Compare commits
315 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 5d35d7b884 | |||
| 7817f82c15 | |||
| cabf0dbd40 | |||
| cd326efb57 | |||
| 39f2c0f711 | |||
| 02dae40716 | |||
| 408beb96d6 | |||
| c4e2c3ba9b | |||
| 4d59af4afa | |||
| 695ecfc67d | |||
| e02155048a | |||
| 0177319237 | |||
| e5f8c4d2e3 | |||
| edbb4f6e53 | |||
| 07b51eebf3 | |||
| 5240013d21 | |||
| a0984c46a1 | |||
| f361d3e20f | |||
| b238a8658f | |||
| 4513906883 | |||
| 1052567d7e | |||
| 1f43996636 | |||
| 0d18a2c74d | |||
| 3302964844 | |||
| 70d71d3af7 | |||
| 0b841c0c72 | |||
| bc66f3d7b2 | |||
| f3008d2a08 | |||
| 7de2aa1a95 | |||
| 69b2e68d27 | |||
| b7327c6c19 | |||
| f06196976a | |||
| 44f9a36089 | |||
| d92624e11f | |||
| 2264a0454c | |||
| 0944647413 | |||
| 8917f657a1 | |||
| 41d53f9bd5 | |||
| 793d034c4a | |||
| 45b9bcd9a0 | |||
| f45a62e469 | |||
| 650d4000cb | |||
| a411fd9ad7 | |||
| 9c35910821 | |||
| 47e5ed8e30 | |||
| b2e6bee53e | |||
| e217f4914a | |||
| 1ba350d146 | |||
| ec921c9d7b | |||
| ec3be4584c | |||
| e8f73b9edd | |||
| e9716eda2f | |||
| df8d12b685 | |||
| 1c529d9897 | |||
| 4ac2ded44b | |||
| f11ab3b3ed | |||
| 471b5b73a3 | |||
| ebc7b73150 | |||
| a06ed7e888 | |||
| 92a25cff43 | |||
| e5549f4f16 | |||
| 0d4fda7843 | |||
| f083859e96 | |||
| 29d83deae9 | |||
| 2217e2fea9 | |||
| 68927e83e5 | |||
| 819020ac57 | |||
| 1e5a066247 | |||
| 24a7fc2f07 | |||
| 03f0b4fc14 | |||
| 17af025b52 | |||
| ac56855bbc | |||
| 6f6ef56253 | |||
| 79d202c36d | |||
| 962aca6ad6 | |||
| 7473e54a3d | |||
| 105370c407 | |||
| 869ffde772 | |||
| 73d2934ba5 | |||
| 74a51dd48a | |||
| 9005a3bb96 | |||
| 6fccd1fe35 | |||
| ea78dbdf50 | |||
| db3cdb6d25 | |||
| ccc297f01a | |||
| 8dd7e73294 | |||
| f2087a7fcb | |||
| b1fe9348db | |||
| c3183cb6fe | |||
| d47064c4b2 | |||
| 66a28fbaa4 | |||
| d5d7d57d6d | |||
| db3bcaba14 | |||
| 145467fadf | |||
| 07021369d7 | |||
| 836172f366 | |||
| 2c3d0c3b6f | |||
| 1388dece19 | |||
| 41ec284720 | |||
| 62e799ac84 | |||
| 2945fe403b | |||
| 6af9a4e21c | |||
| 86c5e56baf | |||
| bde99c5a4b | |||
| abde041907 | |||
| bba453b9ed | |||
| 8abf3701a6 | |||
| d607b840b8 | |||
| c65d2ccb13 | |||
| 9149eaae18 | |||
| b35e24e254 | |||
| 8a0c8192c8 | |||
| f5f86a68ac | |||
| 57b1d3ea85 | |||
| 9611df0f92 | |||
| 74c19577c9 | |||
| c7231d5235 | |||
| 3cf111c8d3 | |||
| e0518a0940 | |||
| b000642c03 | |||
| aae5800486 | |||
| 9ef2475cdd | |||
| 8513fdd0ba | |||
| 19da0bad13 | |||
| ff64873ece | |||
| 7bd6de4822 | |||
| eb127e0b21 | |||
| 9797983c6f | |||
| 6767a5d631 | |||
| 1507697d9f | |||
| daf7e2a478 | |||
| 771e49de0c | |||
| c19896ff95 | |||
| 68494c8ef2 | |||
| 0a44e7d8cc | |||
| 345f365555 | |||
| 8079f3343f | |||
| 005f7c8b24 | |||
| a6f084c9c5 | |||
| 0e7a5b346f | |||
| 8640c059d8 | |||
| a3f65f8b5b | |||
| 88cece4bd7 | |||
| ddfebd633e | |||
| ac4baac8b9 | |||
| a0ef20cfe4 | |||
| e819a58b6e | |||
| 2adbbcac0a | |||
| 4e5e185f80 | |||
| 68cbd0599d | |||
| 2134746dea | |||
| 4d56fe7d60 | |||
| 1c4bc77d44 | |||
| bc91b91ab1 | |||
| 9887a4cbae | |||
| 7d8fb1962e | |||
| 07fbf4515c | |||
| e81e12cd79 | |||
| f318ef32bc | |||
| 696f3dcc83 | |||
| 804a5f59ce | |||
| 3f45d8fece | |||
| dfe989c826 | |||
| ed6277f9f7 | |||
| 48db0e02cd | |||
| 6ace0f59ae | |||
| fbf528eb95 | |||
| 220ea7cd09 | |||
| 7f1c642112 | |||
| 6530c22a11 | |||
| ab37a1c815 | |||
| 75b13bba36 | |||
| 2cebc825e9 | |||
| ffe7dd3769 | |||
| f41205a84c | |||
| 3046ae85cc | |||
| 536892fd4c | |||
| 2cae0d3b15 | |||
| bdb1cab348 | |||
| d08bcc4ded | |||
| 2f1473ac6d | |||
| 899f21fc26 | |||
| c60a3ef656 | |||
| 8262d6133a | |||
| e662941230 | |||
| 89feea07d3 | |||
| 9c2784ca30 | |||
| e18b4b0918 | |||
| 14d8971cd6 | |||
| 7c8149d6af | |||
| 096a908dbe | |||
| 68dfa89fea | |||
| e64751fb8a | |||
| 490c5cabb4 | |||
| 4269cac414 | |||
| cd319f3f2f | |||
| da14ce45dd | |||
| 818f90abd3 | |||
| 13ce9a38a2 | |||
| d5699018b0 | |||
| fbb8579c1a | |||
| f248c81e5a | |||
| 7d05696b12 | |||
| 716c7536cb | |||
| 4cdf94a602 | |||
| c9f2b241e0 | |||
| 8dbe8449e0 | |||
| 4841169211 | |||
| 3fe4b72c34 | |||
| 3c1e7a0759 | |||
| 98ad5c6191 | |||
| 0872bf3175 | |||
| 6e8ca8a6ce | |||
| e2de9c6b6d | |||
| 59b25acd22 | |||
| af145cdac1 | |||
| bf68d558af | |||
| f3d159dea1 | |||
| 3af4f54efb | |||
| 6698b06b11 | |||
| 545d2c9290 | |||
| 7cac3f6fe9 | |||
| db198f615a | |||
| bbf7cf2c44 | |||
| 0f62dd32c7 | |||
| 67e82ebe0b | |||
| ac16eaa936 | |||
| bfe6b3cdd1 | |||
| f1bf39c2f8 | |||
| 6064114c32 | |||
| e0d74e610a | |||
| 8948d04695 | |||
| 9993c6bcc0 | |||
| 1da82165ef | |||
| cf139e224e | |||
| f8bce590ba | |||
| 715eb9438c | |||
| 9c461eae4e | |||
| fe6a3c0531 | |||
| 793c80165d | |||
| a4f457e111 | |||
| 4110561f3e | |||
| b1549e4127 | |||
| 724513e5d8 | |||
| c14fbe69f5 | |||
| 8b4e2418f6 | |||
| 8568798f76 | |||
| 66533b249e | |||
| e5baddebcd | |||
| 0efd3318b2 | |||
| 16acfc55f4 | |||
| 31328e3ede | |||
| c83c1ee838 | |||
| 95f83b70b0 | |||
| 53253aea3a | |||
| c244cd14b7 | |||
| a1b7cd7090 | |||
| e4ffce07cf | |||
| 6b4ce43d1d | |||
| 107ab59c29 | |||
| 4cd0bc7ece | |||
| 42952482c9 | |||
| 3804a59fb6 | |||
| 174faea612 | |||
| dec56ff204 | |||
| c6d3f0d107 | |||
| 8f36db0be5 | |||
| f554e04a27 | |||
| 20c532caf8 | |||
| a1b0938c16 | |||
| 3e1da76d54 | |||
| e3dcc260fb | |||
| ae50bef5e6 | |||
| 1b1e4d2670 | |||
| c31a650aad | |||
| 76943b900c | |||
| c05a3e254c | |||
| 63385ff2b5 | |||
| 42d7bc64f5 | |||
| f0aa5b7e3b | |||
| 40e33b6e75 | |||
| e06768b331 | |||
| ab58f3ee49 | |||
| 6a30312beb | |||
| 8c4dbdfd56 | |||
| e9b0443000 | |||
| fab5233096 | |||
| 2748bf5900 | |||
| 2adf914723 | |||
| 96a2e4086f | |||
| a2d94f3d20 | |||
| 33784bd64b | |||
| 4e5efb5c0c | |||
| 5cb434f62b | |||
| 6117291e6b | |||
| 4e342f5397 | |||
| 6b85e6affd | |||
| e71116f768 | |||
| a0172a28fc | |||
| 60020ccaa9 | |||
| 3987e19c3f | |||
| 2068b31847 | |||
| 9a5f3f7672 | |||
| 75aa0f73db | |||
| 2efce29560 | |||
| a4c6ffd85f | |||
| 184169cd76 | |||
| 55d5b4168e | |||
| 6ccff3ba5d | |||
| 44f23c7ec1 | |||
| 492b025f5f | |||
| 7f98e36008 | |||
| f53c016704 | |||
| 64b9afa6a5 | |||
| da91de7821 |
+10
-42
@@ -12,21 +12,12 @@ notifications:
|
||||
language: php
|
||||
|
||||
php:
|
||||
# Moodle supports versions 5.4, 5.5, and 5.6 of PHP.
|
||||
# Order by fastest to slowest.
|
||||
# We currently only run the highest and lowest versions to reduce the load on travis-ci.org.
|
||||
- 5.6
|
||||
# We only run the highest and lowest supported versions to reduce the load on travis-ci.org.
|
||||
- 7.0
|
||||
# - 5.6
|
||||
# - 5.5
|
||||
- 5.4
|
||||
|
||||
# We hope to offer PHP 7 support in the near future.
|
||||
- nightly
|
||||
|
||||
services:
|
||||
# Ensure that memcached and mongodb are running for testing of those MUC stores.
|
||||
- memcached
|
||||
- mongodb
|
||||
|
||||
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.
|
||||
@@ -50,34 +41,26 @@ matrix:
|
||||
# It will not stop the jobs from running.
|
||||
fast_finish: true
|
||||
|
||||
# Always allow failure on nightly.
|
||||
# It's a nightly build and failures can happen.
|
||||
allow_failures:
|
||||
- php: nightly
|
||||
|
||||
exclude:
|
||||
# PHP 7 is not yet supported for actual runs.
|
||||
# Exclude it by default - we include it for CITEST only later.
|
||||
- php: nightly
|
||||
|
||||
# MySQL - it's just too slow.
|
||||
# Exclude it on all versions except for 5.6.
|
||||
# Exclude it on all versions except for 7.0
|
||||
# - env: DB=mysqli PHPUNIT=true INSTALL=false CITEST=false
|
||||
# php: 5.6
|
||||
#
|
||||
# - env: DB=mysqli PHPUNIT=true INSTALL=false CITEST=false
|
||||
# php: 5.5
|
||||
|
||||
- env: DB=mysqli PHPUNIT=true INSTALL=false CITEST=false
|
||||
php: 5.4
|
||||
|
||||
include:
|
||||
# Attempt to run the CITEST set on PHP 7.
|
||||
- php: nightly
|
||||
env: DB=none PHPUNIT=false INSTALL=false CITEST=true
|
||||
|
||||
cache:
|
||||
directories:
|
||||
- $HOME/.composer/cache
|
||||
|
||||
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
|
||||
|
||||
# Set the encrypted GITHUB_TOKEN if it's available to raise the API limit.
|
||||
- if [ -n "$GITHUB_APITOKEN" ]; then composer config github-oauth.github.com $GITHUB_APITOKEN; fi
|
||||
|
||||
@@ -86,10 +69,6 @@ install:
|
||||
# Typically it should be able to use the Composer cache if any other job has already completed before we started here.
|
||||
- travis_retry composer install --prefer-dist --no-interaction
|
||||
|
||||
- echo "extension = memcache.so" >> ~/.phpenv/versions/$(phpenv version-name)/etc/php.ini
|
||||
- echo "extension = memcached.so" >> ~/.phpenv/versions/$(phpenv version-name)/etc/php.ini
|
||||
- echo "extension = mongo.so" >> ~/.phpenv/versions/$(phpenv version-name)/etc/php.ini
|
||||
|
||||
before_script:
|
||||
- >
|
||||
if [ "$INSTALL" = 'true' -o "$PHPUNIT" = 'true' ];
|
||||
@@ -144,9 +123,6 @@ before_script:
|
||||
sed -i \
|
||||
-e "/require_once/i \\\$CFG->phpunit_dataroot = '\/home\/travis\/roots\/phpunit';" \
|
||||
-e "/require_once/i \\\$CFG->phpunit_prefix = 'p_';" \
|
||||
-e "/require_once/i define('TEST_CACHESTORE_MEMCACHE_TESTSERVERS', '127.0.0.1:11211');" \
|
||||
-e "/require_once/i define('TEST_CACHESTORE_MEMCACHED_TESTSERVERS', '127.0.0.1:11211');" \
|
||||
-e "/require_once/i define('TEST_CACHESTORE_MONGODB_TESTSERVER', 'mongodb://localhost:27017');" \
|
||||
config.php ;
|
||||
|
||||
# Initialise PHPUnit for Moodle.
|
||||
@@ -191,14 +167,6 @@ script:
|
||||
export phpcmd=`which php`;
|
||||
fi
|
||||
|
||||
- >
|
||||
if [ "$CITEST" = "true" -a "$GIT_PREVIOUS_COMMIT" != "$UPSTREAM_FETCH_HEAD" ];
|
||||
then
|
||||
# This is a CI test, but it is based on an older weekly release.
|
||||
# Warn in a way that will fail the test.
|
||||
echo "Current commit is based on an older weekly release" && false;
|
||||
fi
|
||||
|
||||
# Actually run the CI Tests - do this outside of the main test to make output clearer.
|
||||
- >
|
||||
if [ "$CITEST" = 'true' ];
|
||||
|
||||
+25
-6
@@ -50,6 +50,17 @@ module.exports = function(grunt) {
|
||||
}
|
||||
)
|
||||
}
|
||||
},
|
||||
less: {
|
||||
bootstrapbase: {
|
||||
files: {
|
||||
"theme/bootstrapbase/style/moodle.css": "theme/bootstrapbase/less/moodle.less",
|
||||
"theme/bootstrapbase/style/editor.css": "theme/bootstrapbase/less/editor.less",
|
||||
},
|
||||
options: {
|
||||
compress: true
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
@@ -103,6 +114,10 @@ module.exports = function(grunt) {
|
||||
args.push('--lint-stderr');
|
||||
}
|
||||
|
||||
if (grunt.option('no-color')) {
|
||||
args.push('--color=false');
|
||||
}
|
||||
|
||||
var execShifter = function() {
|
||||
|
||||
shifter = exec("node", args, {
|
||||
@@ -208,13 +223,11 @@ module.exports = function(grunt) {
|
||||
grunt.task.run('shifter');
|
||||
// Are we in an AMD directory?
|
||||
} else if (path.basename(cwd) == 'amd') {
|
||||
grunt.task.run('jshint');
|
||||
grunt.task.run('uglify');
|
||||
grunt.task.run('amd');
|
||||
} else {
|
||||
// Run them all!.
|
||||
grunt.task.run('shifter');
|
||||
grunt.task.run('jshint');
|
||||
grunt.task.run('uglify');
|
||||
grunt.task.run('css');
|
||||
grunt.task.run('js');
|
||||
}
|
||||
};
|
||||
|
||||
@@ -222,9 +235,15 @@ module.exports = function(grunt) {
|
||||
// Register NPM tasks.
|
||||
grunt.loadNpmTasks('grunt-contrib-uglify');
|
||||
grunt.loadNpmTasks('grunt-contrib-jshint');
|
||||
grunt.loadNpmTasks('grunt-contrib-less');
|
||||
|
||||
// Register the shifter task.
|
||||
// Register JS tasks.
|
||||
grunt.registerTask('shifter', 'Run Shifter against the current directory', tasks.shifter);
|
||||
grunt.registerTask('amd', ['jshint', 'uglify']);
|
||||
grunt.registerTask('js', ['amd', 'shifter']);
|
||||
|
||||
// Register CSS taks.
|
||||
grunt.registerTask('css', ['less:bootstrapbase']);
|
||||
|
||||
// Register the startup task.
|
||||
grunt.registerTask('startup', 'Run the correct tasks for the current directory', tasks.startup);
|
||||
|
||||
@@ -1434,7 +1434,6 @@
|
||||
<VENDOR name="oracle" version="10.2" />
|
||||
</DATABASE>
|
||||
<PHP version="5.4.4" level="required">
|
||||
<RESTRICT function="restrict_php_version_7" message="unsupportedphpversion7" />
|
||||
</PHP>
|
||||
<PCREUNICODE level="optional">
|
||||
<FEEDBACK>
|
||||
|
||||
@@ -422,6 +422,12 @@ class core_role_define_role_table_advanced extends core_role_capability_table_wi
|
||||
} else {
|
||||
// Updating role.
|
||||
$DB->update_record('role', $this->role);
|
||||
|
||||
// This will ensure the course contacts cache is purged so name changes get updated in
|
||||
// the UI. It would be better to do this only when we know that fields affected are
|
||||
// updated. But thats getting into the weeds of the coursecat cache and role edits
|
||||
// should not be that frequent, so here is the ugly brutal approach.
|
||||
coursecat::role_assignment_changed($this->role->id, context_system::instance());
|
||||
}
|
||||
|
||||
// Assignable contexts.
|
||||
|
||||
@@ -424,9 +424,9 @@ Feature: Set up contextual data for tests
|
||||
And the following "grade categories" exist:
|
||||
| fullname | course |
|
||||
| Grade category 1 | C1 |
|
||||
And the following "grade items" exist:
|
||||
| itemname | course | outcome | gradecategory |
|
||||
| Test Outcome Grade Item 1 | C1 | OT1 | Grade category 1 |
|
||||
And the following "grade items" exist:
|
||||
| itemname | course | outcome | gradecategory |
|
||||
| Test Outcome Grade Item 1 | C1 | OT1 | Grade category 1 |
|
||||
And the following config values are set as admin:
|
||||
| enableoutcomes | 1 |
|
||||
When I log in as "admin"
|
||||
@@ -441,3 +441,15 @@ Feature: Set up contextual data for tests
|
||||
And I expand all fieldsets
|
||||
And "//div[contains(@class, 'fitem')]/div[contains(@class, 'fitemtitle')]/div[contains(@class, fstaticlabel) and contains(., 'Grade category')]/../../div[contains(@class, 'felement') and contains(., 'Grade category 1')]" "xpath_element" should exist
|
||||
And I press "Cancel"
|
||||
|
||||
Scenario: Add a block
|
||||
Given the following "courses" exist:
|
||||
| fullname | shortname |
|
||||
| Course 1 | C1 |
|
||||
And the following "blocks" exist:
|
||||
| blockname | contextlevel | reference | pagetypepattern | defaultregion |
|
||||
| online_users | Course | C1 | course-view-* | site-pre |
|
||||
When I log in as "admin"
|
||||
And I am on site homepage
|
||||
And I follow "Course 1"
|
||||
Then I should see "Online users"
|
||||
|
||||
@@ -54,5 +54,8 @@ function xmldb_tool_customlang_upgrade($oldversion) {
|
||||
// Moodle v2.9.0 release upgrade line.
|
||||
// Put any upgrade step following this.
|
||||
|
||||
// Moodle v3.0.0 release upgrade line.
|
||||
// Put any upgrade step following this.
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -52,5 +52,8 @@ function xmldb_tool_log_upgrade($oldversion) {
|
||||
// Moodle v2.9.0 release upgrade line.
|
||||
// Put any upgrade step following this.
|
||||
|
||||
// Moodle v3.0.0 release upgrade line.
|
||||
// Put any upgrade step following this.
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -42,5 +42,8 @@ function xmldb_logstore_database_upgrade($oldversion) {
|
||||
// Moodle v2.9.0 release upgrade line.
|
||||
// Put any upgrade step following this.
|
||||
|
||||
// Moodle v3.0.0 release upgrade line.
|
||||
// Put any upgrade step following this.
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -120,5 +120,8 @@ function xmldb_logstore_standard_upgrade($oldversion) {
|
||||
// Moodle v2.9.0 release upgrade line.
|
||||
// Put any upgrade step following this.
|
||||
|
||||
// Moodle v3.0.0 release upgrade line.
|
||||
// Put any upgrade step following this.
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -56,5 +56,8 @@ function xmldb_tool_monitor_upgrade($oldversion) {
|
||||
// Moodle v2.9.0 release upgrade line.
|
||||
// Put any upgrade step following this.
|
||||
|
||||
// Moodle v3.0.0 release upgrade line.
|
||||
// Put any upgrade step following this.
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -232,8 +232,8 @@ if ($formdata = $mform2->is_cancelled()) {
|
||||
if (isset($USER->$key) and is_array($USER->$key)) {
|
||||
// this must be some hacky field that is abusing arrays to store content and format
|
||||
$user->$key = array();
|
||||
$user->$key['text'] = $value;
|
||||
$user->$key['format'] = FORMAT_MOODLE;
|
||||
$user->{$key['text']} = $value;
|
||||
$user->{$key['format']} = FORMAT_MOODLE;
|
||||
} else {
|
||||
$user->$key = trim($value);
|
||||
}
|
||||
|
||||
+23
-1
@@ -1,4 +1,4 @@
|
||||
@core @core_admin @_file_upload
|
||||
@tool @tool_uploaduser @_file_upload
|
||||
Feature: Upload users
|
||||
In order to add users to the system
|
||||
As an admin
|
||||
@@ -39,3 +39,25 @@ Feature: Upload users
|
||||
And I follow "Groups"
|
||||
And I set the field "groups" to "Section 1 (1)"
|
||||
And the "members" select box should contain "Tom Jones"
|
||||
|
||||
@javascript
|
||||
Scenario: Upload users with custom profile fields
|
||||
# Create user profile field.
|
||||
Given I log in as "admin"
|
||||
And I navigate to "User profile fields" node in "Site administration > Users > Accounts"
|
||||
And I set the field "datatype" to "Text area"
|
||||
And I set the following fields to these values:
|
||||
| Short name | superfield |
|
||||
| Name | Super field |
|
||||
And I click on "Save changes" "button"
|
||||
# Upload users.
|
||||
When I navigate to "Upload users" node in "Site administration > Users > Accounts"
|
||||
And I upload "lib/tests/fixtures/upload_users_profile.csv" file to "File" filemanager
|
||||
And I press "Upload users"
|
||||
And I press "Upload users"
|
||||
# Check that users were created and the superfield is filled.
|
||||
And I navigate to "Browse list of users" node in "Site administration > Users > Accounts"
|
||||
And I follow "Tom Jones"
|
||||
And I should see "Super field"
|
||||
And I should see "The big guy"
|
||||
And I log out
|
||||
+8
-1
@@ -39,13 +39,20 @@ class auth_plugin_cas extends auth_plugin_ldap {
|
||||
/**
|
||||
* Constructor.
|
||||
*/
|
||||
function auth_plugin_cas() {
|
||||
public function __construct() {
|
||||
$this->authtype = 'cas';
|
||||
$this->roleauth = 'auth_cas';
|
||||
$this->errorlogtag = '[AUTH CAS] ';
|
||||
$this->init_plugin($this->authtype);
|
||||
}
|
||||
|
||||
/**
|
||||
* Old syntax of class constructor for backward compatibility.
|
||||
*/
|
||||
public function auth_plugin_cas() {
|
||||
self::__construct();
|
||||
}
|
||||
|
||||
function prevent_local_passwords() {
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -74,5 +74,8 @@ function xmldb_auth_cas_upgrade($oldversion) {
|
||||
// Moodle v2.9.0 release upgrade line.
|
||||
// Put any upgrade step following this.
|
||||
|
||||
// Moodle v3.0.0 release upgrade line.
|
||||
// Put any upgrade step following this.
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -309,7 +309,7 @@ class auth_db_testcase extends advanced_testcase {
|
||||
require_once($CFG->libdir.'/password_compat/lib/password.php');
|
||||
set_config('passtype', 'saltedcrypt', 'auth/db');
|
||||
$auth->config->passtype = 'saltedcrypt';
|
||||
$user3->pass = password_hash('heslo', PASSWORD_BCRYPT, array('salt' => 'best_salt_ever_moodle_rocks_dont_tell'));
|
||||
$user3->pass = password_hash('heslo', PASSWORD_BCRYPT);
|
||||
$DB->update_record('auth_db_users', $user3);
|
||||
$this->assertTrue($auth->user_login('u3', 'heslo'));
|
||||
|
||||
@@ -381,4 +381,22 @@ class auth_db_testcase extends advanced_testcase {
|
||||
|
||||
$this->cleanup_auth_database();
|
||||
}
|
||||
|
||||
/**
|
||||
* Testing the function _colonscope() from ADOdb.
|
||||
*/
|
||||
public function test_adodb_colonscope() {
|
||||
global $CFG;
|
||||
require_once($CFG->libdir.'/adodb/adodb.inc.php');
|
||||
require_once($CFG->libdir.'/adodb/drivers/adodb-odbc.inc.php');
|
||||
require_once($CFG->libdir.'/adodb/drivers/adodb-db2ora.inc.php');
|
||||
|
||||
$this->resetAfterTest(false);
|
||||
|
||||
$sql = "select * from table WHERE column=:1 AND anothercolumn > :0";
|
||||
$arr = array('b', 1);
|
||||
list($sqlout, $arrout) = _colonscope($sql,$arr);
|
||||
$this->assertEquals("select * from table WHERE column=? AND anothercolumn > ?", $sqlout);
|
||||
$this->assertEquals(array(1, 'b'), $arrout);
|
||||
}
|
||||
}
|
||||
|
||||
+8
-1
@@ -34,11 +34,18 @@ class auth_plugin_email extends auth_plugin_base {
|
||||
/**
|
||||
* Constructor.
|
||||
*/
|
||||
function auth_plugin_email() {
|
||||
public function __construct() {
|
||||
$this->authtype = 'email';
|
||||
$this->config = get_config('auth/email');
|
||||
}
|
||||
|
||||
/**
|
||||
* Old syntax of class constructor for backward compatibility.
|
||||
*/
|
||||
public function auth_plugin_email() {
|
||||
self::__construct();
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns true if the username and password work and false if they are
|
||||
* wrong or don't exist.
|
||||
|
||||
+8
-1
@@ -37,11 +37,18 @@ class auth_plugin_fc extends auth_plugin_base {
|
||||
/**
|
||||
* Constructor.
|
||||
*/
|
||||
function auth_plugin_fc() {
|
||||
public function __construct() {
|
||||
$this->authtype = 'fc';
|
||||
$this->config = get_config('auth/fc');
|
||||
}
|
||||
|
||||
/**
|
||||
* Old syntax of class constructor for backward compatibility.
|
||||
*/
|
||||
public function auth_plugin_fc() {
|
||||
self::__construct();
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns true if the username and password work and false if they are
|
||||
* wrong or don't exist.
|
||||
|
||||
+7
-1
@@ -30,7 +30,7 @@ class fcFPP
|
||||
var $_debug = FALSE; // set to true to see some debug info
|
||||
|
||||
// class constructor
|
||||
function fcFPP($host="localhost", $port="3333")
|
||||
public function __construct($host="localhost", $port="3333")
|
||||
{
|
||||
$this->_hostname = $host;
|
||||
$this->_port = $port;
|
||||
@@ -38,6 +38,12 @@ class fcFPP
|
||||
$this->_pwd = "";
|
||||
}
|
||||
|
||||
function fcFPP($host="localhost", $port="3333")
|
||||
{
|
||||
debugging('Use of class name as constructor is deprecated', DEBUG_DEVELOPER);
|
||||
self::__construct($host, $port);
|
||||
}
|
||||
|
||||
// open a connection to the FirstClass server
|
||||
function open()
|
||||
{
|
||||
|
||||
+8
-1
@@ -35,11 +35,18 @@ class auth_plugin_imap extends auth_plugin_base {
|
||||
/**
|
||||
* Constructor.
|
||||
*/
|
||||
function auth_plugin_imap() {
|
||||
public function __construct() {
|
||||
$this->authtype = 'imap';
|
||||
$this->config = get_config('auth/imap');
|
||||
}
|
||||
|
||||
/**
|
||||
* Old syntax of class constructor for backward compatibility.
|
||||
*/
|
||||
public function auth_plugin_imap() {
|
||||
self::__construct();
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns true if the username and password work and false if they are
|
||||
* wrong or don't exist.
|
||||
|
||||
+8
-1
@@ -143,13 +143,20 @@ class auth_plugin_ldap extends auth_plugin_base {
|
||||
/**
|
||||
* Constructor with initialisation.
|
||||
*/
|
||||
function auth_plugin_ldap() {
|
||||
public function __construct() {
|
||||
$this->authtype = 'ldap';
|
||||
$this->roleauth = 'auth_ldap';
|
||||
$this->errorlogtag = '[AUTH LDAP] ';
|
||||
$this->init_plugin($this->authtype);
|
||||
}
|
||||
|
||||
/**
|
||||
* Old syntax of class constructor for backward compatibility.
|
||||
*/
|
||||
public function auth_plugin_ldap() {
|
||||
self::__construct();
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns true if the username and password work and false if they are
|
||||
* wrong or don't exist.
|
||||
|
||||
@@ -64,5 +64,8 @@ function xmldb_auth_ldap_upgrade($oldversion) {
|
||||
// Moodle v2.9.0 release upgrade line.
|
||||
// Put any upgrade step following this.
|
||||
|
||||
// Moodle v3.0.0 release upgrade line.
|
||||
// Put any upgrade step following this.
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -46,13 +46,20 @@ class auth_plugin_manual extends auth_plugin_base {
|
||||
/**
|
||||
* Constructor.
|
||||
*/
|
||||
function auth_plugin_manual() {
|
||||
public function __construct() {
|
||||
$this->authtype = 'manual';
|
||||
$config = get_config(self::COMPONENT_NAME);
|
||||
$legacyconfig = get_config(self::LEGACY_COMPONENT_NAME);
|
||||
$this->config = (object)array_merge((array)$legacyconfig, (array)$config);
|
||||
}
|
||||
|
||||
/**
|
||||
* Old syntax of class constructor for backward compatibility.
|
||||
*/
|
||||
public function auth_plugin_manual() {
|
||||
self::__construct();
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns true if the username and password work and false if they are
|
||||
* wrong or don't exist. (Non-mnet accounts only!)
|
||||
|
||||
@@ -56,5 +56,8 @@ function xmldb_auth_manual_upgrade($oldversion) {
|
||||
// Moodle v2.9.0 release upgrade line.
|
||||
// Put any upgrade step following this.
|
||||
|
||||
// Moodle v3.0.0 release upgrade line.
|
||||
// Put any upgrade step following this.
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
+8
-1
@@ -35,12 +35,19 @@ class auth_plugin_mnet extends auth_plugin_base {
|
||||
/**
|
||||
* Constructor.
|
||||
*/
|
||||
function auth_plugin_mnet() {
|
||||
public function __construct() {
|
||||
$this->authtype = 'mnet';
|
||||
$this->config = get_config('auth_mnet');
|
||||
$this->mnet = get_mnet_environment();
|
||||
}
|
||||
|
||||
/**
|
||||
* Old syntax of class constructor for backward compatibility.
|
||||
*/
|
||||
public function auth_plugin_mnet() {
|
||||
self::__construct();
|
||||
}
|
||||
|
||||
/**
|
||||
* This function is normally used to determine if the username and password
|
||||
* are correct for local logins. Always returns false, as local users do not
|
||||
|
||||
@@ -56,5 +56,8 @@ function xmldb_auth_mnet_upgrade($oldversion) {
|
||||
// Moodle v2.9.0 release upgrade line.
|
||||
// Put any upgrade step following this.
|
||||
|
||||
// Moodle v3.0.0 release upgrade line.
|
||||
// Put any upgrade step following this.
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
+8
-1
@@ -35,11 +35,18 @@ class auth_plugin_nntp extends auth_plugin_base {
|
||||
/**
|
||||
* Constructor.
|
||||
*/
|
||||
function auth_plugin_nntp() {
|
||||
public function __construct() {
|
||||
$this->authtype = 'nntp';
|
||||
$this->config = get_config('auth/nntp');
|
||||
}
|
||||
|
||||
/**
|
||||
* Old syntax of class constructor for backward compatibility.
|
||||
*/
|
||||
public function auth_plugin_nntp() {
|
||||
self::__construct();
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns true if the username and password work and false if they are
|
||||
* wrong or don't exist.
|
||||
|
||||
@@ -35,10 +35,17 @@ class auth_plugin_nologin extends auth_plugin_base {
|
||||
/**
|
||||
* Constructor.
|
||||
*/
|
||||
function auth_plugin_nologin() {
|
||||
public function __construct() {
|
||||
$this->authtype = 'nologin';
|
||||
}
|
||||
|
||||
/**
|
||||
* Old syntax of class constructor for backward compatibility.
|
||||
*/
|
||||
public function auth_plugin_nologin() {
|
||||
self::__construct();
|
||||
}
|
||||
|
||||
/**
|
||||
* Do not allow any login.
|
||||
*
|
||||
|
||||
+8
-1
@@ -34,11 +34,18 @@ class auth_plugin_none extends auth_plugin_base {
|
||||
/**
|
||||
* Constructor.
|
||||
*/
|
||||
function auth_plugin_none() {
|
||||
public function __construct() {
|
||||
$this->authtype = 'none';
|
||||
$this->config = get_config('auth/none');
|
||||
}
|
||||
|
||||
/**
|
||||
* Old syntax of class constructor for backward compatibility.
|
||||
*/
|
||||
public function auth_plugin_none() {
|
||||
self::__construct();
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns true if the username and password work or don't exist and false
|
||||
* if the user exists and the password is wrong.
|
||||
|
||||
+8
-1
@@ -53,12 +53,19 @@ class auth_plugin_pam extends auth_plugin_base {
|
||||
/**
|
||||
* Constructor.
|
||||
*/
|
||||
function auth_plugin_pam() {
|
||||
public function __construct() {
|
||||
$this->authtype = 'pam';
|
||||
$this->config = get_config('auth/pam');
|
||||
$this->errormessage = '';
|
||||
}
|
||||
|
||||
/**
|
||||
* Old syntax of class constructor for backward compatibility.
|
||||
*/
|
||||
public function auth_plugin_pam() {
|
||||
self::__construct();
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns true if the username and password work and false if they are
|
||||
* wrong or don't exist.
|
||||
|
||||
+8
-1
@@ -35,11 +35,18 @@ class auth_plugin_pop3 extends auth_plugin_base {
|
||||
/**
|
||||
* Constructor.
|
||||
*/
|
||||
function auth_plugin_pop3() {
|
||||
public function __construct() {
|
||||
$this->authtype = 'pop3';
|
||||
$this->config = get_config('auth/pop3');
|
||||
}
|
||||
|
||||
/**
|
||||
* Old syntax of class constructor for backward compatibility.
|
||||
*/
|
||||
public function auth_plugin_pop3() {
|
||||
self::__construct();
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns true if the username and password work and false if they are
|
||||
* wrong or don't exist.
|
||||
|
||||
@@ -38,11 +38,18 @@ class auth_plugin_radius extends auth_plugin_base {
|
||||
/**
|
||||
* Constructor.
|
||||
*/
|
||||
function auth_plugin_radius() {
|
||||
public function __construct() {
|
||||
$this->authtype = 'radius';
|
||||
$this->config = get_config('auth/radius');
|
||||
}
|
||||
|
||||
/**
|
||||
* Old syntax of class constructor for backward compatibility.
|
||||
*/
|
||||
public function auth_plugin_radius() {
|
||||
self::__construct();
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns true if the username and password work and false if they are
|
||||
* wrong or don't exist.
|
||||
|
||||
@@ -38,11 +38,18 @@ class auth_plugin_shibboleth extends auth_plugin_base {
|
||||
/**
|
||||
* Constructor.
|
||||
*/
|
||||
function auth_plugin_shibboleth() {
|
||||
public function __construct() {
|
||||
$this->authtype = 'shibboleth';
|
||||
$this->config = get_config('auth/shibboleth');
|
||||
}
|
||||
|
||||
/**
|
||||
* Old syntax of class constructor for backward compatibility.
|
||||
*/
|
||||
public function auth_plugin_shibboleth() {
|
||||
self::__construct();
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns true if the username and password work and false if they are
|
||||
* wrong or don't exist.
|
||||
|
||||
@@ -35,11 +35,18 @@ class auth_plugin_webservice extends auth_plugin_base {
|
||||
/**
|
||||
* Constructor.
|
||||
*/
|
||||
function auth_plugin_webservice() {
|
||||
public function __construct() {
|
||||
$this->authtype = 'webservice';
|
||||
$this->config = get_config('auth/webservice');
|
||||
}
|
||||
|
||||
/**
|
||||
* Old syntax of class constructor for backward compatibility.
|
||||
*/
|
||||
public function auth_plugin_webservice() {
|
||||
self::__construct();
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns true if the username and password work and false if they are
|
||||
* wrong or don't exist.
|
||||
|
||||
@@ -18,13 +18,20 @@ class cssparser {
|
||||
private $css;
|
||||
private $html;
|
||||
|
||||
function cssparser($html = true) {
|
||||
public function __construct($html = true) {
|
||||
// Register "destructor"
|
||||
core_shutdown_manager::register_function(array(&$this, "finalize"));
|
||||
$this->html = ($html != false);
|
||||
$this->Clear();
|
||||
}
|
||||
|
||||
/**
|
||||
* Old syntax of class constructor. Deprecated in PHP7.
|
||||
*/
|
||||
public function cssparser($html = true) {
|
||||
self::__construct($html);
|
||||
}
|
||||
|
||||
function finalize() {
|
||||
unset($this->css);
|
||||
}
|
||||
@@ -258,4 +265,4 @@ class cssparser {
|
||||
}
|
||||
return $result;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -97,7 +97,10 @@ class restore_log_rule implements processable {
|
||||
return $this->module . '-' . $this->action;
|
||||
}
|
||||
|
||||
public function process($log) {
|
||||
public function process($inputlog) {
|
||||
|
||||
// There might be multiple rules that process this log, we can't alter it in the process of checking it.
|
||||
$log = clone($inputlog);
|
||||
|
||||
// Reset the allpairs array
|
||||
$this->allpairs = array();
|
||||
|
||||
@@ -89,11 +89,12 @@ class restore_logs_processor {
|
||||
}
|
||||
// Arrived here log is empty, no rule was able to perform the conversion, log the problem
|
||||
if (empty($newlog)) {
|
||||
self::$task->log('Log module-action "' . $keyname . '" process problem. Not restored', backup::LOG_DEBUG);
|
||||
self::$task->log('Log module-action "' . $keyname . '" process problem. Not restored. ' .
|
||||
json_encode($log), backup::LOG_DEBUG);
|
||||
}
|
||||
|
||||
} else { // Action not found log the problem
|
||||
self::$task->log('Log module-action "' . $keyname . '" unknown. Not restored', backup::LOG_DEBUG);
|
||||
self::$task->log('Log module-action "' . $keyname . '" unknown. Not restored. '.json_encode($log), backup::LOG_DEBUG);
|
||||
$newlog = false;
|
||||
|
||||
}
|
||||
|
||||
@@ -0,0 +1,52 @@
|
||||
<?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/>.
|
||||
|
||||
/**
|
||||
* @package core_backup
|
||||
* @category test
|
||||
* @copyright 2015 onwards Eloy Lafuente (stronk7) {@link http://stronk7.com}
|
||||
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
|
||||
*/
|
||||
|
||||
defined('MOODLE_INTERNAL') || die();
|
||||
|
||||
// Include all the needed stuff
|
||||
global $CFG;
|
||||
require_once($CFG->dirroot . '/backup/util/includes/restore_includes.php');
|
||||
|
||||
|
||||
class backup_restore_log_rule_testcase extends basic_testcase {
|
||||
|
||||
function test_process_keeps_log_unmodified() {
|
||||
|
||||
// Prepare a tiny log entry.
|
||||
$originallog = new stdClass();
|
||||
$originallog->url = 'original';
|
||||
$originallog->info = 'original';
|
||||
$log = clone($originallog);
|
||||
|
||||
// Process it with a tiny log rule, only modifying url and info.
|
||||
$lr = new restore_log_rule('test', 'test', 'changed', 'changed');
|
||||
$result = $lr->process($log);
|
||||
|
||||
// The log has been processed.
|
||||
$this->assertEquals('changed', $result->url);
|
||||
$this->assertEquals('changed', $result->info);
|
||||
|
||||
// But the original log has been kept unmodified by the process() call.
|
||||
$this->assertEquals($originallog, $log);
|
||||
}
|
||||
}
|
||||
@@ -183,6 +183,10 @@ abstract class backup_structure_step extends backup_step {
|
||||
* @return void
|
||||
*/
|
||||
protected function add_subplugin_structure($subplugintype, $element, $multiple, $plugintype = null, $pluginname = null) {
|
||||
global $CFG;
|
||||
// This global declaration is required, because where we do require_once($backupfile);
|
||||
// That file may in turn try to do require_once($CFG->dirroot ...).
|
||||
// That worked in the past, we should keep it working.
|
||||
|
||||
// Verify if this is a BC call for an activity backup. See NOTE above for this special case.
|
||||
if ($plugintype === null and $pluginname === null) {
|
||||
|
||||
@@ -313,6 +313,10 @@ abstract class restore_structure_step extends restore_step {
|
||||
* @return void
|
||||
*/
|
||||
protected function add_subplugin_structure($subplugintype, $element, $plugintype = null, $pluginname = null) {
|
||||
global $CFG;
|
||||
// This global declaration is required, because where we do require_once($backupfile);
|
||||
// That file may in turn try to do require_once($CFG->dirroot ...).
|
||||
// That worked in the past, we should keep it working.
|
||||
|
||||
// Verify if this is a BC call for an activity restore. See NOTE above for this special case.
|
||||
if ($plugintype === null and $pluginname === null) {
|
||||
|
||||
@@ -126,6 +126,9 @@ class backp_settings_testcase extends basic_testcase {
|
||||
} catch (exception $e) {
|
||||
$this->assertTrue($e instanceof base_setting_exception);
|
||||
$this->assertEquals($e->errorcode, 'incorrect_object_passed');
|
||||
} catch (TypeError $e) {
|
||||
// On PHP7+ we get a TypeError raised, lets check we've the right error.
|
||||
$this->assertRegexp('/must be an instance of backup_setting_ui/', $e->getMessage());
|
||||
}
|
||||
restore_error_handler();
|
||||
|
||||
@@ -140,6 +143,9 @@ class backp_settings_testcase extends basic_testcase {
|
||||
} catch (exception $e) {
|
||||
$this->assertTrue($e instanceof base_setting_exception);
|
||||
$this->assertEquals($e->errorcode, 'incorrect_object_passed');
|
||||
} catch (TypeError $e) {
|
||||
// On PHP7+ we get a TypeError raised, lets check we've the right error.
|
||||
$this->assertRegexp('/must be an instance of backup_setting_ui/', $e->getMessage());
|
||||
}
|
||||
restore_error_handler();
|
||||
|
||||
@@ -302,6 +308,9 @@ class backp_settings_testcase extends basic_testcase {
|
||||
} catch (exception $e) {
|
||||
$this->assertTrue($e instanceof backup_setting_exception);
|
||||
$this->assertEquals($e->errorcode, 'incorrect_object_passed');
|
||||
} catch (TypeError $e) {
|
||||
// On PHP7+ we get a TypeError raised, lets check we've the right error.
|
||||
$this->assertRegexp('/must be an instance of base_setting/', $e->getMessage());
|
||||
}
|
||||
restore_error_handler();
|
||||
|
||||
|
||||
@@ -28,6 +28,7 @@ defined('MOODLE_INTERNAL') || die();
|
||||
|
||||
global $CFG;
|
||||
require_once($CFG->libdir . '/badgeslib.php');
|
||||
require_once($CFG->dirroot . '/badges/lib.php');
|
||||
|
||||
class core_badges_badgeslib_testcase extends advanced_testcase {
|
||||
protected $badgeid;
|
||||
@@ -472,4 +473,69 @@ class core_badges_badgeslib_testcase extends advanced_testcase {
|
||||
$this->assertStringMatchesFormat($testassertion->class, json_encode($assertion->get_badge_class()));
|
||||
$this->assertStringMatchesFormat($testassertion->issuer, json_encode($assertion->get_issuer()));
|
||||
}
|
||||
|
||||
/**
|
||||
* Tests the core_badges_myprofile_navigation() function.
|
||||
*/
|
||||
public function test_core_badges_myprofile_navigation() {
|
||||
// Set up the test.
|
||||
$tree = new \core_user\output\myprofile\tree();
|
||||
$this->setAdminUser();
|
||||
$badge = new badge($this->badgeid);
|
||||
$badge->issue($this->user->id, true);
|
||||
$iscurrentuser = true;
|
||||
$course = null;
|
||||
|
||||
// Enable badges.
|
||||
set_config('enablebadges', true);
|
||||
|
||||
// Check the node tree is correct.
|
||||
core_badges_myprofile_navigation($tree, $this->user, $iscurrentuser, $course);
|
||||
$reflector = new ReflectionObject($tree);
|
||||
$nodes = $reflector->getProperty('nodes');
|
||||
$nodes->setAccessible(true);
|
||||
$this->assertArrayHasKey('localbadges', $nodes->getValue($tree));
|
||||
}
|
||||
|
||||
/**
|
||||
* Tests the core_badges_myprofile_navigation() function with badges disabled..
|
||||
*/
|
||||
public function test_core_badges_myprofile_navigation_badges_disabled() {
|
||||
// Set up the test.
|
||||
$tree = new \core_user\output\myprofile\tree();
|
||||
$this->setAdminUser();
|
||||
$badge = new badge($this->badgeid);
|
||||
$badge->issue($this->user->id, true);
|
||||
$iscurrentuser = false;
|
||||
$course = null;
|
||||
|
||||
// Disable badges.
|
||||
set_config('enablebadges', false);
|
||||
|
||||
// Check the node tree is correct.
|
||||
core_badges_myprofile_navigation($tree, $this->user, $iscurrentuser, $course);
|
||||
$reflector = new ReflectionObject($tree);
|
||||
$nodes = $reflector->getProperty('nodes');
|
||||
$nodes->setAccessible(true);
|
||||
$this->assertArrayNotHasKey('localbadges', $nodes->getValue($tree));
|
||||
}
|
||||
|
||||
/**
|
||||
* Tests the core_badges_myprofile_navigation() function with a course badge.
|
||||
*/
|
||||
public function test_core_badges_myprofile_navigation_with_course_badge() {
|
||||
// Set up the test.
|
||||
$tree = new \core_user\output\myprofile\tree();
|
||||
$this->setAdminUser();
|
||||
$badge = new badge($this->coursebadge);
|
||||
$badge->issue($this->user->id, true);
|
||||
$iscurrentuser = false;
|
||||
|
||||
// Check the node tree is correct.
|
||||
core_badges_myprofile_navigation($tree, $this->user, $iscurrentuser, $this->course);
|
||||
$reflector = new ReflectionObject($tree);
|
||||
$nodes = $reflector->getProperty('nodes');
|
||||
$nodes->setAccessible(true);
|
||||
$this->assertArrayHasKey('localbadges', $nodes->getValue($tree));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,111 @@
|
||||
@block @block_activity_results
|
||||
Feature: The activity results block displays student scores as scales
|
||||
In order to be display student scores as scales
|
||||
As a user
|
||||
I need to see the activity results block
|
||||
|
||||
Background:
|
||||
Given the following "users" exist:
|
||||
| username | firstname | lastname | email | idnumber |
|
||||
| teacher1 | Teacher | 1 | teacher1@example.com | T1 |
|
||||
| student1 | Student | 1 | student1@example.com | S1 |
|
||||
| student2 | Student | 2 | student2@example.com | S2 |
|
||||
| student3 | Student | 3 | student3@example.com | S3 |
|
||||
| student4 | Student | 4 | student4@example.com | S4 |
|
||||
| student5 | Student | 5 | student5@example.com | S5 |
|
||||
And the following "courses" exist:
|
||||
| fullname | shortname | category |
|
||||
| Course 1 | C1 | 0 |
|
||||
And the following "course enrolments" exist:
|
||||
| user | course | role |
|
||||
| teacher1 | C1 | editingteacher |
|
||||
| student1 | C1 | student |
|
||||
| student2 | C1 | student |
|
||||
| student3 | C1 | student |
|
||||
| student4 | C1 | student |
|
||||
| student5 | C1 | student |
|
||||
And I log in as "teacher1"
|
||||
And I follow "Course 1"
|
||||
And I navigate to "Grades" node in "Course administration"
|
||||
And I navigate to "Scales" node in "Grade administration"
|
||||
And I press "Add a new scale"
|
||||
And I set the following fields to these values:
|
||||
| Name | My Scale |
|
||||
| Scale | Disappointing, Not good enough, Average, Good, Very good, Excellent! |
|
||||
And I press "Save changes"
|
||||
And I follow "Course 1"
|
||||
And I turn editing mode on
|
||||
And I add a "Assignment" to section "1" and I fill the form with:
|
||||
| Assignment name | Test assignment |
|
||||
| Description | Offline text |
|
||||
| assignsubmission_file_enabled | 0 |
|
||||
| id_modgrade_type | Scale |
|
||||
| id_modgrade_scale | My Scale |
|
||||
And I follow "Course 1"
|
||||
And I navigate to "Grades" node in "Course administration"
|
||||
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"
|
||||
And I give the grade "Good" to the user "Student 3" for the grade item "Test assignment"
|
||||
And I give the grade "Average" to the user "Student 4" for the grade item "Test assignment"
|
||||
And I give the grade "Not good enough" to the user "Student 5" for the grade item "Test assignment"
|
||||
And I press "Save changes"
|
||||
And I follow "Course 1"
|
||||
|
||||
Scenario: Configure the block on the course page to show 1 high score
|
||||
Given I add the "Activity results" block
|
||||
When I configure the "Activity results" block
|
||||
And I set the following fields to these values:
|
||||
| id_config_showbest | 1 |
|
||||
| id_config_showworst | 0 |
|
||||
| id_config_nameformat | Display full names |
|
||||
| id_config_decimalpoints | 0 |
|
||||
And I press "Save changes"
|
||||
Then I should see "Student 1" in the "Activity results" "block"
|
||||
And I should see "Excellent!" in the "Activity results" "block"
|
||||
|
||||
Scenario: Try to configure the block on the course page to show multiple high scores using full names
|
||||
Given I add the "Activity results" block
|
||||
When I configure the "Activity results" block
|
||||
And I set the following fields to these values:
|
||||
| id_config_showbest | 3 |
|
||||
| id_config_showworst | 0 |
|
||||
| id_config_nameformat | Display full names |
|
||||
And I press "Save changes"
|
||||
Then I should see "Student 1" in the "Activity results" "block"
|
||||
And I should see "Excellent!" in the "Activity results" "block"
|
||||
And I should see "Student 2" in the "Activity results" "block"
|
||||
And I should see "Very good" in the "Activity results" "block"
|
||||
And I should see "Student 3" in the "Activity results" "block"
|
||||
And I should see "Good" in the "Activity results" "block"
|
||||
|
||||
Scenario: Try to configure the block on the course page to show multiple high scores using ID numbers
|
||||
Given I add the "Activity results" block
|
||||
When I configure the "Activity results" block
|
||||
And I set the following fields to these values:
|
||||
| id_config_showbest | 3 |
|
||||
| id_config_showworst | 0 |
|
||||
| id_config_nameformat | Display only ID numbers |
|
||||
And I press "Save changes"
|
||||
Then I should see "User S1" in the "Activity results" "block"
|
||||
And I should see "Excellent!" in the "Activity results" "block"
|
||||
And I should see "User S2" in the "Activity results" "block"
|
||||
And I should see "Very good" in the "Activity results" "block"
|
||||
And I should see "User S3" in the "Activity results" "block"
|
||||
And I should see "Good" in the "Activity results" "block"
|
||||
|
||||
Scenario: Try to configure the block on the course page to show multiple high scores using anonymous names
|
||||
Given I add the "Activity results" block
|
||||
When I configure the "Activity results" block
|
||||
And I set the following fields to these values:
|
||||
| id_config_showbest | 3 |
|
||||
| id_config_showworst | 0 |
|
||||
| id_config_nameformat | Anonymous results |
|
||||
And I press "Save changes"
|
||||
Then I should see "User" in the "Activity results" "block"
|
||||
And I should not see "Student 1" in the "Activity results" "block"
|
||||
And I should see "Excellent!" in the "Activity results" "block"
|
||||
And I should not see "Student 2" in the "Activity results" "block"
|
||||
And I should see "Very good" in the "Activity results" "block"
|
||||
And I should not see "Student 3" in the "Activity results" "block"
|
||||
And I should see "Good" in the "Activity results" "block"
|
||||
@@ -0,0 +1,153 @@
|
||||
@block @block_activity_results
|
||||
Feature: The activity results block displays student scores as scales
|
||||
In order to be display student scores as scales
|
||||
As a user
|
||||
I need to see the activity results block
|
||||
|
||||
Background:
|
||||
Given the following "users" exist:
|
||||
| username | firstname | lastname | email | idnumber |
|
||||
| teacher1 | Teacher | 1 | teacher1@example.com | T1 |
|
||||
| student1 | Student | 1 | student1@example.com | S1 |
|
||||
| student2 | Student | 2 | student2@example.com | S2 |
|
||||
| student3 | Student | 3 | student3@example.com | S3 |
|
||||
| student4 | Student | 4 | student4@example.com | S4 |
|
||||
| student5 | Student | 5 | student5@example.com | S5 |
|
||||
| student6 | Student | 6 | student6@example.com | S6 |
|
||||
And the following "courses" exist:
|
||||
| fullname | shortname | category |
|
||||
| Course 1 | C1 | 0 |
|
||||
And the following "groups" exist:
|
||||
| name | course | idnumber |
|
||||
| Group 1 | C1 | G1 |
|
||||
| Group 2 | C1 | G2 |
|
||||
| Group 3 | C1 | G3 |
|
||||
| Group 4 | C1 | G4 |
|
||||
| Group 5 | C1 | G5 |
|
||||
And the following "course enrolments" exist:
|
||||
| user | course | role |
|
||||
| teacher1 | C1 | editingteacher |
|
||||
| student1 | C1 | student |
|
||||
| student2 | C1 | student |
|
||||
| student3 | C1 | student |
|
||||
| student4 | C1 | student |
|
||||
| student5 | C1 | student |
|
||||
| student6 | C1 | student |
|
||||
And the following "group members" exist:
|
||||
| user | group |
|
||||
| student1 | G1 |
|
||||
| student2 | G1 |
|
||||
| student3 | G2 |
|
||||
| student4 | G2 |
|
||||
| student5 | G3 |
|
||||
| student6 | G3 |
|
||||
And I log in as "teacher1"
|
||||
And I follow "Course 1"
|
||||
And I navigate to "Grades" node in "Course administration"
|
||||
And I navigate to "Scales" node in "Grade administration"
|
||||
And I press "Add a new scale"
|
||||
And I set the following fields to these values:
|
||||
| Name | My Scale |
|
||||
| Scale | Disappointing, Not good enough, Average, Good, Very good, Excellent! |
|
||||
And I press "Save changes"
|
||||
And I follow "Course 1"
|
||||
And I turn editing mode on
|
||||
And I add a "Assignment" to section "1" and I fill the form with:
|
||||
| Assignment name | Test assignment |
|
||||
| Description | Offline text |
|
||||
| assignsubmission_file_enabled | 0 |
|
||||
| id_modgrade_type | Scale |
|
||||
| id_modgrade_scale | My Scale |
|
||||
| Group mode | Separate groups |
|
||||
And I follow "Course 1"
|
||||
And I navigate to "Grades" node in "Course administration"
|
||||
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"
|
||||
And I give the grade "Very good" to the user "Student 3" for the grade item "Test assignment"
|
||||
And I give the grade "Good" to the user "Student 4" for the grade item "Test assignment"
|
||||
And I give the grade "Good" to the user "Student 5" for the grade item "Test assignment"
|
||||
And I give the grade "Average" to the user "Student 6" for the grade item "Test assignment"
|
||||
And I press "Save changes"
|
||||
And I follow "Course 1"
|
||||
|
||||
Scenario: Try to configure the block on the course page to show 1 high score
|
||||
Given I add the "Activity results" block
|
||||
When I configure the "Activity results" block
|
||||
And I set the following fields to these values:
|
||||
| id_config_showbest | 1 |
|
||||
| id_config_showworst | 0 |
|
||||
| id_config_nameformat | Display full names |
|
||||
| id_config_usegroups | Yes |
|
||||
And I press "Save changes"
|
||||
Then I should see "Group 1" in the "Activity results" "block"
|
||||
And I should see "Excellent!" in the "Activity results" "block"
|
||||
And I log out
|
||||
And I log in as "student1"
|
||||
And I follow "Course 1"
|
||||
And I should see "Student 1" in the "Activity results" "block"
|
||||
And I should see "Excellent!" in the "Activity results" "block"
|
||||
|
||||
Scenario: Try to configure the block on the course page to show multiple high scores using full names
|
||||
Given I add the "Activity results" block
|
||||
When I configure the "Activity results" block
|
||||
And I set the following fields to these values:
|
||||
| id_config_showbest | 3 |
|
||||
| id_config_showworst | 0 |
|
||||
| id_config_nameformat | Display full names |
|
||||
| id_config_usegroups | Yes |
|
||||
And I press "Save changes"
|
||||
Then I should see "Group 1" in the "Activity results" "block"
|
||||
And I should see "Excellent!" in the "Activity results" "block"
|
||||
And I should see "Group 2" in the "Activity results" "block"
|
||||
And I should see "Very good" in the "Activity results" "block"
|
||||
And I should see "Group 3" in the "Activity results" "block"
|
||||
And I should see "Good" in the "Activity results" "block"
|
||||
And I log out
|
||||
And I log in as "student3"
|
||||
And I follow "Course 1"
|
||||
And I should see "Student 3" in the "Activity results" "block"
|
||||
And I should see "Very good" in the "Activity results" "block"
|
||||
And I should see "Student 4" in the "Activity results" "block"
|
||||
And I should see "Good" in the "Activity results" "block"
|
||||
|
||||
Scenario: Try to configure the block on the course page to show multiple high scores using ID numbers
|
||||
Given I add the "Activity results" block
|
||||
When I configure the "Activity results" block
|
||||
And I set the following fields to these values:
|
||||
| id_config_showbest | 3 |
|
||||
| id_config_showworst | 0 |
|
||||
| id_config_nameformat | Display only ID numbers |
|
||||
| id_config_usegroups | Yes |
|
||||
And I press "Save changes"
|
||||
Then I should see "Group" in the "Activity results" "block"
|
||||
And I should see "Excellent!" in the "Activity results" "block"
|
||||
And I should see "Very good" in the "Activity results" "block"
|
||||
And I should see "Good" in the "Activity results" "block"
|
||||
And I log out
|
||||
And I log in as "student1"
|
||||
And I follow "Course 1"
|
||||
And I should see "User S1" in the "Activity results" "block"
|
||||
And I should see "Excellent!" in the "Activity results" "block"
|
||||
And I should see "User S2" in the "Activity results" "block"
|
||||
And I should see "Very good" in the "Activity results" "block"
|
||||
|
||||
Scenario: Try to configure the block on the course page to show multiple high scores using anonymous names
|
||||
Given I add the "Activity results" block
|
||||
When I configure the "Activity results" block
|
||||
And I set the following fields to these values:
|
||||
| id_config_showbest | 3 |
|
||||
| id_config_showworst | 0 |
|
||||
| id_config_nameformat | Anonymous results |
|
||||
| id_config_usegroups | Yes |
|
||||
And I press "Save changes"
|
||||
Then I should see "Group" in the "Activity results" "block"
|
||||
And I should see "Excellent!" in the "Activity results" "block"
|
||||
And I should see "Very good" in the "Activity results" "block"
|
||||
And I should see "Good" in the "Activity results" "block"
|
||||
And I log out
|
||||
And I log in as "student1"
|
||||
And I follow "Course 1"
|
||||
And I should see "User" in the "Activity results" "block"
|
||||
And I should see "Excellent!" in the "Activity results" "block"
|
||||
And I should see "Very good" in the "Activity results" "block"
|
||||
@@ -33,19 +33,15 @@ Feature: The activity results block displays student scores
|
||||
| student4 | C1 | student |
|
||||
| student5 | C1 | student |
|
||||
| student6 | C1 | student |
|
||||
|
||||
@javascript
|
||||
Scenario: Configure the block on the course page to show 1 high score
|
||||
Given I log in as "teacher1"
|
||||
And I follow "Course 1"
|
||||
And I expand "Users" node
|
||||
And I follow "Groups"
|
||||
And I add "Student 1 (student1@example.com)" user to "Group 1" group members
|
||||
And I add "Student 2 (student2@example.com)" user to "Group 1" group members
|
||||
And I add "Student 3 (student3@example.com)" user to "Group 2" group members
|
||||
And I add "Student 4 (student4@example.com)" user to "Group 2" group members
|
||||
And I add "Student 5 (student5@example.com)" user to "Group 3" group members
|
||||
And I add "Student 6 (student6@example.com)" user to "Group 3" group members
|
||||
And the following "group members" exist:
|
||||
| user | group |
|
||||
| student1 | G1 |
|
||||
| student2 | G1 |
|
||||
| student3 | G2 |
|
||||
| student4 | G2 |
|
||||
| student5 | G3 |
|
||||
| student6 | G3 |
|
||||
And I log in as "teacher1"
|
||||
And I follow "Course 1"
|
||||
And I turn editing mode on
|
||||
And I add a "Assignment" to section "1" and I fill the form with:
|
||||
@@ -64,7 +60,9 @@ Feature: The activity results block displays student scores
|
||||
And I give the grade "70.00" to the user "Student 6" for the grade item "Test assignment"
|
||||
And I press "Save changes"
|
||||
And I follow "Course 1"
|
||||
And I add the "Activity results" block
|
||||
|
||||
Scenario: Configure the block on the course page to show 1 high score
|
||||
Given I add the "Activity results" block
|
||||
When I configure the "Activity results" block
|
||||
And I set the following fields to these values:
|
||||
| id_config_showbest | 1 |
|
||||
@@ -77,37 +75,8 @@ Feature: The activity results block displays student scores
|
||||
Then I should see "Group 1" in the "Activity results" "block"
|
||||
And I should see "95%" in the "Activity results" "block"
|
||||
|
||||
@javascript
|
||||
Scenario: Try to configure the block on the course page to show 1 high score as a fraction
|
||||
Given I log in as "teacher1"
|
||||
And I follow "Course 1"
|
||||
And I expand "Users" node
|
||||
And I follow "Groups"
|
||||
And I add "Student 1 (student1@example.com)" user to "Group 1" group members
|
||||
And I add "Student 2 (student2@example.com)" user to "Group 1" group members
|
||||
And I add "Student 3 (student3@example.com)" user to "Group 2" group members
|
||||
And I add "Student 4 (student4@example.com)" user to "Group 2" group members
|
||||
And I add "Student 5 (student5@example.com)" user to "Group 3" group members
|
||||
And I add "Student 6 (student6@example.com)" user to "Group 3" group members
|
||||
And I follow "Course 1"
|
||||
And I turn editing mode on
|
||||
And I add a "Assignment" to section "1" and I fill the form with:
|
||||
| Assignment name | Test assignment |
|
||||
| Description | Offline text |
|
||||
| assignsubmission_file_enabled | 0 |
|
||||
| Group mode | Separate groups |
|
||||
And I follow "Course 1"
|
||||
And I navigate to "Grades" node in "Course administration"
|
||||
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"
|
||||
And I give the grade "90.00" to the user "Student 3" for the grade item "Test assignment"
|
||||
And I give the grade "80.00" to the user "Student 4" for the grade item "Test assignment"
|
||||
And I give the grade "80.00" to the user "Student 5" for the grade item "Test assignment"
|
||||
And I give the grade "70.00" to the user "Student 6" for the grade item "Test assignment"
|
||||
And I press "Save changes"
|
||||
And I follow "Course 1"
|
||||
And I add the "Activity results" block
|
||||
Given I add the "Activity results" block
|
||||
When I configure the "Activity results" block
|
||||
And I set the following fields to these values:
|
||||
| id_config_showbest | 1 |
|
||||
@@ -124,37 +93,8 @@ Feature: The activity results block displays student scores
|
||||
And I should see "Student 1" in the "Activity results" "block"
|
||||
And I should see "100.00/100.00" in the "Activity results" "block"
|
||||
|
||||
@javascript
|
||||
Scenario: Try to configure the block on the course page to show 1 high score as a absolute numbers
|
||||
Given I log in as "teacher1"
|
||||
And I follow "Course 1"
|
||||
And I expand "Users" node
|
||||
And I follow "Groups"
|
||||
And I add "Student 1 (student1@example.com)" user to "Group 1" group members
|
||||
And I add "Student 2 (student2@example.com)" user to "Group 1" group members
|
||||
And I add "Student 3 (student3@example.com)" user to "Group 2" group members
|
||||
And I add "Student 4 (student4@example.com)" user to "Group 2" group members
|
||||
And I add "Student 5 (student5@example.com)" user to "Group 3" group members
|
||||
And I add "Student 6 (student6@example.com)" user to "Group 3" group members
|
||||
And I follow "Course 1"
|
||||
And I turn editing mode on
|
||||
And I add a "Assignment" to section "1" and I fill the form with:
|
||||
| Assignment name | Test assignment |
|
||||
| Description | Offline text |
|
||||
| assignsubmission_file_enabled | 0 |
|
||||
| Group mode | Separate groups |
|
||||
And I follow "Course 1"
|
||||
And I navigate to "Grades" node in "Course administration"
|
||||
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"
|
||||
And I give the grade "90.00" to the user "Student 3" for the grade item "Test assignment"
|
||||
And I give the grade "80.00" to the user "Student 4" for the grade item "Test assignment"
|
||||
And I give the grade "80.00" to the user "Student 5" for the grade item "Test assignment"
|
||||
And I give the grade "70.00" to the user "Student 6" for the grade item "Test assignment"
|
||||
And I press "Save changes"
|
||||
And I follow "Course 1"
|
||||
And I add the "Activity results" block
|
||||
Given I add the "Activity results" block
|
||||
When I configure the "Activity results" block
|
||||
And I set the following fields to these values:
|
||||
| id_config_showbest | 1 |
|
||||
@@ -171,37 +111,8 @@ Feature: The activity results block displays student scores
|
||||
And I should see "Student 1" in the "Activity results" "block"
|
||||
And I should see "100.00" in the "Activity results" "block"
|
||||
|
||||
@javascript
|
||||
Scenario: Try to configure the block on the course page to show multiple high scores as percentages
|
||||
Given I log in as "teacher1"
|
||||
And I follow "Course 1"
|
||||
And I expand "Users" node
|
||||
And I follow "Groups"
|
||||
And I add "Student 1 (student1@example.com)" user to "Group 1" group members
|
||||
And I add "Student 2 (student2@example.com)" user to "Group 1" group members
|
||||
And I add "Student 3 (student3@example.com)" user to "Group 2" group members
|
||||
And I add "Student 4 (student4@example.com)" user to "Group 2" group members
|
||||
And I add "Student 5 (student5@example.com)" user to "Group 3" group members
|
||||
And I add "Student 6 (student6@example.com)" user to "Group 3" group members
|
||||
And I follow "Course 1"
|
||||
And I turn editing mode on
|
||||
And I add a "Assignment" to section "1" and I fill the form with:
|
||||
| Assignment name | Test assignment |
|
||||
| Description | Offline text |
|
||||
| assignsubmission_file_enabled | 0 |
|
||||
| Group mode | Separate groups |
|
||||
And I follow "Course 1"
|
||||
And I navigate to "Grades" node in "Course administration"
|
||||
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"
|
||||
And I give the grade "90.00" to the user "Student 3" for the grade item "Test assignment"
|
||||
And I give the grade "80.00" to the user "Student 4" for the grade item "Test assignment"
|
||||
And I give the grade "80.00" to the user "Student 5" for the grade item "Test assignment"
|
||||
And I give the grade "70.00" to the user "Student 6" for the grade item "Test assignment"
|
||||
And I press "Save changes"
|
||||
And I follow "Course 1"
|
||||
And I add the "Activity results" block
|
||||
Given I add the "Activity results" block
|
||||
When I configure the "Activity results" block
|
||||
And I set the following fields to these values:
|
||||
| id_config_showbest | 3 |
|
||||
@@ -225,37 +136,8 @@ Feature: The activity results block displays student scores
|
||||
And I should see "Student 2" in the "Activity results" "block"
|
||||
And I should see "90%" in the "Activity results" "block"
|
||||
|
||||
@javascript
|
||||
Scenario: Try to configure the block on the course page to show multiple high scores as fractions
|
||||
Given I log in as "teacher1"
|
||||
And I follow "Course 1"
|
||||
And I expand "Users" node
|
||||
And I follow "Groups"
|
||||
And I add "Student 1 (student1@example.com)" user to "Group 1" group members
|
||||
And I add "Student 2 (student2@example.com)" user to "Group 1" group members
|
||||
And I add "Student 3 (student3@example.com)" user to "Group 2" group members
|
||||
And I add "Student 4 (student4@example.com)" user to "Group 2" group members
|
||||
And I add "Student 5 (student5@example.com)" user to "Group 3" group members
|
||||
And I add "Student 6 (student6@example.com)" user to "Group 3" group members
|
||||
And I follow "Course 1"
|
||||
And I turn editing mode on
|
||||
And I add a "Assignment" to section "1" and I fill the form with:
|
||||
| Assignment name | Test assignment |
|
||||
| Description | Offline text |
|
||||
| assignsubmission_file_enabled | 0 |
|
||||
| Group mode | Separate groups |
|
||||
And I follow "Course 1"
|
||||
And I navigate to "Grades" node in "Course administration"
|
||||
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"
|
||||
And I give the grade "90.00" to the user "Student 3" for the grade item "Test assignment"
|
||||
And I give the grade "80.00" to the user "Student 4" for the grade item "Test assignment"
|
||||
And I give the grade "80.00" to the user "Student 5" for the grade item "Test assignment"
|
||||
And I give the grade "70.00" to the user "Student 6" for the grade item "Test assignment"
|
||||
And I press "Save changes"
|
||||
And I follow "Course 1"
|
||||
And I add the "Activity results" block
|
||||
Given I add the "Activity results" block
|
||||
When I configure the "Activity results" block
|
||||
And I set the following fields to these values:
|
||||
| id_config_showbest | 3 |
|
||||
@@ -278,37 +160,8 @@ Feature: The activity results block displays student scores
|
||||
And I should see "Student 4" in the "Activity results" "block"
|
||||
And I should see "80.00/100.00" in the "Activity results" "block"
|
||||
|
||||
@javascript
|
||||
Scenario: Try to configure the block on the course page to show multiple high scores as absolute numbers
|
||||
Given I log in as "teacher1"
|
||||
And I follow "Course 1"
|
||||
And I expand "Users" node
|
||||
And I follow "Groups"
|
||||
And I add "Student 1 (student1@example.com)" user to "Group 1" group members
|
||||
And I add "Student 2 (student2@example.com)" user to "Group 1" group members
|
||||
And I add "Student 3 (student3@example.com)" user to "Group 2" group members
|
||||
And I add "Student 4 (student4@example.com)" user to "Group 2" group members
|
||||
And I add "Student 5 (student5@example.com)" user to "Group 3" group members
|
||||
And I add "Student 6 (student6@example.com)" user to "Group 3" group members
|
||||
And I follow "Course 1"
|
||||
And I turn editing mode on
|
||||
And I add a "Assignment" to section "1" and I fill the form with:
|
||||
| Assignment name | Test assignment |
|
||||
| Description | Offline text |
|
||||
| assignsubmission_file_enabled | 0 |
|
||||
| Group mode | Separate groups |
|
||||
And I follow "Course 1"
|
||||
And I navigate to "Grades" node in "Course administration"
|
||||
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"
|
||||
And I give the grade "90.00" to the user "Student 3" for the grade item "Test assignment"
|
||||
And I give the grade "80.00" to the user "Student 4" for the grade item "Test assignment"
|
||||
And I give the grade "80.00" to the user "Student 5" for the grade item "Test assignment"
|
||||
And I give the grade "70.00" to the user "Student 6" for the grade item "Test assignment"
|
||||
And I press "Save changes"
|
||||
And I follow "Course 1"
|
||||
And I add the "Activity results" block
|
||||
Given I add the "Activity results" block
|
||||
When I configure the "Activity results" block
|
||||
And I set the following fields to these values:
|
||||
| id_config_showbest | 3 |
|
||||
@@ -331,37 +184,8 @@ Feature: The activity results block displays student scores
|
||||
And I should see "Student 2" in the "Activity results" "block"
|
||||
And I should see "90.00" in the "Activity results" "block"
|
||||
|
||||
@javascript
|
||||
Scenario: Try to configure the block on the course page to show multiple high scores using ID numbers
|
||||
Given I log in as "teacher1"
|
||||
And I follow "Course 1"
|
||||
And I expand "Users" node
|
||||
And I follow "Groups"
|
||||
And I add "Student 1 (student1@example.com)" user to "Group 1" group members
|
||||
And I add "Student 2 (student2@example.com)" user to "Group 1" group members
|
||||
And I add "Student 3 (student3@example.com)" user to "Group 2" group members
|
||||
And I add "Student 4 (student4@example.com)" user to "Group 2" group members
|
||||
And I add "Student 5 (student5@example.com)" user to "Group 3" group members
|
||||
And I add "Student 6 (student6@example.com)" user to "Group 3" group members
|
||||
And I follow "Course 1"
|
||||
And I turn editing mode on
|
||||
And I add a "Assignment" to section "1" and I fill the form with:
|
||||
| Assignment name | Test assignment |
|
||||
| Description | Offline text |
|
||||
| assignsubmission_file_enabled | 0 |
|
||||
| Group mode | Separate groups |
|
||||
And I follow "Course 1"
|
||||
And I navigate to "Grades" node in "Course administration"
|
||||
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"
|
||||
And I give the grade "90.00" to the user "Student 3" for the grade item "Test assignment"
|
||||
And I give the grade "80.00" to the user "Student 4" for the grade item "Test assignment"
|
||||
And I give the grade "80.00" to the user "Student 5" for the grade item "Test assignment"
|
||||
And I give the grade "70.00" to the user "Student 6" for the grade item "Test assignment"
|
||||
And I press "Save changes"
|
||||
And I follow "Course 1"
|
||||
And I add the "Activity results" block
|
||||
Given I add the "Activity results" block
|
||||
When I configure the "Activity results" block
|
||||
And I set the following fields to these values:
|
||||
| id_config_showbest | 3 |
|
||||
@@ -382,37 +206,8 @@ Feature: The activity results block displays student scores
|
||||
And I should see "User S2" in the "Activity results" "block"
|
||||
And I should see "90.00%" in the "Activity results" "block"
|
||||
|
||||
@javascript
|
||||
Scenario: Try to configure the block on the course page to show multiple high scores using anonymous names
|
||||
Given I log in as "teacher1"
|
||||
And I follow "Course 1"
|
||||
And I expand "Users" node
|
||||
And I follow "Groups"
|
||||
And I add "Student 1 (student1@example.com)" user to "Group 1" group members
|
||||
And I add "Student 2 (student2@example.com)" user to "Group 1" group members
|
||||
And I add "Student 3 (student3@example.com)" user to "Group 2" group members
|
||||
And I add "Student 4 (student4@example.com)" user to "Group 2" group members
|
||||
And I add "Student 5 (student5@example.com)" user to "Group 3" group members
|
||||
And I add "Student 6 (student6@example.com)" user to "Group 3" group members
|
||||
And I follow "Course 1"
|
||||
And I turn editing mode on
|
||||
And I add a "Assignment" to section "1" and I fill the form with:
|
||||
| Assignment name | Test assignment |
|
||||
| Description | Offline text |
|
||||
| assignsubmission_file_enabled | 0 |
|
||||
| Group mode | Separate groups |
|
||||
And I follow "Course 1"
|
||||
And I navigate to "Grades" node in "Course administration"
|
||||
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"
|
||||
And I give the grade "90.00" to the user "Student 3" for the grade item "Test assignment"
|
||||
And I give the grade "80.00" to the user "Student 4" for the grade item "Test assignment"
|
||||
And I give the grade "80.00" to the user "Student 5" for the grade item "Test assignment"
|
||||
And I give the grade "70.00" to the user "Student 6" for the grade item "Test assignment"
|
||||
And I press "Save changes"
|
||||
And I follow "Course 1"
|
||||
And I add the "Activity results" block
|
||||
Given I add the "Activity results" block
|
||||
When I configure the "Activity results" block
|
||||
And I set the following fields to these values:
|
||||
| id_config_showbest | 3 |
|
||||
|
||||
@@ -33,19 +33,15 @@ Feature: The activity results block displays student scores
|
||||
| student4 | C1 | student |
|
||||
| student5 | C1 | student |
|
||||
| student6 | C1 | student |
|
||||
|
||||
@javascript
|
||||
Scenario: Configure the block on the course page to show 1 high score
|
||||
Given I log in as "teacher1"
|
||||
And I follow "Course 1"
|
||||
And I expand "Users" node
|
||||
And I follow "Groups"
|
||||
And I add "Student 1 (student1@example.com)" user to "Group 1" group members
|
||||
And I add "Student 2 (student2@example.com)" user to "Group 1" group members
|
||||
And I add "Student 3 (student3@example.com)" user to "Group 2" group members
|
||||
And I add "Student 4 (student4@example.com)" user to "Group 2" group members
|
||||
And I add "Student 5 (student5@example.com)" user to "Group 3" group members
|
||||
And I add "Student 6 (student6@example.com)" user to "Group 3" group members
|
||||
And the following "group members" exist:
|
||||
| user | group |
|
||||
| student1 | G1 |
|
||||
| student2 | G1 |
|
||||
| student3 | G2 |
|
||||
| student4 | G2 |
|
||||
| student5 | G3 |
|
||||
| student6 | G3 |
|
||||
And I log in as "teacher1"
|
||||
And I follow "Course 1"
|
||||
And I turn editing mode on
|
||||
And I add a "Assignment" to section "1" and I fill the form with:
|
||||
@@ -64,7 +60,9 @@ Feature: The activity results block displays student scores
|
||||
And I give the grade "70.00" to the user "Student 6" for the grade item "Test assignment"
|
||||
And I press "Save changes"
|
||||
And I follow "Course 1"
|
||||
And I add the "Activity results" block
|
||||
|
||||
Scenario: Configure the block on the course page to show 1 high score
|
||||
Given I add the "Activity results" block
|
||||
When I configure the "Activity results" block
|
||||
And I set the following fields to these values:
|
||||
| id_config_showbest | 1 |
|
||||
@@ -77,37 +75,8 @@ Feature: The activity results block displays student scores
|
||||
Then I should see "Group 1" in the "Activity results" "block"
|
||||
And I should see "95%" in the "Activity results" "block"
|
||||
|
||||
@javascript
|
||||
Scenario: Try to configure the block on the course page to show 1 high score as a fraction
|
||||
Given I log in as "teacher1"
|
||||
And I follow "Course 1"
|
||||
And I expand "Users" node
|
||||
And I follow "Groups"
|
||||
And I add "Student 1 (student1@example.com)" user to "Group 1" group members
|
||||
And I add "Student 2 (student2@example.com)" user to "Group 1" group members
|
||||
And I add "Student 3 (student3@example.com)" user to "Group 2" group members
|
||||
And I add "Student 4 (student4@example.com)" user to "Group 2" group members
|
||||
And I add "Student 5 (student5@example.com)" user to "Group 3" group members
|
||||
And I add "Student 6 (student6@example.com)" user to "Group 3" group members
|
||||
And I follow "Course 1"
|
||||
And I turn editing mode on
|
||||
And I add a "Assignment" to section "1" and I fill the form with:
|
||||
| Assignment name | Test assignment |
|
||||
| Description | Offline text |
|
||||
| assignsubmission_file_enabled | 0 |
|
||||
| Group mode | Visible groups |
|
||||
And I follow "Course 1"
|
||||
And I navigate to "Grades" node in "Course administration"
|
||||
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"
|
||||
And I give the grade "90.00" to the user "Student 3" for the grade item "Test assignment"
|
||||
And I give the grade "80.00" to the user "Student 4" for the grade item "Test assignment"
|
||||
And I give the grade "80.00" to the user "Student 5" for the grade item "Test assignment"
|
||||
And I give the grade "70.00" to the user "Student 6" for the grade item "Test assignment"
|
||||
And I press "Save changes"
|
||||
And I follow "Course 1"
|
||||
And I add the "Activity results" block
|
||||
Given I add the "Activity results" block
|
||||
When I configure the "Activity results" block
|
||||
And I set the following fields to these values:
|
||||
| id_config_showbest | 1 |
|
||||
@@ -122,37 +91,8 @@ Feature: The activity results block displays student scores
|
||||
And I should see "Group 1" in the "Activity results" "block"
|
||||
And I should see "95.00/100.00" in the "Activity results" "block"
|
||||
|
||||
@javascript
|
||||
Scenario: Try to configure the block on the course page to show 1 high score as a absolute numbers
|
||||
Given I log in as "teacher1"
|
||||
And I follow "Course 1"
|
||||
And I expand "Users" node
|
||||
And I follow "Groups"
|
||||
And I add "Student 1 (student1@example.com)" user to "Group 1" group members
|
||||
And I add "Student 2 (student2@example.com)" user to "Group 1" group members
|
||||
And I add "Student 3 (student3@example.com)" user to "Group 2" group members
|
||||
And I add "Student 4 (student4@example.com)" user to "Group 2" group members
|
||||
And I add "Student 5 (student5@example.com)" user to "Group 3" group members
|
||||
And I add "Student 6 (student6@example.com)" user to "Group 3" group members
|
||||
And I follow "Course 1"
|
||||
And I turn editing mode on
|
||||
And I add a "Assignment" to section "1" and I fill the form with:
|
||||
| Assignment name | Test assignment |
|
||||
| Description | Offline text |
|
||||
| assignsubmission_file_enabled | 0 |
|
||||
| Group mode | Visible groups |
|
||||
And I follow "Course 1"
|
||||
And I navigate to "Grades" node in "Course administration"
|
||||
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"
|
||||
And I give the grade "90.00" to the user "Student 3" for the grade item "Test assignment"
|
||||
And I give the grade "80.00" to the user "Student 4" for the grade item "Test assignment"
|
||||
And I give the grade "80.00" to the user "Student 5" for the grade item "Test assignment"
|
||||
And I give the grade "70.00" to the user "Student 6" for the grade item "Test assignment"
|
||||
And I press "Save changes"
|
||||
And I follow "Course 1"
|
||||
And I add the "Activity results" block
|
||||
Given I add the "Activity results" block
|
||||
When I configure the "Activity results" block
|
||||
And I set the following fields to these values:
|
||||
| id_config_showbest | 1 |
|
||||
@@ -167,37 +107,8 @@ Feature: The activity results block displays student scores
|
||||
And I should see "Group 1" in the "Activity results" "block"
|
||||
And I should see "95.00" in the "Activity results" "block"
|
||||
|
||||
@javascript
|
||||
Scenario: Try to configure the block on the course page to show multiple high scores as percentages
|
||||
Given I log in as "teacher1"
|
||||
And I follow "Course 1"
|
||||
And I expand "Users" node
|
||||
And I follow "Groups"
|
||||
And I add "Student 1 (student1@example.com)" user to "Group 1" group members
|
||||
And I add "Student 2 (student2@example.com)" user to "Group 1" group members
|
||||
And I add "Student 3 (student3@example.com)" user to "Group 2" group members
|
||||
And I add "Student 4 (student4@example.com)" user to "Group 2" group members
|
||||
And I add "Student 5 (student5@example.com)" user to "Group 3" group members
|
||||
And I add "Student 6 (student6@example.com)" user to "Group 3" group members
|
||||
And I follow "Course 1"
|
||||
And I turn editing mode on
|
||||
And I add a "Assignment" to section "1" and I fill the form with:
|
||||
| Assignment name | Test assignment |
|
||||
| Description | Offline text |
|
||||
| assignsubmission_file_enabled | 0 |
|
||||
| Group mode | Visible groups |
|
||||
And I follow "Course 1"
|
||||
And I navigate to "Grades" node in "Course administration"
|
||||
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"
|
||||
And I give the grade "90.00" to the user "Student 3" for the grade item "Test assignment"
|
||||
And I give the grade "80.00" to the user "Student 4" for the grade item "Test assignment"
|
||||
And I give the grade "80.00" to the user "Student 5" for the grade item "Test assignment"
|
||||
And I give the grade "70.00" to the user "Student 6" for the grade item "Test assignment"
|
||||
And I press "Save changes"
|
||||
And I follow "Course 1"
|
||||
And I add the "Activity results" block
|
||||
Given I add the "Activity results" block
|
||||
When I configure the "Activity results" block
|
||||
And I set the following fields to these values:
|
||||
| id_config_showbest | 3 |
|
||||
@@ -217,37 +128,8 @@ Feature: The activity results block displays student scores
|
||||
And I should see "Group 3" in the "Activity results" "block"
|
||||
And I should see "75%" in the "Activity results" "block"
|
||||
|
||||
@javascript
|
||||
Scenario: Try to configure the block on the course page to show multiple high scores as fractions
|
||||
Given I log in as "teacher1"
|
||||
And I follow "Course 1"
|
||||
And I expand "Users" node
|
||||
And I follow "Groups"
|
||||
And I add "Student 1 (student1@example.com)" user to "Group 1" group members
|
||||
And I add "Student 2 (student2@example.com)" user to "Group 1" group members
|
||||
And I add "Student 3 (student3@example.com)" user to "Group 2" group members
|
||||
And I add "Student 4 (student4@example.com)" user to "Group 2" group members
|
||||
And I add "Student 5 (student5@example.com)" user to "Group 3" group members
|
||||
And I add "Student 6 (student6@example.com)" user to "Group 3" group members
|
||||
And I follow "Course 1"
|
||||
And I turn editing mode on
|
||||
And I add a "Assignment" to section "1" and I fill the form with:
|
||||
| Assignment name | Test assignment |
|
||||
| Description | Offline text |
|
||||
| assignsubmission_file_enabled | 0 |
|
||||
| Group mode | Visible groups |
|
||||
And I follow "Course 1"
|
||||
And I navigate to "Grades" node in "Course administration"
|
||||
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"
|
||||
And I give the grade "90.00" to the user "Student 3" for the grade item "Test assignment"
|
||||
And I give the grade "80.00" to the user "Student 4" for the grade item "Test assignment"
|
||||
And I give the grade "80.00" to the user "Student 5" for the grade item "Test assignment"
|
||||
And I give the grade "70.00" to the user "Student 6" for the grade item "Test assignment"
|
||||
And I press "Save changes"
|
||||
And I follow "Course 1"
|
||||
And I add the "Activity results" block
|
||||
Given I add the "Activity results" block
|
||||
When I configure the "Activity results" block
|
||||
And I set the following fields to these values:
|
||||
| id_config_showbest | 3 |
|
||||
@@ -266,37 +148,8 @@ Feature: The activity results block displays student scores
|
||||
And I should see "Group 3" in the "Activity results" "block"
|
||||
And I should see "75.00/100.00" in the "Activity results" "block"
|
||||
|
||||
@javascript
|
||||
Scenario: Try to configure the block on the course page to show multiple high scores as absolute numbers
|
||||
Given I log in as "teacher1"
|
||||
And I follow "Course 1"
|
||||
And I expand "Users" node
|
||||
And I follow "Groups"
|
||||
And I add "Student 1 (student1@example.com)" user to "Group 1" group members
|
||||
And I add "Student 2 (student2@example.com)" user to "Group 1" group members
|
||||
And I add "Student 3 (student3@example.com)" user to "Group 2" group members
|
||||
And I add "Student 4 (student4@example.com)" user to "Group 2" group members
|
||||
And I add "Student 5 (student5@example.com)" user to "Group 3" group members
|
||||
And I add "Student 6 (student6@example.com)" user to "Group 3" group members
|
||||
And I follow "Course 1"
|
||||
And I turn editing mode on
|
||||
And I add a "Assignment" to section "1" and I fill the form with:
|
||||
| Assignment name | Test assignment |
|
||||
| Description | Offline text |
|
||||
| assignsubmission_file_enabled | 0 |
|
||||
| Group mode | Visible groups |
|
||||
And I follow "Course 1"
|
||||
And I navigate to "Grades" node in "Course administration"
|
||||
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"
|
||||
And I give the grade "90.00" to the user "Student 3" for the grade item "Test assignment"
|
||||
And I give the grade "80.00" to the user "Student 4" for the grade item "Test assignment"
|
||||
And I give the grade "80.00" to the user "Student 5" for the grade item "Test assignment"
|
||||
And I give the grade "70.00" to the user "Student 6" for the grade item "Test assignment"
|
||||
And I press "Save changes"
|
||||
And I follow "Course 1"
|
||||
And I add the "Activity results" block
|
||||
Given I add the "Activity results" block
|
||||
When I configure the "Activity results" block
|
||||
And I set the following fields to these values:
|
||||
| id_config_showbest | 3 |
|
||||
@@ -315,37 +168,8 @@ Feature: The activity results block displays student scores
|
||||
And I should see "Group 3" in the "Activity results" "block"
|
||||
And I should see "75.00" in the "Activity results" "block"
|
||||
|
||||
@javascript
|
||||
Scenario: Try to configure the block on the course page to show multiple high scores using ID numbers
|
||||
Given I log in as "teacher1"
|
||||
And I follow "Course 1"
|
||||
And I expand "Users" node
|
||||
And I follow "Groups"
|
||||
And I add "Student 1 (student1@example.com)" user to "Group 1" group members
|
||||
And I add "Student 2 (student2@example.com)" user to "Group 1" group members
|
||||
And I add "Student 3 (student3@example.com)" user to "Group 2" group members
|
||||
And I add "Student 4 (student4@example.com)" user to "Group 2" group members
|
||||
And I add "Student 5 (student5@example.com)" user to "Group 3" group members
|
||||
And I add "Student 6 (student6@example.com)" user to "Group 3" group members
|
||||
And I follow "Course 1"
|
||||
And I turn editing mode on
|
||||
And I add a "Assignment" to section "1" and I fill the form with:
|
||||
| Assignment name | Test assignment |
|
||||
| Description | Offline text |
|
||||
| assignsubmission_file_enabled | 0 |
|
||||
| Group mode | Visible groups |
|
||||
And I follow "Course 1"
|
||||
And I navigate to "Grades" node in "Course administration"
|
||||
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"
|
||||
And I give the grade "90.00" to the user "Student 3" for the grade item "Test assignment"
|
||||
And I give the grade "80.00" to the user "Student 4" for the grade item "Test assignment"
|
||||
And I give the grade "80.00" to the user "Student 5" for the grade item "Test assignment"
|
||||
And I give the grade "70.00" to the user "Student 6" for the grade item "Test assignment"
|
||||
And I press "Save changes"
|
||||
And I follow "Course 1"
|
||||
And I add the "Activity results" block
|
||||
Given I add the "Activity results" block
|
||||
When I configure the "Activity results" block
|
||||
And I set the following fields to these values:
|
||||
| id_config_showbest | 3 |
|
||||
@@ -362,37 +186,8 @@ Feature: The activity results block displays student scores
|
||||
And I should see "85.00%" in the "Activity results" "block"
|
||||
And I should see "75.00%" in the "Activity results" "block"
|
||||
|
||||
@javascript
|
||||
Scenario: Try to configure the block on the course page to show multiple high scores using anonymous names
|
||||
Given I log in as "teacher1"
|
||||
And I follow "Course 1"
|
||||
And I expand "Users" node
|
||||
And I follow "Groups"
|
||||
And I add "Student 1 (student1@example.com)" user to "Group 1" group members
|
||||
And I add "Student 2 (student2@example.com)" user to "Group 1" group members
|
||||
And I add "Student 3 (student3@example.com)" user to "Group 2" group members
|
||||
And I add "Student 4 (student4@example.com)" user to "Group 2" group members
|
||||
And I add "Student 5 (student5@example.com)" user to "Group 3" group members
|
||||
And I add "Student 6 (student6@example.com)" user to "Group 3" group members
|
||||
And I follow "Course 1"
|
||||
And I turn editing mode on
|
||||
And I add a "Assignment" to section "1" and I fill the form with:
|
||||
| Assignment name | Test assignment |
|
||||
| Description | Offline text |
|
||||
| assignsubmission_file_enabled | 0 |
|
||||
| Group mode | Visible groups |
|
||||
And I follow "Course 1"
|
||||
And I navigate to "Grades" node in "Course administration"
|
||||
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"
|
||||
And I give the grade "90.00" to the user "Student 3" for the grade item "Test assignment"
|
||||
And I give the grade "80.00" to the user "Student 4" for the grade item "Test assignment"
|
||||
And I give the grade "80.00" to the user "Student 5" for the grade item "Test assignment"
|
||||
And I give the grade "70.00" to the user "Student 6" for the grade item "Test assignment"
|
||||
And I press "Save changes"
|
||||
And I follow "Course 1"
|
||||
And I add the "Activity results" block
|
||||
Given I add the "Activity results" block
|
||||
When I configure the "Activity results" block
|
||||
And I set the following fields to these values:
|
||||
| id_config_showbest | 3 |
|
||||
|
||||
@@ -0,0 +1,112 @@
|
||||
@block @block_activity_results
|
||||
Feature: The activity results block displays student scores as scales
|
||||
In order to be display student scores as scales
|
||||
As a user
|
||||
I need to see the activity results block
|
||||
|
||||
Background:
|
||||
Given the following "users" exist:
|
||||
| username | firstname | lastname | email | idnumber |
|
||||
| teacher1 | Teacher | 1 | teacher1@example.com | T1 |
|
||||
| student1 | Student | 1 | student1@example.com | S1 |
|
||||
| student2 | Student | 2 | student2@example.com | S2 |
|
||||
| student3 | Student | 3 | student3@example.com | S3 |
|
||||
| student4 | Student | 4 | student4@example.com | S4 |
|
||||
| student5 | Student | 5 | student5@example.com | S5 |
|
||||
And the following "courses" exist:
|
||||
| fullname | shortname | category |
|
||||
| Course 1 | C1 | 0 |
|
||||
And the following "course enrolments" exist:
|
||||
| user | course | role |
|
||||
| teacher1 | C1 | editingteacher |
|
||||
| student1 | C1 | student |
|
||||
| student2 | C1 | student |
|
||||
| student3 | C1 | student |
|
||||
| student4 | C1 | student |
|
||||
| student5 | C1 | student |
|
||||
And I log in as "teacher1"
|
||||
And I follow "Course 1"
|
||||
And I navigate to "Grades" node in "Course administration"
|
||||
And I navigate to "Scales" node in "Grade administration"
|
||||
And I press "Add a new scale"
|
||||
And I set the following fields to these values:
|
||||
| Name | My Scale |
|
||||
| Scale | Disappointing, Not good enough, Average, Good, Very good, Excellent! |
|
||||
And I press "Save changes"
|
||||
And I follow "Course 1"
|
||||
And I turn editing mode on
|
||||
And I add a "Assignment" to section "1" and I fill the form with:
|
||||
| Assignment name | Test assignment |
|
||||
| Description | Offline text |
|
||||
| assignsubmission_file_enabled | 0 |
|
||||
| id_modgrade_type | Scale |
|
||||
| id_modgrade_scale | My Scale |
|
||||
And I follow "Course 1"
|
||||
And I navigate to "Grades" node in "Course administration"
|
||||
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"
|
||||
And I give the grade "Good" to the user "Student 3" for the grade item "Test assignment"
|
||||
And I give the grade "Average" to the user "Student 4" for the grade item "Test assignment"
|
||||
And I give the grade "Not good enough" to the user "Student 5" for the grade item "Test assignment"
|
||||
And I press "Save changes"
|
||||
And I follow "Course 1"
|
||||
|
||||
Scenario: Configure the block on the course page to show 1 low score
|
||||
Given I add the "Activity results" block
|
||||
When I configure the "Activity results" block
|
||||
And I set the following fields to these values:
|
||||
| id_config_showbest | 0 |
|
||||
| id_config_showworst | 1 |
|
||||
| id_config_gradeformat | Percentages |
|
||||
| id_config_nameformat | Display full names |
|
||||
| id_config_decimalpoints | 0 |
|
||||
And I press "Save changes"
|
||||
Then I should see "Student 5" in the "Activity results" "block"
|
||||
And I should see "Not good enough" in the "Activity results" "block"
|
||||
|
||||
Scenario: Try to configure the block on the course page to show multiple low scores using full names
|
||||
Given I add the "Activity results" block
|
||||
When I configure the "Activity results" block
|
||||
And I set the following fields to these values:
|
||||
| id_config_showbest | 0 |
|
||||
| id_config_showworst | 3 |
|
||||
| id_config_nameformat | Display full names |
|
||||
And I press "Save changes"
|
||||
Then I should see "Student 5" in the "Activity results" "block"
|
||||
And I should see "Not good enough" in the "Activity results" "block"
|
||||
And I should see "Student 4" in the "Activity results" "block"
|
||||
And I should see "Average" in the "Activity results" "block"
|
||||
And I should see "Student 3" in the "Activity results" "block"
|
||||
And I should see "Good" in the "Activity results" "block"
|
||||
|
||||
Scenario: Try to configure the block on the course page to show multiple low scores using ID numbers
|
||||
Given I add the "Activity results" block
|
||||
When I configure the "Activity results" block
|
||||
And I set the following fields to these values:
|
||||
| id_config_showbest | 0 |
|
||||
| id_config_showworst | 3 |
|
||||
| id_config_nameformat | Display only ID numbers |
|
||||
And I press "Save changes"
|
||||
Then I should see "User S5" in the "Activity results" "block"
|
||||
And I should see "Not good enough" in the "Activity results" "block"
|
||||
And I should see "User S4" in the "Activity results" "block"
|
||||
And I should see "Average" in the "Activity results" "block"
|
||||
And I should see "User S3" in the "Activity results" "block"
|
||||
And I should see "Good" in the "Activity results" "block"
|
||||
|
||||
Scenario: Try to configure the block on the course page to show multiple low scores using anonymous names
|
||||
Given I add the "Activity results" block
|
||||
When I configure the "Activity results" block
|
||||
And I set the following fields to these values:
|
||||
| id_config_showbest | 0 |
|
||||
| id_config_showworst | 3 |
|
||||
| id_config_nameformat | Anonymous results |
|
||||
And I press "Save changes"
|
||||
Then I should see "User" in the "Activity results" "block"
|
||||
And I should not see "Student 5" in the "Activity results" "block"
|
||||
And I should see "Not good enough" in the "Activity results" "block"
|
||||
And I should not see "Student 4" in the "Activity results" "block"
|
||||
And I should see "Average" in the "Activity results" "block"
|
||||
And I should not see "Student 3" in the "Activity results" "block"
|
||||
And I should see "Good" in the "Activity results" "block"
|
||||
@@ -0,0 +1,150 @@
|
||||
@block @block_activity_results
|
||||
Feature: The activity results block displays student scores as scales
|
||||
In order to be display student scores as scales
|
||||
As a user
|
||||
I need to see the activity results block
|
||||
|
||||
Background:
|
||||
Given the following "users" exist:
|
||||
| username | firstname | lastname | email | idnumber |
|
||||
| teacher1 | Teacher | 1 | teacher1@example.com | T1 |
|
||||
| student1 | Student | 1 | student1@example.com | S1 |
|
||||
| student2 | Student | 2 | student2@example.com | S2 |
|
||||
| student3 | Student | 3 | student3@example.com | S3 |
|
||||
| student4 | Student | 4 | student4@example.com | S4 |
|
||||
| student5 | Student | 5 | student5@example.com | S5 |
|
||||
| student6 | Student | 6 | student6@example.com | S6 |
|
||||
And the following "courses" exist:
|
||||
| fullname | shortname | category |
|
||||
| Course 1 | C1 | 0 |
|
||||
And the following "groups" exist:
|
||||
| name | course | idnumber |
|
||||
| Group 1 | C1 | G1 |
|
||||
| Group 2 | C1 | G2 |
|
||||
| Group 3 | C1 | G3 |
|
||||
| Group 4 | C1 | G4 |
|
||||
| Group 5 | C1 | G5 |
|
||||
And the following "course enrolments" exist:
|
||||
| user | course | role |
|
||||
| teacher1 | C1 | editingteacher |
|
||||
| student1 | C1 | student |
|
||||
| student2 | C1 | student |
|
||||
| student3 | C1 | student |
|
||||
| student4 | C1 | student |
|
||||
| student5 | C1 | student |
|
||||
| student6 | C1 | student |
|
||||
And the following "group members" exist:
|
||||
| user | group |
|
||||
| student1 | G1 |
|
||||
| student2 | G1 |
|
||||
| student3 | G2 |
|
||||
| student4 | G2 |
|
||||
| student5 | G3 |
|
||||
| student6 | G3 |
|
||||
And I log in as "teacher1"
|
||||
And I follow "Course 1"
|
||||
And I navigate to "Grades" node in "Course administration"
|
||||
And I navigate to "Scales" node in "Grade administration"
|
||||
And I press "Add a new scale"
|
||||
And I set the following fields to these values:
|
||||
| Name | My Scale |
|
||||
| Scale | Disappointing, Not good enough, Average, Good, Very good, Excellent! |
|
||||
And I press "Save changes"
|
||||
And I follow "Course 1"
|
||||
And I turn editing mode on
|
||||
And I add a "Assignment" to section "1" and I fill the form with:
|
||||
| Assignment name | Test assignment |
|
||||
| Description | Offline text |
|
||||
| assignsubmission_file_enabled | 0 |
|
||||
| id_modgrade_type | Scale |
|
||||
| id_modgrade_scale | My Scale |
|
||||
| Group mode | Separate groups |
|
||||
And I follow "Course 1"
|
||||
And I navigate to "Grades" node in "Course administration"
|
||||
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"
|
||||
And I give the grade "Very good" to the user "Student 3" for the grade item "Test assignment"
|
||||
And I give the grade "Good" to the user "Student 4" for the grade item "Test assignment"
|
||||
And I give the grade "Good" to the user "Student 5" for the grade item "Test assignment"
|
||||
And I give the grade "Average" to the user "Student 6" for the grade item "Test assignment"
|
||||
And I press "Save changes"
|
||||
And I follow "Course 1"
|
||||
|
||||
Scenario: Try to configure the block on the course page to show 1 low score
|
||||
Given I add the "Activity results" block
|
||||
When I configure the "Activity results" block
|
||||
And I set the following fields to these values:
|
||||
| id_config_showbest | 0 |
|
||||
| id_config_showworst | 1 |
|
||||
| id_config_nameformat | Display full names |
|
||||
| id_config_usegroups | Yes |
|
||||
And I press "Save changes"
|
||||
Then I should see "Group 3" in the "Activity results" "block"
|
||||
And I should see "Good" in the "Activity results" "block"
|
||||
And I log out
|
||||
And I log in as "student5"
|
||||
And I follow "Course 1"
|
||||
And I should see "Student 6" in the "Activity results" "block"
|
||||
And I should see "Average" in the "Activity results" "block"
|
||||
|
||||
Scenario: Try to configure the block on the course page to show multiple high scores using full names
|
||||
Given I add the "Activity results" block
|
||||
When I configure the "Activity results" block
|
||||
And I set the following fields to these values:
|
||||
| id_config_showbest | 0 |
|
||||
| id_config_showworst | 2 |
|
||||
| id_config_nameformat | Display full names |
|
||||
| id_config_usegroups | Yes |
|
||||
And I press "Save changes"
|
||||
Then I should see "Group 2" in the "Activity results" "block"
|
||||
And I should see "Very good" in the "Activity results" "block"
|
||||
And I should see "Group 3" in the "Activity results" "block"
|
||||
And I should see "Good" in the "Activity results" "block"
|
||||
And I log out
|
||||
And I log in as "student3"
|
||||
And I follow "Course 1"
|
||||
And I should see "Student 3" in the "Activity results" "block"
|
||||
And I should see "Very good" in the "Activity results" "block"
|
||||
And I should see "Student 4" in the "Activity results" "block"
|
||||
And I should see "Good" in the "Activity results" "block"
|
||||
|
||||
Scenario: Try to configure the block on the course page to show multiple high scores using ID numbers
|
||||
Given I add the "Activity results" block
|
||||
When I configure the "Activity results" block
|
||||
And I set the following fields to these values:
|
||||
| id_config_showbest | 0 |
|
||||
| id_config_showworst | 2 |
|
||||
| id_config_nameformat | Display only ID numbers |
|
||||
| id_config_usegroups | Yes |
|
||||
And I press "Save changes"
|
||||
Then I should see "Group" in the "Activity results" "block"
|
||||
And I should see "Very good" in the "Activity results" "block"
|
||||
And I should see "Good" in the "Activity results" "block"
|
||||
And I log out
|
||||
And I log in as "student5"
|
||||
And I follow "Course 1"
|
||||
And I should see "User S5" in the "Activity results" "block"
|
||||
And I should see "Good" in the "Activity results" "block"
|
||||
And I should see "User S6" in the "Activity results" "block"
|
||||
And I should see "Average" in the "Activity results" "block"
|
||||
|
||||
Scenario: Try to configure the block on the course page to show multiple high scores using anonymous names
|
||||
Given I add the "Activity results" block
|
||||
When I configure the "Activity results" block
|
||||
And I set the following fields to these values:
|
||||
| id_config_showbest | 0 |
|
||||
| id_config_showworst | 2 |
|
||||
| id_config_nameformat | Anonymous results |
|
||||
| id_config_usegroups | Yes |
|
||||
And I press "Save changes"
|
||||
Then I should see "Group" in the "Activity results" "block"
|
||||
And I should see "Very good" in the "Activity results" "block"
|
||||
And I should see "Good" in the "Activity results" "block"
|
||||
And I log out
|
||||
And I log in as "student5"
|
||||
And I follow "Course 1"
|
||||
And I should see "User" in the "Activity results" "block"
|
||||
And I should see "Good" in the "Activity results" "block"
|
||||
And I should see "Average" in the "Activity results" "block"
|
||||
|
||||
@@ -33,19 +33,15 @@ Feature: The activity results block displays student scores
|
||||
| student4 | C1 | student |
|
||||
| student5 | C1 | student |
|
||||
| student6 | C1 | student |
|
||||
|
||||
@javascript
|
||||
Scenario: Configure the block on the course page to show 1 low score
|
||||
Given I log in as "teacher1"
|
||||
And I follow "Course 1"
|
||||
And I expand "Users" node
|
||||
And I follow "Groups"
|
||||
And I add "Student 1 (student1@example.com)" user to "Group 1" group members
|
||||
And I add "Student 2 (student2@example.com)" user to "Group 1" group members
|
||||
And I add "Student 3 (student3@example.com)" user to "Group 2" group members
|
||||
And I add "Student 4 (student4@example.com)" user to "Group 2" group members
|
||||
And I add "Student 5 (student5@example.com)" user to "Group 3" group members
|
||||
And I add "Student 6 (student6@example.com)" user to "Group 3" group members
|
||||
And the following "group members" exist:
|
||||
| user | group |
|
||||
| student1 | G1 |
|
||||
| student2 | G1 |
|
||||
| student3 | G2 |
|
||||
| student4 | G2 |
|
||||
| student5 | G3 |
|
||||
| student6 | G3 |
|
||||
And I log in as "teacher1"
|
||||
And I follow "Course 1"
|
||||
And I turn editing mode on
|
||||
And I add a "Assignment" to section "1" and I fill the form with:
|
||||
@@ -64,7 +60,9 @@ Feature: The activity results block displays student scores
|
||||
And I give the grade "70.00" to the user "Student 6" for the grade item "Test assignment"
|
||||
And I press "Save changes"
|
||||
And I follow "Course 1"
|
||||
And I add the "Activity results" block
|
||||
|
||||
Scenario: Configure the block on the course page to show 1 low score
|
||||
Given I add the "Activity results" block
|
||||
When I configure the "Activity results" block
|
||||
And I set the following fields to these values:
|
||||
| id_config_showbest | 0 |
|
||||
@@ -77,37 +75,8 @@ Feature: The activity results block displays student scores
|
||||
Then I should see "Group 3" in the "Activity results" "block"
|
||||
And I should see "75%" in the "Activity results" "block"
|
||||
|
||||
@javascript
|
||||
Scenario: Try to configure the block on the course page to show 1 low score as a fraction
|
||||
Given I log in as "teacher1"
|
||||
And I follow "Course 1"
|
||||
And I expand "Users" node
|
||||
And I follow "Groups"
|
||||
And I add "Student 1 (student1@example.com)" user to "Group 1" group members
|
||||
And I add "Student 2 (student2@example.com)" user to "Group 1" group members
|
||||
And I add "Student 3 (student3@example.com)" user to "Group 2" group members
|
||||
And I add "Student 4 (student4@example.com)" user to "Group 2" group members
|
||||
And I add "Student 5 (student5@example.com)" user to "Group 3" group members
|
||||
And I add "Student 6 (student6@example.com)" user to "Group 3" group members
|
||||
And I follow "Course 1"
|
||||
And I turn editing mode on
|
||||
And I add a "Assignment" to section "1" and I fill the form with:
|
||||
| Assignment name | Test assignment |
|
||||
| Description | Offline text |
|
||||
| assignsubmission_file_enabled | 0 |
|
||||
| Group mode | Separate groups |
|
||||
And I follow "Course 1"
|
||||
And I navigate to "Grades" node in "Course administration"
|
||||
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"
|
||||
And I give the grade "90.00" to the user "Student 3" for the grade item "Test assignment"
|
||||
And I give the grade "80.00" to the user "Student 4" for the grade item "Test assignment"
|
||||
And I give the grade "80.00" to the user "Student 5" for the grade item "Test assignment"
|
||||
And I give the grade "70.00" to the user "Student 6" for the grade item "Test assignment"
|
||||
And I press "Save changes"
|
||||
And I follow "Course 1"
|
||||
And I add the "Activity results" block
|
||||
Given I add the "Activity results" block
|
||||
When I configure the "Activity results" block
|
||||
And I set the following fields to these values:
|
||||
| id_config_showbest | 0 |
|
||||
@@ -124,37 +93,8 @@ Feature: The activity results block displays student scores
|
||||
And I should see "Student 6" in the "Activity results" "block"
|
||||
And I should see "70.00/100.00" in the "Activity results" "block"
|
||||
|
||||
@javascript
|
||||
Scenario: Try to configure the block on the course page to show 1 low score as a absolute numbers
|
||||
Given I log in as "teacher1"
|
||||
And I follow "Course 1"
|
||||
And I expand "Users" node
|
||||
And I follow "Groups"
|
||||
And I add "Student 1 (student1@example.com)" user to "Group 1" group members
|
||||
And I add "Student 2 (student2@example.com)" user to "Group 1" group members
|
||||
And I add "Student 3 (student3@example.com)" user to "Group 2" group members
|
||||
And I add "Student 4 (student4@example.com)" user to "Group 2" group members
|
||||
And I add "Student 5 (student5@example.com)" user to "Group 3" group members
|
||||
And I add "Student 6 (student6@example.com)" user to "Group 3" group members
|
||||
And I follow "Course 1"
|
||||
And I turn editing mode on
|
||||
And I add a "Assignment" to section "1" and I fill the form with:
|
||||
| Assignment name | Test assignment |
|
||||
| Description | Offline text |
|
||||
| assignsubmission_file_enabled | 0 |
|
||||
| Group mode | Separate groups |
|
||||
And I follow "Course 1"
|
||||
And I navigate to "Grades" node in "Course administration"
|
||||
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"
|
||||
And I give the grade "90.00" to the user "Student 3" for the grade item "Test assignment"
|
||||
And I give the grade "80.00" to the user "Student 4" for the grade item "Test assignment"
|
||||
And I give the grade "80.00" to the user "Student 5" for the grade item "Test assignment"
|
||||
And I give the grade "70.00" to the user "Student 6" for the grade item "Test assignment"
|
||||
And I press "Save changes"
|
||||
And I follow "Course 1"
|
||||
And I add the "Activity results" block
|
||||
Given I add the "Activity results" block
|
||||
When I configure the "Activity results" block
|
||||
And I set the following fields to these values:
|
||||
| id_config_showbest | 0 |
|
||||
@@ -171,37 +111,8 @@ Feature: The activity results block displays student scores
|
||||
And I should see "Student 6" in the "Activity results" "block"
|
||||
And I should see "70.00" in the "Activity results" "block"
|
||||
|
||||
@javascript
|
||||
Scenario: Try to configure the block on the course page to show multiple low scores as percentages
|
||||
Given I log in as "teacher1"
|
||||
And I follow "Course 1"
|
||||
And I expand "Users" node
|
||||
And I follow "Groups"
|
||||
And I add "Student 1 (student1@example.com)" user to "Group 1" group members
|
||||
And I add "Student 2 (student2@example.com)" user to "Group 1" group members
|
||||
And I add "Student 3 (student3@example.com)" user to "Group 2" group members
|
||||
And I add "Student 4 (student4@example.com)" user to "Group 2" group members
|
||||
And I add "Student 5 (student5@example.com)" user to "Group 3" group members
|
||||
And I add "Student 6 (student6@example.com)" user to "Group 3" group members
|
||||
And I follow "Course 1"
|
||||
And I turn editing mode on
|
||||
And I add a "Assignment" to section "1" and I fill the form with:
|
||||
| Assignment name | Test assignment |
|
||||
| Description | Offline text |
|
||||
| assignsubmission_file_enabled | 0 |
|
||||
| Group mode | Separate groups |
|
||||
And I follow "Course 1"
|
||||
And I navigate to "Grades" node in "Course administration"
|
||||
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"
|
||||
And I give the grade "90.00" to the user "Student 3" for the grade item "Test assignment"
|
||||
And I give the grade "80.00" to the user "Student 4" for the grade item "Test assignment"
|
||||
And I give the grade "80.00" to the user "Student 5" for the grade item "Test assignment"
|
||||
And I give the grade "70.00" to the user "Student 6" for the grade item "Test assignment"
|
||||
And I press "Save changes"
|
||||
And I follow "Course 1"
|
||||
And I add the "Activity results" block
|
||||
Given I add the "Activity results" block
|
||||
When I configure the "Activity results" block
|
||||
And I set the following fields to these values:
|
||||
| id_config_showbest | 0 |
|
||||
@@ -223,37 +134,8 @@ Feature: The activity results block displays student scores
|
||||
And I should see "Student 5" in the "Activity results" "block"
|
||||
And I should see "80%" in the "Activity results" "block"
|
||||
|
||||
@javascript
|
||||
Scenario: Try to configure the block on the course page to show multiple low scores as fractions
|
||||
Given I log in as "teacher1"
|
||||
And I follow "Course 1"
|
||||
And I expand "Users" node
|
||||
And I follow "Groups"
|
||||
And I add "Student 1 (student1@example.com)" user to "Group 1" group members
|
||||
And I add "Student 2 (student2@example.com)" user to "Group 1" group members
|
||||
And I add "Student 3 (student3@example.com)" user to "Group 2" group members
|
||||
And I add "Student 4 (student4@example.com)" user to "Group 2" group members
|
||||
And I add "Student 5 (student5@example.com)" user to "Group 3" group members
|
||||
And I add "Student 6 (student6@example.com)" user to "Group 3" group members
|
||||
And I follow "Course 1"
|
||||
And I turn editing mode on
|
||||
And I add a "Assignment" to section "1" and I fill the form with:
|
||||
| Assignment name | Test assignment |
|
||||
| Description | Offline text |
|
||||
| assignsubmission_file_enabled | 0 |
|
||||
| Group mode | Separate groups |
|
||||
And I follow "Course 1"
|
||||
And I navigate to "Grades" node in "Course administration"
|
||||
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"
|
||||
And I give the grade "90.00" to the user "Student 3" for the grade item "Test assignment"
|
||||
And I give the grade "80.00" to the user "Student 4" for the grade item "Test assignment"
|
||||
And I give the grade "80.00" to the user "Student 5" for the grade item "Test assignment"
|
||||
And I give the grade "70.00" to the user "Student 6" for the grade item "Test assignment"
|
||||
And I press "Save changes"
|
||||
And I follow "Course 1"
|
||||
And I add the "Activity results" block
|
||||
Given I add the "Activity results" block
|
||||
When I configure the "Activity results" block
|
||||
And I set the following fields to these values:
|
||||
| id_config_showbest | 0 |
|
||||
@@ -274,37 +156,8 @@ Feature: The activity results block displays student scores
|
||||
And I should see "Student 4" in the "Activity results" "block"
|
||||
And I should see "80.00/100.00" in the "Activity results" "block"
|
||||
|
||||
@javascript
|
||||
Scenario: Try to configure the block on the course page to show multiple low scores as absolute numbers
|
||||
Given I log in as "teacher1"
|
||||
And I follow "Course 1"
|
||||
And I expand "Users" node
|
||||
And I follow "Groups"
|
||||
And I add "Student 1 (student1@example.com)" user to "Group 1" group members
|
||||
And I add "Student 2 (student2@example.com)" user to "Group 1" group members
|
||||
And I add "Student 3 (student3@example.com)" user to "Group 2" group members
|
||||
And I add "Student 4 (student4@example.com)" user to "Group 2" group members
|
||||
And I add "Student 5 (student5@example.com)" user to "Group 3" group members
|
||||
And I add "Student 6 (student6@example.com)" user to "Group 3" group members
|
||||
And I follow "Course 1"
|
||||
And I turn editing mode on
|
||||
And I add a "Assignment" to section "1" and I fill the form with:
|
||||
| Assignment name | Test assignment |
|
||||
| Description | Offline text |
|
||||
| assignsubmission_file_enabled | 0 |
|
||||
| Group mode | Separate groups |
|
||||
And I follow "Course 1"
|
||||
And I navigate to "Grades" node in "Course administration"
|
||||
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"
|
||||
And I give the grade "90.00" to the user "Student 3" for the grade item "Test assignment"
|
||||
And I give the grade "80.00" to the user "Student 4" for the grade item "Test assignment"
|
||||
And I give the grade "80.00" to the user "Student 5" for the grade item "Test assignment"
|
||||
And I give the grade "70.00" to the user "Student 6" for the grade item "Test assignment"
|
||||
And I press "Save changes"
|
||||
And I follow "Course 1"
|
||||
And I add the "Activity results" block
|
||||
Given I add the "Activity results" block
|
||||
When I configure the "Activity results" block
|
||||
And I set the following fields to these values:
|
||||
| id_config_showbest | 0 |
|
||||
@@ -325,37 +178,8 @@ Feature: The activity results block displays student scores
|
||||
And I should see "Student 6" in the "Activity results" "block"
|
||||
And I should see "70.00" in the "Activity results" "block"
|
||||
|
||||
@javascript
|
||||
Scenario: Try to configure the block on the course page to show multiple low scores using ID numbers
|
||||
Given I log in as "teacher1"
|
||||
And I follow "Course 1"
|
||||
And I expand "Users" node
|
||||
And I follow "Groups"
|
||||
And I add "Student 1 (student1@example.com)" user to "Group 1" group members
|
||||
And I add "Student 2 (student2@example.com)" user to "Group 1" group members
|
||||
And I add "Student 3 (student3@example.com)" user to "Group 2" group members
|
||||
And I add "Student 4 (student4@example.com)" user to "Group 2" group members
|
||||
And I add "Student 5 (student5@example.com)" user to "Group 3" group members
|
||||
And I add "Student 6 (student6@example.com)" user to "Group 3" group members
|
||||
And I follow "Course 1"
|
||||
And I turn editing mode on
|
||||
And I add a "Assignment" to section "1" and I fill the form with:
|
||||
| Assignment name | Test assignment |
|
||||
| Description | Offline text |
|
||||
| assignsubmission_file_enabled | 0 |
|
||||
| Group mode | Separate groups |
|
||||
And I follow "Course 1"
|
||||
And I navigate to "Grades" node in "Course administration"
|
||||
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"
|
||||
And I give the grade "90.00" to the user "Student 3" for the grade item "Test assignment"
|
||||
And I give the grade "80.00" to the user "Student 4" for the grade item "Test assignment"
|
||||
And I give the grade "80.00" to the user "Student 5" for the grade item "Test assignment"
|
||||
And I give the grade "70.00" to the user "Student 6" for the grade item "Test assignment"
|
||||
And I press "Save changes"
|
||||
And I follow "Course 1"
|
||||
And I add the "Activity results" block
|
||||
Given I add the "Activity results" block
|
||||
When I configure the "Activity results" block
|
||||
And I set the following fields to these values:
|
||||
| id_config_showbest | 0 |
|
||||
@@ -375,37 +199,8 @@ Feature: The activity results block displays student scores
|
||||
And I should see "User S2" in the "Activity results" "block"
|
||||
And I should see "90.00%" in the "Activity results" "block"
|
||||
|
||||
@javascript
|
||||
Scenario: Try to configure the block on the course page to show multiple low scores using anonymous names
|
||||
Given I log in as "teacher1"
|
||||
And I follow "Course 1"
|
||||
And I expand "Users" node
|
||||
And I follow "Groups"
|
||||
And I add "Student 1 (student1@example.com)" user to "Group 1" group members
|
||||
And I add "Student 2 (student2@example.com)" user to "Group 1" group members
|
||||
And I add "Student 3 (student3@example.com)" user to "Group 2" group members
|
||||
And I add "Student 4 (student4@example.com)" user to "Group 2" group members
|
||||
And I add "Student 5 (student5@example.com)" user to "Group 3" group members
|
||||
And I add "Student 6 (student6@example.com)" user to "Group 3" group members
|
||||
And I follow "Course 1"
|
||||
And I turn editing mode on
|
||||
And I add a "Assignment" to section "1" and I fill the form with:
|
||||
| Assignment name | Test assignment |
|
||||
| Description | Offline text |
|
||||
| assignsubmission_file_enabled | 0 |
|
||||
| Group mode | Separate groups |
|
||||
And I follow "Course 1"
|
||||
And I navigate to "Grades" node in "Course administration"
|
||||
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"
|
||||
And I give the grade "90.00" to the user "Student 3" for the grade item "Test assignment"
|
||||
And I give the grade "80.00" to the user "Student 4" for the grade item "Test assignment"
|
||||
And I give the grade "80.00" to the user "Student 5" for the grade item "Test assignment"
|
||||
And I give the grade "70.00" to the user "Student 6" for the grade item "Test assignment"
|
||||
And I press "Save changes"
|
||||
And I follow "Course 1"
|
||||
And I add the "Activity results" block
|
||||
Given I add the "Activity results" block
|
||||
When I configure the "Activity results" block
|
||||
And I set the following fields to these values:
|
||||
| id_config_showbest | 0 |
|
||||
|
||||
@@ -33,19 +33,15 @@ Feature: The activity results block displays student scores
|
||||
| student4 | C1 | student |
|
||||
| student5 | C1 | student |
|
||||
| student6 | C1 | student |
|
||||
|
||||
@javascript
|
||||
Scenario: Configure the block on the course page to show 1 low score
|
||||
Given I log in as "teacher1"
|
||||
And I follow "Course 1"
|
||||
And I expand "Users" node
|
||||
And I follow "Groups"
|
||||
And I add "Student 1 (student1@example.com)" user to "Group 1" group members
|
||||
And I add "Student 2 (student2@example.com)" user to "Group 1" group members
|
||||
And I add "Student 3 (student3@example.com)" user to "Group 2" group members
|
||||
And I add "Student 4 (student4@example.com)" user to "Group 2" group members
|
||||
And I add "Student 5 (student5@example.com)" user to "Group 3" group members
|
||||
And I add "Student 6 (student6@example.com)" user to "Group 3" group members
|
||||
And the following "group members" exist:
|
||||
| user | group |
|
||||
| student1 | G1 |
|
||||
| student2 | G1 |
|
||||
| student3 | G2 |
|
||||
| student4 | G2 |
|
||||
| student5 | G3 |
|
||||
| student6 | G3 |
|
||||
And I log in as "teacher1"
|
||||
And I follow "Course 1"
|
||||
And I turn editing mode on
|
||||
And I add a "Assignment" to section "1" and I fill the form with:
|
||||
@@ -64,7 +60,9 @@ Feature: The activity results block displays student scores
|
||||
And I give the grade "70.00" to the user "Student 6" for the grade item "Test assignment"
|
||||
And I press "Save changes"
|
||||
And I follow "Course 1"
|
||||
And I add the "Activity results" block
|
||||
|
||||
Scenario: Configure the block on the course page to show 1 low score
|
||||
Given I add the "Activity results" block
|
||||
When I configure the "Activity results" block
|
||||
And I set the following fields to these values:
|
||||
| id_config_showbest | 0 |
|
||||
@@ -77,37 +75,8 @@ Feature: The activity results block displays student scores
|
||||
Then I should see "Group 3" in the "Activity results" "block"
|
||||
And I should see "75%" in the "Activity results" "block"
|
||||
|
||||
@javascript
|
||||
Scenario: Try to configure the block on the course page to show 1 low score as a fraction
|
||||
Given I log in as "teacher1"
|
||||
And I follow "Course 1"
|
||||
And I expand "Users" node
|
||||
And I follow "Groups"
|
||||
And I add "Student 1 (student1@example.com)" user to "Group 1" group members
|
||||
And I add "Student 2 (student2@example.com)" user to "Group 1" group members
|
||||
And I add "Student 3 (student3@example.com)" user to "Group 2" group members
|
||||
And I add "Student 4 (student4@example.com)" user to "Group 2" group members
|
||||
And I add "Student 5 (student5@example.com)" user to "Group 3" group members
|
||||
And I add "Student 6 (student6@example.com)" user to "Group 3" group members
|
||||
And I follow "Course 1"
|
||||
And I turn editing mode on
|
||||
And I add a "Assignment" to section "1" and I fill the form with:
|
||||
| Assignment name | Test assignment |
|
||||
| Description | Offline text |
|
||||
| assignsubmission_file_enabled | 0 |
|
||||
| Group mode | Visible groups |
|
||||
And I follow "Course 1"
|
||||
And I navigate to "Grades" node in "Course administration"
|
||||
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"
|
||||
And I give the grade "90.00" to the user "Student 3" for the grade item "Test assignment"
|
||||
And I give the grade "80.00" to the user "Student 4" for the grade item "Test assignment"
|
||||
And I give the grade "80.00" to the user "Student 5" for the grade item "Test assignment"
|
||||
And I give the grade "70.00" to the user "Student 6" for the grade item "Test assignment"
|
||||
And I press "Save changes"
|
||||
And I follow "Course 1"
|
||||
And I add the "Activity results" block
|
||||
Given I add the "Activity results" block
|
||||
When I configure the "Activity results" block
|
||||
And I set the following fields to these values:
|
||||
| id_config_showbest | 0 |
|
||||
@@ -122,37 +91,8 @@ Feature: The activity results block displays student scores
|
||||
And I should see "Group 3" in the "Activity results" "block"
|
||||
And I should see "75.00/100.00" in the "Activity results" "block"
|
||||
|
||||
@javascript
|
||||
Scenario: Try to configure the block on the course page to show 1 low score as a absolute numbers
|
||||
Given I log in as "teacher1"
|
||||
And I follow "Course 1"
|
||||
And I expand "Users" node
|
||||
And I follow "Groups"
|
||||
And I add "Student 1 (student1@example.com)" user to "Group 1" group members
|
||||
And I add "Student 2 (student2@example.com)" user to "Group 1" group members
|
||||
And I add "Student 3 (student3@example.com)" user to "Group 2" group members
|
||||
And I add "Student 4 (student4@example.com)" user to "Group 2" group members
|
||||
And I add "Student 5 (student5@example.com)" user to "Group 3" group members
|
||||
And I add "Student 6 (student6@example.com)" user to "Group 3" group members
|
||||
And I follow "Course 1"
|
||||
And I turn editing mode on
|
||||
And I add a "Assignment" to section "1" and I fill the form with:
|
||||
| Assignment name | Test assignment |
|
||||
| Description | Offline text |
|
||||
| assignsubmission_file_enabled | 0 |
|
||||
| Group mode | Visible groups |
|
||||
And I follow "Course 1"
|
||||
And I navigate to "Grades" node in "Course administration"
|
||||
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"
|
||||
And I give the grade "90.00" to the user "Student 3" for the grade item "Test assignment"
|
||||
And I give the grade "80.00" to the user "Student 4" for the grade item "Test assignment"
|
||||
And I give the grade "80.00" to the user "Student 5" for the grade item "Test assignment"
|
||||
And I give the grade "70.00" to the user "Student 6" for the grade item "Test assignment"
|
||||
And I press "Save changes"
|
||||
And I follow "Course 1"
|
||||
And I add the "Activity results" block
|
||||
Given I add the "Activity results" block
|
||||
When I configure the "Activity results" block
|
||||
And I set the following fields to these values:
|
||||
| id_config_showbest | 0 |
|
||||
@@ -167,37 +107,8 @@ Feature: The activity results block displays student scores
|
||||
And I should see "Group 3" in the "Activity results" "block"
|
||||
And I should see "75.00" in the "Activity results" "block"
|
||||
|
||||
@javascript
|
||||
Scenario: Try to configure the block on the course page to show multiple low scores as percentages
|
||||
Given I log in as "teacher1"
|
||||
And I follow "Course 1"
|
||||
And I expand "Users" node
|
||||
And I follow "Groups"
|
||||
And I add "Student 1 (student1@example.com)" user to "Group 1" group members
|
||||
And I add "Student 2 (student2@example.com)" user to "Group 1" group members
|
||||
And I add "Student 3 (student3@example.com)" user to "Group 2" group members
|
||||
And I add "Student 4 (student4@example.com)" user to "Group 2" group members
|
||||
And I add "Student 5 (student5@example.com)" user to "Group 3" group members
|
||||
And I add "Student 6 (student6@example.com)" user to "Group 3" group members
|
||||
And I follow "Course 1"
|
||||
And I turn editing mode on
|
||||
And I add a "Assignment" to section "1" and I fill the form with:
|
||||
| Assignment name | Test assignment |
|
||||
| Description | Offline text |
|
||||
| assignsubmission_file_enabled | 0 |
|
||||
| Group mode | Visible groups |
|
||||
And I follow "Course 1"
|
||||
And I navigate to "Grades" node in "Course administration"
|
||||
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"
|
||||
And I give the grade "90.00" to the user "Student 3" for the grade item "Test assignment"
|
||||
And I give the grade "80.00" to the user "Student 4" for the grade item "Test assignment"
|
||||
And I give the grade "80.00" to the user "Student 5" for the grade item "Test assignment"
|
||||
And I give the grade "70.00" to the user "Student 6" for the grade item "Test assignment"
|
||||
And I press "Save changes"
|
||||
And I follow "Course 1"
|
||||
And I add the "Activity results" block
|
||||
Given I add the "Activity results" block
|
||||
When I configure the "Activity results" block
|
||||
And I set the following fields to these values:
|
||||
| id_config_showbest | 0 |
|
||||
@@ -219,37 +130,8 @@ Feature: The activity results block displays student scores
|
||||
And I should see "Group 3" in the "Activity results" "block"
|
||||
And I should see "75%" in the "Activity results" "block"
|
||||
|
||||
@javascript
|
||||
Scenario: Try to configure the block on the course page to show multiple low scores as fractions
|
||||
Given I log in as "teacher1"
|
||||
And I follow "Course 1"
|
||||
And I expand "Users" node
|
||||
And I follow "Groups"
|
||||
And I add "Student 1 (student1@example.com)" user to "Group 1" group members
|
||||
And I add "Student 2 (student2@example.com)" user to "Group 1" group members
|
||||
And I add "Student 3 (student3@example.com)" user to "Group 2" group members
|
||||
And I add "Student 4 (student4@example.com)" user to "Group 2" group members
|
||||
And I add "Student 5 (student5@example.com)" user to "Group 3" group members
|
||||
And I add "Student 6 (student6@example.com)" user to "Group 3" group members
|
||||
And I follow "Course 1"
|
||||
And I turn editing mode on
|
||||
And I add a "Assignment" to section "1" and I fill the form with:
|
||||
| Assignment name | Test assignment |
|
||||
| Description | Offline text |
|
||||
| assignsubmission_file_enabled | 0 |
|
||||
| Group mode | Visible groups |
|
||||
And I follow "Course 1"
|
||||
And I navigate to "Grades" node in "Course administration"
|
||||
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"
|
||||
And I give the grade "90.00" to the user "Student 3" for the grade item "Test assignment"
|
||||
And I give the grade "80.00" to the user "Student 4" for the grade item "Test assignment"
|
||||
And I give the grade "80.00" to the user "Student 5" for the grade item "Test assignment"
|
||||
And I give the grade "70.00" to the user "Student 6" for the grade item "Test assignment"
|
||||
And I press "Save changes"
|
||||
And I follow "Course 1"
|
||||
And I add the "Activity results" block
|
||||
Given I add the "Activity results" block
|
||||
When I configure the "Activity results" block
|
||||
And I set the following fields to these values:
|
||||
| id_config_showbest | 0 |
|
||||
@@ -266,37 +148,8 @@ Feature: The activity results block displays student scores
|
||||
And I should see "Group 3" in the "Activity results" "block"
|
||||
And I should see "75.00/100.00" in the "Activity results" "block"
|
||||
|
||||
@javascript
|
||||
Scenario: Try to configure the block on the course page to show multiple low scores as absolute numbers
|
||||
Given I log in as "teacher1"
|
||||
And I follow "Course 1"
|
||||
And I expand "Users" node
|
||||
And I follow "Groups"
|
||||
And I add "Student 1 (student1@example.com)" user to "Group 1" group members
|
||||
And I add "Student 2 (student2@example.com)" user to "Group 1" group members
|
||||
And I add "Student 3 (student3@example.com)" user to "Group 2" group members
|
||||
And I add "Student 4 (student4@example.com)" user to "Group 2" group members
|
||||
And I add "Student 5 (student5@example.com)" user to "Group 3" group members
|
||||
And I add "Student 6 (student6@example.com)" user to "Group 3" group members
|
||||
And I follow "Course 1"
|
||||
And I turn editing mode on
|
||||
And I add a "Assignment" to section "1" and I fill the form with:
|
||||
| Assignment name | Test assignment |
|
||||
| Description | Offline text |
|
||||
| assignsubmission_file_enabled | 0 |
|
||||
| Group mode | Visible groups |
|
||||
And I follow "Course 1"
|
||||
And I navigate to "Grades" node in "Course administration"
|
||||
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"
|
||||
And I give the grade "90.00" to the user "Student 3" for the grade item "Test assignment"
|
||||
And I give the grade "80.00" to the user "Student 4" for the grade item "Test assignment"
|
||||
And I give the grade "80.00" to the user "Student 5" for the grade item "Test assignment"
|
||||
And I give the grade "70.00" to the user "Student 6" for the grade item "Test assignment"
|
||||
And I press "Save changes"
|
||||
And I follow "Course 1"
|
||||
And I add the "Activity results" block
|
||||
Given I add the "Activity results" block
|
||||
When I configure the "Activity results" block
|
||||
And I set the following fields to these values:
|
||||
| id_config_showbest | 0 |
|
||||
@@ -313,37 +166,8 @@ Feature: The activity results block displays student scores
|
||||
And I should see "Group 3" in the "Activity results" "block"
|
||||
And I should see "75.00" in the "Activity results" "block"
|
||||
|
||||
@javascript
|
||||
Scenario: Try to configure the block on the course page to show multiple low scores using ID numbers
|
||||
Given I log in as "teacher1"
|
||||
And I follow "Course 1"
|
||||
And I expand "Users" node
|
||||
And I follow "Groups"
|
||||
And I add "Student 1 (student1@example.com)" user to "Group 1" group members
|
||||
And I add "Student 2 (student2@example.com)" user to "Group 1" group members
|
||||
And I add "Student 3 (student3@example.com)" user to "Group 2" group members
|
||||
And I add "Student 4 (student4@example.com)" user to "Group 2" group members
|
||||
And I add "Student 5 (student5@example.com)" user to "Group 3" group members
|
||||
And I add "Student 6 (student6@example.com)" user to "Group 3" group members
|
||||
And I follow "Course 1"
|
||||
And I turn editing mode on
|
||||
And I add a "Assignment" to section "1" and I fill the form with:
|
||||
| Assignment name | Test assignment |
|
||||
| Description | Offline text |
|
||||
| assignsubmission_file_enabled | 0 |
|
||||
| Group mode | Visible groups |
|
||||
And I follow "Course 1"
|
||||
And I navigate to "Grades" node in "Course administration"
|
||||
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"
|
||||
And I give the grade "90.00" to the user "Student 3" for the grade item "Test assignment"
|
||||
And I give the grade "80.00" to the user "Student 4" for the grade item "Test assignment"
|
||||
And I give the grade "80.00" to the user "Student 5" for the grade item "Test assignment"
|
||||
And I give the grade "70.00" to the user "Student 6" for the grade item "Test assignment"
|
||||
And I press "Save changes"
|
||||
And I follow "Course 1"
|
||||
And I add the "Activity results" block
|
||||
Given I add the "Activity results" block
|
||||
When I configure the "Activity results" block
|
||||
And I set the following fields to these values:
|
||||
| id_config_showbest | 0 |
|
||||
@@ -359,37 +183,8 @@ Feature: The activity results block displays student scores
|
||||
And I should see "85.00%" in the "Activity results" "block"
|
||||
And I should see "75.00%" in the "Activity results" "block"
|
||||
|
||||
@javascript
|
||||
Scenario: Try to configure the block on the course page to show multiple low scores using anonymous names
|
||||
Given I log in as "teacher1"
|
||||
And I follow "Course 1"
|
||||
And I expand "Users" node
|
||||
And I follow "Groups"
|
||||
And I add "Student 1 (student1@example.com)" user to "Group 1" group members
|
||||
And I add "Student 2 (student2@example.com)" user to "Group 1" group members
|
||||
And I add "Student 3 (student3@example.com)" user to "Group 2" group members
|
||||
And I add "Student 4 (student4@example.com)" user to "Group 2" group members
|
||||
And I add "Student 5 (student5@example.com)" user to "Group 3" group members
|
||||
And I add "Student 6 (student6@example.com)" user to "Group 3" group members
|
||||
And I follow "Course 1"
|
||||
And I turn editing mode on
|
||||
And I add a "Assignment" to section "1" and I fill the form with:
|
||||
| Assignment name | Test assignment |
|
||||
| Description | Offline text |
|
||||
| assignsubmission_file_enabled | 0 |
|
||||
| Group mode | Visible groups |
|
||||
And I follow "Course 1"
|
||||
And I navigate to "Grades" node in "Course administration"
|
||||
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"
|
||||
And I give the grade "90.00" to the user "Student 3" for the grade item "Test assignment"
|
||||
And I give the grade "80.00" to the user "Student 4" for the grade item "Test assignment"
|
||||
And I give the grade "80.00" to the user "Student 5" for the grade item "Test assignment"
|
||||
And I give the grade "70.00" to the user "Student 6" for the grade item "Test assignment"
|
||||
And I press "Save changes"
|
||||
And I follow "Course 1"
|
||||
And I add the "Activity results" block
|
||||
Given I add the "Activity results" block
|
||||
When I configure the "Activity results" block
|
||||
And I set the following fields to these values:
|
||||
| id_config_showbest | 0 |
|
||||
|
||||
@@ -79,5 +79,8 @@ function xmldb_block_badges_upgrade($oldversion, $block) {
|
||||
// Moodle v2.9.0 release upgrade line.
|
||||
// Put any upgrade step following this.
|
||||
|
||||
// Moodle v3.0.0 release upgrade line.
|
||||
// Put any upgrade step following this.
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -79,5 +79,8 @@ function xmldb_block_calendar_month_upgrade($oldversion, $block) {
|
||||
// Moodle v2.9.0 release upgrade line.
|
||||
// Put any upgrade step following this.
|
||||
|
||||
// Moodle v3.0.0 release upgrade line.
|
||||
// Put any upgrade step following this.
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -79,5 +79,8 @@ function xmldb_block_calendar_upcoming_upgrade($oldversion, $block) {
|
||||
// Moodle v2.9.0 release upgrade line.
|
||||
// Put any upgrade step following this.
|
||||
|
||||
// Moodle v3.0.0 release upgrade line.
|
||||
// Put any upgrade step following this.
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -69,5 +69,8 @@ function xmldb_block_community_upgrade($oldversion) {
|
||||
// Moodle v2.9.0 release upgrade line.
|
||||
// Put any upgrade step following this.
|
||||
|
||||
// Moodle v3.0.0 release upgrade line.
|
||||
// Put any upgrade step following this.
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -76,5 +76,8 @@ function xmldb_block_completionstatus_upgrade($oldversion, $block) {
|
||||
// Moodle v2.9.0 release upgrade line.
|
||||
// Put any upgrade step following this.
|
||||
|
||||
// Moodle v3.0.0 release upgrade line.
|
||||
// Put any upgrade step following this.
|
||||
|
||||
return true;
|
||||
}
|
||||
@@ -80,5 +80,8 @@ function xmldb_block_course_summary_upgrade($oldversion, $block) {
|
||||
// Moodle v2.9.0 release upgrade line.
|
||||
// Put any upgrade step following this.
|
||||
|
||||
// Moodle v3.0.0 release upgrade line.
|
||||
// Put any upgrade step following this.
|
||||
|
||||
return true;
|
||||
}
|
||||
@@ -54,7 +54,7 @@ class block_edit_form extends moodleform {
|
||||
global $CFG;
|
||||
$this->block = $block;
|
||||
$this->page = $page;
|
||||
parent::moodleform($actionurl);
|
||||
parent::__construct($actionurl);
|
||||
}
|
||||
|
||||
function definition() {
|
||||
|
||||
@@ -84,14 +84,13 @@ class block_glossary_random extends block_base {
|
||||
$limitfrom = 0;
|
||||
$limitnum = 1;
|
||||
|
||||
$BROWSE = 'timemodified';
|
||||
$orderby = 'timemodified ASC';
|
||||
|
||||
switch ($this->config->type) {
|
||||
|
||||
case BGR_RANDOMLY:
|
||||
$i = rand(1,$numberofentries);
|
||||
$limitfrom = $i-1;
|
||||
$SORT = 'ASC';
|
||||
break;
|
||||
|
||||
case BGR_NEXTONE:
|
||||
@@ -104,11 +103,10 @@ class block_glossary_random extends block_base {
|
||||
$i = 1;
|
||||
}
|
||||
$limitfrom = $i-1;
|
||||
$SORT = 'ASC';
|
||||
break;
|
||||
|
||||
case BGR_NEXTALPHA:
|
||||
$BROWSE = 'concept';
|
||||
$orderby = 'concept ASC';
|
||||
if (isset($this->config->previous)) {
|
||||
$i = $this->config->previous + 1;
|
||||
} else {
|
||||
@@ -118,20 +116,19 @@ class block_glossary_random extends block_base {
|
||||
$i = 1;
|
||||
}
|
||||
$limitfrom = $i-1;
|
||||
$SORT = 'ASC';
|
||||
break;
|
||||
|
||||
default: // BGR_LASTMODIFIED
|
||||
$i = $numberofentries;
|
||||
$limitfrom = 0;
|
||||
$SORT = 'DESC';
|
||||
$orderby = 'timemodified DESC, id DESC';
|
||||
break;
|
||||
}
|
||||
|
||||
if ($entry = $DB->get_records_sql("SELECT id, concept, definition, definitionformat, definitiontrust
|
||||
FROM {glossary_entries}
|
||||
WHERE glossaryid = ? AND approved = 1
|
||||
ORDER BY $BROWSE $SORT", array($this->config->glossary), $limitfrom, $limitnum)) {
|
||||
ORDER BY $orderby", array($this->config->glossary), $limitfrom, $limitnum)) {
|
||||
|
||||
$entry = reset($entry);
|
||||
|
||||
|
||||
@@ -56,5 +56,8 @@ function xmldb_block_html_upgrade($oldversion) {
|
||||
// Moodle v2.9.0 release upgrade line.
|
||||
// Put any upgrade step following this.
|
||||
|
||||
// Moodle v3.0.0 release upgrade line.
|
||||
// Put any upgrade step following this.
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -81,5 +81,8 @@ function xmldb_block_navigation_upgrade($oldversion, $block) {
|
||||
// Moodle v2.9.0 release upgrade line.
|
||||
// Put any upgrade step following this.
|
||||
|
||||
// Moodle v3.0.0 release upgrade line.
|
||||
// Put any upgrade step following this.
|
||||
|
||||
return true;
|
||||
}
|
||||
@@ -36,31 +36,6 @@ defined('MOODLE_INTERNAL') || die();
|
||||
*/
|
||||
class block_online_users_generator extends testing_block_generator {
|
||||
|
||||
/**
|
||||
* Create new block instance
|
||||
* @param array|stdClass $record
|
||||
* @param array $options
|
||||
* @return stdClass activity record with extra cmid field
|
||||
*/
|
||||
public function create_instance($record = null, array $options = null) {
|
||||
global $DB, $CFG;
|
||||
require_once("$CFG->dirroot/mod/page/locallib.php");
|
||||
|
||||
$this->instancecount++;
|
||||
|
||||
$record = (object)(array)$record;
|
||||
$options = (array)$options;
|
||||
|
||||
$record = $this->prepare_record($record);
|
||||
|
||||
$id = $DB->insert_record('block_instances', $record);
|
||||
context_block::instance($id);
|
||||
|
||||
$instance = $DB->get_record('block_instances', array('id'=>$id), '*', MUST_EXIST);
|
||||
|
||||
return $instance;
|
||||
}
|
||||
|
||||
/**
|
||||
* Create (simulated) logged in users and add some of them to groups in a course
|
||||
*/
|
||||
|
||||
@@ -104,5 +104,8 @@ function xmldb_block_quiz_results_upgrade($oldversion, $block) {
|
||||
// Moodle v2.9.0 release upgrade line.
|
||||
// Put any upgrade step following this.
|
||||
|
||||
// Moodle v3.0.0 release upgrade line.
|
||||
// Put any upgrade step following this.
|
||||
|
||||
return true;
|
||||
}
|
||||
@@ -90,5 +90,8 @@ function xmldb_block_recent_activity_upgrade($oldversion, $block) {
|
||||
// Moodle v2.9.0 release upgrade line.
|
||||
// Put any upgrade step following this.
|
||||
|
||||
// Moodle v3.0.0 release upgrade line.
|
||||
// Put any upgrade step following this.
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -50,5 +50,8 @@ function xmldb_block_rss_client_upgrade($oldversion) {
|
||||
upgrade_block_savepoint(true, 2015071700, 'rss_client');
|
||||
}
|
||||
|
||||
// Moodle v3.0.0 release upgrade line.
|
||||
// Put any upgrade step following this.
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -36,7 +36,7 @@ class feed_edit_form extends moodleform {
|
||||
function __construct($actionurl, $isadding, $caneditshared) {
|
||||
$this->isadding = $isadding;
|
||||
$this->caneditshared = $caneditshared;
|
||||
parent::moodleform($actionurl);
|
||||
parent::__construct($actionurl);
|
||||
}
|
||||
|
||||
function definition() {
|
||||
|
||||
@@ -40,7 +40,7 @@ class block_rss_client_cron_testcase extends advanced_testcase {
|
||||
* than the current time the attempt is skipped.
|
||||
*/
|
||||
public function test_skip() {
|
||||
global $DB;
|
||||
global $DB, $CFG;
|
||||
$this->resetAfterTest();
|
||||
// Create a RSS feed record with a skip until time set to the future.
|
||||
$record = (object) array(
|
||||
@@ -57,8 +57,12 @@ class block_rss_client_cron_testcase extends advanced_testcase {
|
||||
|
||||
$block = new block_rss_client();
|
||||
ob_start();
|
||||
|
||||
// Silence SimplePie php notices.
|
||||
@$block->cron();
|
||||
$errorlevel = error_reporting($CFG->debug & ~E_USER_NOTICE);
|
||||
$block->cron();
|
||||
error_reporting($errorlevel);
|
||||
|
||||
$cronoutput = ob_get_clean();
|
||||
$this->assertContains('skipping until ' . userdate($record->skipuntil), $cronoutput);
|
||||
$this->assertContains('0 feeds refreshed (took ', $cronoutput);
|
||||
@@ -68,7 +72,7 @@ class block_rss_client_cron_testcase extends advanced_testcase {
|
||||
* Test that when a feed has an error the skip time is increaed correctly.
|
||||
*/
|
||||
public function test_error() {
|
||||
global $DB;
|
||||
global $DB, $CFG;
|
||||
$this->resetAfterTest();
|
||||
$time = time();
|
||||
// A record that has failed before.
|
||||
@@ -113,8 +117,12 @@ class block_rss_client_cron_testcase extends advanced_testcase {
|
||||
// Run the cron.
|
||||
$block = new block_rss_client();
|
||||
ob_start();
|
||||
|
||||
// Silence SimplePie php notices.
|
||||
@$block->cron();
|
||||
$errorlevel = error_reporting($CFG->debug & ~E_USER_NOTICE);
|
||||
$block->cron();
|
||||
error_reporting($errorlevel);
|
||||
|
||||
$cronoutput = ob_get_clean();
|
||||
$skiptime1 = $record->skiptime * 2;
|
||||
$message1 = 'http://example.com/rss Error: could not load/find the RSS feed - skipping for ' . $skiptime1 . ' seconds.';
|
||||
|
||||
@@ -92,5 +92,8 @@ function xmldb_block_section_links_upgrade($oldversion, $block) {
|
||||
// Moodle v2.9.0 release upgrade line.
|
||||
// Put any upgrade step following this.
|
||||
|
||||
// Moodle v3.0.0 release upgrade line.
|
||||
// Put any upgrade step following this.
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -80,5 +80,8 @@ function xmldb_block_selfcompletion_upgrade($oldversion, $block) {
|
||||
// Moodle v2.9.0 release upgrade line.
|
||||
// Put any upgrade step following this.
|
||||
|
||||
// Moodle v3.0.0 release upgrade line.
|
||||
// Put any upgrade step following this.
|
||||
|
||||
return true;
|
||||
}
|
||||
@@ -81,5 +81,8 @@ function xmldb_block_settings_upgrade($oldversion, $block) {
|
||||
// Moodle v2.9.0 release upgrade line.
|
||||
// Put any upgrade step following this.
|
||||
|
||||
// Moodle v3.0.0 release upgrade line.
|
||||
// Put any upgrade step following this.
|
||||
|
||||
return true;
|
||||
}
|
||||
+5
-4
@@ -141,14 +141,15 @@ if ($action === 'delete') {
|
||||
// Output edit mode title.
|
||||
echo $OUTPUT->heading($strblogs . ': ' . get_string('deleteentry', 'blog'), 2);
|
||||
|
||||
echo $OUTPUT->confirm(get_string('blogdeleteconfirm', 'blog'),
|
||||
new moodle_url('edit.php', $optionsyes),
|
||||
new moodle_url('index.php', $optionsno));
|
||||
|
||||
echo '<br />';
|
||||
// Output the entry.
|
||||
$entry->prepare_render();
|
||||
echo $output->render($entry);
|
||||
|
||||
echo '<br />';
|
||||
echo $OUTPUT->confirm(get_string('blogdeleteconfirm', 'blog'),
|
||||
new moodle_url('edit.php', $optionsyes),
|
||||
new moodle_url('index.php', $optionsno));
|
||||
echo $OUTPUT->footer();
|
||||
die;
|
||||
}
|
||||
|
||||
+2
-2
@@ -63,9 +63,9 @@ if ($entryid and !isset($userid)) {
|
||||
$userid = $entry->userid;
|
||||
}
|
||||
|
||||
if (isset($userid) && !isset($courseid)) {
|
||||
if (isset($userid) && empty($courseid)) {
|
||||
$context = context_user::instance($userid);
|
||||
} else if (isset($courseid) && $courseid != SITEID) {
|
||||
} else if (!empty($courseid) && $courseid != SITEID) {
|
||||
$context = context_course::instance($courseid);
|
||||
} else {
|
||||
$context = context_system::instance();
|
||||
|
||||
@@ -0,0 +1,43 @@
|
||||
@core @core_blog
|
||||
Feature: Delete a blog entry
|
||||
In order to manage my blog entries
|
||||
As a user
|
||||
I need to be able to delete entries I no longer wish to appear
|
||||
|
||||
Background:
|
||||
Given the following "users" exist:
|
||||
| username | firstname | lastname | email |
|
||||
| testuser | Test | User | moodle@example.com |
|
||||
And I log in as "testuser"
|
||||
And I expand "Site pages" node
|
||||
And I follow "Site blogs"
|
||||
And I follow "Add a new entry"
|
||||
And I set the following fields to these values:
|
||||
| Entry title | Blog post one |
|
||||
| Blog entry body | User 1 blog post content |
|
||||
And I press "Save changes"
|
||||
And I follow "Add a new entry"
|
||||
And I set the following fields to these values:
|
||||
| Entry title | Blog post two |
|
||||
| Blog entry body | User 1 blog post content |
|
||||
And I press "Save changes"
|
||||
And I am on site homepage
|
||||
And I expand "Site pages" node
|
||||
And I follow "Site blogs"
|
||||
|
||||
Scenario: Delete blog post results in post deleted
|
||||
Given I follow "Blog post one"
|
||||
And I follow "Delete"
|
||||
And I should see "Delete this blog entry?"
|
||||
When I press "Continue"
|
||||
Then I should not see "Blog post one"
|
||||
And I should see "Blog post two"
|
||||
|
||||
Scenario: Delete confirmation screen works and allows cancel
|
||||
Given I follow "Blog post one"
|
||||
When I follow "Delete"
|
||||
Then I should see "Delete this blog entry?"
|
||||
And I press "Cancel"
|
||||
And I should see "Blog post one"
|
||||
And I should see "Blog post two"
|
||||
|
||||
@@ -30,7 +30,7 @@ require_once($CFG->dirroot . '/blog/lib.php');
|
||||
/**
|
||||
* Test functions that rely on the DB tables
|
||||
*/
|
||||
class core_bloglib_testcase extends advanced_testcase {
|
||||
class core_blog_lib_testcase extends advanced_testcase {
|
||||
|
||||
private $courseid;
|
||||
private $cmid;
|
||||
@@ -472,5 +472,73 @@ class core_bloglib_testcase extends advanced_testcase {
|
||||
$this->assertEquals($url, $event->get_url());
|
||||
$this->assertEventContextNotUsed($event);
|
||||
}
|
||||
|
||||
/**
|
||||
* Tests the core_blog_myprofile_navigation() function.
|
||||
*/
|
||||
public function test_core_blog_myprofile_navigation() {
|
||||
global $USER;
|
||||
|
||||
// Set up the test.
|
||||
$tree = new \core_user\output\myprofile\tree();
|
||||
$this->setAdminUser();
|
||||
$iscurrentuser = true;
|
||||
$course = null;
|
||||
|
||||
// Enable blogs.
|
||||
set_config('enableblogs', true);
|
||||
|
||||
// Check the node tree is correct.
|
||||
core_blog_myprofile_navigation($tree, $USER, $iscurrentuser, $course);
|
||||
$reflector = new ReflectionObject($tree);
|
||||
$nodes = $reflector->getProperty('nodes');
|
||||
$nodes->setAccessible(true);
|
||||
$this->assertArrayHasKey('blogs', $nodes->getValue($tree));
|
||||
}
|
||||
|
||||
/**
|
||||
* Tests the core_blog_myprofile_navigation() function as a guest.
|
||||
*/
|
||||
public function test_core_blog_myprofile_navigation_as_guest() {
|
||||
global $USER;
|
||||
|
||||
// Set up the test.
|
||||
$tree = new \core_user\output\myprofile\tree();
|
||||
$iscurrentuser = false;
|
||||
$course = null;
|
||||
|
||||
// Set user as guest.
|
||||
$this->setGuestUser();
|
||||
|
||||
// Check the node tree is correct.
|
||||
core_blog_myprofile_navigation($tree, $USER, $iscurrentuser, $course);
|
||||
$reflector = new ReflectionObject($tree);
|
||||
$nodes = $reflector->getProperty('nodes');
|
||||
$nodes->setAccessible(true);
|
||||
$this->assertArrayNotHasKey('blogs', $nodes->getValue($tree));
|
||||
}
|
||||
|
||||
/**
|
||||
* Tests the core_blog_myprofile_navigation() function when blogs are disabled.
|
||||
*/
|
||||
public function test_core_blog_myprofile_navigation_blogs_disabled() {
|
||||
global $USER;
|
||||
|
||||
// Set up the test.
|
||||
$tree = new \core_user\output\myprofile\tree();
|
||||
$this->setAdminUser();
|
||||
$iscurrentuser = false;
|
||||
$course = null;
|
||||
|
||||
// Disable blogs.
|
||||
set_config('enableblogs', false);
|
||||
|
||||
// Check the node tree is correct.
|
||||
core_blog_myprofile_navigation($tree, $USER, $iscurrentuser, $course);
|
||||
$reflector = new ReflectionObject($tree);
|
||||
$nodes = $reflector->getProperty('nodes');
|
||||
$nodes->setAccessible(true);
|
||||
$this->assertArrayNotHasKey('blogs', $nodes->getValue($tree));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -41,12 +41,9 @@ Feature: Allow teachers to manually mark users as complete when configured
|
||||
And I follow "View course report"
|
||||
And I should see "Student First"
|
||||
And I follow "Click to mark user complete"
|
||||
# Running cron just after clicking sometimes fail, so navigate back
|
||||
# and ensure the student completion is updated before running cron.
|
||||
And I am on site homepage
|
||||
And I follow "Completion course"
|
||||
And I follow "View course report"
|
||||
And "//img[contains(@alt, 'Completed')]" "xpath_element" should exist in the "student1" "table_row"
|
||||
# Running cron just after clicking sometimes fail, as record
|
||||
# should be created before the cron runs.
|
||||
And I wait "1" seconds
|
||||
And I trigger cron
|
||||
And I am on site homepage
|
||||
And I log out
|
||||
|
||||
+1
-1
@@ -2,6 +2,6 @@
|
||||
"require-dev": {
|
||||
"phpunit/phpunit": "4.8.*",
|
||||
"phpunit/dbUnit": "1.4.*",
|
||||
"moodlehq/behat-extension": "1.30.1"
|
||||
"moodlehq/behat-extension": "1.30.2"
|
||||
}
|
||||
}
|
||||
|
||||
Generated
+189
-119
@@ -4,8 +4,8 @@
|
||||
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file",
|
||||
"This file is @generated automatically"
|
||||
],
|
||||
"hash": "85888280993254379afb3dd9a13fbf48",
|
||||
"content-hash": "2660fb1bd1498fa3f4f106caede044f4",
|
||||
"hash": "14326394ae10e01040808e94f1dd15b1",
|
||||
"content-hash": "cab7cffb6f9057c428c3ad41e61548ac",
|
||||
"packages": [],
|
||||
"packages-dev": [
|
||||
{
|
||||
@@ -663,16 +663,16 @@
|
||||
},
|
||||
{
|
||||
"name": "moodlehq/behat-extension",
|
||||
"version": "v1.30.1",
|
||||
"version": "v1.30.2",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/moodlehq/moodle-behat-extension.git",
|
||||
"reference": "7882d9331de46327c430b1572111e722378ab941"
|
||||
"reference": "89c0eb601d75bb60d77cb03b2ad09846265c604e"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/moodlehq/moodle-behat-extension/zipball/7882d9331de46327c430b1572111e722378ab941",
|
||||
"reference": "7882d9331de46327c430b1572111e722378ab941",
|
||||
"url": "https://api.github.com/repos/moodlehq/moodle-behat-extension/zipball/89c0eb601d75bb60d77cb03b2ad09846265c604e",
|
||||
"reference": "89c0eb601d75bb60d77cb03b2ad09846265c604e",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
@@ -686,6 +686,7 @@
|
||||
"symfony/browser-kit": "2.7.5",
|
||||
"symfony/css-selector": "2.7.5",
|
||||
"symfony/dom-crawler": "2.7.5",
|
||||
"symfony/filesystem": "2.7.5",
|
||||
"symfony/finder": "2.7.5"
|
||||
},
|
||||
"type": "library",
|
||||
@@ -712,7 +713,7 @@
|
||||
"Behat",
|
||||
"moodle"
|
||||
],
|
||||
"time": "2015-10-06 02:38:45"
|
||||
"time": "2016-01-05 02:43:00"
|
||||
},
|
||||
{
|
||||
"name": "phpdocumentor/reflection-docblock",
|
||||
@@ -884,16 +885,16 @@
|
||||
},
|
||||
{
|
||||
"name": "phpunit/php-code-coverage",
|
||||
"version": "2.2.3",
|
||||
"version": "2.2.4",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/sebastianbergmann/php-code-coverage.git",
|
||||
"reference": "ef1ca6835468857944d5c3b48fa503d5554cff2f"
|
||||
"reference": "eabf68b476ac7d0f73793aada060f1c1a9bf8979"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/ef1ca6835468857944d5c3b48fa503d5554cff2f",
|
||||
"reference": "ef1ca6835468857944d5c3b48fa503d5554cff2f",
|
||||
"url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/eabf68b476ac7d0f73793aada060f1c1a9bf8979",
|
||||
"reference": "eabf68b476ac7d0f73793aada060f1c1a9bf8979",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
@@ -942,7 +943,7 @@
|
||||
"testing",
|
||||
"xunit"
|
||||
],
|
||||
"time": "2015-09-14 06:51:16"
|
||||
"time": "2015-10-06 15:47:00"
|
||||
},
|
||||
{
|
||||
"name": "phpunit/php-file-iterator",
|
||||
@@ -1124,16 +1125,16 @@
|
||||
},
|
||||
{
|
||||
"name": "phpunit/phpunit",
|
||||
"version": "4.8.10",
|
||||
"version": "4.8.21",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/sebastianbergmann/phpunit.git",
|
||||
"reference": "463163747474815c5ccd4ae12b5b355ec12158e8"
|
||||
"reference": "ea76b17bced0500a28098626b84eda12dbcf119c"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/463163747474815c5ccd4ae12b5b355ec12158e8",
|
||||
"reference": "463163747474815c5ccd4ae12b5b355ec12158e8",
|
||||
"url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/ea76b17bced0500a28098626b84eda12dbcf119c",
|
||||
"reference": "ea76b17bced0500a28098626b84eda12dbcf119c",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
@@ -1192,7 +1193,7 @@
|
||||
"testing",
|
||||
"xunit"
|
||||
],
|
||||
"time": "2015-10-01 09:14:30"
|
||||
"time": "2015-12-12 07:45:58"
|
||||
},
|
||||
{
|
||||
"name": "phpunit/phpunit-mock-objects",
|
||||
@@ -1316,28 +1317,28 @@
|
||||
},
|
||||
{
|
||||
"name": "sebastian/diff",
|
||||
"version": "1.3.0",
|
||||
"version": "1.4.1",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/sebastianbergmann/diff.git",
|
||||
"reference": "863df9687835c62aa423a22412d26fa2ebde3fd3"
|
||||
"reference": "13edfd8706462032c2f52b4b862974dd46b71c9e"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/sebastianbergmann/diff/zipball/863df9687835c62aa423a22412d26fa2ebde3fd3",
|
||||
"reference": "863df9687835c62aa423a22412d26fa2ebde3fd3",
|
||||
"url": "https://api.github.com/repos/sebastianbergmann/diff/zipball/13edfd8706462032c2f52b4b862974dd46b71c9e",
|
||||
"reference": "13edfd8706462032c2f52b4b862974dd46b71c9e",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
"php": ">=5.3.3"
|
||||
},
|
||||
"require-dev": {
|
||||
"phpunit/phpunit": "~4.2"
|
||||
"phpunit/phpunit": "~4.8"
|
||||
},
|
||||
"type": "library",
|
||||
"extra": {
|
||||
"branch-alias": {
|
||||
"dev-master": "1.3-dev"
|
||||
"dev-master": "1.4-dev"
|
||||
}
|
||||
},
|
||||
"autoload": {
|
||||
@@ -1360,24 +1361,24 @@
|
||||
}
|
||||
],
|
||||
"description": "Diff implementation",
|
||||
"homepage": "http://www.github.com/sebastianbergmann/diff",
|
||||
"homepage": "https://github.com/sebastianbergmann/diff",
|
||||
"keywords": [
|
||||
"diff"
|
||||
],
|
||||
"time": "2015-02-22 15:13:53"
|
||||
"time": "2015-12-08 07:14:41"
|
||||
},
|
||||
{
|
||||
"name": "sebastian/environment",
|
||||
"version": "1.3.2",
|
||||
"version": "1.3.3",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/sebastianbergmann/environment.git",
|
||||
"reference": "6324c907ce7a52478eeeaede764f48733ef5ae44"
|
||||
"reference": "6e7133793a8e5a5714a551a8324337374be209df"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/sebastianbergmann/environment/zipball/6324c907ce7a52478eeeaede764f48733ef5ae44",
|
||||
"reference": "6324c907ce7a52478eeeaede764f48733ef5ae44",
|
||||
"url": "https://api.github.com/repos/sebastianbergmann/environment/zipball/6e7133793a8e5a5714a551a8324337374be209df",
|
||||
"reference": "6e7133793a8e5a5714a551a8324337374be209df",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
@@ -1414,7 +1415,7 @@
|
||||
"environment",
|
||||
"hhvm"
|
||||
],
|
||||
"time": "2015-08-03 06:14:51"
|
||||
"time": "2015-12-02 08:37:27"
|
||||
},
|
||||
{
|
||||
"name": "sebastian/exporter",
|
||||
@@ -1484,16 +1485,16 @@
|
||||
},
|
||||
{
|
||||
"name": "sebastian/global-state",
|
||||
"version": "1.0.0",
|
||||
"version": "1.1.1",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/sebastianbergmann/global-state.git",
|
||||
"reference": "c7428acdb62ece0a45e6306f1ae85e1c05b09c01"
|
||||
"reference": "bc37d50fea7d017d3d340f230811c9f1d7280af4"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/sebastianbergmann/global-state/zipball/c7428acdb62ece0a45e6306f1ae85e1c05b09c01",
|
||||
"reference": "c7428acdb62ece0a45e6306f1ae85e1c05b09c01",
|
||||
"url": "https://api.github.com/repos/sebastianbergmann/global-state/zipball/bc37d50fea7d017d3d340f230811c9f1d7280af4",
|
||||
"reference": "bc37d50fea7d017d3d340f230811c9f1d7280af4",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
@@ -1531,20 +1532,20 @@
|
||||
"keywords": [
|
||||
"global state"
|
||||
],
|
||||
"time": "2014-10-06 09:23:50"
|
||||
"time": "2015-10-12 03:26:01"
|
||||
},
|
||||
{
|
||||
"name": "sebastian/recursion-context",
|
||||
"version": "1.0.1",
|
||||
"version": "1.0.2",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/sebastianbergmann/recursion-context.git",
|
||||
"reference": "994d4a811bafe801fb06dccbee797863ba2792ba"
|
||||
"reference": "913401df809e99e4f47b27cdd781f4a258d58791"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/sebastianbergmann/recursion-context/zipball/994d4a811bafe801fb06dccbee797863ba2792ba",
|
||||
"reference": "994d4a811bafe801fb06dccbee797863ba2792ba",
|
||||
"url": "https://api.github.com/repos/sebastianbergmann/recursion-context/zipball/913401df809e99e4f47b27cdd781f4a258d58791",
|
||||
"reference": "913401df809e99e4f47b27cdd781f4a258d58791",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
@@ -1584,7 +1585,7 @@
|
||||
],
|
||||
"description": "Provides functionality to recursively process PHP variables",
|
||||
"homepage": "http://www.github.com/sebastianbergmann/recursion-context",
|
||||
"time": "2015-06-21 08:04:50"
|
||||
"time": "2015-11-11 19:50:13"
|
||||
},
|
||||
{
|
||||
"name": "sebastian/version",
|
||||
@@ -1678,35 +1679,35 @@
|
||||
},
|
||||
{
|
||||
"name": "symfony/config",
|
||||
"version": "v2.7.5",
|
||||
"version": "v2.8.1",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/symfony/config.git",
|
||||
"reference": "9698fdf0a750d6887d5e7729d5cf099765b20e61"
|
||||
"reference": "17d4b2e64ce1c6ba7caa040f14469b3c44d7f7d2"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/symfony/config/zipball/9698fdf0a750d6887d5e7729d5cf099765b20e61",
|
||||
"reference": "9698fdf0a750d6887d5e7729d5cf099765b20e61",
|
||||
"url": "https://api.github.com/repos/symfony/config/zipball/17d4b2e64ce1c6ba7caa040f14469b3c44d7f7d2",
|
||||
"reference": "17d4b2e64ce1c6ba7caa040f14469b3c44d7f7d2",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
"php": ">=5.3.9",
|
||||
"symfony/filesystem": "~2.3"
|
||||
},
|
||||
"require-dev": {
|
||||
"symfony/phpunit-bridge": "~2.7"
|
||||
"symfony/filesystem": "~2.3|~3.0.0"
|
||||
},
|
||||
"type": "library",
|
||||
"extra": {
|
||||
"branch-alias": {
|
||||
"dev-master": "2.7-dev"
|
||||
"dev-master": "2.8-dev"
|
||||
}
|
||||
},
|
||||
"autoload": {
|
||||
"psr-4": {
|
||||
"Symfony\\Component\\Config\\": ""
|
||||
}
|
||||
},
|
||||
"exclude-from-classmap": [
|
||||
"/Tests/"
|
||||
]
|
||||
},
|
||||
"notification-url": "https://packagist.org/downloads/",
|
||||
"license": [
|
||||
@@ -1724,30 +1725,30 @@
|
||||
],
|
||||
"description": "Symfony Config Component",
|
||||
"homepage": "https://symfony.com",
|
||||
"time": "2015-09-21 15:02:29"
|
||||
"time": "2015-12-26 13:37:56"
|
||||
},
|
||||
{
|
||||
"name": "symfony/console",
|
||||
"version": "v2.7.5",
|
||||
"version": "v2.8.1",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/symfony/console.git",
|
||||
"reference": "06cb17c013a82f94a3d840682b49425cd00a2161"
|
||||
"reference": "2e06a5ccb19dcf9b89f1c6a677a39a8df773635a"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/symfony/console/zipball/06cb17c013a82f94a3d840682b49425cd00a2161",
|
||||
"reference": "06cb17c013a82f94a3d840682b49425cd00a2161",
|
||||
"url": "https://api.github.com/repos/symfony/console/zipball/2e06a5ccb19dcf9b89f1c6a677a39a8df773635a",
|
||||
"reference": "2e06a5ccb19dcf9b89f1c6a677a39a8df773635a",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
"php": ">=5.3.9"
|
||||
"php": ">=5.3.9",
|
||||
"symfony/polyfill-mbstring": "~1.0"
|
||||
},
|
||||
"require-dev": {
|
||||
"psr/log": "~1.0",
|
||||
"symfony/event-dispatcher": "~2.1",
|
||||
"symfony/phpunit-bridge": "~2.7",
|
||||
"symfony/process": "~2.1"
|
||||
"symfony/event-dispatcher": "~2.1|~3.0.0",
|
||||
"symfony/process": "~2.1|~3.0.0"
|
||||
},
|
||||
"suggest": {
|
||||
"psr/log": "For using the console logger",
|
||||
@@ -1757,13 +1758,16 @@
|
||||
"type": "library",
|
||||
"extra": {
|
||||
"branch-alias": {
|
||||
"dev-master": "2.7-dev"
|
||||
"dev-master": "2.8-dev"
|
||||
}
|
||||
},
|
||||
"autoload": {
|
||||
"psr-4": {
|
||||
"Symfony\\Component\\Console\\": ""
|
||||
}
|
||||
},
|
||||
"exclude-from-classmap": [
|
||||
"/Tests/"
|
||||
]
|
||||
},
|
||||
"notification-url": "https://packagist.org/downloads/",
|
||||
"license": [
|
||||
@@ -1781,7 +1785,7 @@
|
||||
],
|
||||
"description": "Symfony Console Component",
|
||||
"homepage": "https://symfony.com",
|
||||
"time": "2015-09-25 08:32:23"
|
||||
"time": "2015-12-22 10:25:57"
|
||||
},
|
||||
{
|
||||
"name": "symfony/css-selector",
|
||||
@@ -1838,16 +1842,16 @@
|
||||
},
|
||||
{
|
||||
"name": "symfony/dependency-injection",
|
||||
"version": "v2.7.5",
|
||||
"version": "v2.8.1",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/symfony/dependency-injection.git",
|
||||
"reference": "422c3819b110f610d79c6f1dc38af23787dc790e"
|
||||
"reference": "c5086d186f538c2711b9af6f727be7b0446979cd"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/symfony/dependency-injection/zipball/422c3819b110f610d79c6f1dc38af23787dc790e",
|
||||
"reference": "422c3819b110f610d79c6f1dc38af23787dc790e",
|
||||
"url": "https://api.github.com/repos/symfony/dependency-injection/zipball/c5086d186f538c2711b9af6f727be7b0446979cd",
|
||||
"reference": "c5086d186f538c2711b9af6f727be7b0446979cd",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
@@ -1857,10 +1861,9 @@
|
||||
"symfony/expression-language": "<2.6"
|
||||
},
|
||||
"require-dev": {
|
||||
"symfony/config": "~2.2",
|
||||
"symfony/expression-language": "~2.6",
|
||||
"symfony/phpunit-bridge": "~2.7",
|
||||
"symfony/yaml": "~2.1"
|
||||
"symfony/config": "~2.2|~3.0.0",
|
||||
"symfony/expression-language": "~2.6|~3.0.0",
|
||||
"symfony/yaml": "~2.1|~3.0.0"
|
||||
},
|
||||
"suggest": {
|
||||
"symfony/config": "",
|
||||
@@ -1870,13 +1873,16 @@
|
||||
"type": "library",
|
||||
"extra": {
|
||||
"branch-alias": {
|
||||
"dev-master": "2.7-dev"
|
||||
"dev-master": "2.8-dev"
|
||||
}
|
||||
},
|
||||
"autoload": {
|
||||
"psr-4": {
|
||||
"Symfony\\Component\\DependencyInjection\\": ""
|
||||
}
|
||||
},
|
||||
"exclude-from-classmap": [
|
||||
"/Tests/"
|
||||
]
|
||||
},
|
||||
"notification-url": "https://packagist.org/downloads/",
|
||||
"license": [
|
||||
@@ -1894,7 +1900,7 @@
|
||||
],
|
||||
"description": "Symfony DependencyInjection Component",
|
||||
"homepage": "https://symfony.com",
|
||||
"time": "2015-09-15 08:30:42"
|
||||
"time": "2015-12-26 13:37:56"
|
||||
},
|
||||
{
|
||||
"name": "symfony/dom-crawler",
|
||||
@@ -1951,16 +1957,16 @@
|
||||
},
|
||||
{
|
||||
"name": "symfony/event-dispatcher",
|
||||
"version": "v2.7.5",
|
||||
"version": "v2.8.1",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/symfony/event-dispatcher.git",
|
||||
"reference": "ae4dcc2a8d3de98bd794167a3ccda1311597c5d9"
|
||||
"reference": "a5eb815363c0388e83247e7e9853e5dbc14999cc"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/symfony/event-dispatcher/zipball/ae4dcc2a8d3de98bd794167a3ccda1311597c5d9",
|
||||
"reference": "ae4dcc2a8d3de98bd794167a3ccda1311597c5d9",
|
||||
"url": "https://api.github.com/repos/symfony/event-dispatcher/zipball/a5eb815363c0388e83247e7e9853e5dbc14999cc",
|
||||
"reference": "a5eb815363c0388e83247e7e9853e5dbc14999cc",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
@@ -1968,11 +1974,10 @@
|
||||
},
|
||||
"require-dev": {
|
||||
"psr/log": "~1.0",
|
||||
"symfony/config": "~2.0,>=2.0.5",
|
||||
"symfony/dependency-injection": "~2.6",
|
||||
"symfony/expression-language": "~2.6",
|
||||
"symfony/phpunit-bridge": "~2.7",
|
||||
"symfony/stopwatch": "~2.3"
|
||||
"symfony/config": "~2.0,>=2.0.5|~3.0.0",
|
||||
"symfony/dependency-injection": "~2.6|~3.0.0",
|
||||
"symfony/expression-language": "~2.6|~3.0.0",
|
||||
"symfony/stopwatch": "~2.3|~3.0.0"
|
||||
},
|
||||
"suggest": {
|
||||
"symfony/dependency-injection": "",
|
||||
@@ -1981,13 +1986,16 @@
|
||||
"type": "library",
|
||||
"extra": {
|
||||
"branch-alias": {
|
||||
"dev-master": "2.7-dev"
|
||||
"dev-master": "2.8-dev"
|
||||
}
|
||||
},
|
||||
"autoload": {
|
||||
"psr-4": {
|
||||
"Symfony\\Component\\EventDispatcher\\": ""
|
||||
}
|
||||
},
|
||||
"exclude-from-classmap": [
|
||||
"/Tests/"
|
||||
]
|
||||
},
|
||||
"notification-url": "https://packagist.org/downloads/",
|
||||
"license": [
|
||||
@@ -2005,7 +2013,7 @@
|
||||
],
|
||||
"description": "Symfony EventDispatcher Component",
|
||||
"homepage": "https://symfony.com",
|
||||
"time": "2015-09-22 13:49:29"
|
||||
"time": "2015-10-30 20:15:42"
|
||||
},
|
||||
{
|
||||
"name": "symfony/filesystem",
|
||||
@@ -2106,35 +2114,94 @@
|
||||
"time": "2015-09-19 19:59:23"
|
||||
},
|
||||
{
|
||||
"name": "symfony/process",
|
||||
"version": "v2.7.5",
|
||||
"name": "symfony/polyfill-mbstring",
|
||||
"version": "v1.0.1",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/symfony/process.git",
|
||||
"reference": "b27c8e317922cd3cdd3600850273cf6b82b2e8e9"
|
||||
"url": "https://github.com/symfony/polyfill-mbstring.git",
|
||||
"reference": "49ff736bd5d41f45240cec77b44967d76e0c3d25"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/symfony/process/zipball/b27c8e317922cd3cdd3600850273cf6b82b2e8e9",
|
||||
"reference": "b27c8e317922cd3cdd3600850273cf6b82b2e8e9",
|
||||
"url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/49ff736bd5d41f45240cec77b44967d76e0c3d25",
|
||||
"reference": "49ff736bd5d41f45240cec77b44967d76e0c3d25",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
"php": ">=5.3.3"
|
||||
},
|
||||
"suggest": {
|
||||
"ext-mbstring": "For best performance"
|
||||
},
|
||||
"type": "library",
|
||||
"extra": {
|
||||
"branch-alias": {
|
||||
"dev-master": "1.0-dev"
|
||||
}
|
||||
},
|
||||
"autoload": {
|
||||
"psr-4": {
|
||||
"Symfony\\Polyfill\\Mbstring\\": ""
|
||||
},
|
||||
"files": [
|
||||
"bootstrap.php"
|
||||
]
|
||||
},
|
||||
"notification-url": "https://packagist.org/downloads/",
|
||||
"license": [
|
||||
"MIT"
|
||||
],
|
||||
"authors": [
|
||||
{
|
||||
"name": "Nicolas Grekas",
|
||||
"email": "p@tchwork.com"
|
||||
},
|
||||
{
|
||||
"name": "Symfony Community",
|
||||
"homepage": "https://symfony.com/contributors"
|
||||
}
|
||||
],
|
||||
"description": "Symfony polyfill for the Mbstring extension",
|
||||
"homepage": "https://symfony.com",
|
||||
"keywords": [
|
||||
"compatibility",
|
||||
"mbstring",
|
||||
"polyfill",
|
||||
"portable",
|
||||
"shim"
|
||||
],
|
||||
"time": "2015-11-20 09:19:13"
|
||||
},
|
||||
{
|
||||
"name": "symfony/process",
|
||||
"version": "v2.8.1",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/symfony/process.git",
|
||||
"reference": "62c254438b5040bc2217156e1570cf2206e8540c"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/symfony/process/zipball/62c254438b5040bc2217156e1570cf2206e8540c",
|
||||
"reference": "62c254438b5040bc2217156e1570cf2206e8540c",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
"php": ">=5.3.9"
|
||||
},
|
||||
"require-dev": {
|
||||
"symfony/phpunit-bridge": "~2.7"
|
||||
},
|
||||
"type": "library",
|
||||
"extra": {
|
||||
"branch-alias": {
|
||||
"dev-master": "2.7-dev"
|
||||
"dev-master": "2.8-dev"
|
||||
}
|
||||
},
|
||||
"autoload": {
|
||||
"psr-4": {
|
||||
"Symfony\\Component\\Process\\": ""
|
||||
}
|
||||
},
|
||||
"exclude-from-classmap": [
|
||||
"/Tests/"
|
||||
]
|
||||
},
|
||||
"notification-url": "https://packagist.org/downloads/",
|
||||
"license": [
|
||||
@@ -2152,34 +2219,34 @@
|
||||
],
|
||||
"description": "Symfony Process Component",
|
||||
"homepage": "https://symfony.com",
|
||||
"time": "2015-09-19 19:59:23"
|
||||
"time": "2015-12-23 11:03:46"
|
||||
},
|
||||
{
|
||||
"name": "symfony/translation",
|
||||
"version": "v2.7.5",
|
||||
"version": "v2.8.1",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/symfony/translation.git",
|
||||
"reference": "485877661835e188cd78345c6d4eef1290d17571"
|
||||
"reference": "c1db87c51251167dd91198b9d1edf897773adb4f"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/symfony/translation/zipball/485877661835e188cd78345c6d4eef1290d17571",
|
||||
"reference": "485877661835e188cd78345c6d4eef1290d17571",
|
||||
"url": "https://api.github.com/repos/symfony/translation/zipball/c1db87c51251167dd91198b9d1edf897773adb4f",
|
||||
"reference": "c1db87c51251167dd91198b9d1edf897773adb4f",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
"php": ">=5.3.9"
|
||||
"php": ">=5.3.9",
|
||||
"symfony/polyfill-mbstring": "~1.0"
|
||||
},
|
||||
"conflict": {
|
||||
"symfony/config": "<2.7"
|
||||
},
|
||||
"require-dev": {
|
||||
"psr/log": "~1.0",
|
||||
"symfony/config": "~2.7",
|
||||
"symfony/intl": "~2.4",
|
||||
"symfony/phpunit-bridge": "~2.7",
|
||||
"symfony/yaml": "~2.2"
|
||||
"symfony/config": "~2.8",
|
||||
"symfony/intl": "~2.4|~3.0.0",
|
||||
"symfony/yaml": "~2.2|~3.0.0"
|
||||
},
|
||||
"suggest": {
|
||||
"psr/log": "To use logging capability in translator",
|
||||
@@ -2189,13 +2256,16 @@
|
||||
"type": "library",
|
||||
"extra": {
|
||||
"branch-alias": {
|
||||
"dev-master": "2.7-dev"
|
||||
"dev-master": "2.8-dev"
|
||||
}
|
||||
},
|
||||
"autoload": {
|
||||
"psr-4": {
|
||||
"Symfony\\Component\\Translation\\": ""
|
||||
}
|
||||
},
|
||||
"exclude-from-classmap": [
|
||||
"/Tests/"
|
||||
]
|
||||
},
|
||||
"notification-url": "https://packagist.org/downloads/",
|
||||
"license": [
|
||||
@@ -2213,38 +2283,38 @@
|
||||
],
|
||||
"description": "Symfony Translation Component",
|
||||
"homepage": "https://symfony.com",
|
||||
"time": "2015-09-06 08:36:38"
|
||||
"time": "2015-12-05 17:37:59"
|
||||
},
|
||||
{
|
||||
"name": "symfony/yaml",
|
||||
"version": "v2.7.5",
|
||||
"version": "v2.8.1",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/symfony/yaml.git",
|
||||
"reference": "31cb2ad0155c95b88ee55fe12bc7ff92232c1770"
|
||||
"reference": "ac84cbb98b68a6abbc9f5149eb96ccc7b07b8966"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/symfony/yaml/zipball/31cb2ad0155c95b88ee55fe12bc7ff92232c1770",
|
||||
"reference": "31cb2ad0155c95b88ee55fe12bc7ff92232c1770",
|
||||
"url": "https://api.github.com/repos/symfony/yaml/zipball/ac84cbb98b68a6abbc9f5149eb96ccc7b07b8966",
|
||||
"reference": "ac84cbb98b68a6abbc9f5149eb96ccc7b07b8966",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
"php": ">=5.3.9"
|
||||
},
|
||||
"require-dev": {
|
||||
"symfony/phpunit-bridge": "~2.7"
|
||||
},
|
||||
"type": "library",
|
||||
"extra": {
|
||||
"branch-alias": {
|
||||
"dev-master": "2.7-dev"
|
||||
"dev-master": "2.8-dev"
|
||||
}
|
||||
},
|
||||
"autoload": {
|
||||
"psr-4": {
|
||||
"Symfony\\Component\\Yaml\\": ""
|
||||
}
|
||||
},
|
||||
"exclude-from-classmap": [
|
||||
"/Tests/"
|
||||
]
|
||||
},
|
||||
"notification-url": "https://packagist.org/downloads/",
|
||||
"license": [
|
||||
@@ -2262,7 +2332,7 @@
|
||||
],
|
||||
"description": "Symfony Yaml Component",
|
||||
"homepage": "https://symfony.com",
|
||||
"time": "2015-09-14 14:14:09"
|
||||
"time": "2015-12-26 13:37:56"
|
||||
}
|
||||
],
|
||||
"aliases": [],
|
||||
|
||||
@@ -1130,7 +1130,7 @@ class core_course_management_renderer extends plugin_renderer_base {
|
||||
$totalpages = ceil($totalcourses / $perpage);
|
||||
if ($showtotals) {
|
||||
if ($totalpages == 0) {
|
||||
$str = get_string('nocoursesfound', 'moodle', $search);
|
||||
$str = get_string('nocoursesfound', 'moodle', s($search));
|
||||
} else if ($totalpages == 1) {
|
||||
$str = get_string('showingacourses', 'moodle', $totalcourses);
|
||||
} else {
|
||||
|
||||
@@ -23,6 +23,7 @@ Background:
|
||||
And I press "Post to forum"
|
||||
And I wait to be redirected
|
||||
And I follow "Course 1"
|
||||
And I wait "1" seconds
|
||||
And I press "Add a new discussion topic"
|
||||
And I set the following fields to these values:
|
||||
| Subject | Forum Post 9 |
|
||||
@@ -30,6 +31,7 @@ Background:
|
||||
And I press "Post to forum"
|
||||
And I wait to be redirected
|
||||
And I follow "Course 1"
|
||||
And I wait "1" seconds
|
||||
And I press "Add a new discussion topic"
|
||||
And I set the following fields to these values:
|
||||
| Subject | Forum Post 8 |
|
||||
@@ -37,6 +39,7 @@ Background:
|
||||
And I press "Post to forum"
|
||||
And I wait to be redirected
|
||||
And I follow "Course 1"
|
||||
And I wait "1" seconds
|
||||
And I press "Add a new discussion topic"
|
||||
And I set the following fields to these values:
|
||||
| Subject | Forum Post 7 |
|
||||
@@ -44,6 +47,7 @@ Background:
|
||||
And I press "Post to forum"
|
||||
And I wait to be redirected
|
||||
And I follow "Course 1"
|
||||
And I wait "1" seconds
|
||||
And I press "Add a new discussion topic"
|
||||
And I set the following fields to these values:
|
||||
| Subject | Forum Post 6 |
|
||||
@@ -51,6 +55,7 @@ Background:
|
||||
And I press "Post to forum"
|
||||
And I wait to be redirected
|
||||
And I follow "Course 1"
|
||||
And I wait "1" seconds
|
||||
And I press "Add a new discussion topic"
|
||||
And I set the following fields to these values:
|
||||
| Subject | Forum Post 5 |
|
||||
@@ -58,6 +63,7 @@ Background:
|
||||
And I press "Post to forum"
|
||||
And I wait to be redirected
|
||||
And I follow "Course 1"
|
||||
And I wait "1" seconds
|
||||
And I press "Add a new discussion topic"
|
||||
And I set the following fields to these values:
|
||||
| Subject | Forum Post 4 |
|
||||
@@ -65,6 +71,7 @@ Background:
|
||||
And I press "Post to forum"
|
||||
And I wait to be redirected
|
||||
And I follow "Course 1"
|
||||
And I wait "1" seconds
|
||||
And I press "Add a new discussion topic"
|
||||
And I set the following fields to these values:
|
||||
| Subject | Forum Post 3 |
|
||||
@@ -72,6 +79,7 @@ Background:
|
||||
And I press "Post to forum"
|
||||
And I wait to be redirected
|
||||
And I follow "Course 1"
|
||||
And I wait "1" seconds
|
||||
And I press "Add a new discussion topic"
|
||||
And I set the following fields to these values:
|
||||
| Subject | Forum Post 2 |
|
||||
@@ -79,6 +87,7 @@ Background:
|
||||
And I press "Post to forum"
|
||||
And I wait to be redirected
|
||||
And I follow "Course 1"
|
||||
And I wait "1" seconds
|
||||
And I press "Add a new discussion topic"
|
||||
And I set the following fields to these values:
|
||||
| Subject | Forum Post 1 |
|
||||
|
||||
@@ -2486,6 +2486,8 @@ function save_local_role_names($courseid, $data) {
|
||||
$rolename->name = $value;
|
||||
$DB->insert_record('role_names', $rolename);
|
||||
}
|
||||
// This will ensure the course contacts cache is purged..
|
||||
coursecat::role_assignment_changed($roleid, $context);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
+3
-2
@@ -106,7 +106,8 @@ if (!empty($add)) {
|
||||
$optionsyes = array('confirm'=>1, 'delete'=>$cm->id, 'sesskey'=>sesskey(), 'sr' => $sectionreturn);
|
||||
|
||||
$strdeletecheck = get_string('deletecheck', '', $fullmodulename);
|
||||
$strdeletecheckfull = get_string('deletecheckfull', '', "$fullmodulename '$cm->name'");
|
||||
$strparams = (object)array('type' => $fullmodulename, 'name' => $cm->name);
|
||||
$strdeletechecktypename = get_string('deletechecktypename', '', $strparams);
|
||||
|
||||
$PAGE->set_pagetype('mod-' . $cm->modname . '-delete');
|
||||
$PAGE->set_title($strdeletecheck);
|
||||
@@ -117,7 +118,7 @@ if (!empty($add)) {
|
||||
echo $OUTPUT->box_start('noticebox');
|
||||
$formcontinue = new single_button(new moodle_url("$CFG->wwwroot/course/mod.php", $optionsyes), get_string('yes'));
|
||||
$formcancel = new single_button($return, get_string('no'), 'get');
|
||||
echo $OUTPUT->confirm($strdeletecheckfull, $formcontinue, $formcancel);
|
||||
echo $OUTPUT->confirm($strdeletechecktypename, $formcontinue, $formcancel);
|
||||
echo $OUTPUT->box_end();
|
||||
echo $OUTPUT->footer();
|
||||
|
||||
|
||||
+4
-5
@@ -187,15 +187,14 @@ if (!empty($add)) {
|
||||
|
||||
if ($items = grade_item::fetch_all(array('itemtype'=>'mod', 'itemmodule'=>$data->modulename,
|
||||
'iteminstance'=>$data->instance, 'courseid'=>$course->id))) {
|
||||
// add existing outcomes
|
||||
// Add existing outcomes.
|
||||
foreach ($items as $item) {
|
||||
if (!empty($item->gradepass)) {
|
||||
if (!empty($item->outcomeid)) {
|
||||
$data->{'outcome_' . $item->outcomeid} = 1;
|
||||
} else if (!empty($item->gradepass)) {
|
||||
$decimalpoints = $item->get_decimals();
|
||||
$data->gradepass = format_float($item->gradepass, $decimalpoints);
|
||||
}
|
||||
if (!empty($item->outcomeid)) {
|
||||
$data->{'outcome_'.$item->outcomeid} = 1;
|
||||
}
|
||||
}
|
||||
|
||||
// set category if present
|
||||
|
||||
@@ -58,7 +58,7 @@ abstract class moodleform_mod extends moodleform {
|
||||
/** @var object The course format of the current course. */
|
||||
protected $courseformat;
|
||||
|
||||
function moodleform_mod($current, $section, $cm, $course) {
|
||||
public function __construct($current, $section, $cm, $course) {
|
||||
global $CFG;
|
||||
|
||||
$this->current = $current;
|
||||
@@ -83,7 +83,14 @@ abstract class moodleform_mod extends moodleform {
|
||||
}
|
||||
$this->_modname = $matches[1];
|
||||
$this->init_features();
|
||||
parent::moodleform('modedit.php');
|
||||
parent::__construct('modedit.php');
|
||||
}
|
||||
|
||||
/**
|
||||
* Old syntax of class constructor for backward compatibility.
|
||||
*/
|
||||
public function moodleform_mod($current, $section, $cm, $course) {
|
||||
self::__construct($current, $section, $cm, $course);
|
||||
}
|
||||
|
||||
protected function init_features() {
|
||||
|
||||
@@ -0,0 +1,31 @@
|
||||
@core @core_course
|
||||
Feature: Rename roles in a course
|
||||
In order to account for course-level differences
|
||||
As a teacher
|
||||
I need to be able to rename roles
|
||||
|
||||
Background:
|
||||
Given the following "users" exist:
|
||||
| username | firstname | lastname | email |
|
||||
| student1 | Student | 1 | student1@example.com |
|
||||
| teacher1 | Teacher | 1 | teacher1@example.com |
|
||||
And the following "courses" exist:
|
||||
| fullname | shortname |
|
||||
| Course 1 | C1 |
|
||||
And the following "course enrolments" exist:
|
||||
| user | course | role |
|
||||
| student1 | C1 | student |
|
||||
| teacher1 | C1 | editingteacher |
|
||||
|
||||
Scenario: Teacher can rename roles
|
||||
Given I log in as "teacher1"
|
||||
And I follow "Course 1"
|
||||
And I click on "Edit settings" "link" in the "Administration" "block"
|
||||
And I should see "Role renaming"
|
||||
When I set the following fields to these values:
|
||||
| Your word for 'Teacher' | Lecturer |
|
||||
| Your word for 'Student' | Learner |
|
||||
And I press "Save and display"
|
||||
And I navigate to "Enrolled users" node in "Course administration > Users"
|
||||
Then I should see "Lecturer" in the "Teacher 1" "table_row"
|
||||
And I should see "Learner" in the "Student 1" "table_row"
|
||||
@@ -53,5 +53,8 @@ function xmldb_enrol_database_upgrade($oldversion) {
|
||||
// Moodle v2.9.0 release upgrade line.
|
||||
// Put any upgrade step following this.
|
||||
|
||||
// Moodle v3.0.0 release upgrade line.
|
||||
// Put any upgrade step following this.
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -264,9 +264,9 @@ class enrol_database_plugin extends enrol_plugin {
|
||||
FROM {enrol} e
|
||||
JOIN {course} c ON c.id = e.courseid
|
||||
JOIN {role_assignments} ra ON ra.itemid = e.id
|
||||
LEFT JOIN {user_enrolments} ue ON ue.enrolid = e.id
|
||||
LEFT JOIN {user_enrolments} ue ON ue.enrolid = e.id AND ue.userid = ra.userid
|
||||
WHERE ra.userid = :userid AND e.enrol = 'database'";
|
||||
$rs = $DB->get_recordset_sql($sql, array('userid'=>$user->id));
|
||||
$rs = $DB->get_recordset_sql($sql, array('userid' => $user->id));
|
||||
foreach ($rs as $instance) {
|
||||
if (!$instance->cvisible and $ignorehidden) {
|
||||
continue;
|
||||
|
||||
+10
-3
@@ -618,14 +618,21 @@ class core_enrol_external extends external_api {
|
||||
*
|
||||
* @param int $courseid
|
||||
* @return array of course enrolment methods
|
||||
* @throws moodle_exception
|
||||
*/
|
||||
public static function get_course_enrolment_methods($courseid) {
|
||||
global $DB;
|
||||
|
||||
$params = self::validate_parameters(self::get_course_enrolment_methods_parameters(), array('courseid' => $courseid));
|
||||
|
||||
$coursecontext = context_course::instance($params['courseid']);
|
||||
$categorycontext = $coursecontext->get_parent_context();
|
||||
self::validate_context($categorycontext);
|
||||
// Note that we can't use validate_context because the user is not enrolled in the course.
|
||||
require_login(null, false, null, false, true);
|
||||
|
||||
$course = $DB->get_record('course', array('id' => $params['courseid']), '*', MUST_EXIST);
|
||||
$context = context_course::instance($course->id);
|
||||
if (!$course->visible and !has_capability('moodle/course:viewhiddencourses', $context)) {
|
||||
throw new moodle_exception('coursehidden');
|
||||
}
|
||||
|
||||
$result = array();
|
||||
$enrolinstances = enrol_get_instances($params['courseid'], true);
|
||||
|
||||
@@ -54,5 +54,8 @@ function xmldb_enrol_flatfile_upgrade($oldversion) {
|
||||
// Moodle v2.9.0 release upgrade line.
|
||||
// Put any upgrade step following this.
|
||||
|
||||
// Moodle v3.0.0 release upgrade line.
|
||||
// Put any upgrade step following this.
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -58,7 +58,11 @@ class enrol_guest_edit_form extends moodleform {
|
||||
$mform->addElement('passwordunmask', 'password', get_string('password', 'enrol_guest'));
|
||||
$mform->addHelpButton('password', 'password', 'enrol_guest');
|
||||
|
||||
if ($plugin->get_config('requirepassword')) {
|
||||
// If we have a new instance and the password is required - make sure it is set. For existing
|
||||
// instances we do not force the password to be required as it may have been set to empty before
|
||||
// the password was required. We check in the validation function whether this check is required
|
||||
// for existing instances.
|
||||
if (empty($instance->id) && $plugin->get_config('requirepassword')) {
|
||||
$mform->addRule('password', get_string('required'), 'required', null);
|
||||
}
|
||||
|
||||
@@ -84,20 +88,25 @@ class enrol_guest_edit_form extends moodleform {
|
||||
$checkpassword = false;
|
||||
|
||||
if ($data['id']) {
|
||||
if ($data['status'] == ENROL_INSTANCE_ENABLED) {
|
||||
if ($instance->password !== $data['password']) {
|
||||
$checkpassword = true;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
if ($data['status'] == ENROL_INSTANCE_ENABLED) {
|
||||
// Check the password if we are enabling the plugin again.
|
||||
if (($instance->status == ENROL_INSTANCE_DISABLED) && ($data['status'] == ENROL_INSTANCE_ENABLED)) {
|
||||
$checkpassword = true;
|
||||
}
|
||||
|
||||
// Check the password if the instance is enabled and the password has changed.
|
||||
if (($data['status'] == ENROL_INSTANCE_ENABLED) && ($instance->password !== $data['password'])) {
|
||||
$checkpassword = true;
|
||||
}
|
||||
} else {
|
||||
$checkpassword = true;
|
||||
}
|
||||
|
||||
if ($checkpassword) {
|
||||
$require = $plugin->get_config('requirepassword');
|
||||
$policy = $plugin->get_config('usepasswordpolicy');
|
||||
if ($policy) {
|
||||
if ($require && trim($data['password']) === '') {
|
||||
$errors['password'] = get_string('required');
|
||||
} else if (!empty($data['password']) && $policy) {
|
||||
$errmsg = '';
|
||||
if (!check_password_policy($data['password'], $errmsg)) {
|
||||
$errors['password'] = $errmsg;
|
||||
|
||||
@@ -63,6 +63,9 @@ function xmldb_enrol_guest_upgrade($oldversion) {
|
||||
// Moodle v2.9.0 release upgrade line.
|
||||
// Put any upgrade step following this.
|
||||
|
||||
// Moodle v3.0.0 release upgrade line.
|
||||
// Put any upgrade step following this.
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
+2
-1
@@ -371,7 +371,8 @@ class enrol_guest_plugin extends enrol_plugin {
|
||||
}
|
||||
}
|
||||
|
||||
if ($this->get_config('usepasswordpolicy')) {
|
||||
// Only check the password if it is set.
|
||||
if (!empty($instance->password) && $this->get_config('usepasswordpolicy')) {
|
||||
if (!check_password_policy($instance->password, $errmsg)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -56,5 +56,8 @@ function xmldb_enrol_imsenterprise_upgrade($oldversion) {
|
||||
// Moodle v2.9.0 release upgrade line.
|
||||
// Put any upgrade step following this.
|
||||
|
||||
// Moodle v3.0.0 release upgrade line.
|
||||
// Put any upgrade step following this.
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -72,6 +72,9 @@ function xmldb_enrol_manual_upgrade($oldversion) {
|
||||
upgrade_plugin_savepoint(true, 2015091500, 'enrol', 'manual');
|
||||
}
|
||||
|
||||
// Moodle v3.0.0 release upgrade line.
|
||||
// Put any upgrade step following this.
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
@@ -55,5 +55,8 @@ function xmldb_enrol_mnet_upgrade($oldversion) {
|
||||
// Moodle v2.9.0 release upgrade line.
|
||||
// Put any upgrade step following this.
|
||||
|
||||
// Moodle v3.0.0 release upgrade line.
|
||||
// Put any upgrade step following this.
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -70,5 +70,8 @@ function xmldb_enrol_paypal_upgrade($oldversion) {
|
||||
// Moodle v2.9.0 release upgrade line.
|
||||
// Put any upgrade step following this.
|
||||
|
||||
// Moodle v3.0.0 release upgrade line.
|
||||
// Put any upgrade step following this.
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -71,6 +71,9 @@ function xmldb_enrol_self_upgrade($oldversion) {
|
||||
// Moodle v2.9.0 release upgrade line.
|
||||
// Put any upgrade step following this.
|
||||
|
||||
// Moodle v3.0.0 release upgrade line.
|
||||
// Put any upgrade step following this.
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
@@ -163,15 +163,17 @@ class enrol_self_edit_form extends moodleform {
|
||||
$checkpassword = false;
|
||||
|
||||
if ($instance->id) {
|
||||
if ($data['status'] == ENROL_INSTANCE_ENABLED) {
|
||||
if ($instance->password !== $data['password']) {
|
||||
$checkpassword = true;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
if ($data['status'] == ENROL_INSTANCE_ENABLED) {
|
||||
// Check the password if we are enabling the plugin again.
|
||||
if (($instance->status == ENROL_INSTANCE_DISABLED) && ($data['status'] == ENROL_INSTANCE_ENABLED)) {
|
||||
$checkpassword = true;
|
||||
}
|
||||
|
||||
// Check the password if the instance is enabled and the password has changed.
|
||||
if (($data['status'] == ENROL_INSTANCE_ENABLED) && ($instance->password !== $data['password'])) {
|
||||
$checkpassword = true;
|
||||
}
|
||||
} else {
|
||||
$checkpassword = true;
|
||||
}
|
||||
|
||||
if ($checkpassword) {
|
||||
@@ -179,8 +181,8 @@ class enrol_self_edit_form extends moodleform {
|
||||
$policy = $plugin->get_config('usepasswordpolicy');
|
||||
if ($require and trim($data['password']) === '') {
|
||||
$errors['password'] = get_string('required');
|
||||
} else if ($policy) {
|
||||
$errmsg = '';//prevent eclipse warning
|
||||
} else if (!empty($data['password']) && $policy) {
|
||||
$errmsg = '';
|
||||
if (!check_password_policy($data['password'], $errmsg)) {
|
||||
$errors['password'] = $errmsg;
|
||||
}
|
||||
|
||||
@@ -52,6 +52,7 @@ class enrol_self_external extends external_api {
|
||||
*
|
||||
* @param int $instanceid instance id of self enrolment plugin.
|
||||
* @return array instance information.
|
||||
* @throws moodle_exception
|
||||
*/
|
||||
public static function get_instance_info($instanceid) {
|
||||
global $DB, $CFG;
|
||||
@@ -66,10 +67,15 @@ class enrol_self_external extends external_api {
|
||||
throw new moodle_exception('invaliddata', 'error');
|
||||
}
|
||||
|
||||
// Note that we can't use validate_context because the user is not enrolled in the course.
|
||||
require_login(null, false, null, false, true);
|
||||
|
||||
$enrolinstance = $DB->get_record('enrol', array('id' => $params['instanceid']), '*', MUST_EXIST);
|
||||
$coursecontext = context_course::instance($enrolinstance->courseid);
|
||||
$categorycontext = $coursecontext->get_parent_context();
|
||||
self::validate_context($categorycontext);
|
||||
$course = $DB->get_record('course', array('id' => $enrolinstance->courseid), '*', MUST_EXIST);
|
||||
$context = context_course::instance($course->id);
|
||||
if (!$course->visible and !has_capability('moodle/course:viewhiddencourses', $context)) {
|
||||
throw new moodle_exception('coursehidden');
|
||||
}
|
||||
|
||||
$instanceinfo = (array) $enrolplugin->get_enrol_info($enrolinstance);
|
||||
if (isset($instanceinfo['requiredparam']->enrolpassword)) {
|
||||
|
||||
+22
-1
@@ -685,6 +685,27 @@ class enrol_self_plugin extends enrol_plugin {
|
||||
*/
|
||||
public function can_hide_show_instance($instance) {
|
||||
$context = context_course::instance($instance->courseid);
|
||||
return has_capability('enrol/self:config', $context);
|
||||
|
||||
if (!has_capability('enrol/self:config', $context)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
// If the instance is currently disabled, before it can be enabled,
|
||||
// we must check whether the password meets the password policies.
|
||||
if ($instance->status == ENROL_INSTANCE_DISABLED) {
|
||||
if ($this->get_config('requirepassword')) {
|
||||
if (empty($instance->password)) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
// Only check the password if it is set.
|
||||
if (!empty($instance->password) && $this->get_config('usepasswordpolicy')) {
|
||||
if (!check_password_policy($instance->password, $errmsg)) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -47,7 +47,9 @@ class enrol_self_external_testcase extends externallib_advanced_testcase {
|
||||
$studentrole = $DB->get_record('role', array('shortname'=>'student'));
|
||||
$this->assertNotEmpty($studentrole);
|
||||
|
||||
$course = self::getDataGenerator()->create_course();
|
||||
$coursedata = new stdClass();
|
||||
$coursedata->visible = 0;
|
||||
$course = self::getDataGenerator()->create_course($coursedata);
|
||||
|
||||
// Add enrolment methods for course.
|
||||
$instanceid1 = $selfplugin->add_instance($course, array('status' => ENROL_INSTANCE_ENABLED,
|
||||
@@ -68,6 +70,7 @@ class enrol_self_external_testcase extends externallib_advanced_testcase {
|
||||
$enrolmentmethods = $DB->get_records('enrol', array('courseid' => $course->id, 'status' => ENROL_INSTANCE_ENABLED));
|
||||
$this->assertCount(3, $enrolmentmethods);
|
||||
|
||||
$this->setAdminUser();
|
||||
$instanceinfo1 = enrol_self_external::get_instance_info($instanceid1);
|
||||
$instanceinfo1 = external_api::clean_returnvalue(enrol_self_external::get_instance_info_returns(), $instanceinfo1);
|
||||
|
||||
@@ -95,6 +98,15 @@ class enrol_self_external_testcase extends externallib_advanced_testcase {
|
||||
$this->assertEquals('Test instance 3', $instanceinfo3['name']);
|
||||
$this->assertTrue($instanceinfo3['status']);
|
||||
$this->assertEquals(get_string('password', 'enrol_self'), $instanceinfo3['enrolpassword']);
|
||||
|
||||
// Try to retrieve information using a normal user for a hidden course.
|
||||
$user = self::getDataGenerator()->create_user();
|
||||
$this->setUser($user);
|
||||
try {
|
||||
enrol_self_external::get_instance_info($instanceid3);
|
||||
} catch (moodle_exception $e) {
|
||||
$this->assertEquals('coursehidden', $e->errorcode);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -428,7 +428,9 @@ class core_enrol_externallib_testcase extends externallib_advanced_testcase {
|
||||
$this->assertNotEmpty($studentrole);
|
||||
|
||||
$course1 = self::getDataGenerator()->create_course();
|
||||
$course2 = self::getDataGenerator()->create_course();
|
||||
$coursedata = new stdClass();
|
||||
$coursedata->visible = 0;
|
||||
$course2 = self::getDataGenerator()->create_course($coursedata);
|
||||
|
||||
// Add enrolment methods for course.
|
||||
$instanceid1 = $selfplugin->add_instance($course1, array('status' => ENROL_INSTANCE_ENABLED,
|
||||
@@ -445,6 +447,8 @@ class core_enrol_externallib_testcase extends externallib_advanced_testcase {
|
||||
$enrolmentmethods = $DB->get_records('enrol', array('courseid' => $course1->id, 'status' => ENROL_INSTANCE_ENABLED));
|
||||
$this->assertCount(2, $enrolmentmethods);
|
||||
|
||||
$this->setAdminUser();
|
||||
|
||||
// Check if information is returned.
|
||||
$enrolmentmethods = core_enrol_external::get_course_enrolment_methods($course1->id);
|
||||
$enrolmentmethods = external_api::clean_returnvalue(core_enrol_external::get_course_enrolment_methods_returns(),
|
||||
@@ -474,6 +478,15 @@ class core_enrol_externallib_testcase extends externallib_advanced_testcase {
|
||||
$this->assertEquals('self', $enrolmentmethod['type']);
|
||||
$this->assertTrue($enrolmentmethod['status']);
|
||||
$this->assertEquals('enrol_self_get_instance_info', $enrolmentmethod['wsfunction']);
|
||||
|
||||
// Try to retrieve information using a normal user for a hidden course.
|
||||
$user = self::getDataGenerator()->create_user();
|
||||
$this->setUser($user);
|
||||
try {
|
||||
core_enrol_external::get_course_enrolment_methods($course2->id);
|
||||
} catch (moodle_exception $e) {
|
||||
$this->assertEquals('coursehidden', $e->errorcode);
|
||||
}
|
||||
}
|
||||
|
||||
public function get_enrolled_users_setup($capability) {
|
||||
|
||||
@@ -33,7 +33,7 @@ abstract class filter_local_settings_form extends moodleform {
|
||||
public function __construct($submiturl, $filter, $context) {
|
||||
$this->filter = $filter;
|
||||
$this->context = $context;
|
||||
parent::moodleform($submiturl);
|
||||
parent::__construct($submiturl);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user