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

Go to the source code of this file.

Data Structures

class  question_bank_column_base
class  question_bank_checkbox_column
class  question_bank_question_type_column
class  question_bank_question_name_column
class  question_bank_creator_name_column
class  question_bank_modifier_name_column
class  question_bank_action_column_base
class  question_bank_edit_action_column
class  question_bank_preview_action_column
class  question_bank_move_action_column
class  question_bank_delete_action_column
class  question_bank_row_base
class  question_bank_question_text_row
class  question_bank_view

Namespaces

namespace  moodlecore

Enumerations

enum  DEFAULT_QUESTIONS_PER_PAGE

Functions

 get_module_from_cmid ($cmid)
 get_questions_category ($category, $noparent=false, $recurse=true, $export=true)
 question_is_only_toplevel_category_in_context ($categoryid)
 question_can_delete_cat ($todelete)
 question_edit_setup ($edittab, $baseurl, $requirecmid=false, $requirecourseid=true)
 require_login_in_context ($contextorid=null)
 print_choose_qtype_to_add_form ($hiddenparams)
 print_qtype_to_add_option ($qtype)
 create_new_question_button ($categoryid, $params, $caption, $tooltip= '', $disabled=false)

Variables

 $QUESTION_EDITTABCAPS = question_edit_contexts::$caps

Enumeration Type Documentation

Definition at line 31 of file editlib.php.


Function Documentation

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

Parameters:
int$categoryidThe id of the category that the new question should be added to.
array$paramsOther paramters to add to the URL. You need either $params['cmid'] or $params['courseid'], and you should probably set $params['returnurl']
string$captionthe text to display on the button.
string$tooltipa tooltip to add to the button (optional).
bool$disabledif true, the button will be disabled.

Definition at line 1820 of file editlib.php.

Here is the call graph for this function:

Here is the caller graph for this function:

get_module_from_cmid ( cmid)

Definition at line 33 of file editlib.php.

Here is the call graph for this function:

Here is the caller graph for this function:

get_questions_category ( category,
noparent = false,
recurse = true,
export = true 
)

Function to read all questions for category into big array

Parameters:
int$categorycategory number
bool$noparentif true only questions with NO parent will be selected
bool$recurseinclude subdirectories
bool$exportset true if this is called by questionbank export
Author:
added by Howard Miller June 2004

Definition at line 59 of file editlib.php.

Here is the call graph for this function:

Here is the caller graph for this function:

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.

Parameters:
$hiddenparamshidden parameters to add to the form, in addition to the qtype radio buttons.

Definition at line 1747 of file editlib.php.

Here is the call graph for this function:

Here is the caller graph for this function:

Private function used by the preceding one.

Parameters:
$qtypethe question type.

Definition at line 1789 of file editlib.php.

Here is the call graph for this function:

Here is the caller graph for this function:

question_can_delete_cat ( todelete)

Check whether this user is allowed to delete this category.

Parameters:
int$todeletea category id.

Definition at line 113 of file editlib.php.

Here is the call graph for this function:

Here is the caller graph for this function:

question_edit_setup ( edittab,
baseurl,
requirecmid = false,
requirecourseid = true 
)

Common setup for all pages for editing questions.

Parameters:
string$baseurlthe name of the script calling this funciton. For examle 'qusetion/edit.php'.
string$edittabcode for this edit tab
bool$requirecmidrequire cmid? default false
bool$requirecourseidrequire courseid, if cmid is not given? default true
Returns:
array $thispageurl, $contexts, $cmid, $cm, $module, $pagevars

Definition at line 1571 of file editlib.php.

Here is the call graph for this function:

Parameters:
int$categoryida category id.
Returns:
bool whether this is the only top-level category in a context.

Definition at line 97 of file editlib.php.

Here is the caller graph for this function:

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.

Here is the call graph for this function:


Variable Documentation

$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.

 All Data Structures Namespaces Files Functions Variables Enumerations