From 5bb6773e076d6a2f5f1b7210d932b9b7178166e8 Mon Sep 17 00:00:00 2001 From: Dan Marsden Date: Thu, 13 Aug 2020 14:22:29 +1200 Subject: [PATCH] Fix #453 - add Moodle community of enquiry indicators for analytics. --- classes/analytics/indicator/activity_base.php | 48 +++++++++++++ .../analytics/indicator/cognitive_depth.php | 69 +++++++++++++++++++ .../analytics/indicator/social_breadth.php | 69 +++++++++++++++++++ lang/en/attendance.php | 10 +++ 4 files changed, 196 insertions(+) create mode 100644 classes/analytics/indicator/activity_base.php create mode 100644 classes/analytics/indicator/cognitive_depth.php create mode 100644 classes/analytics/indicator/social_breadth.php diff --git a/classes/analytics/indicator/activity_base.php b/classes/analytics/indicator/activity_base.php new file mode 100644 index 0000000..492b4f2 --- /dev/null +++ b/classes/analytics/indicator/activity_base.php @@ -0,0 +1,48 @@ +. + +/** + * Activity base class. + * + * @package mod_attendance + * @copyright 2020 Catalyst IT + * @author Dan Marsden + * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later + */ + +namespace mod_attendance\analytics\indicator; + +defined('MOODLE_INTERNAL') || die(); + +/** + * Activity base class. + * + * @package mod_attendance + * @copyright 2020 Catalyst IT + * @author Dan Marsden + * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later + */ +abstract class activity_base extends \core_analytics\local\indicator\community_of_inquiry_activity { + + /** + * feedback_viewed_events + * + * @return string[] + */ + protected function feedback_viewed_events() { + return array('\mod_attendance\event\session_report_viewed'); + } +} diff --git a/classes/analytics/indicator/cognitive_depth.php b/classes/analytics/indicator/cognitive_depth.php new file mode 100644 index 0000000..a437a49 --- /dev/null +++ b/classes/analytics/indicator/cognitive_depth.php @@ -0,0 +1,69 @@ +. + +/** + * Cognitive depth indicator - attendance. + * + * @package mod_attendance + * @copyright 2020 Catalyst IT + * @author Dan Marsden + * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later + */ + +namespace mod_attendance\analytics\indicator; + +defined('MOODLE_INTERNAL') || die(); + +/** + * Cognitive depth indicator - attendance. + * + * @package mod_attendance + * @copyright 2020 Catalyst IT + * @author Dan Marsden + * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later + */ +class cognitive_depth extends activity_base { + + /** + * Returns the name. + * + * If there is a corresponding '_help' string this will be shown as well. + * + * @return \lang_string + */ + public static function get_name() : \lang_string { + return new \lang_string('indicator:cognitivedepth', 'mod_attendance'); + } + + /** + * Defines indicator type. + * + * @return string + */ + public function get_indicator_type() { + return self::INDICATOR_COGNITIVE; + } + + /** + * Returns the potential level of cognitive depth. + * + * @param \cm_info $cm + * @return int + */ + public function get_cognitive_depth_level(\cm_info $cm) { + return self::COGNITIVE_LEVEL_3; + } +} diff --git a/classes/analytics/indicator/social_breadth.php b/classes/analytics/indicator/social_breadth.php new file mode 100644 index 0000000..e81f6e8 --- /dev/null +++ b/classes/analytics/indicator/social_breadth.php @@ -0,0 +1,69 @@ +. + +/** + * Social breadth indicator - attendance. + * + * @package mod_attendance + * @copyright 2020 Catalyst IT + * @author Dan Marsden + * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later + */ + +namespace mod_attendance\analytics\indicator; + +defined('MOODLE_INTERNAL') || die(); + +/** + * Social breadth indicator - attendance. + * + * @package mod_attendance + * @copyright 2020 Catalyst IT + * @author Dan Marsden + * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later + */ +class social_breadth extends activity_base { + + /** + * Returns the name. + * + * If there is a corresponding '_help' string this will be shown as well. + * + * @return \lang_string + */ + public static function get_name() : \lang_string { + return new \lang_string('indicator:socialbreadth', 'mod_attendance'); + } + + /** + * Defines indicator type. + * + * @return string + */ + public function get_indicator_type() { + return self::INDICATOR_SOCIAL; + } + + /** + * Returns the potential level of social breadth. + * + * @param \cm_info $cm + * @return int + */ + public function get_social_breadth_level(\cm_info $cm) { + return self::SOCIAL_LEVEL_2; + } +} diff --git a/lang/en/attendance.php b/lang/en/attendance.php index 2c9e1a3..614f455 100644 --- a/lang/en/attendance.php +++ b/lang/en/attendance.php @@ -255,6 +255,16 @@ $string['includeremarks'] = 'Include remarks'; $string['incorrectpassword'] = 'You have entered an incorrect password and your attendance has not been recorded, please enter the correct password.'; $string['incorrectpasswordshort'] = 'Incorrect password, attendance not recorded.'; $string['indetail'] = 'In detail...'; +$string['indicator:cognitivedepth'] = 'Attendance cognitive'; +$string['indicator:cognitivedepth_help'] = 'This indicator is based on the cognitive depth reached by the student in an Attendance activity.'; +$string['indicator:cognitivedepthdef'] = 'Attendance cognitive'; +$string['indicator:cognitivedepthdef_help'] = 'The participant has reached this percentage of the cognitive engagement offered by the Attendance during this analysis interval (Levels = No view, View)'; +$string['indicator:cognitivedepthdef_link'] = 'Learning_analytics_indicators#Cognitive_depth'; +$string['indicator:socialbreadth'] = 'Attendance social'; +$string['indicator:socialbreadth_help'] = 'This indicator is based on the social breadth reached by the student in an Attendance activity.'; +$string['indicator:socialbreadthdef'] = 'Attendance social'; +$string['indicator:socialbreadthdef_help'] = 'The participant has reached this percentage of the social engagement offered by the Attendance during this analysis interval (Levels = No participation, Participant alone)'; +$string['indicator:socialbreadthdef_link'] = 'Learning_analytics_indicators#Social_breadth'; $string['invalidaction'] = 'You must select an action'; $string['invalidemails'] = 'You must specify addresses of existing user accounts, could not find: {$a}'; $string['invalidimportfile'] = 'File format is invalid.';