Skip to content

Commit

Permalink
Merge branch 'wip-MDL-55154-30' of git://github.com/abgreeve/moodle i…
Browse files Browse the repository at this point in the history
…nto MOODLE_30_STABLE
  • Loading branch information
danpoltawski committed Jul 11, 2016
2 parents eb0ac9c + 40e1059 commit 01a64e0
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion mod/lesson/pagetypes/numerical.php
Expand Up @@ -79,6 +79,10 @@ public function check_answer() {
$data = $mform->get_data();
require_sesskey();

$formattextdefoptions = new stdClass();
$formattextdefoptions->noclean = true;
$formattextdefoptions->para = false;

// set defaults
$result->response = '';
$result->newpageid = 0;
Expand All @@ -93,6 +97,7 @@ public function check_answer() {
$result->studentanswer = $result->userresponse = $result->useranswer;
$answers = $this->get_answers();
foreach ($answers as $answer) {
$answer = parent::rewrite_answers_urls($answer);
if (strpos($answer->answer, ':')) {
// there's a pairs of values
list($min, $max) = explode(':', $answer->answer);
Expand All @@ -105,7 +110,7 @@ public function check_answer() {
}
if (($result->useranswer >= $minimum) && ($result->useranswer <= $maximum)) {
$result->newpageid = $answer->jumpto;
$result->response = trim($answer->response);
$result->response = format_text($answer->response, $answer->responseformat, $formattextdefoptions);
if ($this->lesson->jumpto_is_correct($this->properties->id, $result->newpageid)) {
$result->correctanswer = true;
}
Expand Down

0 comments on commit 01a64e0

Please sign in to comment.