Skip to content

Commit

Permalink
Merge pull request #4 from mebis-lp/develop
Browse files Browse the repository at this point in the history
MBS-6126 / MBS-6127 / MBS-6063
  • Loading branch information
PM84 authored Feb 1, 2022
2 parents 67f784b + 93f3287 commit 673ffbe
Show file tree
Hide file tree
Showing 26 changed files with 58 additions and 35 deletions.
2 changes: 1 addition & 1 deletion backup/moodle2/backup_learningmap_activity_task.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
* Backup class for mod_learningmap
*
* @package mod_learningmap
* @copyright 2021, ISB Bayern
* @copyright 2021-2022, ISB Bayern
* @author Stefan Hanauska <[email protected]>
* @license https://www.gnu.org/licenses/agpl-3.0.html GNU AGPL v3 or later
*/
Expand Down
2 changes: 1 addition & 1 deletion backup/moodle2/backup_learningmap_stepslib.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
* Backup steps for mod_learningmap
*
* @package mod_learningmap
* @copyright 2021, ISB Bayern
* @copyright 2021-2022, ISB Bayern
* @author Stefan Hanauska <[email protected]>
* @license https://www.gnu.org/licenses/agpl-3.0.html GNU AGPL v3 or later
*/
Expand Down
2 changes: 1 addition & 1 deletion backup/moodle2/restore_learningmap_activity_task.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
* Restore class for mod_learningmap
*
* @package mod_learningmap
* @copyright 2021, ISB Bayern
* @copyright 2021-2022, ISB Bayern
* @author Stefan Hanauska <[email protected]>
* @license https://www.gnu.org/licenses/agpl-3.0.html GNU AGPL v3 or later
*/
Expand Down
2 changes: 1 addition & 1 deletion backup/moodle2/restore_learningmap_stepslib.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
* Restore steps for mod_learningmap
*
* @package mod_learningmap
* @copyright 2021, ISB Bayern
* @copyright 2021-2022, ISB Bayern
* @author Stefan Hanauska <[email protected]>
* @license https://www.gnu.org/licenses/agpl-3.0.html GNU AGPL v3 or later
*/
Expand Down
2 changes: 1 addition & 1 deletion classes/autoupdate.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
* Autoupdate class for mod_learningmap
*
* @package mod_learningmap
* @copyright 2021, ISB Bayern
* @copyright 2021-2022, ISB Bayern
* @author Stefan Hanauska <[email protected]>
* @license https://www.gnu.org/licenses/agpl-3.0.html GNU AGPL v3 or later
*/
Expand Down
2 changes: 1 addition & 1 deletion classes/completion/custom_completion.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
* Custom completion rules for mod_learningmap
*
* @package mod_learningmap
* @copyright 2021, ISB Bayern
* @copyright 2021-2022, ISB Bayern
* @author Stefan Hanauska <[email protected]>
* @license https://www.gnu.org/licenses/agpl-3.0.html GNU AGPL v3 or later
*/
Expand Down
2 changes: 1 addition & 1 deletion classes/mapworker.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
* Class for handling the content of the learningmap
*
* @package mod_learningmap
* @copyright 2021, ISB Bayern
* @copyright 2021-2022, ISB Bayern
* @author Stefan Hanauska <[email protected]>
* @license https://www.gnu.org/licenses/agpl-3.0.html GNU AGPL v3 or later
*/
Expand Down
2 changes: 1 addition & 1 deletion classes/privacy/provider.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
* Privacy subsystem implementation for mod_learningmap
*
* @package mod_learningmap
* @copyright 2021, ISB Bayern
* @copyright 2021-2022, ISB Bayern
* @author Stefan Hanauska <[email protected]>
* @license https://www.gnu.org/licenses/agpl-3.0.html GNU AGPL v3 or later
*/
Expand Down
2 changes: 1 addition & 1 deletion db/access.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
* Capability definitions for mod_learningmap
*
* @package mod_learningmap
* @copyright 2021, ISB Bayern
* @copyright 2021-2022, ISB Bayern
* @author Stefan Hanauska <[email protected]>
* @license https://www.gnu.org/licenses/agpl-3.0.html GNU AGPL v3 or later
*/
Expand Down
2 changes: 1 addition & 1 deletion db/events.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
* Events for mod_learningmap
*
* @package mod_learningmap
* @copyright 2021, ISB Bayern
* @copyright 2021-2022, ISB Bayern
* @author Stefan Hanauska <[email protected]>
* @license https://www.gnu.org/licenses/agpl-3.0.html GNU AGPL v3 or later
*/
Expand Down
2 changes: 1 addition & 1 deletion db/upgrade.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
* Upgrade functions for mod_learningmap
*
* @package mod_learningmap
* @copyright 2021, ISB Bayern
* @copyright 2021-2022, ISB Bayern
* @author Stefan Hanauska <[email protected]>
* @license https://www.gnu.org/licenses/agpl-3.0.html GNU AGPL v3 or later
*/
Expand Down
2 changes: 1 addition & 1 deletion index.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
* Index.php for mod_learningmap
*
* @package mod_learningmap
* @copyright 2021, ISB Bayern
* @copyright 2021-2022, ISB Bayern
* @author Stefan Hanauska <[email protected]>
* @license https://www.gnu.org/licenses/agpl-3.0.html GNU AGPL v3 or later
*/
Expand Down
4 changes: 3 additions & 1 deletion lang/en/learningmap.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
* Language file for mod_learningmap
*
* @package mod_learningmap
* @copyright 2021, ISB Bayern
* @copyright 2021-2022, ISB Bayern
* @author Stefan Hanauska <[email protected]>
* @license https://www.gnu.org/licenses/agpl-3.0.html GNU AGPL v3 or later
*/
Expand All @@ -34,6 +34,7 @@
$string['completiondetail:all_places'] = 'Reach all places';
$string['completiondetail:all_targets'] = 'Reach all target places';
$string['completiondetail:one_target'] = 'Reach one target place';
$string['completiondisabled'] = 'Completion tracking is disabled in course settings. Without completion tracking this plugin won\'t work.';
$string['completiontype'] = 'Type of completion';
$string['editorhelp'] = 'How to use the editor';
$string['editplace'] = 'Edit place';
Expand All @@ -52,6 +53,7 @@
$string['name'] = 'Learning map name';
$string['name_help'] = 'The name of the learning map is only displayed if the "Show map on course page" is not checked.';
$string['nocompletion'] = 'No completion with map items';
$string['nocompletionenabled'] = 'Not available because completion is not enabled';
$string['paths'] = 'Paths';
$string['places'] = 'Places';
$string['pluginadministration'] = 'Learning map administration';
Expand Down
2 changes: 1 addition & 1 deletion lib.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
* Library for mod_learningmap
*
* @package mod_learningmap
* @copyright 2021, ISB Bayern
* @copyright 2021-2022, ISB Bayern
* @author Stefan Hanauska <[email protected]>
* @license https://www.gnu.org/licenses/agpl-3.0.html GNU AGPL v3 or later
*/
Expand Down
17 changes: 12 additions & 5 deletions mod_form.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
* Editing form for mod_learningmap
*
* @package mod_learningmap
* @copyright 2021, ISB Bayern
* @copyright 2021-2022, ISB Bayern
* @author Stefan Hanauska <[email protected]>
* @license https://www.gnu.org/licenses/agpl-3.0.html GNU AGPL v3 or later
*/
Expand Down Expand Up @@ -54,9 +54,13 @@ public function definition() : void {
$s['coursemodules'] = [];
foreach ($section as $cmid) {
$module = $cm->get_cm($cmid);
// Get only course modules with completion enabled and not deleted.
if ($module->completion > 0 && $module->deletioninprogress == 0) {
$s['coursemodules'][] = ['id' => $cmid, 'name' => $module->name];
// Get only course modules which are not deleted.
if ($module->deletioninprogress == 0) {
$s['coursemodules'][] = [
'id' => $cmid,
'name' => $module->name,
'completionenabled' => $module->completion > 0
];
}
}
$activitysel[] = $s;
Expand All @@ -80,7 +84,10 @@ public function definition() : void {
'html',
$OUTPUT->render_from_template(
'mod_learningmap/formitem',
['sections' => $activitysel, 'help' => $OUTPUT->help_icon('intro', 'learningmap', '')]
['sections' => $activitysel,
'help' => $OUTPUT->help_icon('intro', 'learningmap', ''),
'completiondisabled' => $cm->get_course()->enablecompletion == 0
]
)
);

Expand Down
Binary file removed pix/.DS_Store
Binary file not shown.
2 changes: 1 addition & 1 deletion settings.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
* Admin settings for mod_learningmap
*
* @package mod_learningmap
* @copyright 2021, ISB Bayern
* @copyright 2021-2022, ISB Bayern
* @author Stefan Hanauska <[email protected]>
* @license https://www.gnu.org/licenses/agpl-3.0.html GNU AGPL v3 or later
*/
Expand Down
4 changes: 4 additions & 0 deletions styles.css
Original file line number Diff line number Diff line change
Expand Up @@ -39,3 +39,7 @@
.learningmap-used-activity {
color: green;
}

.learningmap-disabled-activity {
color: lightsalmon;
}
18 changes: 13 additions & 5 deletions templates/activityselector.mustache
Original file line number Diff line number Diff line change
Expand Up @@ -36,11 +36,13 @@ along with this program. If not, see <https://www.gnu.org/licenses/>.
"coursemodules":[
{
"id":"1039",
"name":"Activity 1"
"name":"Activity 1",
"completionenabled":"true"
},
{
"id":"1040",
"name":"Activity 2"
"name":"Activity 2",
"completionenabled":"false"
}
]
},
Expand All @@ -49,10 +51,11 @@ along with this program. If not, see <https://www.gnu.org/licenses/>.
"coursemodules":[
{
"id":"1043",
"name":"Activity 3"
"name":"Activity 3",
"completionenabled":"true"
}
]
},
}
]
}
}}
Expand All @@ -62,9 +65,14 @@ along with this program. If not, see <https://www.gnu.org/licenses/>.
<div class="card-text">{{#str}} activity, core {{/str}}
<select id="learningmap-activity-selector">
{{#sections}}
<option disabled title="{{name}}">{{#shortentext}} 30, {{{name}}} {{/shortentext}}</option>
<option disabled title="{{name}}">-- {{#shortentext}} 30, {{{name}}} {{/shortentext}} --</option>
{{#coursemodules}}
{{^completionenabled}}
<option value="{{id}}" disabled class="learningmap-disabled-activity" title="{{#str}} nocompletionenabled, learningmap {{/str}}">{{#shortentext}} 30, {{{name}}} {{/shortentext}}</option>
{{/completionenabled}}
{{#completionenabled}}
<option value="{{id}}" title="{{name}}">{{#shortentext}} 30, {{{name}}} {{/shortentext}}</option>
{{/completionenabled}}
{{/coursemodules}}
{{/sections}}
</select><br/>
Expand Down
6 changes: 4 additions & 2 deletions templates/formitem.mustache
Original file line number Diff line number Diff line change
Expand Up @@ -52,11 +52,13 @@ along with this program. If not, see <https://www.gnu.org/licenses/>.
"name":"Activity 3"
}
]
},
}
],
"help":"This is the help text"
"help":"This is the help text",
"completiondisabled":"false"
}
}}
{{#completiondisabled}}<div class="alert alert-danger row">{{#str}} completiondisabled, learningmap {{/str}}</div>{{/completiondisabled}}
<div class="form-group row fitem">
<div class="col-md-3 col-form-label d-flex pb-0 pr-md-0">
<label class="d-inline word-break">{{#str}} learningmap, learningmap {{/str}}</label>
Expand Down
2 changes: 1 addition & 1 deletion templates/svgskeleton.mustache
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ along with this program. If not, see <https://www.gnu.org/licenses/>.
Context variables required for this template:
* none
Example content(json):
Example context (json):
{
"id":0,
"places":[
Expand Down
2 changes: 1 addition & 1 deletion tests/generator/lib.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
* mod_learningmap data generator
*
* @package mod_learningmap
* @copyright 2021, ISB Bayern
* @copyright 2021-2022, ISB Bayern
* @author Stefan Hanauska <[email protected]>
* @license https://www.gnu.org/licenses/agpl-3.0.html GNU AGPL v3 or later
*/
Expand Down
2 changes: 1 addition & 1 deletion tests/mod_learningmap_completion_test.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
* Unit test for mod_learningmap
*
* @package mod_learningmap
* @copyright 2021, ISB Bayern
* @copyright 2021-2022, ISB Bayern
* @author Stefan Hanauska <[email protected]>
* @license https://www.gnu.org/licenses/agpl-3.0.html GNU AGPL v3 or later
* @group mod_learningmap
Expand Down
2 changes: 1 addition & 1 deletion tests/mod_learningmap_generation_test.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
* Unit test for mod_learningmap
*
* @package mod_learningmap
* @copyright 2021, ISB Bayern
* @copyright 2021-2022, ISB Bayern
* @author Stefan Hanauska <[email protected]>
* @license https://www.gnu.org/licenses/agpl-3.0.html GNU AGPL v3 or later
* @group mod_learningmap
Expand Down
6 changes: 3 additions & 3 deletions version.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,14 @@
* Version information for mod_learningmap
*
* @package mod_learningmap
* @copyright 2021, ISB Bayern
* @copyright 2021-2022, ISB Bayern
* @author Stefan Hanauska <[email protected]>
* @license https://www.gnu.org/licenses/agpl-3.0.html GNU AGPL v3 or later
*/
defined('MOODLE_INTERNAL') || die();

$plugin->component = 'mod_learningmap';
$plugin->release = '0.4';
$plugin->version = 2022012701;
$plugin->release = '0.4.1';
$plugin->version = 2022013101;
$plugin->requires = 2020061500;
$plugin->maturity = MATURITY_BETA;
2 changes: 1 addition & 1 deletion view.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
* View a learning map instance
*
* @package mod_learningmap
* @copyright 2021, ISB Bayern
* @copyright 2021-2022, ISB Bayern
* @author Stefan Hanauska <[email protected]>
* @license https://www.gnu.org/licenses/agpl-3.0.html GNU AGPL v3 or later
*/
Expand Down

0 comments on commit 673ffbe

Please sign in to comment.