Moodle APIs 3.9
Moodle 3.9.13+ (Build: 20220325)
Files | Namespaces | Classes | Functions | Variables
mod_feedback

Files

file  access.php
 Plugin capabilities.
 
file  activity.php
 Search area for mod_feedback activities.
 
file  activity_base.php
 Activity base class.
 
 
 
 
 
file  choose_group_form.php
 prints the form to choose the group you want to analyse
 
file  cognitive_depth.php
 Cognitive depth indicator - feedback.
 
file  complete_form.php
 Contains class mod_feedback_complete_form.
 
file  completion.php
 Contains class mod_feedback_completion.
 
file  course_map_form.php
 Contains class mod_feedback_course_map_form.
 
file  course_module_instance_list_viewed.php
 The mod_feedback instance list viewed event.
 
file  course_module_viewed.php
 The mod_feedback course module viewed event.
 
file  course_select_form.php
 Contains class mod_feedback_course_map_form.
 
file  edit_form.php
 prints the forms to choose an item-typ to create items and to choose a template to use
 
file  events.php
 Feedback event handler definition.
 
file  external.php
 Feedback external API.
 
file  feedback_completed_exporter.php
 Class for exporting a feedback completion record.
 
file  feedback_completedtmp_exporter.php
 Class for exporting a feedback temporary completion record.
 
file  feedback_item_exporter.php
 Class for exporting a feedback item (question).
 
file  feedback_summary_exporter.php
 Class for exporting partial feedback data.
 
file  feedback_value_exporter.php
 Class for exporting a feedback response.
 
file  feedback_valuetmp_exporter.php
 Class for exporting a feedback tmp response.
 
file  import_form.php
 prints the forms to choose an xml-template file to import items
 
file  lib.php
 Provides support for the conversion of moodle1 backup to the moodle2 format.
 
file  lib.php
 Library of functions and constants for module feedback includes the main-part of feedback-functions.
 
file  lib.php
 mod_feedback data generator.
 
file  log.php
 Definition of log events.
 
file  messages.php
 Defines message providers (types of messages being sent)
 
file  mod_form.php
 print the form to add or edit a feedback-instance
 
file  observer.php
 Event observers supported by this module.
 
file  provider.php
 Data provider.
 
file  response_deleted.php
 The mod_feedback response deleted event.
 
 
file  responses_anon_table.php
 Contains class mod_feedback_responses_anon_table.
 
file  responses_table.php
 Contains class mod_feedback_responses_table.
 
 
 
file  services.php
 Feedback external functions and service definitions.
 
file  social_breadth.php
 Social breadth indicator - feedback.
 
file  structure.php
 Contains class mod_feedback_structure.
 
file  summary.php
 Contains class mod_feedback::output::summary.
 
file  tabs.php
 prints the tabbed bar
 
file  templates_table.php
 Contains class mod_feedback_templates_table.
 
file  upgrade.php
 This file keeps track of upgrades to the feedback module.
 
file  use_templ_form.php
 prints the form to confirm use template
 
file  version.php
 Feedback version information.
 

Namespaces

 
 
 
 
 
 

Classes

class  backup_feedback_activity_structure_step
 Define all the backup steps that will be used by the backup_feedback_activity_task. More...
 
class  backup_feedback_activity_task
 Provides the steps to perform one complete backup of the Feedback instance. More...
 
class  behat_mod_feedback
 Steps definitions related to mod_feedback. More...
 
class  feedback_edit_create_template_form
 
class  feedback_edit_use_template_form
 
class  feedback_import_form
 
class  mod_feedback\analytics\indicator\activity_base
 Activity base class. More...
 
class  mod_feedback\analytics\indicator\cognitive_depth
 Cognitive depth indicator - feedback. More...
 
class  mod_feedback\analytics\indicator\social_breadth
 Social breadth indicator - feedback. More...
 
class  mod_feedback\event\course_module_instance_list_viewed
 The mod_feedback instance list viewed event class. More...
 
