Esempio n. 1
0
        $report = new grade_report_marksheet($courseid, $gpr, $context, $userid);
        $studentnamelink = html_writer::link(new moodle_url('/user/view.php', array('id' => $report->user->id, 'course' => $courseid)), fullname($report->user));
        print_grade_page_head($courseid, 'report', 'marksheet', get_string('pluginname', 'gradereport_marksheet') . ' - ' . $studentnamelink);
        groups_print_course_menu($course, $gpr->get_return_url('index.php?id=' . $courseid, array('userid' => 0)));
        if ($user_selector) {
            $renderer = $PAGE->get_renderer('gradereport_marksheet');
            $showallusersoptions = true;
            echo $renderer->graded_users_selector('marksheet', $course, $userid, $currentgroup, $showallusersoptions);
        }
        if ($currentgroup and !groups_is_member($currentgroup, $userid)) {
            echo $OUTPUT->notification(get_string('groupusernotmember', 'error'));
        } else {
            if ($report->fill_table()) {
                echo $renderer->graded_user_report($course, $userid);
                echo '<br />' . $report->print_table(true);
                echo $renderer->signature($course, $userid);
            }
        }
    }
} else {
    //Students will see just their own report
    // Create a report instance
    $report = new grade_report_marksheet($courseid, $gpr, $context, $userid);
    // print the page
    print_grade_page_head($courseid, 'report', 'marksheet', get_string('pluginname', 'gradereport_marksheet') . ' - ' . fullname($report->user));
    if ($report->fill_table()) {
        echo $renderer->graded_user_report($course, $userid);
        echo '<br />' . $report->print_table(true);
    }
}
echo $OUTPUT->footer();
Esempio n. 2
0
function grade_report_marksheet_profilereport($course, $user)
{
    global $OUTPUT;
    if (!empty($course->showgrades)) {
        $context = context_course::instance($course->id);
        //first make sure we have proper final grades - this must be done before constructing of the grade tree
        grade_regrade_final_grades($course->id);
        /// return tracking object
        $gpr = new grade_plugin_return(array('type' => 'report', 'plugin' => 'user', 'courseid' => $course->id, 'userid' => $user->id));
        // Create a report instance
        $report = new grade_report_marksheet($course->id, $gpr, $context, $user->id);
        // print the page
        echo '<div class="grade-report-user">';
        // css fix to share styles with real report page
        echo $OUTPUT->heading(get_string('pluginname', 'gradereport_marksheet') . ' - ' . fullname($report->user));
        if ($report->fill_table()) {
            echo $report->print_table(true);
        }
        echo '</div>';
    }
}