Duplicated the Assignment plugin. (Not able to get grade)

Duplicated the Assignment plugin. (Not able to get grade)

by Amir Mustafa -
Number of replies: 2

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;
    }

Average of ratings: -
In reply to Amir Mustafa

Re: Duplicated the Assignment plugin. (Not able to get grade)

by Amir Mustafa -

After forth-last line I am getting the error

i.e. $o .= $this->get_renderer()->render($framegrader);

In reply to Amir Mustafa

Re: Duplicated the Assignment plugin. (Not able to get grade)

by Amir Mustafa -
Can anyone please guide me how to proceed. I am really stuck in this issue. sad

When I open the student view i get this error 

Unexpected token < in JSON at position 0