Permalink
Browse files

Merge branch 'MDL-31521-master' of https://github.com/lucaboesch/moodle

  • Loading branch information...
dmonllao committed Dec 18, 2017
2 parents 10d22cc + e00e36f commit f71a4993c76dea5ed979fbff5b3f3dcd28d7a91a
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 f71a499

Please sign in to comment.