MDL-62344 mod_label: ID number feature support

This commit is contained in:
Johnny Tsheke 2018-05-31 00:31:58 -04:00
parent 6e8235c7d3
commit 155bf1dd2f
3 changed files with 44 additions and 2 deletions

View File

@ -185,7 +185,7 @@ function label_get_extra_capabilities() {
*/
function label_supports($feature) {
switch($feature) {
case FEATURE_IDNUMBER: return false;
case FEATURE_IDNUMBER: return true;
case FEATURE_GROUPS: return false;
case FEATURE_GROUPINGS: return false;
case FEATURE_MOD_INTRO: return true;

View File

@ -0,0 +1,42 @@
@mod @mod_label
Feature: set label idnumber
In order to set label idnumber
As a teacher
I should create label activity and set an ID number
@javascript
Scenario: label ID number input box should be shown.
Given the following "courses" exist:
| fullname | shortname | category |
| Test | C1 | 0 |
And the following "users" exist:
| username | firstname | lastname | email |
| teacher | Teacher | Frist | teacher1@example.com |
| student | Student | First | student1@example.com |
And the following "course enrolments" exist:
| user | course | role |
| teacher | C1 | editingteacher |
| student | C1 | student |
Given I log in as "teacher"
And I am on "Test" course homepage with editing mode on
When I add a "label" to section "1" and I fill the form with:
| Label text | Label with ID number set |
| Availability | Show on course page |
| ID number | C1LABEL1 |
Then "Label with ID number set" activity should be visible
And I turn editing mode off
And "Label with ID number set" activity should be visible
And I log out
And I log in as "student"
And I am on "Test" course homepage
And I should see "Label with ID number set"
And I log out
And I log in as "teacher"
And I am on "Test" course homepage
And I turn editing mode on
And I open "Label with ID number set" actions menu
And I click on "Edit settings" "link" in the "Label with ID number set" activity
And I expand all fieldsets
And I should see "ID number" in the "Common module settings" "fieldset"
And the field "ID number" matches value "C1LABEL1"

View File

@ -24,7 +24,7 @@
defined('MOODLE_INTERNAL') || die();
$plugin->version = 2018051400; // The current module version (Date: YYYYMMDDXX)
$plugin->version = 2018053000; // The current module version (Date: YYYYMMDDXX)
$plugin->requires = 2018050800; // Requires this Moodle version
$plugin->component = 'mod_label'; // Full name of the plugin (used for diagnostics)
$plugin->cron = 0;