summaryrefslogtreecommitdiff
path: root/sqlbox/report.php
diff options
context:
space:
mode:
authorBenjamin Franzke <benjaminfranzke@googlemail.com>2013-02-14 10:16:32 +0100
committerBenjamin Franzke <benjaminfranzke@googlemail.com>2013-02-14 10:21:33 +0100
commit78780e9fc7a7663e0a3865bb7fd475eecde24750 (patch)
treef89083d022ee4728f3c2418b2b191897654e19eb /sqlbox/report.php
parent7d426fbdca2a5eaf53f1e7cdf71d656edb8ddb19 (diff)
downloadsqltutor-plugin-78780e9fc7a7663e0a3865bb7fd475eecde24750.tar.gz
sqltutor-plugin-78780e9fc7a7663e0a3865bb7fd475eecde24750.tar.bz2
sqltutor-plugin-78780e9fc7a7663e0a3865bb7fd475eecde24750.zip
report: Rewrite to be able to query reports from a mysql moodle backend
Diffstat (limited to 'sqlbox/report.php')
-rw-r--r--sqlbox/report.php9
1 files changed, 6 insertions, 3 deletions
diff --git a/sqlbox/report.php b/sqlbox/report.php
index 02dabef..7d9904c 100644
--- a/sqlbox/report.php
+++ b/sqlbox/report.php
@@ -34,8 +34,9 @@ echo '</div>';
$sql = "SELECT
u.id,
- translate(to_char(s.correct, 'FM9'), '01', '☒☑'),
- (u.firstname || ' ' || u.lastname),
+ s.correct,
+ u.firstname,
+ u.lastname,
s.query
FROM {user} u, {sqlbox_solutions} s
WHERE
@@ -47,7 +48,9 @@ $table->head = array("Lösung", "Nutzer", "Anfrage");
$table->align = array("center", "left", "left");
if ($records) {
foreach ($records as $record)
- $table->data[] = array_slice((array)$record, 1);
+ $table->data[] = array($record->correct == 1 ? '☑' : '☒',
+ $record->firstname." ".$record->lastname,
+ $record->query);
}
echo html_writer::table($table);