public function view_page_notenrolled($course, $quiz, $cm, $context, $messages) {
        global $CFG;
        $output = '';
        $output .= $this->view_information($quiz, $cm, $context, $messages);
        $youneedtoenrol = html_writer::tag('p', get_string('youneedtoenrol', 'quiz'));
        $button = html_writer::tag('p',
                $this->continue_button($CFG->wwwroot . '/course/view.php?id=' . $course->id));
        $output .= $this->box($youneedtoenrol."\n\n".$button."\n", 'generalbox', 'notice');
        return $output;
    }
public function view_page_notenrolled($course, $quiz, $cm, $context, $messages) {
        global $CFG;
        $output = '';
        $output .= $this->view_information($quiz, $cm, $context, $messages);
        $youneedtoenrol = html_writer::tag('p', get_string('youneedtoenrol', 'quiz'));
        $button = html_writer::tag('p',
                $this->continue_button($CFG->wwwroot . '/course/view.php?id=' . $course->id));
        $output .= $this->box($youneedtoenrol."\n\n".$button."\n", 'generalbox', 'notice');
        return $output;
    }
public function view_page_notenrolled ( $ course , $ quiz , $ cm , $ context , $ messages ) { global $ CFG ; $ output = '' ; $ output .= $ this -> view_information ( $ quiz , $ cm , $ context , $ messages ) ; $ youneedtoenrol = html_writer :: tag ( 'p' , get_string ( 'youneedtoenrol' , 'quiz' ) ) ; $ button = html_writer :: tag ( 'p' , $ this -> continue_button ( $ CFG -> wwwroot . '/course/view.php?id=' . $ course -> id ) ) ; $ output .= $ this -> box ( $ youneedtoenrol . "\n\n" . $ button . "\n" , 'generalbox' , 'notice' ) ; return $ output ; }
Outputs and error message for anyone who is not enrolle don the course

@param int $course The course ID
@param array $quiz Array contingin quiz data
@param int $cm Course Module ID
@param int $context The page contect ID
@param array $messages Array containing any messages
Outputs and error message for anyone who is not enrolle don the course