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

Library of functions and constants for module feedback includes the main-part of feedback-functions. More...

Functions

object feedback_add_instance ($feedback)
 this will create a new instance and return the id number of the new instance. More...
 
 feedback_ajax_saveitemorder ($itemlist, $feedback)
 Move save the items of the given $feedback in the order of $itemlist. More...
 
 feedback_can_view_analysis ($feedback, $context, $courseid=false)
 Checks if current user is able to view feedback on this course. More...
 
object feedback_check_is_switchrole ()
 returns true if the current role is faked by switching role feature More...
 
 feedback_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...
 
 feedback_check_values ()
 
 feedback_clean_input_value ()
 
 feedback_clean_up_sitecourse_map ()
 
 feedback_compare_item_value ($completedid, $item, $dependvalue, $tmp=false)
 compares the value of the itemid related to the completedid with the dependvalue. More...
 
object feedback_count_complete_users ($cm, $group=false)
 count users which have completed a feedback More...
 
object feedback_count_incomplete_users ($cm, $group=false)
 count users which have not completed the feedback More...
 
 feedback_create_item ()
 
object feedback_create_pagebreak ($feedbackid)
 this creates a pagebreak. More...
 
object feedback_create_template ($courseid, $name, $ispublic=0)
 creates a new template-record. More...
 
 feedback_create_values ()
 
 feedback_cron ()
 
 feedback_delete_all_completeds ($feedback, $cm=null, $course=null)
 deletes all completed-recordsets from a feedback. More...
 
object feedback_delete_all_items ($feedbackid)
 deletes all items of the given feedbackid More...
 
 feedback_delete_completed ($completed, $feedback=null, $cm=null, $course=null)
 deletes a completed given by completedid. More...
 
 feedback_delete_completedtmp ()
 
object feedback_delete_course_module ($id)
 this function is called by feedback_delete_userdata() it drops the feedback-instance from the course_module table More...
 
object feedback_delete_instance ($id)
 this will delete a given instance. More...
 
object feedback_delete_item ($itemid, $renumber=true, $template=false)
 deletes an item and also deletes all related values More...
 
object feedback_delete_template ($template)
 deletes all feedback_items related to the given template id More...
 
 feedback_encode_target_url ($url)
 
 feedback_extend_settings_navigation (settings_navigation $settings, navigation_node $feedbacknode)
 Adds module specific settings to the settings block. More...
 
object feedback_get_all_break_positions ($feedbackid)
 get all positions of pagebreaks in the given feedback More...
 
object feedback_get_complete_users ($cm, $group=false, $where='', array $params=null, $sort='', $startpage=false, $pagecount=false)
 get users which have completed a feedback More...
 
object feedback_get_completeds_group ($feedback, $groupid=false, $courseid=false)
 get the completeds depending on the given groupid. More...
 
object feedback_get_completeds_group_count ($feedback, $groupid=false, $courseid=false)
 get the count of completeds depending on the given groupid. More...
 
 feedback_get_completion_state ($course, $cm, $userid, $type)
 Obtains the automatic completion state for this feedback based on the condition in feedback settings. More...
 
 feedback_get_context ()
 
 feedback_get_coursemodule_info ($coursemodule)
 Add a get_coursemodule_info function in case any feedback type wants to add 'extra' information for the course (see resource). More...
 
 feedback_get_courses_from_sitecourse_map ($feedbackid)
 Gets the courses from table feedback_sitecourse_map. More...
 
 feedback_get_current_completed ()
 
object feedback_get_depend_candidates_for_item ($feedback, $item)
 load the available items for the depend item dropdown list shown in the edit_item form More...
 
 feedback_get_editor_options ()
 This gets an array with default options for the editor. More...
 
object feedback_get_feedbacks_from_sitecourse_map ($courseid)
 gets the feedbacks from table feedback_sitecourse_map. More...
 
object feedback_get_group_values ($item, $groupid=false, $courseid=false, $ignore_empty=false)
 get the values of an item depending on the given groupid. More...
 
object feedback_get_incomplete_users (cm_info $cm, $group=false, $sort='', $startpage=false, $pagecount=false, $includestatus=false)
 count users which have not completed the feedback More...
 
 feedback_get_item_class ($typ)
 load the lib.php from item-plugin-dir and returns the instance of the itemclass More...
 
object feedback_get_item_value ($completedid, $itemid, $tmp=false)
 get the value from the given item related to the given completed. More...
 
 feedback_get_last_break_position ($feedbackid)
 get the position of the last pagebreak More...
 
 feedback_get_page_to_continue ()
 
 feedback_get_post_actions ()
 List the actions that correspond to a post of this module. More...
 
 feedback_get_receivemail_users ($cmid, $groups=false)
 get users which have the receivemail-capability More...
 
object feedback_get_recent_mod_activity (&$activities, &$index, $timemodified, $courseid, $cmid, $userid="", $groupid="")
 Returns all users who has completed a specified feedback since a given time many thanks to Manolescu Dorel, who contributed these two functions. More...
 
object feedback_get_template_list ($course, $onlyownorpublic='')
 get the list of available templates. More...
 
 feedback_get_view_actions ()
 List the actions that correspond to a view of this module. More...
 
 feedback_get_viewreports_users ($cmid, $groups=false)
 get users which have the viewreports-capability More...
 
 feedback_init_feedback_session ()
 