class  mod_feedback\event\course_module_viewed
 
class  mod_feedback\event\response_deleted
 
class  mod_feedback\event\response_submitted
 
class  mod_feedback\external\feedback_completed_exporter
 Class for exporting a feedback completion record. More...
 
class  mod_feedback\external\feedback_completedtmp_exporter
 Class for exporting a feedback temporary completion record. More...
 
class  mod_feedback\external\feedback_item_exporter
 Class for exporting a feedback item (question). More...
 
class  mod_feedback\external\feedback_summary_exporter
 Class for exporting partial feedback data (some fields are only viewable by admins). More...
 
class  mod_feedback\external\feedback_value_exporter
 Class for exporting a feedback response. More...
 
class  mod_feedback\external\feedback_valuetmp_exporter
 Class for exporting a feedback tmp response. More...
 
class  mod_feedback\output\summary
 Class to help display feedback summary. More...
 
class  mod_feedback\privacy\provider
 Data provider class. More...
 
class  mod_feedback\search\activity
 Search area for mod_feedback activities. More...
 
class  mod_feedback_complete_form
 Class mod_feedback_complete_form. More...
 
class  mod_feedback_completion
 Collects information and methods about feedback completion (either complete.php or show_entries.php) More...
 
class  mod_feedback_course_map_form
 Form for mapping courses to the feedback. More...
 
class  mod_feedback_course_select_form
 Form for mapping courses to the feedback. More...
 
class  mod_feedback_external
 
class  mod_feedback_generator
 
class  mod_feedback_mod_form
 
class  mod_feedback_observer
 Event observers supported by this module. More...
 
class  mod_feedback_responses_anon_table
 Class mod_feedback_responses_anon_table. More...
 
class  mod_feedback_responses_table
 Class mod_feedback_responses_table. More...
 
class  mod_feedback_structure
 Stores and manipulates the structure of the feedback or template (items, pages, etc.) More...
 
class  mod_feedback_templates_table
 Class mod_feedback_templates_table. More...
 
class  mod_feedback_use_templ_form
 
class  moodle1_mod_feedback_handler
 Feedback module conversion handler. More...
 
class  restore_feedback_activity_structure_step
 Define all the restore steps that will be used by the restore_feedback_activity_task. More...
 
class  restore_feedback_activity_task
 feedback restore task that provides all the settings and steps to perform one complete restore of the activity 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.
 
 xmldb_feedback_upgrade ($oldversion)
 

Variables

 $activated = array()
 
 $capabilities
 
global $CFG
 
global $CFG
 
 $context = context_module::instance($usedid)
 
 $courseid = optional_param('courseid', false, PARAM_INT)
 
 $feedback_version_intern = 1
 
 $functions
 
 $inactive = array()
 
 $logs
 
 $messageproviders
 
 $observers
 
 $plugin = 2020060900
 
 $row = array()
 
 $row [] = new tabobject('view', $viewurl->out(), get_string('overview', 'feedback'))
 
 $tabs = array()
 
 $urlparams = ['id' => $usedid]
 
if(!isset($current_tab)) $viewurl = new moodle_url('/mod/feedback/view.php', array('id' => $usedid))
 
$plugin component = 'mod_feedback'
 
$plugin cron = 0
 
if(isset($cmid) AND intval($cmid) AND $cmid > 0) else
 
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 ','
 
 if (!defined( 'MOODLE_INTERNAL'))
 
 if (!defined( 'MOODLE_INTERNAL'))
 
 if (!defined( 'MOODLE_INTERNAL'))
 
 if (!defined( 'MOODLE_INTERNAL'))
 
$plugin version = 2020061500
 

Detailed Description

Function Documentation

◆ feedback_add_instance()

object feedback_add_instance (   $feedback)

this will create a new instance and return the id number of the new instance.

Parameters
object$feedbackthe object given by mod_feedback_mod_form
Return values
int

