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

Adding a new grade type to weights of a subject will delete the other weights and change final grade type #1803

Open
Jonas-Sander opened this issue Jan 14, 2025 · 1 comment
Assignees
Labels
bug Something isn't working. feature: grades Users can add their grades to Sharezone.

Comments

@Jonas-Sander
Copy link
Collaborator

Jonas-Sander commented Jan 14, 2025

Describe the bug

When adding a new grade type (e.g. presentation) to the default weights of a default subject (written exam -> 50%, oral participation -> 50%) then the default weights are deleted and the final grade type of the subject is changed.

Steps to reproduce the bug

  1. Go to the grades page
  2. Tap on the add grade button
  3. Select a grade and grade system (e.g. "2+", "1-6 (+-)")
  4. Select a subject (e.g. "Deutsch")
  5. Create a new term (e.g. "10/2")
  6. Select that term
  7. Create the grade
  8. Tap on the newly created term
  9. Tap on the edit icon of the subject
  10. At "Berechnung der Fachnote" tap on "Neue Gewichtung hinzufügen"
  11. Select a weighting that is not already added, e.g. "Präsentation"
  12. Close the subject settings

Current broken behavior

When opening the subject settings again the

  1. default weightings are gone (written exam -> 50%, oral participation -> 50%)
  2. final grade type has changed (in my example to written exam)

Expected behavior

  1. The default weights should still be there (should they have changed automatically to accomodate the new grade type?).
  2. The final grade type should not have changed

Screenshots, videos or logs

Phone (v2.2.2) Web(v2.2.2)
sharezone.grade.type.bug.phone.mp4
Sharezone.grade.bug.new.grade.type.webm

Tested device

  • App version: 2.2.2

Context

Probably applies to a bug report by a user on discord: https://discord.com/channels/545668860859252746/1232365061717102704/1326862647596945419

@Jonas-Sander Jonas-Sander added bug Something isn't working. feature: grades Users can add their grades to Sharezone. labels Jan 14, 2025
@Jonas-Sander
Copy link
Collaborator Author

I'm still investigating, so far:

It seems like when adding a new grade type weight, the subject WeightType setting is switched from WeightType.inheritFromTerm to WeightType.perGradeType (app/lib/grades/pages/subject_settings_page/subject_settings_page_controller.dart). Since the default grade type weights (written exam: 50%, oral participation: 50%) are coming from the term, after switching to WeightType.perGradeType they are "gone" from the view of the subject. The only weight type there will be the newly added grade type.

So: The UI doesn't update right away to show the switch from the WeightType settings of the term to the subjects. After closing and the re-opening the settings page it is correctly shown that only the grade type has a weight assigned.
What we should probably do is duplicate the weight settings from the term when switching the GradeType setting from WeightType.inheritFromTerm to WeightType.perGradeType.

@Jonas-Sander Jonas-Sander self-assigned this Jan 14, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working. feature: grades Users can add their grades to Sharezone.
Projects
None yet
Development

No branches or pull requests

1 participant