Moodle code style fixes part 8
This commit is contained in:
parent
0911db7ed4
commit
6e9d0cac4a
23 changed files with 326 additions and 311 deletions
|
@ -174,7 +174,7 @@ class badgeinfo {
|
||||||
return $badge;
|
return $badge;
|
||||||
}
|
}
|
||||||
|
|
||||||
function count_issued(array $studentids) {
|
public function count_issued(array $studentids) {
|
||||||
$issuecount = 0;
|
$issuecount = 0;
|
||||||
|
|
||||||
foreach ($studentids as $userid) {
|
foreach ($studentids as $userid) {
|
||||||
|
|
|
@ -87,11 +87,11 @@ class cascadecohortsync {
|
||||||
|
|
||||||
foreach ($courseids as $courseid) {
|
foreach ($courseids as $courseid) {
|
||||||
$course = \get_course($courseid);
|
$course = \get_course($courseid);
|
||||||
//\mtrace("Processing Course {$courseid} {$course->shortname}");.
|
|
||||||
// First create any nonexistent links.
|
// First create any nonexistent links.
|
||||||
foreach ($cohortids as $cohortid) {
|
foreach ($cohortids as $cohortid) {
|
||||||
$cohort = $DB->get_record('cohort', ['id' => $cohortid]);
|
$cohort = $DB->get_record('cohort', ['id' => $cohortid]);
|
||||||
//\mtrace("Processing cohort {$cohortid} {$cohort->shortname}");.
|
|
||||||
|
|
||||||
$instanceparams = [
|
$instanceparams = [
|
||||||
'courseid' => $courseid,
|
'courseid' => $courseid,
|
||||||
|
@ -111,11 +111,11 @@ class cascadecohortsync {
|
||||||
// 1: check if a link exists.
|
// 1: check if a link exists.
|
||||||
// If not, make it (maybe use some of the custom text to list the studyplans involved).
|
// If not, make it (maybe use some of the custom text to list the studyplans involved).
|
||||||
if ($instance = $DB->get_record('enrol', $instanceparams)) {
|
if ($instance = $DB->get_record('enrol', $instanceparams)) {
|
||||||
//\mtrace("Instance exists");.
|
|
||||||
// It already exists.
|
// It already exists.
|
||||||
// Check if this studyplan is already referenced in customtext4 in json format.
|
// Check if this studyplan is already referenced in customtext4 in json format.
|
||||||
|
|
||||||
//TODO: Check this code - Maybe add option to not remember manually added stuff .
|
// TODO: Check this code - Maybe add option to not remember manually added stuff .
|
||||||
$plans = json_decode($instance->customtext4);
|
$plans = json_decode($instance->customtext4);
|
||||||
if ($plans == false || !is_array(($plans))) {
|
if ($plans == false || !is_array(($plans))) {
|
||||||
// If the data was not an array (null or garbled), count it as manually added.
|
// If the data was not an array (null or garbled), count it as manually added.
|
||||||
|
@ -128,19 +128,19 @@ class cascadecohortsync {
|
||||||
}
|
}
|
||||||
if (!in_array($this->studyplanid , $plans)) {
|
if (!in_array($this->studyplanid , $plans)) {
|
||||||
// If not, add it to the reference.
|
// If not, add it to the reference.
|
||||||
//\mtrace("Adding this plan to the list");.
|
|
||||||
$plans[] = (int)($this->studyplanid);
|
$plans[] = (int)($this->studyplanid);
|
||||||
$enrol->update_instance($instance, (object)["customtext4" => json_encode($plans)]);
|
$enrol->update_instance($instance, (object)["customtext4" => json_encode($plans)]);
|
||||||
}
|
}
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
//\mtrace("New instance should be made");.
|
|
||||||
// If method members should be added to a group, create it or get its ID.
|
// If method members should be added to a group, create it or get its ID.
|
||||||
|
|
||||||
if (get_config("local_treestudyplan", "csync_creategroup")) {
|
if (get_config("local_treestudyplan", "csync_creategroup")) {
|
||||||
// Make or get new new cohort group - but only on creating of instances.
|
// Make or get new new cohort group - but only on creating of instances.
|
||||||
$groupname = $cohort->name." ".strtolower(\get_string('defaultgroupname', 'core_group'));
|
$groupname = $cohort->name." ".strtolower(\get_string('defaultgroupname', 'core_group'));
|
||||||
//\mtrace("Adding group {$groupname} for this method");.
|
|
||||||
// And make sure the .
|
// And make sure the .
|
||||||
$instancenewparams['customint2'] = self::uploadenrolmentmethods_get_group($courseid, $groupname);
|
$instancenewparams['customint2'] = self::uploadenrolmentmethods_get_group($courseid, $groupname);
|
||||||
}
|
}
|
||||||
|
@ -148,18 +148,15 @@ class cascadecohortsync {
|
||||||
if ($instanceid = $enrol->add_instance($course, $instancenewparams)) {
|
if ($instanceid = $enrol->add_instance($course, $instancenewparams)) {
|
||||||
// Also record the (as of yet only) studyplans id requiring this association.
|
// Also record the (as of yet only) studyplans id requiring this association.
|
||||||
// In the customtext4 field in json format.
|
// In the customtext4 field in json format.
|
||||||
//\mtrace("Instance ({$instanceid} created. Updateing instance with studyplan id");.
|
|
||||||
$instance = $DB->get_record('enrol', array('id' => $instanceid));
|
$instance = $DB->get_record('enrol', array('id' => $instanceid));
|
||||||
$enrol->update_instance($instance, (object)["customtext4" => json_encode([(int)($this->studyplanid)])]);
|
$enrol->update_instance($instance, (object)["customtext4" => json_encode([(int)($this->studyplanid)])]);
|
||||||
|
|
||||||
//\mtrace("Synchronize the enrolment");.
|
|
||||||
// Successfully added a valid new instance, so now instantiate it.
|
// Successfully added a valid new instance, so now instantiate it.
|
||||||
// First synchronise the enrolment.
|
// First synchronise the enrolment.
|
||||||
$cohorttrace = new \null_progress_trace();
|
$cohorttrace = new \null_progress_trace();
|
||||||
$result = enrol_cohort_sync($cohorttrace, $cohortid);
|
$result = enrol_cohort_sync($cohorttrace, $cohortid);
|
||||||
if ($result > 0) {
|
|
||||||
//\mtrace("Error during 'enrol_cohort_sync': code {$result}");.
|
|
||||||
}
|
|
||||||
$cohorttrace->finished();
|
$cohorttrace->finished();
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
|
@ -181,7 +178,7 @@ class cascadecohortsync {
|
||||||
|
|
||||||
if (get_config("local_treestudyplan", "csync_autoremove")) {
|
if (get_config("local_treestudyplan", "csync_autoremove")) {
|
||||||
// Only try the autoremove if the option is enabled.
|
// Only try the autoremove if the option is enabled.
|
||||||
//\mtrace("Autoremove scan for course {$courseid} {$course->shortname}");.
|
|
||||||
// Find all cohort syncs for this course.
|
// Find all cohort syncs for this course.
|
||||||
$searchparams = [
|
$searchparams = [
|
||||||
'courseid' => $courseid,
|
'courseid' => $courseid,
|
||||||
|
@ -195,24 +192,24 @@ class cascadecohortsync {
|
||||||
// Only check the records that have studyplan information in the customtext4 field.
|
// Only check the records that have studyplan information in the customtext4 field.
|
||||||
// First check if the cohort is not one of the cohort id's we have associated.
|
// First check if the cohort is not one of the cohort id's we have associated.
|
||||||
if (!in_array($instance->customint1, $cohortids)) {
|
if (!in_array($instance->customint1, $cohortids)) {
|
||||||
//\mtrace("Found cohort sync instance that is not currently liked to the studyplan: {$instance->id}");.
|
|
||||||
// So it may or may not need to be removed.
|
// So it may or may not need to be removed.
|
||||||
$plans = json_decode($instance->customtext4);
|
$plans = json_decode($instance->customtext4);
|
||||||
if ($plans !== null && is_array($plans)) {
|
if ($plans !== null && is_array($plans)) {
|
||||||
//if a valid array is not returned, better leave it be, we don't want to mess with it.
|
// If a valid array is not returned, better leave it be, we don't want to mess with it.
|
||||||
// Otherwise, check if we should remove it.
|
// Otherwise, check if we should remove it.
|
||||||
if (in_array($this->studyplanid, $plans)) {
|
if (in_array($this->studyplanid, $plans)) {
|
||||||
//\mtrace("Found this studyplan in the id list - removing from list");.
|
|
||||||
//if this plan was referenced before.
|
// If this plan was referenced before.
|
||||||
// First remove the link.
|
// First remove the link.
|
||||||
$fplans = self::array_remove_value($plans, $this->studyplanid);
|
$fplans = self::array_remove_value($plans, $this->studyplanid);
|
||||||
if (count($fplans) == 0) {
|
if (count($fplans) == 0) {
|
||||||
// Delete the sync if there are no studyplan references left.
|
// Delete the sync if there are no studyplan references left.
|
||||||
//\mtrace("No references are left, removing instance");.
|
|
||||||
$enrol->delete_instance($instance);
|
$enrol->delete_instance($instance);
|
||||||
} else {
|
} else {
|
||||||
// Otherwise just update the references so this studyplan is no longer linked.
|
// Otherwise just update the references so this studyplan is no longer linked.
|
||||||
//\mtrace("Still references left in the list, updating list...");.
|
|
||||||
$enrol->update_instance($instance, (object)["customtext4" => json_encode($fplans)]);
|
$enrol->update_instance($instance, (object)["customtext4" => json_encode($fplans)]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -222,6 +219,6 @@ class cascadecohortsync {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
//\mtrace("Cascading complete");.
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -427,8 +427,8 @@ class corecompletioninfo {
|
||||||
} else { // Typeaggregation == COMPLETION_AGGREGATION_ANY.
|
} else { // Typeaggregation == COMPLETION_AGGREGATION_ANY.
|
||||||
// Count and progress are either 1 or 0, since any of the items.
|
// Count and progress are either 1 or 0, since any of the items.
|
||||||
// Complete's the type.
|
// Complete's the type.
|
||||||
$cinfo["count"] = (count($cinfo["items"]) > 0)?1:0;
|
$cinfo["count"] = (count($cinfo["items"]) > 0) ? 1 : 0;
|
||||||
$cinfo["progress"] = ($progress>0)?1:0;
|
$cinfo["progress"] = ($progress>0) ? 1 : 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
$info['conditions'][] = $cinfo;
|
$info['conditions'][] = $cinfo;
|
||||||
|
@ -645,7 +645,7 @@ class corecompletioninfo {
|
||||||
$cmpl = $c->completed;
|
$cmpl = $c->completed;
|
||||||
} else {
|
} else {
|
||||||
$ct = 1;
|
$ct = 1;
|
||||||
$cmpl = ($c->completed > 0)?1:0;
|
$cmpl = ($c->completed > 0) ? 1 : 0;
|
||||||
}
|
}
|
||||||
// If ANY completion for the types, count only the criteria type with the highest completion percentage -.
|
// If ANY completion for the types, count only the criteria type with the highest completion percentage -.
|
||||||
// Overwrite data if current type is more complete.
|
// Overwrite data if current type is more complete.
|
||||||
|
|
|
@ -56,8 +56,8 @@ class courseservice extends \external_api {
|
||||||
"id" => new \external_value(PARAM_INT, 'course category id'),
|
"id" => new \external_value(PARAM_INT, 'course category id'),
|
||||||
"context_id" => new \external_value(PARAM_INT, 'course category context id'),
|
"context_id" => new \external_value(PARAM_INT, 'course category context id'),
|
||||||
"category" => contextinfo::structure(VALUE_OPTIONAL),
|
"category" => contextinfo::structure(VALUE_OPTIONAL),
|
||||||
"haschildren" => new \external_value(PARAM_BOOL, 'True if the category has child categories'),
|
"haschildren" => new \external_value(PARAM_BOOL, 'true if the category has child categories'),
|
||||||
"hascourses" => new \external_value(PARAM_BOOL, 'True if the category contains courses'),
|
"hascourses" => new \external_value(PARAM_BOOL, 'true if the category contains courses'),
|
||||||
"studyplancount" => new \external_value(PARAM_INT, 'number of linked studyplans', VALUE_OPTIONAL),
|
"studyplancount" => new \external_value(PARAM_INT, 'number of linked studyplans', VALUE_OPTIONAL),
|
||||||
];
|
];
|
||||||
|
|
||||||
|
|
|
@ -384,7 +384,7 @@ class gradeinfo {
|
||||||
$r = $DB->get_record($table, ['studyitem_id' => $itemid, 'grade_item_id' => $gradeid]);
|
$r = $DB->get_record($table, ['studyitem_id' => $itemid, 'grade_item_id' => $gradeid]);
|
||||||
if ($r) {
|
if ($r) {
|
||||||
$r->include = 1;
|
$r->include = 1;
|
||||||
$r->required = boolval($required)?1:0;
|
$r->required = boolval($required) ? 1 : 0;
|
||||||
$id = $DB->update_record($table, $r);
|
$id = $DB->update_record($table, $r);
|
||||||
} else {
|
} else {
|
||||||
$DB->insert_record($table, [
|
$DB->insert_record($table, [
|
||||||
|
|
|
@ -103,9 +103,9 @@ class gradingscanner {
|
||||||
} else {
|
} else {
|
||||||
$grade = $this->gi->get_final($userid);
|
$grade = $this->gi->get_final($userid);
|
||||||
if (!is_numeric($grade->finalgrade) && empty($grade->finalgrade)) {
|
if (!is_numeric($grade->finalgrade) && empty($grade->finalgrade)) {
|
||||||
//skip.
|
// Skip.
|
||||||
} else {
|
} else {
|
||||||
//compare grade to minimum grade.
|
// Compare grade to minimum grade.
|
||||||
if ($this->grade_passed($grade)) {
|
if ($this->grade_passed($grade)) {
|
||||||
$completedpass++;
|
$completedpass++;
|
||||||
} else {
|
} else {
|
||||||
|
|
|
@ -36,9 +36,9 @@ class bistate_aggregator extends \local_treestudyplan\aggregator {
|
||||||
private $threshexcellent = 1.0; // Minimum fraction that must be completed to aggregate as excellent (usually 1.0).
|
private $threshexcellent = 1.0; // Minimum fraction that must be completed to aggregate as excellent (usually 1.0).
|
||||||
private $threshgood = 0.8; // Minimum fraction that must be completed to aggregate as good.
|
private $threshgood = 0.8; // Minimum fraction that must be completed to aggregate as good.
|
||||||
private $threshcompleted = 0.66; // Minimum fraction that must be completed to aggregate as completed.
|
private $threshcompleted = 0.66; // Minimum fraction that must be completed to aggregate as completed.
|
||||||
private $usefailed = True; // Support failed completion yes/no.
|
private $usefailed = true; // Support failed completion yes/no.
|
||||||
private $threshprogress = 0.33; // Minimum fraction that must be failed to aggregate as failed instead of progress.
|
private $threshprogress = 0.33; // Minimum fraction that must be failed to aggregate as failed instead of progress.
|
||||||
private $acceptpending_as_submitted = False; // Also count ungraded but submitted .
|
private $acceptpending_as_submitted = false; // Also count ungraded but submitted .
|
||||||
|
|
||||||
public function __construct($configstr) {
|
public function __construct($configstr) {
|
||||||
// Allow public constructor for testing purposes.
|
// Allow public constructor for testing purposes.
|
||||||
|
@ -76,8 +76,6 @@ class bistate_aggregator extends \local_treestudyplan\aggregator {
|
||||||
$this->$key = boolval($config[$key]);
|
$this->$key = boolval($config[$key]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else {
|
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -93,10 +91,18 @@ class bistate_aggregator extends \local_treestudyplan\aggregator {
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function needSelectGradables() { return True;}
|
public function needSelectGradables() {
|
||||||
public function isDeprecated() { return self::DEPRECATED;}
|
return true;
|
||||||
public function useRequiredGrades() { return True;}
|
}
|
||||||
public function useItemConditions() { return False;}
|
public function isDeprecated() {
|
||||||
|
return self::DEPRECATED;
|
||||||
|
}
|
||||||
|
public function useRequiredGrades() {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
public function useItemConditions() {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
public function aggregate_binary_goals(array $completions, array $required = []) {
|
public function aggregate_binary_goals(array $completions, array $required = []) {
|
||||||
// Function is public to allow access for the testing code.
|
// Function is public to allow access for the testing code.
|
||||||
|
@ -123,9 +129,9 @@ class bistate_aggregator extends \local_treestudyplan\aggregator {
|
||||||
|
|
||||||
foreach ($completions as $index => $c) {
|
foreach ($completions as $index => $c) {
|
||||||
|
|
||||||
$completed += ($c >= completion::COMPLETED)?1:0;
|
$completed += ($c >= completion::COMPLETED) ? 1 : 0;
|
||||||
$progress += ($c >= $MINPROGRESS)?1:0;
|
$progress += ($c >= $MINPROGRESS) ? 1 : 0;
|
||||||
$failed += ($c <= completion::FAILED)?1:0;
|
$failed += ($c <= completion::FAILED) ? 1 : 0;
|
||||||
}
|
}
|
||||||
$started = $progress + $failed;
|
$started = $progress + $failed;
|
||||||
$allrequiredmet = ($requiredmet >= $totalrequired);
|
$allrequiredmet = ($requiredmet >= $totalrequired);
|
||||||
|
@ -219,7 +225,7 @@ class bistate_aggregator extends \local_treestudyplan\aggregator {
|
||||||
|
|
||||||
if (empty($grade)) {
|
if (empty($grade)) {
|
||||||
return completion::INCOMPLETE;
|
return completion::INCOMPLETE;
|
||||||
} else if ($grade->finalgrade === NULL) {
|
} else if ($grade->finalgrade === null) {
|
||||||
// On assignments, grade NULL means a submission has not yet been graded,.
|
// On assignments, grade NULL means a submission has not yet been graded,.
|
||||||
// But on quizes this can also mean a quiz might have been started.
|
// But on quizes this can also mean a quiz might have been started.
|
||||||
// Therefor, we treat a NULL result as a reason to check the relevant gradingscanner for presence of pending items.
|
// Therefor, we treat a NULL result as a reason to check the relevant gradingscanner for presence of pending items.
|
||||||
|
|
|
@ -32,7 +32,7 @@ use \local_treestudyplan\debug;
|
||||||
|
|
||||||
class core_aggregator extends \local_treestudyplan\aggregator {
|
class core_aggregator extends \local_treestudyplan\aggregator {
|
||||||
public const DEPRECATED = false;
|
public const DEPRECATED = false;
|
||||||
private $acceptpending_as_submitted = False; // Also count ungraded but submitted .
|
private $acceptpending_as_submitted = false; // Also count ungraded but submitted .
|
||||||
|
|
||||||
public function __construct($configstr) {
|
public function __construct($configstr) {
|
||||||
// Allow public constructor for testing purposes.
|
// Allow public constructor for testing purposes.
|
||||||
|
@ -55,8 +55,6 @@ class core_aggregator extends \local_treestudyplan\aggregator {
|
||||||
$this->$key = boolval($config[$key]);
|
$this->$key = boolval($config[$key]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else {
|
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -67,11 +65,21 @@ class core_aggregator extends \local_treestudyplan\aggregator {
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function needSelectGradables() { return False;}
|
public function needSelectGradables() {
|
||||||
public function isDeprecated() { return self::DEPRECATED;}
|
return false;
|
||||||
public function useRequiredGrades() { return True;}
|
}
|
||||||
public function useItemConditions() { return False;}
|
public function isDeprecated() {
|
||||||
public function usecorecompletioninfo() { return True; }
|
return self::DEPRECATED;
|
||||||
|
}
|
||||||
|
public function useRequiredGrades() {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
public function useItemConditions() {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
public function usecorecompletioninfo() {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Return course completion information based on the core completion infromation
|
* Return course completion information based on the core completion infromation
|
||||||
|
@ -172,7 +180,7 @@ class core_aggregator extends \local_treestudyplan\aggregator {
|
||||||
|
|
||||||
if (empty($grade)) {
|
if (empty($grade)) {
|
||||||
return completion::INCOMPLETE;
|
return completion::INCOMPLETE;
|
||||||
} else if ($grade->finalgrade === NULL) {
|
} else if ($grade->finalgrade === null) {
|
||||||
// On assignments, grade NULL means a submission has not yet been graded,.
|
// On assignments, grade NULL means a submission has not yet been graded,.
|
||||||
// But on quizes this can also mean a quiz might have been started.
|
// But on quizes this can also mean a quiz might have been started.
|
||||||
// Therefor, we treat a NULL result as a reason to check the relevant gradingscanner for presence of pending items.
|
// Therefor, we treat a NULL result as a reason to check the relevant gradingscanner for presence of pending items.
|
||||||
|
|
|
@ -32,10 +32,18 @@ class tristate_aggregator extends \local_treestudyplan\aggregator {
|
||||||
public const DEPRECATED = true;
|
public const DEPRECATED = true;
|
||||||
private const DEFAULT_CONDITION = "50";
|
private const DEFAULT_CONDITION = "50";
|
||||||
|
|
||||||
public function needSelectGradables() { return True;}
|
public function needSelectGradables() {
|
||||||
public function isDeprecated() { return self::DEPRECATED;}
|
return true;
|
||||||
public function useRequiredGrades() { return False;}
|
}
|
||||||
public function useItemConditions() { return True;}
|
public function isDeprecated() {
|
||||||
|
return self::DEPRECATED;
|
||||||
|
}
|
||||||
|
public function useRequiredGrades() {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
public function useItemConditions() {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
protected function aggregate_completion(array $a, $condition = "50") {
|
protected function aggregate_completion(array $a, $condition = "50") {
|
||||||
if (in_array($condition, ['ALL', '67', '50', 'ANY'])) {
|
if (in_array($condition, ['ALL', '67', '50', 'ANY'])) {
|
||||||
|
@ -49,10 +57,10 @@ class tristate_aggregator extends \local_treestudyplan\aggregator {
|
||||||
if ($count > 0) {
|
if ($count > 0) {
|
||||||
|
|
||||||
foreach ($a as $c) {
|
foreach ($a as $c) {
|
||||||
$cprogress += ($c>=completion::PROGRESS)?1:0;
|
$cprogress += ($c>=completion::PROGRESS) ? 1 : 0;
|
||||||
$ccompleted += ($c>=completion::COMPLETED)?1:0;
|
$ccompleted += ($c>=completion::COMPLETED) ? 1 : 0;
|
||||||
$cexcellent += ($c>=completion::EXCELLENT)?1:0;
|
$cexcellent += ($c>=completion::EXCELLENT) ? 1 : 0;
|
||||||
$cpending += ($c>=completion::PENDING)?1:0;
|
$cpending += ($c>=completion::PENDING) ? 1 : 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
$required = [
|
$required = [
|
||||||
|
@ -114,7 +122,7 @@ class tristate_aggregator extends \local_treestudyplan\aggregator {
|
||||||
|
|
||||||
if (empty($grade)) {
|
if (empty($grade)) {
|
||||||
return completion::INCOMPLETE;
|
return completion::INCOMPLETE;
|
||||||
} else if ($grade->finalgrade === NULL) {
|
} else if ($grade->finalgrade === null) {
|
||||||
// On assignments, grade NULL means a submission has not yet been graded,.
|
// On assignments, grade NULL means a submission has not yet been graded,.
|
||||||
// But on quizes this can also mean a quiz might have been started.
|
// But on quizes this can also mean a quiz might have been started.
|
||||||
// Therefor, we treat a NULL result as a reason to check the relevant gradingscanner for presence of pending items.
|
// Therefor, we treat a NULL result as a reason to check the relevant gradingscanner for presence of pending items.
|
||||||
|
|
|
@ -220,7 +220,7 @@ class gradegenerator {
|
||||||
$grade = rand(0, $gi->gradepass/2);
|
$grade = rand(0, $gi->gradepass/2);
|
||||||
$r = (object)["gi" => $g, "grade" => $grade, "fb" =>($grade > 0) ? $gr->fb : "" ];
|
$r = (object)["gi" => $g, "grade" => $grade, "fb" =>($grade > 0) ? $gr->fb : "" ];
|
||||||
} else if (!$gr->result) {
|
} else if (!$gr->result) {
|
||||||
//PROGRESS.
|
// PROGRESS.
|
||||||
$r = (object)["gi" => $g, "grade" => rand( round($gi->gradepass/2), $gi->gradepass -1 ), "fb" => $gr->fb ];
|
$r = (object)["gi" => $g, "grade" => rand( round($gi->gradepass/2), $gi->gradepass -1 ), "fb" => $gr->fb ];
|
||||||
} else {
|
} else {
|
||||||
// COMPLETED.
|
// COMPLETED.
|
||||||
|
@ -243,7 +243,7 @@ class gradegenerator {
|
||||||
"fb" =>($grade > 0) ? $gr->fb : ""
|
"fb" =>($grade > 0) ? $gr->fb : ""
|
||||||
];
|
];
|
||||||
} else if (!$gr->result) {
|
} else if (!$gr->result) {
|
||||||
//PROGRESS.
|
// PROGRESS.
|
||||||
$r = (object)[
|
$r = (object)[
|
||||||
"gi" => $g,
|
"gi" => $g,
|
||||||
"grade" => $gi->grademin+rand(round($range * 0.35), round($range * 0.55) - 1 ),
|
"grade" => $gi->grademin+rand(round($range * 0.35), round($range * 0.55) - 1 ),
|
||||||
|
|
|
@ -44,7 +44,7 @@ class webservicehelper {
|
||||||
}
|
}
|
||||||
|
|
||||||
if (is_array($capability)) {
|
if (is_array($capability)) {
|
||||||
//TODO: replace this by accesslib function \has_any_capability().
|
// TODO: replace this by accesslib function \has_any_capability().
|
||||||
foreach ($capability as $cap) {
|
foreach ($capability as $cap) {
|
||||||
if (has_capability($cap, $context)) {
|
if (has_capability($cap, $context)) {
|
||||||
return true;
|
return true;
|
||||||
|
|
|
@ -222,7 +222,7 @@ class period {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
$DB->update_record(self::TABLE, $info);
|
$DB->update_record(self::TABLE, $info);
|
||||||
//reload record after edit.
|
// Reload record after edit.
|
||||||
$this->r = $DB->get_record(self::TABLE, ['id' => $this->id], "*", MUST_EXIST);
|
$this->r = $DB->get_record(self::TABLE, ['id' => $this->id], "*", MUST_EXIST);
|
||||||
unset(self::$PAGECACHE[$this->r->page_id]); // Invalidate the cache for this page.
|
unset(self::$PAGECACHE[$this->r->page_id]); // Invalidate the cache for this page.
|
||||||
return $this;
|
return $this;
|
||||||
|
|
|
@ -26,7 +26,7 @@ require_once("$CFG->libdir/formslib.php");
|
||||||
require_once("$CFG->dirroot/local/treestudyplan/lib.php");
|
require_once("$CFG->dirroot/local/treestudyplan/lib.php");
|
||||||
|
|
||||||
class reportinvite_form extends moodleform {
|
class reportinvite_form extends moodleform {
|
||||||
//Add elements to form.
|
// Add elements to form.
|
||||||
const GOALS_EDITOR_OPTIONS = array('trusttext' => true, 'subdirs' => true, 'maxfiles' => 0, 'maxbytes' => 5*1024*1025);
|
const GOALS_EDITOR_OPTIONS = array('trusttext' => true, 'subdirs' => true, 'maxfiles' => 0, 'maxbytes' => 5*1024*1025);
|
||||||
|
|
||||||
public function definition() {
|
public function definition() {
|
||||||
|
@ -42,13 +42,13 @@ class reportinvite_form extends moodleform {
|
||||||
$mform->setType('update', PARAM_INT);
|
$mform->setType('update', PARAM_INT);
|
||||||
|
|
||||||
$mform->addElement('text', 'name', get_string('invite_name', 'local_treestudyplan'), array('size' => 50));
|
$mform->addElement('text', 'name', get_string('invite_name', 'local_treestudyplan'), array('size' => 50));
|
||||||
$mform->setType('name', PARAM_NOTAGS); //Set type of element.
|
$mform->setType('name', PARAM_NOTAGS); // Set type of element.
|
||||||
$mform->setDefault('name', ''); //Default value.
|
$mform->setDefault('name', ''); // Default value.
|
||||||
$mform->addRule('name', get_string('required'), 'required', null, 'client');
|
$mform->addRule('name', get_string('required'), 'required', null, 'client');
|
||||||
|
|
||||||
$mform->addElement('text', 'email', get_string('invite_email', 'local_treestudyplan'), array('size' => 20));
|
$mform->addElement('text', 'email', get_string('invite_email', 'local_treestudyplan'), array('size' => 20));
|
||||||
$mform->setType('email', PARAM_NOTAGS); //Set type of element.
|
$mform->setType('email', PARAM_NOTAGS); // Set type of element.
|
||||||
$mform->setDefault('email', ''); //Default value.
|
$mform->setDefault('email', ''); // Default value.
|
||||||
$mform->addRule('email', get_string('required'), 'required', null, 'client');
|
$mform->addRule('email', get_string('required'), 'required', null, 'client');
|
||||||
$mform->addRule('email', get_string('email'), 'email', null, 'client');
|
$mform->addRule('email', get_string('email'), 'email', null, 'client');
|
||||||
|
|
||||||
|
@ -56,7 +56,7 @@ class reportinvite_form extends moodleform {
|
||||||
|
|
||||||
$this->add_action_buttons();
|
$this->add_action_buttons();
|
||||||
}
|
}
|
||||||
//Custom validation should be added here.
|
// Custom validation should be added here.
|
||||||
public function validation($data, $files) {
|
public function validation($data, $files) {
|
||||||
return array();
|
return array();
|
||||||
}
|
}
|
||||||
|
@ -70,7 +70,7 @@ class reportinvite_form extends moodleform {
|
||||||
global $DB, $USER;
|
global $DB, $USER;
|
||||||
|
|
||||||
$data = parent::get_data();
|
$data = parent::get_data();
|
||||||
if ($data != NULL) {
|
if ($data != null) {
|
||||||
if (empty($data->user_id)) {
|
if (empty($data->user_id)) {
|
||||||
$data->user_id = $USER->id;
|
$data->user_id = $USER->id;
|
||||||
}
|
}
|
||||||
|
@ -83,7 +83,7 @@ class reportinvite_form extends moodleform {
|
||||||
}
|
}
|
||||||
|
|
||||||
if (empty($data->update)) {
|
if (empty($data->update)) {
|
||||||
//create a new random key for the invite.
|
// Create a new random key for the invite.
|
||||||
do {
|
do {
|
||||||
$length = 20;
|
$length = 20;
|
||||||
$characters = '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ';
|
$characters = '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ';
|
||||||
|
|
|
@ -237,7 +237,7 @@ class studyitem {
|
||||||
}
|
}
|
||||||
|
|
||||||
$DB->update_record(self::TABLE, $info);
|
$DB->update_record(self::TABLE, $info);
|
||||||
//reload record after edit.
|
// Reload record after edit.
|
||||||
$this->r = $DB->get_record(self::TABLE, ['id' => $this->id], "*", MUST_EXIST);
|
$this->r = $DB->get_record(self::TABLE, ['id' => $this->id], "*", MUST_EXIST);
|
||||||
return $this;
|
return $this;
|
||||||
}
|
}
|
||||||
|
@ -484,7 +484,7 @@ class studyitem {
|
||||||
// Set new line id.
|
// Set new line id.
|
||||||
unset($fields->id);
|
unset($fields->id);
|
||||||
$fields->line_id = $newline->id();
|
$fields->line_id = $newline->id();
|
||||||
//create new record with the new data.
|
// Create new record with the new data.
|
||||||
$id = $DB->insert_record(self::TABLE, (array)$fields);
|
$id = $DB->insert_record(self::TABLE, (array)$fields);
|
||||||
$new = self::findById($id, $newline);
|
$new = self::findById($id, $newline);
|
||||||
|
|
||||||
|
|
|
@ -88,7 +88,7 @@ class studyitemconnection {
|
||||||
public static function connect($fromid, $toid) {
|
public static function connect($fromid, $toid) {
|
||||||
global $DB;
|
global $DB;
|
||||||
|
|
||||||
//check if link already exists.
|
// Check if link already exists.
|
||||||
|
|
||||||
if (!$DB->record_exists(self::TABLE, ['from_id' => $fromid, 'to_id' => $toid])) {
|
if (!$DB->record_exists(self::TABLE, ['from_id' => $fromid, 'to_id' => $toid])) {
|
||||||
$id = $DB->insert_record(self::TABLE, [
|
$id = $DB->insert_record(self::TABLE, [
|
||||||
|
|
|
@ -207,7 +207,7 @@ class studyline {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
$DB->update_record(self::TABLE, $info);
|
$DB->update_record(self::TABLE, $info);
|
||||||
//reload record after edit.
|
// Reload record after edit.
|
||||||
$this->r = $DB->get_record(self::TABLE, ['id' => $this->id], "*", MUST_EXIST);
|
$this->r = $DB->get_record(self::TABLE, ['id' => $this->id], "*", MUST_EXIST);
|
||||||
return $this;
|
return $this;
|
||||||
}
|
}
|
||||||
|
|
|
@ -243,10 +243,10 @@ class studyplan {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
$DB->update_record(self::TABLE, $info);
|
$DB->update_record(self::TABLE, $info);
|
||||||
//reload record after edit.
|
// Reload record after edit.
|
||||||
$this->r = $DB->get_record(self::TABLE, ['id' => $this->id], "*", MUST_EXIST);
|
$this->r = $DB->get_record(self::TABLE, ['id' => $this->id], "*", MUST_EXIST);
|
||||||
|
|
||||||
//reload the context...
|
// Reload the context...
|
||||||
$this->context = null;
|
$this->context = null;
|
||||||
$this->context();
|
$this->context();
|
||||||
// Reload aggregator.
|
// Reload aggregator.
|
||||||
|
|
|
@ -187,7 +187,7 @@ class studyplanpage {
|
||||||
}
|
}
|
||||||
|
|
||||||
$DB->update_record(self::TABLE, $info);
|
$DB->update_record(self::TABLE, $info);
|
||||||
//reload record after edit.
|
// Reload record after edit.
|
||||||
$this->r = $DB->get_record(self::TABLE, ['id' => $this->id], "*", MUST_EXIST);
|
$this->r = $DB->get_record(self::TABLE, ['id' => $this->id], "*", MUST_EXIST);
|
||||||
|
|
||||||
return $this;
|
return $this;
|
||||||
|
|
|
@ -419,7 +419,6 @@ class studyplanservice extends \external_api {
|
||||||
$o = studyitem::add([
|
$o = studyitem::add([
|
||||||
'line_id' => $lineid,
|
'line_id' => $lineid,
|
||||||
'type' => $type,
|
'type' => $type,
|
||||||
//'conditions' => $conditions,.
|
|
||||||
'slot' => $slot,
|
'slot' => $slot,
|
||||||
'layer' => $layer,
|
'layer' => $layer,
|
||||||
'competency_id' => isset($details['competency_id']) ? $details['competency_id'] : null,
|
'competency_id' => isset($details['competency_id']) ? $details['competency_id'] : null,
|
||||||
|
|
|
@ -88,7 +88,7 @@ class teachingfinder {
|
||||||
$now = time();
|
$now = time();
|
||||||
foreach ($list as $pageid) {
|
foreach ($list as $pageid) {
|
||||||
// Retrieve the studyplan id from the page.
|
// Retrieve the studyplan id from the page.
|
||||||
//TODO: Change this when page management is implemented to return the page instead of the plan.
|
// TODO: Change this when page management is implemented to return the page instead of the plan.
|
||||||
$planid = $DB->get_field("local_treestudyplan_page", "studyplan_id", ["id" => $pageid]);
|
$planid = $DB->get_field("local_treestudyplan_page", "studyplan_id", ["id" => $pageid]);
|
||||||
$DB->insert_record(self::TABLE, ["teacher_id" => $userid, "studyplan_id" => $planid, "update_time" => $now]);
|
$DB->insert_record(self::TABLE, ["teacher_id" => $userid, "studyplan_id" => $planid, "update_time" => $now]);
|
||||||
}
|
}
|
||||||
|
|
448
db/services.php
448
db/services.php
|
@ -56,168 +56,168 @@ $functions = [
|
||||||
/***************************
|
/***************************
|
||||||
* Studyplan functions
|
* Studyplan functions
|
||||||
***************************/
|
***************************/
|
||||||
'local_treestudyplan_list_studyplans' => [ //web service function name.
|
'local_treestudyplan_list_studyplans' => [ // Web service function name.
|
||||||
'classname' => '\local_treestudyplan\studyplanservice', //class containing the external function.
|
'classname' => '\local_treestudyplan\studyplanservice', // Class containing the external function.
|
||||||
'methodname' => 'list_studyplans', //external function name.
|
'methodname' => 'list_studyplans', // External function name.
|
||||||
'description' => 'List available studyplans',
|
'description' => 'List available studyplans',
|
||||||
'type' => 'read', //database rights of the web service function (read, write).
|
'type' => 'read', // Database rights of the web service function (read, write).
|
||||||
'ajax' => true,
|
'ajax' => true,
|
||||||
'capabilities' => 'local/treestudyplan:editstudyplan, local/treestudyplan:viewuserreports',
|
'capabilities' => 'local/treestudyplan:editstudyplan, local/treestudyplan:viewuserreports',
|
||||||
'loginrequired' => true,
|
'loginrequired' => true,
|
||||||
],
|
],
|
||||||
'local_treestudyplan_get_studyplan_map' => [ //web service function name.
|
'local_treestudyplan_get_studyplan_map' => [ // Web service function name.
|
||||||
'classname' => '\local_treestudyplan\studyplanservice', //class containing the external function.
|
'classname' => '\local_treestudyplan\studyplanservice', // Class containing the external function.
|
||||||
'methodname' => 'get_studyplan_map', //external function name.
|
'methodname' => 'get_studyplan_map', // External function name.
|
||||||
'description' => 'Retrieve studyplan map',
|
'description' => 'Retrieve studyplan map',
|
||||||
'type' => 'read', //database rights of the web service function (read, write).
|
'type' => 'read', // Database rights of the web service function (read, write).
|
||||||
'ajax' => true,
|
'ajax' => true,
|
||||||
'capabilities' => 'local/treestudyplan:editstudyplan, local/treestudyplan:viewuserreports',
|
'capabilities' => 'local/treestudyplan:editstudyplan, local/treestudyplan:viewuserreports',
|
||||||
'loginrequired' => true,
|
'loginrequired' => true,
|
||||||
],
|
],
|
||||||
|
|
||||||
'local_treestudyplan_get_studyline_map' => [ //web service function name.
|
'local_treestudyplan_get_studyline_map' => [ // Web service function name.
|
||||||
'classname' => '\local_treestudyplan\studyplanservice', //class containing the external function.
|
'classname' => '\local_treestudyplan\studyplanservice', // Class containing the external function.
|
||||||
'methodname' => 'get_studyline_map', //external function name.
|
'methodname' => 'get_studyline_map', // External function name.
|
||||||
'description' => 'Retrieve studyline map',
|
'description' => 'Retrieve studyline map',
|
||||||
'type' => 'read', //database rights of the web service function (read, write).
|
'type' => 'read', // Database rights of the web service function (read, write).
|
||||||
'ajax' => true,
|
'ajax' => true,
|
||||||
'capabilities' => 'local/treestudyplan:editstudyplan',
|
'capabilities' => 'local/treestudyplan:editstudyplan',
|
||||||
'loginrequired' => true,
|
'loginrequired' => true,
|
||||||
],
|
],
|
||||||
|
|
||||||
'local_treestudyplan_add_studyplan' => [ //web service function name.
|
'local_treestudyplan_add_studyplan' => [ // Web service function name.
|
||||||
'classname' => '\local_treestudyplan\studyplanservice', //class containing the external function.
|
'classname' => '\local_treestudyplan\studyplanservice', // Class containing the external function.
|
||||||
'methodname' => 'add_studyplan', //external function name.
|
'methodname' => 'add_studyplan', // External function name.
|
||||||
'description' => 'Add studyplan',
|
'description' => 'Add studyplan',
|
||||||
'type' => 'write', //database rights of the web service function (read, write).
|
'type' => 'write', // Database rights of the web service function (read, write).
|
||||||
'ajax' => true,
|
'ajax' => true,
|
||||||
'capabilities' => 'local/treestudyplan:editstudyplan',
|
'capabilities' => 'local/treestudyplan:editstudyplan',
|
||||||
'loginrequired' => true,
|
'loginrequired' => true,
|
||||||
],
|
],
|
||||||
|
|
||||||
'local_treestudyplan_add_studyline' => [ //web service function name.
|
'local_treestudyplan_add_studyline' => [ // Web service function name.
|
||||||
'classname' => '\local_treestudyplan\studyplanservice', //class containing the external function.
|
'classname' => '\local_treestudyplan\studyplanservice', // Class containing the external function.
|
||||||
'methodname' => 'add_studyline', //external function name.
|
'methodname' => 'add_studyline', // External function name.
|
||||||
'description' => 'Add studyline',
|
'description' => 'Add studyline',
|
||||||
'type' => 'write', //database rights of the web service function (read, write).
|
'type' => 'write', // Database rights of the web service function (read, write).
|
||||||
'ajax' => true,
|
'ajax' => true,
|
||||||
'capabilities' => 'local/treestudyplan:editstudyplan',
|
'capabilities' => 'local/treestudyplan:editstudyplan',
|
||||||
'loginrequired' => true,
|
'loginrequired' => true,
|
||||||
],
|
],
|
||||||
|
|
||||||
'local_treestudyplan_edit_studyplan' => [ //web service function name.
|
'local_treestudyplan_edit_studyplan' => [ // Web service function name.
|
||||||
'classname' => '\local_treestudyplan\studyplanservice', //class containing the external function.
|
'classname' => '\local_treestudyplan\studyplanservice', // Class containing the external function.
|
||||||
'methodname' => 'edit_studyplan', //external function name.
|
'methodname' => 'edit_studyplan', // External function name.
|
||||||
'description' => 'Edit studyplan',
|
'description' => 'Edit studyplan',
|
||||||
'type' => 'write', //database rights of the web service function (read, write).
|
'type' => 'write', // Database rights of the web service function (read, write).
|
||||||
'ajax' => true,
|
'ajax' => true,
|
||||||
'capabilities' => 'local/treestudyplan:editstudyplan',
|
'capabilities' => 'local/treestudyplan:editstudyplan',
|
||||||
'loginrequired' => true,
|
'loginrequired' => true,
|
||||||
],
|
],
|
||||||
|
|
||||||
'local_treestudyplan_edit_studyline' => [ //web service function name.
|
'local_treestudyplan_edit_studyline' => [ // Web service function name.
|
||||||
'classname' => '\local_treestudyplan\studyplanservice', //class containing the external function.
|
'classname' => '\local_treestudyplan\studyplanservice', // Class containing the external function.
|
||||||
'methodname' => 'edit_studyline', //external function name.
|
'methodname' => 'edit_studyline', // External function name.
|
||||||
'description' => 'Edit studyline',
|
'description' => 'Edit studyline',
|
||||||
'type' => 'write', //database rights of the web service function (read, write).
|
'type' => 'write', // Database rights of the web service function (read, write).
|
||||||
'ajax' => true,
|
'ajax' => true,
|
||||||
'capabilities' => 'local/treestudyplan:editstudyplan',
|
'capabilities' => 'local/treestudyplan:editstudyplan',
|
||||||
'loginrequired' => true,
|
'loginrequired' => true,
|
||||||
],
|
],
|
||||||
|
|
||||||
'local_treestudyplan_delete_studyplan' => [ //web service function name.
|
'local_treestudyplan_delete_studyplan' => [ // Web service function name.
|
||||||
'classname' => '\local_treestudyplan\studyplanservice', //class containing the external function.
|
'classname' => '\local_treestudyplan\studyplanservice', // Class containing the external function.
|
||||||
'methodname' => 'delete_studyplan', //external function name.
|
'methodname' => 'delete_studyplan', // External function name.
|
||||||
'description' => 'Delete studyplan',
|
'description' => 'Delete studyplan',
|
||||||
'type' => 'write', //database rights of the web service function (read, write).
|
'type' => 'write', // Database rights of the web service function (read, write).
|
||||||
'ajax' => true,
|
'ajax' => true,
|
||||||
'capabilities' => 'local/treestudyplan:editstudyplan',
|
'capabilities' => 'local/treestudyplan:editstudyplan',
|
||||||
'loginrequired' => true,
|
'loginrequired' => true,
|
||||||
],
|
],
|
||||||
|
|
||||||
'local_treestudyplan_delete_studyline' => [ //web service function name.
|
'local_treestudyplan_delete_studyline' => [ // Web service function name.
|
||||||
'classname' => '\local_treestudyplan\studyplanservice', //class containing the external function.
|
'classname' => '\local_treestudyplan\studyplanservice', // Class containing the external function.
|
||||||
'methodname' => 'delete_studyline', //external function name.
|
'methodname' => 'delete_studyline', // External function name.
|
||||||
'description' => 'Delete studyline',
|
'description' => 'Delete studyline',
|
||||||
'type' => 'write', //database rights of the web service function (read, write).
|
'type' => 'write', // Database rights of the web service function (read, write).
|
||||||
'ajax' => true,
|
'ajax' => true,
|
||||||
'capabilities' => 'local/treestudyplan:editstudyplan',
|
'capabilities' => 'local/treestudyplan:editstudyplan',
|
||||||
'loginrequired' => true,
|
'loginrequired' => true,
|
||||||
],
|
],
|
||||||
|
|
||||||
'local_treestudyplan_reorder_studylines' => [ //web service function name.
|
'local_treestudyplan_reorder_studylines' => [ // Web service function name.
|
||||||
'classname' => '\local_treestudyplan\studyplanservice', //class containing the external function.
|
'classname' => '\local_treestudyplan\studyplanservice', // Class containing the external function.
|
||||||
'methodname' => 'reorder_studylines', //external function name.
|
'methodname' => 'reorder_studylines', // External function name.
|
||||||
'description' => 'Reorder studylines',
|
'description' => 'Reorder studylines',
|
||||||
'type' => 'write', //database rights of the web service function (read, write).
|
'type' => 'write', // Database rights of the web service function (read, write).
|
||||||
'ajax' => true,
|
'ajax' => true,
|
||||||
'capabilities' => 'local/treestudyplan:editstudyplan',
|
'capabilities' => 'local/treestudyplan:editstudyplan',
|
||||||
'loginrequired' => true,
|
'loginrequired' => true,
|
||||||
],
|
],
|
||||||
|
|
||||||
'local_treestudyplan_get_studyitem' => [ //web service function name.
|
'local_treestudyplan_get_studyitem' => [ // Web service function name.
|
||||||
'classname' => '\local_treestudyplan\studyplanservice', //class containing the external function.
|
'classname' => '\local_treestudyplan\studyplanservice', // Class containing the external function.
|
||||||
'methodname' => 'get_studyitem', //external function name.
|
'methodname' => 'get_studyitem', // External function name.
|
||||||
'description' => 'Retrieve study item',
|
'description' => 'Retrieve study item',
|
||||||
'type' => 'read', //database rights of the web service function (read, write).
|
'type' => 'read', // Database rights of the web service function (read, write).
|
||||||
'ajax' => true,
|
'ajax' => true,
|
||||||
'capabilities' => 'local/treestudyplan:editstudyplan',
|
'capabilities' => 'local/treestudyplan:editstudyplan',
|
||||||
'loginrequired' => true,
|
'loginrequired' => true,
|
||||||
],
|
],
|
||||||
|
|
||||||
'local_treestudyplan_add_studyitem' => [ //web service function name.
|
'local_treestudyplan_add_studyitem' => [ // Web service function name.
|
||||||
'classname' => '\local_treestudyplan\studyplanservice', //class containing the external function.
|
'classname' => '\local_treestudyplan\studyplanservice', // Class containing the external function.
|
||||||
'methodname' => 'add_studyitem', //external function name.
|
'methodname' => 'add_studyitem', // External function name.
|
||||||
'description' => 'Add study item',
|
'description' => 'Add study item',
|
||||||
'type' => 'write', //database rights of the web service function (read, write).
|
'type' => 'write', // Database rights of the web service function (read, write).
|
||||||
'ajax' => true,
|
'ajax' => true,
|
||||||
'capabilities' => 'local/treestudyplan:editstudyplan',
|
'capabilities' => 'local/treestudyplan:editstudyplan',
|
||||||
'loginrequired' => true,
|
'loginrequired' => true,
|
||||||
],
|
],
|
||||||
|
|
||||||
'local_treestudyplan_edit_studyitem' => [ //web service function name.
|
'local_treestudyplan_edit_studyitem' => [ // Web service function name.
|
||||||
'classname' => '\local_treestudyplan\studyplanservice', //class containing the external function.
|
'classname' => '\local_treestudyplan\studyplanservice', // Class containing the external function.
|
||||||
'methodname' => 'edit_studyitem', //external function name.
|
'methodname' => 'edit_studyitem', // External function name.
|
||||||
'description' => 'Edit study item',
|
'description' => 'Edit study item',
|
||||||
'type' => 'write', //database rights of the web service function (read, write).
|
'type' => 'write', // Database rights of the web service function (read, write).
|
||||||
'ajax' => true,
|
'ajax' => true,
|
||||||
'capabilities' => 'local/treestudyplan:editstudyplan',
|
'capabilities' => 'local/treestudyplan:editstudyplan',
|
||||||
'loginrequired' => true,
|
'loginrequired' => true,
|
||||||
],
|
],
|
||||||
|
|
||||||
'local_treestudyplan_reorder_studyitems' => [ //web service function name.
|
'local_treestudyplan_reorder_studyitems' => [ // Web service function name.
|
||||||
'classname' => '\local_treestudyplan\studyplanservice', //class containing the external function.
|
'classname' => '\local_treestudyplan\studyplanservice', // Class containing the external function.
|
||||||
'methodname' => 'reorder_studyitems', //external function name.
|
'methodname' => 'reorder_studyitems', // External function name.
|
||||||
'description' => 'Reorder study items',
|
'description' => 'Reorder study items',
|
||||||
'type' => 'write', //database rights of the web service function (read, write).
|
'type' => 'write', // Database rights of the web service function (read, write).
|
||||||
'ajax' => true,
|
'ajax' => true,
|
||||||
'capabilities' => 'local/treestudyplan:editstudyplan',
|
'capabilities' => 'local/treestudyplan:editstudyplan',
|
||||||
'loginrequired' => true,
|
'loginrequired' => true,
|
||||||
],
|
],
|
||||||
|
|
||||||
'local_treestudyplan_delete_studyitem' => [ //web service function name.
|
'local_treestudyplan_delete_studyitem' => [ // Web service function name.
|
||||||
'classname' => '\local_treestudyplan\studyplanservice', //class containing the external function.
|
'classname' => '\local_treestudyplan\studyplanservice', // Class containing the external function.
|
||||||
'methodname' => 'delete_studyitem', //external function name.
|
'methodname' => 'delete_studyitem', // External function name.
|
||||||
'description' => 'Delete study item',
|
'description' => 'Delete study item',
|
||||||
'type' => 'write', //database rights of the web service function (read, write).
|
'type' => 'write', // Database rights of the web service function (read, write).
|
||||||
'ajax' => true,
|
'ajax' => true,
|
||||||
'capabilities' => 'local/treestudyplan:editstudyplan',
|
'capabilities' => 'local/treestudyplan:editstudyplan',
|
||||||
'loginrequired' => true,
|
'loginrequired' => true,
|
||||||
],
|
],
|
||||||
'local_treestudyplan_connect_studyitems' => [ //web service function name.
|
'local_treestudyplan_connect_studyitems' => [ // Web service function name.
|
||||||
'classname' => '\local_treestudyplan\studyplanservice', //class containing the external function.
|
'classname' => '\local_treestudyplan\studyplanservice', // Class containing the external function.
|
||||||
'methodname' => 'connect_studyitems', //external function name.
|
'methodname' => 'connect_studyitems', // External function name.
|
||||||
'description' => 'Connect study items',
|
'description' => 'Connect study items',
|
||||||
'type' => 'write', //database rights of the web service function (read, write).
|
'type' => 'write', // Database rights of the web service function (read, write).
|
||||||
'ajax' => true,
|
'ajax' => true,
|
||||||
'capabilities' => 'local/treestudyplan:editstudyplan',
|
'capabilities' => 'local/treestudyplan:editstudyplan',
|
||||||
'loginrequired' => true,
|
'loginrequired' => true,
|
||||||
],
|
],
|
||||||
'local_treestudyplan_disconnect_studyitems' => [ //web service function name.
|
'local_treestudyplan_disconnect_studyitems' => [ // Web service function name.
|
||||||
'classname' => '\local_treestudyplan\studyplanservice', //class containing the external function.
|
'classname' => '\local_treestudyplan\studyplanservice', // Class containing the external function.
|
||||||
'methodname' => 'disconnect_studyitems', //external function name.
|
'methodname' => 'disconnect_studyitems', // External function name.
|
||||||
'description' => 'Disconnect study items',
|
'description' => 'Disconnect study items',
|
||||||
'type' => 'write', //database rights of the web service function (read, write).
|
'type' => 'write', // Database rights of the web service function (read, write).
|
||||||
'ajax' => true,
|
'ajax' => true,
|
||||||
'capabilities' => 'local/treestudyplan:editstudyplan',
|
'capabilities' => 'local/treestudyplan:editstudyplan',
|
||||||
'loginrequired' => true,
|
'loginrequired' => true,
|
||||||
|
@ -226,11 +226,11 @@ $functions = [
|
||||||
* Badge functions
|
* Badge functions
|
||||||
***************************/
|
***************************/
|
||||||
|
|
||||||
'local_treestudyplan_list_badges' => [ //web service function name.
|
'local_treestudyplan_list_badges' => [ // Web service function name.
|
||||||
'classname' => '\local_treestudyplan\studyplanservice', //class containing the external function.
|
'classname' => '\local_treestudyplan\studyplanservice', // Class containing the external function.
|
||||||
'methodname' => 'list_badges', //external function name.
|
'methodname' => 'list_badges', // External function name.
|
||||||
'description' => 'List availabel site badges',
|
'description' => 'List availabel site badges',
|
||||||
'type' => 'read', //database rights of the web service function (read, write).
|
'type' => 'read', // Database rights of the web service function (read, write).
|
||||||
'ajax' => true,
|
'ajax' => true,
|
||||||
'capabilities' => 'local/treestudyplan:editstudyplan',
|
'capabilities' => 'local/treestudyplan:editstudyplan',
|
||||||
'loginrequired' => true,
|
'loginrequired' => true,
|
||||||
|
@ -238,344 +238,344 @@ $functions = [
|
||||||
/***************************
|
/***************************
|
||||||
* Association functions
|
* Association functions
|
||||||
***************************/
|
***************************/
|
||||||
'local_treestudyplan_list_cohort' => [ //web service function name.
|
'local_treestudyplan_list_cohort' => [ // Web service function name.
|
||||||
'classname' => '\local_treestudyplan\associationservice', //class containing the external function.
|
'classname' => '\local_treestudyplan\associationservice', // Class containing the external function.
|
||||||
'methodname' => 'list_cohort', //external function name.
|
'methodname' => 'list_cohort', // External function name.
|
||||||
'description' => 'List available cohorts',
|
'description' => 'List available cohorts',
|
||||||
'type' => 'read', //database rights of the web service function (read, write).
|
'type' => 'read', // Database rights of the web service function (read, write).
|
||||||
'ajax' => true,
|
'ajax' => true,
|
||||||
'capabilities' => 'local/treestudyplan:editstudyplan',
|
'capabilities' => 'local/treestudyplan:editstudyplan',
|
||||||
'loginrequired' => true,
|
'loginrequired' => true,
|
||||||
],
|
],
|
||||||
'local_treestudyplan_find_user' => [ //web service function name.
|
'local_treestudyplan_find_user' => [ // Web service function name.
|
||||||
'classname' => '\local_treestudyplan\associationservice', //class containing the external function.
|
'classname' => '\local_treestudyplan\associationservice', // Class containing the external function.
|
||||||
'methodname' => 'find_user', //external function name.
|
'methodname' => 'find_user', // External function name.
|
||||||
'description' => 'Find user',
|
'description' => 'Find user',
|
||||||
'type' => 'read', //database rights of the web service function (read, write).
|
'type' => 'read', // Database rights of the web service function (read, write).
|
||||||
'ajax' => true,
|
'ajax' => true,
|
||||||
'capabilities' => 'local/treestudyplan:editstudyplan',
|
'capabilities' => 'local/treestudyplan:editstudyplan',
|
||||||
'loginrequired' => true,
|
'loginrequired' => true,
|
||||||
],
|
],
|
||||||
'local_treestudyplan_connect_cohort' => [ //web service function name.
|
'local_treestudyplan_connect_cohort' => [ // Web service function name.
|
||||||
'classname' => '\local_treestudyplan\associationservice', //class containing the external function.
|
'classname' => '\local_treestudyplan\associationservice', // Class containing the external function.
|
||||||
'methodname' => 'connect_cohort', //external function name.
|
'methodname' => 'connect_cohort', // External function name.
|
||||||
'description' => 'Connect cohort to studyplan',
|
'description' => 'Connect cohort to studyplan',
|
||||||
'type' => 'read', //database rights of the web service function (read, write).
|
'type' => 'read', // Database rights of the web service function (read, write).
|
||||||
'ajax' => true,
|
'ajax' => true,
|
||||||
'capabilities' => 'local/treestudyplan:editstudyplan',
|
'capabilities' => 'local/treestudyplan:editstudyplan',
|
||||||
'loginrequired' => true,
|
'loginrequired' => true,
|
||||||
],
|
],
|
||||||
'local_treestudyplan_disconnect_cohort' => [ //web service function name.
|
'local_treestudyplan_disconnect_cohort' => [ // Web service function name.
|
||||||
'classname' => '\local_treestudyplan\associationservice', //class containing the external function.
|
'classname' => '\local_treestudyplan\associationservice', // Class containing the external function.
|
||||||
'methodname' => 'disconnect_cohort', //external function name.
|
'methodname' => 'disconnect_cohort', // External function name.
|
||||||
'description' => 'Disconnect cohort from study plan',
|
'description' => 'Disconnect cohort from study plan',
|
||||||
'type' => 'read', //database rights of the web service function (read, write).
|
'type' => 'read', // Database rights of the web service function (read, write).
|
||||||
'ajax' => true,
|
'ajax' => true,
|
||||||
'capabilities' => 'local/treestudyplan:editstudyplan',
|
'capabilities' => 'local/treestudyplan:editstudyplan',
|
||||||
'loginrequired' => true,
|
'loginrequired' => true,
|
||||||
],
|
],
|
||||||
|
|
||||||
'local_treestudyplan_connect_user' => [ //web service function name.
|
'local_treestudyplan_connect_user' => [ // Web service function name.
|
||||||
'classname' => '\local_treestudyplan\associationservice', //class containing the external function.
|
'classname' => '\local_treestudyplan\associationservice', // Class containing the external function.
|
||||||
'methodname' => 'connect_user', //external function name.
|
'methodname' => 'connect_user', // External function name.
|
||||||
'description' => 'Connect user to study plan',
|
'description' => 'Connect user to study plan',
|
||||||
'type' => 'read', //database rights of the web service function (read, write).
|
'type' => 'read', // Database rights of the web service function (read, write).
|
||||||
'ajax' => true,
|
'ajax' => true,
|
||||||
'capabilities' => 'local/treestudyplan:editstudyplan',
|
'capabilities' => 'local/treestudyplan:editstudyplan',
|
||||||
'loginrequired' => true,
|
'loginrequired' => true,
|
||||||
],
|
],
|
||||||
'local_treestudyplan_disconnect_user' => [ //web service function name.
|
'local_treestudyplan_disconnect_user' => [ // Web service function name.
|
||||||
'classname' => '\local_treestudyplan\associationservice', //class containing the external function.
|
'classname' => '\local_treestudyplan\associationservice', // Class containing the external function.
|
||||||
'methodname' => 'disconnect_user', //external function name.
|
'methodname' => 'disconnect_user', // External function name.
|
||||||
'description' => 'Disconnect user from studyplan',
|
'description' => 'Disconnect user from studyplan',
|
||||||
'type' => 'read', //database rights of the web service function (read, write).
|
'type' => 'read', // Database rights of the web service function (read, write).
|
||||||
'ajax' => true,
|
'ajax' => true,
|
||||||
'capabilities' => 'local/treestudyplan:editstudyplan',
|
'capabilities' => 'local/treestudyplan:editstudyplan',
|
||||||
'loginrequired' => true,
|
'loginrequired' => true,
|
||||||
],
|
],
|
||||||
'local_treestudyplan_associated_users' => [ //web service function name.
|
'local_treestudyplan_associated_users' => [ // Web service function name.
|
||||||
'classname' => '\local_treestudyplan\associationservice', //class containing the external function.
|
'classname' => '\local_treestudyplan\associationservice', // Class containing the external function.
|
||||||
'methodname' => 'associated_users', //external function name.
|
'methodname' => 'associated_users', // External function name.
|
||||||
'description' => 'List users associated with a studyplan',
|
'description' => 'List users associated with a studyplan',
|
||||||
'type' => 'read', //database rights of the web service function (read, write).
|
'type' => 'read', // Database rights of the web service function (read, write).
|
||||||
'ajax' => true,
|
'ajax' => true,
|
||||||
'capabilities' => 'local/treestudyplan:editstudyplan',
|
'capabilities' => 'local/treestudyplan:editstudyplan',
|
||||||
'loginrequired' => true,
|
'loginrequired' => true,
|
||||||
],
|
],
|
||||||
'local_treestudyplan_associated_cohorts' => [ //web service function name.
|
'local_treestudyplan_associated_cohorts' => [ // Web service function name.
|
||||||
'classname' => '\local_treestudyplan\associationservice', //class containing the external function.
|
'classname' => '\local_treestudyplan\associationservice', // Class containing the external function.
|
||||||
'methodname' => 'associated_cohorts', //external function name.
|
'methodname' => 'associated_cohorts', // External function name.
|
||||||
'description' => 'List cohorts associated with a studyplan',
|
'description' => 'List cohorts associated with a studyplan',
|
||||||
'type' => 'read', //database rights of the web service function (read, write).
|
'type' => 'read', // Database rights of the web service function (read, write).
|
||||||
'ajax' => true,
|
'ajax' => true,
|
||||||
'capabilities' => 'local/treestudyplan:editstudyplan',
|
'capabilities' => 'local/treestudyplan:editstudyplan',
|
||||||
'loginrequired' => true,
|
'loginrequired' => true,
|
||||||
],
|
],
|
||||||
'local_treestudyplan_list_user_studyplans' => [ //web service function name.
|
'local_treestudyplan_list_user_studyplans' => [ // Web service function name.
|
||||||
'classname' => '\local_treestudyplan\studentstudyplanservice', //class containing the external function.
|
'classname' => '\local_treestudyplan\studentstudyplanservice', // Class containing the external function.
|
||||||
'methodname' => 'list_user_studyplans', //external function name.
|
'methodname' => 'list_user_studyplans', // External function name.
|
||||||
'description' => 'List user studyplans',
|
'description' => 'List user studyplans',
|
||||||
'type' => 'read', //database rights of the web service function (read, write).
|
'type' => 'read', // Database rights of the web service function (read, write).
|
||||||
'ajax' => true,
|
'ajax' => true,
|
||||||
'capabilities' => 'local/treestudyplan:viewuserreports',
|
'capabilities' => 'local/treestudyplan:viewuserreports',
|
||||||
'loginrequired' => true,
|
'loginrequired' => true,
|
||||||
],
|
],
|
||||||
'local_treestudyplan_get_user_studyplans' => [ //web service function name.
|
'local_treestudyplan_get_user_studyplans' => [ // Web service function name.
|
||||||
'classname' => '\local_treestudyplan\studentstudyplanservice', //class containing the external function.
|
'classname' => '\local_treestudyplan\studentstudyplanservice', // Class containing the external function.
|
||||||
'methodname' => 'get_user_studyplans', //external function name.
|
'methodname' => 'get_user_studyplans', // External function name.
|
||||||
'description' => 'Retrieve user studyplan',
|
'description' => 'Retrieve user studyplan',
|
||||||
'type' => 'read', //database rights of the web service function (read, write).
|
'type' => 'read', // Database rights of the web service function (read, write).
|
||||||
'ajax' => true,
|
'ajax' => true,
|
||||||
'capabilities' => 'local/treestudyplan:viewuserreports',
|
'capabilities' => 'local/treestudyplan:viewuserreports',
|
||||||
'loginrequired' => true,
|
'loginrequired' => true,
|
||||||
],
|
],
|
||||||
'local_treestudyplan_get_user_studyplan' => [ //web service function name.
|
'local_treestudyplan_get_user_studyplan' => [ // Web service function name.
|
||||||
'classname' => '\local_treestudyplan\studentstudyplanservice', //class containing the external function.
|
'classname' => '\local_treestudyplan\studentstudyplanservice', // Class containing the external function.
|
||||||
'methodname' => 'get_user_studyplan', //external function name.
|
'methodname' => 'get_user_studyplan', // External function name.
|
||||||
'description' => 'Retrieve user studyplan',
|
'description' => 'Retrieve user studyplan',
|
||||||
'type' => 'read', //database rights of the web service function (read, write).
|
'type' => 'read', // Database rights of the web service function (read, write).
|
||||||
'ajax' => true,
|
'ajax' => true,
|
||||||
'capabilities' => 'local/treestudyplan:viewuserreports',
|
'capabilities' => 'local/treestudyplan:viewuserreports',
|
||||||
'loginrequired' => true,
|
'loginrequired' => true,
|
||||||
],
|
],
|
||||||
'local_treestudyplan_get_invited_studyplan' => [ //web service function name.
|
'local_treestudyplan_get_invited_studyplan' => [ // Web service function name.
|
||||||
'classname' => '\local_treestudyplan\studentstudyplanservice', //class containing the external function.
|
'classname' => '\local_treestudyplan\studentstudyplanservice', // Class containing the external function.
|
||||||
'methodname' => 'get_invited_studyplan', //external function name.
|
'methodname' => 'get_invited_studyplan', // External function name.
|
||||||
'description' => 'Retrieve user studyplan based on invite',
|
'description' => 'Retrieve user studyplan based on invite',
|
||||||
'type' => 'read', //database rights of the web service function (read, write).
|
'type' => 'read', // Database rights of the web service function (read, write).
|
||||||
'ajax' => true,
|
'ajax' => true,
|
||||||
'capabilities' => '',
|
'capabilities' => '',
|
||||||
'loginrequired' => false,
|
'loginrequired' => false,
|
||||||
],
|
],
|
||||||
'local_treestudyplan_list_own_studyplans' => [ //web service function name.
|
'local_treestudyplan_list_own_studyplans' => [ // Web service function name.
|
||||||
'classname' => '\local_treestudyplan\studentstudyplanservice', //class containing the external function.
|
'classname' => '\local_treestudyplan\studentstudyplanservice', // Class containing the external function.
|
||||||
'methodname' => 'list_own_studyplans', //external function name.
|
'methodname' => 'list_own_studyplans', // External function name.
|
||||||
'description' => 'List own studyplans',
|
'description' => 'List own studyplans',
|
||||||
'type' => 'read', //database rights of the web service function (read, write).
|
'type' => 'read', // Database rights of the web service function (read, write).
|
||||||
'ajax' => true,
|
'ajax' => true,
|
||||||
'capabilities' => '',
|
'capabilities' => '',
|
||||||
'loginrequired' => true,
|
'loginrequired' => true,
|
||||||
],
|
],
|
||||||
'local_treestudyplan_get_own_studyplan' => [ //web service function name.
|
'local_treestudyplan_get_own_studyplan' => [ // Web service function name.
|
||||||
'classname' => '\local_treestudyplan\studentstudyplanservice', //class containing the external function.
|
'classname' => '\local_treestudyplan\studentstudyplanservice', // Class containing the external function.
|
||||||
'methodname' => 'get_own_studyplan', //external function name.
|
'methodname' => 'get_own_studyplan', // External function name.
|
||||||
'description' => 'Retrieve own studyplan',
|
'description' => 'Retrieve own studyplan',
|
||||||
'type' => 'read', //database rights of the web service function (read, write).
|
'type' => 'read', // Database rights of the web service function (read, write).
|
||||||
'ajax' => true,
|
'ajax' => true,
|
||||||
'capabilities' => '',
|
'capabilities' => '',
|
||||||
'loginrequired' => true,
|
'loginrequired' => true,
|
||||||
],
|
],
|
||||||
'local_treestudyplan_map_categories' => [ //web service function name.
|
'local_treestudyplan_map_categories' => [ // Web service function name.
|
||||||
'classname' => '\local_treestudyplan\courseservice', //class containing the external function.
|
'classname' => '\local_treestudyplan\courseservice', // Class containing the external function.
|
||||||
'methodname' => 'map_categories', //external function name.
|
'methodname' => 'map_categories', // External function name.
|
||||||
'description' => 'List available root categories',
|
'description' => 'List available root categories',
|
||||||
'type' => 'read', //database rights of the web service function (read, write).
|
'type' => 'read', // Database rights of the web service function (read, write).
|
||||||
'ajax' => true,
|
'ajax' => true,
|
||||||
'capabilities' => 'local/treestudyplan:editstudyplan',
|
'capabilities' => 'local/treestudyplan:editstudyplan',
|
||||||
'loginrequired' => true,
|
'loginrequired' => true,
|
||||||
],
|
],
|
||||||
'local_treestudyplan_get_category' => [ //web service function name.
|
'local_treestudyplan_get_category' => [ // Web service function name.
|
||||||
'classname' => '\local_treestudyplan\courseservice', //class containing the external function.
|
'classname' => '\local_treestudyplan\courseservice', // Class containing the external function.
|
||||||
'methodname' => 'get_category', //external function name.
|
'methodname' => 'get_category', // External function name.
|
||||||
'description' => 'Get details for specified category',
|
'description' => 'Get details for specified category',
|
||||||
'type' => 'read', //database rights of the web service function (read, write).
|
'type' => 'read', // Database rights of the web service function (read, write).
|
||||||
'ajax' => true,
|
'ajax' => true,
|
||||||
'capabilities' => 'local/treestudyplan:editstudyplan',
|
'capabilities' => 'local/treestudyplan:editstudyplan',
|
||||||
'loginrequired' => true,
|
'loginrequired' => true,
|
||||||
],
|
],
|
||||||
'local_treestudyplan_include_grade' => [ //web service function name.
|
'local_treestudyplan_include_grade' => [ // Web service function name.
|
||||||
'classname' => '\local_treestudyplan\studyplanservice', //class containing the external function.
|
'classname' => '\local_treestudyplan\studyplanservice', // Class containing the external function.
|
||||||
'methodname' => 'include_grade', //external function name.
|
'methodname' => 'include_grade', // External function name.
|
||||||
'description' => 'Include gradable in result',
|
'description' => 'Include gradable in result',
|
||||||
'type' => 'read', //database rights of the web service function (read, write).
|
'type' => 'read', // Database rights of the web service function (read, write).
|
||||||
'ajax' => true,
|
'ajax' => true,
|
||||||
'capabilities' => 'local/treestudyplan:editstudyplan, local/treestudyplan:selectowngradables',
|
'capabilities' => 'local/treestudyplan:editstudyplan, local/treestudyplan:selectowngradables',
|
||||||
'loginrequired' => true,
|
'loginrequired' => true,
|
||||||
],
|
],
|
||||||
'local_treestudyplan_all_associated' => [ //web service function name.
|
'local_treestudyplan_all_associated' => [ // Web service function name.
|
||||||
'classname' => '\local_treestudyplan\associationservice', //class containing the external function.
|
'classname' => '\local_treestudyplan\associationservice', // Class containing the external function.
|
||||||
'methodname' => 'all_associated', //external function name.
|
'methodname' => 'all_associated', // External function name.
|
||||||
'description' => 'List associated users',
|
'description' => 'List associated users',
|
||||||
'type' => 'read', //database rights of the web service function (read, write).
|
'type' => 'read', // Database rights of the web service function (read, write).
|
||||||
'ajax' => true,
|
'ajax' => true,
|
||||||
'capabilities' => 'local/treestudyplan:viewuserreports',
|
'capabilities' => 'local/treestudyplan:viewuserreports',
|
||||||
'loginrequired' => true,
|
'loginrequired' => true,
|
||||||
],
|
],
|
||||||
'local_treestudyplan_list_aggregators' => [ //web service function name.
|
'local_treestudyplan_list_aggregators' => [ // Web service function name.
|
||||||
'classname' => '\local_treestudyplan\studyplanservice', //class containing the external function.
|
'classname' => '\local_treestudyplan\studyplanservice', // Class containing the external function.
|
||||||
'methodname' => 'list_aggregators', //external function name.
|
'methodname' => 'list_aggregators', // External function name.
|
||||||
'description' => 'List available aggregators',
|
'description' => 'List available aggregators',
|
||||||
'type' => 'read', //database rights of the web service function (read, write).
|
'type' => 'read', // Database rights of the web service function (read, write).
|
||||||
'ajax' => true,
|
'ajax' => true,
|
||||||
'capabilities' => 'local/treestudyplan:editstudyplan',
|
'capabilities' => 'local/treestudyplan:editstudyplan',
|
||||||
'loginrequired' => true,
|
'loginrequired' => true,
|
||||||
],
|
],
|
||||||
'local_treestudyplan_disable_autoenddate' => [ //web service function name.
|
'local_treestudyplan_disable_autoenddate' => [ // Web service function name.
|
||||||
'classname' => '\local_treestudyplan\studyplanservice', //class containing the external function.
|
'classname' => '\local_treestudyplan\studyplanservice', // Class containing the external function.
|
||||||
'methodname' => 'disable_autoenddate', //external function name.
|
'methodname' => 'disable_autoenddate', // External function name.
|
||||||
'description' => 'Disable automatic end dates on courses in the study plan',
|
'description' => 'Disable automatic end dates on courses in the study plan',
|
||||||
'type' => 'write', //database rights of the web service function (read, write).
|
'type' => 'write', // Database rights of the web service function (read, write).
|
||||||
'ajax' => true,
|
'ajax' => true,
|
||||||
'capabilities' => 'local/treestudyplan:forcescales',
|
'capabilities' => 'local/treestudyplan:forcescales',
|
||||||
'loginrequired' => true,
|
'loginrequired' => true,
|
||||||
],
|
],
|
||||||
'local_treestudyplan_force_studyplan_scale' => [ //web service function name.
|
'local_treestudyplan_force_studyplan_scale' => [ // Web service function name.
|
||||||
'classname' => '\local_treestudyplan\studyplanservice', //class containing the external function.
|
'classname' => '\local_treestudyplan\studyplanservice', // Class containing the external function.
|
||||||
'methodname' => 'force_studyplan_scale', //external function name.
|
'methodname' => 'force_studyplan_scale', // External function name.
|
||||||
'description' => 'Change all associated gradables to the chosen scale if possible',
|
'description' => 'Change all associated gradables to the chosen scale if possible',
|
||||||
'type' => 'write', //database rights of the web service function (read, write).
|
'type' => 'write', // Database rights of the web service function (read, write).
|
||||||
'ajax' => true,
|
'ajax' => true,
|
||||||
'capabilities' => 'local/treestudyplan:forcescales',
|
'capabilities' => 'local/treestudyplan:forcescales',
|
||||||
'loginrequired' => true,
|
'loginrequired' => true,
|
||||||
],
|
],
|
||||||
'local_treestudyplan_list_scales' => [ //web service function name.
|
'local_treestudyplan_list_scales' => [ // Web service function name.
|
||||||
'classname' => '\local_treestudyplan\studyplanservice', //class containing the external function.
|
'classname' => '\local_treestudyplan\studyplanservice', // Class containing the external function.
|
||||||
'methodname' => 'list_scales', //external function name.
|
'methodname' => 'list_scales', // External function name.
|
||||||
'description' => 'List system scales',
|
'description' => 'List system scales',
|
||||||
'type' => 'write', //database rights of the web service function (read, write).
|
'type' => 'write', // Database rights of the web service function (read, write).
|
||||||
'ajax' => true,
|
'ajax' => true,
|
||||||
'capabilities' => 'local/treestudyplan:forcescales',
|
'capabilities' => 'local/treestudyplan:forcescales',
|
||||||
'loginrequired' => true,
|
'loginrequired' => true,
|
||||||
],
|
],
|
||||||
'local_treestudyplan_duplicate_plan' => [ //web service function name.
|
'local_treestudyplan_duplicate_plan' => [ // Web service function name.
|
||||||
'classname' => '\local_treestudyplan\studyplanservice', //class containing the external function.
|
'classname' => '\local_treestudyplan\studyplanservice', // Class containing the external function.
|
||||||
'methodname' => 'duplicate_plan', //external function name.
|
'methodname' => 'duplicate_plan', // External function name.
|
||||||
'description' => 'Copy studyplan',
|
'description' => 'Copy studyplan',
|
||||||
'type' => 'write', //database rights of the web service function (read, write).
|
'type' => 'write', // Database rights of the web service function (read, write).
|
||||||
'ajax' => true,
|
'ajax' => true,
|
||||||
'capabilities' => 'local/treestudyplan:editstudyplan',
|
'capabilities' => 'local/treestudyplan:editstudyplan',
|
||||||
'loginrequired' => true,
|
'loginrequired' => true,
|
||||||
],
|
],
|
||||||
'local_treestudyplan_export_plan' => [ //web service function name.
|
'local_treestudyplan_export_plan' => [ // Web service function name.
|
||||||
'classname' => '\local_treestudyplan\studyplanservice', //class containing the external function.
|
'classname' => '\local_treestudyplan\studyplanservice', // Class containing the external function.
|
||||||
'methodname' => 'export_plan', //external function name.
|
'methodname' => 'export_plan', // External function name.
|
||||||
'description' => 'Export study plan',
|
'description' => 'Export study plan',
|
||||||
'type' => 'read', //database rights of the web service function (read, write).
|
'type' => 'read', // Database rights of the web service function (read, write).
|
||||||
'ajax' => true,
|
'ajax' => true,
|
||||||
'capabilities' => 'local/treestudyplan:editstudyplan',
|
'capabilities' => 'local/treestudyplan:editstudyplan',
|
||||||
'loginrequired' => true,
|
'loginrequired' => true,
|
||||||
],
|
],
|
||||||
'local_treestudyplan_export_studylines' => [ //web service function name.
|
'local_treestudyplan_export_studylines' => [ // Web service function name.
|
||||||
'classname' => '\local_treestudyplan\studyplanservice', //class containing the external function.
|
'classname' => '\local_treestudyplan\studyplanservice', // Class containing the external function.
|
||||||
'methodname' => 'export_studylines', //external function name.
|
'methodname' => 'export_studylines', // External function name.
|
||||||
'description' => 'Export study plan',
|
'description' => 'Export study plan',
|
||||||
'type' => 'read', //database rights of the web service function (read, write).
|
'type' => 'read', // Database rights of the web service function (read, write).
|
||||||
'ajax' => true,
|
'ajax' => true,
|
||||||
'capabilities' => 'local/treestudyplan:editstudyplan',
|
'capabilities' => 'local/treestudyplan:editstudyplan',
|
||||||
'loginrequired' => true,
|
'loginrequired' => true,
|
||||||
],
|
],
|
||||||
'local_treestudyplan_import_plan' => [ //web service function name.
|
'local_treestudyplan_import_plan' => [ // Web service function name.
|
||||||
'classname' => '\local_treestudyplan\studyplanservice', //class containing the external function.
|
'classname' => '\local_treestudyplan\studyplanservice', // Class containing the external function.
|
||||||
'methodname' => 'import_plan', //external function name.
|
'methodname' => 'import_plan', // External function name.
|
||||||
'description' => 'Import study plan',
|
'description' => 'Import study plan',
|
||||||
'type' => 'write', //database rights of the web service function (read, write).
|
'type' => 'write', // Database rights of the web service function (read, write).
|
||||||
'ajax' => true,
|
'ajax' => true,
|
||||||
'capabilities' => 'local/treestudyplan:editstudyplan',
|
'capabilities' => 'local/treestudyplan:editstudyplan',
|
||||||
'loginrequired' => true,
|
'loginrequired' => true,
|
||||||
],
|
],
|
||||||
'local_treestudyplan_import_studylines' => [ //web service function name.
|
'local_treestudyplan_import_studylines' => [ // Web service function name.
|
||||||
'classname' => '\local_treestudyplan\studyplanservice', //class containing the external function.
|
'classname' => '\local_treestudyplan\studyplanservice', // Class containing the external function.
|
||||||
'methodname' => 'import_studylines', //external function name.
|
'methodname' => 'import_studylines', // External function name.
|
||||||
'description' => 'Import study plan',
|
'description' => 'Import study plan',
|
||||||
'type' => 'write', //database rights of the web service function (read, write).
|
'type' => 'write', // Database rights of the web service function (read, write).
|
||||||
'ajax' => true,
|
'ajax' => true,
|
||||||
'capabilities' => 'local/treestudyplan:editstudyplan',
|
'capabilities' => 'local/treestudyplan:editstudyplan',
|
||||||
'loginrequired' => true,
|
'loginrequired' => true,
|
||||||
],
|
],
|
||||||
'local_treestudyplan_edit_period' => [ //web service function name.
|
'local_treestudyplan_edit_period' => [ // Web service function name.
|
||||||
'classname' => '\local_treestudyplan\studyplanservice', //class containing the external function.
|
'classname' => '\local_treestudyplan\studyplanservice', // Class containing the external function.
|
||||||
'methodname' => 'edit_period', //external function name.
|
'methodname' => 'edit_period', // External function name.
|
||||||
'description' => 'Edit period name and timing',
|
'description' => 'Edit period name and timing',
|
||||||
'type' => 'write', //database rights of the web service function (read, write).
|
'type' => 'write', // Database rights of the web service function (read, write).
|
||||||
'ajax' => true,
|
'ajax' => true,
|
||||||
'capabilities' => 'local/treestudyplan:editstudyplan',
|
'capabilities' => 'local/treestudyplan:editstudyplan',
|
||||||
'loginrequired' => true,
|
'loginrequired' => true,
|
||||||
],
|
],
|
||||||
'local_treestudyplan_submit_cm_editform' => [ //web service function name.
|
'local_treestudyplan_submit_cm_editform' => [ // Web service function name.
|
||||||
'classname' => '\local_treestudyplan\studyplanservice', //class containing the external function.
|
'classname' => '\local_treestudyplan\studyplanservice', // Class containing the external function.
|
||||||
'methodname' => 'submit_cm_editform', //external function name.
|
'methodname' => 'submit_cm_editform', // External function name.
|
||||||
'description' => 'Submit course module edit form',
|
'description' => 'Submit course module edit form',
|
||||||
'type' => 'write', //database rights of the web service function (read, write).
|
'type' => 'write', // Database rights of the web service function (read, write).
|
||||||
'ajax' => true,
|
'ajax' => true,
|
||||||
'capabilities' => 'local/treestudyplan:editstudyplan',
|
'capabilities' => 'local/treestudyplan:editstudyplan',
|
||||||
'loginrequired' => true,
|
'loginrequired' => true,
|
||||||
],
|
],
|
||||||
'local_treestudyplan_get_teaching_studyplans' => [ //web service function name.
|
'local_treestudyplan_get_teaching_studyplans' => [ // Web service function name.
|
||||||
'classname' => '\local_treestudyplan\studentstudyplanservice', //class containing the external function.
|
'classname' => '\local_treestudyplan\studentstudyplanservice', // Class containing the external function.
|
||||||
'methodname' => 'get_teaching_studyplans', //external function name.
|
'methodname' => 'get_teaching_studyplans', // External function name.
|
||||||
'description' => 'Get the studyplans I currently teach in',
|
'description' => 'Get the studyplans I currently teach in',
|
||||||
'type' => 'read', //database rights of the web service function (read, write).
|
'type' => 'read', // Database rights of the web service function (read, write).
|
||||||
'ajax' => true,
|
'ajax' => true,
|
||||||
'capabilities' => 'local/treestudyplan:viewuserreports',
|
'capabilities' => 'local/treestudyplan:viewuserreports',
|
||||||
'loginrequired' => true,
|
'loginrequired' => true,
|
||||||
],
|
],
|
||||||
'local_treestudyplan_list_accessible_categories' => [ //web service function name.
|
'local_treestudyplan_list_accessible_categories' => [ // Web service function name.
|
||||||
'classname' => '\local_treestudyplan\courseservice', //class containing the external function.
|
'classname' => '\local_treestudyplan\courseservice', // Class containing the external function.
|
||||||
'methodname' => 'list_accessible_categories', //external function name.
|
'methodname' => 'list_accessible_categories', // External function name.
|
||||||
'description' => 'Get categories accessible to the current user',
|
'description' => 'Get categories accessible to the current user',
|
||||||
'type' => 'read', //database rights of the web service function (read, write).
|
'type' => 'read', // Database rights of the web service function (read, write).
|
||||||
'ajax' => true,
|
'ajax' => true,
|
||||||
'loginrequired' => true,
|
'loginrequired' => true,
|
||||||
],
|
],
|
||||||
'local_treestudyplan_list_used_categories' => [ //web service function name.
|
'local_treestudyplan_list_used_categories' => [ // Web service function name.
|
||||||
'classname' => '\local_treestudyplan\courseservice', //class containing the external function.
|
'classname' => '\local_treestudyplan\courseservice', // Class containing the external function.
|
||||||
'methodname' => 'list_used_categories', //external function name.
|
'methodname' => 'list_used_categories', // External function name.
|
||||||
'description' => 'Get categories hosting a studyplan',
|
'description' => 'Get categories hosting a studyplan',
|
||||||
'type' => 'read', //database rights of the web service function (read, write).
|
'type' => 'read', // Database rights of the web service function (read, write).
|
||||||
'capabilities' => 'local/treestudyplan:editstudyplan',
|
'capabilities' => 'local/treestudyplan:editstudyplan',
|
||||||
'ajax' => true,
|
'ajax' => true,
|
||||||
'loginrequired' => true,
|
'loginrequired' => true,
|
||||||
],
|
],
|
||||||
'local_treestudyplan_scan_badge_progress' => [ //web service function name.
|
'local_treestudyplan_scan_badge_progress' => [ // Web service function name.
|
||||||
'classname' => '\local_treestudyplan\courseservice', //class containing the external function.
|
'classname' => '\local_treestudyplan\courseservice', // Class containing the external function.
|
||||||
'methodname' => 'scan_badge_progress', //external function name.
|
'methodname' => 'scan_badge_progress', // External function name.
|
||||||
'description' => 'Scan progress of students in attaining badge',
|
'description' => 'Scan progress of students in attaining badge',
|
||||||
'type' => 'read', //database rights of the web service function (read, write).
|
'type' => 'read', // Database rights of the web service function (read, write).
|
||||||
'capabilities' => 'local/treestudyplan:viewuserreports',
|
'capabilities' => 'local/treestudyplan:viewuserreports',
|
||||||
'ajax' => true,
|
'ajax' => true,
|
||||||
'loginrequired' => true,
|
'loginrequired' => true,
|
||||||
],
|
],
|
||||||
'local_treestudyplan_scan_completion_progress' => [ //web service function name.
|
'local_treestudyplan_scan_completion_progress' => [ // Web service function name.
|
||||||
'classname' => '\local_treestudyplan\courseservice', //class containing the external function.
|
'classname' => '\local_treestudyplan\courseservice', // Class containing the external function.
|
||||||
'methodname' => 'scan_completion_progress', //external function name.
|
'methodname' => 'scan_completion_progress', // External function name.
|
||||||
'description' => 'Scan progress of students in attaining completions',
|
'description' => 'Scan progress of students in attaining completions',
|
||||||
'type' => 'read', //database rights of the web service function (read, write).
|
'type' => 'read', // Database rights of the web service function (read, write).
|
||||||
'capabilities' => 'local/treestudyplan:viewuserreports',
|
'capabilities' => 'local/treestudyplan:viewuserreports',
|
||||||
'ajax' => true,
|
'ajax' => true,
|
||||||
'loginrequired' => true,
|
'loginrequired' => true,
|
||||||
],
|
],
|
||||||
'local_treestudyplan_scan_grade_progress' => [ //web service function name.
|
'local_treestudyplan_scan_grade_progress' => [ // Web service function name.
|
||||||
'classname' => '\local_treestudyplan\courseservice', //class containing the external function.
|
'classname' => '\local_treestudyplan\courseservice', // Class containing the external function.
|
||||||
'methodname' => 'scan_grade_progress', //external function name.
|
'methodname' => 'scan_grade_progress', // External function name.
|
||||||
'description' => 'Scan progress of students in attaining grades',
|
'description' => 'Scan progress of students in attaining grades',
|
||||||
'type' => 'read', //database rights of the web service function (read, write).
|
'type' => 'read', // Database rights of the web service function (read, write).
|
||||||
'capabilities' => 'local/treestudyplan:viewuserreports',
|
'capabilities' => 'local/treestudyplan:viewuserreports',
|
||||||
'ajax' => true,
|
'ajax' => true,
|
||||||
'loginrequired' => true,
|
'loginrequired' => true,
|
||||||
],
|
],
|
||||||
'local_treestudyplan_cascade_cohortsync' => [ //web service function name.
|
'local_treestudyplan_cascade_cohortsync' => [ // Web service function name.
|
||||||
'classname' => '\local_treestudyplan\associationservice', //class containing the external function.
|
'classname' => '\local_treestudyplan\associationservice', // Class containing the external function.
|
||||||
'methodname' => 'cascade_cohortsync', //external function name.
|
'methodname' => 'cascade_cohortsync', // External function name.
|
||||||
'description' => 'Sync cohortsync to studyplan association',
|
'description' => 'Sync cohortsync to studyplan association',
|
||||||
'type' => 'read', //database rights of the web service function (read, write).
|
'type' => 'read', // Database rights of the web service function (read, write).
|
||||||
'capabilities' => 'local/treestudyplan:editstudyplan',
|
'capabilities' => 'local/treestudyplan:editstudyplan',
|
||||||
'ajax' => true,
|
'ajax' => true,
|
||||||
'loginrequired' => true,
|
'loginrequired' => true,
|
||||||
],
|
],
|
||||||
'local_treestudyplan_course_period_timing' => [ //web service function name.
|
'local_treestudyplan_course_period_timing' => [ // Web service function name.
|
||||||
'classname' => '\local_treestudyplan\studyplanservice', //class containing the external function.
|
'classname' => '\local_treestudyplan\studyplanservice', // Class containing the external function.
|
||||||
'methodname' => 'course_period_timing', //external function name.
|
'methodname' => 'course_period_timing', // External function name.
|
||||||
'description' => 'Chenge course start and end times to match period',
|
'description' => 'Chenge course start and end times to match period',
|
||||||
'type' => 'read', //database rights of the web service function (read, write).
|
'type' => 'read', // Database rights of the web service function (read, write).
|
||||||
'capabilities' => 'local/treestudyplan:editstudyplan',
|
'capabilities' => 'local/treestudyplan:editstudyplan',
|
||||||
'ajax' => true,
|
'ajax' => true,
|
||||||
'loginrequired' => true,
|
'loginrequired' => true,
|
||||||
],
|
],
|
||||||
'local_treestudyplan_set_studyitem_span' => [ //web service function name.
|
'local_treestudyplan_set_studyitem_span' => [ // Web service function name.
|
||||||
'classname' => '\local_treestudyplan\studyplanservice', //class containing the external function.
|
'classname' => '\local_treestudyplan\studyplanservice', // Class containing the external function.
|
||||||
'methodname' => 'set_studyitem_span', //external function name.
|
'methodname' => 'set_studyitem_span', // External function name.
|
||||||
'description' => 'Change the span of a course item',
|
'description' => 'Change the span of a course item',
|
||||||
'type' => 'read', //database rights of the web service function (read, write).
|
'type' => 'read', // Database rights of the web service function (read, write).
|
||||||
'capabilities' => 'local/treestudyplan:editstudyplan',
|
'capabilities' => 'local/treestudyplan:editstudyplan',
|
||||||
'ajax' => true,
|
'ajax' => true,
|
||||||
'loginrequired' => true,
|
'loginrequired' => true,
|
||||||
|
|
|
@ -117,9 +117,9 @@ if ($mform->is_cancelled()) {
|
||||||
|
|
||||||
redirect("$CFG->wwwroot/local/treestudyplan/invitations.php?sent={$id}");
|
redirect("$CFG->wwwroot/local/treestudyplan/invitations.php?sent={$id}");
|
||||||
} else if (!empty($data->resend)) {
|
} else if (!empty($data->resend)) {
|
||||||
|
exit;
|
||||||
} else if (!empty($data->delete)) {
|
} else if (!empty($data->delete)) {
|
||||||
|
exit;
|
||||||
} else
|
} else
|
||||||
{
|
{
|
||||||
print_error("invaliddata");
|
print_error("invaliddata");
|
||||||
|
@ -129,9 +129,6 @@ if ($mform->is_cancelled()) {
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
$data = null;
|
$data = null;
|
||||||
if ($unitid > 0) {
|
|
||||||
|
|
||||||
}
|
|
||||||
$mform->display();
|
$mform->display();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -115,13 +115,13 @@ if ($hassiteconfig) {
|
||||||
$page->add(new admin_setting_configcheckbox('local_treestudyplan/bistate_support_failed',
|
$page->add(new admin_setting_configcheckbox('local_treestudyplan/bistate_support_failed',
|
||||||
get_string('setting_bistate_support_failed', 'local_treestudyplan'),
|
get_string('setting_bistate_support_failed', 'local_treestudyplan'),
|
||||||
get_string('settingdesc_bistate_support_failed', 'local_treestudyplan'),
|
get_string('settingdesc_bistate_support_failed', 'local_treestudyplan'),
|
||||||
True,
|
true,
|
||||||
));
|
));
|
||||||
|
|
||||||
$page->add(new admin_setting_configcheckbox('local_treestudyplan/bistate_accept_pending_submitted',
|
$page->add(new admin_setting_configcheckbox('local_treestudyplan/bistate_accept_pending_submitted',
|
||||||
get_string('setting_bistate_accept_pending_submitted', 'local_treestudyplan'),
|
get_string('setting_bistate_accept_pending_submitted', 'local_treestudyplan'),
|
||||||
get_string('settingdesc_bistate_accept_pending_submitted', 'local_treestudyplan'),
|
get_string('settingdesc_bistate_accept_pending_submitted', 'local_treestudyplan'),
|
||||||
False,
|
false,
|
||||||
));
|
));
|
||||||
|
|
||||||
// Add settings page to the admin settings category.
|
// Add settings page to the admin settings category.
|
||||||
|
|
Loading…
Reference in a new issue