diff options
| author | Elmar Ludwig <elmar.ludwig@uni-osnabrueck.de> | 2026-02-18 12:22:13 +0100 |
|---|---|---|
| committer | Elmar Ludwig <elmar.ludwig@uni-osnabrueck.de> | 2026-02-18 12:22:13 +0100 |
| commit | f87679a9d8ef2ea25526897da8aa761287cacabc (patch) | |
| tree | 3b99c6f94f8e84312e570958e5804f3b78a81203 | |
| parent | 2cf137042a708d49022ac90852d799b9123810c2 (diff) | |
order responses by autoincrement id instead of mkdate, fixes #6001
Closes #6001
Merge request studip/studip!4743
| -rw-r--r-- | app/controllers/vips/solutions.php | 2 | ||||
| -rw-r--r-- | lib/models/vips/VipsAssignment.php | 10 |
2 files changed, 6 insertions, 6 deletions
diff --git a/app/controllers/vips/solutions.php b/app/controllers/vips/solutions.php index aa8b02d..fe514a5 100644 --- a/app/controllers/vips/solutions.php +++ b/app/controllers/vips/solutions.php @@ -2449,7 +2449,7 @@ class Vips_SolutionsController extends AuthenticatedController seminar_user.status IS NULL OR seminar_user.status NOT IN ('dozent', 'tutor') ) - ORDER BY etask_responses.mkdate DESC"; + ORDER BY etask_responses.id DESC"; $result = $db->prepare($sql); $result->execute([$course_id, $assignment_id]); diff --git a/lib/models/vips/VipsAssignment.php b/lib/models/vips/VipsAssignment.php index 0c84106..9f89836 100644 --- a/lib/models/vips/VipsAssignment.php +++ b/lib/models/vips/VipsAssignment.php @@ -950,7 +950,7 @@ class VipsAssignment extends SimpleORMap AND group_id = ? AND start < ? AND (end > ? OR end IS NULL) - ORDER BY mkdate DESC', + ORDER BY id DESC', [$exercise_id, $this->id, $group_id, $this->end, $this->end] ); } @@ -965,7 +965,7 @@ class VipsAssignment extends SimpleORMap public function getArchivedUserSolutions(string $user_id, int $exercise_id): array { return VipsSolution::findBySQL( - 'task_id = ? AND assignment_id = ? AND user_id = ? ORDER BY mkdate DESC', + 'task_id = ? AND assignment_id = ? AND user_id = ? ORDER BY id DESC', [$exercise_id, $this->id, $user_id] ); } @@ -1000,7 +1000,7 @@ class VipsAssignment extends SimpleORMap AND group_id = ? AND start < ? AND (end > ? OR end IS NULL) - ORDER BY mkdate DESC', + ORDER BY id DESC', [$exercise_id, $this->id, $group_id, $this->end, $this->end] ); } @@ -1013,7 +1013,7 @@ class VipsAssignment extends SimpleORMap public function getUserSolution(string $user_id, int $exercise_id): ?VipsSolution { return VipsSolution::findOneBySQL( - 'task_id = ? AND assignment_id = ? AND user_id = ? ORDER BY mkdate DESC', + 'task_id = ? AND assignment_id = ? AND user_id = ? ORDER BY id DESC', [$exercise_id, $this->id, $user_id] ); } @@ -1117,7 +1117,7 @@ class VipsAssignment extends SimpleORMap $user_ids = [$user_id]; } - $solutions = $this->solutions->findBy('user_id', $user_ids)->orderBy('mkdate'); + $solutions = $this->solutions->findBy('user_id', $user_ids)->orderBy('id'); $points = []; foreach ($solutions as $solution) { |
