Moodle APIs 4.3
Moodle 4.3.6 (Build: 20240812)
lib.php File Reference

Functions

 mod_survey_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.
 
 mod_survey_get_completion_active_rule_descriptions ($cm)
 Callback which returns human-readable strings describing the active completion custom rules for the module instance.
 
object survey_add_analysis ($survey, $user, $notes)
 
object survey_add_instance ($survey)
 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.
 
object survey_already_done ($survey, $user)
 
 survey_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.
 
 survey_count_responses ($surveyid, $groupid, $groupingid)
 
object survey_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.
 
 survey_extend_settings_navigation (settings_navigation $settings, navigation_node $surveynode)
 This function extends the settings navigation block for the site.
 
object survey_get_analysis ($survey, $user)
 
 survey_get_coursemodule_info ($coursemodule)
 Add a get_coursemodule_info function in case any survey type wants to add 'extra' information for the course (see resource).
 
 survey_get_post_actions ()
 List the actions that correspond to a post of this module.
 
 survey_get_questions ($survey)
 Returns the questions for a survey (ordered).
 
object survey_get_responses ($surveyid, $groupid, $groupingid)
 
 survey_get_subquestions ($question)
 Returns subquestions for a given question (ordered).
 
object survey_get_template_name ($templateid)
 
object survey_get_user_answer ($surveyid, $questionid, $userid)
 
object survey_get_user_answers ($surveyid, $questionid, $groupid, $sort="sa.answer1,sa.answer2 ASC")
 
 survey_get_view_actions ()
 List the actions that correspond to a view of this module.
 
object survey_log_info ($log)
 
 survey_order_questions ($questions, $questionorder)
 Helper function for ordering a set of questions by the given ids.
 
 survey_page_type_list ($pagetype, $parentcontext, $currentcontext)
 Return a list of page types.
 
 survey_print_all_responses ($cmid, $results, $courseid)
 
object survey_print_graph ($url)
 @global int @global int
 
object survey_print_multi ($question)
 
stdClass survey_print_recent_activity ($course, $viewfullnames, $timestart)
 @global object
 
object survey_print_single ($question)
 @global int
 
 survey_question_rowclass ($qnum)
 
 survey_reset_course_form_defaults ($course)
 Course reset form defaults.
 
 survey_reset_course_form_definition (&$mform)
 Implementation of the function for printing the form elements that control whether the course reset functionality affects the survey.
 
object survey_reset_userdata ($data)
 Actual implementation of the reset course functionality, delete all the survey responses for course $data->courseid.
 
 survey_save_answers ($survey, $answersrawdata, $course, $context)
 Save the answer for the given survey.
 
 survey_shorten_name ($name, $numwords)
 
 survey_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
 
 survey_translate_question ($question)
 Translate the question texts and options.
 
object survey_update_analysis ($survey, $user, $notes)
 
object survey_update_instance ($survey)
 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.
 
stdObject survey_user_complete ($course, $user, $mod, $survey)
 @global object @uses SURVEY_CIQ
 
object survey_user_outline ($course, $user, $mod, $survey)
 
 survey_view ($survey, $course, $cm, $context, $viewed)
 Mark the activity completed (if required) and trigger the course_module_viewed event.
 

Variables

global int $SURVEY_GHEIGHT = 500
 Graph size $SURVEY_GHEIGHT.
 
global int $SURVEY_GWIDTH = 900
 Graph size $SURVEY_GWIDTH.
 
global array $SURVEY_QTYPE
 Question Type $SURVEY_QTYPE.
 
const SURVEY_ATTLS "4"
 
const SURVEY_CIQ "5"
 
const SURVEY_COLLES_ACTUAL "1"
 
const SURVEY_COLLES_PREFERRED "2"
 
const SURVEY_COLLES_PREFERRED_ACTUAL "3"
 
const SURVEY_QLENGTH_WRAP "80"