object feedback_is_already_submitted ($feedbackid, $courseid=false)
 check for multiple_submit = false. More...
 
 feedback_is_course_in_sitecourse_map ()
 
 feedback_is_feedback_in_sitecourse_map ()
 
object feedback_items_from_template ($feedback, $templateid, $deleteold=false)
 creates new feedback_item-records from template. More...
 
object feedback_load_feedback_items ($dir='mod/feedback/item')
 load the available item plugins from given subdirectory of $CFG->dirroot the default is "mod/feedback/item" More...
 
object feedback_load_feedback_items_options ()
 load the available item plugins to use as dropdown-options More...
 
object feedback_move_item ($moveitem, $pos)
 here the position of the given item will be set to the value in $pos More...
 
object feedback_movedown_item ($item)
 this increased the position of the given item More...
 
object feedback_moveup_item ($item)
 this decreases the position of the given item More...
 
 feedback_page_type_list ($pagetype, $parentcontext, $currentcontext)
 Return a list of page types. More...
 
 feedback_pluginfile ($course, $cm, $context, $filearea, $args, $forcedownload, array $options=array())
 
 feedback_print_item_complete ()
 
 feedback_print_item_preview ()
 
 feedback_print_item_show_value ()
 
 feedback_print_numeric_option_list ()
 
object feedback_print_recent_mod_activity ($activity, $courseid, $detail, $modnames)
 Prints all users who has completed a specified feedback since a given time many thanks to Manolescu Dorel, who contributed these two functions. More...
 
 feedback_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...
 
object feedback_renumber_items ($feedbackid)
 renumbers all items of the given feedbackid More...
 
object feedback_reset_course_form ($course)
 Called by course/reset.php and shows the formdata by coursereset. More...
 
object feedback_reset_course_form_defaults ($course)
 Course reset form defaults. More...
 
object feedback_reset_course_form_definition (&$mform)
 Called by course/reset.php. More...
 
object feedback_reset_userdata ($data)
 This function is used by the reset_course_userdata function in moodlelib. More...
 
object feedback_save_as_template ($feedback, $name, $ispublic=0)
 creates new template items. More...
 
 feedback_save_guest_values ()
 
object feedback_save_tmp_values ($feedbackcompletedtmp, $feedbackcompleted)
 this saves the temporary saved values permanently More...
 
 feedback_save_values ()
 
 feedback_scale_used ()
 
 feedback_scale_used_anywhere ($scaleid)
 Checks if scale is being used by any instance of feedback. More...
 
object feedback_send_email ($cm, $feedback, $course, $user, $completed=null)
 sends an email to the teachers of the course where the given feedback is placed. More...
 
object feedback_send_email_anonym ($cm, $feedback, $course)
 sends an email to the teachers of the course where the given feedback is placed. More...
 
object feedback_send_email_html ($info, $course, $cm)
 send the html-part of the email More...
 
 feedback_send_email_text ($info, $course)
 send the text-part of the email More...
 
object feedback_set_events ($feedback)
 This creates new events given as timeopen and closeopen by $feedback. More...
 
object feedback_set_tmp_values ($feedbackcompleted)
 if the user completes a feedback and there is a pagebreak so the values are saved temporary. More...
 
 feedback_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 feedback_switch_item_required ($item)
 this function toggled the item-attribute required (yes/no) More...
 
object feedback_update_instance ($feedback)
 this will update a given instance More...
 
object feedback_update_item ($item)
 save the changes of a given item. More...
 
 feedback_update_sitecourse_map ($feedback, $courses)
 Updates the course mapping for the feedback. More...
 
 feedback_update_values ()
 
 feedback_user_complete ($course, $user, $mod, $feedback)
 Print a detailed representation of what a user has done with a given particular instance of this module, for user activity reports. More...
 
 feedback_user_outline ($course, $user, $mod, $feedback)
 Return a small object with summary information about what a user has done with a given particular instance of this module Used for user activity reports. More...
 
 mod_feedback_core_calendar_event_timestart_updated (\calendar_event $event, stdClass $feedback)
 This function will update the feedback module according to the event that has been modified. More...
 
 mod_feedback_core_calendar_get_valid_event_timestart_range (\calendar_event $event, stdClass $instance)
 This function calculates the minimum and maximum cutoff values for the timestart of the given event. More...
 
 mod_feedback_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_feedback_get_completion_active_rule_descriptions ($cm)
 Callback which returns human-readable strings describing the active completion custom rules for the module instance. More...
 
 mod_feedback_get_fontawesome_icon_map ()
 Get icon mapping for font-awesome.
 

Variables

const FEEDBACK_ANONYMOUS_NO 2
 
const FEEDBACK_ANONYMOUS_YES 1
 
const FEEDBACK_DECIMAL '.'
 
const FEEDBACK_DEFAULT_PAGE_COUNT 20
 
const FEEDBACK_EVENT_TYPE_CLOSE 'close'
 
const FEEDBACK_EVENT_TYPE_OPEN 'open'
 
const FEEDBACK_MAX_PIX_LENGTH '400'
 
const FEEDBACK_MIN_ANONYMOUS_COUNT_IN_GROUP 2
 
const FEEDBACK_RESETFORM_DROP 'feedback_drop_feedback_'
 
const FEEDBACK_RESETFORM_RESET 'feedback_reset_data_'
 
const FEEDBACK_THOUSAND ','
 

Detailed Description

Library of functions and constants for module feedback includes the main-part of feedback-functions.

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