Moodle APIs 3.9
Moodle 3.9.13+ (Build: 20220325)
Functions | Variables
lib.php File Reference

Functions

object choice_add_instance ($choice)
 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. More...
 
 choice_can_view_results ($choice, $current=null, $choiceopen=null)
 Return true if we are allowd to view the choice results. More...
 
 choice_check_updates_since (cm_info $cm, $from, $filter=array())
 Check if the module has any update that affects the current user since a given time. More...
 
object choice_delete_instance ($id)
 Given an ID of an instance of this module, this function will permanently delete the instance and any data that depends on it. More...
 
object choice_delete_responses ($attemptids, $choice, $cm, $course)
 
 choice_extend_settings_navigation (settings_navigation $settings, navigation_node $choicenode)
 Adds module specific settings to the settings block. More...
 
 choice_get_all_responses ($choice)
 Get all the responses on a given choice. More...
 
 choice_get_availability_status ($choice)
 Check if a choice is available for the current user. More...
 
object choice_get_choice ($choiceid)
 Gets a full choice record. More...
 
 choice_get_completion_state ($course, $cm, $userid, $type)
 Obtains the automatic completion state for this choice based on any conditions in forum settings. More...
 
 choice_get_coursemodule_info ($coursemodule)
 Add a get_coursemodule_info function in case any choice type wants to add 'extra' information for the course (see resource). More...
 
 choice_get_my_response ($choice)
 Get my responses on a given choice. More...
 
object choice_get_option_text ($choice, $id)
 Returns text string which is the answer that matches the id. More...
 
 choice_get_post_actions ()
 List the actions that correspond to a post of this module. More...
 
object choice_get_response_data ($choice, $cm, $groupmode, $onlyactive)
 @global object @global object @uses CONTEXT_MODULE More...
 
 choice_get_user_response ($choice, $userid)
 Get responses of a given user on a given choice. More...
 
 choice_get_view_actions ()
 List the actions that correspond to a view of this module. More...
 
 choice_modify_responses ($userids, $answerids, $newoptionid, $choice, $cm, $course)
 Modifies responses of other users adding the option $newoptionid to them. More...
 
 choice_page_type_list ($pagetype, $parentcontext, $currentcontext)
 Return a list of page types. More...
 
object choice_prepare_options ($choice, $user, $coursemodule, $allresponses)
 
 choice_print_overview ()
 
 choice_refresh_events ($courseid=0, $instance=null, $cm=null)
 This standard function will check all instances of this module and make sure there are up-to-date events created for each of them. More...
 
 choice_reset_course_form_defaults ($course)
 Course reset form defaults. More...
 
 choice_reset_course_form_definition (&$mform)
 Implementation of the function for printing the form elements that control whether the course reset functionality affects the choice. More...
 
object choice_reset_userdata ($data)
 Actual implementation of the reset course functionality, delete all the choice responses for course $data->courseid. More...
 
 choice_show_reportlink ($user, $cm)
 
 choice_supports ($feature)
 @uses FEATURE_GROUPS @uses FEATURE_GROUPINGS @uses FEATURE_MOD_INTRO @uses FEATURE_COMPLETION_TRACKS_VIEWS @uses FEATURE_GRADE_HAS_GRADE @uses FEATURE_GRADE_OUTCOMES More...
 
object choice_update_instance ($choice)
 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. More...
 
 choice_user_complete ($course, $user, $mod, $choice)
 Callback for the "Complete" report - prints the activity summary for the given user. More...
 
object choice_user_outline ($course, $user, $mod, $choice)
 Standard functions /////////////////////////////////////////////////////////. More...
 
 choice_user_submit_response ($formanswer, $choice, $userid, $course, $cm)
 Process user submitted answers for a choice, and either updating them or saving new answers. More...
 
 choice_view ($choice, $course, $cm, $context)
 Mark the activity completed (if required) and trigger the course_module_viewed event. More...
 
 mod_choice_core_calendar_event_timestart_updated (\calendar_event $event, stdClass $choice)
 This function will update the choice module according to the event that has been modified. More...
 
 mod_choice_core_calendar_get_valid_event_timestart_range (\calendar_event $event, stdClass $choice)
 This function calculates the minimum and maximum cutoff values for the timestart of the given event. More...
 
 mod_choice_core_calendar_provide_event_action (calendar_event $event, core_calendar\action_factory $factory, int $userid=0)
 This function receives a calendar event and returns the action associated with it, or null if there is none. More...
 
 mod_choice_get_completion_active_rule_descriptions ($cm)
 Callback which returns human-readable strings describing the active completion custom rules for the module instance. More...
 
 mod_choice_get_fontawesome_icon_map ()
 Get icon mapping for font-awesome.
 
object prepare_choice_show_results ($choice, $course, $cm, $allresponses)
 

Variables

global int $CHOICE_COLUMN_HEIGHT = 300
 $CHOICE_COLUMN_HEIGHT
 
global int $CHOICE_COLUMN_WIDTH = 300
 $CHOICE_COLUMN_WIDTH
 
global array $CHOICE_DISPLAY
 $CHOICE_DISPLAY More...
 
global array $CHOICE_PUBLISH
 $CHOICE_PUBLISH More...
 
global array $CHOICE_SHOWRESULTS
 $CHOICE_SHOWRESULTS More...
 
const CHOICE_DISPLAY_HORIZONTAL '0'
 
const CHOICE_DISPLAY_VERTICAL '1'
 
const CHOICE_EVENT_TYPE_CLOSE 'close'
 
const CHOICE_EVENT_TYPE_OPEN 'open'
 
const CHOICE_PUBLISH_ANONYMOUS '0'
 
const CHOICE_PUBLISH_NAMES '1'
 
const CHOICE_SHOWRESULTS_AFTER_ANSWER '1'
 
const CHOICE_SHOWRESULTS_AFTER_CLOSE '2'
 
const CHOICE_SHOWRESULTS_ALWAYS '3'
 
const CHOICE_SHOWRESULTS_NOT '0'
 

Detailed Description

License
http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later