Permalink
Browse files

Merge branch 'MDL-35023_23' of git://github.com/timhunt/moodle into M…

…OODLE_23_STABLE
  • Loading branch information...
stronk7 committed Aug 27, 2012
2 parents b6cd701 + 07eca71 commit 8f93d94ab2ea86ac240d4ec69dcbef2bdc938283
Showing with 8 additions and 6 deletions.
  1. +8 −6 question/type/calculated/questiontype.php
@@ -1701,17 +1701,19 @@ public function print_dataset_definitions_category_shared($question, $datasetdef
WHERE i.id = d.datasetdefinition AND i.category = ?";
if ($records = $DB->get_records_sql($sql, array($category))) {
foreach ($records as $r) {
+ $key = "$r->type-$r->category-$r->name";
$sql1 = "SELECT q.*
FROM {question} q
WHERE q.id = ?";
- if (!isset ($datasetdefs["$r->type-$r->category-$r->name"])) {
- $datasetdefs["$r->type-$r->category-$r->name"]= $r;
+ if (!isset($datasetdefs[$key])) {
+ $datasetdefs[$key] = $r;
}
if ($questionb = $DB->get_records_sql($sql1, array($r->question))) {
- $datasetdefs["$r->type-$r->category-$r->name"]->questions[
- $r->question]->name = $questionb[$r->question]->name;
- $datasetdefs["$r->type-$r->category-$r->name"]->questions[
- $r->question]->id = $questionb[$r->question]->id;
+ $datasetdefs[$key]->questions[$r->question] = new stdClass();
+ $datasetdefs[$key]->questions[$r->question]->name =
+ $questionb[$r->question]->name;
+ $datasetdefs[$key]->questions[$r->question]->id =
+ $questionb[$r->question]->id;
}
}
}

0 comments on commit 8f93d94

Please sign in to comment.