Permalink
Browse files

Merge branch 'MDL-31521-34' of https://github.com/lucaboesch/moodle i…

…nto MOODLE_34_STABLE
  • Loading branch information...
dmonllao committed Dec 18, 2017
2 parents 2faa795 + b35acd2 commit b85ec901dd380707246faec2d1851b21fcace4c4
Showing with 9 additions and 5 deletions.
  1. +9 −5 question/type/calculated/questiontype.php
@@ -1054,11 +1054,15 @@ public function comment_on_datasetitems($qtypeobj, $questionid, $questiontext,
$comment->outsidelimit = false;
$comment->answers = array();
// Find a default unit.
if (!empty($questionid) && $unit = $DB->get_record('question_numerical_units',
array('question' => $questionid, 'multiplier' => 1.0))) {
$unit = $unit->unit;
} else {
$unit = '';
$unit = '';
if (!empty($questionid)) {
$units = $DB->get_records('question_numerical_units',
array('question' => $questionid, 'multiplier' => 1.0),
'id ASC', '*', 0, 1);
if ($units) {
$unit = reset($units);
$unit = $unit->unit;
}
}
$answers = fullclone($answers);

0 comments on commit b85ec90

Please sign in to comment.