◆ feedback_ajax_saveitemorder()

feedback_ajax_saveitemorder (   $itemlist,
  $feedback 
)

Move save the items of the given $feedback in the order of $itemlist.

Parameters
string$itemlista comma separated list with item ids
stdClass$feedback
Return values
booltrue if success

◆ feedback_can_view_analysis()

feedback_can_view_analysis (   $feedback,
  $context,
  $courseid = false 
)

Checks if current user is able to view feedback on this course.

Parameters
stdClass$feedback
context_module$context
int$courseid
Return values
bool

◆ feedback_check_is_switchrole()

object feedback_check_is_switchrole ( )

returns true if the current role is faked by switching role feature

Return values
boolean

◆ feedback_check_updates_since()

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.

Parameters
cm_info$cmcourse module data
int$fromthe time to check updates from
array$filterif we need to check only specific updates
Return values
stdClassan object with the different type of areas indicating if they were updated or not
Since
Moodle 3.3

◆ feedback_check_values()

feedback_check_values ( )
Deprecated:
since Moodle 3.1

◆ feedback_clean_input_value()

feedback_clean_input_value ( )
Deprecated:
since Moodle 3.1

◆ feedback_clean_up_sitecourse_map()

feedback_clean_up_sitecourse_map ( )
Deprecated:
since 3.1

◆ feedback_compare_item_value()

feedback_compare_item_value (   $completedid,
  $item,
  $dependvalue,
  $tmp = false 
)

compares the value of the itemid related to the completedid with the dependvalue.

this is used if a depend item is set. the value can come as temporary or as permanently value. the deciding is done by $tmp.

Parameters
int$completedid
stdClass | int$item
mixed$dependvalue
bool$tmp
Return values
bool

◆ feedback_count_complete_users()

object feedback_count_complete_users (   $cm,
  $group = false 
)

count users which have completed a feedback

@uses FEEDBACK_ANONYMOUS_NO

Parameters
object$cm
int$groupsingle groupid
Return values
intcount of userrecords

◆ feedback_count_incomplete_users()

object feedback_count_incomplete_users (   $cm,
  $group = false 
)

count users which have not completed the feedback

Parameters
object$cm
int$groupsingle groupid
Return values
intcount of userrecords

◆ feedback_create_item()

feedback_create_item ( )
Deprecated:
since 3.1

◆ feedback_create_pagebreak()

object feedback_create_pagebreak (   $feedbackid)

this creates a pagebreak.

a pagebreak is a special kind of item

Parameters
int$feedbackid
Return values
mixedfalse if there already is a pagebreak on last position or the id of the pagebreak-item

◆ feedback_create_template()

object feedback_create_template (   $courseid,
  $name,
  $ispublic = 0 
)

creates a new template-record.

Parameters
int$courseid
string$namethe name of template shown in the templatelist
int$ispublic0:privat 1:public
Return values
intthe new templateid

◆ feedback_create_values()

feedback_create_values ( )
Deprecated:
since Moodle 3.1

◆ feedback_cron()

feedback_cron ( )
Return values
booltrue

◆ feedback_delete_all_completeds()

feedback_delete_all_completeds (   $feedback,
  $cm = null,
  $course = null 
)

deletes all completed-recordsets from a feedback.

all related data such as values also will be deleted

Parameters
stdClass | int$feedback
stdClass | cm_info$cm
stdClass$course
Return values
void

◆ feedback_delete_all_items()

object feedback_delete_all_items (   $feedbackid)

deletes all items of the given feedbackid

Parameters
int$feedbackid
Return values
void

◆ feedback_delete_completed()

feedback_delete_completed (   $completed,
  $feedback = null,
  $cm = null,
  $course = null 
)

deletes a completed given by completedid.

all related data such values or tracking data also will be deleted

Parameters
int | stdClass$completed
stdClass$feedback
stdClass | cm_info$cm
stdClass$course
Return values
boolean

