From 78780e9fc7a7663e0a3865bb7fd475eecde24750 Mon Sep 17 00:00:00 2001 From: Benjamin Franzke Date: Thu, 14 Feb 2013 10:16:32 +0100 Subject: report: Rewrite to be able to query reports from a mysql moodle backend --- sqlbox/report.php | 9 ++++++--- 1 file 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 ''; $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); -- cgit