Skip to content

Commit 2c347f8

Browse files
committed
Make sure that a proctored test becomes unproctored when graded by instructor.
When an instructor uses the "Grade Test for" button and the test is on its final submission, currently the grading occurs, but the test is still set as a proctored test. To fix this the condition that determines if the assignment type should be changed needs to check the `$will{recordAnswers}` value in the case that the `$userID` and `$effectiveUserID` are different. In that case `$will{recordAnswers}` is the result of the `can_recordAnswers` method which will be true if either the user has the `record_answers_when_acting_as_student` permission or the user can grade an unsubmitted test. This fixes issue #2962. The `GatewayQuiz.pm` module is really so convoluted at this point that it is really becoming impossible to do anything with, and is in desperate need of a complete overhaul and rewrite. Any time any new feature is added to the module or change is made to the module it is almost impossible to go through all of the possibilities and ensure you haven't broken something.
1 parent 0b1fa1c commit 2c347f8

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

lib/WeBWorK/ContentGenerator/GatewayQuiz.pm

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1245,7 +1245,7 @@ async sub pre_header_initialize ($c) {
12451245
($userID eq $effectiveUserID && !$can{recordAnswersNextTime})
12461246
|| (
12471247
$userID ne $effectiveUserID
1248-
&& $authz->hasPermissions($userID, 'record_answers_when_acting_as_student')
1248+
&& $will{recordAnswers}
12491249
&& $set->attempts_per_version > 0
12501250
&& ($problem->num_correct + $problem->num_incorrect + ($c->{submitAnswers} ? 1 : 0) >=
12511251
$set->attempts_per_version)

0 commit comments

Comments
 (0)