◆ feedback_delete_completedtmp()

feedback_delete_completedtmp ( )
Deprecated:
since Moodle 3.1

◆ feedback_delete_course_module()

object feedback_delete_course_module (   $id)

this function is called by feedback_delete_userdata() it drops the feedback-instance from the course_module table

Parameters
int$idthe id from the coursemodule
Return values
boolean

◆ feedback_delete_instance()

object feedback_delete_instance (   $id)

this will delete a given instance.

all referenced data also will be deleted

Parameters
int$idthe instanceid of feedback
Return values
boolean

◆ feedback_delete_item()

object feedback_delete_item (   $itemid,
  $renumber = true,
  $template = false 
)

deletes an item and also deletes all related values

@uses CONTEXT_MODULE

Parameters
int$itemid
boolean$renumbershould the kept items renumbered Yes/No
object$templateif the template is given so the items are bound to it
Return values
void

◆ feedback_delete_template()

object feedback_delete_template (   $template)

deletes all feedback_items related to the given template id

@uses CONTEXT_COURSE

Parameters
object$templatethe template
Return values
void

◆ feedback_encode_target_url()

feedback_encode_target_url (   $url)
Parameters
string$url
Return values
string

◆ feedback_extend_settings_navigation()

feedback_extend_settings_navigation ( settings_navigation  $settings,
navigation_node  $feedbacknode 
)

Adds module specific settings to the settings block.

Parameters
settings_navigation$settingsThe settings navigation object
navigation_node$feedbacknodeThe node to add module settings to

◆ feedback_get_all_break_positions()

object feedback_get_all_break_positions (   $feedbackid)

get all positions of pagebreaks in the given feedback

Parameters
int$feedbackid
Return values
arrayall ordered pagebreak positions

◆ feedback_get_complete_users()

object feedback_get_complete_users (   $cm,
  $group = false,
  $where = '',
array  $params = null,
  $sort = '',
  $startpage = false,
  $pagecount = false 
)

get users which have completed a feedback

@uses CONTEXT_MODULE @uses FEEDBACK_ANONYMOUS_NO

Parameters
object$cm
int$groupsingle groupid
string$wherea sql where condition (must end with " AND ")
arrayparameters used in $where
string$sorta table field
int$startpage
int$pagecount
Return values
objectthe userrecords

◆ feedback_get_completeds_group()

object feedback_get_completeds_group (   $feedback,
  $groupid = false,
  $courseid = false 
)

get the completeds depending on the given groupid.

@global object

Parameters
object$feedback
int$groupid
int$courseid
Return values
mixedarray of found completeds otherwise false

◆ feedback_get_completeds_group_count()

object feedback_get_completeds_group_count (   $feedback,
  $groupid = false,
  $courseid = false 
)

get the count of completeds depending on the given groupid.

@global object

Parameters
object$feedback
int$groupid
int$courseid
Return values
mixedcount of completeds or false

◆ feedback_get_completion_state()

feedback_get_completion_state (   $course,
  $cm,
  $userid,
  $type 
)

Obtains the automatic completion state for this feedback based on the condition in feedback settings.

Parameters
object$courseCourse
object$cmCourse-module
int$useridUser ID
bool$typeType of comparison (or/and; can be used as return value if no conditions)
Return values
boolTrue if completed, false if not, $type if conditions not set.

◆ feedback_get_context()

feedback_get_context ( )
Deprecated:
since 3.1

◆ feedback_get_coursemodule_info()

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).

Given a course_module object, this function returns any "extra" information that may be needed when printing this activity in a course listing. See get_array_of_activities() in course/lib.php.

Parameters
stdClass$coursemoduleThe coursemodule object (record).
Return values
cached_cm_infoAn object on information that the courses will know about (most noticeably, an icon).

◆ feedback_get_courses_from_sitecourse_map()

feedback_get_courses_from_sitecourse_map (   $feedbackid)

Gets the courses from table feedback_sitecourse_map.

