summaryrefslogtreecommitdiff
path: root/sqlbox/reportall.php
diff options
context:
space:
mode:
Diffstat (limited to 'sqlbox/reportall.php')
-rw-r--r--sqlbox/reportall.php12
1 files changed, 6 insertions, 6 deletions
diff --git a/sqlbox/reportall.php b/sqlbox/reportall.php
index b11a422..e6a6dab 100644
--- a/sqlbox/reportall.php
+++ b/sqlbox/reportall.php
@@ -6,9 +6,9 @@ require_once(dirname(__FILE__).'/lib.php');
$id = required_param('id', PARAM_INT); //moduleid
if ($id) {
- $cm = get_coursemodule_from_id('sqlbox', $id, 0, false, MUST_EXIST);
- $course = $DB->get_record('course', array('id' => $cm->course), '*', MUST_EXIST);
- $sqlbox = $DB->get_record('sqlbox', array('id' => $cm->instance), '*', MUST_EXIST);
+ $cm = get_coursemodule_from_id('sqlbox', $id, 0, false, MUST_EXIST);
+ $course = $DB->get_record('course', array('id' => $cm->course), '*', MUST_EXIST);
+ $sqlbox = $DB->get_record('sqlbox', array('id' => $cm->instance), '*', MUST_EXIST);
} else {
print_error('invalidcourse');
}
@@ -44,14 +44,14 @@ foreach ($users as $user) {
$name = $user->firstname.' '.$user->lastname;
$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
+ FROM {sqlbox} s LEFT JOIN (
+ SELECT sqlboxid,correct FROM {sqlbox_solutions} WHERE userid=:id) as sol
ON s.id = sol.sqlboxid",
array('id'=>$user->id));
$s = array();
foreach ($solutions as $solution)
$s[$solution->id] = ($solution->correct == 1) ? '☑' : '☒';
-
+
$table->data[] = array_merge(array($name), $s);
}