Compare commits
221 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 07f6358b03 | |||
| 7ffb98d0f5 | |||
| dda99bb3f2 | |||
| 9cff26295b | |||
| 5865a6875b | |||
| ef2eed1b3c | |||
| 6601017d02 | |||
| 7ed6f330c6 | |||
| 418d01aaf4 | |||
| 11f9ff55e1 | |||
| 04d4796089 | |||
| e889aee562 | |||
| 228157ebf5 | |||
| c77ae4e017 | |||
| 1da3022e50 | |||
| f6507b8e35 | |||
| d52b937932 | |||
| ce36e3626f | |||
| 063f7c198b | |||
| 83dedbcd33 | |||
| 0ad466926d | |||
| ced9a33352 | |||
| 3b4fba5588 | |||
| 9cc9dabf17 | |||
| cb8be0b6b8 | |||
| c6bd4c1a45 | |||
| 31e4c05002 | |||
| c5f11c0f3c | |||
| 6158379f75 | |||
| bc076bf1b8 | |||
| 27a3a42efd | |||
| b0c2ea4640 | |||
| 00ef7b1caa | |||
| 7914b0035f | |||
| cb358279b7 | |||
| 339edb47e2 | |||
| bd6bc508df | |||
| c53194f3f9 | |||
| c477dc23c0 | |||
| 8cd421e941 | |||
| f18c2a9d15 | |||
| 403e0d96e5 | |||
| 5984ffded4 | |||
| cd9a925e6a | |||
| 40471ed54c | |||
| 000b0949e6 | |||
| 6c7f60dbc0 | |||
| 3b37e372f2 | |||
| 44b94d9324 | |||
| e5bc84f84f | |||
| a38d0650d4 | |||
| 8d9edc0e7c | |||
| 4e0357c1e3 | |||
| 9efd73abec | |||
| c31b5bbf9d | |||
| 7606ba2133 | |||
| 51b7f8f0a4 | |||
| 40fdf0f84f | |||
| 3e99f4f642 | |||
| 324e613b48 | |||
| 502397dcbc | |||
| f1f83c3ba1 | |||
| 2c3f09ccf7 | |||
| e2f5592b8f | |||
| 522fcf2ffc | |||
| 96e743ff78 | |||
| e514ae345e | |||
| 2659b808ab | |||
| 54037cf3e2 | |||
| b0773d70c6 | |||
| 4348fffe0c | |||
| 216c68b834 | |||
| a3c1bd86ed | |||
| e0006399ff | |||
| 2084c59b82 | |||
| a09a9879e5 | |||
| a3a095b6eb | |||
| 0edf724367 | |||
| a953ac5942 | |||
| 5627b0b1a1 | |||
| 5d3a7be453 | |||
| 8f27fdf1ab | |||
| 1d5c2c6560 | |||
| 18317c7c1c | |||
| b83fd5b1fe | |||
| 11eeb2e347 | |||
| 0aa8b11f5c | |||
| 829cafc050 | |||
| 25474b5e84 | |||
| b7f902b5b3 | |||
| 11488775eb | |||
| 32ec7e3d30 | |||
| 1a1eef4345 | |||
| 4942dfc7cd | |||
| d469fb2181 | |||
| 0213ce081c | |||
| 70b6a6618a | |||
| 089cf944f3 | |||
| 68d9adcba8 | |||
| 32636d1757 | |||
| 48ff43d3bd | |||
| 725863abe4 | |||
| 9de4bbf8a8 | |||
| cd7ca81fdd | |||
| 1ca30f2503 | |||
| c47a9439d3 | |||
| 2ce5b1d637 | |||
| c4ade76ee5 | |||
| 62fc665ff6 | |||
| 263865899e | |||
| f927f3e196 | |||
| 70f5e9ba61 | |||
| 3b7bf2cee0 | |||
| a57a9053d7 | |||
| 0292245755 | |||
| dd7aa695b2 | |||
| 2626dce64c | |||
| 7e2e135943 | |||
| cc15b9d46f | |||
| ce47bacfe9 | |||
| 7c89091995 | |||
| 7766ffc618 | |||
| 75efa0860c | |||
| d31412392c | |||
| da694c75ff | |||
| 76f5d7b9ab | |||
| e7d8926583 | |||
| c87f1ac4c7 | |||
| 75c4f5b0ca | |||
| f7b3774380 | |||
| 78293c74bf | |||
| 406fc019c1 | |||
| 903cd37434 | |||
| 6fd8b0098a | |||
| 34954a6050 | |||
| 949d8ae04e | |||
| 1c7cbed23c | |||
| 9156498826 | |||
| 71adc9a9a3 | |||
| 49612b733f | |||
| bc0721c7d9 | |||
| c5452484ee | |||
| 74eecb6078 | |||
| 725be51c11 | |||
| d0d8a7f984 | |||
| 4a50811ae3 | |||
| b82ddcbcac | |||
| 6e4cc6caf4 | |||
| fe8e9b1b4e | |||
| 72770e9a60 | |||
| a847efc70b | |||
| 9e99327888 | |||
| 9973eebb91 | |||
| a162f636d8 | |||
| 8ff8d598fe | |||
| 8704d2e5fc | |||
| f9dd21a17a | |||
| eb349bdfc4 | |||
| 89d186af72 | |||
| 65de977483 | |||
| e167481759 | |||
| 457c913461 | |||
| 422449dca8 | |||
| 53c8f0ca3c | |||
| b094b88a9a | |||
| 49e5d04a8d | |||
| 38e28dfbcd | |||
| 44047dc78d | |||
| c06b8145b1 | |||
| 79da2c5bfa | |||
| a5800adaf0 | |||
| c1c3f50965 | |||
| cff14cf0d1 | |||
| c95ea731bc | |||
| b98f14632b | |||
| a1e1b45ae7 | |||
| 2d44bb544b | |||
| c60d333578 | |||
| 182690b018 | |||
| b36b54179d | |||
| fc4b768e25 | |||
| 7e0f1972f1 | |||
| 93e64c823c | |||
| 20d598f094 | |||
| e376549179 | |||
| 163a317bcc | |||
| 7ecf13ac1d | |||
| 2fbe4fca87 | |||
| d07a8ebd7e | |||
| d4feb70e17 | |||
| f477809e38 | |||
| 94caed45db | |||
| 8c4fdb1073 | |||
| e5bbe44230 | |||
| d0a58fe035 | |||
| 9c68157292 | |||
| 44f71599df | |||
| 1fac7b914b | |||
| cede73411f | |||
| 47deb83b5c | |||
| 4ea56c1c80 | |||
| 311121b16c | |||
| 5863f1b073 | |||
| 2bb195f64f | |||
| f6b50d9901 | |||
| a0b0234a18 | |||
| f8b8a363ae | |||
| b197272987 | |||
| e4976aefc5 | |||
| dcd408b81f | |||
| 4a564ca40b | |||
| 5da06d632a | |||
| d797e57255 | |||
| 55d2042f0a | |||
| 8cd6972966 | |||
| 9cbc0a0cdb | |||
| 931d12b589 | |||
| 0beeb95a8a | |||
| 617f8bb911 | |||
| 75dd21a002 | |||
| a0c13477ab |
+7
-9
@@ -13,7 +13,7 @@ language: php
|
||||
|
||||
php:
|
||||
# We only run the highest and lowest supported versions to reduce the load on travis-ci.org.
|
||||
- 7.0
|
||||
- 7.1
|
||||
- 5.6
|
||||
|
||||
services:
|
||||
@@ -23,7 +23,7 @@ env:
|
||||
# Although we want to run these jobs and see failures as quickly as possible, we also want to get the slowest job to
|
||||
# start first so that the total run time is not too high.
|
||||
#
|
||||
# We only run MySQL on PHP 7.0, so run that first.
|
||||
# We only run MySQL on PHP 7.1, so run that first.
|
||||
# CI Tests should be second-highest in priority as these only take <= 60 seconds to run under normal circumstances.
|
||||
# Postgres is significantly is pretty reasonable in its run-time.
|
||||
|
||||
@@ -47,22 +47,22 @@ matrix:
|
||||
|
||||
include:
|
||||
# Run grunt/npm install on lowest supported npm version
|
||||
- php: 7
|
||||
- php: 7.1
|
||||
env: DB=none TASK=GRUNT NVM_VERSION='4'
|
||||
# Run grunt/npm install on highest version ('node' is an alias for the latest node.js version.)
|
||||
- php: 7
|
||||
- php: 7.1
|
||||
env: DB=none TASK=GRUNT NVM_VERSION='node'
|
||||
|
||||
exclude:
|
||||
# MySQL - it's just too slow.
|
||||
# Exclude it on all versions except for 7.0
|
||||
# Exclude it on all versions except for 7.1
|
||||
|
||||
- env: DB=mysqli TASK=PHPUNIT
|
||||
php: 5.6
|
||||
|
||||
# Moodle 2.7 is not compatible with PHP 7 for the upgrade test.
|
||||
- env: DB=pgsql TASK=UPGRADE
|
||||
php: 7.0
|
||||
php: 7.1
|
||||
|
||||
cache:
|
||||
directories:
|
||||
@@ -70,9 +70,6 @@ cache:
|
||||
- $HOME/.npm
|
||||
|
||||
install:
|
||||
# Disable xdebug. We aren't generating code coverage, and it has a huge impact upon test performance.
|
||||
- rm /home/travis/.phpenv/versions/$(phpenv version-name)/etc/conf.d/xdebug.ini
|
||||
|
||||
- >
|
||||
if [ "$TASK" = 'PHPUNIT' ];
|
||||
then
|
||||
@@ -99,6 +96,7 @@ install:
|
||||
fi
|
||||
|
||||
before_script:
|
||||
- phpenv config-rm xdebug.ini
|
||||
- >
|
||||
if [ "$TASK" = 'PHPUNIT' -o "$TASK" = 'UPGRADE' ];
|
||||
then
|
||||
|
||||
@@ -37,6 +37,7 @@
|
||||
print_error('blockdoesnotexist', 'error');
|
||||
}
|
||||
$DB->set_field('block', 'visible', '0', array('id'=>$block->id)); // Hide block
|
||||
add_to_config_log('block_visibility', $block->visible, '0', $block->name);
|
||||
core_plugin_manager::reset_caches();
|
||||
admin_get_root(true, false); // settings not required - only pages
|
||||
}
|
||||
@@ -46,6 +47,7 @@
|
||||
print_error('blockdoesnotexist', 'error');
|
||||
}
|
||||
$DB->set_field('block', 'visible', '1', array('id'=>$block->id)); // Show block
|
||||
add_to_config_log('block_visibility', $block->visible, '1', $block->name);
|
||||
core_plugin_manager::reset_caches();
|
||||
admin_get_root(true, false); // settings not required - only pages
|
||||
}
|
||||
|
||||
@@ -1868,11 +1868,6 @@
|
||||
<ON_CHECK message="unoconvwarning" />
|
||||
</FEEDBACK>
|
||||
</CUSTOM_CHECK>
|
||||
<CUSTOM_CHECK file="lib/upgradelib.php" function="check_tls_libraries" level="optional">
|
||||
<FEEDBACK>
|
||||
<ON_CHECK message="tlswarning" />
|
||||
</FEEDBACK>
|
||||
</CUSTOM_CHECK>
|
||||
<CUSTOM_CHECK file="lib/upgradelib.php" function="check_libcurl_version" level="optional">
|
||||
<FEEDBACK>
|
||||
<ON_CHECK message="libcurlwarning" />
|
||||
|
||||
+10
-3
@@ -1899,14 +1899,21 @@ class core_admin_renderer extends plugin_renderer_base {
|
||||
} else {
|
||||
$report = $this->doc_link(join($linkparts, '/'), get_string($stringtouse, 'admin', $rec));
|
||||
}
|
||||
// Enclose report text in div so feedback text will be displayed underneath it.
|
||||
$report = html_writer::div($report);
|
||||
|
||||
// Format error or warning line
|
||||
if ($errorline || $warningline) {
|
||||
$messagetype = $errorline? 'error':'warn';
|
||||
if ($errorline) {
|
||||
$messagetype = 'error';
|
||||
$statusclass = 'label-important';
|
||||
} else if ($warningline) {
|
||||
$messagetype = 'warn';
|
||||
$statusclass = 'label-warning';
|
||||
} else {
|
||||
$messagetype = 'ok';
|
||||
$statusclass = 'label-success';
|
||||
}
|
||||
$status = '<span class="'.$messagetype.'">'.$status.'</span>';
|
||||
$status = html_writer::span($status, 'label ' . $statusclass);
|
||||
// Here we'll store all the feedback found
|
||||
$feedbacktext = '';
|
||||
// Append the feedback if there is some
|
||||
|
||||
@@ -29,9 +29,9 @@ if ($primaryadmin) {
|
||||
$primaryadminname = NULL;
|
||||
}
|
||||
$temp->add(new admin_setting_configtext('supportname', new lang_string('supportname', 'admin'),
|
||||
new lang_string('configsupportname', 'admin'), $primaryadminname, PARAM_NOTAGS));
|
||||
new lang_string('configsupportname', 'admin'), $primaryadminname, PARAM_NOTAGS));
|
||||
$setting = new admin_setting_configtext('supportemail', new lang_string('supportemail', 'admin'),
|
||||
new lang_string('configsupportemail', 'admin'), $primaryadminemail, PARAM_NOTAGS);
|
||||
new lang_string('configsupportemail', 'admin'), $primaryadminemail, PARAM_EMAIL);
|
||||
$setting->set_force_ltr(true);
|
||||
$temp->add($setting);
|
||||
$temp->add(new admin_setting_configtext('supportpage', new lang_string('supportpage', 'admin'), new lang_string('configsupportpage', 'admin'), '', PARAM_URL));
|
||||
@@ -237,7 +237,7 @@ $temp->add(new admin_setting_configtext('smtpmaxbulk', new lang_string('smtpmaxb
|
||||
$temp->add(new admin_setting_heading('noreplydomainheading', new lang_string('noreplydomain', 'admin'),
|
||||
new lang_string('noreplydomaindetail', 'admin')));
|
||||
$temp->add(new admin_setting_configtext('noreplyaddress', new lang_string('noreplyaddress', 'admin'),
|
||||
new lang_string('confignoreplyaddress', 'admin'), 'noreply@' . get_host_from_url($CFG->wwwroot), PARAM_NOTAGS));
|
||||
new lang_string('confignoreplyaddress', 'admin'), 'noreply@' . get_host_from_url($CFG->wwwroot), PARAM_EMAIL));
|
||||
$temp->add(new admin_setting_configtextarea('allowedemaildomains',
|
||||
new lang_string('allowedemaildomains', 'admin'),
|
||||
new lang_string('configallowedemaildomains', 'admin'),
|
||||
|
||||
@@ -16,8 +16,7 @@ Feature: Display extended course names
|
||||
And I should not see "C_shortname Course fullname"
|
||||
|
||||
Scenario: Courses list with extended course names
|
||||
Given I expand "Site administration" node
|
||||
And I click on "Courses" "link" in the "//div[@id='settingsnav']/descendant::li[contains(concat(' ', normalize-space(@class), ' '), ' type_setting ')][contains(., 'Appearance')]" "xpath_element"
|
||||
Given I navigate to "Appearance > Courses" in site administration
|
||||
And I set the field "Display extended course names" to "1"
|
||||
When I press "Save changes"
|
||||
And I am on site homepage
|
||||
|
||||
@@ -25,7 +25,7 @@ Feature: An administrator can filter user accounts by role, cohort and other pro
|
||||
And I log in as "admin"
|
||||
And I add "User Two (two@example.com)" user to "CH1" cohort members
|
||||
And I add "User Three (three@example.com)" user to "CH1" cohort members
|
||||
And I follow "Browse list of users"
|
||||
And I navigate to "Users > Accounts > Browse list of users" in site administration
|
||||
|
||||
Scenario: Filter user accounts by role and cohort
|
||||
When I set the following fields to these values:
|
||||
|
||||
@@ -8,6 +8,8 @@ Feature: Manage availability conditions
|
||||
Scenario: Display list of availability conditions
|
||||
# Check the report doesn't show when not enabled.
|
||||
Given I log in as "admin"
|
||||
And I press "Customise this page"
|
||||
And I add the "Administration" block if not present
|
||||
And the following config values are set as admin:
|
||||
| enableavailability | 0 |
|
||||
And I expand "Site administration" node
|
||||
|
||||
@@ -59,8 +59,7 @@ Feature: Set up contextual data for tests
|
||||
When I log in as "admin"
|
||||
And I am on site homepage
|
||||
And I follow "Course 1"
|
||||
And I expand "Users" node
|
||||
And I follow "Groups"
|
||||
And I navigate to "Users > Groups" in current page administration
|
||||
Then I should see "Group 1"
|
||||
And I should see "Group 2"
|
||||
And I follow "Groupings"
|
||||
@@ -90,8 +89,7 @@ Feature: Set up contextual data for tests
|
||||
When I log in as "admin"
|
||||
And I am on site homepage
|
||||
And I follow "Course 1"
|
||||
And I expand "Users" node
|
||||
And I follow "Permissions"
|
||||
And I navigate to "Users > Permissions" in current page administration
|
||||
And I set the field "Advanced role override" to "Student (1)"
|
||||
Then "mod/forum:editanypost" capability has "Allow" permission
|
||||
And I press "Cancel"
|
||||
@@ -134,30 +132,31 @@ Feature: Set up contextual data for tests
|
||||
And the following "course enrolments" exist:
|
||||
| user | course | role |
|
||||
| user4 | C1 | custom1 |
|
||||
| user2 | C1 | student |
|
||||
| user3 | C1 | editingteacher |
|
||||
And the following "role assigns" exist:
|
||||
| user | role | contextlevel | reference |
|
||||
| user1 | manager | System | |
|
||||
| user2 | editingteacher | Category | CAT1 |
|
||||
| user3 | editingteacher | Course | C1 |
|
||||
| user5 | custom2 | System | |
|
||||
When I log in as "user1"
|
||||
And I am on site homepage
|
||||
Then I should see "Front page settings"
|
||||
Then "Edit settings" "link" should exist in current page administration
|
||||
And I log out
|
||||
And I log in as "user2"
|
||||
And I am on site homepage
|
||||
And I follow "Course 1"
|
||||
And I should see "Turn editing on"
|
||||
And "Turn editing on" "link" should exist in current page administration
|
||||
And I log out
|
||||
And I log in as "user3"
|
||||
And I am on site homepage
|
||||
And I follow "Course 1"
|
||||
And I should see "Turn editing on"
|
||||
And "Turn editing on" "link" should exist in current page administration
|
||||
And I log out
|
||||
And I log in as "user4"
|
||||
And I am on site homepage
|
||||
And I follow "Course 1"
|
||||
And I should see "Turn editing on"
|
||||
And "Turn editing on" "link" should exist in current page administration
|
||||
And I log out
|
||||
And I log in as "user5"
|
||||
And I should see "You are logged in as"
|
||||
@@ -264,8 +263,7 @@ Feature: Set up contextual data for tests
|
||||
When I log in as "admin"
|
||||
And I am on site homepage
|
||||
And I follow "Course 1"
|
||||
And I expand "Users" node
|
||||
And I follow "Groups"
|
||||
And I navigate to "Users > Groups" in current page administration
|
||||
Then the "groups" select box should contain "Group 1 (1)"
|
||||
And the "groups" select box should contain "Group 2 (1)"
|
||||
And I set the field "groups" to "Group 1 (1)"
|
||||
@@ -302,7 +300,7 @@ Feature: Set up contextual data for tests
|
||||
| System cohort A | 1 |
|
||||
| System cohort B | 2 |
|
||||
And I should not see "Cohort in category"
|
||||
And I follow "Courses"
|
||||
And I am on course index
|
||||
And I follow "Cat 1"
|
||||
And I follow "Cohorts"
|
||||
And I should not see "System cohort"
|
||||
@@ -322,10 +320,9 @@ Feature: Set up contextual data for tests
|
||||
| fullname | course | gradecategory |
|
||||
| Grade sub category 2 | C1 | Grade category 1 |
|
||||
When I log in as "admin"
|
||||
And I am on site homepage
|
||||
And I follow "Courses"
|
||||
And I am on course index
|
||||
And I follow "Course 1"
|
||||
And I go to "View > Grader report" in the course gradebook
|
||||
And I navigate to "View > Grader report" in the course gradebook
|
||||
Then I should see "Grade category 1"
|
||||
And I should see "Grade sub category 2"
|
||||
|
||||
@@ -349,7 +346,7 @@ Feature: Set up contextual data for tests
|
||||
When I log in as "admin"
|
||||
And I am on site homepage
|
||||
And I follow "Course 1"
|
||||
And I go to "Setup > Gradebook setup" in the course gradebook
|
||||
And I navigate to "Setup > Gradebook setup" in the course gradebook
|
||||
Then I should see "Test Grade Item 1"
|
||||
And I follow "Edit Test Grade Item 1"
|
||||
And I expand all fieldsets
|
||||
@@ -378,7 +375,7 @@ Feature: Set up contextual data for tests
|
||||
When I log in as "admin"
|
||||
And I am on site homepage
|
||||
And I follow "Course 1"
|
||||
And I go to "Scales" in the course gradebook
|
||||
And I navigate to "Scales" in the course gradebook
|
||||
Then I should see "Test Scale 1"
|
||||
And I should see "Disappointing, Good, Very good, Excellent"
|
||||
|
||||
@@ -429,7 +426,7 @@ Feature: Set up contextual data for tests
|
||||
When I log in as "admin"
|
||||
And I am on site homepage
|
||||
And I follow "Course 1"
|
||||
And I go to "Setup > Gradebook setup" in the course gradebook
|
||||
And I navigate to "Setup > Gradebook setup" in the course gradebook
|
||||
Then I should see "Test Outcome Grade Item 1"
|
||||
And I follow "Edit Test Outcome Grade Item 1"
|
||||
And the field "Outcome" matches value "Grade outcome 1"
|
||||
|
||||
@@ -32,8 +32,7 @@ Feature: Edit capabilities
|
||||
Scenario: Course capabilities overrides
|
||||
Given I log in as "teacher1"
|
||||
And I follow "Course 1"
|
||||
And I expand "Users" node
|
||||
And I follow "Permissions"
|
||||
And I navigate to "Users > Permissions" in current page administration
|
||||
And I override the system permissions of "Student" role with:
|
||||
| mod/forum:deleteanypost | Prohibit |
|
||||
| mod/forum:editanypost | Prevent |
|
||||
@@ -52,7 +51,7 @@ Feature: Edit capabilities
|
||||
| Forum name | I'm the name |
|
||||
| Description | I'm the introduction |
|
||||
And I follow "I'm the name"
|
||||
And I navigate to "Permissions" node in "Forum administration"
|
||||
And I navigate to "Permissions" in current page administration
|
||||
And I override the system permissions of "Student" role with:
|
||||
| mod/forum:deleteanypost | Prohibit |
|
||||
| mod/forum:editanypost | Prevent |
|
||||
|
||||
@@ -33,8 +33,6 @@ Feature: Verify that all form fields values can be get and set
|
||||
| activity | course | idnumber | name | intro | firstpagetitle | wikimode | visible |
|
||||
| wiki | C1 | wiki1 | Test this one | Test this one | Test this one | collaborative | 0 |
|
||||
And I log in as "admin"
|
||||
And I expand "Site administration" node
|
||||
And I expand "Appearance" node
|
||||
And I am on site homepage
|
||||
And I follow "Course 1"
|
||||
And I navigate to "Reset" node in "Course administration"
|
||||
@@ -60,9 +58,8 @@ Feature: Verify that all form fields values can be get and set
|
||||
| HTML format | Student page contents |
|
||||
And I press "Save"
|
||||
Then I should see "Student page contents" in the "region-main" "region"
|
||||
And I click on "Edit" "link" in the "Administration" "block"
|
||||
# Select (multi-select) - Checking "I set the field".
|
||||
And I click on "Edit settings" "link" in the "Administration" "block"
|
||||
And I navigate to "Edit settings" in current page administration
|
||||
And I expand all fieldsets
|
||||
# Checkbox - Checking "I set the field".
|
||||
And I set the field "Display description on course page" to "1"
|
||||
@@ -75,7 +72,7 @@ Feature: Verify that all form fields values can be get and set
|
||||
And I press "Save and return to course"
|
||||
And I should see "Test this one"
|
||||
And I follow "Test this one"
|
||||
And I click on "Edit settings" "link" in the "Administration" "block"
|
||||
And I navigate to "Edit settings" in current page administration
|
||||
# Checkbox - Checking "the field matches value" and "the following fields match these values".
|
||||
And the following fields match these values:
|
||||
| Display description on course page | 1 |
|
||||
@@ -91,7 +88,7 @@ Feature: Verify that all form fields values can be get and set
|
||||
# Select (simple) - Checking "I set the field".
|
||||
And I set the field "Group mode" to "Separate groups"
|
||||
And I press "Save and display"
|
||||
And I click on "Edit settings" "link" in the "Administration" "block"
|
||||
And I navigate to "Edit settings" in current page administration
|
||||
And the following fields match these values:
|
||||
| Default format | NWiki |
|
||||
| Group mode | Separate groups |
|
||||
@@ -134,8 +131,7 @@ Feature: Verify that all form fields values can be get and set
|
||||
@javascript
|
||||
Scenario: with JS enabled all form fields getters and setters works as expected
|
||||
Then I follow "Course 1"
|
||||
And I expand "Users" node
|
||||
And I follow "Groups"
|
||||
And I navigate to "Users > Groups" in current page administration
|
||||
# Select (multi-select & AJAX) - Checking "I set the field" and "select box should contain".
|
||||
And I set the field "groups" to "Group 2"
|
||||
And the "members" select box should contain "Student 2"
|
||||
@@ -158,7 +154,7 @@ Feature: Verify that all form fields values can be get and set
|
||||
And the "available[day]" "field" should be enabled
|
||||
And the field "deadline[enabled]" matches value "1"
|
||||
And I press "Save and display"
|
||||
And I click on "Edit settings" "link" in the "Administration" "block"
|
||||
And I navigate to "Edit settings" in current page administration
|
||||
And the field "available[enabled]" matches value "1"
|
||||
And the "available[day]" "field" should be enabled
|
||||
And the field "deadline[enabled]" matches value "1"
|
||||
|
||||
@@ -41,5 +41,8 @@ function xmldb_tool_customlang_upgrade($oldversion) {
|
||||
// Moodle v3.1.0 release upgrade line.
|
||||
// Put any upgrade step following this.
|
||||
|
||||
// Automatically generated Moodle v3.2.0 release upgrade line.
|
||||
// Put any upgrade step following this.
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -45,5 +45,8 @@ function xmldb_tool_log_upgrade($oldversion) {
|
||||
// Moodle v3.1.0 release upgrade line.
|
||||
// Put any upgrade step following this.
|
||||
|
||||
// Automatically generated Moodle v3.2.0 release upgrade line.
|
||||
// Put any upgrade step following this.
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -39,5 +39,8 @@ function xmldb_logstore_database_upgrade($oldversion) {
|
||||
// Moodle v3.1.0 release upgrade line.
|
||||
// Put any upgrade step following this.
|
||||
|
||||
// Automatically generated Moodle v3.2.0 release upgrade line.
|
||||
// Put any upgrade step following this.
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -56,5 +56,8 @@ function xmldb_logstore_standard_upgrade($oldversion) {
|
||||
// Moodle v3.1.0 release upgrade line.
|
||||
// Put any upgrade step following this.
|
||||
|
||||
// Automatically generated Moodle v3.2.0 release upgrade line.
|
||||
// Put any upgrade step following this.
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -7,12 +7,9 @@ Feature: Manage competency frameworks
|
||||
Background:
|
||||
Given I log in as "admin"
|
||||
And I am on site homepage
|
||||
And I expand "Site administration" node
|
||||
When I expand "Competencies" node
|
||||
Then I should see "Competency frameworks"
|
||||
|
||||
Scenario: Create a new framework
|
||||
Given I follow "Competency frameworks"
|
||||
Given I navigate to "Competencies > Competency frameworks" in site administration
|
||||
And I should see "List of competency frameworks"
|
||||
And I click on "Add new competency framework" "button"
|
||||
And I should see "General"
|
||||
@@ -34,7 +31,7 @@ Feature: Manage competency frameworks
|
||||
Given the following lp "frameworks" exist:
|
||||
| shortname | idnumber |
|
||||
| Science Year-2 | sc-y-2 |
|
||||
And I follow "Competency frameworks"
|
||||
And I navigate to "Competencies > Competency frameworks" in site administration
|
||||
And I should see "Science Year-2"
|
||||
When I click on "Science Year-2" "link"
|
||||
Then I should see "Science Year-2"
|
||||
@@ -43,7 +40,7 @@ Feature: Manage competency frameworks
|
||||
Given the following lp "frameworks" exist:
|
||||
| shortname | idnumber |
|
||||
| Science Year-3 | sc-y-3 |
|
||||
And I follow "Competency frameworks"
|
||||
And I navigate to "Competencies > Competency frameworks" in site administration
|
||||
And I should see "Science Year-3"
|
||||
And I click on "Edit" of edit menu in the "Science Year-3" row
|
||||
And the field "Name" matches value "Science Year-3 "
|
||||
@@ -57,7 +54,7 @@ Feature: Manage competency frameworks
|
||||
Given the following lp "frameworks" exist:
|
||||
| shortname | idnumber |
|
||||
| Science Year-4 | sc-y-4 |
|
||||
And I follow "Competency frameworks"
|
||||
And I navigate to "Competencies > Competency frameworks" in site administration
|
||||
And I should see "Science Year-4"
|
||||
And I should see "sc-y-4"
|
||||
And I click on "Delete" of edit menu in the "Science Year-4" row
|
||||
@@ -90,7 +87,7 @@ Scenario: Edit a framework with competencies in user competency
|
||||
| user | competency |
|
||||
| admin | Comp1 |
|
||||
| admin | Comp2 |
|
||||
And I follow "Competency frameworks"
|
||||
And I navigate to "Competencies > Competency frameworks" in site administration
|
||||
And I should see "Science Year-5"
|
||||
And I click on "Edit" of edit menu in the "Science Year-5" row
|
||||
And the field "Name" matches value "Science Year-5 "
|
||||
@@ -120,7 +117,7 @@ Scenario: Edit a framework with competencies in user competency plan
|
||||
| user | competency | plan |
|
||||
| admin | Comp1 | Plan Science-6 |
|
||||
| admin | Comp2 | Plan Science-6 |
|
||||
And I follow "Competency frameworks"
|
||||
And I navigate to "Competencies > Competency frameworks" in site administration
|
||||
And I should see "Science Year-6"
|
||||
And I click on "Edit" of edit menu in the "Science Year-6" row
|
||||
And the field "Name" matches value "Science Year-6 "
|
||||
|
||||
@@ -26,9 +26,7 @@ Feature: Manage plearning plan
|
||||
| shortname | description |
|
||||
| Science template | science template description |
|
||||
And I follow "Home"
|
||||
And I expand "Site administration" node
|
||||
And I expand "Competencies" node
|
||||
And I follow "Learning plan templates"
|
||||
And I navigate to "Competencies > Learning plan templates" in site administration
|
||||
And I click on ".template-userplans" "css_element" in the "Science template" "table_row"
|
||||
And I click on ".form-autocomplete-downarrow" "css_element"
|
||||
And I click on "Admin" item in the autocomplete list
|
||||
@@ -52,9 +50,7 @@ Feature: Manage plearning plan
|
||||
| student-plan1 | COHORTPLAN |
|
||||
| student-plan2 | COHORTPLAN |
|
||||
And I follow "Home"
|
||||
And I expand "Site administration" node
|
||||
And I expand "Competencies" node
|
||||
And I follow "Learning plan templates"
|
||||
And I navigate to "Competencies > Learning plan templates" in site administration
|
||||
And I click on ".template-cohorts" "css_element" in the "Science template cohort" "table_row"
|
||||
And I click on ".form-autocomplete-downarrow" "css_element"
|
||||
And I click on "cohort plan" item in the autocomplete list
|
||||
|
||||
@@ -145,10 +145,7 @@ Feature: Manage plan workflow
|
||||
| Test-Plan3 | user1 | Description of plan 3 for user 1 | active | manager1 |
|
||||
| Test-Plan4 | user1 | Description of plan 4 for user 1 | active | manager1 |
|
||||
And I log in as "manager1"
|
||||
And I expand "Site administration" node
|
||||
And I expand "Users" node
|
||||
And I expand "Accounts" node
|
||||
And I follow "Browse list of users"
|
||||
And I navigate to "Users > Accounts > Browse list of users" in site administration
|
||||
And I follow "User 1"
|
||||
And I follow "Learning plans"
|
||||
And I should see "List of learning plans"
|
||||
@@ -167,10 +164,7 @@ Feature: Manage plan workflow
|
||||
| Test-Plan3 | user1 | Description of plan 3 for user 1 | active | manager1 |
|
||||
| Test-Plan4 | user1 | Description of plan 4 for user 1 | active | manager1 |
|
||||
And I log in as "manager1"
|
||||
And I expand "Site administration" node
|
||||
And I expand "Users" node
|
||||
And I expand "Accounts" node
|
||||
And I follow "Browse list of users"
|
||||
And I navigate to "Users > Accounts > Browse list of users" in site administration
|
||||
And I follow "User 1"
|
||||
And I follow "Learning plans"
|
||||
And I should see "List of learning plans"
|
||||
@@ -191,10 +185,7 @@ Scenario: Manager reopen a complete learning plan
|
||||
| Test-Plan3 | user1 | Description of plan 3 for user 1 | complete | manager1 |
|
||||
| Test-Plan4 | user1 | Description of plan 4 for user 1 | complete | manager1 |
|
||||
And I log in as "manager1"
|
||||
And I expand "Site administration" node
|
||||
And I expand "Users" node
|
||||
And I expand "Accounts" node
|
||||
And I follow "Browse list of users"
|
||||
And I navigate to "Users > Accounts > Browse list of users" in site administration
|
||||
And I follow "User 1"
|
||||
And I follow "Learning plans"
|
||||
And I should see "List of learning plans"
|
||||
|
||||
@@ -7,12 +7,9 @@ Feature: Manage plearning plan templates
|
||||
Background:
|
||||
Given I log in as "admin"
|
||||
And I am on site homepage
|
||||
And I expand "Site administration" node
|
||||
When I expand "Competencies" node
|
||||
Then I should see "Learning plan templates"
|
||||
|
||||
Scenario: Create a new learning plan template
|
||||
Given I follow "Learning plan templates"
|
||||
Given I navigate to "Competencies > Learning plan templates" in site administration
|
||||
And I should see "List of learning plan templates"
|
||||
And I click on "Add new learning plan template" "button"
|
||||
And I should see "Add new learning plan template"
|
||||
@@ -26,7 +23,7 @@ Feature: Manage plearning plan templates
|
||||
Given the following lp "templates" exist:
|
||||
| shortname | description |
|
||||
| Science template Year-2 | science template description |
|
||||
And I follow "Learning plan templates"
|
||||
And I navigate to "Competencies > Learning plan templates" in site administration
|
||||
And I should see "Science template Year-2"
|
||||
When I click on "Science template Year-2" "link"
|
||||
Then I should see "Science template Year-2"
|
||||
@@ -36,7 +33,7 @@ Feature: Manage plearning plan templates
|
||||
Given the following lp "templates" exist:
|
||||
| shortname | description |
|
||||
| Science template Year-3 | science template description |
|
||||
And I follow "Learning plan templates"
|
||||
And I navigate to "Competencies > Learning plan templates" in site administration
|
||||
And I should see "Science template Year-3"
|
||||
And I click on "Edit" of edit menu in the "Science template Year-3" row
|
||||
And the field "Name" matches value "Science template Year-3"
|
||||
@@ -49,7 +46,7 @@ Feature: Manage plearning plan templates
|
||||
Given the following lp "templates" exist:
|
||||
| shortname | description |
|
||||
| Science template Year-4 | science template description |
|
||||
And I follow "Learning plan templates"
|
||||
And I navigate to "Competencies > Learning plan templates" in site administration
|
||||
And I should see "Science template Year-4"
|
||||
And I click on "Delete" of edit menu in the "Science template Year-4" row
|
||||
And "Confirm" "dialogue" should be visible
|
||||
|
||||
@@ -53,6 +53,10 @@ class framework_importer {
|
||||
protected $importer = null;
|
||||
protected $foundheaders = array();
|
||||
protected $scalecache = array();
|
||||
/** @var bool $useprogressbar Control whether importing should use progress bars or not. */
|
||||
protected $useprogressbar = false;
|
||||
/** @var \core\progress\display_if_slow|null $progress The progress bar instance. */
|
||||
protected $progress = null;
|
||||
|
||||
/**
|
||||
* Store an error message for display later
|
||||
@@ -164,8 +168,11 @@ class framework_importer {
|
||||
* @param string delimiter The specified delimiter for the file.
|
||||
* @param string importid The id of the csv import.
|
||||
* @param array mappingdata The mapping data from the import form.
|
||||
* @param bool $useprogressbar Whether progress bar should be displayed, to avoid html output on CLI.
|
||||
*/
|
||||
public function __construct($text = null, $encoding = null, $delimiter = null, $importid = 0, $mappingdata = null) {
|
||||
public function __construct($text = null, $encoding = null, $delimiter = null, $importid = 0, $mappingdata = null,
|
||||
$useprogressbar = false) {
|
||||
|
||||
global $CFG;
|
||||
|
||||
// The format of our records is:
|
||||
@@ -204,7 +211,7 @@ class framework_importer {
|
||||
}
|
||||
|
||||
$this->foundheaders = $this->importer->get_columns();
|
||||
|
||||
$this->useprogressbar = $useprogressbar;
|
||||
$domainid = 1;
|
||||
|
||||
$flat = array();
|
||||
@@ -264,8 +271,19 @@ class framework_importer {
|
||||
$this->fail(get_string('invalidimportfile', 'tool_lpimportcsv'));
|
||||
return;
|
||||
} else {
|
||||
// We are calling from browser, display progress bar.
|
||||
if ($this->useprogressbar === true) {
|
||||
$this->progress = new \core\progress\display_if_slow(get_string('processingfile', 'tool_lpimportcsv'));
|
||||
$this->progress->start_html();
|
||||
} else {
|
||||
// Avoid html output on CLI scripts.
|
||||
$this->progress = new \core\progress\none();
|
||||
}
|
||||
$this->progress->start_progress('', count($this->flat));
|
||||
// Build a tree from this flat list.
|
||||
raise_memory_limit(MEMORY_EXTRA);
|
||||
$this->add_children($this->framework, '');
|
||||
$this->progress->end_progress();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -278,6 +296,7 @@ class framework_importer {
|
||||
public function add_children(& $node, $parentidnumber) {
|
||||
foreach ($this->flat as $competency) {
|
||||
if ($competency->parentidnumber == $parentidnumber) {
|
||||
$this->progress->increment_progress();
|
||||
$node->children[] = $competency;
|
||||
$this->add_children($competency, $competency->idnumber);
|
||||
}
|
||||
@@ -443,17 +462,28 @@ class framework_importer {
|
||||
$record->contextid = context_system::instance()->id;
|
||||
|
||||
$framework = api::create_framework($record);
|
||||
if ($this->useprogressbar === true) {
|
||||
$this->progress = new \core\progress\display_if_slow(get_string('importingfile', 'tool_lpimportcsv'));
|
||||
$this->progress->start_html();
|
||||
} else {
|
||||
$this->progress = new \core\progress\none();
|
||||
}
|
||||
|
||||
$this->progress->start_progress('', (count($this->framework->children) * 2));
|
||||
raise_memory_limit(MEMORY_EXTRA);
|
||||
// Now all the children.
|
||||
foreach ($this->framework->children as $comp) {
|
||||
$this->progress->increment_progress();
|
||||
$this->create_competency($comp, null, $framework);
|
||||
}
|
||||
|
||||
// Now create the rules.
|
||||
foreach ($this->framework->children as $record) {
|
||||
$this->progress->increment_progress();
|
||||
$this->set_rules($record);
|
||||
$this->set_related($record);
|
||||
}
|
||||
$this->progress->end_progress();
|
||||
|
||||
$this->importer->cleanup();
|
||||
return $framework;
|
||||
|
||||
@@ -1,47 +0,0 @@
|
||||
<?php
|
||||
// This file is part of Moodle - http://moodle.org/
|
||||
//
|
||||
// Moodle is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU General Public License as published by
|
||||
// the Free Software Foundation, either version 3 of the License, or
|
||||
// (at your option) any later version.
|
||||
//
|
||||
// Moodle is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU General Public License
|
||||
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
/**
|
||||
* Page to continue after an action.
|
||||
*
|
||||
* @package tool_lpimportcsv
|
||||
* @copyright 2015 Damyon Wiese
|
||||
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
|
||||
*/
|
||||
|
||||
require_once(__DIR__ . '/../../../config.php');
|
||||
require_once($CFG->libdir.'/adminlib.php');
|
||||
|
||||
$pagetitle = get_string('pluginname', 'tool_lpimportcsv');
|
||||
|
||||
$context = context_system::instance();
|
||||
|
||||
$id = required_param('id', PARAM_INT);
|
||||
$url = new moodle_url("/admin/tool/lpimportcsv/index.php");
|
||||
$PAGE->set_context($context);
|
||||
$PAGE->set_url($url);
|
||||
$PAGE->set_title($pagetitle);
|
||||
$PAGE->set_pagelayout('admin');
|
||||
$PAGE->set_heading($pagetitle);
|
||||
|
||||
echo $OUTPUT->header();
|
||||
echo $OUTPUT->heading($pagetitle);
|
||||
$urlparams = ['competencyframeworkid' => $id, 'pagecontextid' => $context->id];
|
||||
$frameworksurl = new moodle_url('/admin/tool/lp/competencies.php', $urlparams);
|
||||
echo $OUTPUT->notification(get_string('competencyframeworkcreated', 'tool_lp'), 'notifysuccess');
|
||||
echo $OUTPUT->continue_button($frameworksurl);
|
||||
|
||||
echo $OUTPUT->footer();
|
||||
@@ -37,6 +37,7 @@ $PAGE->set_pagelayout('admin');
|
||||
$PAGE->set_heading($pagetitle);
|
||||
|
||||
$form = null;
|
||||
echo $OUTPUT->header();
|
||||
if (optional_param('needsconfirm', 0, PARAM_BOOL)) {
|
||||
$form = new \tool_lpimportcsv\form\import($url->out(false));
|
||||
} else if (optional_param('confirm', 0, PARAM_BOOL)) {
|
||||
@@ -53,7 +54,7 @@ if ($form->is_cancelled()) {
|
||||
|
||||
if ($data->confirm) {
|
||||
$importid = $data->importid;
|
||||
$importer = new \tool_lpimportcsv\framework_importer(null, null, null, $importid, $data);
|
||||
$importer = new \tool_lpimportcsv\framework_importer(null, null, null, $importid, $data, true);
|
||||
|
||||
$error = $importer->get_error();
|
||||
if ($error) {
|
||||
@@ -61,21 +62,23 @@ if ($form->is_cancelled()) {
|
||||
$form->set_import_error($error);
|
||||
} else {
|
||||
$framework = $importer->import();
|
||||
redirect(new moodle_url('continue.php', array('id' => $framework->get_id())));
|
||||
$urlparams = ['competencyframeworkid' => $framework->get_id(), 'pagecontextid' => $context->id];
|
||||
$frameworksurl = new moodle_url('/admin/tool/lp/competencies.php', $urlparams);
|
||||
echo $OUTPUT->notification(get_string('competencyframeworkcreated', 'tool_lp'), 'notifysuccess');
|
||||
echo $OUTPUT->continue_button($frameworksurl);
|
||||
die();
|
||||
}
|
||||
} else {
|
||||
$text = $form->get_file_content('importfile');
|
||||
$encoding = $data->encoding;
|
||||
$delimiter = $data->delimiter_name;
|
||||
$importer = new \tool_lpimportcsv\framework_importer($text, $encoding, $delimiter);
|
||||
$importer = new \tool_lpimportcsv\framework_importer($text, $encoding, $delimiter, 0, null, true);
|
||||
$confirmform = new \tool_lpimportcsv\form\import_confirm(null, $importer);
|
||||
$form = $confirmform;
|
||||
$pagetitle = get_string('confirmcolumnmappings', 'tool_lpimportcsv');
|
||||
}
|
||||
}
|
||||
|
||||
echo $OUTPUT->header();
|
||||
echo $OUTPUT->heading($pagetitle);
|
||||
|
||||
$form->display();
|
||||
|
||||
@@ -38,11 +38,13 @@ $string['importfile'] = 'CSV framework description file';
|
||||
$string['importfile_help'] = 'A competency framework may be imported via text file. The format of the file can be determined by creating a new competency framework on the site and then exporting it.';
|
||||
$string['importfile_link'] = 'admin/tool/lpimportcsv';
|
||||
$string['import'] = 'Import';
|
||||
$string['importingfile'] = 'Importing file data';
|
||||
$string['invalidimportfile'] = 'File format is invalid.';
|
||||
$string['isframework'] = 'Is framework';
|
||||
$string['noframeworks'] = 'No competency frameworks have been created yet';
|
||||
$string['parentidnumber'] = 'Parent ID number';
|
||||
$string['pluginname'] = 'Import competency framework';
|
||||
$string['processingfile'] = 'Processing file';
|
||||
$string['relatedidnumbers'] = 'Cross-referenced competency ID numbers';
|
||||
$string['ruleconfig'] = 'Rule config (optional)';
|
||||
$string['ruleoutcome'] = 'Rule outcome (optional)';
|
||||
|
||||
@@ -77,5 +77,8 @@ function xmldb_tool_monitor_upgrade($oldversion) {
|
||||
upgrade_plugin_savepoint(true, 2016052305, 'tool', 'monitor');
|
||||
}
|
||||
|
||||
// Automatically generated Moodle v3.2.0 release upgrade line.
|
||||
// Put any upgrade step following this.
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -65,6 +65,6 @@ Feature: Backup user data
|
||||
And I log out
|
||||
And I log in as "student1"
|
||||
And I follow "Course 1"
|
||||
When I go to "User report" in the course gradebook
|
||||
When I navigate to "User report" in the course gradebook
|
||||
Then "Quiz 1" row "Grade" column of "user-grade" table should contain "5"
|
||||
And "Quiz 1" row "Percentage" column of "user-grade" table should contain "50"
|
||||
|
||||
@@ -49,9 +49,10 @@ Feature: Basic recycle bin functionality
|
||||
And I should see "Deleting C2"
|
||||
And I should see "C2 has been completely deleted"
|
||||
And I press "Continue"
|
||||
And I go to the courses management page
|
||||
And I should not see "Course 2" in the "#course-listing" "css_element"
|
||||
When I navigate to "Recycle bin" node in "Category: Miscellaneous"
|
||||
And I am on course index
|
||||
And I should see "Course 1"
|
||||
And I should not see "Course 2"
|
||||
When I navigate to "Recycle bin" in current page administration
|
||||
Then I should see "Course 2"
|
||||
And I should see "Contents will be permanently deleted after 14 days"
|
||||
And I click on "Restore" "link" in the "region-main" "region"
|
||||
|
||||
@@ -75,7 +75,7 @@ if (!empty($delall) && confirm_sesskey()) {
|
||||
exit;
|
||||
}
|
||||
|
||||
if (!empty($ignore)) {
|
||||
if (!empty($ignore) && confirm_sesskey()) {
|
||||
unset($SESSION->users_result[$id]);
|
||||
echo json_encode(true);
|
||||
exit;
|
||||
|
||||
@@ -358,38 +358,40 @@ if ($formdata = $mform2->is_cancelled()) {
|
||||
|
||||
// add default values for remaining fields
|
||||
$formdefaults = array();
|
||||
foreach ($STD_FIELDS as $field) {
|
||||
if (isset($user->$field)) {
|
||||
continue;
|
||||
}
|
||||
// all validation moved to form2
|
||||
if (isset($formdata->$field)) {
|
||||
// process templates
|
||||
$user->$field = uu_process_template($formdata->$field, $user);
|
||||
$formdefaults[$field] = true;
|
||||
if (in_array($field, $upt->columns)) {
|
||||
$upt->track($field, s($user->$field), 'normal');
|
||||
if ($updatetype != UU_UPDATE_FILEOVERRIDE && $updatetype != UU_UPDATE_NOCHANGES) {
|
||||
foreach ($STD_FIELDS as $field) {
|
||||
if (isset($user->$field)) {
|
||||
continue;
|
||||
}
|
||||
// all validation moved to form2
|
||||
if (isset($formdata->$field)) {
|
||||
// process templates
|
||||
$user->$field = uu_process_template($formdata->$field, $user);
|
||||
$formdefaults[$field] = true;
|
||||
if (in_array($field, $upt->columns)) {
|
||||
$upt->track($field, s($user->$field), 'normal');
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
foreach ($PRF_FIELDS as $field) {
|
||||
if (isset($user->$field)) {
|
||||
continue;
|
||||
}
|
||||
if (isset($formdata->$field)) {
|
||||
// process templates
|
||||
$user->$field = uu_process_template($formdata->$field, $user);
|
||||
|
||||
// Form contains key and later code expects value.
|
||||
// Convert key to value for required profile fields.
|
||||
require_once($CFG->dirroot.'/user/profile/field/'.$proffields[$field]->datatype.'/field.class.php');
|
||||
$profilefieldclass = 'profile_field_'.$proffields[$field]->datatype;
|
||||
$profilefield = new $profilefieldclass($proffields[$field]->id);
|
||||
if (method_exists($profilefield, 'convert_external_data')) {
|
||||
$user->$field = $profilefield->edit_save_data_preprocess($user->$field, null);
|
||||
foreach ($PRF_FIELDS as $field) {
|
||||
if (isset($user->$field)) {
|
||||
continue;
|
||||
}
|
||||
if (isset($formdata->$field)) {
|
||||
// process templates
|
||||
$user->$field = uu_process_template($formdata->$field, $user);
|
||||
|
||||
$formdefaults[$field] = true;
|
||||
// Form contains key and later code expects value.
|
||||
// Convert key to value for required profile fields.
|
||||
require_once($CFG->dirroot.'/user/profile/field/'.$proffields[$field]->datatype.'/field.class.php');
|
||||
$profilefieldclass = 'profile_field_'.$proffields[$field]->datatype;
|
||||
$profilefield = new $profilefieldclass($proffields[$field]->id);
|
||||
if (method_exists($profilefield, 'convert_external_data')) {
|
||||
$user->$field = $profilefield->edit_save_data_preprocess($user->$field, null);
|
||||
}
|
||||
|
||||
$formdefaults[$field] = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -33,6 +33,7 @@ $string['deleteerrors'] = 'Delete errors';
|
||||
$string['encoding'] = 'Encoding';
|
||||
$string['errormnetadd'] = 'Can not add remote users';
|
||||
$string['errors'] = 'Errors';
|
||||
$string['invalidupdatetype'] = 'This option cannot be selected with the chosen upload type.';
|
||||
$string['invaliduserdata'] = 'Invalid data detected for user {$a} and it has been automatically cleaned.';
|
||||
$string['nochanges'] = 'No changes';
|
||||
$string['pluginname'] = 'User upload';
|
||||
|
||||
@@ -29,14 +29,13 @@ Feature: Upload users
|
||||
And I should see "Section 1"
|
||||
And I press "Upload users"
|
||||
And I press "Continue"
|
||||
And I follow "Browse list of users"
|
||||
And I navigate to "Users > Accounts > Browse list of users" in site administration
|
||||
And I should see "Tom Jones"
|
||||
And I should see "Trent Reznor"
|
||||
And I should see "reznor@example.com"
|
||||
And I am on site homepage
|
||||
And I follow "Maths"
|
||||
And I expand "Users" node
|
||||
And I follow "Groups"
|
||||
And I navigate to "Users > Groups" in current page administration
|
||||
And I set the field "groups" to "Section 1 (1)"
|
||||
And the "members" select box should contain "Tom Jones"
|
||||
|
||||
|
||||
@@ -350,6 +350,7 @@ class admin_uploaduser_form2 extends moodleform {
|
||||
$errors = parent::validation($data, $files);
|
||||
$columns = $this->_customdata['columns'];
|
||||
$optype = $data['uutype'];
|
||||
$updatetype = $data['uuupdatetype'];
|
||||
|
||||
// detect if password column needed in file
|
||||
if (!in_array('password', $columns)) {
|
||||
@@ -382,6 +383,12 @@ class admin_uploaduser_form2 extends moodleform {
|
||||
}
|
||||
}
|
||||
|
||||
// If the 'Existing user details' value is set we need to ensure that the
|
||||
// 'Upload type' is not set to something invalid.
|
||||
if (!empty($updatetype) && ($optype == UU_USER_ADDNEW || $optype == UU_USER_ADDINC)) {
|
||||
$errors['uuupdatetype'] = get_string('invalidupdatetype', 'tool_uploaduser');
|
||||
}
|
||||
|
||||
// look for other required data
|
||||
if ($optype != UU_USER_UPDATE) {
|
||||
$requiredusernames = useredit_get_required_name_fields();
|
||||
|
||||
@@ -42,5 +42,8 @@ function xmldb_tool_usertours_upgrade($oldversion) {
|
||||
upgrade_plugin_savepoint(true, 2016120501, 'tool', 'usertours');
|
||||
}
|
||||
|
||||
// Automatically generated Moodle v3.2.0 release upgrade line.
|
||||
// Put any upgrade step following this.
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -146,9 +146,9 @@ $string['tour1_content_navigation'] = 'Major navigation is now through this nav
|
||||
$string['tour1_title_customisation'] = 'Customisation';
|
||||
$string['tour1_content_customisation'] = 'To customise the look of your site and the front page, use the settings menu in the corner of this header. Try turning editing on right now.';
|
||||
$string['tour1_title_blockregion'] = 'Block region';
|
||||
$string['tour1_content_blockregion'] = 'There is still a block region over here. We recommend removing the Navigation and Settings blocks completely, as all the functionality is elsewhere in the Boost theme.';
|
||||
$string['tour1_content_blockregion'] = 'There is still a block region over here. We recommend removing the Navigation and Administration blocks completely, as all the functionality is elsewhere in the Boost theme.';
|
||||
$string['tour1_title_addingblocks'] = 'Adding blocks';
|
||||
$string['tour1_content_addingblocks'] = 'In fact, think carefully about including any blocks on your pages. Blocks are not shown on the Moodle mobile app, so as a general rule it\'s much better to make sure your site works well without any blocks.';
|
||||
$string['tour1_content_addingblocks'] = 'In fact, think carefully about including any blocks on your pages. Blocks are not shown on the Moodle Mobile app, so as a general rule it\'s much better to make sure your site works well without any blocks.';
|
||||
$string['tour1_title_end'] = 'End of tour';
|
||||
$string['tour1_content_end'] = 'This has been a user tour, a new feature in Moodle 3.2. It won\'t show again unless you reset it using the link in the footer. As an admin you can also create your own tours like this!';
|
||||
|
||||
@@ -158,14 +158,14 @@ $string['tour2_content_welcome'] = 'Welcome to the Boost theme for Moodle 3.2. I
|
||||
$string['tour2_title_customisation'] = 'Customisation';
|
||||
$string['tour2_content_customisation'] = 'To change any course settings, use the settings menu in the corner of this header. You will find a similar settings menu on the home page of every activity, too. Try turning editing on right now.';
|
||||
$string['tour2_title_navigation'] = 'Navigation';
|
||||
$string['tour2_content_navigation'] = 'Major navigation is now though this nav drawer. Use the button at the top to hide or show it. You will see that there are links for major sections of your course.';
|
||||
$string['tour2_content_navigation'] = 'Navigation is now through this nav drawer. Use the button at the top to hide or show it. You will see that there are links for sections of your course.';
|
||||
$string['tour2_title_opendrawer'] = 'Open the nav drawer';
|
||||
$string['tour2_content_opendrawer'] = 'Try opening the nav drawer now.';
|
||||
$string['tour2_title_participants'] = 'Course participants';
|
||||
$string['tour2_content_participants'] = 'View participants here. This is also where you go to add or remove students.';
|
||||
$string['tour2_title_addblock'] = 'Add a block';
|
||||
$string['tour2_content_addblock'] = 'If you enable editing mode you can add blocks from the nav drawer. However, think carefully about including any blocks on your pages. Blocks are not shown on Moodle mobile app, so for the best student experience it is much better to make sure your course works well without any blocks.';
|
||||
$string['tour2_content_addblock'] = 'If you turn editing on you can add blocks from the nav drawer. However, think carefully about including any blocks on your pages. Blocks are not shown on the Moodle Mobile app, so for the best user experience it is better to make sure your course works well without any blocks.';
|
||||
$string['tour2_title_addingblocks'] = 'Adding blocks';
|
||||
$string['tour2_content_addingblocks'] = 'You can add blocks to this page using this button. However, think carefully about including any blocks on your pages. Blocks are not shown on Moodle mobile app, so for the best student experience it is much better to make sure your course works well without any blocks.';
|
||||
$string['tour2_content_addingblocks'] = 'You can add blocks to this page using this button. However, think carefully about including any blocks on your pages. Blocks are not shown on the Moodle Mobile app, so for the best user experience it is better to make sure your course works well without any blocks.';
|
||||
$string['tour2_title_end'] = 'End of tour';
|
||||
$string['tour2_content_end'] = 'This has been a user tour, a new feature in Moodle 3.2. It won\'t show again unless you reset it using the link in the footer. The site admin can also create further tours for this site if required.';
|
||||
|
||||
@@ -25,7 +25,7 @@ Feature: Add a new user tour
|
||||
And I add steps to the "First tour" tour:
|
||||
| targettype | targetvalue_selector | Title | Content |
|
||||
| Selector | .usermenu | User menu | This is your personal user menu. You'll find your personal preferences and your user profile here. |
|
||||
When I click on "Dashboard" "link" in the "Navigation" "block"
|
||||
When I am on homepage
|
||||
Then I should see "Welcome to your personal learning space. We'd like to give you a quick tour to show you some of the areas you may find helpful"
|
||||
And I press "Next"
|
||||
And I should see "This area shows you what's happening in some of your courses"
|
||||
@@ -38,7 +38,7 @@ Feature: Add a new user tour
|
||||
And I should see "This area shows you what's happening in some of your courses"
|
||||
And I press "End tour"
|
||||
And I should not see "This area shows you what's happening in some of your courses"
|
||||
And I click on "Dashboard" "link" in the "Navigation" "block"
|
||||
And I am on homepage
|
||||
And I should not see "Welcome to your personal learning space. We'd like to give you a quick tour to show you some of the areas you may find helpful"
|
||||
And I should not see "This area shows you what's happening in some of your courses"
|
||||
And I follow "Reset user tour on this page"
|
||||
@@ -58,7 +58,7 @@ Feature: Add a new user tour
|
||||
And I add steps to the "First tour" tour:
|
||||
| targettype | Title | Content |
|
||||
| Display in middle of page | Welcome | Welcome to your personal learning space. We'd like to give you a quick tour to show you some of the areas you may find helpful |
|
||||
When I click on "Dashboard" "link" in the "Navigation" "block"
|
||||
When I am on homepage
|
||||
Then I should not see "Welcome to your personal learning space. We'd like to give you a quick tour to show you some of the areas you may find helpful"
|
||||
|
||||
@javascript
|
||||
@@ -77,5 +77,5 @@ Feature: Add a new user tour
|
||||
| Display in middle of page | Welcome | Welcome to your personal learning space. We'd like to give you a quick tour to show you some of the areas you may find helpful |
|
||||
And I open the User tour settings page
|
||||
When I click on "Enable" "link" in the "My first tour" "table_row"
|
||||
And I click on "Dashboard" "link" in the "Navigation" "block"
|
||||
And I am on homepage
|
||||
Then I should see "Welcome to your personal learning space. We'd like to give you a quick tour to show you some of the areas you may find helpful"
|
||||
|
||||
@@ -16,7 +16,7 @@ Feature: Apply tour filters to a tour
|
||||
And I add steps to the "First tour" tour:
|
||||
| targettype | Title | Content |
|
||||
| Display in middle of page | Welcome | Welcome to your personal learning space. We'd like to give you a quick tour to show you some of the areas you may find helpful |
|
||||
When I click on "Dashboard" "link" in the "Navigation" "block"
|
||||
When I am on homepage
|
||||
Then I should not see "Welcome to your personal learning space. We'd like to give you a quick tour to show you some of the areas you may find helpful"
|
||||
|
||||
@javascript
|
||||
|
||||
@@ -55,5 +55,8 @@ function xmldb_auth_cas_upgrade($oldversion) {
|
||||
// Moodle v3.1.0 release upgrade line.
|
||||
// Put any upgrade step following this.
|
||||
|
||||
// Automatically generated Moodle v3.2.0 release upgrade line.
|
||||
// Put any upgrade step following this.
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -151,6 +151,7 @@ class login implements renderable, templatable {
|
||||
$data->rememberusername = $this->rememberusername;
|
||||
$data->passwordautocomplete = $this->passwordautocomplete;
|
||||
$data->signupurl = $this->signupurl->out(false);
|
||||
$data->username = $this->username;
|
||||
|
||||
return $data;
|
||||
}
|
||||
|
||||
@@ -31,6 +31,9 @@ class auth_db_testcase extends advanced_testcase {
|
||||
/** @var string Original error log */
|
||||
protected $oldlog;
|
||||
|
||||
/** @var int The amount of users to create for the large user set deletion test */
|
||||
protected $largedeletionsetsize = 128;
|
||||
|
||||
protected function init_auth_database() {
|
||||
global $DB, $CFG;
|
||||
require_once("$CFG->dirroot/auth/db/auth.php");
|
||||
@@ -444,4 +447,56 @@ class auth_db_testcase extends advanced_testcase {
|
||||
|
||||
$this->cleanup_auth_database();
|
||||
}
|
||||
|
||||
/**
|
||||
* Testing the deletion of a user when there are many users in the external DB.
|
||||
*/
|
||||
public function test_deleting_with_many_users() {
|
||||
global $DB;
|
||||
|
||||
$this->resetAfterTest(true);
|
||||
$this->preventResetByRollback();
|
||||
$this->init_auth_database();
|
||||
$auth = get_auth_plugin('db');
|
||||
$auth->db_init();
|
||||
|
||||
// Set to delete from moodle when missing from DB.
|
||||
set_config('removeuser', AUTH_REMOVEUSER_FULLDELETE, 'auth/db');
|
||||
$auth->config->removeuser = AUTH_REMOVEUSER_FULLDELETE;
|
||||
|
||||
// Create users.
|
||||
$users = [];
|
||||
for ($i = 0; $i < $this->largedeletionsetsize; $i++) {
|
||||
$user = (object)array('username' => "u$i", 'name' => "u$i", 'pass' => 'heslo', 'email' => "u$i@example.com");
|
||||
$user->id = $DB->insert_record('auth_db_users', $user);
|
||||
$users[] = $user;
|
||||
}
|
||||
|
||||
// Sync to moodle.
|
||||
$trace = new null_progress_trace();
|
||||
$auth->sync_users($trace, true);
|
||||
|
||||
// Check user is there.
|
||||
$user = array_shift($users);
|
||||
$moodleuser = $DB->get_record('user', array('email' => $user->email, 'auth' => 'db'));
|
||||
$this->assertNotNull($moodleuser);
|
||||
$this->assertEquals($user->username, $moodleuser->username);
|
||||
|
||||
// Delete a user.
|
||||
$DB->delete_records('auth_db_users', array('id' => $user->id));
|
||||
|
||||
// Sync again.
|
||||
$auth->sync_users($trace, true);
|
||||
|
||||
// Check user is no longer there.
|
||||
$moodleuser = $DB->get_record('user', array('id' => $moodleuser->id));
|
||||
$this->assertFalse($auth->user_login($user->username, 'heslo'));
|
||||
$this->assertEquals(1, $moodleuser->deleted);
|
||||
|
||||
// Make sure it was the only user deleted.
|
||||
$numberdeleted = $DB->count_records('user', array('deleted' => 1, 'auth' => 'db'));
|
||||
$this->assertEquals(1, $numberdeleted);
|
||||
|
||||
$this->cleanup_auth_database();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -55,5 +55,8 @@ function xmldb_auth_ldap_upgrade($oldversion) {
|
||||
// Moodle v3.1.0 release upgrade line.
|
||||
// Put any upgrade step following this.
|
||||
|
||||
// Automatically generated Moodle v3.2.0 release upgrade line.
|
||||
// Put any upgrade step following this.
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -43,5 +43,8 @@ function xmldb_auth_manual_upgrade($oldversion) {
|
||||
// Moodle v3.1.0 release upgrade line.
|
||||
// Put any upgrade step following this.
|
||||
|
||||
// Automatically generated Moodle v3.2.0 release upgrade line.
|
||||
// Put any upgrade step following this.
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -43,5 +43,8 @@ function xmldb_auth_mnet_upgrade($oldversion) {
|
||||
// Moodle v3.1.0 release upgrade line.
|
||||
// Put any upgrade step following this.
|
||||
|
||||
// Automatically generated Moodle v3.2.0 release upgrade line.
|
||||
// Put any upgrade step following this.
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -0,0 +1,55 @@
|
||||
@core @core_auth
|
||||
Feature: Test the 'showlogfailures' feature works.
|
||||
In order to see my recent login failures when logging in
|
||||
As a user
|
||||
I need to have at least one failed login attempt and then log in
|
||||
|
||||
Background:
|
||||
Given the following "users" exist:
|
||||
| username |
|
||||
| teacher1 |
|
||||
And the following config values are set as admin:
|
||||
| displayloginfailures | 1 |
|
||||
|
||||
# Given the user has at least one failed login attempt, when they login, then they should see both header and footer notices.
|
||||
Scenario: Check that 'displayloginfailures' works without javascript for teachers.
|
||||
# Simulate a log in failure for the teacher.
|
||||
Given I am on homepage
|
||||
And I click on "Log in" "link" in the ".logininfo" "css_element"
|
||||
And I set the field "Username" to "teacher1"
|
||||
And I set the field "Password" to "wrongpass"
|
||||
And I press "Log in"
|
||||
And I should see "Invalid login, please try again"
|
||||
# Now, log in with the correct credentials.
|
||||
When I set the field "Username" to "teacher1"
|
||||
And I set the field "Password" to "teacher1"
|
||||
And I press "Log in"
|
||||
# Confirm the notices are displayed.
|
||||
Then I should see "1 failed logins since your last login" in the "header.navbar" "css_element"
|
||||
And I should see "1 failed logins since your last login" in the "page-footer" "region"
|
||||
# Confirm the notices disappear when navigating to another page.
|
||||
And I am on homepage
|
||||
And I should not see "1 failed logins since your last login" in the "header.navbar" "css_element"
|
||||
And I should not see "1 failed logins since your last login" in the "page-footer" "region"
|
||||
|
||||
# Given the user has at least one failed login attempt, when they login, then they should see both header and footer notices.
|
||||
Scenario: Check that 'displayloginfailures' works without javascript for admins.
|
||||
# Simulate a log in failure for the teacher.
|
||||
Given I am on homepage
|
||||
And I click on "Log in" "link" in the ".logininfo" "css_element"
|
||||
And I set the field "Username" to "admin"
|
||||
And I set the field "Password" to "wrongpass"
|
||||
And I press "Log in"
|
||||
And I should see "Invalid login, please try again"
|
||||
# Now, log in with the correct credentials.
|
||||
When I set the field "Username" to "admin"
|
||||
And I set the field "Password" to "admin"
|
||||
And I press "Log in"
|
||||
# Confirm the notices are displayed.
|
||||
Then I should see "1 failed logins since your last login" in the "header.navbar" "css_element"
|
||||
And I should see "1 failed logins since your last login (Logs)" in the "page-footer" "region"
|
||||
# Confirm that the link works and that the notices disappear when navigating to another page.
|
||||
And I click on "Logs" "link" in the "page-footer" "region"
|
||||
And I should see "User login failed" in the "table.reportlog" "css_element"
|
||||
And I should not see "1 failed logins since your last login" in the "header.navbar" "css_element"
|
||||
And I should not see "1 failed logins since your last login (Logs)" in the "page-footer" "region"
|
||||
@@ -0,0 +1,50 @@
|
||||
@core @core_auth
|
||||
Feature: Test the 'remember username' feature works.
|
||||
In order to see my saved username on the login form
|
||||
As a user
|
||||
I need to have logged in once before and clicked 'Remember username'
|
||||
|
||||
Background:
|
||||
Given the following "users" exist:
|
||||
| username |
|
||||
| teacher1 |
|
||||
|
||||
# Given the user has logged in and selected 'Remember username', when they log in again, then their username should be remembered.
|
||||
Scenario: Check that 'remember username' works without javascript for teachers.
|
||||
# Log in the first time and check the 'remember username' box.
|
||||
Given I am on homepage
|
||||
And I click on "Log in" "link" in the ".logininfo" "css_element"
|
||||
And I set the field "Username" to "teacher1"
|
||||
And I set the field "Password" to "teacher1"
|
||||
And I set the field "Remember username" to "1"
|
||||
And I press "Log in"
|
||||
And I log out
|
||||
# Log out and check that the username was remembered.
|
||||
When I am on homepage
|
||||
And I click on "Log in" "link" in the ".logininfo" "css_element"
|
||||
Then the field "username" matches value "teacher1"
|
||||
And the field "Remember username" matches value "1"
|
||||
|
||||
# Given the user has logged in before and selected 'Remember username', when they log in again and unset 'Remember username', then
|
||||
# their username should be forgotten for future log in attempts.
|
||||
Scenario: Check that 'remember username' unsetting works without javascript for teachers.
|
||||
# Log in the first time and check the 'remember username' box.
|
||||
Given I am on homepage
|
||||
And I click on "Log in" "link" in the ".logininfo" "css_element"
|
||||
And I set the field "Username" to "teacher1"
|
||||
And I set the field "Password" to "teacher1"
|
||||
And I set the field "Remember username" to "1"
|
||||
And I press "Log in"
|
||||
And I log out
|
||||
# Log in again, unsetting the 'remember username' field.
|
||||
When I am on homepage
|
||||
And I click on "Log in" "link" in the ".logininfo" "css_element"
|
||||
And I set the field "Password" to "teacher1"
|
||||
And I set the field "Remember username" to "0"
|
||||
And I press "Log in"
|
||||
And I log out
|
||||
# Check username has been forgotten.
|
||||
Then I am on homepage
|
||||
And I click on "Log in" "link" in the ".logininfo" "css_element"
|
||||
Then the field "username" matches value ""
|
||||
And the field "Remember username" matches value "0"
|
||||
@@ -1,3 +0,0 @@
|
||||
#fitem_id_availabilityconditionsjson .availability_grade input[type=text] {
|
||||
width: 3em;
|
||||
}
|
||||
@@ -115,7 +115,7 @@ Feature: availability_grade
|
||||
|
||||
# Give the assignment 40%.
|
||||
And I follow "A1"
|
||||
And I click on "View all submissions" "link" in the "Administration" "block"
|
||||
And I navigate to "View all submissions" in current page administration
|
||||
# Pick the grade link in the row that has s@example.com in it.
|
||||
And I click on "Grade" "link" in the "s@example.com" "table_row"
|
||||
And I set the field "Grade out of 100" to "40"
|
||||
|
||||
@@ -101,7 +101,7 @@ Feature: availability_profile
|
||||
|
||||
# Edit it again and check the setting still works.
|
||||
When I follow "P1"
|
||||
And I navigate to "Edit settings" node in "Page module administration"
|
||||
And I navigate to "Edit settings" in current page administration
|
||||
And I expand all fieldsets
|
||||
Then the field "User profile field" matches value "Super field"
|
||||
And the field "Value to compare against" matches value "Bananaman"
|
||||
|
||||
@@ -216,7 +216,7 @@ Feature: edit_availability
|
||||
|
||||
# Check the button still works after saving and editing.
|
||||
And I press "Save and display"
|
||||
And I navigate to "Edit settings" node in "Forum administration"
|
||||
And I navigate to "Edit settings" in current page administration
|
||||
And I expand all fieldsets
|
||||
And the "Add group/grouping access restriction" "button" should be disabled
|
||||
And I should see "Grouping" in the "Restrict access" "fieldset"
|
||||
|
||||
@@ -2,6 +2,11 @@ This files describes API changes in /availability/*.
|
||||
|
||||
The information here is intended only for developers.
|
||||
|
||||
=== 3.2 ===
|
||||
|
||||
* Condition plugins must replace the CSS selector "#fitem_id_availabilityconditionsjson" with ".availability-field".
|
||||
This selector is often used in your plugin's yui/src/form/js/form.js file.
|
||||
|
||||
=== 2.9 ===
|
||||
|
||||
* Condition plugins can now implement a new include_after_restore function to
|
||||
|
||||
@@ -43,19 +43,6 @@ use Behat\Gherkin\Node\TableNode as TableNode,
|
||||
*/
|
||||
class behat_backup extends behat_base {
|
||||
|
||||
/**
|
||||
* Follow a link like 'Backup' or 'Import', where the link name comes from
|
||||
* a language string, in the settings nav block of a course.
|
||||
* @param string $langstring the lang string to look for. E.g. 'backup' or 'import'.
|
||||
* @param string $component (optional) second argument to {@link get_string}.
|
||||
*/
|
||||
protected function navigate_to_course_settings_link($langstring, $component = '') {
|
||||
$behatnavigation = new behat_navigation();
|
||||
$behatnavigation->setMink($this->getMink());
|
||||
$behatnavigation->i_navigate_to_node_in(get_string($langstring, $component),
|
||||
get_string('courseadministration'));
|
||||
}
|
||||
|
||||
/**
|
||||
* Backups the specified course using the provided options. If you are interested in restoring this backup would be
|
||||
* useful to provide a 'Filename' option.
|
||||
@@ -70,33 +57,31 @@ class behat_backup extends behat_base {
|
||||
|
||||
// Go to homepage.
|
||||
$this->getSession()->visit($this->locate_path('/?redirect=0'));
|
||||
$this->execute("behat_general::wait_until_the_page_is_ready");
|
||||
|
||||
// Click the course link.
|
||||
$this->find_link($backupcourse)->click();
|
||||
$this->execute("behat_general::click_link", $backupcourse);
|
||||
|
||||
// Click the backup link.
|
||||
$this->navigate_to_course_settings_link('backup');
|
||||
$this->wait();
|
||||
$this->execute("behat_navigation::i_navigate_to_in_current_page_administration", get_string('backup'));
|
||||
|
||||
// Initial settings.
|
||||
$this->fill_backup_restore_form($this->get_step_options($options, "Initial"));
|
||||
$this->find_button(get_string('backupstage1action', 'backup'))->press();
|
||||
$this->wait();
|
||||
$this->execute("behat_forms::press_button", get_string('backupstage1action', 'backup'));
|
||||
|
||||
// Schema settings.
|
||||
$this->fill_backup_restore_form($this->get_step_options($options, "Schema"));
|
||||
$this->find_button(get_string('backupstage2action', 'backup'))->press();
|
||||
$this->wait();
|
||||
$this->execute("behat_forms::press_button", get_string('backupstage2action', 'backup'));
|
||||
|
||||
// Confirmation and review, backup filename can also be specified.
|
||||
$this->fill_backup_restore_form($this->get_step_options($options, "Confirmation"));
|
||||
$this->find_button(get_string('backupstage4action', 'backup'))->press();
|
||||
$this->execute("behat_forms::press_button", get_string('backupstage4action', 'backup'));
|
||||
|
||||
// Waiting for it to finish.
|
||||
$this->wait(self::EXTENDED_TIMEOUT);
|
||||
$this->execute("behat_general::wait_until_the_page_is_ready");
|
||||
|
||||
// Last backup continue button.
|
||||
$this->find_button(get_string('backupstage16action', 'backup'))->press();
|
||||
$this->execute("behat_general::i_click_on", array(get_string('backupstage16action', 'backup'), 'button'));
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -116,21 +101,19 @@ class behat_backup extends behat_base {
|
||||
$this->getSession()->visit($this->locate_path('/?redirect=0'));
|
||||
|
||||
// Click the course link.
|
||||
$this->find_link($backupcourse)->click();
|
||||
$this->execute("behat_general::click_link", $backupcourse);
|
||||
|
||||
// Click the backup link.
|
||||
$this->find_link(get_string('backup'))->click();
|
||||
$this->wait();
|
||||
$this->execute("behat_navigation::i_navigate_to_in_current_page_administration", get_string('backup'));
|
||||
|
||||
// Initial settings.
|
||||
$this->find_button(get_string('jumptofinalstep', 'backup'))->press();
|
||||
$this->wait();
|
||||
$this->execute("behat_forms::press_button", get_string('jumptofinalstep', 'backup'));
|
||||
|
||||
// Waiting for it to finish.
|
||||
$this->wait(self::EXTENDED_TIMEOUT);
|
||||
$this->execute("behat_general::wait_until_the_page_is_ready");
|
||||
|
||||
// Last backup continue button.
|
||||
$this->find_button(get_string('backupstage16action', 'backup'))->press();
|
||||
$this->execute("behat_general::i_click_on", array(get_string('backupstage16action', 'backup'), 'button'));
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -152,15 +135,13 @@ class behat_backup extends behat_base {
|
||||
|
||||
// Go to homepage.
|
||||
$this->getSession()->visit($this->locate_path('/?redirect=0'));
|
||||
$this->wait();
|
||||
$this->execute("behat_general::wait_until_the_page_is_ready");
|
||||
|
||||
// Click the course link.
|
||||
$this->find_link($tocourse)->click();
|
||||
$this->wait();
|
||||
$this->execute("behat_general::click_link", $tocourse);
|
||||
|
||||
// Click the import link.
|
||||
$this->navigate_to_course_settings_link('import');
|
||||
$this->wait();
|
||||
$this->execute("behat_navigation::i_navigate_to_in_current_page_administration", get_string('import'));
|
||||
|
||||
// Select the course.
|
||||
$exception = new ExpectationException('"' . $fromcourse . '" course not found in the list of courses to import from',
|
||||
@@ -175,25 +156,24 @@ class behat_backup extends behat_base {
|
||||
$radiofield = new behat_form_field($this->getSession(), $radionode);
|
||||
$radiofield->set_value(1);
|
||||
|
||||
$this->find_button(get_string('continue'))->press();
|
||||
$this->wait();
|
||||
$this->execute("behat_forms::press_button", get_string('continue'));
|
||||
|
||||
// Initial settings.
|
||||
$this->fill_backup_restore_form($this->get_step_options($options, "Initial"));
|
||||
$this->find_button(get_string('importbackupstage1action', 'backup'))->press();
|
||||
$this->wait();
|
||||
$this->execute("behat_forms::press_button", get_string('importbackupstage1action', 'backup'));
|
||||
|
||||
// Schema settings.
|
||||
$this->fill_backup_restore_form($this->get_step_options($options, "Schema"));
|
||||
$this->find_button(get_string('importbackupstage2action', 'backup'))->press();
|
||||
$this->wait();
|
||||
$this->execute("behat_forms::press_button", get_string('importbackupstage2action', 'backup'));
|
||||
|
||||
// Run it.
|
||||
$this->find_button(get_string('importbackupstage4action', 'backup'))->press();
|
||||
$this->wait(self::EXTENDED_TIMEOUT);
|
||||
$this->execute("behat_forms::press_button", get_string('importbackupstage4action', 'backup'));
|
||||
|
||||
// Wait to ensure restore is complete.
|
||||
$this->execute("behat_general::wait_until_the_page_is_ready");
|
||||
|
||||
// Continue and redirect to 'to' course.
|
||||
$this->find_button(get_string('continue'))->press();
|
||||
$this->execute("behat_general::i_click_on", array(get_string('continue'), 'button'));
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -215,17 +195,16 @@ class behat_backup extends behat_base {
|
||||
$existingcourse = behat_context_helper::escape($existingcourse);
|
||||
|
||||
// Selecting the specified course (we can not call behat_forms::select_radio here as is in another behat subcontext).
|
||||
$radionode = $this->find('xpath', "//div[contains(concat(' ', normalize-space(@class), ' '), ' bcs-existing-course ')]" .
|
||||
$radionodexpath = "//div[contains(concat(' ', normalize-space(@class), ' '), ' bcs-existing-course ')]" .
|
||||
"/descendant::div[contains(concat(' ', normalize-space(@class), ' '), ' restore-course-search ')]" .
|
||||
"/descendant::tr[contains(., $existingcourse)]" .
|
||||
"/descendant::input[@type='radio']");
|
||||
$radionode->click();
|
||||
"/descendant::input[@type='radio']";
|
||||
$this->execute("behat_general::i_click_on", array($radionodexpath, 'xpath_element'));
|
||||
|
||||
// Pressing the continue button of the restore into an existing course section.
|
||||
$continuenode = $this->find('xpath', "//div[contains(concat(' ', normalize-space(@class), ' '), ' bcs-existing-course ')]" .
|
||||
"/descendant::input[@type='submit'][@value='" . get_string('continue') . "']");
|
||||
$continuenode->click();
|
||||
$this->wait();
|
||||
$continuenodexpath = "//div[contains(concat(' ', normalize-space(@class), ' '), ' bcs-existing-course ')]" .
|
||||
"/descendant::input[@type='submit'][@value='" . get_string('continue') . "']";
|
||||
$this->execute("behat_general::i_click_on", array($continuenodexpath, 'xpath_element'));
|
||||
|
||||
// Common restore process using provided key/value options.
|
||||
$this->process_restore($options);
|
||||
@@ -246,16 +225,15 @@ class behat_backup extends behat_base {
|
||||
$this->select_backup($backupfilename);
|
||||
|
||||
// The first category in the list.
|
||||
$radionode = $this->find('xpath', "//div[contains(concat(' ', normalize-space(@class), ' '), ' bcs-new-course ')]" .
|
||||
$radionodexpath = "//div[contains(concat(' ', normalize-space(@class), ' '), ' bcs-new-course ')]" .
|
||||
"/descendant::div[contains(concat(' ', normalize-space(@class), ' '), ' restore-course-search ')]" .
|
||||
"/descendant::input[@type='radio']");
|
||||
$radionode->click();
|
||||
"/descendant::input[@type='radio']";
|
||||
$this->execute("behat_general::i_click_on", array($radionodexpath, 'xpath_element'));
|
||||
|
||||
// Pressing the continue button of the restore into an existing course section.
|
||||
$continuenode = $this->find('xpath', "//div[contains(concat(' ', normalize-space(@class), ' '), ' bcs-new-course ')]" .
|
||||
"/descendant::input[@type='submit'][@value='" . get_string('continue') . "']");
|
||||
$continuenode->click();
|
||||
$this->wait();
|
||||
$continuenodexpath = "//div[contains(concat(' ', normalize-space(@class), ' '), ' bcs-new-course ')]" .
|
||||
"/descendant::input[@type='submit'][@value='" . get_string('continue') . "']";
|
||||
$this->execute("behat_general::i_click_on", array($continuenodexpath, 'xpath_element'));
|
||||
|
||||
// Common restore process using provided key/value options.
|
||||
$this->process_restore($options);
|
||||
@@ -276,15 +254,14 @@ class behat_backup extends behat_base {
|
||||
$this->select_backup($backupfilename);
|
||||
|
||||
// Merge without deleting radio option.
|
||||
$radionode = $this->find('xpath', "//div[contains(concat(' ', normalize-space(@class), ' '), 'bcs-current-course')]" .
|
||||
"/descendant::input[@type='radio'][@name='target'][@value='1']");
|
||||
$radionode->click();
|
||||
$radionodexpath = "//div[contains(concat(' ', normalize-space(@class), ' '), 'bcs-current-course')]" .
|
||||
"/descendant::input[@type='radio'][@name='target'][@value='1']";
|
||||
$this->execute("behat_general::i_click_on", array($radionodexpath, 'xpath_element'));
|
||||
|
||||
// Pressing the continue button of the restore merging section.
|
||||
$continuenode = $this->find('xpath', "//div[contains(concat(' ', normalize-space(@class), ' '), 'bcs-current-course')]" .
|
||||
"/descendant::input[@type='submit'][@value='" . get_string('continue') . "']");
|
||||
$continuenode->click();
|
||||
$this->wait();
|
||||
$continuenodexpath = "//div[contains(concat(' ', normalize-space(@class), ' '), 'bcs-current-course')]" .
|
||||
"/descendant::input[@type='submit'][@value='" . get_string('continue') . "']";
|
||||
$this->execute("behat_general::i_click_on", array($continuenodexpath, 'xpath_element'));
|
||||
|
||||
// Common restore process using provided key/value options.
|
||||
$this->process_restore($options);
|
||||
@@ -305,15 +282,14 @@ class behat_backup extends behat_base {
|
||||
$this->select_backup($backupfilename);
|
||||
|
||||
// Delete contents radio option.
|
||||
$radionode = $this->find('xpath', "//div[contains(concat(' ', normalize-space(@class), ' '), 'bcs-current-course')]" .
|
||||
"/descendant::input[@type='radio'][@name='target'][@value='0']");
|
||||
$radionode->click();
|
||||
$radionodexpath = "//div[contains(concat(' ', normalize-space(@class), ' '), 'bcs-current-course')]" .
|
||||
"/descendant::input[@type='radio'][@name='target'][@value='0']";
|
||||
$this->execute("behat_general::i_click_on", array($radionodexpath, 'xpath_element'));
|
||||
|
||||
// Pressing the continue button of the restore merging section.
|
||||
$continuenode = $this->find('xpath', "//div[contains(concat(' ', normalize-space(@class), ' '), 'bcs-current-course')]" .
|
||||
"/descendant::input[@type='submit'][@value='" . get_string('continue') . "']");
|
||||
$continuenode->click();
|
||||
$this->wait();
|
||||
$continuenodexpath = "//div[contains(concat(' ', normalize-space(@class), ' '), 'bcs-current-course')]" .
|
||||
"/descendant::input[@type='submit'][@value='" . get_string('continue') . "']";
|
||||
$this->execute("behat_general::i_click_on", array($continuenodexpath, 'xpath_element'));
|
||||
|
||||
// Common restore process using provided key/value options.
|
||||
$this->process_restore($options);
|
||||
@@ -340,7 +316,7 @@ class behat_backup extends behat_base {
|
||||
$restorelink->click();
|
||||
|
||||
// Confirm the backup contents.
|
||||
$restore = $this->find_button(get_string('continue'))->press();
|
||||
$this->find_button(get_string('continue'))->press();
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -356,23 +332,20 @@ class behat_backup extends behat_base {
|
||||
|
||||
// Settings.
|
||||
$this->fill_backup_restore_form($this->get_step_options($options, "Settings"));
|
||||
$this->find_button(get_string('restorestage4action', 'backup'))->press();
|
||||
$this->wait();
|
||||
$this->execute("behat_forms::press_button", get_string('restorestage4action', 'backup'));
|
||||
|
||||
// Schema.
|
||||
$this->fill_backup_restore_form($this->get_step_options($options, "Schema"));
|
||||
$this->find_button(get_string('restorestage8action', 'backup'))->press();
|
||||
$this->wait();
|
||||
$this->execute("behat_forms::press_button", get_string('restorestage8action', 'backup'));
|
||||
|
||||
// Review, no options here.
|
||||
$this->find_button(get_string('restorestage16action', 'backup'))->press();
|
||||
$this->wait();
|
||||
$this->execute("behat_forms::press_button", get_string('restorestage16action', 'backup'));
|
||||
|
||||
// Wait till the final button is visible.
|
||||
$this->execute("behat_general::wait_until_the_page_is_ready");
|
||||
|
||||
// Last restore continue button, redirected to restore course after this.
|
||||
$this->find_button(get_string('restorestage32action', 'backup'))->press();
|
||||
|
||||
// Long wait when waiting for the restore to finish.
|
||||
$this->wait(self::EXTENDED_TIMEOUT);
|
||||
$this->execute("behat_general::i_click_on", array(get_string('restorestage32action', 'backup'), 'button'));
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -431,25 +404,4 @@ class behat_backup extends behat_base {
|
||||
|
||||
return $pageoptions;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Waits until the DOM and the page Javascript code is ready.
|
||||
*
|
||||
* @param int $timeout The number of seconds that we wait.
|
||||
* @return void
|
||||
*/
|
||||
protected function wait($timeout = false) {
|
||||
|
||||
if (!$this->running_javascript()) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (!$timeout) {
|
||||
$timeout = self::TIMEOUT;
|
||||
}
|
||||
|
||||
$this->getSession()->wait($timeout * 1000, self::PAGE_READY_JS);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -41,7 +41,7 @@ Feature: Restore Moodle 2 course backups
|
||||
Then I should see "Course 1 restored in a new course"
|
||||
And I should see "Community finder" in the "Community finder" "block"
|
||||
And I should see "Test forum name"
|
||||
And I click on "Edit settings" "link" in the "Administration" "block"
|
||||
And I navigate to "Edit settings" node in "Course administration"
|
||||
And I expand all fieldsets
|
||||
And the field "id_format" matches value "Topics format"
|
||||
And the field "Number of sections" matches value "15"
|
||||
@@ -83,7 +83,7 @@ Feature: Restore Moodle 2 course backups
|
||||
When I restore "test_backup.mbz" backup into a new course using this options:
|
||||
Then I should see "Topic 1"
|
||||
And I should see "Test forum name"
|
||||
And I click on "Edit settings" "link" in the "Administration" "block"
|
||||
And I navigate to "Edit settings" node in "Course administration"
|
||||
And I expand all fieldsets
|
||||
And the field "id_format" matches value "Topics format"
|
||||
And I set the following fields to these values:
|
||||
@@ -95,14 +95,14 @@ Feature: Restore Moodle 2 course backups
|
||||
And I press "Save and display"
|
||||
And I should see "1 January - 7 January"
|
||||
And I should see "Test forum name"
|
||||
And I click on "Edit settings" "link" in the "Administration" "block"
|
||||
And I navigate to "Edit settings" node in "Course administration"
|
||||
And I expand all fieldsets
|
||||
And the field "id_format" matches value "Weekly format"
|
||||
And I set the following fields to these values:
|
||||
| id_format | Social format |
|
||||
And I press "Save and display"
|
||||
And I should see "An open forum for chatting about anything you want to"
|
||||
And I click on "Edit settings" "link" in the "Administration" "block"
|
||||
And I navigate to "Edit settings" node in "Course administration"
|
||||
And I expand all fieldsets
|
||||
And the field "id_format" matches value "Social format"
|
||||
And I press "Cancel"
|
||||
@@ -119,7 +119,7 @@ Feature: Restore Moodle 2 course backups
|
||||
| Confirmation | Filename | test_backup.mbz |
|
||||
And I restore "test_backup.mbz" backup into "Course 2" course using this options:
|
||||
| Schema | Overwrite course configuration | Yes |
|
||||
And I click on "Edit settings" "link" in the "Administration" "block"
|
||||
And I navigate to "Edit settings" node in "Course administration"
|
||||
And I expand all fieldsets
|
||||
Then the field "id_format" matches value "Topics format"
|
||||
And the field "Number of sections" matches value "15"
|
||||
|
||||
@@ -14,12 +14,16 @@ Feature: Add badges to the system
|
||||
And I set the field "Default badge issuer name" to "Test Badge Site"
|
||||
And I set the field "Default badge issuer contact details" to "testuser@example.com"
|
||||
And I press "Save changes"
|
||||
And I follow "Badges"
|
||||
When I follow "Add a new badge"
|
||||
Then the field "issuercontact" matches value "testuser@example.com"
|
||||
And the field "issuername" matches value "Test Badge Site"
|
||||
|
||||
@javascript
|
||||
Scenario: Accessing the badges
|
||||
And I press "Customise this page"
|
||||
# TODO MDL-57120 site "Badges" link not accessible without navigation block.
|
||||
And I add the "Navigation" block if not present
|
||||
Given I navigate to "Site badges" node in "Site pages"
|
||||
Then I should see "There are no badges available."
|
||||
|
||||
|
||||
@@ -109,7 +109,7 @@ Feature: Block activity modules
|
||||
| workshop | Test workshop name | Test workshop description | C1 | workshop1 |
|
||||
|
||||
When I log in as "admin"
|
||||
And I follow "Courses"
|
||||
And I am on course index
|
||||
And I follow "Course 1"
|
||||
And I turn editing mode on
|
||||
And I add the "Activities" block
|
||||
|
||||
@@ -50,7 +50,7 @@ Feature: The activity results block displays student scores
|
||||
And I press "Save and return to course"
|
||||
And I follow "Course 1"
|
||||
And I should see "Test page name"
|
||||
And I go to "View > Grader report" in the course gradebook
|
||||
And I navigate to "View > Grader report" in the course gradebook
|
||||
And I turn editing mode on
|
||||
And I give the grade "90.00" to the user "Student 1" for the grade item "Test assignment 1"
|
||||
And I give the grade "80.00" to the user "Student 2" for the grade item "Test assignment 1"
|
||||
|
||||
@@ -33,7 +33,7 @@ Feature: The activity results block displays student scores
|
||||
| id_config_nameformat | Display full names |
|
||||
And I press "Save changes"
|
||||
When I follow "Test assignment"
|
||||
And I click on "Edit settings" "link" in the "Administration" "block"
|
||||
And I navigate to "Edit settings" in current page administration
|
||||
And I set the following fields to these values:
|
||||
| id_grade_modgrade_type | None |
|
||||
And I press "Save and return to course"
|
||||
|
||||
@@ -32,7 +32,7 @@ Feature: The activity results block displays student scores
|
||||
| Description | Offline text |
|
||||
| assignsubmission_file_enabled | 0 |
|
||||
And I follow "Course 1"
|
||||
And I go to "View > Grader report" in the course gradebook
|
||||
And I navigate to "View > Grader report" in the course gradebook
|
||||
And I turn editing mode on
|
||||
And I give the grade "90.00" to the user "Student 1" for the grade item "Test assignment"
|
||||
And I give the grade "80.00" to the user "Student 2" for the grade item "Test assignment"
|
||||
|
||||
@@ -26,7 +26,7 @@ Feature: The activity results block displays student scores as scales
|
||||
| student5 | C1 | student |
|
||||
And I log in as "teacher1"
|
||||
And I follow "Course 1"
|
||||
And I go to "Scales" in the course gradebook
|
||||
And I navigate to "Scales" in the course gradebook
|
||||
And I press "Add a new scale"
|
||||
And I set the following fields to these values:
|
||||
| Name | My Scale |
|
||||
@@ -41,7 +41,7 @@ Feature: The activity results block displays student scores as scales
|
||||
| id_grade_modgrade_type | Scale |
|
||||
| id_grade_modgrade_scale | My Scale |
|
||||
And I follow "Course 1"
|
||||
And I go to "View > Grader report" in the course gradebook
|
||||
And I navigate to "View > Grader report" in the course gradebook
|
||||
And I turn editing mode on
|
||||
And I give the grade "Excellent!" to the user "Student 1" for the grade item "Test assignment"
|
||||
And I give the grade "Very good" to the user "Student 2" for the grade item "Test assignment"
|
||||
|
||||
@@ -43,7 +43,7 @@ Feature: The activity results block displays student scores as scales
|
||||
| student6 | G3 |
|
||||
And I log in as "teacher1"
|
||||
And I follow "Course 1"
|
||||
And I go to "Scales" in the course gradebook
|
||||
And I navigate to "Scales" in the course gradebook
|
||||
And I press "Add a new scale"
|
||||
And I set the following fields to these values:
|
||||
| Name | My Scale |
|
||||
@@ -59,7 +59,7 @@ Feature: The activity results block displays student scores as scales
|
||||
| id_grade_modgrade_scale | My Scale |
|
||||
| Group mode | Separate groups |
|
||||
And I follow "Course 1"
|
||||
And I go to "View > Grader report" in the course gradebook
|
||||
And I navigate to "View > Grader report" in the course gradebook
|
||||
And I turn editing mode on
|
||||
And I give the grade "Excellent!" to the user "Student 1" for the grade item "Test assignment"
|
||||
And I give the grade "Very good" to the user "Student 2" for the grade item "Test assignment"
|
||||
|
||||
@@ -50,7 +50,7 @@ Feature: The activity results block displays student scores
|
||||
| assignsubmission_file_enabled | 0 |
|
||||
| Group mode | Separate groups |
|
||||
And I follow "Course 1"
|
||||
And I go to "View > Grader report" in the course gradebook
|
||||
And I navigate to "View > Grader report" in the course gradebook
|
||||
And I turn editing mode on
|
||||
And I give the grade "100.00" to the user "Student 1" for the grade item "Test assignment"
|
||||
And I give the grade "90.00" to the user "Student 2" for the grade item "Test assignment"
|
||||
|
||||
@@ -50,7 +50,7 @@ Feature: The activity results block displays student scores
|
||||
| assignsubmission_file_enabled | 0 |
|
||||
| Group mode | Visible groups |
|
||||
And I follow "Course 1"
|
||||
And I go to "View > Grader report" in the course gradebook
|
||||
And I navigate to "View > Grader report" in the course gradebook
|
||||
And I turn editing mode on
|
||||
And I give the grade "100.00" to the user "Student 1" for the grade item "Test assignment"
|
||||
And I give the grade "90.00" to the user "Student 2" for the grade item "Test assignment"
|
||||
|
||||
@@ -32,7 +32,7 @@ Feature: The activity results block displays student scores
|
||||
| Description | Offline text |
|
||||
| assignsubmission_file_enabled | 0 |
|
||||
And I follow "Course 1"
|
||||
And I go to "View > Grader report" in the course gradebook
|
||||
And I navigate to "View > Grader report" in the course gradebook
|
||||
And I turn editing mode on
|
||||
And I give the grade "90.00" to the user "Student 1" for the grade item "Test assignment"
|
||||
And I give the grade "80.00" to the user "Student 2" for the grade item "Test assignment"
|
||||
|
||||
@@ -26,7 +26,7 @@ Feature: The activity results block displays student scores as scales
|
||||
| student5 | C1 | student |
|
||||
And I log in as "teacher1"
|
||||
And I follow "Course 1"
|
||||
And I go to "Scales" in the course gradebook
|
||||
And I navigate to "Scales" in the course gradebook
|
||||
And I press "Add a new scale"
|
||||
And I set the following fields to these values:
|
||||
| Name | My Scale |
|
||||
@@ -41,7 +41,7 @@ Feature: The activity results block displays student scores as scales
|
||||
| id_grade_modgrade_type | Scale |
|
||||
| id_grade_modgrade_scale | My Scale |
|
||||
And I follow "Course 1"
|
||||
And I go to "View > Grader report" in the course gradebook
|
||||
And I navigate to "View > Grader report" in the course gradebook
|
||||
And I turn editing mode on
|
||||
And I give the grade "Excellent!" to the user "Student 1" for the grade item "Test assignment"
|
||||
And I give the grade "Very good" to the user "Student 2" for the grade item "Test assignment"
|
||||
|
||||
@@ -43,7 +43,7 @@ Feature: The activity results block displays student scores as scales
|
||||
| student6 | G3 |
|
||||
And I log in as "teacher1"
|
||||
And I follow "Course 1"
|
||||
And I go to "Scales" in the course gradebook
|
||||
And I navigate to "Scales" in the course gradebook
|
||||
And I press "Add a new scale"
|
||||
And I set the following fields to these values:
|
||||
| Name | My Scale |
|
||||
@@ -59,7 +59,7 @@ Feature: The activity results block displays student scores as scales
|
||||
| id_grade_modgrade_scale | My Scale |
|
||||
| Group mode | Separate groups |
|
||||
And I follow "Course 1"
|
||||
And I go to "View > Grader report" in the course gradebook
|
||||
And I navigate to "View > Grader report" in the course gradebook
|
||||
And I turn editing mode on
|
||||
And I give the grade "Excellent!" to the user "Student 1" for the grade item "Test assignment"
|
||||
And I give the grade "Very good" to the user "Student 2" for the grade item "Test assignment"
|
||||
|
||||
@@ -50,7 +50,7 @@ Feature: The activity results block displays student scores
|
||||
| assignsubmission_file_enabled | 0 |
|
||||
| Group mode | Separate groups |
|
||||
And I follow "Course 1"
|
||||
And I go to "View > Grader report" in the course gradebook
|
||||
And I navigate to "View > Grader report" in the course gradebook
|
||||
And I turn editing mode on
|
||||
And I give the grade "100.00" to the user "Student 1" for the grade item "Test assignment"
|
||||
And I give the grade "90.00" to the user "Student 2" for the grade item "Test assignment"
|
||||
|
||||
@@ -50,7 +50,7 @@ Feature: The activity results block displays student scores
|
||||
| assignsubmission_file_enabled | 0 |
|
||||
| Group mode | Visible groups |
|
||||
And I follow "Course 1"
|
||||
And I go to "View > Grader report" in the course gradebook
|
||||
And I navigate to "View > Grader report" in the course gradebook
|
||||
And I turn editing mode on
|
||||
And I give the grade "100.00" to the user "Student 1" for the grade item "Test assignment"
|
||||
And I give the grade "90.00" to the user "Student 2" for the grade item "Test assignment"
|
||||
|
||||
@@ -85,5 +85,8 @@ function xmldb_block_badges_upgrade($oldversion, $block) {
|
||||
// Moodle v3.1.0 release upgrade line.
|
||||
// Put any upgrade step following this.
|
||||
|
||||
// Automatically generated Moodle v3.2.0 release upgrade line.
|
||||
// Put any upgrade step following this.
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -35,5 +35,4 @@ Feature: Enable Block Badges on the dashboard and view awarded badges
|
||||
And I press "Award badge"
|
||||
And I log out
|
||||
When I log in as "teacher1"
|
||||
And I click on "Dashboard" "link" in the "Navigation" "block"
|
||||
Then I should see "Badge 1" in the "Latest badges" "block"
|
||||
|
||||
@@ -12,6 +12,8 @@ Feature: Feature: Students can use the recent blog entries block to view recent
|
||||
And I am on site homepage
|
||||
And I navigate to "Turn editing on" node in "Front page settings"
|
||||
And I add the "Recent blog entries" block
|
||||
# TODO MDL-57120 site "Blogs" link not accessible without navigation block.
|
||||
And I add the "Navigation" block if not present
|
||||
And I log out
|
||||
|
||||
Scenario: Students use the recent blog entries block to view blogs
|
||||
|
||||
@@ -24,8 +24,11 @@ Feature: Adding blog tag block
|
||||
And I follow "Course 1"
|
||||
And I turn editing mode on
|
||||
And I add the "Blog tags" block
|
||||
# TODO MDL-57120 site "Blogs" link not accessible without navigation block.
|
||||
And I add the "Navigation" block if not present
|
||||
|
||||
And I navigate to "Course blogs" node in "My courses > c1 > Participants"
|
||||
And I navigate to course participants
|
||||
And I click on "Course blogs" "link" in the "Navigation" "block"
|
||||
And I follow "Blog about this Course"
|
||||
And I set the following fields to these values:
|
||||
| Entry title | Blog post from teacher |
|
||||
@@ -35,7 +38,8 @@ Feature: Adding blog tag block
|
||||
And I log out
|
||||
And I log in as "student1"
|
||||
And I follow "Course 1"
|
||||
And I navigate to "Course blogs" node in "My courses > c1 > Participants"
|
||||
And I navigate to course participants
|
||||
And I click on "Course blogs" "link" in the "Navigation" "block"
|
||||
And I follow "Blog about this Course"
|
||||
And I set the following fields to these values:
|
||||
| Entry title | Blog post from student |
|
||||
|
||||
@@ -85,5 +85,8 @@ function xmldb_block_calendar_month_upgrade($oldversion, $block) {
|
||||
// Moodle v3.1.0 release upgrade line.
|
||||
// Put any upgrade step following this.
|
||||
|
||||
// Automatically generated Moodle v3.2.0 release upgrade line.
|
||||
// Put any upgrade step following this.
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -86,7 +86,7 @@ Feature: Enable the calendar block in a course and test it's functionality
|
||||
And I create a calendar event with form data:
|
||||
| id_eventtype | User |
|
||||
| id_name | User Event |
|
||||
When I click on "Dashboard" "link" in the "Navigation" "block"
|
||||
When I am on homepage
|
||||
And I follow "Course 1"
|
||||
And I follow "Hide course events"
|
||||
And I hover over today in the calendar
|
||||
@@ -102,7 +102,7 @@ Feature: Enable the calendar block in a course and test it's functionality
|
||||
And I create a calendar event with form data:
|
||||
| id_eventtype | User |
|
||||
| id_name | User Event |
|
||||
When I click on "Dashboard" "link" in the "Navigation" "block"
|
||||
When I am on homepage
|
||||
And I follow "Course 1"
|
||||
And I hover over today in the calendar
|
||||
Then I should see "User Event"
|
||||
@@ -120,7 +120,7 @@ Feature: Enable the calendar block in a course and test it's functionality
|
||||
And I create a calendar event with form data:
|
||||
| id_eventtype | User |
|
||||
| id_name | User Event |
|
||||
When I click on "Dashboard" "link" in the "Navigation" "block"
|
||||
When I am on homepage
|
||||
And I follow "Course 1"
|
||||
And I follow "Hide user events"
|
||||
And I hover over today in the calendar
|
||||
|
||||
@@ -85,5 +85,8 @@ function xmldb_block_calendar_upcoming_upgrade($oldversion, $block) {
|
||||
// Moodle v3.1.0 release upgrade line.
|
||||
// Put any upgrade step following this.
|
||||
|
||||
// Automatically generated Moodle v3.2.0 release upgrade line.
|
||||
// Put any upgrade step following this.
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -58,5 +58,8 @@ function xmldb_block_community_upgrade($oldversion) {
|
||||
// Moodle v3.1.0 release upgrade line.
|
||||
// Put any upgrade step following this.
|
||||
|
||||
// Automatically generated Moodle v3.2.0 release upgrade line.
|
||||
// Put any upgrade step following this.
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -60,5 +60,8 @@ function xmldb_block_completionstatus_upgrade($oldversion, $block) {
|
||||
// Moodle v3.1.0 release upgrade line.
|
||||
// Put any upgrade step following this.
|
||||
|
||||
// Automatically generated Moodle v3.2.0 release upgrade line.
|
||||
// Put any upgrade step following this.
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -43,7 +43,7 @@ Feature: Enable Block Completion in a course
|
||||
And I follow "Course 1"
|
||||
And I turn editing mode on
|
||||
And I follow "Test page name"
|
||||
And I navigate to "Edit settings" node in "Page module administration"
|
||||
And I navigate to "Edit settings" in current page administration
|
||||
And I set the following fields to these values:
|
||||
| Completion tracking | Show activity as complete when conditions are met |
|
||||
| Require view | 1 |
|
||||
|
||||
+2
-2
@@ -25,7 +25,7 @@ Feature: Enable Block Completion in a course using activity completion
|
||||
And I follow "Course 1"
|
||||
And I turn editing mode on
|
||||
And I follow "Test page name"
|
||||
And I navigate to "Edit settings" node in "Page module administration"
|
||||
And I navigate to "Edit settings" in current page administration
|
||||
And I set the following fields to these values:
|
||||
| Completion tracking | Show activity as complete when conditions are met |
|
||||
| Require view | 1 |
|
||||
@@ -47,7 +47,7 @@ Feature: Enable Block Completion in a course using activity completion
|
||||
And I follow "Course 1"
|
||||
And I turn editing mode on
|
||||
And I follow "Test page name"
|
||||
And I navigate to "Edit settings" node in "Page module administration"
|
||||
And I navigate to "Edit settings" in current page administration
|
||||
And I set the following fields to these values:
|
||||
| Completion tracking | Show activity as complete when conditions are met |
|
||||
| Require view | 1 |
|
||||
|
||||
@@ -153,7 +153,6 @@ Feature: View the course overview block on the dashboard and test it's functiona
|
||||
And I click on "Enable" "link" in the "Course meta link" "table_row"
|
||||
And I am on site homepage
|
||||
And I follow "Course 2"
|
||||
And I navigate to "Enrolment methods" node in "Course administration > Users"
|
||||
And I add "Course meta link" enrolment method with:
|
||||
| Link course | C1 |
|
||||
And I log out
|
||||
|
||||
@@ -60,5 +60,8 @@ function xmldb_block_course_summary_upgrade($oldversion, $block) {
|
||||
// Moodle v3.1.0 release upgrade line.
|
||||
// Put any upgrade step following this.
|
||||
|
||||
// Automatically generated Moodle v3.2.0 release upgrade line.
|
||||
// Put any upgrade step following this.
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -10,7 +10,7 @@ Scenario: Admin can add random glossary block to the frontpage
|
||||
| glossary | Tips and Tricks | Frontpage glossary description | Acceptance test site | glossary0 |
|
||||
And I log in as "admin"
|
||||
And I am on site homepage
|
||||
And I click on "Turn editing on" "link" in the "Administration" "block"
|
||||
And I turn editing mode on
|
||||
And I add the "Random glossary entry" block
|
||||
And I configure the "block_glossary_random" block
|
||||
And I set the following fields to these values:
|
||||
|
||||
@@ -45,5 +45,8 @@ function xmldb_block_html_upgrade($oldversion) {
|
||||
// Moodle v3.1.0 release upgrade line.
|
||||
// Put any upgrade step following this.
|
||||
|
||||
// Automatically generated Moodle v3.2.0 release upgrade line.
|
||||
// Put any upgrade step following this.
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -8,7 +8,7 @@ Feature: Adding and configuring HTML blocks
|
||||
Scenario: Configuring the HTML block with Javascript on
|
||||
Given I log in as "admin"
|
||||
And I am on site homepage
|
||||
When I click on "Turn editing on" "link" in the "Administration" "block"
|
||||
When I turn editing mode on
|
||||
And I add the "HTML" block
|
||||
And I configure the "(new HTML block)" block
|
||||
And I set the field "Content" to "Static text without a header"
|
||||
@@ -25,7 +25,7 @@ Feature: Adding and configuring HTML blocks
|
||||
Scenario: Configuring the HTML block with Javascript off
|
||||
Given I log in as "admin"
|
||||
And I am on site homepage
|
||||
When I click on "Turn editing on" "link" in the "Administration" "block"
|
||||
When I turn editing mode on
|
||||
And I add the "HTML" block
|
||||
And I configure the "(new HTML block)" block
|
||||
And I set the field "Content" to "Static text without a header"
|
||||
|
||||
@@ -7,7 +7,7 @@ Feature: Adding and configuring HTML blocks
|
||||
Background:
|
||||
Given I log in as "admin"
|
||||
And I am on site homepage
|
||||
When I click on "Turn editing on" "link" in the "Administration" "block"
|
||||
When I turn editing mode on
|
||||
And I add the "HTML" block
|
||||
|
||||
Scenario: Other users can not see HTML block that has not been configured
|
||||
|
||||
@@ -67,5 +67,8 @@ function xmldb_block_navigation_upgrade($oldversion, $block) {
|
||||
// Moodle v3.1.0 release upgrade line.
|
||||
// Put any upgrade step following this.
|
||||
|
||||
// Automatically generated Moodle v3.2.0 release upgrade line.
|
||||
// Put any upgrade step following this.
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -38,6 +38,13 @@ Feature: Expand the courses nodes within the navigation block
|
||||
| navshowallcourses | 1 |
|
||||
And I log in as "admin"
|
||||
And I am on site homepage
|
||||
And I turn editing mode on
|
||||
And I add the "Navigation" block if not present
|
||||
And I configure the "Navigation" block
|
||||
And I set the following fields to these values:
|
||||
| Page contexts | Display throughout the entire site |
|
||||
And I press "Save changes"
|
||||
And I turn editing mode off
|
||||
And I follow "Course 2"
|
||||
And I navigate to "Enrolment methods" node in "Course administration > Users"
|
||||
And I click on "Edit" "link" in the "Guest access" "table_row"
|
||||
|
||||
@@ -15,13 +15,22 @@ Feature: Displaying the link to the Participants page
|
||||
And the following "course enrolments" exist:
|
||||
| user | course | role |
|
||||
| student1 | C1 | student |
|
||||
And I log in as "admin"
|
||||
And I am on site homepage
|
||||
And I turn editing mode on
|
||||
And I add the "Navigation" block if not present
|
||||
And I configure the "Navigation" block
|
||||
And I set the following fields to these values:
|
||||
| Page contexts | Display throughout the entire site |
|
||||
And I press "Save changes"
|
||||
And I log out
|
||||
|
||||
@javascript
|
||||
Scenario: Course participants link is displayed to enrolled students after expanding the course node
|
||||
When I log in as "student1"
|
||||
And I expand "C1" node
|
||||
Then "Participants" "link" should exist in the "Navigation" "block"
|
||||
And I navigate to "Participants" node in "My courses > C1"
|
||||
And I click on "Participants" "link" in the "Navigation" "block"
|
||||
And I should see "Participants"
|
||||
And "Student One" "link" should exist
|
||||
And "Student Two" "link" should not exist
|
||||
@@ -29,7 +38,7 @@ Feature: Displaying the link to the Participants page
|
||||
Scenario: Site participants link is displayed to admins
|
||||
When I log in as "admin"
|
||||
Then "Participants" "link" should exist in the "Navigation" "block"
|
||||
And I navigate to "Participants" node in "Site pages"
|
||||
And I click on "Participants" "link" in the "Navigation" "block"
|
||||
And I should see "Participants"
|
||||
And "Student One" "link" should exist
|
||||
And "Student Two" "link" should exist
|
||||
|
||||
@@ -29,6 +29,15 @@ Feature: View my courses in navigation block
|
||||
| student1 | c1 | student |
|
||||
| student1 | c31 | student |
|
||||
| student1 | c331 | student |
|
||||
And I log in as "admin"
|
||||
And I am on site homepage
|
||||
And I turn editing mode on
|
||||
And I add the "Navigation" block if not present
|
||||
And I configure the "Navigation" block
|
||||
And I set the following fields to these values:
|
||||
| Page contexts | Display throughout the entire site |
|
||||
And I press "Save changes"
|
||||
And I log out
|
||||
|
||||
@javascript
|
||||
Scenario: The plain list of enrolled courses is shown
|
||||
|
||||
@@ -13,7 +13,7 @@ Feature: Latest announcements block displays the course latest news
|
||||
And I create a course with:
|
||||
| Course full name | Course 1 |
|
||||
| Course short name | C1 |
|
||||
| News items to show | 5 |
|
||||
| Number of announcements | 5 |
|
||||
And I enrol "Teacher 1" user as "Teacher"
|
||||
And I log out
|
||||
And I log in as "teacher1"
|
||||
@@ -34,15 +34,15 @@ Feature: Latest announcements block displays the course latest news
|
||||
Then I should see "Discussion One" in the "Latest announcements" "block"
|
||||
And I should see "Discussion Two" in the "Latest announcements" "block"
|
||||
And I should see "Discussion Three" in the "Latest announcements" "block"
|
||||
And I click on "Edit settings" "link" in the "Administration" "block"
|
||||
And I navigate to "Edit settings" in current page administration
|
||||
And I set the following fields to these values:
|
||||
| News items to show | 2 |
|
||||
| Number of announcements | 2 |
|
||||
And I press "Save and display"
|
||||
And I should not see "Discussion One" in the "Latest announcements" "block"
|
||||
And I should see "Discussion Two" in the "Latest announcements" "block"
|
||||
And I should see "Discussion Three" in the "Latest announcements" "block"
|
||||
And I click on "Edit settings" "link" in the "Administration" "block"
|
||||
And I navigate to "Edit settings" in current page administration
|
||||
And I set the following fields to these values:
|
||||
| News items to show | 0 |
|
||||
| Number of announcements | 0 |
|
||||
And I press "Save and display"
|
||||
And "Latest announcements" "block" should not exist
|
||||
|
||||
@@ -110,5 +110,8 @@ function xmldb_block_quiz_results_upgrade($oldversion, $block) {
|
||||
// Moodle v3.1.0 release upgrade line.
|
||||
// Put any upgrade step following this.
|
||||
|
||||
// Automatically generated Moodle v3.2.0 release upgrade line.
|
||||
// Put any upgrade step following this.
|
||||
|
||||
return true;
|
||||
}
|
||||
@@ -59,5 +59,8 @@ function xmldb_block_recent_activity_upgrade($oldversion, $block) {
|
||||
// Moodle v3.1.0 release upgrade line.
|
||||
// Put any upgrade step following this.
|
||||
|
||||
// Automatically generated Moodle v3.2.0 release upgrade line.
|
||||
// Put any upgrade step following this.
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -165,7 +165,7 @@ Feature: View structural changes in recent activity block
|
||||
And I log in as "teacher1"
|
||||
And I follow "Course 1"
|
||||
And I follow "ForumNew"
|
||||
And I click on "Edit settings" "link" in the "Administration" "block"
|
||||
And I navigate to "Edit settings" in current page administration
|
||||
And I set the following fields to these values:
|
||||
| name | ForumUpdated |
|
||||
And I press "Save and return to course"
|
||||
|
||||
@@ -56,5 +56,8 @@ function xmldb_block_rss_client_upgrade($oldversion) {
|
||||
// Moodle v3.1.0 release upgrade line.
|
||||
// Put any upgrade step following this.
|
||||
|
||||
// Automatically generated Moodle v3.2.0 release upgrade line.
|
||||
// Put any upgrade step following this.
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -43,7 +43,7 @@ Feature: The search forums block allows users to search for forum posts
|
||||
And I follow "Course 1"
|
||||
And I turn editing mode on
|
||||
And I follow "Announcements"
|
||||
And I navigate to "Edit settings" node in "Forum administration"
|
||||
And I navigate to "Edit settings" in current page administration
|
||||
And I expand all fieldsets
|
||||
And I set the field "id_visible" to "0"
|
||||
And I press "Save and return to course"
|
||||
|
||||
@@ -61,5 +61,8 @@ function xmldb_block_section_links_upgrade($oldversion, $block) {
|
||||
// Moodle v3.1.0 release upgrade line.
|
||||
// Put any upgrade step following this.
|
||||
|
||||
// Automatically generated Moodle v3.2.0 release upgrade line.
|
||||
// Put any upgrade step following this.
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -60,5 +60,8 @@ function xmldb_block_selfcompletion_upgrade($oldversion, $block) {
|
||||
// Moodle v3.1.0 release upgrade line.
|
||||
// Put any upgrade step following this.
|
||||
|
||||
// Automatically generated Moodle v3.2.0 release upgrade line.
|
||||
// Put any upgrade step following this.
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -67,5 +67,8 @@ function xmldb_block_settings_upgrade($oldversion, $block) {
|
||||
// Moodle v3.1.0 release upgrade line.
|
||||
// Put any upgrade step following this.
|
||||
|
||||
// Automatically generated Moodle v3.2.0 release upgrade line.
|
||||
// Put any upgrade step following this.
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -25,6 +25,8 @@
|
||||
|
||||
// NOTE: no MOODLE_INTERNAL test here, this file may be required by behat before including /config.php.
|
||||
|
||||
use Behat\Mink\Exception\ElementNotFoundException as ElementNotFoundException;
|
||||
|
||||
require_once(__DIR__ . '/../../../lib/behat/behat_base.php');
|
||||
|
||||
/**
|
||||
@@ -56,6 +58,20 @@ class behat_blocks extends behat_base {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Adds the selected block if it is not already present. Editing mode must be previously enabled.
|
||||
*
|
||||
* @Given /^I add the "(?P<block_name_string>(?:[^"]|\\")*)" block if not present$/
|
||||
* @param string $blockname
|
||||
*/
|
||||
public function i_add_the_block_if_not_present($blockname) {
|
||||
try {
|
||||
$this->get_text_selector_node('block', $blockname);
|
||||
} catch (ElementNotFoundException $e) {
|
||||
$this->execute('behat_blocks::i_add_the_block', [$blockname]);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Docks a block. Editing mode should be previously enabled.
|
||||
*
|
||||
|
||||
@@ -50,9 +50,8 @@ Feature: Add and configure blocks throughout the site
|
||||
|
||||
Scenario: Blocks on the dashboard page can have roles assigned to them
|
||||
Given I log in as "manager1"
|
||||
And I click on "Dashboard" "link" in the "Navigation" "block"
|
||||
When I press "Customise this page"
|
||||
Then I should see "Assign roles in Navigation block"
|
||||
Then I should see "Assign roles in Private files block"
|
||||
|
||||
Scenario: Blocks on courses can have roles assigned to them
|
||||
Given I log in as "teacher1"
|
||||
@@ -64,7 +63,7 @@ Feature: Add and configure blocks throughout the site
|
||||
@javascript
|
||||
Scenario: Blocks can safely be customised
|
||||
Given I log in as "admin"
|
||||
And I click on "Dashboard" "link" in the "Navigation" "block"
|
||||
And I am on homepage
|
||||
And I press "Customise this page"
|
||||
And I add the "HTML" block
|
||||
And I configure the "(new HTML block)" block
|
||||
|
||||
@@ -30,8 +30,7 @@ Feature: Allowed blocks controls
|
||||
| block/activity_modules:addinstance | Prohibit |
|
||||
And I am on site homepage
|
||||
And I follow "Course 1"
|
||||
And I expand "Users" node
|
||||
And I follow "Permissions"
|
||||
And I navigate to "Users > Permissions" in current page administration
|
||||
And I override the system permissions of "Teacher" role with:
|
||||
| block/completionstatus:addinstance | Prohibit |
|
||||
And I log out
|
||||
|
||||
@@ -14,7 +14,7 @@ Feature: The context of a block can always be returned to it's original state.
|
||||
And I follow "Turn editing on"
|
||||
And I add the "Tags" block
|
||||
Then I should see "Tags" in the "Tags" "block"
|
||||
And I click on "Participants" "link" in the "//li[p/a[contains(normalize-space(string(.)), 'Courses')]]" "xpath_element"
|
||||
And I navigate to course participants
|
||||
And I configure the "Tags" block
|
||||
And I set the following fields to these values:
|
||||
| Display on page types | Any page |
|
||||
@@ -31,7 +31,7 @@ Feature: The context of a block can always be returned to it's original state.
|
||||
And I should see "Tags" in the "Tags" "block"
|
||||
And I follow "Course 1"
|
||||
And "Tags" "block" should not exist
|
||||
And I navigate to "Participants" node in "Courses > C1"
|
||||
And I navigate to course participants
|
||||
And "Tags" "block" should not exist
|
||||
And I follow "Course 1"
|
||||
And I add a "Assignment" to section "1" and I fill the form with:
|
||||
@@ -45,5 +45,5 @@ Feature: The context of a block can always be returned to it's original state.
|
||||
And I press "Save changes"
|
||||
And I follow "Course 1"
|
||||
And I should see "Tags" in the "Tags" "block"
|
||||
And I navigate to "Participants" node in "Courses > C1"
|
||||
And I navigate to course participants
|
||||
And I should see "Tags" in the "Tags" "block"
|
||||
|
||||
@@ -27,7 +27,7 @@ Feature: Blogs can be set to be only visible by the author.
|
||||
Scenario: A student can not see another student's blog entries.
|
||||
Given I log in as "testuser"
|
||||
And I follow "Course 1"
|
||||
And I follow "Participants"
|
||||
And I navigate to course participants
|
||||
And I follow "Test2 User2"
|
||||
And I should see "Miscellaneous"
|
||||
Then I should not see "Blog entries"
|
||||
|
||||
@@ -9,9 +9,18 @@ Feature: Comment on a blog entry
|
||||
| username | firstname | lastname | email |
|
||||
| testuser | Test | User | moodle@example.com |
|
||||
| testuser2 | Test2 | User2 | moodle2@example.com |
|
||||
And I log in as "admin"
|
||||
And I am on site homepage
|
||||
And I turn editing mode on
|
||||
# TODO MDL-57120 "Site blogs" link not accessible without navigation block.
|
||||
And I add the "Navigation" block if not present
|
||||
And I configure the "Navigation" block
|
||||
And I set the following fields to these values:
|
||||
| Page contexts | Display throughout the entire site |
|
||||
And I press "Save changes"
|
||||
And I log out
|
||||
And I log in as "testuser"
|
||||
And I expand "Site pages" node
|
||||
And I follow "Site blogs"
|
||||
And I navigate to "Site blogs" node in "Site pages"
|
||||
And I follow "Add a new entry"
|
||||
And I set the following fields to these values:
|
||||
| Entry title | Blog post from user 1 |
|
||||
@@ -23,8 +32,7 @@ Feature: Comment on a blog entry
|
||||
Scenario: Commenting on my own blog entry
|
||||
Given I am on site homepage
|
||||
And I log in as "testuser"
|
||||
And I expand "Site pages" node
|
||||
And I follow "Site blogs"
|
||||
And I navigate to "Site blogs" node in "Site pages"
|
||||
And I follow "Blog post from user 1"
|
||||
And I should see "User 1 blog post content"
|
||||
And I follow "Comments (0)"
|
||||
@@ -39,8 +47,7 @@ Feature: Comment on a blog entry
|
||||
Scenario: Deleting my own comment
|
||||
Given I am on site homepage
|
||||
And I log in as "testuser"
|
||||
And I expand "Site pages" node
|
||||
And I follow "Site blogs"
|
||||
And I navigate to "Site blogs" node in "Site pages"
|
||||
And I follow "Blog post from user 1"
|
||||
And I should see "User 1 blog post content"
|
||||
And I follow "Comments (0)"
|
||||
@@ -60,8 +67,7 @@ Feature: Comment on a blog entry
|
||||
Given I am on site homepage
|
||||
And I log in as "testuser2"
|
||||
And I am on site homepage
|
||||
And I expand "Site pages" node
|
||||
And I follow "Site blogs"
|
||||
And I navigate to "Site blogs" node in "Site pages"
|
||||
And I follow "Blog post from user 1"
|
||||
When I follow "Comments (0)"
|
||||
And I set the field "content" to "$My own >nasty< \"string\"!"
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user