Parameters
int$feedbackid
Return values
arraythe course-records

◆ feedback_get_current_completed()

feedback_get_current_completed ( )
Deprecated:
since Moodle 3.1. Use feedback_get_current_completed_tmp() or feedback_get_last_completed.

◆ feedback_get_depend_candidates_for_item()

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

Parameters
object$feedback
object$itemthe item of the edit_item form
Return values
arrayall items except the item $item, labels and pagebreaks

◆ feedback_get_editor_options()

feedback_get_editor_options ( )

This gets an array with default options for the editor.

Return values
arraythe options

◆ feedback_get_feedbacks_from_sitecourse_map()

object feedback_get_feedbacks_from_sitecourse_map (   $courseid)

gets the feedbacks from table feedback_sitecourse_map.

this is used to show the global feedbacks on the feedback block all feedbacks with the following criteria will be selected:

1) all feedbacks which id are listed together with the courseid in sitecoursemap and
2) all feedbacks which not are listed in sitecoursemap

Parameters
int$courseid
Return values
arraythe feedback-records

◆ feedback_get_group_values()

object feedback_get_group_values (   $item,
  $groupid = false,
  $courseid = false,
  $ignore_empty = false 
)

get the values of an item depending on the given groupid.

if the feedback is anonymous so the values are shuffled

@global object

Parameters
object$item
int$groupid
int$courseid
bool$ignore_emptyif this is set true so empty values are not delivered
Return values
arraythe value-records

◆ feedback_get_incomplete_users()

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

@uses CONTEXT_MODULE

Parameters
cm_info$cmCourse-module object
int$groupsingle groupid
string$sort
int$startpage
int$pagecount
bool$includestatusto return if the user started or not the feedback among the complete user record
Return values
arrayarray of user ids or user objects when $includestatus set to true

◆ feedback_get_item_class()

feedback_get_item_class (   $typ)

load the lib.php from item-plugin-dir and returns the instance of the itemclass

Parameters
string$typ
Return values
feedback_item_basethe instance of itemclass

◆ feedback_get_item_value()

object feedback_get_item_value (   $completedid,
  $itemid,
  $tmp = false 
)

get the value from the given item related to the given completed.

the value can come as temporary or as permanently value. the deciding is done by $tmp

Parameters
int$completeid
int$itemid
boolean$tmp
Return values
mixedthe value, the type depends on plugin-definition

◆ feedback_get_last_break_position()

feedback_get_last_break_position (   $feedbackid)

get the position of the last pagebreak

Parameters
int$feedbackid
Return values
intthe position of the last pagebreak

◆ feedback_get_page_to_continue()

feedback_get_page_to_continue ( )
Deprecated:
since Moodle 3.1

◆ feedback_get_post_actions()

feedback_get_post_actions ( )

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 values
array

◆ feedback_get_receivemail_users()

feedback_get_receivemail_users (   $cmid,
  $groups = false 
)

get users which have the receivemail-capability

@uses CONTEXT_MODULE

Parameters
int$cmid
mixed$groupssingle groupid or array of groupids - group(s) user is in
Return values
objectthe userrecords

◆ feedback_get_recent_mod_activity()

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.

@global object @global object @global object @uses CONTEXT_MODULE

Parameters
array$activitiesPassed by reference
int$indexPassed by reference
int$timemodifiedTimestamp
int$courseid
int$cmid
int$userid
int$groupid
Return values
void

◆ feedback_get_template_list()

object feedback_get_template_list (   $course,
  $onlyownorpublic = '' 
)

get the list of available templates.

if the $onlyown param is set true so only templates from own course will be served this is important for droping templates

Parameters
object$course
string$onlyownorpublic
Return values
arraythe template recordsets

◆ feedback_get_view_actions()

feedback_get_view_actions ( )

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 values
array

◆ feedback_get_viewreports_users()

feedback_get_viewreports_users (   $cmid,
  $groups = false 
)

get users which have the viewreports-capability

@uses CONTEXT_MODULE

Parameters
int$cmid
mixed$groupssingle groupid or array of groupids - group(s) user is in
Return values
objectthe userrecords

◆ feedback_is_already_submitted()

object feedback_is_already_submitted (   $feedbackid,
  $courseid = false 
)

check for multiple_submit = false.

if the feedback is global so the courseid must be given

@global object

Parameters
int$feedbackid
int$courseid
Return values
booleantrue if the feedback already is submitted otherwise false

◆ feedback_is_course_in_sitecourse_map()

feedback_is_course_in_sitecourse_map ( )
Deprecated:
since 3.1

◆ feedback_is_feedback_in_sitecourse_map()

feedback_is_feedback_in_sitecourse_map ( )
Deprecated:
since 3.1

◆ feedback_items_from_template()

object feedback_items_from_template (   $feedback,
  $templateid,
  $deleteold = false 
)

creates new feedback_item-records from template.

if $deleteold is set true so the existing items of the given feedback will be deleted if $deleteold is set false so the new items will be appanded to the old items

@uses CONTEXT_COURSE @uses CONTEXT_MODULE

Parameters
object$feedback
int$templateid
boolean$deleteold

◆ feedback_load_feedback_items()

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"

Parameters
string$dirthe subdir
Return values
arraypluginnames as string

◆ feedback_load_feedback_items_options()

object feedback_load_feedback_items_options ( )

load the available item plugins to use as dropdown-options

Return values
arraypluginnames as string

◆ feedback_move_item()

object feedback_move_item (   $moveitem,
  $pos 
)

here the position of the given item will be set to the value in $pos

Parameters
object$moveitem
int$pos
Return values
boolean

◆ feedback_movedown_item()

object feedback_movedown_item (   $item)

this increased the position of the given item

Parameters
object$item
Return values
bool

◆ feedback_moveup_item()

object feedback_moveup_item (   $item)

this decreases the position of the given item

Parameters
object$item
Return values
bool

◆ feedback_page_type_list()

feedback_page_type_list (   $pagetype,
  $parentcontext,
  $currentcontext 
)

Return a list of page types.

Parameters
string$pagetypecurrent page type
stdClass$parentcontextBlock's parent context
stdClass$currentcontextCurrent context of block

◆ feedback_print_item_complete()

feedback_print_item_complete ( )
Deprecated:
since Moodle 3.1

◆ feedback_print_item_preview()

feedback_print_item_preview ( )
Deprecated:
since Moodle 3.1

◆ feedback_print_item_show_value()

feedback_print_item_show_value ( )
Deprecated:
since Moodle 3.1

◆ feedback_print_numeric_option_list()

feedback_print_numeric_option_list ( )
Deprecated:
since 3.1

◆ feedback_print_recent_mod_activity()

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.

Parameters
object$activity
int$courseid
string$detail
array$modnames
Return values
voidOutput is echo'd

◆ feedback_refresh_events()

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.

If courseid = 0, then every feedback event in the site is checked, else only feedback events belonging to the course specified are checked. This function is used, in its new format, by restore_refresh_events()

Parameters
int$courseid
int | stdClass$instanceFeedback module instance or ID.
int | stdClass$cmCourse module object or ID (not used in this module).
Return values
bool

◆ feedback_renumber_items()

object feedback_renumber_items (   $feedbackid)

renumbers all items of the given feedbackid

Parameters
int$feedbackid
Return values
void

◆ feedback_reset_course_form()

object feedback_reset_course_form (   $course)

Called by course/reset.php and shows the formdata by coursereset.

it prints checkboxes for each feedback available at the given course there are two checkboxes: 1) delete userdata and keep the feedback 2) delete userdata and drop the feedback

@uses FEEDBACK_RESETFORM_RESET @uses FEEDBACK_RESETFORM_DROP

Parameters
object$course
Return values
void

