summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--sqlbox/reportall.php4
1 files changed, 2 insertions, 2 deletions
diff --git a/sqlbox/reportall.php b/sqlbox/reportall.php
index 035dfe8..41c6d78 100644
--- a/sqlbox/reportall.php
+++ b/sqlbox/reportall.php
@@ -27,7 +27,7 @@ $PAGE->set_context($context);
echo $OUTPUT->header();
-$boxes = $DB->get_records("sqlbox");
+$boxes = $DB->get_records_sql("SELECT * FROM {sqlbox} ORDER BY id");
$b = array();
foreach ($boxes as $box)
$b[$box->id] = $box->name;
@@ -46,7 +46,7 @@ foreach ($users as $user) {
$solutions = $DB->get_records_sql("SELECT s.id, sol.correct
FROM {sqlbox} s LEFT JOIN (
SELECT sqlboxid,correct FROM {sqlbox_solutions} WHERE userid=:id) as sol
- ON s.id = sol.sqlboxid",
+ ON s.id = sol.sqlboxid ORDER BY s.id",
array('id'=>$user->id));
$s = array();
foreach ($solutions as $solution)