Ejemplo n.º 1
0
 protected function process_actions($quiz, $cm, $currentgroup, $groupstudents, $allowed, $redirecturl)
 {
     parent::process_actions($quiz, $cm, $currentgroup, $groupstudents, $allowed, $redirecturl);
     if (empty($currentgroup) || $groupstudents) {
         if (optional_param('regrade', 0, PARAM_BOOL) && confirm_sesskey()) {
             if ($attemptids = optional_param_array('attemptid', array(), PARAM_INT)) {
                 $this->start_regrade($quiz, $cm);
                 $this->regrade_attempts($quiz, false, $groupstudents, $attemptids);
                 $this->finish_regrade($redirecturl);
             }
         }
     }
     if (optional_param('regradeall', 0, PARAM_BOOL) && confirm_sesskey()) {
         $this->start_regrade($quiz, $cm);
         $this->regrade_attempts($quiz, false, $groupstudents);
         $this->finish_regrade($redirecturl);
     } else {
         if (optional_param('regradealldry', 0, PARAM_BOOL) && confirm_sesskey()) {
             $this->start_regrade($quiz, $cm);
             $this->regrade_attempts($quiz, true, $groupstudents);
             $this->finish_regrade($redirecturl);
         } else {
             if (optional_param('regradealldrydo', 0, PARAM_BOOL) && confirm_sesskey()) {
                 $this->start_regrade($quiz, $cm);
                 $this->regrade_attempts_needing_it($quiz, $groupstudents);
                 $this->finish_regrade($redirecturl);
             }
         }
     }
 }
Ejemplo n.º 2
0
    protected function process_actions($quiz, $cm, $currentgroup, $groupstudents, $allowed, $redirecturl) {
        parent::process_actions($quiz, $cm, $currentgroup, $groupstudents, $allowed, $redirecturl);

        if (empty($currentgroup) || $groupstudents) {
            if (optional_param('regrade', 0, PARAM_BOOL) && confirm_sesskey()) {
                if ($attemptids = optional_param_array('attemptid', array(), PARAM_INT)) {
                    require_capability('mod/quiz:regrade', $this->context);
                    $this->regrade_attempts($quiz, false, $groupstudents, $attemptids);
                    redirect($redirecturl, '', 5);
                }
            }
        }

        if (optional_param('regradeall', 0, PARAM_BOOL) && confirm_sesskey()) {
            require_capability('mod/quiz:regrade', $this->context);
            $this->regrade_attempts($quiz, false, $groupstudents);
            redirect($redirecturl, '', 5);

        } else if (optional_param('regradealldry', 0, PARAM_BOOL) && confirm_sesskey()) {
            require_capability('mod/quiz:regrade', $this->context);
            $this->regrade_attempts($quiz, true, $groupstudents);
            redirect($redirecturl, '', 5);

        } else if (optional_param('regradealldrydo', 0, PARAM_BOOL) && confirm_sesskey()) {
            require_capability('mod/quiz:regrade', $this->context);
            $this->regrade_attempts_needing_it($quiz, $groupstudents);
            redirect($redirecturl, '', 5);
        }
    }