Skip to content
Snippets Groups Projects
Commit 6639b372 authored by Elmar Ludwig's avatar Elmar Ludwig
Browse files

don't update end time to past values, fixes #111

parent c8d41e86
No related branches found
No related tags found
No related merge requests found
......@@ -1512,7 +1512,7 @@ class SheetsController extends StudipController
// extend exam duration for already active participants
if ($assignment_type === 'exam' && $assignment->options['duration'] != $exam_length) {
$sql = 'UPDATE vips_assignment_attempt SET end = end + INTERVAL ? MINUTE
$sql = 'UPDATE vips_assignment_attempt SET end = GREATEST(end + INTERVAL ? MINUTE, NOW())
WHERE assignment_id = ? AND end > NOW()';
$stmt = $db->prepare($sql);
$stmt->execute([$exam_length - $assignment->options['duration'], $assignment_id]);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment