Moodle  2.2.1
http://www.collinsharper.com
C:/xampp/htdocs/moodle/mod/quiz/editlib.php File Reference

Go to the source code of this file.

Data Structures

class  question_bank_add_to_quiz_action_column
class  question_bank_question_name_text_column
class  quiz_question_bank_view

Namespaces

namespace  mod
 

Local Library of functions for module scorm.


Enumerations

enum  NUM_QS_TO_SHOW_IN_RANDOM

Functions

 quiz_remove_question ($quiz, $questionid)
 quiz_delete_empty_page ($layout, $index)
 quiz_add_quiz_question ($id, $quiz, $page=0)
 quiz_add_random_questions ($quiz, $addonpage, $categoryid, $number, $includesubcategories)
 quiz_add_page_break_at ($layout, $index)
 quiz_add_page_break_after ($layout, $questionid)
 quiz_save_new_layout ($quiz)
 quiz_update_question_instance ($grade, $questionid, $quiz)
 _quiz_move_question ($layout, $questionid, $shift)
 quiz_move_question_up ($layout, $questionid)
 quiz_move_question_down ($layout, $questionid)
 quiz_print_question_list ($quiz, $pageurl, $allowdelete, $reordertool, $quiz_qbanktool, $hasattempts, $defaultcategoryobj)
 quiz_print_pagecontrols ($quiz, $pageurl, $page, $hasattempts, $defaultcategoryobj)
 quiz_print_singlequestion ($question, $returnurl, $quiz)
 quiz_print_randomquestion (&$question, &$pageurl, &$quiz, $quiz_qbanktool)
 quiz_print_singlequestion_reordertool ($question, $returnurl, $quiz)
 quiz_print_randomquestion_reordertool (&$question, &$pageurl, &$quiz)
 print_random_option_icon ($question)
 quiz_question_tostring ($question, $showicon=false, $showquestiontext=true, $return=true)
 quiz_print_grading_form ($quiz, $pageurl, $tabindex)
 quiz_print_status_bar ($quiz)

Enumeration Type Documentation

Definition at line 36 of file editlib.php.


Function Documentation

_quiz_move_question ( layout,
questionid,
shift 
)

Definition at line 287 of file editlib.php.

Here is the caller graph for this function:

print_random_option_icon ( question)

Print an icon to indicate the 'include subcategories' state of a random question.

Parameters:
$questionthe random question.

Definition at line 948 of file editlib.php.

Here is the caller graph for this function:

quiz_add_page_break_after ( layout,
questionid 
)

Add a page break after a particular question.

Parameters:
string$layoutthe existinng layout, $quiz->questions.
int$qustionidthe question to add the page break after.
Returns:
the updated layout

Definition at line 231 of file editlib.php.

Here is the caller graph for this function:

quiz_add_page_break_at ( layout,
index 
)

Add a page break after at particular position$.

Parameters:
string$layoutthe existinng layout, $quiz->questions.
int$indexthe position into $layout where the empty page should be removed.
Returns:
the updated layout

Definition at line 214 of file editlib.php.

Here is the caller graph for this function:

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.

Parameters:
int$idThe id of the question to be added
object$quizThe extended quiz object as used by edit.php This is updated by this function
int$pageWhich page in quiz to add the question on. If 0 (default), add at the end
Returns:
bool false if the question was already in the quiz

Definition at line 94 of file editlib.php.

Here is the call graph for this function:

Here is the caller graph for this function:

quiz_add_random_questions ( quiz,
addonpage,
categoryid,
number,
includesubcategories 
)

Definition at line 155 of file editlib.php.

Here is the call graph for this function:

quiz_delete_empty_page ( layout,
index 
)

Remove an empty page from the quiz layout. If that is not possible, do nothing.

Parameters:
string$layoutthe existinng layout, $quiz->questions.
int$indexthe position into $layout where the empty page should be removed.
Returns:
the updated layout

Definition at line 65 of file editlib.php.

Here is the caller graph for this function:

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.

Parameters:
string$layoutthe existinng layout, $quiz->questions.
int$questionidthe id of a question.
Returns:
the updated layout