◆ feedback_reset_course_form_defaults()

object feedback_reset_course_form_defaults (   $course)

Course reset form defaults.

@uses FEEDBACK_RESETFORM_RESET

Parameters
object$course

◆ feedback_reset_course_form_definition()

object feedback_reset_course_form_definition ( $mform)

Called by course/reset.php.

@uses FEEDBACK_RESETFORM_RESET

Parameters
object$mformform passed by reference

◆ feedback_reset_userdata()

object feedback_reset_userdata (   $data)

This function is used by the reset_course_userdata function in moodlelib.

This function will remove all responses from the specified feedback and clean up any related data.

@global object @uses FEEDBACK_RESETFORM_RESET @uses FEEDBACK_RESETFORM_DROP

Parameters
object$datathe data submitted from the reset course.
Return values
arraystatus array

◆ feedback_save_as_template()

object feedback_save_as_template (   $feedback,
  $name,
  $ispublic = 0 
)

creates new template items.

all items will be copied and the attribute feedback will be set to 0 and the attribute template will be set to the new templateid

@uses CONTEXT_MODULE @uses CONTEXT_COURSE

Parameters
object$feedback
string$namethe name of template shown in the templatelist
int$ispublic0:privat 1:public
Return values
boolean

◆ feedback_save_guest_values()

feedback_save_guest_values ( )
Deprecated:
since Moodle 3.1

◆ feedback_save_tmp_values()

object feedback_save_tmp_values (   $feedbackcompletedtmp,
  $feedbackcompleted 
)

this saves the temporary saved values permanently

Parameters
object$feedbackcompletedtmpthe temporary completed
object$feedbackcompletedthe target completed
Return values
intthe id of the completed

◆ feedback_save_values()

feedback_save_values ( )
Deprecated:
since Moodle 3.1

◆ feedback_scale_used()

feedback_scale_used ( )
Deprecated:
since Moodle 3.8

◆ feedback_scale_used_anywhere()

feedback_scale_used_anywhere (   $scaleid)

Checks if scale is being used by any instance of feedback.

This is used to find out if scale used anywhere

Parameters
$scaleidint
Return values
booleanTrue if the scale is used by any assignment

◆ feedback_send_email()

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.

@global object @uses FEEDBACK_ANONYMOUS_NO @uses FORMAT_PLAIN

Parameters
object$cmthe coursemodule-record
object$feedback
object$course
stdClass | int$user
stdClass$completedrecord from feedback_completed if known
Return values
void

◆ feedback_send_email_anonym()

object feedback_send_email_anonym (   $cm,
  $feedback,
  $course 
)

sends an email to the teachers of the course where the given feedback is placed.

@uses FORMAT_PLAIN

Parameters
object$cmthe coursemodule-record
object$feedback
object$course
Return values
void

◆ feedback_send_email_html()

object feedback_send_email_html (   $info,
  $course,
  $cm 
)

send the html-part of the email

Parameters
object$infoincludes some infos about the feedback you want to send
object$course
Return values
stringthe text you want to post

◆ feedback_send_email_text()

feedback_send_email_text (   $info,
  $course 
)

send the text-part of the email

Parameters
object$infoincludes some infos about the feedback you want to send
object$course
Return values
stringthe text you want to post

◆ feedback_set_events()

object feedback_set_events (   $feedback)

This creates new events given as timeopen and closeopen by $feedback.

Parameters
object$feedback
Return values
void

◆ feedback_set_tmp_values()

object feedback_set_tmp_values (   $feedbackcompleted)

if the user completes a feedback and there is a pagebreak so the values are saved temporary.

the values are not saved permanently until the user click on save button

Parameters
object$feedbackcompleted
Return values
objecttemporary saved completed-record

◆ feedback_supports()

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

Parameters
string$featureFEATURE_xx constant for requested feature
Return values
mixedTrue if module supports feature, null if doesn't know

◆ feedback_switch_item_required()

