|
Moodle
2.2.1
http://www.collinsharper.com
|
Go to the source code of this file.
| enum QUIZ_ATTEMPTFIRST |
| enum QUIZ_ATTEMPTLAST |
| enum QUIZ_GRADEAVERAGE |
| enum QUIZ_GRADEHIGHEST |
| enum QUIZ_MAX_QPP_OPTION |
| mod_quiz_question_pluginfile | ( | $ | course, |
| $ | context, | ||
| $ | component, | ||
| $ | filearea, | ||
| $ | qubaid, | ||
| $ | slot, | ||
| $ | args, | ||
| $ | forcedownload | ||
| ) |
Called via pluginfile.php -> question_pluginfile to serve files belonging to a question in a question_attempt when that attempt is a quiz attempt.
| object | $course | course settings object |
| object | $context | context object |
| string | $component | the name of the component we are serving files for. |
| string | $filearea | the name of the file area. |
| array | $args | the remaining bits of the file path. |
| bool | $forcedownload | whether the user must be forced to download the file. |
Definition at line 1721 of file lib.php.

| quiz_add_instance | ( | $ | quiz | ) |
Given an object containing all the necessary data, (defined by the form in mod_form.php) this function will create a new instance and return the id number of the new instance.
| object | $quiz | the data that came from the form. |
Definition at line 71 of file lib.php.

| quiz_after_add_or_update | ( | $ | quiz | ) |
| quiz_attempt_summary_link_to_reports | ( | $ | quiz, |
| $ | cm, | ||
| $ | context, | ||
| $ | returnzero = false, |
||
| $ | currentgroup = 0 |
||
| ) |
Returns the same as quiz_num_attempt_summary() but wrapped in a link to the quiz reports.
| object | $quiz | the quiz object. Only $quiz->id is used at the moment. |
| object | $cm | the cm object. Only $cm->course, $cm->groupmode and $cm->groupingid fields are used at the moment. |
| object | $context | the quiz context. |
| bool | $returnzero | if false (default), when no attempts have been made '' is returned instead of 'Attempts: 0'. |
| int | $currentgroup | if there is a concept of current group where this method is being called (e.g. a report) pass it in here. Default 0 which means no current group. |
Definition at line 1516 of file lib.php.

| quiz_check_file_access | ( | $ | attemptuniqueid, |
| $ | questionid, | ||
| $ | context = null |
||
| ) |
Checks whether the current user is allowed to view a file uploaded in a quiz. Teachers can view any from their courses, students can only view their own.
| int | $attemptuniqueid | int attempt id |
| int | $questionid | int question id |
Definition at line 1348 of file lib.php.

| quiz_cron | ( | ) |
| quiz_delete_all_attempts | ( | $ | quiz | ) |
| quiz_delete_all_overrides | ( | $ | quiz | ) |
| quiz_delete_instance | ( | $ | id | ) |
| quiz_delete_override | ( | $ | quiz, |
| $ | overrideid | ||
| ) |
Deletes a quiz override from the database and clears any corresponding calendar events
| object | $quiz | The quiz object. |
| int | $overrideid | The id of the override being deleted |
Definition at line 178 of file lib.php.


| quiz_extend_navigation | ( | $ | quiznode, |
| $ | course, | ||
| $ | module, | ||
| $ | cm | ||
| ) |
This fucntion extends the global navigation for the site. It is important to note that you should not rely on PAGE objects within this body of code as there is no guarantee that during an AJAX request they are available
| navigation_node | $quiznode | The quiz node within the global navigation |
| object | $course | The course object returned from the DB |
| object | $module | The module object returned from the DB |
| object | $cm | The course module instance returned from the DB |
Definition at line 1572 of file lib.php.

| quiz_extend_settings_navigation | ( | $ | settings, |
| $ | quiznode | ||
| ) |
This function extends the settings navigation block for the site.
It is safe to rely on PAGE here as we will only ever be within the module context when this is called
| settings_navigation | $settings | |
| navigation_node | $quiznode |
Require questionlib.php Included here as we only ever want to include this file if we really need to.
Definition at line 1612 of file lib.php.

| quiz_format_grade | ( | $ | quiz, |
| $ | grade | ||
| ) |
Round a grade to to the correct number of decimal places, and format it for display.
| object | $quiz | The quiz table row, only $quiz->decimalpoints is used. |
| float | $grade | The grade to round. |
Definition at line 543 of file lib.php.


| quiz_format_question_grade | ( | $ | quiz, |
| $ | grade | ||
| ) |
Round a grade to to the correct number of decimal places, and format it for display.
| object | $quiz | The quiz table row, only $quiz->decimalpoints is used. |
| float | $grade | The grade to round. |
Definition at line 557 of file lib.php.


| quiz_get_best_grade | ( | $ | quiz, |
| $ | userid | ||
| ) |
| quiz_get_participants | ( | $ | quizid | ) |
| quiz_get_recent_mod_activity | ( | &$ | activities, |
| &$ | index, | ||
| $ | timestart, | ||
| $ | courseid, | ||
| $ | cmid, | ||
| $ | userid = 0, |
||
| $ | groupid = 0 |
||
| ) |
| quiz_get_user_attempts | ( | $ | quizid, |
| $ | userid, | ||
| $ | status = 'finished', |
||
| $ | includepreviews = false |
||
| ) |
| int | $quizid | the quiz id. |
| int | $userid | the userid. |
| string | $status | 'all', 'finished' or 'unfinished' to control |
| bool | $includepreviews |
Definition at line 486 of file lib.php.

