[ Index ]

PHP Cross Reference of Unnamed Project

title

Body

[close]

/mod/choice/ -> lib.php (summary)

(no description)

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

Defines 30 functions

  choice_user_outline()
  choice_user_complete()
  choice_add_instance()
  choice_update_instance()
  choice_prepare_options()
  choice_user_submit_response()
  choice_show_reportlink()
  prepare_choice_show_results()
  choice_delete_responses()
  choice_delete_instance()
  choice_get_option_text()
  choice_get_choice()
  choice_get_view_actions()
  choice_get_post_actions()
  choice_reset_course_form_definition()
  choice_reset_course_form_defaults()
  choice_reset_userdata()
  choice_get_response_data()
  choice_get_extra_capabilities()
  choice_supports()
  choice_extend_settings_navigation()
  choice_get_completion_state()
  choice_page_type_list()
  choice_print_overview()
  choice_get_my_response()
  choice_get_all_responses()
  choice_can_view_results()
  choice_view()
  choice_get_availability_status()
  choice_refresh_events()

Functions
Functions that are not part of a class:

choice_user_outline($course, $user, $mod, $choice)   X-Ref

param: object $course
param: object $user
param: object $mod
param: object $choice
return: object|null

choice_user_complete($course, $user, $mod, $choice)   X-Ref
Callback for the "Complete" report - prints the activity summary for the given user

param: object $course
param: object $user
param: object $mod
param: object $choice

choice_add_instance($choice)   X-Ref
Given an object containing all the necessary data,
(defined by the form in mod_form.php) this function
will create a new instance and return the id number
of the new instance.

param: object $choice
return: int

choice_update_instance($choice)   X-Ref
Given an object containing all the necessary data,
(defined by the form in mod_form.php) this function
will update an existing instance with new data.

param: object $choice
return: bool

choice_prepare_options($choice, $user, $coursemodule, $allresponses)   X-Ref

param: object $choice
param: object $user
param: object $coursemodule
param: array $allresponses
return: array

choice_user_submit_response($formanswer, $choice, $userid, $course, $cm)   X-Ref
Process user submitted answers for a choice,
and either updating them or saving new answers.

param: int $formanswer users submitted answers.
param: object $choice the selected choice.
param: int $userid user identifier.
param: object $course current course.
param: object $cm course context.
return: void

choice_show_reportlink($user, $cm)   X-Ref

param: array $user
param: object $cm
return: void Output is echo'd

prepare_choice_show_results($choice, $course, $cm, $allresponses)   X-Ref

param: object $choice
param: object $course
param: object $coursemodule
param: array $allresponses
return: object

choice_delete_responses($attemptids, $choice, $cm, $course)   X-Ref

param: array $attemptids
param: object $choice Choice main table row
param: object $cm Course-module object
param: object $course Course object
return: bool

choice_delete_instance($id)   X-Ref
Given an ID of an instance of this module,
this function will permanently delete the instance
and any data that depends on it.

param: int $id
return: bool

choice_get_option_text($choice, $id)   X-Ref
Returns text string which is the answer that matches the id

param: object $choice
param: int $id
return: string

choice_get_choice($choiceid)   X-Ref
Gets a full choice record

param: int $choiceid
return: object|bool The choice or false

choice_get_view_actions()   X-Ref
List the actions that correspond to a view of this module.
This is used by the participation report.

Note: This is not used by new logging system. Event with
crud = 'r' and edulevel = LEVEL_PARTICIPATING will
be considered as view action.

return: array

choice_get_post_actions()   X-Ref
List the actions that correspond to a post of this module.
This is used by the participation report.

Note: This is not used by new logging system. Event with
crud = ('c' || 'u' || 'd') and edulevel = LEVEL_PARTICIPATING
will be considered as post action.

return: array

choice_reset_course_form_definition(&$mform)   X-Ref
Implementation of the function for printing the form elements that control
whether the course reset functionality affects the choice.

param: object $mform form passed by reference

choice_reset_course_form_defaults($course)   X-Ref
Course reset form defaults.

return: array

choice_reset_userdata($data)   X-Ref
Actual implementation of the reset course functionality, delete all the
choice responses for course $data->courseid.

param: object $data the data submitted from the reset course.
return: array status array

choice_get_response_data($choice, $cm, $groupmode, $onlyactive)   X-Ref

param: object $choice
param: object $cm
param: int $groupmode
param: bool $onlyactive Whether to get response data for active users only.
return: array

choice_get_extra_capabilities()   X-Ref
Returns all other caps used in module

return: array

choice_supports($feature)   X-Ref

param: string $feature FEATURE_xx constant for requested feature
return: mixed True if module supports feature, null if doesn't know

choice_extend_settings_navigation(settings_navigation $settings, navigation_node $choicenode)   X-Ref
Adds module specific settings to the settings block

param: settings_navigation $settings The settings navigation object
param: navigation_node $choicenode The node to add module settings to

choice_get_completion_state($course, $cm, $userid, $type)   X-Ref
Obtains the automatic completion state for this choice based on any conditions
in forum settings.

param: object $course Course
param: object $cm Course-module
param: int $userid User ID
param: bool $type Type of comparison (or/and; can be used as return value if no conditions)
return: bool True if completed, false if not, $type if conditions not set.

choice_page_type_list($pagetype, $parentcontext, $currentcontext)   X-Ref
Return a list of page types

param: string $pagetype current page type
param: stdClass $parentcontext Block's parent context
param: stdClass $currentcontext Current context of block

choice_print_overview($courses, &$htmlarray)   X-Ref
Prints choice summaries on MyMoodle Page

Prints choice name, due date and attempt information on
choice activities that have a deadline that has not already passed
and it is available for completing.
param: array $courses An array of course objects to get choice instances from.
param: array $htmlarray Store overview output array( course ID => 'choice' => HTML output )

choice_get_my_response($choice)   X-Ref
Get my responses on a given choice.

param: stdClass $choice Choice record
return: array of choice answers records

choice_get_all_responses($choice)   X-Ref
Get all the responses on a given choice.

param: stdClass $choice Choice record
return: array of choice answers records

choice_can_view_results($choice, $current = null, $choiceopen = null)   X-Ref
Return true if we are allowd to view the choice results.

param: stdClass $choice Choice record
param: rows|null $current my choice responses
param: bool|null $choiceopen if the choice is open
return: bool true if we can view the results, false otherwise.

choice_view($choice, $course, $cm, $context)   X-Ref
Mark the activity completed (if required) and trigger the course_module_viewed event.

param: stdClass $choice     choice object
param: stdClass $course     course object
param: stdClass $cm         course module object
param: stdClass $context    context object

choice_get_availability_status($choice)   X-Ref
Check if a choice is available for the current user.

param: stdClass  $choice            choice record
return: array                       status (available or not and possible warnings)

choice_refresh_events($courseid = 0)   X-Ref
This standard function will check all instances of this module
and make sure there are up-to-date events created for each of them.
If courseid = 0, then every chat event in the site is checked, else
only chat events belonging to the course specified are checked.
This function is used, in its new format, by restore_refresh_events()

param: int $courseid
return: bool



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