Skip to content

Commit

Permalink
Merge branch 'MDL-31521-master' of https://github.com/lucaboesch/moodle
Browse files Browse the repository at this point in the history
  • Loading branch information
David Monllao committed Dec 18, 2017
2 parents 10d22cc + e00e36f commit f71a499
Showing 1 changed file with 9 additions and 5 deletions.
14 changes: 9 additions & 5 deletions question/type/calculated/questiontype.php
Expand Up @@ -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);
Expand Down

0 comments on commit f71a499

Please sign in to comment.