summaryrefslogtreecommitdiff
path: root/sqlbox/locallib.php
diff options
context:
space:
mode:
authorBenjamin Franzke <benjaminfranzke@googlemail.com>2013-01-25 09:25:23 +0100
committerBenjamin Franzke <benjaminfranzke@googlemail.com>2013-01-25 09:25:23 +0100
commita278371368e6ece009bd62504788898ae256d868 (patch)
tree99363223bdb719833e3d5bd99d0578bf1d8c6410 /sqlbox/locallib.php
parenta3d5dfe86e51c71a7b29776f48e107ccd6fabb31 (diff)
downloadsqltutor-plugin-a278371368e6ece009bd62504788898ae256d868.tar.gz
sqltutor-plugin-a278371368e6ece009bd62504788898ae256d868.tar.bz2
sqltutor-plugin-a278371368e6ece009bd62504788898ae256d868.zip
Fix coding style
Diffstat (limited to 'sqlbox/locallib.php')
-rw-r--r--sqlbox/locallib.php28
1 files changed, 14 insertions, 14 deletions
diff --git a/sqlbox/locallib.php b/sqlbox/locallib.php
index 359d5ae..2968e3f 100644
--- a/sqlbox/locallib.php
+++ b/sqlbox/locallib.php
@@ -40,22 +40,22 @@ defined('MOODLE_INTERNAL') || die();
//}
function db_table_from_query($db, $query) {
- global $PAGE;
+ global $PAGE;
- $table = new html_table;
- $result = @pg_query($db, $query);
- if (!$result)
- print_error('queryfailed', 'sqlbox', $PAGE->url, pg_last_error($db));
+ $table = new html_table;
+ $result = @pg_query($db, $query);
+ if (!$result)
+ print_error('queryfailed', 'sqlbox', $PAGE->url, pg_last_error($db));
- $table = new html_table;
- $n = pg_num_fields($result);
- for ($i = 0; $i < $n; $i++)
- $table->head[] = pg_field_name($result, $i);
- $table->align = array_fill(0, $n, 'left');
- while ($row = pg_fetch_row($result))
- $table->data[] = $row;
+ $table = new html_table;
+ $n = pg_num_fields($result);
+ for ($i = 0; $i < $n; $i++)
+ $table->head[] = pg_field_name($result, $i);
+ $table->align = array_fill(0, $n, 'left');
+ while ($row = pg_fetch_row($result))
+ $table->data[] = $row;
- return $table;
+ return $table;
}
function sqlbox_submit_response($query, $sqlbox, $correct, $userid) {
@@ -73,7 +73,7 @@ function sqlbox_submit_response($query, $sqlbox, $correct, $userid) {
}
$newsolution->query = $query;
$newsolution->correct = $correct;
-
+
if ($current)
$DB->update_record("sqlbox_solutions", $newsolution);
else