object feedback_switch_item_required (   $item)

this function toggled the item-attribute required (yes/no)

Parameters
object$item
Return values
boolean

◆ feedback_update_instance()

object feedback_update_instance (   $feedback)

this will update a given instance

Parameters
object$feedbackthe object given by mod_feedback_mod_form
Return values
boolean

◆ feedback_update_item()

object feedback_update_item (   $item)

save the changes of a given item.

Parameters
object$item
Return values
boolean

◆ feedback_update_sitecourse_map()

feedback_update_sitecourse_map (   $feedback,
  $courses 
)

Updates the course mapping for the feedback.

Parameters
stdClass$feedback
array$coursesarray of course ids

◆ feedback_update_values()

feedback_update_values ( )
Deprecated:
since Moodle 3.1

◆ feedback_user_complete()

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.

Parameters
stdClass$course
stdClass$user
cm_info | stdClass$mod
stdClass$feedback

◆ feedback_user_outline()

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.

$return->time = the time they did it $return->info = a short text description

Parameters
stdClass$course
stdClass$user
cm_info | stdClass$mod
stdClass$feedback
Return values
stdClass

◆ mod_feedback_core_calendar_event_timestart_updated()

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.

It will set the timeopen or timeclose value of the feedback instance according to the type of event provided.

Exceptions
moodle_exception
Parameters
calendar_event$event
stdClass$feedbackThe module instance to get the range from

◆ mod_feedback_core_calendar_get_valid_event_timestart_range()

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.

It will return an array with two values, the first being the minimum cutoff value and the second being the maximum cutoff value. Either or both values can be null, which indicates there is no minimum or maximum, respectively.

If a cutoff is required then the function must return an array containing the cutoff timestamp and error string to display to the user if the cutoff value is violated.

A minimum and maximum cutoff return value will look like: [ [1505704373, 'The due date must be after the sbumission start date'], [1506741172, 'The due date must be before the cutoff date'] ]

Parameters
calendar_event$eventThe calendar event to get the time range for
stdClass$instanceThe module instance to get the range from
Return values
array

◆ mod_feedback_core_calendar_provide_event_action()

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.

This is used by block_myoverview in order to display the event appropriately. If null is returned then the event is not displayed on the block.

Parameters
calendar_event$event
core_calendar::action_factory$factory
int$useridUser id to use for all capability checks, etc. Set to 0 for current user (default).
Return values
core_calendar::local::event::entities::action_interface|null

◆ mod_feedback_get_completion_active_rule_descriptions()

mod_feedback_get_completion_active_rule_descriptions (   $cm)

Callback which returns human-readable strings describing the active completion custom rules for the module instance.

Parameters
cm_info | stdClass$cmobject with fields ->completion and ->customdata['customcompletionrules']
Return values
array::$descriptionsthe array of descriptions for the custom rules.

Variable Documentation

◆ $logs

$logs
Initial value:
= array(
array('module'=>'feedback', 'action'=>'startcomplete', 'mtable'=>'feedback', 'field'=>'name'),
array('module'=>'feedback', 'action'=>'submit', 'mtable'=>'feedback', 'field'=>'name'),
array('module'=>'feedback', 'action'=>'delete', 'mtable'=>'feedback', 'field'=>'name'),
array('module'=>'feedback', 'action'=>'view', 'mtable'=>'feedback', 'field'=>'name'),
array('module'=>'feedback', 'action'=>'view all', 'mtable'=>'course', 'field'=>'shortname'),
)

◆ $messageproviders

$messageproviders
Initial value:
= array (
'submission' => array (
),
'message' => array (
)
)

◆ $observers

$observers
Initial value:
= array(
array(
'eventname' => '\core\event\course_content_deleted',
'callback' => 'mod_feedback_observer::course_content_deleted',
),
)

◆ else

if (isset( $cmid) AND intval( $cmid) AND $cmid > 0) else
Initial value:
{
$usedid = $id