Exemplo n.º 1
0
    $qcfilter = '';
}
if ($emarking->type == EMARKING_TYPE_PEER_REVIEW) {
    $qcfilter = '';
}
// Default variables for the number of criteria for this evaluation.
// and minimum and maximum scores.
$numcriteria = 0;
$rubricscores = array('maxscore' => 0, 'minscore' => 0);
if ($rubriccriteria) {
    $numcriteria = count($rubriccriteria->rubric_criteria);
    // Getting min and max scores.
    $rubricscores = $rubriccontroller->get_min_max_score();
}
// Show export buttons when grades are available
emarking_show_export_buttons($issupervisor, $rubriccriteria, $cm, $emarking, $numdraftsgrading);
$usercanpublishgrades = ($emarking->type == EMARKING_TYPE_ON_SCREEN_MARKING || $emarking->type == EMARKING_TYPE_PEER_REVIEW) && has_capability("mod/emarking:supervisegrading", $context) && !$scan;
// Only when marking normally for a grade we can publish grades.
if ($usercanpublishgrades) {
    echo "<form id='publishgrades' action='marking/publish.php' method='post'>";
    echo "<input type='hidden' name='id' value='{$cm->id}'>";
}
// Calculates the number of criteria assigned to current user.
$numcriteriauser = $DB->count_records_sql("\n\t\tSELECT COUNT(DISTINCT criterion)\n\t\tFROM {emarking_marker_criterion}\n\t\tWHERE emarking=? AND marker=?", array($emarking->id, $USER->id));
// Check if activity is configured with separate groups to filter users.
if ($cm->groupmode == SEPARATEGROUPS && ($emarking->type == EMARKING_TYPE_ON_SCREEN_MARKING || $emarking->type == EMARKING_TYPE_PRINT_SCAN) && $usercangrade && !is_siteadmin($USER) && !$issupervisor) {
    $userfilter .= "\n\t\tAND u.id in (\n\t\t\tSELECT userid\n\t\t\tFROM {groups_members}\n\t\t\tWHERE groupid in (\n\t\t\t\tSELECT groupid\n\t\t\t\tFROM {groups_members} gm\n\t\t\t\tINNER JOIN {groups} g on (gm.groupid = g.id)\n\t\t\t\tWHERE gm.userid = {$USER->id} AND g.courseid = e.courseid\n\t\t\t\t\t\t\t)\n\t\t\t\t\t)";
}
$enrolments = explode(',', $exam ? $exam->enrolments : $CFG->emarking_enrolincludes);
for ($i = 0; $i < count($enrolments); $i++) {
    $enrolments[$i] = "'" . $enrolments[$i] . "'";
Exemplo n.º 2
0
foreach ($dataexams as $sid => $d) {
    $examurl = new moodle_url("/mod/emarking/marking/agreement.php", array("id" => $cm->id, "exam" => $sid));
    $firststagetable->data[] = array($OUTPUT->action_link($examurl, emarking_get_progress_circle($d, 'green') . '&nbsp;' . get_string("exam", "mod_emarking") . '&nbsp;' . $sid));
}
$secondstagetable = new html_table();
$secondstagetable->data[] = array($OUTPUT->heading(get_string("criteria", "mod_emarking"), 5));
foreach ($datacriteria as $cid => $d) {
    $criterionurl = new moodle_url("/mod/emarking/marking/agreement.php", array("id" => $cm->id, "criterion" => $cid));
    $secondstagetable->data[] = array($OUTPUT->action_link($criterionurl, emarking_get_progress_circle($d, 'green') . '&nbsp;' . $definition->rubric_criteria[$cid]['description']));
}
$thirdstagetable = new html_table();
$thirdstagetable->data[] = array($OUTPUT->heading(get_string("marker", "mod_emarking"), 5));
foreach ($datamarkers as $mid => $d) {
    $markerurl = new moodle_url("/mod/emarking/marking/agreement.php", array("id" => $cm->id, "marker" => $mid));
    $thirdstagetable->data[] = array(emarking_get_progress_circle($d, 'green') . '&nbsp;' . $OUTPUT->action_link($markerurl, $markersnames[$mid]));
}
// Get the course module for the emarking, to build the emarking url.
$urlagreement = new moodle_url('/mod/emarking/marking/agreement.php', array('id' => $cm->id));
// Heading and tabs if we are within a course module.
echo $OUTPUT->heading($emarking->name);
echo emarking_tabs_markers_training($context, $cm, $emarking, 100, $avgagreement);
emarking_show_export_buttons($issupervisor, $definition, $cm, $emarking, $numdraftsgrading);
echo $OUTPUT->heading(get_string('agreement', 'mod_emarking'), 4);
echo html_writer::start_tag('table', array('class' => 'agreementtable'));
echo html_writer::start_tag('tr');
echo html_writer::tag('td', html_writer::table($firststagetable));
echo html_writer::tag('td', html_writer::table($secondstagetable));
echo html_writer::tag('td', html_writer::table($thirdstagetable));
echo html_writer::end_tag('tr');
echo html_writer::end_tag('table');
echo $OUTPUT->footer();