Proyectos de Subversion Moodle

Rev

Rev 1126 | Rev 1140 | Ir a la última revisión | Mostrar el archivo completo | | | Autoría | Ultima modificación | Ver Log |

Rev 1126 Rev 1139
Línea 30... Línea 30...
30
require_once($CFG->libdir . '/behat/lib.php');
30
require_once($CFG->libdir . '/behat/lib.php');
31
require_once($CFG->dirroot . '/course/lib.php');
31
require_once($CFG->dirroot . '/course/lib.php');
Línea 32... Línea 32...
32
 
32
 
33
 
33
 
34
$linkurl = '';
34
$linkurl = '';
35
if(!empty($PAGE->course->id)) {
35
if (!empty($PAGE->course->id)) {
36
    $course = get_course($PAGE->course->id);
36
    $course = get_course($PAGE->course->id);
37
    $course_context = context_course::instance($course->id);
37
    $course_context = context_course::instance($course->id);
38
    $completioninfo = new \completion_info($course);
38
    $completioninfo = new \completion_info($course);
39
    
39
 
40
    
40
 
41
    $modules = get_fast_modinfo($course->id)->get_cms();
41
    $modules = get_fast_modinfo($course->id)->get_cms();
42
    if(!empty($modules))
-
 
43
    foreach ($modules as $module) 
42
    if (!empty($modules))
44
    {
43
        foreach ($modules as $module) {
45
        if (!$module->uservisible || $module->is_stealth() || empty($module->url)) {
44
            if (!$module->uservisible || $module->is_stealth() || empty($module->url)) {
-
 
45
                continue;
46
            continue;
46
            }
-
 
47
            if ($module->section == $first_section || $completion_edit_curso) {
-
 
48
                $linkurl = new moodle_url($module->url, array(
-
 
49
                    'forceview' => 1
47
        }
50
                ));
48
        $linkurl = new \moodle_url($module->url, array('forceview' => 1));
51
            }
49
        
52
 
50
        $completiondata = $completioninfo->get_data($module, true);
53
            $completiondata = $completioninfo->get_data($module, true);
-
 
54
            if ($completiondata &&  $completiondata->completionstate == COMPLETION_COMPLETE || $completiondata->completionstate == COMPLETION_COMPLETE_PASS) {
-
 
55
                continue;
51
        if($completiondata &&  $completiondata->completionstate == COMPLETION_COMPLETE || $completiondata->completionstate == COMPLETION_COMPLETE_PASS) {
56
            }
52
            continue;
-
 
53
        }
-
 
54
        break;
57
            break;
Línea 55... Línea 58...
55
    }
58
        }
56
}
59
}
57
 
60
 
58
if($linkurl) {
61
if ($linkurl) {