Definition at line 328 of file editlib.php.

Here is the call graph for this function:

Here is the caller graph for this function:

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.

Parameters:
string$layoutthe existinng layout, $quiz->questions.
int$questionidthe id of a question.
Returns:
the updated layout

Definition at line 317 of file editlib.php.

Here is the call graph for this function:

Here is the caller graph for this function:

quiz_print_grading_form ( quiz,
pageurl,
tabindex 
)

Prints the form for setting a quiz' overall grade

Parameters:
object$quizThe quiz object of the quiz in question
object$pageurlThe url of the current page with the parameters required for links returning to the current page, as a moodle_url object
int$tabindexThe tabindex to start from for the form elements created
Returns:
int The tabindex from which the calling page can continue, that is, the last value used +1.

Definition at line 1214 of file editlib.php.

Here is the call graph for this function:

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

Parameters:
unknown_type$quiz
unknown_type$pageurl
unknown_type$page
unknown_type$hasattempts

Definition at line 711 of file editlib.php.

Here is the call graph for this function:

Here is the caller graph for this function:

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

Returns:
int sum of maximum grades
Parameters:
object$quizThis is not the standard quiz object used elsewhere but it contains the quiz layout in $quiz->questions and the grades in $quiz->grades
object$pageurlThe url of the current page with the parameters required for links returning to the current page, as a moodle_url object
bool$allowdeleteIndicates whether the delete icons should be displayed
bool$reordertoolIndicates whether the reorder tool should be displayed
bool$quiz_qbanktoolIndicates whether the question bank should be displayed
bool$hasattemptsIndicates whether the quiz has attempts

Definition at line 347 of file editlib.php.

Here is the call graph for this function:

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()

Parameters:
object$questionA question object from the database questions table
object$questionurlThe url of the question editing page as a moodle_url object
object$quizThe quiz in the context of which the question is being displayed
bool$quiz_qbanktoolIndicate to this function if the question bank window open

Definition at line 796 of file editlib.php.

Here is the call graph for this function:

Here is the caller graph for this function:

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()

Parameters:
object$questionA question object from the database questions table
object$questionurlThe url of the question editing page as a moodle_url object
object$quizThe quiz in the context of which the question is being displayed

Definition at line 902 of file editlib.php.

Here is the call graph for this function:

Here is the caller graph for this function:

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()

Parameters:
object$questionA question object from the database questions table
object$returnurlThe url to get back to this page, for example after editing.
object$quizThe quiz in the context of which the question is being displayed

Definition at line 776 of file editlib.php.

Here is the call graph for this function:

Here is the caller graph for this function:

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()

Parameters:
object$questionA question object from the database questions table
object$questionurlThe url of the question editing page as a moodle_url object
object$quizThe quiz in the context of which the question is being displayed

Definition at line 883 of file editlib.php.

Here is the call graph for this function:

Here is the caller graph for this function:

quiz_print_status_bar ( quiz)

Print the status bar

Parameters:
object$quizThe quiz object of the quiz in question

Definition at line 1237 of file editlib.php.

Here is the call graph for this function:

quiz_question_tostring ( question,
showicon = false,
showquestiontext = true,
return = true 
)

Creates a textual representation of a question for display.

Parameters:
object$questionA question object from the database questions table
bool$showiconIf true, show the question's icon with the question. False by default.
bool$showquestiontextIf true (default), show question text after question name. If false, show only question name.
bool$returnIf true (default), return the output. If false, print it.

Definition at line 970 of file editlib.php.

Here is the call graph for this function:

Here is the caller graph for this function:

quiz_remove_question ( quiz,
questionid 
)

Remove a question from a quiz

Parameters:
object$quizthe quiz object.
int$questionidThe 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.

Parameters:
$quizthe quiz object.

Definition at line 248 of file editlib.php.

Here is the call graph for this function:

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.

Parameters:
intgrade The maximal grade for the question
int$questionidThe id of the question
int$quizidThe id of the quiz to update / add the instances for.

Definition at line 265 of file editlib.php.

Here is the call graph for this function:

 All Data Structures Namespaces Files Functions Variables Enumerations