Hello Developers,
I had to duplicate my assignment to fast assignment with some additional functionalities. When I click the Grade form opens with page with
Unexpected token < in JSON at position 1
I was searching the code in fastassign/locallib.php(similar to assign/locallib.php)
protected function view_grader() {
global $USER, $PAGE;
$o = '';
// Need submit permission to submit an assignment.
$this->require_view_grades();
$PAGE->set_pagelayout('embedded');
$courseshortname = $this->get_context()->get_course_context()->get_context_name(false, true);
$args = [
'contextname' => $this->get_context()->get_context_name(false, true),
'subpage' => get_string('grading', 'assign')
];
$title = get_string('subpagetitle', 'assign', $args);
$title = $courseshortname . ': ' . $title;
$PAGE->set_title($title);
$o .= $this->get_renderer()->header();
$userid = optional_param('userid', 0, PARAM_INT);
$blindid = optional_param('blindid', 0, PARAM_INT);
if (!$userid && $blindid) {
$userid = $this->get_user_id_for_uniqueid($blindid);
}
$currentgroup = groups_get_activity_group($this->get_course_module(), true);
$framegrader = new grading_app($userid, $currentgroup, $this);
$this->update_effective_access($userid);
$o .= $this->get_renderer()->render($framegrader);
$o .= $this->view_footer();
\mod_assign\event\grading_table_viewed::create_from_assign($this)->trigger();
return $o;
}