[ Index ]

PHP Cross Reference of Unnamed Project

title

Body

[close]

/question/ -> editlib.php (summary)

Functions used to show question editing interface

Copyright: 1999 onwards Martin Dougiamas and others {@link http://moodle.com}
License: http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
File Size: 502 lines (18 kb)
Included or required: 2 times
Referenced: 8 times
Includes or requires: 0 files

Defines 10 functions

  get_module_from_cmid()
  get_questions_category()
  question_is_only_toplevel_category_in_context()
  question_can_delete_cat()
  question_edit_setup()
  question_get_category_id_from_pagevars()
  question_get_display_preference()
  require_login_in_context()
  print_choose_qtype_to_add_form()
  create_new_question_button()

Functions
Functions that are not part of a class:

get_module_from_cmid($cmid)   X-Ref
No description

get_questions_category( $category, $noparent=false, $recurse=true, $export=true )   X-Ref
Function to read all questions for category into big array

param: int $category category number
param: bool $noparent if true only questions with NO parent will be selected
param: bool $recurse include subdirectories
param: bool $export set true if this is called by questionbank export

question_is_only_toplevel_category_in_context($categoryid)   X-Ref

param: int $categoryid a category id.
return: bool whether this is the only top-level category in a context.

question_can_delete_cat($todelete)   X-Ref
Check whether this user is allowed to delete this category.

param: int $todelete a category id.

question_edit_setup($edittab, $baseurl, $requirecmid = false, $unused = null)   X-Ref
Common setup for all pages for editing questions.

param: string $baseurl the name of the script calling this funciton. For examle 'qusetion/edit.php'.
param: string $edittab code for this edit tab
param: bool $requirecmid require cmid? default false
param: bool $unused no longer used, do no pass
return: array $thispageurl, $contexts, $cmid, $cm, $module, $pagevars

question_get_category_id_from_pagevars(array $pagevars)   X-Ref
Get the category id from $pagevars.

param: array $pagevars from {@link question_edit_setup()}.
return: int the category id.

question_get_display_preference($param, $default, $type, $thispageurl)   X-Ref
Get a particular question preference that is also stored as a user preference.
If the the value is given in the GET/POST request, then that value is used,
and the user preference is updated to that value. Otherwise, the last set
value of the user preference is used, or if it has never been set the default
passed to this function.

param: string $param the param name. The URL parameter set, and the GET/POST
param: mixed $default The default value to use, if not otherwise set.
param: int $type one of the PARAM_... constants.
param: moodle_url $thispageurl if the value has been explicitly set, we add
return: mixed the parameter value to use.

require_login_in_context($contextorid = null)   X-Ref
Make sure user is logged in as required in this context.


print_choose_qtype_to_add_form($hiddenparams, array $allowedqtypes = null, $enablejs = true)   X-Ref
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.

param: $hiddenparams hidden parameters to add to the form, in addition to
param: $allowedqtypes optional list of qtypes that are allowed. If given, only

create_new_question_button($categoryid, $params, $caption, $tooltip = '', $disabled = false)   X-Ref
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).

param: int $categoryid The id of the category that the new question should be added to.
param: array $params Other paramters to add to the URL. You need either $params['cmid'] or
param: string $caption the text to display on the button.
param: string $tooltip a tooltip to add to the button (optional).
param: bool $disabled if true, the button will be disabled.



Generated: Thu Aug 11 10:00:09 2016 Cross-referenced by PHPXref 0.7.1