Proyectos de Subversion Moodle

Rev

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

Rev 1 Rev 1441
Línea 25... Línea 25...
25
require_once($CFG->dirroot . '/mod/feedback/lib.php');
25
require_once($CFG->dirroot . '/mod/feedback/lib.php');
Línea 26... Línea 26...
26
 
26
 
27
$id = required_param('id', PARAM_INT);
27
$id = required_param('id', PARAM_INT);
Línea 28... Línea -...
28
$courseid = optional_param('courseid', false, PARAM_INT);
-
 
29
 
-
 
30
$current_tab = 'view';
28
$courseid = optional_param('courseid', false, PARAM_INT);
31
 
29
 
32
list($course, $cm) = get_course_and_cm_from_cmid($id, 'feedback');
30
list($course, $cm) = get_course_and_cm_from_cmid($id, 'feedback');
Línea 33... Línea 31...
33
require_course_login($course, true, $cm);
31
require_course_login($course, true, $cm);
Línea 39... Línea 37...
39
 
37
 
40
if ($course->id == SITEID) {
38
if ($course->id == SITEID) {
41
    $PAGE->set_pagelayout('incourse');
39
    $PAGE->set_pagelayout('incourse');
42
}
40
}
-
 
41
$PAGE->set_url('/mod/feedback/view.php', array('id' => $cm->id));
-
 
42
 
43
$PAGE->set_url('/mod/feedback/view.php', array('id' => $cm->id));
43
/** @var \mod_feedback\output\renderer $renderer */
-
 
44
$renderer = $PAGE->get_renderer('mod_feedback');
-
 
45
$renderer->set_title(
-
 
46
    [format_string($feedback->name), format_string($course->fullname)]
-
 
47
);
44
$PAGE->set_title($feedback->name);
48
 
45
$PAGE->set_heading($course->fullname);
49
$PAGE->set_heading($course->fullname);
Línea 46... Línea -...
46
$PAGE->add_body_class('limitedwidth');
-
 
47
 
-
 
48
// Check access to the given courseid.
-
 
49
if ($courseid AND $courseid != SITEID) {
-
 
50
    require_course_login(get_course($courseid)); // This overwrites the object $COURSE .
-
 
51
}
50
$PAGE->add_body_class('limitedwidth');
52
 
51
 
53
// Check whether the feedback is mapped to the given courseid.
52
// Check whether the feedback is mapped to the given courseid.
54
if (!has_capability('mod/feedback:edititems', $context) &&
53
if (!has_capability('mod/feedback:edititems', $context) &&
55
        !$feedbackcompletion->check_course_is_mapped()) {
54
        !$feedbackcompletion->check_course_is_mapped()) {
Línea 65... Línea 64...
65
    $viewcompletion,
64
    $viewcompletion,
66
    $feedbackcompletion->get_resume_page(),
65
    $feedbackcompletion->get_resume_page(),
67
    $courseid
66
    $courseid
68
);
67
);
Línea 69... Línea -...
69
 
-
 
70
/** @var \mod_feedback\output\renderer $renderer */
-
 
71
$renderer = $PAGE->get_renderer('mod_feedback');
-
 
72
 
68
 
73
// Trigger module viewed event.
69
// Trigger module viewed event.
Línea 74... Línea 70...
74
$feedbackcompletion->trigger_module_viewed();
70
$feedbackcompletion->trigger_module_viewed();
75
 
71
 
Línea 141... Línea 137...
141
        // Feedback is not yet open or is already closed.
137
        // Feedback is not yet open or is already closed.
142
        echo $OUTPUT->notification(get_string('feedback_is_not_open', 'feedback'));
138
        echo $OUTPUT->notification(get_string('feedback_is_not_open', 'feedback'));
143
        echo $OUTPUT->continue_button(course_get_url($courseid ?: $course->id));
139
        echo $OUTPUT->continue_button(course_get_url($courseid ?: $course->id));
144
    } else if (!$feedbackcompletion->can_submit()) {
140
    } else if (!$feedbackcompletion->can_submit()) {
145
        // Feedback was already submitted.
141
        // Feedback was already submitted.
-
 
142
        echo $OUTPUT->notification(
146
        echo $OUTPUT->notification(get_string('this_feedback_is_already_submitted', 'feedback'));
143
            get_string('this_feedback_is_already_submitted', 'feedback'),
-
 
144
            \core\output\notification::NOTIFY_INFO,
-
 
145
            closebutton: false,
-
 
146
        );
147
        $OUTPUT->continue_button(course_get_url($courseid ?: $course->id));
147
        $OUTPUT->continue_button(course_get_url($courseid ?: $course->id));
148
    }
148
    }
149
    echo $OUTPUT->box_end();
149
    echo $OUTPUT->box_end();
150
}
150
}