public function process_evalcomix($data) { global $DB, $CFG; include_once $CFG->dirroot . '/blocks/evalcomix/classes/evalcomix.php'; $data = (object) $data; $oldid = $data->id; $data->courseid = $this->get_courseid(); if (!evalcomix::fetch(array('courseid' => $data->courseid))) { $newitemid = $DB->insert_record('block_evalcomix', $data); $this->set_mapping('evalcomix', $oldid, $newitemid); } else { $this->set_mapping('evalcomix', $oldid, $oldid); } }
$report_evalcomix->process_data($data); } // Array // Almacenará los estudiantes que se mostrarán en la tabla de calificaciones // Los estudiantes que almacenará variará en función de los privilegios del usuario y de la configuración // de la actividad (grupos, agrupamientos, modalidades de evaluación) $users = array(); // Array // Almacenará las actividades que se mostrará en la tabla de calificacions. // Las instancias que almacenará dependerá de la configuración de la actividad (agrupamientos) $activities = array(); // Array de dos dimensiones [usuario][actividad]; // Contendrá código HTML que se mostrará en las celdas de la tabla de calificaciones. // Su contenido dependerá de los privilegios del usuario. $content_cells = array(); $evalcomix = evalcomix::fetch(array('courseid' => $courseid)); $showmessage = false; //////////////////////////////////////////////////////////////////////////////////////////////////////////////// ///////////////////////////////// Se comprueba si hay que pasar notas al libro ///////////////////////////////// //////////////////////////////////////////////////////////////////////////////////////////////////////////////// // prints paging bar at top for large pages $studentsperpage = $report_evalcomix->studentsperpage; $numusers = $report_evalcomix->get_numusers(); include_once $CFG->dirroot . '/blocks/evalcomix/classes/evalcomix_tasks.php'; $tasks = evalcomix_tasks::get_tasks_by_courseid($courseid); //if (has_capability('block/evalcomix:edit',$context, $USER->id) && ($grd == 1 || $grd == 2 || $grd == 3)){ if (has_capability('moodle/block:edit', $context, $USER->id) && ($grd == 1 || $grd == 2 || $grd == 3)) { $blockdb = $DB->get_records('modules', array()); $cmdb = $DB->get_records('course_modules', array('course' => $courseid)); foreach ($blockdb as $b) { $mod = $b->id;
$response = $curl->get($serverurl); if ($response && $curl->getHttpCode() >= 200 && $curl->getHttpCode() < 400) { if ($xml = simplexml_load_string($response)) { if ((string) $xml->status == 'success') { return (string) $xml->description; } else { return 0; } } else { return 0; } } else { throw new Exception('SG: Bad Response'); } } public static function generate_token() { return md5(uniqid()); } /** * @param string $params['courseid'] * @param array $params['module'] module names * @param array $params['activity'] activity IDs * @param array $params['student'] student IDs * @param array $params['assessor'] assessor IDs * @param array $params['mode'] [teacher | self | peer] * @param string $params['lms'] lms name * @return xml document with data assessments */ public static function get_ws_xml_tools($params = array()) { defined('GET_TOOLS') || die('EvalCOMIX is not configured');
global $DB; if (!empty($this->id)) { debugging("Tool object already exists!"); return false; } $this->timecreated = time(); $data = $this->get_record_data(); $this->id = $DB->insert_record($this->table, $data); // set all object properties from real db data $this->update_from_db(); $this->notify_changed(false); return $this->id; } /** * Updates this object in the Database, based on its object variables. ID must be set. * @param string $source from where was the object updated (mod/forum, manual, etc.) * @return boolean success */ public function update() { global $DB; if (empty($this->id)) { debugging('Can not update tool object, no id!'); return false;
/** * @return array of course tools by [taskid][modality] */ function load_tools() { $result = array(); if ($evalcomix = evalcomix::fetch(array('courseid' => $this->courseid))) { if ($tools = evalcomix_tool::fetch_all(array('evxid' => $evalcomix->id))) { foreach ($tools as $tool) { if ($modes = evalcomix_modes::fetch_all(array('toolid' => $tool->id))) { foreach ($modes as $mode) { $taskid = $mode->taskid; $modality = $mode->modality; $result[$taskid][$modality] = $tool; } } } } } return $result; }
$result = evalcomix::fetch_all($params); $this->assertFalse($result); unset($params, $result); } /** * Fetch an object with no unique params. Return false */ public function sub_test_evalcomix_fetch_fail()
} else { $editing = false; } echo ' <script type="text/javascript"> function urledit(u, nombre, edit){ win2 = window.open(u, nombre, "menubar=0,location=0,scrollbars,resizable,width=780,height=500"); checkChildedit(edit); } function checkChildedit(edit) { if (win2.closed) { window.location.replace("' . $CFG->wwwroot . '/blocks/evalcomix/tool/index.php?id=' . $courseid . '&edit=" + edit); /*window.location.href = "' . $CFG->wwwroot . '/blocks/evalcomix/tool/index.php?id=' . $courseid . '&edit=" + edit;*/ } else setTimeout("checkChildedit(\'"+edit+"\')",1); } </script> '; include_once $CFG->dirroot . '/blocks/evalcomix/javascript/popup.php'; include_once $CFG->dirroot . '/blocks/evalcomix/classes/evalcomix_tool.php'; include_once $CFG->dirroot . '/blocks/evalcomix/classes/evalcomix.php'; include_once $CFG->dirroot . '/blocks/evalcomix/classes/webservice_evalcomix_client.php'; if ($tid) { $tooldelete = evalcomix_tool::fetch(array('id' => $tid)); if ($tooldelete) { $response = webservice_evalcomix_client::get_ws_deletetool($tooldelete->idtool); $tooldelete->delete(); } } if (isset($edit) && $edit != '' && $edit != 'undefined') {