Permalink
Browse files

Merge branch 'MDL-32714-rubric_22' of git://github.com/mudrd8mz/moodl…

…e into MOODLE_22_STABLE
  • Loading branch information...
2 parents bf03cf1 + 1f90d92 commit 39a3a530696b029539298b94aec76cd285fcb9ad @danpoltawski danpoltawski committed May 14, 2012
Showing with 7 additions and 4 deletions.
  1. +7 −4 mod/workshop/form/rubric/lib.php
@@ -418,16 +418,17 @@ public static function delete_instance($workshopid) {
protected function load_fields() {
global $DB;
- $sql = 'SELECT l.id AS lid, r.id AS rid, r.*, l.*
+ $sql = "SELECT r.id AS rid, r.sort, r.description, r.descriptionformat,
+ l.id AS lid, l.grade, l.definition, l.definitionformat
FROM {workshopform_rubric} r
LEFT JOIN {workshopform_rubric_levels} l ON (l.dimensionid = r.id)
WHERE r.workshopid = :workshopid
- ORDER BY r.sort, l.grade';
+ ORDER BY r.sort, l.grade";
$params = array('workshopid' => $this->workshop->id);
- $records = $DB->get_records_sql($sql, $params);
+ $rs = $DB->get_recordset_sql($sql, $params);
$fields = array();
- foreach ($records as $record) {
+ foreach ($rs as $record) {
if (!isset($fields[$record->rid])) {
$fields[$record->rid] = new stdclass();
$fields[$record->rid]->id = $record->rid;
@@ -444,6 +445,8 @@ protected function load_fields() {
$fields[$record->rid]->levels[$record->lid]->definitionformat = $record->definitionformat;
}
}
+ $rs->close();
+
return $fields;
}

0 comments on commit 39a3a53

Please sign in to comment.