|
Moodle
2.2.1
http://www.collinsharper.com
|
Go to the source code of this file.
Definition at line 36 of file editlib.php.
| _quiz_move_question | ( | $ | layout, |
| $ | questionid, | ||
| $ | shift | ||
| ) |
| print_random_option_icon | ( | $ | question | ) |
Print an icon to indicate the 'include subcategories' state of a random question.
| $question | the random question. |
Definition at line 948 of file editlib.php.

| quiz_add_page_break_after | ( | $ | layout, |
| $ | questionid | ||
| ) |
Add a page break after a particular question.
| string | $layout | the existinng layout, $quiz->questions. |
| int | $qustionid | the question to add the page break after. |
Definition at line 231 of file editlib.php.

| quiz_add_page_break_at | ( | $ | layout, |
| $ | index | ||
| ) |
Add a page break after at particular position$.
| string | $layout | the existinng layout, $quiz->questions. |
| int | $index | the position into $layout where the empty page should be removed. |
Definition at line 214 of file editlib.php.

| quiz_add_quiz_question | ( | $ | id, |
| $ | quiz, | ||
| $ | page = 0 |
||
| ) |
Add a question to a quiz
Adds a question to a quiz by updating $quiz as well as the quiz and quiz_question_instances tables. It also adds a page break if required.
| int | $id | The id of the question to be added |
| object | $quiz | The extended quiz object as used by edit.php This is updated by this function |
| int | $page | Which page in quiz to add the question on. If 0 (default), add at the end |
Definition at line 94 of file editlib.php.


| quiz_add_random_questions | ( | $ | quiz, |
| $ | addonpage, | ||
| $ | categoryid, | ||
| $ | number, | ||
| $ | includesubcategories | ||
| ) |
| quiz_delete_empty_page | ( | $ | layout, |
| $ | index | ||
| ) |
Remove an empty page from the quiz layout. If that is not possible, do nothing.
| string | $layout | the existinng layout, $quiz->questions. |
| int | $index | the position into $layout where the empty page should be removed. |
Definition at line 65 of file editlib.php.

| quiz_move_question_down | ( | $ | layout, |
| $ | questionid | ||
| ) |
Move a particular question one space later in the $quiz->questions list. If that is not possible, do nothing.
| string | $layout | the existinng layout, $quiz->questions. |
| int | $questionid | the id of a question. |
Definition at line 328 of file editlib.php.


| quiz_move_question_up | ( | $ | layout, |
| $ | questionid | ||
| ) |
Move a particular question one space earlier in the $quiz->questions list. If that is not possible, do nothing.
| string | $layout | the existinng layout, $quiz->questions. |
| int | $questionid | the id of a question. |
Definition at line 317 of file editlib.php.


| quiz_print_grading_form | ( | $ | quiz, |
| $ | pageurl, | ||
| $ | tabindex | ||
| ) |
Prints the form for setting a quiz' overall grade
| object | $quiz | The quiz object of the quiz in question |
| object | $pageurl | The url of the current page with the parameters required for links returning to the current page, as a moodle_url object |
| int | $tabindex | The tabindex to start from for the form elements created |
Definition at line 1214 of file editlib.php.

| quiz_print_pagecontrols | ( | $ | quiz, |
| $ | pageurl, | ||
| $ | page, | ||
| $ | hasattempts, | ||
| $ | defaultcategoryobj | ||
| ) |
Print all the controls for adding questions directly into the specific page in the edit tab of edit.php
| unknown_type | $quiz | |
| unknown_type | $pageurl | |
| unknown_type | $page | |
| unknown_type | $hasattempts |
Definition at line 711 of file editlib.php.


