} else { $datapost = $_POST; $dataget = $_GET; } if (isset($datapost['stu']) && isset($datapost['cma']) && isset($dataget['id']) && isset($dataget['eva'])) { require_once 'lib.php'; $courseid = $dataget['id']; $assessorid = $dataget['eva']; $page = $datapost['page']; $context = context_course::instance($courseid); $report_evalcomix = new grade_report_evalcomix($courseid, null, $context, $page); $userid = $datapost['stu']; $cmid = $datapost['cma']; $report_evalcomix->process_data($datapost); //Obtains course�s users $users = $report_evalcomix->load_users(); $coursegroups = $report_evalcomix->load_groups(); $coursegroupings = $report_evalcomix->load_groupings(); $finalgrades = evalcomix_grades::get_grades($courseid); //$finalgrades = $report_evalcomix->get_grades(); //echo $report_evalcomix->create_grade_table(); $showdetails = true; $configured = $report_evalcomix->configured_activity($cmid); //Only show the user�s grade or all grades if the USER is a teacher or admin //if ((has_capability('block/evalcomix:edit',$context, $USER->id) || $userid == $USER->id) && isset($finalgrades[$cmid][$userid])){ if ((has_capability('moodle/grade:viewhidden', $context, $USER->id) || $userid == $USER->id) && isset($finalgrades[$cmid][$userid])) { if ($finalgrades[$cmid][$userid] != -1) { echo format_float($finalgrades[$cmid][$userid], 2); } else { echo '-'; }
* @author Daniel Cabeza Sánchez <*****@*****.**>, Juan Antonio Caballero Hernández <*****@*****.**> */ require_once '../../../config.php'; require_once $CFG->dirroot . '/blocks/evalcomix/assessment/lib.php'; include_once $CFG->dirroot . '/blocks/evalcomix/classes/evalcomix_allowedusers.php'; $search = required_param('search', PARAM_RAW); $courseid = required_param('id', PARAM_INT); // course id $id = required_param('a', PARAM_INT); $type = optional_param('t', 0, PARAM_INT); $assessorid = optional_param('as', 0, PARAM_INT); require_login($courseid); if ($id) { $cm = get_coursemodule_from_id('', $id, 0, false, MUST_EXIST); if (!($course = $DB->get_record('course', array('id' => $courseid)))) { print_error('nocourseid'); } } $context = context_course::instance($courseid); $report_evalcomix = new grade_report_evalcomix($courseid, null, $context); $users = $report_evalcomix->load_users(false); $allowedusershash = array(); $output = '<select id="assessorid" name="assessorid" style="width:20em" size="20" onclick="document.getElementById(\'submit\').disabled = false;doWork(\'targetstudents\', \'targetstudents.php\', \'u=\'+this.value+\'&id=' . $courseid . '&a=' . $cm->id . '\');">'; if ($type == 'potential' && $assessorid > 0) { $allowedusershash[$assessorid] = true; if ($allowedusers = evalcomix_allowedusers::fetch_all(array('cmid' => $id, 'assessorid' => $assessorid))) { foreach ($allowedusers as $alloweduser) { $userid = $alloweduser->studentid; $allowedusershash[$userid] = true; } }