| quiz_get_user_grades | ( | $ | quiz, |
| $ | userid = 0 |
||
| ) |
Return grade for given user or all users.
| int | $quizid | id of quiz |
| int | $userid | optional user id, 0 means all users |
Definition at line 510 of file lib.php.

| quiz_grade_item_delete | ( | $ | quiz | ) |
| quiz_grade_item_update | ( | $ | quiz, |
| $ | grades = null |
||
| ) |
Create grade item for given quiz
| object | $quiz | object with extra cmidnumber |
| mixed | $grades | optional array/object of grade(s); 'reset' means reset grades in gradebook |
Definition at line 630 of file lib.php.


| quiz_has_grades | ( | $ | quiz | ) |
Is this a graded quiz? If this method returns true, you can assume that $quiz->grade and $quiz->sumgrades are non-zero (for example, if you want to divide by them).
| object | $quiz | a row from the quiz table. |
Definition at line 350 of file lib.php.

| quiz_num_attempt_summary | ( | $ | quiz, |
| $ | cm, | ||
| $ | returnzero = false, |
||
| $ | currentgroup = 0 |
||
| ) |
Return a textual summary of the number of attempts that have been made at a particular quiz, returns '' if no attempts have been made yet, unless $returnzero is passed as true.
| object | $quiz | the quiz object. Only $quiz->id is used at the moment. |
| object | $cm | the cm object. Only $cm->course, $cm->groupmode and $cm->groupingid fields are used at the moment. |
| bool | $returnzero | if false (default), when no attempts have been made '' is returned instead of 'Attempts: 0'. |
| int | $currentgroup | if there is a concept of current group where this method is being called (e.g. a report) pass it in here. Default 0 which means no current group. |
Definition at line 1473 of file lib.php.


| quiz_page_type_list | ( | $ | pagetype, |
| $ | parentcontext, | ||
| $ | currentcontext | ||
| ) |
| quiz_pluginfile | ( | $ | course, |
| $ | cm, | ||
| $ | context, | ||
| $ | filearea, | ||
| $ | args, | ||
| $ | forcedownload | ||
| ) |
| quiz_print_overview | ( | $ | courses, |
| &$ | htmlarray | ||
| ) |
| quiz_print_recent_mod_activity | ( | $ | activity, |
| $ | courseid, | ||
| $ | detail, | ||
| $ | modnames | ||
| ) |
| quiz_process_options | ( | $ | quiz | ) |
| quiz_questions_in_use | ( | $ | questionids | ) |
| quiz_refresh_events | ( | $ | courseid = 0 | ) |
This standard function will check all instances of this module and make sure there are up-to-date events created for each of them. If courseid = 0, then every quiz event in the site is checked, else only quiz events belonging to the course specified are checked. This function is used, in its new format, by restore_refresh_events()
| int | $courseid |
Definition at line 752 of file lib.php.

| quiz_reset_course_form_defaults | ( | $ | course | ) |
| quiz_reset_course_form_definition | ( | $ | mform | ) |
| quiz_reset_gradebook | ( | $ | courseid, |
| $ | type = '' |
||
| ) |
| quiz_reset_userdata | ( | $ | data | ) |
Actual implementation of the reset course functionality, delete all the quiz attempts for course $data->courseid, if $data->reset_quiz_attempts is set and true.
Also, move the quiz open and close dates, if the course start date is changing.
| object | $data | the data submitted from the reset course. |
Definition at line 1292 of file lib.php.

| quiz_review_option_form_to_db | ( | $ | fromform, |
| $ | field | ||
| ) |
Helper function for quiz_process_options().
| object | $fromform | the sumbitted form date. |
| string | $field | one of the review option field names. |
Definition at line 1029 of file lib.php.

| quiz_supports | ( | $ | feature | ) |
| quiz_update_effective_access | ( | $ | quiz, |
| $ | userid | ||
| ) |
Updates a quiz object with override information for a user.
Algorithm: For each quiz setting, if there is a matching user-specific override, then use that otherwise, if there are group-specific overrides, return the most lenient combination of them. If neither applies, leave the quiz setting unchanged.
Special case: if there is more than one password that applies to the user, then quiz->extrapasswords will contain an array of strings giving the remaining passwords.
| object | $quiz | The quiz object. |
| int | $userid | The userid. |
Definition at line 225 of file lib.php.


| quiz_update_events | ( | $ | quiz, |
| $ | override = null |
||
| ) |
This function updates the events associated to the quiz. If $override is non-zero, then it updates only the events associated with the specified override.
QUIZ_MAX_EVENT_LENGTH
| object | $quiz | the quiz object. |
| object | optional $override limit to a specific override |
Definition at line 1101 of file lib.php.


| quiz_update_grades | ( | $ | quiz, |
| $ | userid = 0, |
||
| $ | nullifnone = true |
||
| ) |
| quiz_update_instance | ( | $ | quiz, |
| $ | mform | ||
| ) |
Given an object containing all the necessary data, (defined by the form in mod_form.php) this function will update an existing instance with new data.
| object | $quiz | the data that came from the form. |
Definition at line 100 of file lib.php.

| quiz_user_complete | ( | $ | course, |
| $ | user, | ||
| $ | mod, | ||
| $ | quiz | ||
| ) |
| quiz_user_outline | ( | $ | course, |
| $ | user, | ||
| $ | mod, | ||
| $ | quiz | ||
| ) |
Return a small object with summary information about what a user has done with a given particular instance of this module Used for user activity reports. $return->time = the time they did it $return->info = a short text description
| object | $course | |
| object | $user | |
| object | $mod | |
| object | $quiz |
Definition at line 367 of file lib.php.
