unset($SESSION->evaluation->is_started); // Update completion state //$completion = new completion_info($classid); //if ($completion->is_enabled($cm) && $evaluation->completionsubmit) { // $completion->update_state($cm, COMPLETION_COMPLETE); //} } else { $savereturn = 'failed'; } } //} if ($allbreaks = evaluation_get_all_break_positions($evaluation->id)) { if ($gopage <= 0) { $startposition = 0; } else { if (!isset($allbreaks[$gopage - 1])) { $gopage = count($allbreaks); } $startposition = $allbreaks[$gopage - 1]; } $ispagebreak = true; } else { $startposition = 0; $newpage = 0; $ispagebreak = false; }
/** * get the position of the last pagebreak * * @param int $evaluationid * @return int the position of the last pagebreak */ function evaluation_get_last_break_position($evaluationid) { if (!$allbreaks = evaluation_get_all_break_positions($evaluationid)) { return false; } return $allbreaks[count($allbreaks) - 1]; }