-
Notifications
You must be signed in to change notification settings - Fork 167
Non-counting questions #2450
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
Open
jooooosef
wants to merge
57
commits into
e-valuation:main
Choose a base branch
from
jooooosef:iss2391
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Non-counting questions #2450
Changes from all commits
Commits
Show all changes
57 commits
Select commit
Hold shift + click to select a range
75b282a
fix allows additional textanswers saving bug
jooooosef c077bf6
added counts for grade on staff side
jooooosef 178b77a
counts for grade on student side
jooooosef 68d227c
implement questions not being counted for grade calculation
jooooosef 2a830cb
add db contraint for counts_for_grade
jooooosef 15887a1
add tests to improve coverage
jooooosef a78c9b9
minor review changes
jooooosef 374c48b
more minor review changes
jooooosef 5ffe1e9
fix migration naming
jooooosef 45e373b
coding style
jooooosef 395fae1
fix bug
jooooosef 265c4b4
fix migations naming and update test_data
jooooosef 4322823
extend test_data.json with more non counting questions
jooooosef 6d3b054
fixup! add tests to improve coverage
jooooosef 5449094
fixup! fix bug
jooooosef 1f9f10a
remove unnessary defaults
jooooosef 64cca89
fix migration naming
jooooosef fc8b6c3
fix test_data
jooooosef 95e172d
fixup! fix migration naming
jooooosef b1137b9
implement dropped course not counting for grade
jooooosef 3972951
fix migration naming
jooooosef 6fa978f
fix saving with extra row
jooooosef be83197
fixup! implement dropped course not counting for grade
jooooosef 5d8925b
fixup! fixup! implement dropped course not counting for grade
jooooosef 32b69d0
fixup! fixup! implement dropped course not counting for grade
jooooosef 887dbaf
add tests for dropout questionnaires
jooooosef dd39abb
make migration and tests better
jooooosef ba8ee0f
fix display bug
jooooosef d2e4284
fix migration naming
jooooosef 141fb5c
format
jooooosef 9f2e32b
fix display error again
jooooosef 5bec147
move questionnaire and question type select change handlng to seperat…
jooooosef 919ad19
use helper functions
jooooosef 252af0c
improve code quality
jooooosef 5d50f74
introduce helper functions to disable/enable and check/uncheck checkb…
jooooosef b77fa33
refactor QuestionForm initialization and move checkbox disabling to f…
jooooosef 0bd6eb4
clean up code
jooooosef 8b9e9c7
clean up staff-questionnaire form ts
jooooosef 0d68697
fix migration to use exact same contraint logic
jooooosef babf328
deduplicate code and make more readable
jooooosef a9f2402
refactor event listener to use delegation on table
jooooosef 75ae977
add live tests for staff questionnaire edit form
jooooosef 2734028
remove old non working tests
jooooosef 72183ca
add regression test for #2539
jooooosef 00045f7
format
jooooosef 4a0b8b3
fix migration naming
jooooosef d55e3a2
add tests for handling dropout questionnaires in distribution calcula…
jooooosef a64383d
improve code quality and readability
jooooosef 6b5b471
fix migration naming
jooooosef 5ae44bb
add helper function for question checkbox logic assertions
jooooosef 7708486
move helper for tomselect to LiveServerTest class
jooooosef c301bc3
fix some tests so they look better
jooooosef f6131b4
remove duplicated test
jooooosef 2f88eee
UX improvements and code cleanup
jooooosef 280cd08
fix migration naming
jooooosef d1aa2b4
fix naming
jooooosef ebf01a2
disable checkboxes with template and add test
jooooosef File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
42 changes: 42 additions & 0 deletions
42
evap/evaluation/migrations/0161_question_counts_for_grade.py
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,42 @@ | ||
| # Generated by Django 5.2 on 2025-05-12 21:30 | ||
|
|
||
| from django.db import migrations, models | ||
| from django.db.models import Q | ||
|
|
||
| TEXT = 0 | ||
| HEADING = 5 | ||
| DROPOUT_QUESTIONNAIRE = 5 | ||
|
|
||
|
|
||
| def set_initial_values(apps, _schema_editor): | ||
| Question = apps.get_model("evaluation", "Question") | ||
|
|
||
| Question.objects.filter(Q(type__in=[TEXT, HEADING]) | Q(questionnaire__type=DROPOUT_QUESTIONNAIRE)).update( | ||
| counts_for_grade=False | ||
| ) | ||
|
|
||
|
|
||
| class Migration(migrations.Migration): | ||
| dependencies = [ | ||
| ("evaluation", "0160_evaluation_staff_notes"), | ||
| ] | ||
|
|
||
| operations = [ | ||
| migrations.AddField( | ||
| model_name="question", | ||
| name="counts_for_grade", | ||
| field=models.BooleanField(default=True, verbose_name="counts toward the evaluation's grade"), | ||
| ), | ||
| migrations.RunPython(set_initial_values, reverse_code=migrations.RunPython.noop), | ||
| migrations.AddConstraint( | ||
| model_name="question", | ||
| constraint=models.CheckConstraint( | ||
| condition=models.Q( | ||
| models.Q(("type", TEXT), ("type", HEADING), _connector="OR", _negated=True), | ||
| ("counts_for_grade", False), | ||
| _connector="OR", | ||
| ), | ||
| name="check_evaluation_textanswer_or_heading_question_does_not_count_for_grade", | ||
| ), | ||
| ), | ||
| ] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.