Skip to content

Commit

Permalink
3.61.0 stable version
Browse files Browse the repository at this point in the history
  • Loading branch information
mcagigas-at-wiris authored Feb 6, 2018
1 parent 8940a60 commit c4b603d
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 19 deletions.
9 changes: 4 additions & 5 deletions question.php
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,9 @@ public function apply_attempt_state(question_attempt_step $step) {
// This is a regrade because is the only case where this function is
// called with the first step instead of start_attempt. So invalidate
// cached matching answers.
$subquestion->step->set_var('_response_hash', '0');
if ($subquestion->step->is_first_step()) {
$subquestion->step->set_var('_response_hash', '0');
}
}
}
}
Expand Down Expand Up @@ -212,10 +214,7 @@ private function set_shortanswer_matching_answers(array $response) {
$substep = $this->get_substep(null, $i);
$subresp = $substep->filter_array($response);
$subresphash = md5($subresp['answer']);
// This is a regrade because is the only case where this function is
// called with the first step instead of start_attempt. So invalidate
// cached matching answers.
$subquestion->step->set_var('_response_hash', '0');
$subquestion->step->set_var('_response_hash', $subresphash, true);
$subquestion->step->set_var('_matching_answer', $matchinganswerid, true);
$numsubq++;
}
Expand Down
13 changes: 2 additions & 11 deletions questiontype.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,17 +28,8 @@ public function __construct() {
public function save_question_options($question) {
global $DB;

// Delete old subquestions. The Moodle implementation is somewhat more
// efficient because it reuses the questions, but we do that way so we
// can call base method.

$oldidsseq = $DB->get_field('question_multianswer', 'sequence', array('question' => $question->id));
if (!empty($oldidsseq)) {
$oldids = explode(',', $oldidsseq);
foreach ($oldids as $id) {
question_delete_question($id);
}
}
// We don't delete old subquestions because it cause
// a new ids on BD that throw error on regrade.
parent::save_question_options($question);
}

Expand Down
6 changes: 3 additions & 3 deletions version.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,11 @@

defined('MOODLE_INTERNAL') || die();

$plugin->version = 2017121200;
$plugin->release = '3.59.0.1031';
$plugin->version = 2018020600;
$plugin->release = '3.61.0.1034';
$plugin->requires = 2011060313;
$plugin->maturity = MATURITY_STABLE;
$plugin->component = 'qtype_multianswerwiris';
$plugin->dependencies = array (
'qtype_wq' => 2017121200
'qtype_wq' => 2018020600
);

0 comments on commit c4b603d

Please sign in to comment.