/sloodle/mod/quiz-1.0/locallib.1.9.phpLibrary of functions used by the quiz module.
This contains functions that are called from within the quiz module only Functions that are also called by core Moodle are in lib.php This script also loads the code in questionlib.php which holds the module-indpendent code for handling questions and which in turn initialises all the questiontype classes.
QUIZ_ATTEMPTFIRST = "3"
(line 33)
Options determining how the grades from individual attempts are combined to give
the overall grade for a user
QUIZ_ATTEMPTLAST = "4"
(line 34)
Options determining how the grades from individual attempts are combined to give
the overall grade for a user
QUIZ_GRADEAVERAGE = "2"
(line 32)
Options determining how the grades from individual attempts are combined to give
the overall grade for a user
QUIZ_GRADEHIGHEST = "1"
(line 31)
Options determining how the grades from individual attempts are combined to give
the overall grade for a user
QUIZ_STATE_CLOSED = 'closed'
(line 43)
Constants to describe the various states a quiz attempt can be in.
QUIZ_STATE_DURING = 'during'
(line 40)
Constants to describe the various states a quiz attempt can be in.
QUIZ_STATE_IMMEDIATELY = 'immedately'
(line 41)
Constants to describe the various states a quiz attempt can be in.
QUIZ_STATE_OPEN = 'open'
(line 42)
Constants to describe the various states a quiz attempt can be in.
QUIZ_STATE_TEACHERACCESS = 'teacheraccess'
(line 44)
Constants to describe the various states a quiz attempt can be in.
Return the attempt with the best grade for a quiz
Which attempt is the best depends on $quiz->grademethod. If the grade method is GRADEAVERAGE then this function simply returns the last attempt.
Calculate the overall grade for a quiz given a number of attempts by a particular user.
Creates an object to represent a new attempt at a quiz
Creates an attempt object to represent an attempt at the quiz by the current user starting at the current time. The ->id field is not set. The object is NOT written to the database.
Delete a quiz attempt.
Get the feedback text that should be show to a student who got this grade on this quiz. The feedback is processed ready for diplay.
Returns the first question number for the current quiz page
Creates an array of maximum grades for a quiz
The grades are extracted from the quiz_question_instances table.
Get the best current grade for a particular user in a quiz.
Combines the review options from a number of different quiz attempts.
Returns an array of two ojects, so he suggested way of calling this funciton is: list($someoptions, $alloptions) = quiz_get_combined_reviewoptions(...)
Determine render options
Determine review options
Returns an unfinished attempt (if there is one) for the given user on the given quiz. This function does not return preview attempts.
Returns the number of pages in the quiz layout
Parse field names used for the replace options on question edit forms
Print navigation panel for quiz attempt and review pages
Returns a comma separated list of question ids for the quiz
Returns a comma separated list of question ids for the current page
Re-paginates the quiz layout
Convert the raw grade stored in $attempt into a grade out of the maximum grade for this quiz.
Save the overall grade for a user at a quiz in the quiz_grades table
Sends confirmation email to the student taking the course
Sends notification email to the interested parties that assign the role capability
Takes a bunch of information to format into an email and send to the specified recipient.
The quiz grade is the score that student's results are marked out of. When it changes, the corresponding data in quiz_grades and quiz_feedback needs to be rescaled.
Upgrade states for an attempt to Moodle 1.5 model
Any state that does not yet have its timestamp set to nonzero has not yet been upgraded from Moodle 1.4 The reason these are still around is that for large sites it would have taken too long to upgrade all states at once. This function sets the timestamp field and creates an entry in the question_sessions table.
Documentation generated on Mon, 16 Jun 2008 15:56:36 +0100 by phpDocumentor 1.4.0