From a278371368e6ece009bd62504788898ae256d868 Mon Sep 17 00:00:00 2001 From: Benjamin Franzke Date: Fri, 25 Jan 2013 09:25:23 +0100 Subject: Fix coding style --- sqlbox/locallib.php | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) (limited to 'sqlbox/locallib.php') 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 -- cgit