diff --git a/edit_wq_form.php b/edit_wq_form.php
index 60ad939d..8074ae0f 100644
--- a/edit_wq_form.php
+++ b/edit_wq_form.php
@@ -55,10 +55,10 @@ protected function definition_inner($mform) {
$mform->addElement('hidden', 'wirislang', current_language(), array('class' => 'wirislang'));
$mform->setType('wirislang', PARAM_TEXT);
- // TODO: Delete this if when all questions are wq!
if (isset($this->question->wirisquestion)) {
$program = $this->question->wirisquestion->serialize();
} else {
+ // If the wirisquestion is not already loaded in memory, load it from the DB directly.
if (empty($this->question->id)) {
// New question.
$program = '';
@@ -66,12 +66,13 @@ protected function definition_inner($mform) {
// Existing question.
$wiris = $DB->get_record('qtype_wq', array('question' => $this->question->id));
if (empty($wiris)) {
- // Corrupted question
- $corruptwarning = $mform->createElement('html', '
' . get_string('corruptquestion_edit', 'qtype_wq') .'
createElement('html', '' . get_string('corruptquestion_edit', 'qtype_wq') . '
insertElementBefore($corruptwarning, 'generalheader');
$program = '';
} else {
- // Happy path
+ // Question found in the DB.
$program = $wiris->xml;
}
}
@@ -90,7 +91,6 @@ protected function definition_inner($mform) {
$defaultvalues = array();
$defaultvalues['wirisquestion'] = $program;
$mform->setDefaults($defaultvalues);
-
}
public function set_data($question) {
$this->base->set_data($question);
diff --git a/question.php b/question.php
index da95af3b..3b760038 100644
--- a/question.php
+++ b/question.php
@@ -46,7 +46,7 @@ class qtype_wq_question extends question_graded_automatically {
/**
* @var bool
- * Whether this question is corrupt and its wirisquestion was removed from the database.
+ * Whether this question is corrupt and its wirisquestion was removed from the database.
*/
public $corrupt = false;
@@ -371,7 +371,7 @@ public function call_wiris_service($request) {
$service = $builder->getQuizzesService();
$isdebugmodeenabled = get_config('qtype_wq', 'debug_mode_enabled') == '1';
- $islogmodeenabled = get_config('qtype_wq', 'log_server_errors') == '1';
+ $islogmodeenabled = get_config('qtype_wq', 'log_server_errors') == '1';
if ($isdebugmodeenabled) {
// @codingStandardsIgnoreLine
diff --git a/questiontype.php b/questiontype.php
index 98273526..181e35b9 100644
--- a/questiontype.php
+++ b/questiontype.php
@@ -101,9 +101,9 @@ protected function make_question_instance($questiondata) {
protected function initialise_question_instance(question_definition $question, $questiondata) {
global $CFG;
- /** @var qtype_wq_question $question */
$this->base->initialise_question_instance($question->base, $questiondata);
+ /** @var qtype_wq_question $question */
$question->id = &$question->base->id;
$question->idnumber = &$question->base->idnumber;
$question->category = &$question->base->category;
diff --git a/step.php b/step.php
index ec35f895..2460deeb 100644
--- a/step.php
+++ b/step.php
@@ -247,14 +247,14 @@ public function is_attempt_limit_reached() {
$isreached = $c >= self::MAX_ATTEMPS_SHORTANSWER_WIRIS;
- $islogmodeenabled = get_config('qtype_wq', 'log_server_errors') == '1';
+ $islogmodeenabled = get_config('qtype_wq', 'log_server_errors') == '1';
if ($islogmodeenabled) {
- $errormessage = 'WIRISQUIZZES ATTEMPT LIMIT REACHED FOR STEP WITH ID ' .
- ($this->step != null ? $this->step->get_id() : $this->stepid);
+ $errormessage = 'WIRISQUIZZES ATTEMPT LIMIT REACHED FOR STEP WITH ID ' .
+ ($this->step != null ? $this->step->get_id() : $this->stepid);
// @codingStandardsIgnoreLine
- error_log($errormessage);
+ error_log($errormessage);
}
-
+
return $isreached;
}
@@ -267,13 +267,13 @@ public function inc_attempts(moodle_exception $e) {
$c = 0;
}
- $islogmodeenabled = get_config('qtype_wq', 'log_server_errors') == '1';
+ $islogmodeenabled = get_config('qtype_wq', 'log_server_errors') == '1';
if ($islogmodeenabled) {
- $errormessage = 'WIRISQUIZZES ATTEMPT ERROR --- INCREASING ATTEMPT COUNT TO ' . ($c + 1) . ' FOR STEP WITH ID ' .
- ($this->step != null ? $this->step->get_id() : $this->stepid) . PHP_EOL .
- 'EXCEPTION: ' . $e->getMessage();
+ $errormessage = 'WIRISQUIZZES ATTEMPT ERROR --- INCREASING ATTEMPT COUNT TO ' . ($c + 1) . ' FOR STEP WITH ID ' .
+ ($this->step != null ? $this->step->get_id() : $this->stepid) . PHP_EOL .
+ 'EXCEPTION: ' . $e->getMessage();
// @codingStandardsIgnoreLine
- error_log($errormessage);
+ error_log($errormessage);
}
$this->set_var('_gc', $c + 1, false);
diff --git a/styles.css b/styles.css
index d67a1e2c..445406e3 100644
--- a/styles.css
+++ b/styles.css
@@ -1,15 +1,19 @@
body.wrs_plugin.wrs_filter {
font-family: Arial;
}
+
span.wrs_plugin.wrs_filter {
font-weight: bold;
}
+
span.ok.wrs_plugin.wrs_filter {
color: #090;
}
+
span.error.wrs_plugin.wrs_filter {
color: #d00;
}
+
table.wrs_plugin.wrs_filter,
th.wrs_plugin.wrs_filter,
td.wrs_plugin.wrs_filter,
@@ -18,9 +22,11 @@ tr.wrs_plugin.wrs_filter {
border-collapse: collapse;
padding: 5px;
}
+
th.wrs_plugin.wrs_filter {
background-color: #eee;
}
+
img.wrs_plugin.wrs_filter {
border: none;
-}
+}
\ No newline at end of file