Gitlab Community Edition Instance

Skip to content
Snippets Groups Projects
Commit 1dc5803c authored by Dominik Seeger's avatar Dominik Seeger :ghost:
Browse files

fixed some issues regarding assignments and single correction mode

- tutors no longer need an assignment when in exercise mode
- all feedback is always final when in single correction mode
parent dedbc4df
No related branches found
Tags 5.1.7
1 merge request!241Resolve "Tutors have issues while setting feedback on the participants page"
Pipeline #136234 passed
......@@ -122,6 +122,11 @@ class FeedbackSerializer(DynamicFieldsModelSerializer):
if labels is not None:
comment_instance.labels.set(labels)
# Set all feedback final for when single correction is active
if config.SINGLE_CORRECTION:
feedback.is_final = True
validated_data['is_final'] = True
return super().update(feedback, validated_data)
def validate_of_submission(self, submission):
......
......@@ -13,7 +13,9 @@ class NoAssignmentForTutor(Exception):
def tutor_attempts_to_patch_first_feedback_final(feedback_serializer,
user,
assignment=None):
if user.role == models.UserAccount.REVIEWER:
# override assignment logic in exercise mode
if user.role == models.UserAccount.REVIEWER \
or user.role == models.UserAccount.TUTOR and config.EXERCISE_MODE:
return False
if user.role == models.UserAccount.TUTOR and assignment is None:
raise NoAssignmentForTutor()
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment