aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJean-Michel Vedrine <vedrine@vedrine.org>2018-02-04 13:42:14 +0100
committerJean-Michel Vedrine <vedrine@vedrine.org>2018-02-04 13:42:14 +0100
commitfd51725e2ae9ee1a900f14ac7c0f85568880063c (patch)
treec0bfec98f9bc414eb7d6c564503ff40db1527006
parent3ed27511a38532d4f1cfcfe070625bd475acd580 (diff)
Coding style fix to renderer
-rw-r--r--renderer.php15
1 files changed, 5 insertions, 10 deletions
diff --git a/renderer.php b/renderer.php
index a368397..c0955d5 100644
--- a/renderer.php
+++ b/renderer.php
@@ -23,10 +23,8 @@
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
-
defined('MOODLE_INTERNAL') || die();
-
/**
* Generates the output for algebra questions.
*
@@ -38,13 +36,10 @@ class qtype_algebra_renderer extends qtype_renderer {
question_display_options $options) {
global $CFG;
-
$this->page->requires->js_call_amd('qtype_algebra/display', 'init');
$question = $qa->get_question();
-
$currentanswer = $qa->get_last_qt_var('answer');
-
$inputname = $qa->get_qt_field_name('answer');
$nameprefix = str_replace(':', '_', $inputname); // Valid javascript name.
@@ -74,7 +69,7 @@ class qtype_algebra_renderer extends qtype_renderer {
} else {
$inputattributes['class'] = 'algebra_answer';
}
-
+
// Create an array of variable names to use when displaying the function entered.
$vars = array();
if ($question and isset($question->variables)) {
@@ -90,7 +85,7 @@ class qtype_algebra_renderer extends qtype_renderer {
$input = html_writer::empty_tag('input', $inputattributes) . $feedbackimg;
$result = html_writer::tag('div', $questiontext, array('class' => 'qtext'));
-
+
$result .= html_writer::start_tag('div', array('class' => 'ablock'));
$result .= html_writer::start_tag('div', array('class' => 'prompt', 'style' => 'vertical-align: top'));
if (isset($question->answerprefix) and !empty($question->answerprefix)) {
@@ -134,7 +129,7 @@ class qtype_algebra_renderer extends qtype_renderer {
$result .= html_writer::tag('script', $dfname.'();', array('type' => 'text/javascript'));
$result .= html_writer::end_tag('div');
} else {
- $result .= html_writer::tag('div', $varnames ,array(
+ $result .= html_writer::tag('div', $varnames , array(
'type' => 'text',
'name' => $nameprefix . '_vars',
'id' => $nameprefix . '_vars',
@@ -144,8 +139,8 @@ class qtype_algebra_renderer extends qtype_renderer {
);
$display = $question->format_text($question->formated_expression($currentanswer, $vars),
- FORMAT_MOODLE ,$qa, 'question', 'questiontext', $question->id);
- $result .= html_writer::tag('div', $display ,array(
+ FORMAT_MOODLE , $qa, 'question', 'questiontext', $question->id);
+ $result .= html_writer::tag('div', $display , array(
'type' => 'text',
'name' => $nameprefix . '_display',
'id' => $nameprefix. '_display',