Ejemplo n.º 1
0
require 'tabs.php';
// Show description.
echo $OUTPUT->box_start('generalbox feedback_description');
$options = (object) array('noclean' => true);
echo format_module_intro('feedback', $feedback, $cm->id);
echo $OUTPUT->box_end();
//show some infos to the feedback
if (has_capability('mod/feedback:edititems', $context)) {
    echo $OUTPUT->heading(get_string('overview', 'feedback'), 3);
    //get the groupid
    $groupselect = groups_print_activity_menu($cm, $CFG->wwwroot . '/mod/feedback/view.php?id=' . $cm->id, true);
    $mygroupid = groups_get_activity_group($cm);
    echo $groupselect . '<div class="clearer">&nbsp;</div>';
    $summary = new mod_feedback\output\summary($feedbackcompletion, $mygroupid, true);
    echo $OUTPUT->render_from_template('mod_feedback/summary', $summary->export_for_template($OUTPUT));
    if ($pageaftersubmit = $feedbackcompletion->page_after_submit()) {
        echo $OUTPUT->heading(get_string("page_after_submit", "feedback"), 3);
        echo $OUTPUT->box($pageaftersubmit, 'generalbox feedback_after_submit');
    }
}
if (!has_capability('mod/feedback:viewreports', $context) && $feedbackcompletion->can_view_analysis()) {
    $analysisurl = new moodle_url('/mod/feedback/analysis.php', array('id' => $id));
    echo '<div class="mdl-align"><a href="' . $analysisurl->out() . '">';
    echo get_string('completed_feedbacks', 'feedback') . '</a>';
    echo '</div>';
}
if (has_capability('mod/feedback:mapcourse', $context) && $feedback->course == SITEID) {
    echo $OUTPUT->box_start('generalbox feedback_mapped_courses');
    echo $OUTPUT->heading(get_string("mappedcourses", "feedback"), 3);
    echo '<p>' . get_string('mapcourse_help', 'feedback') . '</p>';
    $mapurl = new moodle_url('/mod/feedback/mapcourse.php', array('id' => $id));
Ejemplo n.º 2
0
        }
    }
}
// Print the page header.
$strfeedbacks = get_string("modulenameplural", "feedback");
$strfeedback = get_string("modulename", "feedback");
echo $OUTPUT->header();
echo $OUTPUT->heading(format_string($feedback->name));
if ($feedbackcompletion->is_empty()) {
    \core\notification::error(get_string('no_items_available_yet', 'feedback'));
} else {
    if ($cansubmit) {
        if (!empty($data->savevalues) || !empty($data->gonextpage)) {
            // Display information after the submit.
            if ($feedback->page_after_submit) {
                echo $OUTPUT->box($feedbackcompletion->page_after_submit(), 'generalbox boxaligncenter');
            }
            if ($feedbackcompletion->can_view_analysis()) {
                echo '<p align="center">';
                $analysisurl = new moodle_url('/mod/feedback/analysis.php', array('id' => $cm->id, 'courseid' => $courseid));
                echo html_writer::link($analysisurl, get_string('completed_feedbacks', 'feedback'));
                echo '</p>';
            }
            if ($feedback->site_after_submit) {
                $url = feedback_encode_target_url($feedback->site_after_submit);
            } else {
                $url = course_get_url($courseid ?: $course->id);
            }
            echo $OUTPUT->continue_button($url);
        } else {
            // Print the items.