mirror of
https://github.com/moodle/moodle.git
synced 2025-01-19 06:18:28 +01:00
Merge branch 'MDL-31918-master-2' of git://git.luns.net.uk/moodle
This commit is contained in:
commit
100875efdb
@ -90,6 +90,9 @@ if ($group === 0 && $course->groupmode == SEPARATEGROUPS) {
|
||||
* Load data
|
||||
*/
|
||||
|
||||
// Retrieve course_module data for all modules in the course
|
||||
$modinfo = get_fast_modinfo($course);
|
||||
|
||||
// Get criteria for course
|
||||
$completion = new completion_info($course);
|
||||
|
||||
@ -490,13 +493,10 @@ if (!$csv) {
|
||||
switch ($criterion->criteriatype) {
|
||||
|
||||
case COMPLETION_CRITERIA_TYPE_ACTIVITY:
|
||||
// Load activity
|
||||
$activity = $criterion->get_mod_instance();
|
||||
|
||||
// Display icon
|
||||
$icon = $OUTPUT->pix_url('icon', $criterion->module);
|
||||
$iconlink = $CFG->wwwroot.'/mod/'.$criterion->module.'/view.php?id='.$criterion->moduleinstance;
|
||||
$icontitle = $activity->name;
|
||||
$icontitle = $modinfo->cms[$criterion->moduleinstance]->name;
|
||||
$iconalt = get_string('modulename', $criterion->module);
|
||||
break;
|
||||
|
||||
@ -575,10 +575,7 @@ foreach ($progress as $user) {
|
||||
if ($criterion->criteriatype == COMPLETION_CRITERIA_TYPE_ACTIVITY) {
|
||||
|
||||
// Load activity
|
||||
$mod = $criterion->get_mod_instance();
|
||||
$activity = $DB->get_record('course_modules', array('id' => $criterion->moduleinstance));
|
||||
$activity->name = $mod->name;
|
||||
|
||||
$activity = $modinfo->cms[$criterion->moduleinstance];
|
||||
|
||||
// Get progress information and state
|
||||
if (array_key_exists($activity->id,$user->progress)) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user