|
Moodle
2.2.1
http://www.collinsharper.com
|
Go to the source code of this file.
Definition at line 31 of file editlib.php.
| create_new_question_button | ( | $ | categoryid, |
| $ | params, | ||
| $ | caption, | ||
| $ | tooltip = '', |
||
| $ | disabled = false |
||
| ) |
Print a button for creating a new question. This will open question/addquestion.php, which in turn goes to question/question.php before getting back to $params['returnurl'] (by default the question bank screen).
| int | $categoryid | The id of the category that the new question should be added to. |
| array | $params | Other paramters to add to the URL. You need either $params['cmid'] or $params['courseid'], and you should probably set $params['returnurl'] |
| string | $caption | the text to display on the button. |
| string | $tooltip | a tooltip to add to the button (optional). |
| bool | $disabled | if true, the button will be disabled. |
Definition at line 1820 of file editlib.php.


| get_module_from_cmid | ( | $ | cmid | ) |
Definition at line 33 of file editlib.php.


| get_questions_category | ( | $ | category, |
| $ | noparent = false, |
||
| $ | recurse = true, |
||
| $ | export = true |
||
| ) |
Function to read all questions for category into big array
| int | $category | category number |
| bool | $noparent | if true only questions with NO parent will be selected |
| bool | $recurse | include subdirectories |
| bool | $export | set true if this is called by questionbank export |
Definition at line 59 of file editlib.php.


| print_choose_qtype_to_add_form | ( | $ | hiddenparams | ) |
Print a form to let the user choose which question type to add. When the form is submitted, it goes to the question.php script.
| $hiddenparams | hidden parameters to add to the form, in addition to the qtype radio buttons. |
Definition at line 1747 of file editlib.php.


| print_qtype_to_add_option | ( | $ | qtype | ) |
Private function used by the preceding one.
| $qtype | the question type. |
Definition at line 1789 of file editlib.php.


| question_can_delete_cat | ( | $ | todelete | ) |
Check whether this user is allowed to delete this category.
| int | $todelete | a category id. |
Definition at line 113 of file editlib.php.


| question_edit_setup | ( | $ | edittab, |
| $ | baseurl, | ||
| $ | requirecmid = false, |
||
| $ | requirecourseid = true |
||
| ) |
Common setup for all pages for editing questions.
| string | $baseurl | the name of the script calling this funciton. For examle 'qusetion/edit.php'. |
| string | $edittab | code for this edit tab |
| bool | $requirecmid | require cmid? default false |
| bool | $requirecourseid | require courseid, if cmid is not given? default true |
Definition at line 1571 of file editlib.php.

| question_is_only_toplevel_category_in_context | ( | $ | categoryid | ) |
| int | $categoryid | a category id. |
Definition at line 97 of file editlib.php.

| require_login_in_context | ( | $ | contextorid = null | ) |
Make sure user is logged in as required in this context.
Definition at line 1712 of file editlib.php.

| $QUESTION_EDITTABCAPS = question_edit_contexts::$caps |
Required for legacy reasons. Was originally global then changed to class static as of Moodle 2.0
Definition at line 1707 of file editlib.php.