Skip to content

Commit

Permalink
Moodle plugin CI and Documentation updated.
Browse files Browse the repository at this point in the history
  • Loading branch information
raja-lmsace committed Jan 19, 2024
1 parent 5314140 commit 87b48c1
Show file tree
Hide file tree
Showing 7 changed files with 57 additions and 12 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/moodle-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ jobs:
fail-fast: false
matrix:
include:
- php: '8.0'
- php: '8.2'
moodle-branch: 'MOODLE_403_STABLE'
database: 'pgsql'
- php: '8.0'
Expand Down
13 changes: 8 additions & 5 deletions Documentation.md
Original file line number Diff line number Diff line change
Expand Up @@ -62,8 +62,7 @@ Upon course completion, users earn points and acquire skills based on the establ

Manage skills to create a new skill and edit existing skills.


2. **Filter:** The "Filter" option is used to filter the list of skills within the category lists.
1. **Filter:** The "Filter" option is used to filter the list of skills within the category lists.

### Active Skills:

Expand Down Expand Up @@ -97,7 +96,7 @@ The "Active Skills" tab displays a full list of created skills or the filtered s
2. ***Status:*** Use this toggle icon in the table to enable or disable the status of the specific skill.
3. **Archive:** Click the "Archive" option in the table to Archive the specific skill.

### ***Archived Skills:***
### Archived Skills:

Archived skills are not available in course list, and not awared to students.

Expand Down Expand Up @@ -170,7 +169,7 @@ Select a color to represent the level. This will override the general skill colo
Please upload an image that represents the level of skill. This will be used for visualization.


# Course settings
# Course skills settings

To access the skills list and assign them to a course, utilize the "Manage Skills" link found in the secondary navigation of the course. Within this interface, you have the option to grant a precise number of points or set the points required to reach a specific skill level.

Expand All @@ -190,7 +189,7 @@ Simply employ the "Edit" icon in the table to activate the skill for the course

***Nothing:*** Choose 'Nothing' to use activity completion, instead of course completion, for awarding points.

***Add points:*** Select 'Add points' to have the specified number of skill points added upon course completion. Please note that using negative numbers will result in a deduction of points.
***Points:*** Select 'Add points' to have the specified number of skill points added upon course completion. Please note that using negative numbers will result in a deduction of points.

***Set level:*** Choose 'Set level' to have the completion of the course add the necessary number of points required to reach that level, unless the student already has more points.

Expand All @@ -203,3 +202,7 @@ Simply employ the "Edit" icon in the table to activate the skill for the course
***Example:***
Entering "50" will add 50 points.
Entering "-20" will deduct 20 points.

4. **Level:**

Choose the desired skill level for this course. Upon completion, the student will receive the corresponding number of points required to achieve the selected level.
44 changes: 44 additions & 0 deletions db/upgrade.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
<?php
// This file is part of Moodle - http://moodle.org/
//
// Moodle is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// Moodle is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.

/**
* DB authentication plugin upgrade code
*
* @package tool_skills
* @copyright 2023 bdecent GmbH <https://bdecent.de>
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/

/**
* Function to upgrade tool_skills.
* @param int $oldversion the version we are upgrading from
* @return bool result
*/
function xmldb_tool_skills_upgrade($oldversion) {
global $CFG, $DB;

$dbman = $DB->get_manager();
if ($oldversion < 2023102505) {
$table = new xmldb_table('tool_skills_awardlogs');
$field = new xmldb_field('skill', XMLDB_TYPE_INTEGER, 18, null, null, null, null, 'id');
// Conditionally launch add field timecreated.
if ($dbman->table_exists($table) && !$dbman->field_exists($table, $field)) {
$dbman->add_field($table, $field);
}
upgrade_plugin_savepoint(true, 2023102505, 'tool', 'skills');
}
return true;
}
3 changes: 2 additions & 1 deletion tests/behat/behat_tool_skills.php
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,8 @@ public function i_should_see_message_confirmation($messagetext) {
$cssclass = ($CFG->branch <= "402") ? '.confirmation-dialogue' : '.modal-body';
$this->execute("behat_general::assert_element_contains_text", [
"Are you sure! do you want to $messagetext this skill and its levels",
$cssclass, "css_element"]);
$cssclass, "css_element",
]);
}

}
3 changes: 1 addition & 2 deletions tests/behat/tool_skills_general.feature
Original file line number Diff line number Diff line change
Expand Up @@ -145,8 +145,7 @@ Feature: Configuring the tool_skills plugin on the "Skills" page, applying diffe
| Level #3 name | Level 3 |
And I press "Save changes"
Then I am on "Course 1" course homepage
And I click on "More" "link" in the ".secondary-navigation" "css_element"
And I click on "Manage skills" "link"
And I navigate to "Manage skills" in current page administration
And I should see "Begineer"
And I click on ".skill-course-actions .action-edit" "css_element"
And I should see "Set course skills" in the ".modal-header" "css_element"
Expand Down
2 changes: 0 additions & 2 deletions tests/behat/tool_skills_managelevels.feature
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,6 @@ Feature: Allocate points to users, need to manage levels and assign skills to co
And I log out
And I am on the "Course 1" course page logged in as student1
And I am on the "student1" "user > profile" page
Then I should see "Skills earned"
And I should see "Earned: 0"
And I am on "Course 1" course homepage
And I press "Mark as done"
Expand All @@ -83,7 +82,6 @@ Feature: Allocate points to users, need to manage levels and assign skills to co
And I log out
And I am on the "Course 1" course page logged in as student1
And I am on the "student1" "user > profile" page
Then I should see "Skills earned"
And I should see "Earned: 0"
And I am on "Course 1" course homepage
And I press "Mark as done"
Expand Down
2 changes: 1 addition & 1 deletion version.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@

defined('MOODLE_INTERNAL') || die;

$plugin->version = 2024012000;
$plugin->version = 2024012006;
$plugin->requires = 2021051700; // Requires this Moodle version.
$plugin->component = 'tool_skills'; // Full name of the plugin (used for diagnostics).
$plugin->maturity = MATURITY_STABLE;
Expand Down

0 comments on commit 87b48c1

Please sign in to comment.