MDL-59079 core_analytics: Refactor community of inquiry indicators

Refactor code to introduce a new base class per activity. This would help in sharing apis
between cognitive and social classes which is heavily required for level 2 and onwards.

Part of MDL-57791 epic.
This commit is contained in:
Ankit Agarwal 2017-05-30 13:07:48 +05:30 committed by David Monllao
parent 6ec2ae0f87
commit 022f3f07fa
66 changed files with 1235 additions and 476 deletions

View File

@ -1,116 +0,0 @@
<?php
// This file is part of Moodle - http://moodle.org/
//
// Moodle is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// Moodle is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
/**
* Cognitive depth abstract indicator.
*
* @package core_analytics
* @copyright 2017 David Monllao {@link http://www.davidmonllao.com}
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
namespace core_analytics\local\indicator;
defined('MOODLE_INTERNAL') || die();
/**
* Cognitive depth abstract indicator.
*
* @package core_analytics
* @copyright 2017 David Monllao {@link http://www.davidmonllao.com}
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
abstract class activity_cognitive_depth extends community_of_inquiry_activity {
public function calculate_sample($sampleid, $tablename, $starttime = false, $endtime = false) {
// May not be available.
$user = $this->retrieve('user', $sampleid);
if (!$useractivities = $this->get_student_activities($sampleid, $tablename, $starttime, $endtime)) {
// Null if no activities.
return null;
}
$scoreperactivity = (self::get_max_value() - self::get_min_value()) / count($useractivities);
$score = self::get_min_value();
// Iterate through the module activities/resources which due date is part of this time range.
foreach ($useractivities as $contextid => $cm) {
$potentiallevel = $this->get_cognitive_depth_level($cm);
if (!is_int($potentiallevel) || $potentiallevel > 5 || $potentiallevel < 1) {
throw new \coding_exception('Activities\' potential level of engagement possible values go from 1 to 5.');
}
$scoreperlevel = $scoreperactivity / $potentiallevel;
switch ($potentiallevel) {
case 5:
// Cognitive level 4 is to comment on feedback.
if ($this->any_feedback('submitted', $cm, $contextid, $user)) {
$score += $scoreperlevel * 5;
break;
}
// The user didn't reach the activity max cognitive depth, continue with level 2.
case 4:
// Cognitive level 4 is to comment on feedback.
if ($this->any_feedback('replied', $cm, $contextid, $user)) {
$score += $scoreperlevel * 4;
break;
}
// The user didn't reach the activity max cognitive depth, continue with level 2.
case 3:
// Cognitive level 3 is to view feedback.
if ($this->any_feedback('viewed', $cm, $contextid, $user)) {
// Max score for level 3.
$score += $scoreperlevel * 3;
break;
}
// The user didn't reach the activity max cognitive depth, continue with level 2.
case 2:
// Cognitive depth level 2 is to submit content.
if ($this->any_write_log($contextid, $user)) {
$score += $scoreperlevel * 2;
break;
}
// The user didn't reach the activity max cognitive depth, continue with level 1.
case 1:
// Cognitive depth level 1 is just accessing the activity.
if ($this->any_log($contextid, $user)) {
$score += $scoreperlevel;
}
default:
}
}
// To avoid decimal problems.
if ($score > self::MAX_VALUE) {
return self::MAX_VALUE;
} else if ($score < self::MIN_VALUE) {
return self::MIN_VALUE;
}
return $score;
}
}

View File

@ -1,67 +0,0 @@
<?php
// This file is part of Moodle - http://moodle.org/
//
// Moodle is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// Moodle is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
/**
* Social breadth abstract indicator.
*
* @package core_analytics
* @copyright 2017 David Monllao {@link http://www.davidmonllao.com}
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
namespace core_analytics\local\indicator;
defined('MOODLE_INTERNAL') || die();
/**
* Social breadth abstract indicator.
*
* @package core_analytics
* @copyright 2017 David Monllao {@link http://www.davidmonllao.com}
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
abstract class activity_social_breadth extends community_of_inquiry_activity {
public function calculate_sample($sampleid, $tablename, $starttime = false, $endtime = false) {
// May not be available.
$user = $this->retrieve('user', $sampleid);
if (!$useractivities = $this->get_student_activities($sampleid, $tablename, $starttime, $endtime)) {
// Null if no activities.
return null;
}
$scoreperactivity = (self::get_max_value() - self::get_min_value()) / count($useractivities);
$score = self::get_min_value();
foreach ($useractivities as $contextid => $cm) {
// TODO Add support for other levels than 1.
if ($this->any_log($contextid, $user)) {
$score += $scoreperactivity;
}
}
// To avoid decimal problems.
if ($score > self::MAX_VALUE) {
return self::MAX_VALUE;
} else if ($score < self::MIN_VALUE) {
return self::MIN_VALUE;
}
return $score;
}
}

View File

@ -0,0 +1,45 @@
<?php
// This file is part of Moodle - http://moodle.org/
//
// Moodle is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// Moodle is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
/**
* Activity base class.
*
* @package core_analytics
* @copyright 2017 onwards Ankit Agarwal <ankit.agrr@gmail.com>
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
namespace core_analytics\local\indicator\assign;
defined('MOODLE_INTERNAL') || die();
/**
* Activity base class.
*
* @package core_analytics
* @copyright 2017 onwards Ankit Agarwal <ankit.agrr@gmail.com>
* @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 {
public static function get_name() {
return get_string('indicator:cognitivedepthassign', 'analytics');
}
protected function get_activity_type() {
return 'assign';
}
}

View File

@ -33,14 +33,10 @@ defined('MOODLE_INTERNAL') || die();
* @copyright 2017 David Monllao {@link http://www.davidmonllao.com}
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
class cognitive_depth extends \core_analytics\local\indicator\activity_cognitive_depth {
class cognitive_depth extends activity_base {
public static function get_name() {
return get_string('indicator:cognitivedepthassign', 'analytics');
}
protected function get_activity_type() {
return 'assign';
protected function get_indicator_type() {
return self::INDICATOR_COGNITIVE;
}
protected function get_cognitive_depth_level(\cm_info $cm) {

View File

@ -33,13 +33,9 @@ defined('MOODLE_INTERNAL') || die();
* @copyright 2017 David Monllao {@link http://www.davidmonllao.com}
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
class social_breadth extends \core_analytics\local\indicator\activity_social_breadth {
class social_breadth extends activity_base {
public static function get_name() {
return get_string('indicator:socialbreadthassign', 'analytics');
}
protected function get_activity_type() {
return 'assign';
protected function get_indicator_type() {
return self::INDICATOR_SOCIAL;
}
}

View File

@ -0,0 +1,45 @@
<?php
// This file is part of Moodle - http://moodle.org/
//
// Moodle is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// Moodle is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
/**
* Activity base class.
*
* @package core_analytics
* @copyright 2017 onwards Ankit Agarwal <ankit.agrr@gmail.com>
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
namespace core_analytics\local\indicator\book;
defined('MOODLE_INTERNAL') || die();
/**
* Activity base class.
*
* @package core_analytics
* @copyright 2017 onwards Ankit Agarwal <ankit.agrr@gmail.com>
* @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 {
public static function get_name() {
return get_string('indicator:cognitivedepthbook', 'analytics');
}
protected function get_activity_type() {
return 'book';
}
}

View File

@ -33,14 +33,10 @@ defined('MOODLE_INTERNAL') || die();
* @copyright 2017 David Monllao {@link http://www.davidmonllao.com}
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
class cognitive_depth extends \core_analytics\local\indicator\activity_cognitive_depth {
class cognitive_depth extends activity_base {
public static function get_name() {
return get_string('indicator:cognitivedepthbook', 'analytics');
}
protected function get_activity_type() {
return 'book';
protected function get_indicator_type() {
return self::INDICATOR_COGNITIVE;
}
protected function get_cognitive_depth_level(\cm_info $cm) {

View File

@ -33,13 +33,9 @@ defined('MOODLE_INTERNAL') || die();
* @copyright 2017 David Monllao {@link http://www.davidmonllao.com}
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
class social_breadth extends \core_analytics\local\indicator\activity_social_breadth {
class social_breadth extends activity_base {
public static function get_name() {
return get_string('indicator:socialbreadthbook', 'analytics');
}
protected function get_activity_type() {
return 'book';
protected function get_indicator_type() {
return self::INDICATOR_SOCIAL;
}
}

View File

@ -0,0 +1,45 @@
<?php
// This file is part of Moodle - http://moodle.org/
//
// Moodle is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// Moodle is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
/**
* Activity base class.
*
* @package core_analytics
* @copyright 2017 onwards Ankit Agarwal <ankit.agrr@gmail.com>
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
namespace core_analytics\local\indicator\chat;
defined('MOODLE_INTERNAL') || die();
/**
* Activity base class.
*
* @package core_analytics
* @copyright 2017 onwards Ankit Agarwal <ankit.agrr@gmail.com>
* @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 {
public static function get_name() {
return get_string('indicator:cognitivedepthchat', 'analytics');
}
protected function get_activity_type() {
return 'chat';
}
}

View File

@ -33,14 +33,10 @@ defined('MOODLE_INTERNAL') || die();
* @copyright 2017 David Monllao {@link http://www.davidmonllao.com}
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
class cognitive_depth extends \core_analytics\local\indicator\activity_cognitive_depth {
class cognitive_depth extends activity_base {
public static function get_name() {
return get_string('indicator:cognitivedepthchat', 'analytics');
}
protected function get_activity_type() {
return 'chat';
protected function get_indicator_type() {
return self::INDICATOR_COGNITIVE;
}
public function get_cognitive_depth_level(\cm_info $cm) {

View File

@ -33,13 +33,9 @@ defined('MOODLE_INTERNAL') || die();
* @copyright 2017 David Monllao {@link http://www.davidmonllao.com}
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
class social_breadth extends \core_analytics\local\indicator\activity_social_breadth {
class social_breadth extends activity_base {
public static function get_name() {
return get_string('indicator:socialbreadthchat', 'analytics');
}
protected function get_activity_type() {
return 'chat';
protected function get_indicator_type() {
return self::INDICATOR_SOCIAL;
}
}

View File

@ -0,0 +1,45 @@
<?php
// This file is part of Moodle - http://moodle.org/
//
// Moodle is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// Moodle is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
/**
* Activity base class.
*
* @package core_analytics
* @copyright 2017 onwards Ankit Agarwal <ankit.agrr@gmail.com>
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
namespace core_analytics\local\indicator\choice;
defined('MOODLE_INTERNAL') || die();
/**
* Activity base class.
*
* @package core_analytics
* @copyright 2017 onwards Ankit Agarwal <ankit.agrr@gmail.com>
* @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 {
public static function get_name() {
return get_string('indicator:cognitivedepthchoice', 'analytics');
}
protected function get_activity_type() {
return 'choice';
}
}

View File

@ -33,16 +33,12 @@ defined('MOODLE_INTERNAL') || die();
* @copyright 2017 David Monllao {@link http://www.davidmonllao.com}
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
class cognitive_depth extends \core_analytics\local\indicator\activity_cognitive_depth {
class cognitive_depth extends activity_base {
protected $choicedata = array();
public static function get_name() {
return get_string('indicator:cognitivedepthchoice', 'analytics');
}
protected function get_activity_type() {
return 'choice';
protected function get_indicator_type() {
return self::INDICATOR_COGNITIVE;
}
protected function get_cognitive_depth_level(\cm_info $cm) {

View File

@ -33,13 +33,9 @@ defined('MOODLE_INTERNAL') || die();
* @copyright 2017 David Monllao {@link http://www.davidmonllao.com}
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
class social_breadth extends \core_analytics\local\indicator\activity_social_breadth {
class social_breadth extends activity_base {
public static function get_name() {
return get_string('indicator:socialbreadthchoice', 'analytics');
}
protected function get_activity_type() {
return 'choice';
protected function get_indicator_type() {
return self::INDICATOR_SOCIAL;
}
}

View File

@ -48,6 +48,16 @@ abstract class community_of_inquiry_activity extends linear {
*/
protected $grades = null;
/**
* @const Constant cognitive indicator type.
*/
const INDICATOR_COGNITIVE = "cognitve";
/**
* @const Constant social indicator type.
*/
const INDICATOR_SOCIAL = "social";
/**
* TODO Automate this when merging into core.
* @var string The activity name (e.g. assign or quiz)
@ -331,4 +341,158 @@ abstract class community_of_inquiry_activity extends linear {
protected function feedback_check_grades() {
return true;
}
/**
* cognitive_calculate_sample
*
* @param $sampleid
* @param $tablename
* @param bool $starttime
* @param bool $endtime
* @return float|int|null
* @throws \coding_exception
*/
protected function cognitive_calculate_sample($sampleid, $tablename, $starttime = false, $endtime = false) {
// May not be available.
$user = $this->retrieve('user', $sampleid);
if (!$useractivities = $this->get_student_activities($sampleid, $tablename, $starttime, $endtime)) {
// Null if no activities.
return null;
}
$scoreperactivity = (self::get_max_value() - self::get_min_value()) / count($useractivities);
$score = self::get_min_value();
// Iterate through the module activities/resources which due date is part of this time range.
foreach ($useractivities as $contextid => $cm) {
$potentiallevel = $this->get_cognitive_depth_level($cm);
if (!is_int($potentiallevel) || $potentiallevel > 5 || $potentiallevel < 1) {
throw new \coding_exception('Activities\' potential level of engagement possible values go from 1 to 5.');
}
$scoreperlevel = $scoreperactivity / $potentiallevel;
switch ($potentiallevel) {
case 5:
// Cognitive level 4 is to comment on feedback.
if ($this->any_feedback('submitted', $cm, $contextid, $user)) {
$score += $scoreperlevel * 5;
break;
}
// The user didn't reach the activity max cognitive depth, continue with level 2.
case 4:
// Cognitive level 4 is to comment on feedback.
if ($this->any_feedback('replied', $cm, $contextid, $user)) {
$score += $scoreperlevel * 4;
break;
}
// The user didn't reach the activity max cognitive depth, continue with level 2.
case 3:
// Cognitive level 3 is to view feedback.
if ($this->any_feedback('viewed', $cm, $contextid, $user)) {
// Max score for level 3.
$score += $scoreperlevel * 3;
break;
}
// The user didn't reach the activity max cognitive depth, continue with level 2.
case 2:
// Cognitive depth level 2 is to submit content.
if ($this->any_write_log($contextid, $user)) {
$score += $scoreperlevel * 2;
break;
}
// The user didn't reach the activity max cognitive depth, continue with level 1.
case 1:
// Cognitive depth level 1 is just accessing the activity.
if ($this->any_log($contextid, $user)) {
$score += $scoreperlevel;
}
default:
}
}
// To avoid decimal problems.
if ($score > self::MAX_VALUE) {
return self::MAX_VALUE;
} else if ($score < self::MIN_VALUE) {
return self::MIN_VALUE;
}
return $score;
}
/**
* social_calculate_sample
*
* @param $sampleid
* @param $tablename
* @param bool $starttime
* @param bool $endtime
* @return float|int|null
*/
protected function social_calculate_sample($sampleid, $tablename, $starttime = false, $endtime = false) {
// May not be available.
$user = $this->retrieve('user', $sampleid);
if (!$useractivities = $this->get_student_activities($sampleid, $tablename, $starttime, $endtime)) {
// Null if no activities.
return null;
}
$scoreperactivity = (self::get_max_value() - self::get_min_value()) / count($useractivities);
$score = self::get_min_value();
foreach ($useractivities as $contextid => $cm) {
// TODO Add support for other levels than 1.
if ($this->any_log($contextid, $user)) {
$score += $scoreperactivity;
}
}
// To avoid decimal problems.
if ($score > self::MAX_VALUE) {
return self::MAX_VALUE;
} else if ($score < self::MIN_VALUE) {
return self::MIN_VALUE;
}
return $score;
}
/**
* calculate_sample
*
* @param int $sampleid
* @param string $tablename
* @param bool $starttime
* @param bool $endtime
* @return float|int|null
* @throws \coding_exception
*/
public function calculate_sample($sampleid, $tablename, $starttime = false, $endtime = false) {
if ($this->get_indicator_type() == self::INDICATOR_COGNITIVE) {
return $this->cognitive_calculate_sample($sampleid, $tablename, $starttime, $endtime);
} else if ($this->get_indicator_type() == self::INDICATOR_SOCIAL) {
return $this->social_calculate_sample($sampleid, $tablename, $starttime, $endtime);
}
throw new \coding_exception("Indicator type is invalid.");
}
/**
* Defines indicator type.
*
* @return mixed
*/
abstract protected function get_indicator_type();
}

