Proyectos de Subversion Moodle

Rev

Rev 1 | Mostrar el archivo completo | | | Autoría | Ultima modificación | Ver Log |

Rev 1 Rev 1441
Línea 47... Línea 47...
47
    protected function get_javascript_strings() {
47
    protected function get_javascript_strings() {
48
        return ['option_complete', 'option_fail', 'option_incomplete', 'option_pass',
48
        return ['option_complete', 'option_fail', 'option_incomplete', 'option_pass',
49
                        'label_cm', 'label_completion'];
49
                        'label_cm', 'label_completion'];
50
    }
50
    }
Línea 51... Línea 51...
51
 
51
 
52
    protected function get_javascript_init_params($course, \cm_info $cm = null,
52
    protected function get_javascript_init_params($course, ?\cm_info $cm = null,
53
            \section_info $section = null) {
53
            ?\section_info $section = null) {
54
        // Use cached result if available. The cache is just because we call it
54
        // Use cached result if available. The cache is just because we call it
55
        // twice (once from allow_add) so it's nice to avoid doing all the
55
        // twice (once from allow_add) so it's nice to avoid doing all the
56
        // print_string calls twice.
56
        // print_string calls twice.
57
        $cachekey = $course->id . ',' . ($cm ? $cm->id : '') . ($section ? $section->id : '');
57
        $cachekey = $course->id . ',' . ($cm ? $cm->id : '') . ($section ? $section->id : '');
Línea 84... Línea 84...
84
            $this->cacheinitparams = [$cms];
84
            $this->cacheinitparams = [$cms];
85
        }
85
        }
86
        return $this->cacheinitparams;
86
        return $this->cacheinitparams;
87
    }
87
    }
Línea 88... Línea 88...
88
 
88
 
89
    protected function allow_add($course, \cm_info $cm = null,
89
    protected function allow_add($course, ?\cm_info $cm = null,
90
            \section_info $section = null) {
90
            ?\section_info $section = null) {
Línea 91... Línea 91...
91
        global $CFG;
91
        global $CFG;
92
 
92
 
93
        // Check if completion is enabled for the course.
93
        // Check if completion is enabled for the course.