Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
0.1.0+2025.01.02T16.11.54.892Z.0ba3c08e.berickson.requirements.cleanup
0.1.0+2025.04.14T14.58.15.3NZ.5aef220.dami.lms.pmss
2 changes: 1 addition & 1 deletion learning_observer/VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
0.1.0+2024.12.20T14.09.00.406Z.257bae3a.master
0.1.0+2025.04.14T14.58.15.3NZ.5aef220.dami.lms.pmss
17 changes: 17 additions & 0 deletions learning_observer/learning_observer/paths.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
import os
import os.path
import sys
import glob


BASE_PATH = os.path.abspath(os.path.dirname(__file__))
Expand Down Expand Up @@ -87,6 +88,22 @@ def config_file():

return pathname

def get_school_config_files():
'''
Return a list of all .yaml config files in the specified directory.
Defaults to a 'configs' folder next to the base path.
'''
school_config_dir = os.path.join(os.path.dirname(base_path()), 'school_configs')

if not os.path.isdir(school_config_dir):
raise FileNotFoundError(f"Config directory not found: {school_config_dir}")

school_config_files = glob.glob(os.path.join(school_config_dir, '*.yaml'))

if not school_config_files:
print(f"No .yaml school configuration files found in: {school_config_dir}")

return school_config_files

DATA_PATH_OVERRIDE = None

Expand Down
10 changes: 9 additions & 1 deletion learning_observer/learning_observer/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,19 @@

import pmss

school_config_paths = learning_observer.paths.get_school_config_files()
school_rulesets = [pmss.YAMLFileRuleset(filename=path) for path in school_config_paths]

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should be transitioning toward the .pmss files for individual schools. Specifically so we can define things like:

roster_data {
  roster_source: google;
}
roster_data[school="middletown_high"] {
  roster_source: canvas;
}
roster_data[school="eastside_west"] {
  roster_source: schoology;
}

We will default to using the Google as our roster source unless the user's school matches "middletown_high" and uses canvas or "eastside_west" and uses schoology.

CSS-like files (like pmss) allow us to define attribute selectors (searching the internet for this term should provide more information) to define these specific rules for different contexts. The yaml files do not have this ability to specify.

Recall that CSS stands for cascading style-sheets meaning that there is some hierarchy of information (this is the cascading portion of the name).

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Abstract this in your mind model to include more context beyond just the school the teacher is at.

Example:
Middletown High uses Canvas for their source. Mr. Johnson at Middletown High teaches an after school program (course id = 12345) where the roster actually comes from a different source like Google. The PMSS file might look something like:

roster_data[school="middletown_high"] {
  roster_source: canvas;
}
roster_data[course_id="12345"] {
  roster_source: google;
}
// OR it might look like:
roster_data[school="middletown_high"][course_id="12345"] {
  roster_source: google;
}

There is another aspect of CSS called specificity where we apply the most specific rules to a given user.

Mr. Johnson when teaching regular classes will use the roster source of Canvas since that's what the school uses, but when he is teaching the after school class, the roster will come from Google instead.


base_ruleset = pmss.YAMLFileRuleset(filename=learning_observer.paths.config_file())

pmss_settings = pmss.init(
prog=__name__,
description="A system for monitoring",
epilog="For more information, see PMSS documentation.",
rulesets=[pmss.YAMLFileRuleset(filename=learning_observer.paths.config_file())]
rulesets=[
base_ruleset,
*school_rulesets
]
)

# If we e.g. `import settings` and `import learning_observer.settings`, we
Expand Down
4 changes: 4 additions & 0 deletions learning_observer/school_configs/school1.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
theme:
server_name: Learning Observer (School 1)
server:
port: 9990
4 changes: 4 additions & 0 deletions learning_observer/school_configs/school2.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
theme:
server_name: Learning Observer (School 2)
server:
port: 9991
Loading