-
Notifications
You must be signed in to change notification settings - Fork 147
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
Dropped Courses #2262
base: main
Are you sure you want to change the base?
Dropped Courses #2262
Conversation
6545c8d
to
9ea80f3
Compare
d91a83b
to
2f42c54
Compare
2f42c54
to
e2e836e
Compare
evap/evaluation/models.py
Outdated
Questionnaire.objects.active_dropout_questionnaire().update(is_active_dropout_questionnaire=False) | ||
self.is_active_dropout_questionnaire = True | ||
self.save() | ||
# TODO@Felix: why does this not work [wip] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think the (unique=True, blank=True, null=True) tri-state approach forces us to have at most one instance with value True
and all other instance with value None
/NULL
. The update above sets it to False
, which would give it a unique validation failure. Guess that's one issue here
@@ -162,6 +163,12 @@ def general_questionnaires(self): | |||
def contributor_questionnaires(self): | |||
return super().get_queryset().filter(type=Questionnaire.Type.CONTRIBUTOR) | |||
|
|||
def dropout_questionnaires(self): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If you're touching these and it's no trouble, it would probably be nice if you could also add the return type annotation (-> QuerySet[Questionnaire]
or whatever it should be)
(same for the views below that return HttpResponse
. It's a bit annoying, but for backwards compatibility, no annotation always means "Any", even if the method always returns some specific type. I wonder if mypy issue 4409 will one day be implemented.)
evap/evaluation/models.py
Outdated
if self.type != Questionnaire.Type.DROPOUT: | ||
raise ValueError("Can only set DROPOUT-type Questionnaires as active dropout questionnaire.") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
probably fair to just use an assertion -- or do we expect this to ever happen for a correct program execution?
c24d5dd
to
178fc31
Compare
0c1711f
to
2f3043b
Compare
dc783bf
to
96e9dc7
Compare
1fa6eb3
to
5a312ec
Compare
2cb0daf
to
cfcf4fd
Compare
{% blocktranslate %} | ||
If you mark this course as dropped, you can still give feedback like normal, but your answers will only | ||
be visible to contributors. | ||
{% endblocktranslate %} | ||
<br> | ||
{% blocktranslate %} | ||
You will not be able to vote for this course afterwards. | ||
{% endblocktranslate %} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this would be fine
{% blocktranslate %} | |
If you mark this course as dropped, you can still give feedback like normal, but your answers will only | |
be visible to contributors. | |
{% endblocktranslate %} | |
<br> | |
{% blocktranslate %} | |
You will not be able to vote for this course afterwards. | |
{% endblocktranslate %} | |
{% blocktranslate %} | |
If you mark this course as dropped, you will still be able to provide feedback as usual. However, you can only submit the questionnaire once. | |
{% endblocktranslate %} |
The typing HttpRequest also allows for AnonymousUser as request.user. In the future, we probably should add a custom HttpRequest class that correctly states that request.user must be a UserProfile.
cfcf4fd
to
0f5c592
Compare
fixes #991
(@janno42) As discussed, we want:
A setting "DROPOUT_QUESTIONNAIRE_ID" to set which questionnaire should be shown when using the drop-out function.