| quiz_print_question_list | ( | $ | quiz, |
| $ | pageurl, | ||
| $ | allowdelete, | ||
| $ | reordertool, | ||
| $ | quiz_qbanktool, | ||
| $ | hasattempts, | ||
| $ | defaultcategoryobj | ||
| ) |
Prints a list of quiz questions for the edit.php main view for edit ($reordertool = false) and order and paging ($reordertool = true) tabs
| object | $quiz | This is not the standard quiz object used elsewhere but it contains the quiz layout in $quiz->questions and the grades in $quiz->grades |
| object | $pageurl | The url of the current page with the parameters required for links returning to the current page, as a moodle_url object |
| bool | $allowdelete | Indicates whether the delete icons should be displayed |
| bool | $reordertool | Indicates whether the reorder tool should be displayed |
| bool | $quiz_qbanktool | Indicates whether the question bank should be displayed |
| bool | $hasattempts | Indicates whether the quiz has attempts |
Definition at line 347 of file editlib.php.

| quiz_print_randomquestion | ( | &$ | question, |
| &$ | pageurl, | ||
| &$ | quiz, | ||
| $ | quiz_qbanktool | ||
| ) |
Print a given random question in quiz for the edit tab of edit.php. Meant to be used from quiz_print_question_list()
| object | $question | A question object from the database questions table |
| object | $questionurl | The url of the question editing page as a moodle_url object |
| object | $quiz | The quiz in the context of which the question is being displayed |
| bool | $quiz_qbanktool | Indicate to this function if the question bank window open |
Definition at line 796 of file editlib.php.


| quiz_print_randomquestion_reordertool | ( | &$ | question, |
| &$ | pageurl, | ||
| &$ | quiz | ||
| ) |
Print a given random question in quiz for the reordertool tab of edit.php. Meant to be used from quiz_print_question_list()
| object | $question | A question object from the database questions table |
| object | $questionurl | The url of the question editing page as a moodle_url object |
| object | $quiz | The quiz in the context of which the question is being displayed |
Definition at line 902 of file editlib.php.


| quiz_print_singlequestion | ( | $ | question, |
| $ | returnurl, | ||
| $ | quiz | ||
| ) |
Print a given single question in quiz for the edit tab of edit.php. Meant to be used from quiz_print_question_list()
| object | $question | A question object from the database questions table |
| object | $returnurl | The url to get back to this page, for example after editing. |
| object | $quiz | The quiz in the context of which the question is being displayed |
Definition at line 776 of file editlib.php.


| quiz_print_singlequestion_reordertool | ( | $ | question, |
| $ | returnurl, | ||
| $ | quiz | ||
| ) |
Print a given single question in quiz for the reordertool tab of edit.php. Meant to be used from quiz_print_question_list()
| object | $question | A question object from the database questions table |
| object | $questionurl | The url of the question editing page as a moodle_url object |
| object | $quiz | The quiz in the context of which the question is being displayed |
Definition at line 883 of file editlib.php.


| quiz_print_status_bar | ( | $ | quiz | ) |
Print the status bar
| object | $quiz | The quiz object of the quiz in question |
Definition at line 1237 of file editlib.php.

| quiz_question_tostring | ( | $ | question, |
| $ | showicon = false, |
||
| $ | showquestiontext = true, |
||
| $ | return = true |
||
| ) |
Creates a textual representation of a question for display.
| object | $question | A question object from the database questions table |
| bool | $showicon | If true, show the question's icon with the question. False by default. |
| bool | $showquestiontext | If true (default), show question text after question name. If false, show only question name. |
| bool | $return | If true (default), return the output. If false, print it. |
Definition at line 970 of file editlib.php.


| quiz_remove_question | ( | $ | quiz, |
| $ | questionid | ||
| ) |
Remove a question from a quiz
| object | $quiz | the quiz object. |
| int | $questionid | The id of the question to be deleted. |
Definition at line 43 of file editlib.php.
| quiz_save_new_layout | ( | $ | quiz | ) |
Update the database after $quiz->questions has been changed. For example, this deletes preview attempts and updates $quiz->sumgrades.
| $quiz | the quiz object. |
Definition at line 248 of file editlib.php.

| quiz_update_question_instance | ( | $ | grade, |
| $ | questionid, | ||
| $ | quiz | ||
| ) |
Save changes to question instance
Saves changes to the question grades in the quiz_question_instances table. It does not update 'sumgrades' in the quiz table.
| int | grade The maximal grade for the question | |
| int | $questionid | The id of the question |
| int | $quizid | The id of the quiz to update / add the instances for. |
Definition at line 265 of file editlib.php.
