protected function send_response($mod) {
        global $OUTPUT, $PAGE;

        $resp = new stdClass();
        $resp->error = self::ERROR_OK;
        $resp->elementid = 'module-' . $mod->id;

        $courserenderer = $PAGE->get_renderer('core', 'course');
        $completioninfo = new completion_info($this->course);
        $info = get_fast_modinfo($this->course);
        $sr = null;
        $modulehtml = $courserenderer->course_section_cm($this->course, $completioninfo,
                $mod, null, array());
        $resp->fullcontent = $courserenderer->course_section_cm_list_item($this->course, $completioninfo, $mod, $sr);

        echo $OUTPUT->header();
        echo json_encode($resp);
        die();
    }