From e8ac0cda8090fcbd128387c75e6cea5f59729a51 Mon Sep 17 00:00:00 2001
From: Elmar Ludwig <elmar.ludwig@uni-osnabrueck.de>
Date: Wed, 15 May 2024 18:16:04 +0200
Subject: [PATCH] also include assignment attempts without solutions, fixes
 #249

---
 controllers/solutions.php | 12 ++++++++++++
 1 file changed, 12 insertions(+)

diff --git a/controllers/solutions.php b/controllers/solutions.php
index d606358..c29663f 100644
--- a/controllers/solutions.php
+++ b/controllers/solutions.php
@@ -2196,6 +2196,18 @@ function get_solutions($assignment, $view)
         }
     }
 
+    // get assignment attempts //
+
+    foreach ($assignment->assignment_attempts as $attempt) {
+        $user_id = $attempt->user_id;
+
+        $solvers[$user_id] = [
+            'type'      => 'single',
+            'id'        => $user_id,
+            'user_id'   => $user_id
+        ];
+    }
+
     // get solutions //
 
     $solutions = [];
-- 
GitLab