summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBenjamin Franzke <benjaminfranzke@googlemail.com>2013-01-30 14:50:04 +0100
committerBenjamin Franzke <benjaminfranzke@googlemail.com>2013-01-30 14:54:08 +0100
commita3eb8b3f0be1154b1f59ce67648abe74228c56f2 (patch)
treef6c01d16a903785a284ad749ac80b8f282a2bc10
parent0e577b48ff53065fd337f796ce8a3f7cd4cd59c4 (diff)
downloadsqltutor-plugin-a3eb8b3f0be1154b1f59ce67648abe74228c56f2.tar.gz
sqltutor-plugin-a3eb8b3f0be1154b1f59ce67648abe74228c56f2.tar.bz2
sqltutor-plugin-a3eb8b3f0be1154b1f59ce67648abe74228c56f2.zip
reportall: Show users progress
-rw-r--r--doc/documentation.txt4
-rw-r--r--sqlbox/reportall.php13
2 files changed, 11 insertions, 6 deletions
diff --git a/doc/documentation.txt b/doc/documentation.txt
index aed3fe7..9ed9782 100644
--- a/doc/documentation.txt
+++ b/doc/documentation.txt
@@ -79,10 +79,10 @@ Der die SQL-Anfrage der Muterloesung sowie die des Studenten werden beide
nacheinander auf einer Realen PostgreSQL-Datenbank ausgefuert.
Die dabei entstehenden Antworten werden verglichen und bei Uebereinstimmung gilt
gilt diese Aufgabe fuer den Studenten als Bestanden.
-Der Tutor kann den Lernsoftschritt aller Studenten Anhand einer
+Der Tutor kann den Lernsoftschritt aller Studenten anhand einer
Uebersichtstabelle verfolgen.
In dieser Tabelle werden alle SQLBox-Aufgaben sowie alle Bentzer einander
-gegenueber gestellt.
+gegenueber gestellt und zusätzlich der Gesamtfortschritt pro Benutzer angezeigt.
=== Das Test-Szenario
diff --git a/sqlbox/reportall.php b/sqlbox/reportall.php
index 2e002b4..c3a2813 100644
--- a/sqlbox/reportall.php
+++ b/sqlbox/reportall.php
@@ -44,8 +44,8 @@ foreach ($boxes as $box)
$b[$box->id] = $box->name;
$table = new html_table;
-$table->head = array_merge(array("Nutzer"), $b);
-$table->align = array_merge(array("left"), array_fill(0, count($b), 'center'));
+$table->head = array_merge(array("Nutzer", "Fortschritt"), $b);
+$table->align = array_merge(array("left", "left"), array_fill(0, count($b), 'center'));
$users = $DB->get_records("user", array('deleted'=>'0'));
foreach ($users as $user) {
@@ -60,10 +60,15 @@ foreach ($users as $user) {
ON s.id = sol.sqlboxid ORDER BY s.id",
array('id'=>$user->id));
$s = array();
- foreach ($solutions as $solution)
+ $progress = 0;
+ foreach ($solutions as $solution) {
$s[$solution->id] = ($solution->correct == '1') ? '☑' : ($solution->correct == '0' ? '☒' : '☐');
+ if ($solution->correct == '1')
+ $progress++;
+ }
+ $progress /= count($s);
- $table->data[] = array_merge(array($name), $s);
+ $table->data[] = array_merge(array($name, round($progress * 100) . "%"), $s);
}
echo html_writer::table($table);