View File

@ -0,0 +1,45 @@
<?php
// This file is part of Moodle - http://moodle.org/
//
// Moodle is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// Moodle is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
/**
* Activity base class.
*
* @package core_analytics
* @copyright 2017 onwards Ankit Agarwal <ankit.agrr@gmail.com>
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
namespace core_analytics\local\indicator\data;
defined('MOODLE_INTERNAL') || die();
/**
* Activity base class.
*
* @package core_analytics
* @copyright 2017 onwards Ankit Agarwal <ankit.agrr@gmail.com>
* @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 {
public static function get_name() {
return get_string('indicator:cognitivedepthdata', 'analytics');
}
protected function get_activity_type() {
return 'data';
}
}

View File

@ -33,14 +33,10 @@ defined('MOODLE_INTERNAL') || die();
* @copyright 2017 David Monllao {@link http://www.davidmonllao.com}
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
class cognitive_depth extends \core_analytics\local\indicator\activity_cognitive_depth {
class cognitive_depth extends activity_base {
public static function get_name() {
return get_string('indicator:cognitivedepthdata', 'analytics');
}
protected function get_activity_type() {
return 'data';
protected function get_indicator_type() {
return self::INDICATOR_COGNITIVE;
}
public function get_cognitive_depth_level(\cm_info $cm) {

View File

@ -33,13 +33,9 @@ defined('MOODLE_INTERNAL') || die();
* @copyright 2017 David Monllao {@link http://www.davidmonllao.com}
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
class social_breadth extends \core_analytics\local\indicator\activity_social_breadth {
class social_breadth extends activity_base {
public static function get_name() {
return get_string('indicator:socialbreadthdata', 'analytics');
}
protected function get_activity_type() {
return 'data';
protected function get_indicator_type() {
return self::INDICATOR_SOCIAL;
}
}

View File

@ -0,0 +1,45 @@
<?php
// This file is part of Moodle - http://moodle.org/
//
// Moodle is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// Moodle is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
/**
* Activity base class.
*
* @package core_analytics
* @copyright 2017 onwards Ankit Agarwal <ankit.agrr@gmail.com>
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
namespace core_analytics\local\indicator\feedback;
defined('MOODLE_INTERNAL') || die();
/**
* Activity base class.
*
* @package core_analytics
* @copyright 2017 onwards Ankit Agarwal <ankit.agrr@gmail.com>
* @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 {
public static function get_name() {
return get_string('indicator:cognitivedepthfeedback', 'analytics');
}
protected function get_activity_type() {
return 'feedback';
}
}

View File

@ -33,19 +33,15 @@ defined('MOODLE_INTERNAL') || die();
* @copyright 2017 David Monllao {@link http://www.davidmonllao.com}
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
class cognitive_depth extends \core_analytics\local\indicator\activity_cognitive_depth {
class cognitive_depth extends activity_base {
/**
* @var int[] Tiny cache to hold feedback instance - publish_stats field relation.
*/
protected $publishstats = array();
public static function get_name() {
return get_string('indicator:cognitivedepthfeedback', 'analytics');
}
protected function get_activity_type() {
return 'feedback';
protected function get_indicator_type() {
return self::INDICATOR_COGNITIVE;
}
protected function get_cognitive_depth_level(\cm_info $cm) {

View File

@ -33,13 +33,9 @@ defined('MOODLE_INTERNAL') || die();
* @copyright 2017 David Monllao {@link http://www.davidmonllao.com}
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
class social_breadth extends \core_analytics\local\indicator\activity_social_breadth {
class social_breadth extends activity_base {
public static function get_name() {
return get_string('indicator:socialbreadthfeedback', 'analytics');
}
protected function get_activity_type() {
return 'feedback';
protected function get_indicator_type() {
return self::INDICATOR_SOCIAL;
}
}

View File

@ -0,0 +1,45 @@
<?php
// This file is part of Moodle - http://moodle.org/
//
// Moodle is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// Moodle is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
/**
* Activity base class.
*
* @package core_analytics
* @copyright 2017 onwards Ankit Agarwal <ankit.agrr@gmail.com>
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
namespace core_analytics\local\indicator\folder;
defined('MOODLE_INTERNAL') || die();
/**
* Activity base class.
*
* @package core_analytics
* @copyright 2017 onwards Ankit Agarwal <ankit.agrr@gmail.com>
* @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 {
public static function get_name() {
return get_string('indicator:cognitivedepthfolder', 'analytics');
}
protected function get_activity_type() {
return 'folder';
}
}

View File

@ -33,15 +33,12 @@ defined('MOODLE_INTERNAL') || die();
* @copyright 2017 David Monllao {@link http://www.davidmonllao.com}
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
class cognitive_depth extends \core_analytics\local\indicator\activity_cognitive_depth {
class cognitive_depth extends activity_base {
public static function get_name() {
return get_string('indicator:cognitivedepthfolder', 'analytics');
protected function get_indicator_type() {
return self::INDICATOR_COGNITIVE;
}
protected function get_activity_type() {
return 'folder';
}
protected function get_cognitive_depth_level(\cm_info $cm) {
return 1;
}

View File

@ -33,13 +33,9 @@ defined('MOODLE_INTERNAL') || die();
* @copyright 2017 David Monllao {@link http://www.davidmonllao.com}
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
class social_breadth extends \core_analytics\local\indicator\activity_social_breadth {
class social_breadth extends activity_base {
public static function get_name() {
return get_string('indicator:socialbreadthfolder', 'analytics');
}
protected function get_activity_type() {
return 'folder';
protected function get_indicator_type() {
return self::INDICATOR_SOCIAL;
}
}

View File

@ -0,0 +1,45 @@
<?php
// This file is part of Moodle - http://moodle.org/
//
// Moodle is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// Moodle is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
/**
* Activity base class.
*
* @package core_analytics
* @copyright 2017 onwards Ankit Agarwal <ankit.agrr@gmail.com>
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
namespace core_analytics\local\indicator\forum;
defined('MOODLE_INTERNAL') || die();
/**
* Activity base class.
*
* @package core_analytics
* @copyright 2017 onwards Ankit Agarwal <ankit.agrr@gmail.com>
* @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 {
public static function get_name() {
return get_string('indicator:cognitivedepthforum', 'core_analytics');
}
protected function get_activity_type() {
return 'forum';
}
}

View File

@ -33,14 +33,10 @@ defined('MOODLE_INTERNAL') || die();
* @copyright 2017 David Monllao {@link http://www.davidmonllao.com}
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
class cognitive_depth extends \core_analytics\local\indicator\activity_cognitive_depth {
class cognitive_depth extends activity_base {
public static function get_name() {
return get_string('indicator:cognitivedepthforum', 'analytics');
}
protected function get_activity_type() {
return 'forum';
protected function get_indicator_type() {
return self::INDICATOR_COGNITIVE;
}
public function get_cognitive_depth_level(\cm_info $cm) {

View File

@ -33,13 +33,9 @@ defined('MOODLE_INTERNAL') || die();
* @copyright 2017 David Monllao {@link http://www.davidmonllao.com}
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
class social_breadth extends \core_analytics\local\indicator\activity_social_breadth {
class social_breadth extends activity_base {
public static function get_name() {
return get_string('indicator:socialbreadthforum', 'analytics');
}
protected function get_activity_type() {
return 'forum';
protected function get_indicator_type() {
return self::INDICATOR_SOCIAL;
}
}

View File

@ -0,0 +1,45 @@
<?php
// This file is part of Moodle - http://moodle.org/
//
// Moodle is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// Moodle is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
/**
* Activity base class.
*
* @package core_analytics
* @copyright 2017 onwards Ankit Agarwal <ankit.agrr@gmail.com>
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
namespace core_analytics\local\indicator\glossary;
defined('MOODLE_INTERNAL') || die();
/**
* Activity base class.
*
* @package core_analytics
* @copyright 2017 onwards Ankit Agarwal <ankit.agrr@gmail.com>
* @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 {
public static function get_name() {
return get_string('indicator:cognitivedepthglossary', 'analytics');
}
protected function get_activity_type() {
return 'glossary';
}
}

View File

@ -33,14 +33,10 @@ defined('MOODLE_INTERNAL') || die();
* @copyright 2017 David Monllao {@link http://www.davidmonllao.com}
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
class cognitive_depth extends \core_analytics\local\indicator\activity_cognitive_depth {
class cognitive_depth extends activity_base {
public static function get_name() {
return get_string('indicator:cognitivedepthglossary', 'analytics');
}
protected function get_activity_type() {
return 'glossary';
protected function get_indicator_type() {
return self::INDICATOR_COGNITIVE;
}
public function get_cognitive_depth_level(\cm_info $cm) {

View File

@ -33,13 +33,9 @@ defined('MOODLE_INTERNAL') || die();
* @copyright 2017 David Monllao {@link http://www.davidmonllao.com}
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
class social_breadth extends \core_analytics\local\indicator\activity_social_breadth {
class social_breadth extends activity_base {
public static function get_name() {
return get_string('indicator:socialbreadthglossary', 'analytics');
}
protected function get_activity_type() {
return 'glossary';
protected function get_indicator_type() {
return self::INDICATOR_SOCIAL;
}
}

View File

@ -0,0 +1,45 @@
<?php
// This file is part of Moodle - http://moodle.org/
//
// Moodle is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// Moodle is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
/**
* Activity base class.
*
* @package core_analytics
* @copyright 2017 onwards Ankit Agarwal <ankit.agrr@gmail.com>
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
namespace core_analytics\local\indicator\imscp;
defined('MOODLE_INTERNAL') || die();
/**
* Activity base class.
*
* @package core_analytics
* @copyright 2017 onwards Ankit Agarwal <ankit.agrr@gmail.com>
* @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 {
public static function get_name() {
return get_string('indicator:cognitivedepthimscp', 'analytics');
}
protected function get_activity_type() {
return 'imscp';
}
}

View File

@ -33,14 +33,10 @@ defined('MOODLE_INTERNAL') || die();
* @copyright 2017 David Monllao {@link http://www.davidmonllao.com}
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
class cognitive_depth extends \core_analytics\local\indicator\activity_cognitive_depth {
class cognitive_depth extends activity_base {
public static function get_name() {
return get_string('indicator:cognitivedepthimscp', 'analytics');
}
protected function get_activity_type() {
return 'imscp';
protected function get_indicator_type() {
return self::INDICATOR_COGNITIVE;
}
protected function get_cognitive_depth_level(\cm_info $cm) {

View File

@ -33,13 +33,9 @@ defined('MOODLE_INTERNAL') || die();
* @copyright 2017 David Monllao {@link http://www.davidmonllao.com}
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
class social_breadth extends \core_analytics\local\indicator\activity_social_breadth {
class social_breadth extends activity_base {
public static function get_name() {
return get_string('indicator:socialbreadthimscp', 'analytics');
}
protected function get_activity_type() {
return 'imscp';
protected function get_indicator_type() {
return self::INDICATOR_SOCIAL;
}
}

View File

@ -0,0 +1,45 @@
<?php
// This file is part of Moodle - http://moodle.org/
//
// Moodle is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// Moodle is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
/**
* Activity base class.
*
* @package core_analytics
* @copyright 2017 onwards Ankit Agarwal <ankit.agrr@gmail.com>
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
namespace core_analytics\local\indicator\label;
defined('MOODLE_INTERNAL') || die();
/**
* Activity base class.
*
* @package core_analytics
* @copyright 2017 onwards Ankit Agarwal <ankit.agrr@gmail.com>
* @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 {
public static function get_name() {
return get_string('indicator:cognitivedepthlabel', 'analytics');
}
protected function get_activity_type() {
return 'label';
}
}

View File

@ -33,14 +33,10 @@ defined('MOODLE_INTERNAL') || die();
* @copyright 2017 David Monllao {@link http://www.davidmonllao.com}
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
class cognitive_depth extends \core_analytics\local\indicator\activity_cognitive_depth {
class cognitive_depth extends activity_base {
public static function get_name() {
return get_string('indicator:cognitivedepthlabel', 'analytics');
}
protected function get_activity_type() {
return 'label';
protected function get_indicator_type() {
return self::INDICATOR_COGNITIVE;
}
protected function get_cognitive_depth_level(\cm_info $cm) {

View File

@ -33,13 +33,9 @@ defined('MOODLE_INTERNAL') || die();
* @copyright 2017 David Monllao {@link http://www.davidmonllao.com}
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
class social_breadth extends \core_analytics\local\indicator\activity_social_breadth {
class social_breadth extends activity_base {
public static function get_name() {
return get_string('indicator:socialbreadthlabel', 'analytics');
}
protected function get_activity_type() {
return 'label';
protected function get_indicator_type() {
return self::INDICATOR_SOCIAL;
}
}

View File

@ -0,0 +1,45 @@
<?php
// This file is part of Moodle - http://moodle.org/
//
// Moodle is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// Moodle is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
/**
* Activity base class.
*
* @package core_analytics
* @copyright 2017 onwards Ankit Agarwal <ankit.agrr@gmail.com>
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
namespace core_analytics\local\indicator\lesson;
defined('MOODLE_INTERNAL') || die();
/**
* Activity base class.
*
* @package core_analytics
* @copyright 2017 onwards Ankit Agarwal <ankit.agrr@gmail.com>
* @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 {
public static function get_name() {
return get_string('indicator:cognitivedepthlesson', 'analytics');
}
protected function get_activity_type() {
return 'lesson';
}
}

View File

@ -33,14 +33,10 @@ defined('MOODLE_INTERNAL') || die();
* @copyright 2017 David Monllao {@link http://www.davidmonllao.com}
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
class cognitive_depth extends \core_analytics\local\indicator\activity_cognitive_depth {
class cognitive_depth extends activity_base {
public static function get_name() {
return get_string('indicator:cognitivedepthlesson', 'analytics');
}
protected function get_activity_type() {
return 'lesson';
protected function get_indicator_type() {
return self::INDICATOR_COGNITIVE;
}
protected function get_cognitive_depth_level(\cm_info $cm) {

View File

@ -33,13 +33,9 @@ defined('MOODLE_INTERNAL') || die();
* @copyright 2017 David Monllao {@link http://www.davidmonllao.com}
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
class social_breadth extends \core_analytics\local\indicator\activity_social_breadth {
class social_breadth extends activity_base {
public static function get_name() {
return get_string('indicator:socialbreadthlesson', 'analytics');
}
protected function get_activity_type() {
return 'lesson';
protected function get_indicator_type() {
return self::INDICATOR_SOCIAL;
}
}

View File

@ -0,0 +1,45 @@
<?php
// This file is part of Moodle - http://moodle.org/
//
// Moodle is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// Moodle is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
/**
* Activity base class.
*
* @package core_analytics
* @copyright 2017 onwards Ankit Agarwal <ankit.agrr@gmail.com>
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
namespace core_analytics\local\indicator\lti;
defined('MOODLE_INTERNAL') || die();
/**
* Activity base class.
*
* @package core_analytics
* @copyright 2017 onwards Ankit Agarwal <ankit.agrr@gmail.com>
* @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 {
public static function get_name() {
return get_string('indicator:cognitivedepthlti', 'analytics');
}
protected function get_activity_type() {
return 'lti';
}
}

View File

@ -33,14 +33,10 @@ defined('MOODLE_INTERNAL') || die();
* @copyright 2017 David Monllao {@link http://www.davidmonllao.com}
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
class cognitive_depth extends \core_analytics\local\indicator\activity_cognitive_depth {
class cognitive_depth extends activity_base {
public static function get_name() {
return get_string('indicator:cognitivedepthlti', 'analytics');
}
protected function get_activity_type() {
return 'lti';
protected function get_indicator_type() {
return self::INDICATOR_COGNITIVE;
}
public function get_cognitive_depth_level(\cm_info $cm) {

View File

@ -33,13 +33,9 @@ defined('MOODLE_INTERNAL') || die();
* @copyright 2017 David Monllao {@link http://www.davidmonllao.com}
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
class social_breadth extends \core_analytics\local\indicator\activity_social_breadth {
class social_breadth extends activity_base {
public static function get_name() {
return get_string('indicator:socialbreadthlti', 'analytics');
}
protected function get_activity_type() {
return 'lti';
protected function get_indicator_type() {
return self::INDICATOR_SOCIAL;
}
}

View File

@ -0,0 +1,45 @@
<?php
// This file is part of Moodle - http://moodle.org/
//
// Moodle is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// Moodle is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
/**
* Activity base class.
*
* @package core_analytics
* @copyright 2017 onwards Ankit Agarwal <ankit.agrr@gmail.com>
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
namespace core_analytics\local\indicator\page;
defined('MOODLE_INTERNAL') || die();
/**
* Activity base class.
*
* @package core_analytics
* @copyright 2017 onwards Ankit Agarwal <ankit.agrr@gmail.com>
* @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 {
public static function get_name() {
return get_string('indicator:cognitivedepthpage', 'analytics');
}
protected function get_activity_type() {
return 'page';
}
}

View File

@ -33,14 +33,10 @@ defined('MOODLE_INTERNAL') || die();
* @copyright 2017 David Monllao {@link http://www.davidmonllao.com}
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
class cognitive_depth extends \core_analytics\local\indicator\activity_cognitive_depth {
class cognitive_depth extends activity_base {
public static function get_name() {
return get_string('indicator:cognitivedepthpage', 'analytics');
}
protected function get_activity_type() {
return 'page';
protected function get_indicator_type() {
return self::INDICATOR_COGNITIVE;
}
protected function get_cognitive_depth_level(\cm_info $cm) {

View File

@ -33,13 +33,9 @@ defined('MOODLE_INTERNAL') || die();
* @copyright 2017 David Monllao {@link http://www.davidmonllao.com}
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
class social_breadth extends \core_analytics\local\indicator\activity_social_breadth {
class social_breadth extends activity_base {
public static function get_name() {
return get_string('indicator:socialbreadthpage', 'analytics');
}
protected function get_activity_type() {
return 'page';
protected function get_indicator_type() {
return self::INDICATOR_SOCIAL;
}
}

View File

@ -0,0 +1,45 @@
<?php
// This file is part of Moodle - http://moodle.org/
//
// Moodle is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// Moodle is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
/**
* Activity base class.
*
* @package core_analytics
* @copyright 2017 onwards Ankit Agarwal <ankit.agrr@gmail.com>
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
namespace core_analytics\local\indicator\quiz;
defined('MOODLE_INTERNAL') || die();
/**
* Activity base class.
*
* @package core_analytics
* @copyright 2017 onwards Ankit Agarwal <ankit.agrr@gmail.com>
* @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 {
public static function get_name() {
return get_string('indicator:cognitivedepthquiz', 'analytics');
}
protected function get_activity_type() {
return 'quiz';
}
}

View File

@ -33,14 +33,10 @@ defined('MOODLE_INTERNAL') || die();
* @copyright 2017 David Monllao {@link http://www.davidmonllao.com}
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
class cognitive_depth extends \core_analytics\local\indicator\activity_cognitive_depth {
class cognitive_depth extends activity_base {
public static function get_name() {
return get_string('indicator:cognitivedepthquiz', 'analytics');
}
protected function get_activity_type() {
return 'quiz';
protected function get_indicator_type() {
return self::INDICATOR_COGNITIVE;
}
public function get_cognitive_depth_level(\cm_info $cm) {

View File

@ -33,13 +33,9 @@ defined('MOODLE_INTERNAL') || die();
* @copyright 2017 David Monllao {@link http://www.davidmonllao.com}
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
class social_breadth extends \core_analytics\local\indicator\activity_social_breadth {
class social_breadth extends activity_base {
public static function get_name() {
return get_string('indicator:socialbreadthquiz', 'analytics');
}
protected function get_activity_type() {
return 'quiz';
protected function get_indicator_type() {
return self::INDICATOR_SOCIAL;
}
}

View File

@ -0,0 +1,45 @@
<?php
// This file is part of Moodle - http://moodle.org/
//
// Moodle is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// Moodle is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
/**
* Activity base class.
*
* @package core_analytics
* @copyright 2017 onwards Ankit Agarwal <ankit.agrr@gmail.com>
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
namespace core_analytics\local\indicator\resource;
defined('MOODLE_INTERNAL') || die();
/**
* Activity base class.
*
* @package core_analytics
* @copyright 2017 onwards Ankit Agarwal <ankit.agrr@gmail.com>
* @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 {
public static function get_name() {
return get_string('indicator:cognitivedepthresource', 'analytics');
}
protected function get_activity_type() {
return 'resource';
}
}

View File

@ -33,14 +33,10 @@ defined('MOODLE_INTERNAL') || die();
* @copyright 2017 David Monllao {@link http://www.davidmonllao.com}
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
class cognitive_depth extends \core_analytics\local\indicator\activity_cognitive_depth {
class cognitive_depth extends activity_base {
public static function get_name() {
return get_string('indicator:cognitivedepthresource', 'analytics');
}
protected function get_activity_type() {
return 'resource';
protected function get_indicator_type() {
return self::INDICATOR_COGNITIVE;
}
protected function get_cognitive_depth_level(\cm_info $cm) {

View File

@ -33,13 +33,9 @@ defined('MOODLE_INTERNAL') || die();
* @copyright 2017 David Monllao {@link http://www.davidmonllao.com}
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
class social_breadth extends \core_analytics\local\indicator\activity_social_breadth {
class social_breadth extends activity_base {
public static function get_name() {
return get_string('indicator:socialbreadthresource', 'analytics');
}
protected function get_activity_type() {
return 'resource';
protected function get_indicator_type() {
return self::INDICATOR_SOCIAL;
}
}

View File

@ -0,0 +1,45 @@
<?php
// This file is part of Moodle - http://moodle.org/
//
// Moodle is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// Moodle is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
/**
* Activity base class.
*
* @package core_analytics
* @copyright 2017 onwards Ankit Agarwal <ankit.agrr@gmail.com>
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
namespace core_analytics\local\indicator\scorm;
defined('MOODLE_INTERNAL') || die();
/**
* Activity base class.
*
* @package core_analytics
* @copyright 2017 onwards Ankit Agarwal <ankit.agrr@gmail.com>
* @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 {
public static function get_name() {
return get_string('indicator:cognitivedepthscorm', 'analytics');
}
protected function get_activity_type() {
return 'scorm';
}
}

View File

@ -33,14 +33,10 @@ defined('MOODLE_INTERNAL') || die();
* @copyright 2017 David Monllao {@link http://www.davidmonllao.com}
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
class cognitive_depth extends \core_analytics\local\indicator\activity_cognitive_depth {
class cognitive_depth extends activity_base {
public static function get_name() {
return get_string('indicator:cognitivedepthscorm', 'analytics');
}
protected function get_activity_type() {
return 'scorm';
protected function get_indicator_type() {
return self::INDICATOR_COGNITIVE;
}
public function get_cognitive_depth_level(\cm_info $cm) {

View File

@ -33,13 +33,9 @@ defined('MOODLE_INTERNAL') || die();
* @copyright 2017 David Monllao {@link http://www.davidmonllao.com}
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
class social_breadth extends \core_analytics\local\indicator\activity_social_breadth {
class social_breadth extends activity_base {
public static function get_name() {
return get_string('indicator:socialbreadthscorm', 'analytics');
}
protected function get_activity_type() {
return 'scorm';
protected function get_indicator_type() {
return self::INDICATOR_SOCIAL;
}
}

View File

@ -0,0 +1,45 @@
<?php
// This file is part of Moodle - http://moodle.org/
//
// Moodle is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// Moodle is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
/**
* Activity base class.
*
* @package core_analytics
* @copyright 2017 onwards Ankit Agarwal <ankit.agrr@gmail.com>
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
namespace core_analytics\local\indicator\survey;
defined('MOODLE_INTERNAL') || die();
/**
* Activity base class.
*
* @package core_analytics
* @copyright 2017 onwards Ankit Agarwal <ankit.agrr@gmail.com>
* @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 {
public static function get_name() {
return get_string('indicator:cognitivedepthsurvey', 'analytics');
}
protected function get_activity_type() {
return 'survey';
}
}

View File

@ -33,14 +33,10 @@ defined('MOODLE_INTERNAL') || die();
* @copyright 2017 David Monllao {@link http://www.davidmonllao.com}
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
class cognitive_depth extends \core_analytics\local\indicator\activity_cognitive_depth {
class cognitive_depth extends activity_base {
public static function get_name() {
return get_string('indicator:cognitivedepthsurvey', 'analytics');
}
protected function get_activity_type() {
return 'survey';
protected function get_indicator_type() {
return self::INDICATOR_COGNITIVE;
}
protected function get_cognitive_depth_level(\cm_info $cm) {

View File

@ -33,13 +33,9 @@ defined('MOODLE_INTERNAL') || die();
* @copyright 2017 David Monllao {@link http://www.davidmonllao.com}
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
class social_breadth extends \core_analytics\local\indicator\activity_social_breadth {
class social_breadth extends activity_base {
public static function get_name() {
return get_string('indicator:socialbreadthsurvey', 'analytics');
}
protected function get_activity_type() {
return 'survey';
protected function get_indicator_type() {
return self::INDICATOR_SOCIAL;
}
}

View File

@ -0,0 +1,45 @@
<?php
// This file is part of Moodle - http://moodle.org/
//
// Moodle is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// Moodle is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
/**
* Activity base class.
*
* @package core_analytics
* @copyright 2017 onwards Ankit Agarwal <ankit.agrr@gmail.com>
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
namespace core_analytics\local\indicator\url;
defined('MOODLE_INTERNAL') || die();
/**
* Activity base class.
*
* @package core_analytics
* @copyright 2017 onwards Ankit Agarwal <ankit.agrr@gmail.com>
* @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 {
public static function get_name() {
return get_string('indicator:cognitivedepthurl', 'analytics');
}
protected function get_activity_type() {
return 'url';
}
}

View File

@ -33,14 +33,10 @@ defined('MOODLE_INTERNAL') || die();
* @copyright 2017 David Monllao {@link http://www.davidmonllao.com}
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
class cognitive_depth extends \core_analytics\local\indicator\activity_cognitive_depth {
class cognitive_depth extends activity_base {
public static function get_name() {
return get_string('indicator:cognitivedepthurl', 'analytics');
}
protected function get_activity_type() {
return 'url';
protected function get_indicator_type() {
return self::INDICATOR_COGNITIVE;
}
protected function get_cognitive_depth_level(\cm_info $cm) {

View File

@ -33,13 +33,9 @@ defined('MOODLE_INTERNAL') || die();
* @copyright 2017 David Monllao {@link http://www.davidmonllao.com}
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
class social_breadth extends \core_analytics\local\indicator\activity_social_breadth {
class social_breadth extends activity_base {
public static function get_name() {
return get_string('indicator:socialbreadthurl', 'analytics');
}
protected function get_activity_type() {
return 'url';
protected function get_indicator_type() {
return self::INDICATOR_SOCIAL;
}
}

View File

@ -0,0 +1,45 @@
<?php
// This file is part of Moodle - http://moodle.org/
//
// Moodle is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// Moodle is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
/**
* Activity base class.
*
* @package core_analytics
* @copyright 2017 onwards Ankit Agarwal <ankit.agrr@gmail.com>
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
namespace core_analytics\local\indicator\wiki;
defined('MOODLE_INTERNAL') || die();
/**
* Activity base class.
*
* @package core_analytics
* @copyright 2017 onwards Ankit Agarwal <ankit.agrr@gmail.com>
* @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 {
public static function get_name() {
return get_string('indicator:cognitivedepthwiki', 'analytics');
}
protected function get_activity_type() {
return 'wiki';
}
}

View File

@ -33,14 +33,10 @@ defined('MOODLE_INTERNAL') || die();
* @copyright 2017 David Monllao {@link http://www.davidmonllao.com}
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
class cognitive_depth extends \core_analytics\local\indicator\activity_cognitive_depth {
class cognitive_depth extends activity_base {
public static function get_name() {
return get_string('indicator:cognitivedepthwiki', 'analytics');
}
protected function get_activity_type() {
return 'wiki';
protected function get_indicator_type() {
return self::INDICATOR_COGNITIVE;
}
public function get_cognitive_depth_level(\cm_info $cm) {

View File

@ -33,13 +33,9 @@ defined('MOODLE_INTERNAL') || die();
* @copyright 2017 David Monllao {@link http://www.davidmonllao.com}
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
class social_breadth extends \core_analytics\local\indicator\activity_social_breadth {
class social_breadth extends activity_base {
public static function get_name() {
return get_string('indicator:socialbreadthwiki', 'analytics');
}
protected function get_activity_type() {
return 'wiki';
protected function get_indicator_type() {
return self::INDICATOR_SOCIAL;
}
}

View File

@ -0,0 +1,45 @@
<?php
// This file is part of Moodle - http://moodle.org/
//
// Moodle is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// Moodle is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
/**
* Activity base class.
*
* @package core_analytics
* @copyright 2017 onwards Ankit Agarwal <ankit.agrr@gmail.com>
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
namespace core_analytics\local\indicator\workshop;
defined('MOODLE_INTERNAL') || die();
/**
* Activity base class.
*
* @package core_analytics
* @copyright 2017 onwards Ankit Agarwal <ankit.agrr@gmail.com>
* @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 {
public static function get_name() {
return get_string('indicator:cognitivedepthworkshop', 'analytics');
}
protected function get_activity_type() {
return 'workshop';
}
}

View File

@ -33,14 +33,10 @@ defined('MOODLE_INTERNAL') || die();
* @copyright 2017 David Monllao {@link http://www.davidmonllao.com}
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
class cognitive_depth extends \core_analytics\local\indicator\activity_cognitive_depth {
class cognitive_depth extends activity_base {
public static function get_name() {
return get_string('indicator:cognitivedepthworkshop', 'analytics');
}
protected function get_activity_type() {
return 'workshop';
protected function get_indicator_type() {
return self::INDICATOR_COGNITIVE;
}
public function get_cognitive_depth_level(\cm_info $cm) {

View File

@ -33,13 +33,9 @@ defined('MOODLE_INTERNAL') || die();
* @copyright 2017 David Monllao {@link http://www.davidmonllao.com}
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
class social_breadth extends \core_analytics\local\indicator\activity_social_breadth {
class social_breadth extends activity_base {
public static function get_name() {
return get_string('indicator:socialbreadthworkshop', 'analytics');
}
protected function get_activity_type() {
return 'workshop';
protected function get_indicator_type() {
return self::INDICATOR_SOCIAL;
}
}