Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Class difficulties are saved as strings #3708

Open
willgearty opened this issue Jan 17, 2024 · 1 comment
Open

Class difficulties are saved as strings #3708

willgearty opened this issue Jan 17, 2024 · 1 comment

Comments

@willgearty
Copy link
Member

The options for a class's difficulty is set by the global "teacherreg_difficulty_choices" tag. This tag is basically an ordered dictionary consisting of rankings/abbreviations (keys) and their descriptions (values). During class creation/editing, only the descriptions are shown, but the chosen key is saved as a string. This key is then shown on the course catalog and during student registration. However, this presents several problems:

  1. The difficulty description is never shown outside of teacher registration (as far as I can tell). This means that students can only infer what the difficulty is based on the abbreviation. The default for this is some number of stars, but it's unclear to students how many stars is the max, etc.
  2. When the choices tag is changed, this can possibly invalidate all course registration forms because the old chosen strings are no longer valid options. This similarly causes the difficulty filter on the course catalog to break (because the new options that are populated into the filter dropdown don't match the strings in the catalog).

I'm not too sure what the fix for this should be. Here are some possible options:

  • We could have "difficulty option" model objects like we have flag categories which can be added and removed to individual programs? They would need to have an order such that they are listed in order in the course reg form and catalog filter dropdowns. But how do we backport this behavior to existing difficulty settings for existing classes? We could find all unique difficulty strings and add those as objects in a migration?
  • We could force the tag to just be a list, but then we save the list index for the difficulty field. When we render the course in the catalog, we use the value at that list index. Unfortunately, this doesn't completely solve the tag change issues because the tag length could be shortened, causing the same problems. This would also have the problem related to backporting.
  • Maybe we are fine with the current behavior regarding invalidating the reg form, and all we really need to fix is the catalog filter? Instead of using the choices tag, we could pull all unique difficulties from the classes in the catalog (although the entire page is cached which could be an issue), then just sort them alphanumerically? Although this still presents the issue where descriptions are never shown to students.
@willgearty
Copy link
Member Author

@kkbrum brought this up and probably has thoughts.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants