// This is definitely a hacking attempt $item = array('context' => context_module::instance($cm->id), 'objectid' => $cm->id); // Add to Moodle log so some auditing can be done \mod_emarking\event\unauthorized_granted::create($item)->trigger(); emarking_json_error('Unauthorized access!'); } } } else { $readonly = false; } // Switch according to action switch ($action) { case 'emarking': $item = array('context' => context_module::instance($cm->id), 'objectid' => $cm->id); // Add to Moodle log so some auditing can be done \mod_emarking\event\emarking_graded::create($item)->trigger(); $module = new stdClass(); include "../version.php"; include "view/emarking.php"; break; case 'getsubmission': include "qry/getSubmissionGrade.php"; $output = $results; emarking_json_array($output); break; case 'getcomments': include "qry/getCommentsSubmission.php"; emarking_json_resultset($results); break; case 'getstudents': include "qry/getStudentsInMarking.php";