summaryrefslogtreecommitdiff
path: root/sqlbox
diff options
context:
space:
mode:
authorBenjamin Franzke <benjaminfranzke@googlemail.com>2013-01-27 12:40:13 +0100
committerBenjamin Franzke <benjaminfranzke@googlemail.com>2013-01-27 12:49:09 +0100
commit03f2cab8ffbc20e1d04b342ac8b635bf1a24c894 (patch)
treee2ae9eeda8b973bdad5ba6a56e2e6ff1f9e289bb /sqlbox
parentfe210b5ccf1dbb899b8c31002af5bbb13e1b5e59 (diff)
downloadsqltutor-plugin-03f2cab8ffbc20e1d04b342ac8b635bf1a24c894.tar.gz
sqltutor-plugin-03f2cab8ffbc20e1d04b342ac8b635bf1a24c894.tar.bz2
sqltutor-plugin-03f2cab8ffbc20e1d04b342ac8b635bf1a24c894.zip
reportall: Order results by id
Diffstat (limited to 'sqlbox')
-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)