Merge branch 'MDL-46015_27' of git://github.com/jmvedrine/moodle into MOODLE_27_STABLE

This commit is contained in:
Dan Poltawski
2015-01-06 12:04:10 +00:00
+7 -3
View File
@@ -64,7 +64,8 @@ if (!empty($cm->groupingid)) {
ORDER BY $sort";
}
if (! $students = $DB->get_records_sql($sql, $params)) {
$students = $DB->get_recordset_sql($sql, $params);
if (!$students->valid()) {
$nothingtodisplay = true;
}
@@ -83,7 +84,8 @@ if ($action == 'reportoverview') {
$lessonoutput = $PAGE->get_renderer('mod_lesson');
if (! $attempts = $DB->get_records('lesson_attempts', array('lessonid' => $lesson->id), 'timeseen')) {
$attempts = $DB->get_recordset('lesson_attempts', array('lessonid' => $lesson->id), 'timeseen');
if (!$attempts->valid()) {
$nothingtodisplay = true;
}
@@ -221,6 +223,7 @@ if ($action === 'delete') {
"userid" => $attempt->userid);
}
}
$attempts->close();
// set all the stats variables
$numofattempts = 0;
$avescore = 0;
@@ -306,6 +309,7 @@ if ($action === 'delete') {
$table->data[] = array($studentname, $attempts, $bestgrade."%");
}
}
$students->close();
// print it all out !
if (has_capability('mod/lesson:edit', $context)) {
echo "<form id=\"theform\" method=\"post\" action=\"report.php\">\n
@@ -535,7 +539,7 @@ if ($action === 'delete') {
$table->data[] = array(get_string("notcompleted", "lesson"));
} else {
$user = $students[$userid];
$user = $DB->get_record('user', array('id' => $userid));
$gradeinfo = lesson_grade($lesson, $try, $user->id);