Compare commits
541 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 70fa678586 | |||
| 0c6de97371 | |||
| 63981e5a82 | |||
| 6a0dfc60d6 | |||
| 38c4435a37 | |||
| 3cc4e2f725 | |||
| ca3cbbc233 | |||
| 7d196ef3b3 | |||
| 069b9d5820 | |||
| 454a3d34d5 | |||
| db3a985faf | |||
| c535520966 | |||
| e35ad40de1 | |||
| 436acc27fe | |||
| 73fd6f2928 | |||
| 84e17f59c5 | |||
| 63464df041 | |||
| 17c82085fc | |||
| 5e3ce67f37 | |||
| ec02a34e1f | |||
| 1e1e1b8229 | |||
| f7af2c5fc7 | |||
| 92194c1c8d | |||
| 7bbe8a1c76 | |||
| 22ee65c275 | |||
| 9354f9de64 | |||
| 04d2305788 | |||
| e21e294072 | |||
| 19b7ac05ad | |||
| 4294bbd50f | |||
| b1ffb73177 | |||
| cde1ac3eea | |||
| 059759aab9 | |||
| 188d41ccc9 | |||
| 0b5f9f6e60 | |||
| fa60a11522 | |||
| 29cdf58116 | |||
| 3db24b8015 | |||
| b21b210f41 | |||
| 79482e3fe8 | |||
| 3935371599 | |||
| 14026572ae | |||
| ee66d63054 | |||
| af2d6085cd | |||
| e615d70923 | |||
| ae8388d51c | |||
| 962e3eb662 | |||
| 4c586b025e | |||
| 8612c8aa3e | |||
| a7db91030b | |||
| d807d3c603 | |||
| 8f61b909e8 | |||
| e44ce23c9f | |||
| 6c87b08240 | |||
| 9afdc8fc12 | |||
| e30a500fb9 | |||
| 121d3e0d29 | |||
| 5b7356cdde | |||
| 169d972bf6 | |||
| 4fef0dadf0 | |||
| 96a0d1bc7a | |||
| 01c2ca76c0 | |||
| 46c68c1b42 | |||
| e65f6a7e40 | |||
| 800da1b13d | |||
| a53008f1f0 | |||
| f1a117b86b | |||
| bcbd4140a1 | |||
| c99c5a436e | |||
| b7d36bdbaf | |||
| c21f12e786 | |||
| 2dd1bb44c2 | |||
| 63de9b5cdb | |||
| 24a00cadec | |||
| 3f709d3272 | |||
| def32a798d | |||
| b63524492f | |||
| 46f0136a5a | |||
| 83dbc72f38 | |||
| c6911cefb4 | |||
| dfbdf40af9 | |||
| 3e0fb6862e | |||
| 0e8eba7e1f | |||
| d0209e611f | |||
| ec9ed6d067 | |||
| 3e340aba45 | |||
| de80be59bb | |||
| 310172571b | |||
| a550b70a94 | |||
| 3cd6842501 | |||
| f17c1aadb3 | |||
| 043dffdd34 | |||
| 6fef2ab3db | |||
| 9ffcf8a3e9 | |||
| 56b8f8c8be | |||
| fede68a0ac | |||
| 6588079c5d | |||
| f7e4c3627c | |||
| 6c3f7e0ae6 | |||
| 89d948d86b | |||
| e1dcad3d13 | |||
| 07d000c51e | |||
| 636e7a13b6 | |||
| a57bdfa055 | |||
| 80a57cf924 | |||
| 059d6ffd9f | |||
| fd13953a8a | |||
| 488e115027 | |||
| 72e3ff3c15 | |||
| bd4f6ce186 | |||
| 5416d932d7 | |||
| 27e719e709 | |||
| b577d34861 | |||
| dcd27d9cee | |||
| 863dcb14a8 | |||
| 1a754e8446 | |||
| 95e9f4cc02 | |||
| bac13609ca | |||
| df90a44f3f | |||
| 23fd4f3afc | |||
| 9b39a92170 | |||
| 69c5e60f8c | |||
| cc36a37ea4 | |||
| 2678ee4e81 | |||
| 5a9f3039a7 | |||
| 667784420f | |||
| f628e0ecf6 | |||
| 9ae3b89cc5 | |||
| 098a875e4e | |||
| 9d64f4f078 | |||
| 5fac573391 | |||
| def9c15904 | |||
| d4e9fe521e | |||
| 343cdba46b | |||
| aca74d0d74 | |||
| ce01dbab40 | |||
| 21cf201536 | |||
| dfefe26665 | |||
| de70bc556c | |||
| 7b06a12ef3 | |||
| a415eb505e | |||
| 54a20ea8fc | |||
| a1740aad65 | |||
| 3680b1efa0 | |||
| b90c2e2627 | |||
| 5c53893f97 | |||
| 3049c086a3 | |||
| c644b03f02 | |||
| 7693409caa | |||
| eac59c38f8 | |||
| cd6612b079 | |||
| 7d88829470 | |||
| 9fde80dfa0 | |||
| e787fa6ab4 | |||
| 24cfd4c7d8 | |||
| de33f85405 | |||
| 57e38e1d12 | |||
| ddbf8c29ae | |||
| f265312fcf | |||
| 7dc6674cc4 | |||
| c1b9c51914 | |||
| 14da7f58a4 | |||
| 18221902bc | |||
| 7d9ee66a2f | |||
| de60425a16 | |||
| 4eb3f8d9b7 | |||
| 994e94bf76 | |||
| 2f9f8b5903 | |||
| 3923610e6c | |||
| 0913eb3c2a | |||
| f5b50e0472 | |||
| 09261027b6 | |||
| e0c4e6496f | |||
| 672ce4c6cd | |||
| 13a2a8344c | |||
| 8184f47d6c | |||
| 7a7320af90 | |||
| 70fd9fbb39 | |||
| e16448d3f1 | |||
| 2b4eb2cb71 | |||
| ed798679bb | |||
| 299dcca1b1 | |||
| c16c53d137 | |||
| 52723e1e3f | |||
| 0bcbd5b205 | |||
| ec319d13df | |||
| 0c4422af0b | |||
| 40dcbac3d6 | |||
| 62eb5ef8eb | |||
| 434e8abac8 | |||
| 28add18d9b | |||
| f9220d8138 | |||
| 32237b8308 | |||
| c2ae90c553 | |||
| 7035e0f5b5 | |||
| 6a3777f90c | |||
| de7a6ff47e | |||
| 46e26a1b69 | |||
| 0db0a63e50 | |||
| 120798e85f | |||
| 4679634e36 | |||
| 1c0462deb3 | |||
| 7dc8cc1ab6 | |||
| 170cd579ff | |||
| 6c83de1d51 | |||
| 0ef42d5f6d | |||
| ffc60d23b4 | |||
| 4f5a6ca40e | |||
| a669c6b21e | |||
| e7734513b8 | |||
| 44b4f83298 | |||
| 49053808a2 | |||
| 8ea5d72218 | |||
| e33b7b342a | |||
| f33a8d4eee | |||
| 6a4a1d812c | |||
| c94dce9c89 | |||
| a551ea0210 | |||
| 72b489ef65 | |||
| 827d93f88a | |||
| 884f4d3ec3 | |||
| a072271853 | |||
| 95c794075a | |||
| 890f84cdb2 | |||
| b4e1bbef47 | |||
| 678d051bee | |||
| c83ef7e25b | |||
| 1ee447d3a4 | |||
| 217d523d43 | |||
| 76cebe50cb | |||
| 7dfc04ff98 | |||
| ff037d9698 | |||
| 39dc183d9f | |||
| f7ddcd23f8 | |||
| 92f57f8397 | |||
| 98f246ae97 | |||
| f9e7ee4534 | |||
| b14507a31f | |||
| 4436b9e9dd | |||
| 2568183232 | |||
| bcca23f9c5 | |||
| bab24efe70 | |||
| 45a46ecbd8 | |||
| 64cfe467f8 | |||
| 48f0ebcd49 | |||
| 6537c557b5 | |||
| 225e039e73 | |||
| c8dddb5ccb | |||
| 3e276d6efa | |||
| adf2ea6166 | |||
| fd90d0e925 | |||
| 58a4ce4774 | |||
| b44972cc8b | |||
| 655570df00 | |||
| dbf70dec42 | |||
| c40ed5f6ff | |||
| 2827c7f997 | |||
| 2259fb5f36 | |||
| 6dc7039af9 | |||
| ee7b977a8b | |||
| f4841f394c | |||
| 6973e38a91 | |||
| c1b158b569 | |||
| 21a8a95869 | |||
| 359914c8f6 | |||
| 95208fe135 | |||
| df428648ee | |||
| 9148905e9a | |||
| 64df3fed13 | |||
| ed4aaea57b | |||
| 163fc8588d | |||
| 39e34b9586 | |||
| 5c63ab7ee8 | |||
| 3e3068cd11 | |||
| a27dde0ba7 | |||
| b92400a49f | |||
| a477c8b752 | |||
| 7f52d5c740 | |||
| f52bdbb885 | |||
| 7c519588f1 | |||
| 7345917de4 | |||
| 8a71b10a68 | |||
| 18907a51d5 | |||
| 11d04ffe8a | |||
| 5e1014a76e | |||
| 6e497e6e7d | |||
| 66a4a376ee | |||
| 3563244314 | |||
| bf02dc9819 | |||
| 8e8c066448 | |||
| 67f83d9279 | |||
| bcd1915dd0 | |||
| 992ffccfd2 | |||
| 97fd5a9841 | |||
| 6b47a070e7 | |||
| b4cfb7d733 | |||
| a9fa51024f | |||
| 2eec6ffc6c | |||
| 3f1574f849 | |||
| 40b78a23e9 | |||
| fb5655b5c2 | |||
| 405dcba6f3 | |||
| 7f32c5a447 | |||
| ec3eeb7ace | |||
| 1af3d13bf3 | |||
| 84122523ba | |||
| 382c069e52 | |||
| 3f58a36504 | |||
| 9e41e4e8ea | |||
| 7523d99558 | |||
| 9a375bdf6c | |||
| 07f6358b03 | |||
| 7ffb98d0f5 | |||
| dda99bb3f2 | |||
| 9cff26295b | |||
| 2fd5ceadb5 | |||
| 5865a6875b | |||
| ef2eed1b3c | |||
| 6601017d02 | |||
| a204d7d921 | |||
| bf345fc4ca | |||
| 2722404791 | |||
| 256f820dfd | |||
| 173f5515e3 | |||
| 7ed6f330c6 | |||
| 418d01aaf4 | |||
| 11f9ff55e1 | |||
| 04d4796089 | |||
| e889aee562 | |||
| 228157ebf5 | |||
| c77ae4e017 | |||
| 1da3022e50 | |||
| f6507b8e35 | |||
| d52b937932 | |||
| ce36e3626f | |||
| 063f7c198b | |||
| 83dedbcd33 | |||
| 0ad466926d | |||
| ced9a33352 | |||
| 3b4fba5588 | |||
| 926d5a53ff | |||
| 9cc9dabf17 | |||
| cb8be0b6b8 | |||
| c6bd4c1a45 | |||
| 31e4c05002 | |||
| c5f11c0f3c | |||
| 6158379f75 | |||
| bc076bf1b8 | |||
| 27a3a42efd | |||
| b0c2ea4640 | |||
| 00ef7b1caa | |||
| 7914b0035f | |||
| cb358279b7 | |||
| 339edb47e2 | |||
| bd6bc508df | |||
| c53194f3f9 | |||
| c477dc23c0 | |||
| 8cd421e941 | |||
| f18c2a9d15 | |||
| 403e0d96e5 | |||
| 5984ffded4 | |||
| cd9a925e6a | |||
| 40471ed54c | |||
| 000b0949e6 | |||
| 6c7f60dbc0 | |||
| 3b37e372f2 | |||
| 44b94d9324 | |||
| e5bc84f84f | |||
| a38d0650d4 | |||
| 8d9edc0e7c | |||
| 4e0357c1e3 | |||
| 9efd73abec | |||
| c31b5bbf9d | |||
| 7606ba2133 | |||
| 88c0fcb03f | |||
| 51b7f8f0a4 | |||
| 40fdf0f84f | |||
| 3e99f4f642 | |||
| 324e613b48 | |||
| 502397dcbc | |||
| f1f83c3ba1 | |||
| 2c3f09ccf7 | |||
| e2f5592b8f | |||
| 522fcf2ffc | |||
| 96e743ff78 | |||
| e514ae345e | |||
| 2659b808ab | |||
| 54037cf3e2 | |||
| b0773d70c6 | |||
| 4348fffe0c | |||
| 216c68b834 | |||
| a3c1bd86ed | |||
| e0006399ff | |||
| 2084c59b82 | |||
| a09a9879e5 | |||
| a3a095b6eb | |||
| 0edf724367 | |||
| a953ac5942 | |||
| 5627b0b1a1 | |||
| 5d3a7be453 | |||
| 8f27fdf1ab | |||
| 1d5c2c6560 | |||
| 18317c7c1c | |||
| b83fd5b1fe | |||
| 972304f4cb | |||
| 11eeb2e347 | |||
| 0aa8b11f5c | |||
| 829cafc050 | |||
| 25474b5e84 | |||
| b7f902b5b3 | |||
| 11488775eb | |||
| 32ec7e3d30 | |||
| 1a1eef4345 | |||
| 4942dfc7cd | |||
| d469fb2181 | |||
| 0213ce081c | |||
| 70b6a6618a | |||
| 089cf944f3 | |||
| 68d9adcba8 | |||
| 32636d1757 | |||
| 48ff43d3bd | |||
| 725863abe4 | |||
| 9de4bbf8a8 | |||
| cd7ca81fdd | |||
| 1ca30f2503 | |||
| c47a9439d3 | |||
| 2ce5b1d637 | |||
| c4ade76ee5 | |||
| 62fc665ff6 | |||
| 263865899e | |||
| f927f3e196 | |||
| 70f5e9ba61 | |||
| 3b7bf2cee0 | |||
| a57a9053d7 | |||
| 0292245755 | |||
| dd7aa695b2 | |||
| 2626dce64c | |||
| 7e2e135943 | |||
| cc15b9d46f | |||
| ce47bacfe9 | |||
| 7c89091995 | |||
| 7766ffc618 | |||
| 75efa0860c | |||
| d31412392c | |||
| da694c75ff | |||
| 76f5d7b9ab | |||
| e7d8926583 | |||
| c87f1ac4c7 | |||
| 75c4f5b0ca | |||
| f7b3774380 | |||
| 78293c74bf | |||
| 406fc019c1 | |||
| 903cd37434 | |||
| 6fd8b0098a | |||
| 34954a6050 | |||
| 949d8ae04e | |||
| 1c7cbed23c | |||
| 9156498826 | |||
| 71adc9a9a3 | |||
| 49612b733f | |||
| bc0721c7d9 | |||
| c5452484ee | |||
| 74eecb6078 | |||
| 725be51c11 | |||
| d0d8a7f984 | |||
| 4a50811ae3 | |||
| b82ddcbcac | |||
| 6e4cc6caf4 | |||
| fe8e9b1b4e | |||
| 72770e9a60 | |||
| a847efc70b | |||
| 9e99327888 | |||
| 9973eebb91 | |||
| a162f636d8 | |||
| 8ff8d598fe | |||
| 8704d2e5fc | |||
| f9dd21a17a | |||
| eb349bdfc4 | |||
| 89d186af72 | |||
| 65de977483 | |||
| e167481759 | |||
| 457c913461 | |||
| 422449dca8 | |||
| 53c8f0ca3c | |||
| b094b88a9a | |||
| 49e5d04a8d | |||
| 38e28dfbcd | |||
| 44047dc78d | |||
| c06b8145b1 | |||
| 79da2c5bfa | |||
| a5800adaf0 | |||
| c1c3f50965 | |||
| cff14cf0d1 | |||
| c95ea731bc | |||
| b98f14632b | |||
| a1e1b45ae7 | |||
| 2d44bb544b | |||
| c60d333578 | |||
| 182690b018 | |||
| b36b54179d | |||
| fc4b768e25 | |||
| 7e0f1972f1 | |||
| 93e64c823c | |||
| 20d598f094 | |||
| e376549179 | |||
| 163a317bcc | |||
| 7ecf13ac1d | |||
| 2fbe4fca87 | |||
| d07a8ebd7e | |||
| d4feb70e17 | |||
| f477809e38 | |||
| 94caed45db | |||
| 8c4fdb1073 | |||
| e5bbe44230 | |||
| d0a58fe035 | |||
| 9c68157292 | |||
| 44f71599df | |||
| 1fac7b914b | |||
| cede73411f | |||
| 47deb83b5c | |||
| 4ea56c1c80 | |||
| 311121b16c | |||
| 5863f1b073 | |||
| 2bb195f64f | |||
| f6b50d9901 | |||
| a0b0234a18 | |||
| f8b8a363ae | |||
| b197272987 | |||
| e4976aefc5 | |||
| dcd408b81f | |||
| 4a564ca40b | |||
| 5da06d632a | |||
| d797e57255 | |||
| 55d2042f0a | |||
| 8cd6972966 | |||
| 9cbc0a0cdb | |||
| 931d12b589 | |||
| 0beeb95a8a | |||
| 617f8bb911 | |||
| 75dd21a002 | |||
| a0c13477ab |
+2
-1
@@ -56,7 +56,8 @@ lib/amd/src/chartjs-lazy.js
|
||||
lib/maxmind/GeoIp2/
|
||||
lib/maxmind/MaxMind/
|
||||
lib/ltiprovider/
|
||||
media/player/videojs/amd/src/
|
||||
media/player/videojs/amd/src/video-lazy.js
|
||||
media/player/videojs/amd/src/Youtube-lazy.js
|
||||
media/player/videojs/videojs/
|
||||
mod/assign/feedback/editpdf/fpdi/
|
||||
repository/s3/S3.php
|
||||
|
||||
+2
-1
@@ -57,7 +57,8 @@ lib/amd/src/chartjs-lazy.js
|
||||
lib/maxmind/GeoIp2/
|
||||
lib/maxmind/MaxMind/
|
||||
lib/ltiprovider/
|
||||
media/player/videojs/amd/src/
|
||||
media/player/videojs/amd/src/video-lazy.js
|
||||
media/player/videojs/amd/src/Youtube-lazy.js
|
||||
media/player/videojs/videojs/
|
||||
mod/assign/feedback/editpdf/fpdi/
|
||||
repository/s3/S3.php
|
||||
|
||||
+10
-10
@@ -13,7 +13,7 @@ language: php
|
||||
|
||||
php:
|
||||
# We only run the highest and lowest supported versions to reduce the load on travis-ci.org.
|
||||
- 7.0
|
||||
- 7.1
|
||||
- 5.6
|
||||
|
||||
services:
|
||||
@@ -23,7 +23,7 @@ env:
|
||||
# Although we want to run these jobs and see failures as quickly as possible, we also want to get the slowest job to
|
||||
# start first so that the total run time is not too high.
|
||||
#
|
||||
# We only run MySQL on PHP 7.0, so run that first.
|
||||
# We only run MySQL on PHP 7.1, so run that first.
|
||||
# CI Tests should be second-highest in priority as these only take <= 60 seconds to run under normal circumstances.
|
||||
# Postgres is significantly is pretty reasonable in its run-time.
|
||||
|
||||
@@ -47,22 +47,22 @@ matrix:
|
||||
|
||||
include:
|
||||
# Run grunt/npm install on lowest supported npm version
|
||||
- php: 7
|
||||
- php: 7.1
|
||||
env: DB=none TASK=GRUNT NVM_VERSION='4'
|
||||
# Run grunt/npm install on highest version ('node' is an alias for the latest node.js version.)
|
||||
- php: 7
|
||||
- php: 7.1
|
||||
env: DB=none TASK=GRUNT NVM_VERSION='node'
|
||||
|
||||
exclude:
|
||||
# MySQL - it's just too slow.
|
||||
# Exclude it on all versions except for 7.0
|
||||
# Exclude it on all versions except for 7.1
|
||||
|
||||
- env: DB=mysqli TASK=PHPUNIT
|
||||
php: 5.6
|
||||
|
||||
# Moodle 2.7 is not compatible with PHP 7 for the upgrade test.
|
||||
- env: DB=pgsql TASK=UPGRADE
|
||||
php: 7.0
|
||||
php: 7.1
|
||||
|
||||
cache:
|
||||
directories:
|
||||
@@ -70,9 +70,6 @@ cache:
|
||||
- $HOME/.npm
|
||||
|
||||
install:
|
||||
# Disable xdebug. We aren't generating code coverage, and it has a huge impact upon test performance.
|
||||
- rm /home/travis/.phpenv/versions/$(phpenv version-name)/etc/conf.d/xdebug.ini
|
||||
|
||||
- >
|
||||
if [ "$TASK" = 'PHPUNIT' ];
|
||||
then
|
||||
@@ -99,6 +96,7 @@ install:
|
||||
fi
|
||||
|
||||
before_script:
|
||||
- phpenv config-rm xdebug.ini
|
||||
- >
|
||||
if [ "$TASK" = 'PHPUNIT' -o "$TASK" = 'UPGRADE' ];
|
||||
then
|
||||
@@ -136,11 +134,13 @@ before_script:
|
||||
sed -i \
|
||||
-e "s%= 'pgsql'%= 'mysqli'%" \
|
||||
-e "s%= 'username'%= 'travis'%" \
|
||||
-e "s%=> 'utf8mb4_unicode_ci'%=> 'utf8mb4_bin'%" \
|
||||
config.php;
|
||||
|
||||
mysql -u root -e 'SET GLOBAL innodb_file_format=barracuda;' ;
|
||||
mysql -u root -e 'SET GLOBAL innodb_file_per_table=ON;' ;
|
||||
mysql -e 'CREATE DATABASE travis_ci_test DEFAULT CHARACTER SET utf8 DEFAULT COLLATE utf8_bin;' ;
|
||||
mysql -u root -e 'SET GLOBAL innodb_large_prefix=ON;' ;
|
||||
mysql -e 'CREATE DATABASE travis_ci_test DEFAULT CHARACTER SET utf8mb4 DEFAULT COLLATE utf8mb4_bin;' ;
|
||||
fi
|
||||
fi
|
||||
|
||||
|
||||
@@ -37,6 +37,7 @@
|
||||
print_error('blockdoesnotexist', 'error');
|
||||
}
|
||||
$DB->set_field('block', 'visible', '0', array('id'=>$block->id)); // Hide block
|
||||
add_to_config_log('block_visibility', $block->visible, '0', $block->name);
|
||||
core_plugin_manager::reset_caches();
|
||||
admin_get_root(true, false); // settings not required - only pages
|
||||
}
|
||||
@@ -46,6 +47,7 @@
|
||||
print_error('blockdoesnotexist', 'error');
|
||||
}
|
||||
$DB->set_field('block', 'visible', '1', array('id'=>$block->id)); // Show block
|
||||
add_to_config_log('block_visibility', $block->visible, '1', $block->name);
|
||||
core_plugin_manager::reset_caches();
|
||||
admin_get_root(true, false); // settings not required - only pages
|
||||
}
|
||||
|
||||
@@ -64,6 +64,71 @@ if (!empty($options['collation'])) {
|
||||
cli_error("Error: collation '$collation' is not available on this server!");
|
||||
}
|
||||
|
||||
$collationinfo = explode('_', $collation);
|
||||
$charset = reset($collationinfo);
|
||||
|
||||
$engine = strtolower($DB->get_dbengine());
|
||||
|
||||
// Do checks for utf8mb4.
|
||||
if (strpos($collation, 'utf8mb4') === 0) {
|
||||
// Do we have the right engine?
|
||||
if ($engine !== 'innodb' && $engine !== 'xtradb') {
|
||||
cli_error("Error: '$collation' requires InnoDB or XtraDB set as the engine.");
|
||||
}
|
||||
// Are we using Barracuda?
|
||||
if ($DB->get_row_format() != 'Barracuda') {
|
||||
// Try setting it here.
|
||||
try {
|
||||
$DB->execute("SET GLOBAL innodb_file_format=Barracuda");
|
||||
} catch (dml_exception $e) {
|
||||
cli_error("Error: '$collation' requires the file format to be set to Barracuda.
|
||||
An attempt was made to change the format, but it failed. Please try doing this manually.");
|
||||
}
|
||||
echo "GLOBAL SETTING: innodb_file_format changed to Barracuda\n";
|
||||
}
|
||||
// Is one file per table being used?
|
||||
if (!$DB->is_file_per_table_enabled()) {
|
||||
try {
|
||||
$DB->execute("SET GLOBAL innodb_file_per_table=1");
|
||||
} catch (dml_exception $e) {
|
||||
cli_error("Error: '$collation' requires the setting 'innodb_file_per_table' be set to 'ON'.
|
||||
An attempt was made to change the format, but it failed. Please try doing this manually.");
|
||||
}
|
||||
echo "GLOBAL SETTING: innodb_file_per_table changed to 1\n";
|
||||
}
|
||||
// Is large prefix set?
|
||||
if (!$DB->is_large_prefix_enabled()) {
|
||||
try {
|
||||
$DB->execute("SET GLOBAL innodb_large_prefix=1");
|
||||
} catch (dml_exception $e) {
|
||||
cli_error("Error: '$collation' requires the setting 'innodb_large_prefix' be set to 'ON'.
|
||||
An attempt was made to change the format, but it failed. Please try doing this manually.");
|
||||
}
|
||||
echo "GLOBAL SETTING: innodb_large_prefix changed to 1\n";
|
||||
}
|
||||
}
|
||||
|
||||
$sql = "SHOW VARIABLES LIKE 'collation_database'";
|
||||
if (!$dbcollation = $DB->get_record_sql($sql)) {
|
||||
cli_error("Error: Could not access collation information on the database.");
|
||||
}
|
||||
$sql = "SHOW VARIABLES LIKE 'character_set_database'";
|
||||
if (!$dbcharset = $DB->get_record_sql($sql)) {
|
||||
cli_error("Error: Could not access character set information on the database.");
|
||||
}
|
||||
if ($dbcollation->value !== $collation || $dbcharset->value !== $charset) {
|
||||
// Try to convert the DB.
|
||||
echo "Converting database to '$collation' for $CFG->wwwroot:\n";
|
||||
$sql = "ALTER DATABASE $CFG->dbname DEFAULT CHARACTER SET $charset DEFAULT COLLATE = $collation";
|
||||
try {
|
||||
$DB->change_database_structure($sql);
|
||||
} catch (exception $e) {
|
||||
cli_error("Error: Tried to alter the database with no success. Please try manually changing the database
|
||||
to the new collation and character set and then run this script again.");
|
||||
}
|
||||
echo "DATABASE CONVERTED\n";
|
||||
}
|
||||
|
||||
echo "Converting tables and columns to '$collation' for $CFG->wwwroot:\n";
|
||||
$prefix = $DB->get_prefix();
|
||||
$prefix = str_replace('_', '\\_', $prefix);
|
||||
@@ -80,7 +145,7 @@ if (!empty($options['collation'])) {
|
||||
$skipped++;
|
||||
|
||||
} else {
|
||||
$DB->change_database_structure("ALTER TABLE $table->name DEFAULT COLLATE = $collation");
|
||||
$DB->change_database_structure("ALTER TABLE $table->name DEFAULT CHARACTER SET $charset DEFAULT COLLATE = $collation");
|
||||
echo "CONVERTED\n";
|
||||
$converted++;
|
||||
}
|
||||
@@ -96,18 +161,32 @@ if (!empty($options['collation'])) {
|
||||
continue;
|
||||
}
|
||||
|
||||
// Check for utf8mb4 collation.
|
||||
$rowformat = $DB->get_row_format_sql($engine, $collation);
|
||||
|
||||
if ($column->type === 'tinytext' or $column->type === 'mediumtext' or $column->type === 'text' or $column->type === 'longtext') {
|
||||
$notnull = ($column->null === 'NO') ? 'NOT NULL' : 'NULL';
|
||||
$default = (!is_null($column->default) and $column->default !== '') ? "DEFAULT '$column->default'" : '';
|
||||
// primary, unique and inc are not supported for texts
|
||||
$sql = "ALTER TABLE $table->name MODIFY COLUMN $column->field $column->type COLLATE $collation $notnull $default";
|
||||
$sql = "ALTER TABLE $table->name
|
||||
MODIFY COLUMN $column->field $column->type
|
||||
CHARACTER SET $charset
|
||||
COLLATE $collation $notnull $default";
|
||||
$DB->change_database_structure($sql);
|
||||
|
||||
} else if (strpos($column->type, 'varchar') === 0) {
|
||||
$notnull = ($column->null === 'NO') ? 'NOT NULL' : 'NULL';
|
||||
$default = !is_null($column->default) ? "DEFAULT '$column->default'" : '';
|
||||
// primary, unique and inc are not supported for texts
|
||||
$sql = "ALTER TABLE $table->name MODIFY COLUMN $column->field $column->type COLLATE $collation $notnull $default";
|
||||
|
||||
if ($rowformat != '') {
|
||||
$sql = "ALTER TABLE $table->name $rowformat";
|
||||
$DB->change_database_structure($sql);
|
||||
}
|
||||
|
||||
$sql = "ALTER TABLE $table->name
|
||||
MODIFY COLUMN $column->field $column->type
|
||||
CHARACTER SET $charset
|
||||
COLLATE $collation $notnull $default";
|
||||
$DB->change_database_structure($sql);
|
||||
} else {
|
||||
echo "ERROR (unknown column type: $column->type)\n";
|
||||
@@ -180,7 +259,9 @@ function mysql_get_collations() {
|
||||
global $DB;
|
||||
|
||||
$collations = array();
|
||||
$sql = "SHOW COLLATION WHERE Collation LIKE 'utf8\_%' AND Charset = 'utf8'";
|
||||
$sql = "SHOW COLLATION
|
||||
WHERE Collation LIKE 'utf8\_%' AND Charset = 'utf8'
|
||||
OR Collation LIKE 'utf8mb4\_%' AND Charset = 'utf8mb4'";
|
||||
$rs = $DB->get_recordset_sql($sql);
|
||||
foreach ($rs as $collation) {
|
||||
$collations[$collation->collation] = $collation->collation;
|
||||
|
||||
+30
-5
@@ -1723,6 +1723,21 @@
|
||||
<ON_CHECK message="libcurlwarning" />
|
||||
</FEEDBACK>
|
||||
</CUSTOM_CHECK>
|
||||
<CUSTOM_CHECK file="lib/upgradelib.php" function="check_mysql_file_format" level="required">
|
||||
<FEEDBACK>
|
||||
<ON_ERROR message="unsupporteddbfileformat" />
|
||||
</FEEDBACK>
|
||||
</CUSTOM_CHECK>
|
||||
<CUSTOM_CHECK file="lib/upgradelib.php" function="check_mysql_file_per_table" level="required">
|
||||
<FEEDBACK>
|
||||
<ON_ERROR message="unsupporteddbfilepertable" />
|
||||
</FEEDBACK>
|
||||
</CUSTOM_CHECK>
|
||||
<CUSTOM_CHECK file="lib/upgradelib.php" function="check_mysql_large_prefix" level="required">
|
||||
<FEEDBACK>
|
||||
<ON_ERROR message="unsupporteddblargeprefix" />
|
||||
</FEEDBACK>
|
||||
</CUSTOM_CHECK>
|
||||
</CUSTOM_CHECKS>
|
||||
</MOODLE>
|
||||
<MOODLE version="3.2" requires="2.7">
|
||||
@@ -1868,16 +1883,26 @@
|
||||
<ON_CHECK message="unoconvwarning" />
|
||||
</FEEDBACK>
|
||||
</CUSTOM_CHECK>
|
||||
<CUSTOM_CHECK file="lib/upgradelib.php" function="check_tls_libraries" level="optional">
|
||||
<FEEDBACK>
|
||||
<ON_CHECK message="tlswarning" />
|
||||
</FEEDBACK>
|
||||
</CUSTOM_CHECK>
|
||||
<CUSTOM_CHECK file="lib/upgradelib.php" function="check_libcurl_version" level="optional">
|
||||
<FEEDBACK>
|
||||
<ON_CHECK message="libcurlwarning" />
|
||||
</FEEDBACK>
|
||||
</CUSTOM_CHECK>
|
||||
<CUSTOM_CHECK file="lib/upgradelib.php" function="check_mysql_file_format" level="required">
|
||||
<FEEDBACK>
|
||||
<ON_ERROR message="unsupporteddbfileformat" />
|
||||
</FEEDBACK>
|
||||
</CUSTOM_CHECK>
|
||||
<CUSTOM_CHECK file="lib/upgradelib.php" function="check_mysql_file_per_table" level="required">
|
||||
<FEEDBACK>
|
||||
<ON_ERROR message="unsupporteddbfilepertable" />
|
||||
</FEEDBACK>
|
||||
</CUSTOM_CHECK>
|
||||
<CUSTOM_CHECK file="lib/upgradelib.php" function="check_mysql_large_prefix" level="required">
|
||||
<FEEDBACK>
|
||||
<ON_ERROR message="unsupporteddblargeprefix" />
|
||||
</FEEDBACK>
|
||||
</CUSTOM_CHECK>
|
||||
</CUSTOM_CHECKS>
|
||||
</MOODLE>
|
||||
</COMPATIBILITY_MATRIX>
|
||||
|
||||
+10
-3
@@ -1899,14 +1899,21 @@ class core_admin_renderer extends plugin_renderer_base {
|
||||
} else {
|
||||
$report = $this->doc_link(join($linkparts, '/'), get_string($stringtouse, 'admin', $rec));
|
||||
}
|
||||
// Enclose report text in div so feedback text will be displayed underneath it.
|
||||
$report = html_writer::div($report);
|
||||
|
||||
// Format error or warning line
|
||||
if ($errorline || $warningline) {
|
||||
$messagetype = $errorline? 'error':'warn';
|
||||
if ($errorline) {
|
||||
$messagetype = 'error';
|
||||
$statusclass = 'label-important';
|
||||
} else if ($warningline) {
|
||||
$messagetype = 'warn';
|
||||
$statusclass = 'label-warning';
|
||||
} else {
|
||||
$messagetype = 'ok';
|
||||
$statusclass = 'label-success';
|
||||
}
|
||||
$status = '<span class="'.$messagetype.'">'.$status.'</span>';
|
||||
$status = html_writer::span($status, 'label ' . $statusclass);
|
||||
// Here we'll store all the feedback found
|
||||
$feedbacktext = '';
|
||||
// Append the feedback if there is some
|
||||
|
||||
@@ -29,9 +29,9 @@ if ($primaryadmin) {
|
||||
$primaryadminname = NULL;
|
||||
}
|
||||
$temp->add(new admin_setting_configtext('supportname', new lang_string('supportname', 'admin'),
|
||||
new lang_string('configsupportname', 'admin'), $primaryadminname, PARAM_NOTAGS));
|
||||
new lang_string('configsupportname', 'admin'), $primaryadminname, PARAM_NOTAGS));
|
||||
$setting = new admin_setting_configtext('supportemail', new lang_string('supportemail', 'admin'),
|
||||
new lang_string('configsupportemail', 'admin'), $primaryadminemail, PARAM_NOTAGS);
|
||||
new lang_string('configsupportemail', 'admin'), $primaryadminemail, PARAM_EMAIL);
|
||||
$setting->set_force_ltr(true);
|
||||
$temp->add($setting);
|
||||
$temp->add(new admin_setting_configtext('supportpage', new lang_string('supportpage', 'admin'), new lang_string('configsupportpage', 'admin'), '', PARAM_URL));
|
||||
@@ -237,7 +237,7 @@ $temp->add(new admin_setting_configtext('smtpmaxbulk', new lang_string('smtpmaxb
|
||||
$temp->add(new admin_setting_heading('noreplydomainheading', new lang_string('noreplydomain', 'admin'),
|
||||
new lang_string('noreplydomaindetail', 'admin')));
|
||||
$temp->add(new admin_setting_configtext('noreplyaddress', new lang_string('noreplyaddress', 'admin'),
|
||||
new lang_string('confignoreplyaddress', 'admin'), 'noreply@' . get_host_from_url($CFG->wwwroot), PARAM_NOTAGS));
|
||||
new lang_string('confignoreplyaddress', 'admin'), 'noreply@' . get_host_from_url($CFG->wwwroot), PARAM_EMAIL));
|
||||
$temp->add(new admin_setting_configtextarea('allowedemaildomains',
|
||||
new lang_string('allowedemaildomains', 'admin'),
|
||||
new lang_string('configallowedemaildomains', 'admin'),
|
||||
|
||||
@@ -38,5 +38,5 @@
|
||||
}
|
||||
}}
|
||||
<div class="form-text defaultsnext">
|
||||
<input type="text" name="{{name}}" value="{{value}}" size="{{size}}" id="{{id}}" class="{{#forceltr}}text-ltr{{/forceltr}}" {{#attributes}} {{name}}="{{value}}"{{/attributes}}>
|
||||
<input type="text" name="{{name}}" value="{{value}}" size="{{size}}" id="{{id}}" class="{{#forceltr}}text-ltr{{/forceltr}}"{{#attributes}} {{name}}="{{value}}"{{/attributes}}>
|
||||
</div>
|
||||
|
||||
@@ -16,8 +16,7 @@ Feature: Display extended course names
|
||||
And I should not see "C_shortname Course fullname"
|
||||
|
||||
Scenario: Courses list with extended course names
|
||||
Given I expand "Site administration" node
|
||||
And I click on "Courses" "link" in the "//div[@id='settingsnav']/descendant::li[contains(concat(' ', normalize-space(@class), ' '), ' type_setting ')][contains(., 'Appearance')]" "xpath_element"
|
||||
Given I navigate to "Appearance > Courses" in site administration
|
||||
And I set the field "Display extended course names" to "1"
|
||||
When I press "Save changes"
|
||||
And I am on site homepage
|
||||
|
||||
@@ -25,7 +25,7 @@ Feature: An administrator can filter user accounts by role, cohort and other pro
|
||||
And I log in as "admin"
|
||||
And I add "User Two (two@example.com)" user to "CH1" cohort members
|
||||
And I add "User Three (three@example.com)" user to "CH1" cohort members
|
||||
And I follow "Browse list of users"
|
||||
And I navigate to "Users > Accounts > Browse list of users" in site administration
|
||||
|
||||
Scenario: Filter user accounts by role and cohort
|
||||
When I set the following fields to these values:
|
||||
|
||||
@@ -8,6 +8,8 @@ Feature: Manage availability conditions
|
||||
Scenario: Display list of availability conditions
|
||||
# Check the report doesn't show when not enabled.
|
||||
Given I log in as "admin"
|
||||
And I press "Customise this page"
|
||||
And I add the "Administration" block if not present
|
||||
And the following config values are set as admin:
|
||||
| enableavailability | 0 |
|
||||
And I expand "Site administration" node
|
||||
|
||||
+225
-89
@@ -54,6 +54,8 @@ list($options, $unrecognised) = cli_get_params(
|
||||
'fromrun' => 1,
|
||||
'torun' => 0,
|
||||
'single-run' => false,
|
||||
'rerun' => 0,
|
||||
'auto-rerun' => 0,
|
||||
),
|
||||
array(
|
||||
'h' => 'help',
|
||||
@@ -77,6 +79,8 @@ Options:
|
||||
--replace Replace args string with run process number, useful for output.
|
||||
--fromrun Execute run starting from (Used for parallel runs on different vms)
|
||||
--torun Execute run till (Used for parallel runs on different vms)
|
||||
--rerun Re-run scenarios that failed during last execution.
|
||||
--auto-rerun Automatically re-run scenarios that failed during last execution.
|
||||
|
||||
-h, --help Print out this help
|
||||
|
||||
@@ -91,11 +95,31 @@ if (!empty($options['help'])) {
|
||||
exit(0);
|
||||
}
|
||||
|
||||
$parallelrun = behat_config_manager::get_parallel_test_runs($options['fromrun']);
|
||||
$parallelrun = behat_config_manager::get_behat_run_config_value('parallel');
|
||||
|
||||
// Default torun is maximum parallel runs.
|
||||
if (empty($options['torun'])) {
|
||||
$options['torun'] = $parallelrun;
|
||||
// Check if the options provided are valid to run behat.
|
||||
if ($parallelrun === false) {
|
||||
// Parallel run should not have fromrun or torun options greater than 1.
|
||||
if (($options['fromrun'] > 1) || ($options['torun'] > 1)) {
|
||||
echo "Test site is not initialized for parallel run." . PHP_EOL;
|
||||
exit(1);
|
||||
}
|
||||
} else {
|
||||
// Ensure fromrun is within limits of initialized test site.
|
||||
if (!empty($options['fromrun']) && ($options['fromrun'] > $parallelrun)) {
|
||||
echo "From run (" . $options['fromrun'] . ") is more than site with parallel runs (" . $parallelrun . ")" . PHP_EOL;
|
||||
exit(1);
|
||||
}
|
||||
|
||||
// Default torun is maximum parallel runs and should be less than equal to parallelruns.
|
||||
if (empty($options['torun'])) {
|
||||
$options['torun'] = $parallelrun;
|
||||
} else {
|
||||
if ($options['torun'] > $parallelrun) {
|
||||
echo "To run (" . $options['torun'] . ") is more than site with parallel runs (" . $parallelrun . ")" . PHP_EOL;
|
||||
exit(1);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Capture signals and ensure we clean symlinks.
|
||||
@@ -127,7 +151,7 @@ if ($options['profile']) {
|
||||
exit(1);
|
||||
}
|
||||
|
||||
$extraopts[] = '--profile="' . $profile . '"';
|
||||
$extraopts['profile'] = '--profile="' . $profile . '"';
|
||||
// By default, profile tags will be used.
|
||||
if (!empty($CFG->behat_config[$profile]['filters']['tags'])) {
|
||||
$tags = $CFG->behat_config[$profile]['filters']['tags'];
|
||||
@@ -137,117 +161,205 @@ if ($options['profile']) {
|
||||
// Command line tags have precedence (std behat behavior).
|
||||
if ($options['tags']) {
|
||||
$tags = $options['tags'];
|
||||
$extraopts[] = '--tags="' . $tags . '"';
|
||||
$extraopts['tags'] = '--tags="' . $tags . '"';
|
||||
}
|
||||
|
||||
// Add suite option if specified.
|
||||
if ($options['suite']) {
|
||||
$extraopts[] = '--suite="' . $options['suite'] . '"';
|
||||
$extraopts['suite'] = '--suite="' . $options['suite'] . '"';
|
||||
}
|
||||
|
||||
// Feature should be added to last, for behat command.
|
||||
if ($options['feature']) {
|
||||
$extraopts[] = $options['feature'];
|
||||
$extraopts['feature'] = $options['feature'];
|
||||
// Only run 1 process as process.
|
||||
// Feature file is picked from absolute path provided, so no need to check for behat.yml.
|
||||
$options['torun'] = $options['fromrun'];
|
||||
}
|
||||
|
||||
// Set of options to pass to behat.
|
||||
$extraopts = implode(' ', $extraopts);
|
||||
$extraoptstr = implode(' ', $extraopts);
|
||||
|
||||
// If empty parallelrun then just check with user if it's a run single behat test.
|
||||
// If rerun is passed then ensure we just run the failed processes.
|
||||
$lastfailedstatus = 0;
|
||||
$lasttorun = $options['torun'];
|
||||
$lastfromrun = $options['fromrun'];
|
||||
if ($options['rerun']) {
|
||||
// Get last combined failed status.
|
||||
$lastfailedstatus = behat_config_manager::get_behat_run_config_value('lastcombinedfailedstatus');
|
||||
$lasttorun = behat_config_manager::get_behat_run_config_value('lasttorun');
|
||||
$lastfromrun = behat_config_manager::get_behat_run_config_value('lastfromrun');
|
||||
|
||||
if ($lastfailedstatus !== false) {
|
||||
$extraoptstr .= ' --rerun';
|
||||
}
|
||||
|
||||
// If torun is less than last torun, then just set this to min last to run and similar for fromrun.
|
||||
if ($options['torun'] < $lasttorun) {
|
||||
$options['torun'];
|
||||
}
|
||||
if ($options['fromrun'] > $lastfromrun) {
|
||||
$options['fromrun'];
|
||||
}
|
||||
unset($options['rerun']);
|
||||
}
|
||||
|
||||
$cmds = array();
|
||||
$exitcodes = array();
|
||||
$status = 0;
|
||||
$verbose = empty($options['verbose']) ? false : true;
|
||||
|
||||
// Execute behat run commands.
|
||||
if (empty($parallelrun)) {
|
||||
$cwd = getcwd();
|
||||
chdir(__DIR__);
|
||||
$runtestscommand = behat_command::get_behat_command(false, false, true);
|
||||
$runtestscommand .= ' --config ' . behat_config_manager::get_behat_cli_config_filepath();
|
||||
$runtestscommand .= ' ' . $extraopts;
|
||||
$runtestscommand .= ' ' . $extraoptstr;
|
||||
$cmds['singlerun'] = $runtestscommand;
|
||||
|
||||
echo "Running single behat site:" . PHP_EOL;
|
||||
passthru("php $runtestscommand", $code);
|
||||
passthru("php $runtestscommand", $status);
|
||||
$exitcodes['singlerun'] = $status;
|
||||
chdir($cwd);
|
||||
exit($code);
|
||||
}
|
||||
} else {
|
||||
|
||||
$cmds = array();
|
||||
echo "Running " . ($options['torun'] - $options['fromrun'] + 1) . " parallel behat sites:" . PHP_EOL;
|
||||
echo "Running " . ($options['torun'] - $options['fromrun'] + 1) . " parallel behat sites:" . PHP_EOL;
|
||||
|
||||
for ($i = $options['fromrun']; $i <= $options['torun']; $i++) {
|
||||
$CFG->behatrunprocess = $i;
|
||||
for ($i = $options['fromrun']; $i <= $options['torun']; $i++) {
|
||||
$lastfailed = 1 & $lastfailedstatus >> ($i - 1);
|
||||
|
||||
// Options parameters to be added to each run.
|
||||
$myopts = !empty($options['replace']) ? str_replace($options['replace'], $i, $extraopts) : $extraopts;
|
||||
// Bypass if not failed in last run.
|
||||
if ($lastfailedstatus && !$lastfailed && ($i <= $lasttorun) && ($i >= $lastfromrun)) {
|
||||
continue;
|
||||
}
|
||||
|
||||
$behatcommand = behat_command::get_behat_command(false, false, true);
|
||||
$behatconfigpath = behat_config_manager::get_behat_cli_config_filepath($i);
|
||||
$CFG->behatrunprocess = $i;
|
||||
|
||||
// Command to execute behat run.
|
||||
$cmds[BEHAT_PARALLEL_SITE_NAME . $i] = $behatcommand . ' --config ' . $behatconfigpath . " " . $myopts;
|
||||
echo "[" . BEHAT_PARALLEL_SITE_NAME . $i . "] " . $cmds[BEHAT_PARALLEL_SITE_NAME . $i] . PHP_EOL;
|
||||
}
|
||||
// Options parameters to be added to each run.
|
||||
$myopts = !empty($options['replace']) ? str_replace($options['replace'], $i, $extraoptstr) : $extraoptstr;
|
||||
|
||||
if (empty($cmds)) {
|
||||
echo "No commands to execute " . PHP_EOL;
|
||||
exit(1);
|
||||
}
|
||||
$behatcommand = behat_command::get_behat_command(false, false, true);
|
||||
$behatconfigpath = behat_config_manager::get_behat_cli_config_filepath($i);
|
||||
|
||||
// Create site symlink if necessary.
|
||||
if (!behat_config_manager::create_parallel_site_links($options['fromrun'], $options['torun'])) {
|
||||
echo "Check permissions. If on windows, make sure you are running this command as admin" . PHP_EOL;
|
||||
exit(1);
|
||||
}
|
||||
|
||||
// Execute all commands, relative to moodle root directory.
|
||||
$processes = cli_execute_parallel($cmds, __DIR__ . "/../../../../");
|
||||
$stoponfail = empty($options['stop-on-failure']) ? false : true;
|
||||
|
||||
// Print header.
|
||||
print_process_start_info($processes);
|
||||
|
||||
// Print combined run o/p from processes.
|
||||
$exitcodes = print_combined_run_output($processes, $stoponfail);
|
||||
$time = round(microtime(true) - $time, 1);
|
||||
echo "Finished in " . gmdate("G\h i\m s\s", $time) . PHP_EOL . PHP_EOL;
|
||||
|
||||
ksort($exitcodes);
|
||||
|
||||
// Print exit info from each run.
|
||||
// Status bits contains pass/fail status of parallel runs.
|
||||
$status = 0;
|
||||
$processcounter = 0;
|
||||
foreach ($exitcodes as $exitcode) {
|
||||
if ($exitcode) {
|
||||
$status |= (1 << $processcounter);
|
||||
}
|
||||
$processcounter++;
|
||||
}
|
||||
|
||||
// Run finished. Show exit code and output from individual process.
|
||||
$verbose = empty($options['verbose']) ? false : true;
|
||||
$verbose = $verbose || !empty($status);
|
||||
|
||||
// Show exit code from each process, if any process failed.
|
||||
if ($verbose) {
|
||||
// Echo exit codes.
|
||||
echo "Exit codes for each behat run: " . PHP_EOL;
|
||||
foreach ($exitcodes as $run => $exitcode) {
|
||||
echo $run . ": " . $exitcode . PHP_EOL;
|
||||
// Command to execute behat run.
|
||||
$cmds[BEHAT_PARALLEL_SITE_NAME . $i] = $behatcommand . ' --config ' . $behatconfigpath . " " . $myopts;
|
||||
echo "[" . BEHAT_PARALLEL_SITE_NAME . $i . "] " . $cmds[BEHAT_PARALLEL_SITE_NAME . $i] . PHP_EOL;
|
||||
}
|
||||
|
||||
// Show failed re-run commands.
|
||||
if ($status) {
|
||||
echo "To re-run failed processes, you can use following commands:" . PHP_EOL;
|
||||
foreach ($cmds as $name => $cmd) {
|
||||
if (!empty($exitcodes[$name])) {
|
||||
echo "[" . $name . "] " . $cmd . PHP_EOL;
|
||||
if (empty($cmds)) {
|
||||
echo "No commands to execute " . PHP_EOL;
|
||||
exit(1);
|
||||
}
|
||||
|
||||
// Create site symlink if necessary.
|
||||
if (!behat_config_manager::create_parallel_site_links($options['fromrun'], $options['torun'])) {
|
||||
echo "Check permissions. If on windows, make sure you are running this command as admin" . PHP_EOL;
|
||||
exit(1);
|
||||
}
|
||||
|
||||
// Save torun and from run, so it can be used to detect if it was executed in last run.
|
||||
behat_config_manager::set_behat_run_config_value('lasttorun', $options['torun']);
|
||||
behat_config_manager::set_behat_run_config_value('lastfromrun', $options['fromrun']);
|
||||
|
||||
// Keep no delay by default, between each parallel, let user decide.
|
||||
if (!defined('BEHAT_PARALLEL_START_DELAY')) {
|
||||
define('BEHAT_PARALLEL_START_DELAY', 0);
|
||||
}
|
||||
|
||||
// Execute all commands, relative to moodle root directory.
|
||||
$processes = cli_execute_parallel($cmds, __DIR__ . "/../../../../", BEHAT_PARALLEL_START_DELAY);
|
||||
$stoponfail = empty($options['stop-on-failure']) ? false : true;
|
||||
|
||||
// Print header.
|
||||
print_process_start_info($processes);
|
||||
|
||||
// Print combined run o/p from processes.
|
||||
$exitcodes = print_combined_run_output($processes, $stoponfail);
|
||||
// Time to finish run.
|
||||
$time = round(microtime(true) - $time, 1);
|
||||
echo "Finished in " . gmdate("G\h i\m s\s", $time) . PHP_EOL . PHP_EOL;
|
||||
ksort($exitcodes);
|
||||
|
||||
// Print exit info from each run.
|
||||
// Status bits contains pass/fail status of parallel runs.
|
||||
foreach ($exitcodes as $name => $exitcode) {
|
||||
if ($exitcode) {
|
||||
$runno = str_replace(BEHAT_PARALLEL_SITE_NAME, '', $name);
|
||||
$status |= (1 << ($runno - 1));
|
||||
}
|
||||
}
|
||||
|
||||
// Print each process information.
|
||||
print_each_process_info($processes, $verbose, $status);
|
||||
}
|
||||
|
||||
// Save final exit code containing which run failed.
|
||||
behat_config_manager::set_behat_run_config_value('lastcombinedfailedstatus', $status);
|
||||
|
||||
// Show exit code from each process, if any process failed and how to rerun failed process.
|
||||
if ($verbose || $status) {
|
||||
// Check if status of last run is failure and rerun is suggested.
|
||||
if (!empty($options['auto-rerun']) && $status) {
|
||||
// Rerun for the number of tries passed.
|
||||
for ($i = 0; $i < $options['auto-rerun']; $i++) {
|
||||
|
||||
// Run individual commands, to avoid parallel failures.
|
||||
foreach ($exitcodes as $behatrunname => $exitcode) {
|
||||
// If not failed in last run, then skip.
|
||||
if ($exitcode == 0) {
|
||||
continue;
|
||||
}
|
||||
|
||||
// This was a failure.
|
||||
echo "*** Re-running behat run: $behatrunname ***" . PHP_EOL;
|
||||
if ($verbose) {
|
||||
echo "Executing: " . $cmds[$behatrunname] . " --rerun" . PHP_EOL;
|
||||
}
|
||||
|
||||
passthru("php $cmds[$behatrunname] --rerun", $rerunstatus);
|
||||
|
||||
// Update exit code.
|
||||
$exitcodes[$behatrunname] = $rerunstatus;
|
||||
}
|
||||
}
|
||||
|
||||
// Update status after auto-rerun finished.
|
||||
foreach ($exitcodes as $name => $exitcode) {
|
||||
if ($exitcode) {
|
||||
if (!empty($parallelrun)) {
|
||||
$runno = str_replace(BEHAT_PARALLEL_SITE_NAME, '', $name);
|
||||
} else {
|
||||
$runno = 1;
|
||||
}
|
||||
$status |= (1 << ($runno - 1));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Show final o/p with re-run commands.
|
||||
if ($status) {
|
||||
if (!empty($parallelrun)) {
|
||||
// Echo exit codes.
|
||||
echo "Exit codes for each behat run: " . PHP_EOL;
|
||||
foreach ($exitcodes as $run => $exitcode) {
|
||||
echo $run . ": " . $exitcode . PHP_EOL;
|
||||
}
|
||||
unset($extraopts['fromrun']);
|
||||
unset($extraopts['torun']);
|
||||
if (!empty($options['replace'])) {
|
||||
$extraopts['replace'] = '--replace="' . $options['replace'] . '"';
|
||||
}
|
||||
}
|
||||
|
||||
echo "To re-run failed processes, you can use following command:" . PHP_EOL;
|
||||
$extraopts['rerun'] = '--rerun';
|
||||
$extraoptstr = implode(' ', $extraopts);
|
||||
echo behat_command::get_behat_command(true, true, true) . " " . $extraoptstr . PHP_EOL;
|
||||
}
|
||||
echo PHP_EOL;
|
||||
}
|
||||
|
||||
print_each_process_info($processes, $verbose);
|
||||
|
||||
// Remove site symlink if necessary.
|
||||
behat_config_manager::drop_parallel_site_links();
|
||||
|
||||
@@ -364,23 +476,47 @@ function print_combined_run_output($processes, $stoponfail = false) {
|
||||
* @param array $processes list of processes to loop though.
|
||||
* @param bool $verbose Show verbose output for each process.
|
||||
*/
|
||||
function print_each_process_info($processes, $verbose = false) {
|
||||
function print_each_process_info($processes, $verbose = false, $status = 0) {
|
||||
foreach ($processes as $name => $process) {
|
||||
echo "**************** [" . $name . "] ****************" . PHP_EOL;
|
||||
if ($verbose) {
|
||||
echo $process->getOutput();
|
||||
echo $process->getErrorOutput();
|
||||
} else {
|
||||
$op = explode(PHP_EOL, $process->getOutput());
|
||||
foreach ($op as $line) {
|
||||
// Don't print progress .
|
||||
if (trim($line) && (strpos($line, '.') !== 0) && (strpos($line, 'Moodle ') !== 0) &&
|
||||
(strpos($line, 'Server OS ') !== 0) && (strpos($line, 'Started at ') !== 0) &&
|
||||
(strpos($line, 'Browser specific fixes ') !== 0)) {
|
||||
echo $line . PHP_EOL;
|
||||
}
|
||||
|
||||
} else if ($status) {
|
||||
// Only show failed o/p.
|
||||
$runno = str_replace(BEHAT_PARALLEL_SITE_NAME, '', $name);
|
||||
if ((1 << ($runno - 1)) & $status) {
|
||||
echo $process->getOutput();
|
||||
echo $process->getErrorOutput();
|
||||
} else {
|
||||
echo get_status_lines_from_run_op($process);
|
||||
}
|
||||
|
||||
} else {
|
||||
echo get_status_lines_from_run_op($process);
|
||||
}
|
||||
echo PHP_EOL;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Extract status information from behat o/p and return.
|
||||
* @param Symfony\Component\Process\Process $process
|
||||
* @return string
|
||||
*/
|
||||
function get_status_lines_from_run_op(Symfony\Component\Process\Process $process) {
|
||||
$statusstr = '';
|
||||
$op = explode(PHP_EOL, $process->getOutput());
|
||||
foreach ($op as $line) {
|
||||
// Don't print progress .
|
||||
if (trim($line) && (strpos($line, '.') !== 0) && (strpos($line, 'Moodle ') !== 0) &&
|
||||
(strpos($line, 'Server OS ') !== 0) && (strpos($line, 'Started at ') !== 0) &&
|
||||
(strpos($line, 'Browser specific fixes ') !== 0)) {
|
||||
$statusstr .= $line . PHP_EOL;
|
||||
}
|
||||
}
|
||||
|
||||
return $statusstr;
|
||||
}
|
||||
|
||||
|
||||
@@ -36,11 +36,7 @@ define('NO_OUTPUT_BUFFERING', true);
|
||||
define('IGNORE_COMPONENT_CACHE', true);
|
||||
define('ABORT_AFTER_CONFIG', true);
|
||||
|
||||
require_once(__DIR__ . '/../../../../config.php');
|
||||
require_once(__DIR__ . '/../../../../lib/clilib.php');
|
||||
require_once(__DIR__ . '/../../../../lib/behat/lib.php');
|
||||
require_once(__DIR__ . '/../../../../lib/behat/classes/behat_command.php');
|
||||
require_once(__DIR__ . '/../../../../lib/behat/classes/behat_config_manager.php');
|
||||
|
||||
// CLI options.
|
||||
list($options, $unrecognized) = cli_get_params(
|
||||
@@ -103,14 +99,26 @@ if (!empty($options['help'])) {
|
||||
|
||||
$cwd = getcwd();
|
||||
|
||||
// If Behat parallel site is being initiliased, then define a param to be used to ignore single run install.
|
||||
if (!empty($options['parallel'])) {
|
||||
define('BEHAT_PARALLEL_UTIL', true);
|
||||
}
|
||||
|
||||
require_once(__DIR__ . '/../../../../config.php');
|
||||
require_once(__DIR__ . '/../../../../lib/behat/lib.php');
|
||||
require_once(__DIR__ . '/../../../../lib/behat/classes/behat_command.php');
|
||||
require_once(__DIR__ . '/../../../../lib/behat/classes/behat_config_manager.php');
|
||||
|
||||
// For drop option check if parallel site.
|
||||
if ((empty($options['parallel'])) && ($options['drop']) || $options['updatesteps']) {
|
||||
// Get parallel run info from first run.
|
||||
$options['parallel'] = behat_config_manager::get_parallel_test_runs($options['fromrun']);
|
||||
$options['parallel'] = behat_config_manager::get_behat_run_config_value('parallel');
|
||||
}
|
||||
|
||||
// If not a parallel site then open single run.
|
||||
if (empty($options['parallel'])) {
|
||||
// Set run config value for single run.
|
||||
behat_config_manager::set_behat_run_config_value('singlerun', 1);
|
||||
|
||||
chdir(__DIR__);
|
||||
// Check if behat is initialised, if not exit.
|
||||
passthru("php util_single_run.php --diag", $status);
|
||||
@@ -147,6 +155,21 @@ if ($options['diag'] || $options['enable'] || $options['disable']) {
|
||||
$status = (bool)$status || (bool)$exitcode;
|
||||
}
|
||||
|
||||
// Remove run config file.
|
||||
$behatrunconfigfile = behat_config_manager::get_behat_run_config_file_path();
|
||||
if (file_exists($behatrunconfigfile)) {
|
||||
if (!unlink($behatrunconfigfile)) {
|
||||
behat_error(BEHAT_EXITCODE_PERMISSIONS, 'Can not delete behat run config file');
|
||||
}
|
||||
}
|
||||
|
||||
// Remove test file path.
|
||||
if (file_exists(behat_util::get_test_file_path())) {
|
||||
if (!unlink(behat_util::get_test_file_path())) {
|
||||
behat_error(BEHAT_EXITCODE_PERMISSIONS, 'Can not delete test file enable info');
|
||||
}
|
||||
}
|
||||
|
||||
} else if ($options['install']) {
|
||||
// This is intensive compared to behat itself so run them in chunk if option maxruns not set.
|
||||
if ($options['maxruns']) {
|
||||
@@ -233,6 +256,19 @@ if ($options['install']) {
|
||||
} else if ($options['enable']) {
|
||||
echo "Acceptance tests environment enabled on $CFG->behat_wwwroot, to run the tests use:" . PHP_EOL;
|
||||
echo behat_command::get_behat_command(true, true);
|
||||
|
||||
// Save fromrun and to run information.
|
||||
if (isset($options['fromrun'])) {
|
||||
behat_config_manager::set_behat_run_config_value('fromrun', $options['fromrun']);
|
||||
}
|
||||
|
||||
if (isset($options['torun'])) {
|
||||
behat_config_manager::set_behat_run_config_value('torun', $options['torun']);
|
||||
}
|
||||
if (isset($options['parallel'])) {
|
||||
behat_config_manager::set_behat_run_config_value('parallel', $options['parallel']);
|
||||
}
|
||||
|
||||
echo PHP_EOL;
|
||||
|
||||
} else if ($options['disable']) {
|
||||
|
||||
@@ -143,7 +143,7 @@ if ($options['run']) {
|
||||
$run = $options['run'];
|
||||
// If parallel option is not passed, then try get it form config.
|
||||
if (!$options['parallel']) {
|
||||
$parallel = behat_config_manager::get_parallel_test_runs();
|
||||
$parallel = behat_config_manager::get_behat_run_config_value('parallel');
|
||||
} else {
|
||||
$parallel = $options['parallel'];
|
||||
}
|
||||
@@ -176,10 +176,7 @@ if ($options['install']) {
|
||||
} else if ($options['enable']) {
|
||||
if (!empty($parallel)) {
|
||||
// Save parallel site info for enable and install options.
|
||||
$filepath = behat_config_manager::get_parallel_test_file_path();
|
||||
if (!file_put_contents($filepath, $parallel)) {
|
||||
behat_error(BEHAT_EXITCODE_PERMISSIONS, 'File ' . $filepath . ' can not be created');
|
||||
}
|
||||
behat_config_manager::set_behat_run_config_value('behatsiteenabled', 1);
|
||||
}
|
||||
|
||||
// Enable test mode.
|
||||
@@ -200,7 +197,7 @@ if ($options['install']) {
|
||||
}
|
||||
|
||||
} else if ($options['disable']) {
|
||||
behat_util::stop_test_mode();
|
||||
behat_util::stop_test_mode($run);
|
||||
// This is only displayed once for parallel install.
|
||||
if (empty($run)) {
|
||||
mtrace("Acceptance tests environment disabled");
|
||||
|
||||
@@ -59,8 +59,7 @@ Feature: Set up contextual data for tests
|
||||
When I log in as "admin"
|
||||
And I am on site homepage
|
||||
And I follow "Course 1"
|
||||
And I expand "Users" node
|
||||
And I follow "Groups"
|
||||
And I navigate to "Users > Groups" in current page administration
|
||||
Then I should see "Group 1"
|
||||
And I should see "Group 2"
|
||||
And I follow "Groupings"
|
||||
@@ -90,8 +89,7 @@ Feature: Set up contextual data for tests
|
||||
When I log in as "admin"
|
||||
And I am on site homepage
|
||||
And I follow "Course 1"
|
||||
And I expand "Users" node
|
||||
And I follow "Permissions"
|
||||
And I navigate to "Users > Permissions" in current page administration
|
||||
And I set the field "Advanced role override" to "Student (1)"
|
||||
Then "mod/forum:editanypost" capability has "Allow" permission
|
||||
And I press "Cancel"
|
||||
@@ -134,30 +132,31 @@ Feature: Set up contextual data for tests
|
||||
And the following "course enrolments" exist:
|
||||
| user | course | role |
|
||||
| user4 | C1 | custom1 |
|
||||
| user2 | C1 | student |
|
||||
| user3 | C1 | editingteacher |
|
||||
And the following "role assigns" exist:
|
||||
| user | role | contextlevel | reference |
|
||||
| user1 | manager | System | |
|
||||
| user2 | editingteacher | Category | CAT1 |
|
||||
| user3 | editingteacher | Course | C1 |
|
||||
| user5 | custom2 | System | |
|
||||
When I log in as "user1"
|
||||
And I am on site homepage
|
||||
Then I should see "Front page settings"
|
||||
Then "Edit settings" "link" should exist in current page administration
|
||||
And I log out
|
||||
And I log in as "user2"
|
||||
And I am on site homepage
|
||||
And I follow "Course 1"
|
||||
And I should see "Turn editing on"
|
||||
And "Turn editing on" "link" should exist in current page administration
|
||||
And I log out
|
||||
And I log in as "user3"
|
||||
And I am on site homepage
|
||||
And I follow "Course 1"
|
||||
And I should see "Turn editing on"
|
||||
And "Turn editing on" "link" should exist in current page administration
|
||||
And I log out
|
||||
And I log in as "user4"
|
||||
And I am on site homepage
|
||||
And I follow "Course 1"
|
||||
And I should see "Turn editing on"
|
||||
And "Turn editing on" "link" should exist in current page administration
|
||||
And I log out
|
||||
And I log in as "user5"
|
||||
And I should see "You are logged in as"
|
||||
@@ -264,8 +263,7 @@ Feature: Set up contextual data for tests
|
||||
When I log in as "admin"
|
||||
And I am on site homepage
|
||||
And I follow "Course 1"
|
||||
And I expand "Users" node
|
||||
And I follow "Groups"
|
||||
And I navigate to "Users > Groups" in current page administration
|
||||
Then the "groups" select box should contain "Group 1 (1)"
|
||||
And the "groups" select box should contain "Group 2 (1)"
|
||||
And I set the field "groups" to "Group 1 (1)"
|
||||
@@ -302,7 +300,7 @@ Feature: Set up contextual data for tests
|
||||
| System cohort A | 1 |
|
||||
| System cohort B | 2 |
|
||||
And I should not see "Cohort in category"
|
||||
And I follow "Courses"
|
||||
And I am on course index
|
||||
And I follow "Cat 1"
|
||||
And I follow "Cohorts"
|
||||
And I should not see "System cohort"
|
||||
@@ -322,10 +320,9 @@ Feature: Set up contextual data for tests
|
||||
| fullname | course | gradecategory |
|
||||
| Grade sub category 2 | C1 | Grade category 1 |
|
||||
When I log in as "admin"
|
||||
And I am on site homepage
|
||||
And I follow "Courses"
|
||||
And I am on course index
|
||||
And I follow "Course 1"
|
||||
And I go to "View > Grader report" in the course gradebook
|
||||
And I navigate to "View > Grader report" in the course gradebook
|
||||
Then I should see "Grade category 1"
|
||||
And I should see "Grade sub category 2"
|
||||
|
||||
@@ -349,7 +346,7 @@ Feature: Set up contextual data for tests
|
||||
When I log in as "admin"
|
||||
And I am on site homepage
|
||||
And I follow "Course 1"
|
||||
And I go to "Setup > Gradebook setup" in the course gradebook
|
||||
And I navigate to "Setup > Gradebook setup" in the course gradebook
|
||||
Then I should see "Test Grade Item 1"
|
||||
And I follow "Edit Test Grade Item 1"
|
||||
And I expand all fieldsets
|
||||
@@ -378,7 +375,7 @@ Feature: Set up contextual data for tests
|
||||
When I log in as "admin"
|
||||
And I am on site homepage
|
||||
And I follow "Course 1"
|
||||
And I go to "Scales" in the course gradebook
|
||||
And I navigate to "Scales" in the course gradebook
|
||||
Then I should see "Test Scale 1"
|
||||
And I should see "Disappointing, Good, Very good, Excellent"
|
||||
|
||||
@@ -429,7 +426,7 @@ Feature: Set up contextual data for tests
|
||||
When I log in as "admin"
|
||||
And I am on site homepage
|
||||
And I follow "Course 1"
|
||||
And I go to "Setup > Gradebook setup" in the course gradebook
|
||||
And I navigate to "Setup > Gradebook setup" in the course gradebook
|
||||
Then I should see "Test Outcome Grade Item 1"
|
||||
And I follow "Edit Test Outcome Grade Item 1"
|
||||
And the field "Outcome" matches value "Grade outcome 1"
|
||||
|
||||
@@ -32,8 +32,7 @@ Feature: Edit capabilities
|
||||
Scenario: Course capabilities overrides
|
||||
Given I log in as "teacher1"
|
||||
And I follow "Course 1"
|
||||
And I expand "Users" node
|
||||
And I follow "Permissions"
|
||||
And I navigate to "Users > Permissions" in current page administration
|
||||
And I override the system permissions of "Student" role with:
|
||||
| mod/forum:deleteanypost | Prohibit |
|
||||
| mod/forum:editanypost | Prevent |
|
||||
@@ -52,7 +51,7 @@ Feature: Edit capabilities
|
||||
| Forum name | I'm the name |
|
||||
| Description | I'm the introduction |
|
||||
And I follow "I'm the name"
|
||||
And I navigate to "Permissions" node in "Forum administration"
|
||||
And I navigate to "Permissions" in current page administration
|
||||
And I override the system permissions of "Student" role with:
|
||||
| mod/forum:deleteanypost | Prohibit |
|
||||
| mod/forum:editanypost | Prevent |
|
||||
|
||||
@@ -33,8 +33,6 @@ Feature: Verify that all form fields values can be get and set
|
||||
| activity | course | idnumber | name | intro | firstpagetitle | wikimode | visible |
|
||||
| wiki | C1 | wiki1 | Test this one | Test this one | Test this one | collaborative | 0 |
|
||||
And I log in as "admin"
|
||||
And I expand "Site administration" node
|
||||
And I expand "Appearance" node
|
||||
And I am on site homepage
|
||||
And I follow "Course 1"
|
||||
And I navigate to "Reset" node in "Course administration"
|
||||
@@ -60,9 +58,8 @@ Feature: Verify that all form fields values can be get and set
|
||||
| HTML format | Student page contents |
|
||||
And I press "Save"
|
||||
Then I should see "Student page contents" in the "region-main" "region"
|
||||
And I click on "Edit" "link" in the "Administration" "block"
|
||||
# Select (multi-select) - Checking "I set the field".
|
||||
And I click on "Edit settings" "link" in the "Administration" "block"
|
||||
And I navigate to "Edit settings" in current page administration
|
||||
And I expand all fieldsets
|
||||
# Checkbox - Checking "I set the field".
|
||||
And I set the field "Display description on course page" to "1"
|
||||
@@ -75,7 +72,7 @@ Feature: Verify that all form fields values can be get and set
|
||||
And I press "Save and return to course"
|
||||
And I should see "Test this one"
|
||||
And I follow "Test this one"
|
||||
And I click on "Edit settings" "link" in the "Administration" "block"
|
||||
And I navigate to "Edit settings" in current page administration
|
||||
# Checkbox - Checking "the field matches value" and "the following fields match these values".
|
||||
And the following fields match these values:
|
||||
| Display description on course page | 1 |
|
||||
@@ -91,7 +88,7 @@ Feature: Verify that all form fields values can be get and set
|
||||
# Select (simple) - Checking "I set the field".
|
||||
And I set the field "Group mode" to "Separate groups"
|
||||
And I press "Save and display"
|
||||
And I click on "Edit settings" "link" in the "Administration" "block"
|
||||
And I navigate to "Edit settings" in current page administration
|
||||
And the following fields match these values:
|
||||
| Default format | NWiki |
|
||||
| Group mode | Separate groups |
|
||||
@@ -134,8 +131,7 @@ Feature: Verify that all form fields values can be get and set
|
||||
@javascript
|
||||
Scenario: with JS enabled all form fields getters and setters works as expected
|
||||
Then I follow "Course 1"
|
||||
And I expand "Users" node
|
||||
And I follow "Groups"
|
||||
And I navigate to "Users > Groups" in current page administration
|
||||
# Select (multi-select & AJAX) - Checking "I set the field" and "select box should contain".
|
||||
And I set the field "groups" to "Group 2"
|
||||
And the "members" select box should contain "Student 2"
|
||||
@@ -158,7 +154,7 @@ Feature: Verify that all form fields values can be get and set
|
||||
And the "available[day]" "field" should be enabled
|
||||
And the field "deadline[enabled]" matches value "1"
|
||||
And I press "Save and display"
|
||||
And I click on "Edit settings" "link" in the "Administration" "block"
|
||||
And I navigate to "Edit settings" in current page administration
|
||||
And the field "available[enabled]" matches value "1"
|
||||
And the "available[day]" "field" should be enabled
|
||||
And the field "deadline[enabled]" matches value "1"
|
||||
|
||||
@@ -7,8 +7,7 @@ Feature: Forms manipulation
|
||||
@javascript
|
||||
Scenario: Basic forms manipulation
|
||||
Given I log in as "admin"
|
||||
And I follow "Preferences" in the user menu
|
||||
And I click on "Edit profile" "link" in the "region-main" "region"
|
||||
And I open my profile in edit mode
|
||||
When I set the field "First name" to "Field value"
|
||||
And I set the field "Select a country" to "Japan"
|
||||
And I set the field "New password" to "TestPass"
|
||||
|
||||
@@ -10,8 +10,7 @@ Feature: Transform steps arguments
|
||||
| fullname | shortname | category |
|
||||
| Course 1 | C1 | 0 |
|
||||
And I log in as "admin"
|
||||
And I follow "Preferences" in the user menu
|
||||
And I click on "Edit profile" "link" in the "region-main" "region"
|
||||
And I open my profile in edit mode
|
||||
|
||||
Scenario: Use nasty strings on steps arguments
|
||||
When I set the field "Surname" to "$NASTYSTRING1"
|
||||
|
||||
@@ -41,5 +41,8 @@ function xmldb_tool_customlang_upgrade($oldversion) {
|
||||
// Moodle v3.1.0 release upgrade line.
|
||||
// Put any upgrade step following this.
|
||||
|
||||
// Automatically generated Moodle v3.2.0 release upgrade line.
|
||||
// Put any upgrade step following this.
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -45,5 +45,8 @@ function xmldb_tool_log_upgrade($oldversion) {
|
||||
// Moodle v3.1.0 release upgrade line.
|
||||
// Put any upgrade step following this.
|
||||
|
||||
// Automatically generated Moodle v3.2.0 release upgrade line.
|
||||
// Put any upgrade step following this.
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -39,5 +39,8 @@ function xmldb_logstore_database_upgrade($oldversion) {
|
||||
// Moodle v3.1.0 release upgrade line.
|
||||
// Put any upgrade step following this.
|
||||
|
||||
// Automatically generated Moodle v3.2.0 release upgrade line.
|
||||
// Put any upgrade step following this.
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -56,5 +56,8 @@ function xmldb_logstore_standard_upgrade($oldversion) {
|
||||
// Moodle v3.1.0 release upgrade line.
|
||||
// Put any upgrade step following this.
|
||||
|
||||
// Automatically generated Moodle v3.2.0 release upgrade line.
|
||||
// Put any upgrade step following this.
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -99,7 +99,7 @@ class competency extends persistent {
|
||||
// Description.
|
||||
$mform->addElement('editor', 'description',
|
||||
get_string('description', 'tool_lp'), array('rows' => 4));
|
||||
$mform->setType('description', PARAM_RAW);
|
||||
$mform->setType('description', PARAM_CLEANHTML);
|
||||
// ID number.
|
||||
$mform->addElement('text', 'idnumber', get_string('idnumber', 'tool_lp'), 'maxlength="100"');
|
||||
$mform->setType('idnumber', PARAM_RAW);
|
||||
|
||||
@@ -62,7 +62,7 @@ class competency_framework extends persistent {
|
||||
// Description.
|
||||
$mform->addElement('editor', 'description',
|
||||
get_string('description', 'tool_lp'), array('rows' => 4));
|
||||
$mform->setType('description', PARAM_RAW);
|
||||
$mform->setType('description', PARAM_CLEANHTML);
|
||||
// ID number.
|
||||
$mform->addElement('text', 'idnumber', get_string('idnumber', 'tool_lp'), 'maxlength="100"');
|
||||
$mform->setType('idnumber', PARAM_RAW);
|
||||
|
||||
@@ -184,8 +184,14 @@ abstract class persistent extends moodleform {
|
||||
$data = $this->get_persistent()->to_record();
|
||||
$class = static::$persistentclass;
|
||||
$properties = $class::get_formatted_properties();
|
||||
$allproperties = $class::properties_definition();
|
||||
|
||||
foreach ($data as $field => $value) {
|
||||
// Clean data if it is to be displayed in a form.
|
||||
if (isset($allproperties[$field]['type'])) {
|
||||
$data->$field = clean_param($data->$field, $allproperties[$field]['type']);
|
||||
}
|
||||
|
||||
// Convert formatted properties.
|
||||
if (isset($properties[$field])) {
|
||||
$data->$field = array(
|
||||
|
||||
@@ -59,7 +59,7 @@ class plan extends persistent {
|
||||
$mform->addRule('name', get_string('maximumchars', '', 100), 'maxlength', 100, 'client');
|
||||
// Description.
|
||||
$mform->addElement('editor', 'description', get_string('plandescription', 'tool_lp'), array('rows' => 4));
|
||||
$mform->setType('description', PARAM_RAW);
|
||||
$mform->setType('description', PARAM_CLEANHTML);
|
||||
|
||||
$mform->addElement('date_time_selector', 'duedate', get_string('duedate', 'tool_lp'), array('optional' => true));
|
||||
$mform->addHelpButton('duedate', 'duedate', 'tool_lp');
|
||||
|
||||
@@ -58,7 +58,7 @@ class template extends persistent {
|
||||
// Description.
|
||||
$mform->addElement('editor', 'description',
|
||||
get_string('description', 'tool_lp'), array('rows' => 4));
|
||||
$mform->setType('description', PARAM_RAW);
|
||||
$mform->setType('description', PARAM_CLEANHTML);
|
||||
$mform->addElement('selectyesno', 'visible',
|
||||
get_string('visible', 'tool_lp'));
|
||||
$mform->addElement('date_time_selector',
|
||||
|
||||
@@ -54,7 +54,7 @@ class user_evidence extends persistent {
|
||||
$mform->addRule('name', get_string('maximumchars', '', 100), 'maxlength', 100, 'client');
|
||||
// Description.
|
||||
$mform->addElement('editor', 'description', get_string('userevidencedescription', 'tool_lp'), array('rows' => 10));
|
||||
$mform->setType('description', PARAM_RAW);
|
||||
$mform->setType('description', PARAM_CLEANHTML);
|
||||
|
||||
$mform->addElement('url', 'url', get_string('userevidenceurl', 'tool_lp'), array('size' => '60'), array('usefilepicker' => false));
|
||||
$mform->setType('url', PARAM_RAW_TRIMMED); // Can not use PARAM_URL, it silently converts bad URLs to ''.
|
||||
|
||||
@@ -93,7 +93,7 @@ require(['core/str'], function(Str) {
|
||||
{ key: 'comments', component: 'moodle' },
|
||||
{ key: 'commentscount', component: 'moodle' },
|
||||
{ key: 'commentsrequirelogin', component: 'moodle' },
|
||||
{ key: 'deletecomment', component: 'moodle' },
|
||||
{ key: 'deletecommentbyon', component: 'moodle' },
|
||||
]).then(function() {
|
||||
// Kick off when strings are loaded.
|
||||
Y.use('core_comment', function(Y) {
|
||||
|
||||
@@ -7,12 +7,9 @@ Feature: Manage competency frameworks
|
||||
Background:
|
||||
Given I log in as "admin"
|
||||
And I am on site homepage
|
||||
And I expand "Site administration" node
|
||||
When I expand "Competencies" node
|
||||
Then I should see "Competency frameworks"
|
||||
|
||||
Scenario: Create a new framework
|
||||
Given I follow "Competency frameworks"
|
||||
Given I navigate to "Competencies > Competency frameworks" in site administration
|
||||
And I should see "List of competency frameworks"
|
||||
And I click on "Add new competency framework" "button"
|
||||
And I should see "General"
|
||||
@@ -34,7 +31,7 @@ Feature: Manage competency frameworks
|
||||
Given the following lp "frameworks" exist:
|
||||
| shortname | idnumber |
|
||||
| Science Year-2 | sc-y-2 |
|
||||
And I follow "Competency frameworks"
|
||||
And I navigate to "Competencies > Competency frameworks" in site administration
|
||||
And I should see "Science Year-2"
|
||||
When I click on "Science Year-2" "link"
|
||||
Then I should see "Science Year-2"
|
||||
@@ -43,7 +40,7 @@ Feature: Manage competency frameworks
|
||||
Given the following lp "frameworks" exist:
|
||||
| shortname | idnumber |
|
||||
| Science Year-3 | sc-y-3 |
|
||||
And I follow "Competency frameworks"
|
||||
And I navigate to "Competencies > Competency frameworks" in site administration
|
||||
And I should see "Science Year-3"
|
||||
And I click on "Edit" of edit menu in the "Science Year-3" row
|
||||
And the field "Name" matches value "Science Year-3 "
|
||||
@@ -57,7 +54,7 @@ Feature: Manage competency frameworks
|
||||
Given the following lp "frameworks" exist:
|
||||
| shortname | idnumber |
|
||||
| Science Year-4 | sc-y-4 |
|
||||
And I follow "Competency frameworks"
|
||||
And I navigate to "Competencies > Competency frameworks" in site administration
|
||||
And I should see "Science Year-4"
|
||||
And I should see "sc-y-4"
|
||||
And I click on "Delete" of edit menu in the "Science Year-4" row
|
||||
@@ -90,7 +87,7 @@ Scenario: Edit a framework with competencies in user competency
|
||||
| user | competency |
|
||||
| admin | Comp1 |
|
||||
| admin | Comp2 |
|
||||
And I follow "Competency frameworks"
|
||||
And I navigate to "Competencies > Competency frameworks" in site administration
|
||||
And I should see "Science Year-5"
|
||||
And I click on "Edit" of edit menu in the "Science Year-5" row
|
||||
And the field "Name" matches value "Science Year-5 "
|
||||
@@ -120,7 +117,7 @@ Scenario: Edit a framework with competencies in user competency plan
|
||||
| user | competency | plan |
|
||||
| admin | Comp1 | Plan Science-6 |
|
||||
| admin | Comp2 | Plan Science-6 |
|
||||
And I follow "Competency frameworks"
|
||||
And I navigate to "Competencies > Competency frameworks" in site administration
|
||||
And I should see "Science Year-6"
|
||||
And I click on "Edit" of edit menu in the "Science Year-6" row
|
||||
And the field "Name" matches value "Science Year-6 "
|
||||
|
||||
@@ -26,9 +26,7 @@ Feature: Manage plearning plan
|
||||
| shortname | description |
|
||||
| Science template | science template description |
|
||||
And I follow "Home"
|
||||
And I expand "Site administration" node
|
||||
And I expand "Competencies" node
|
||||
And I follow "Learning plan templates"
|
||||
And I navigate to "Competencies > Learning plan templates" in site administration
|
||||
And I click on ".template-userplans" "css_element" in the "Science template" "table_row"
|
||||
And I click on ".form-autocomplete-downarrow" "css_element"
|
||||
And I click on "Admin" item in the autocomplete list
|
||||
@@ -52,9 +50,7 @@ Feature: Manage plearning plan
|
||||
| student-plan1 | COHORTPLAN |
|
||||
| student-plan2 | COHORTPLAN |
|
||||
And I follow "Home"
|
||||
And I expand "Site administration" node
|
||||
And I expand "Competencies" node
|
||||
And I follow "Learning plan templates"
|
||||
And I navigate to "Competencies > Learning plan templates" in site administration
|
||||
And I click on ".template-cohorts" "css_element" in the "Science template cohort" "table_row"
|
||||
And I click on ".form-autocomplete-downarrow" "css_element"
|
||||
And I click on "cohort plan" item in the autocomplete list
|
||||
|
||||
@@ -145,10 +145,7 @@ Feature: Manage plan workflow
|
||||
| Test-Plan3 | user1 | Description of plan 3 for user 1 | active | manager1 |
|
||||
| Test-Plan4 | user1 | Description of plan 4 for user 1 | active | manager1 |
|
||||
And I log in as "manager1"
|
||||
And I expand "Site administration" node
|
||||
And I expand "Users" node
|
||||
And I expand "Accounts" node
|
||||
And I follow "Browse list of users"
|
||||
And I navigate to "Users > Accounts > Browse list of users" in site administration
|
||||
And I follow "User 1"
|
||||
And I follow "Learning plans"
|
||||
And I should see "List of learning plans"
|
||||
@@ -167,10 +164,7 @@ Feature: Manage plan workflow
|
||||
| Test-Plan3 | user1 | Description of plan 3 for user 1 | active | manager1 |
|
||||
| Test-Plan4 | user1 | Description of plan 4 for user 1 | active | manager1 |
|
||||
And I log in as "manager1"
|
||||
And I expand "Site administration" node
|
||||
And I expand "Users" node
|
||||
And I expand "Accounts" node
|
||||
And I follow "Browse list of users"
|
||||
And I navigate to "Users > Accounts > Browse list of users" in site administration
|
||||
And I follow "User 1"
|
||||
And I follow "Learning plans"
|
||||
And I should see "List of learning plans"
|
||||
@@ -191,10 +185,7 @@ Scenario: Manager reopen a complete learning plan
|
||||
| Test-Plan3 | user1 | Description of plan 3 for user 1 | complete | manager1 |
|
||||
| Test-Plan4 | user1 | Description of plan 4 for user 1 | complete | manager1 |
|
||||
And I log in as "manager1"
|
||||
And I expand "Site administration" node
|
||||
And I expand "Users" node
|
||||
And I expand "Accounts" node
|
||||
And I follow "Browse list of users"
|
||||
And I navigate to "Users > Accounts > Browse list of users" in site administration
|
||||
And I follow "User 1"
|
||||
And I follow "Learning plans"
|
||||
And I should see "List of learning plans"
|
||||
|
||||
@@ -7,12 +7,9 @@ Feature: Manage plearning plan templates
|
||||
Background:
|
||||
Given I log in as "admin"
|
||||
And I am on site homepage
|
||||
And I expand "Site administration" node
|
||||
When I expand "Competencies" node
|
||||
Then I should see "Learning plan templates"
|
||||
|
||||
Scenario: Create a new learning plan template
|
||||
Given I follow "Learning plan templates"
|
||||
Given I navigate to "Competencies > Learning plan templates" in site administration
|
||||
And I should see "List of learning plan templates"
|
||||
And I click on "Add new learning plan template" "button"
|
||||
And I should see "Add new learning plan template"
|
||||
@@ -26,7 +23,7 @@ Feature: Manage plearning plan templates
|
||||
Given the following lp "templates" exist:
|
||||
| shortname | description |
|
||||
| Science template Year-2 | science template description |
|
||||
And I follow "Learning plan templates"
|
||||
And I navigate to "Competencies > Learning plan templates" in site administration
|
||||
And I should see "Science template Year-2"
|
||||
When I click on "Science template Year-2" "link"
|
||||
Then I should see "Science template Year-2"
|
||||
@@ -36,7 +33,7 @@ Feature: Manage plearning plan templates
|
||||
Given the following lp "templates" exist:
|
||||
| shortname | description |
|
||||
| Science template Year-3 | science template description |
|
||||
And I follow "Learning plan templates"
|
||||
And I navigate to "Competencies > Learning plan templates" in site administration
|
||||
And I should see "Science template Year-3"
|
||||
And I click on "Edit" of edit menu in the "Science template Year-3" row
|
||||
And the field "Name" matches value "Science template Year-3"
|
||||
@@ -49,7 +46,7 @@ Feature: Manage plearning plan templates
|
||||
Given the following lp "templates" exist:
|
||||
| shortname | description |
|
||||
| Science template Year-4 | science template description |
|
||||
And I follow "Learning plan templates"
|
||||
And I navigate to "Competencies > Learning plan templates" in site administration
|
||||
And I should see "Science template Year-4"
|
||||
And I click on "Delete" of edit menu in the "Science template Year-4" row
|
||||
And "Confirm" "dialogue" should be visible
|
||||
|
||||
@@ -53,6 +53,10 @@ class framework_importer {
|
||||
protected $importer = null;
|
||||
protected $foundheaders = array();
|
||||
protected $scalecache = array();
|
||||
/** @var bool $useprogressbar Control whether importing should use progress bars or not. */
|
||||
protected $useprogressbar = false;
|
||||
/** @var \core\progress\display_if_slow|null $progress The progress bar instance. */
|
||||
protected $progress = null;
|
||||
|
||||
/**
|
||||
* Store an error message for display later
|
||||
@@ -164,8 +168,11 @@ class framework_importer {
|
||||
* @param string delimiter The specified delimiter for the file.
|
||||
* @param string importid The id of the csv import.
|
||||
* @param array mappingdata The mapping data from the import form.
|
||||
* @param bool $useprogressbar Whether progress bar should be displayed, to avoid html output on CLI.
|
||||
*/
|
||||
public function __construct($text = null, $encoding = null, $delimiter = null, $importid = 0, $mappingdata = null) {
|
||||
public function __construct($text = null, $encoding = null, $delimiter = null, $importid = 0, $mappingdata = null,
|
||||
$useprogressbar = false) {
|
||||
|
||||
global $CFG;
|
||||
|
||||
// The format of our records is:
|
||||
@@ -204,7 +211,7 @@ class framework_importer {
|
||||
}
|
||||
|
||||
$this->foundheaders = $this->importer->get_columns();
|
||||
|
||||
$this->useprogressbar = $useprogressbar;
|
||||
$domainid = 1;
|
||||
|
||||
$flat = array();
|
||||
@@ -264,8 +271,19 @@ class framework_importer {
|
||||
$this->fail(get_string('invalidimportfile', 'tool_lpimportcsv'));
|
||||
return;
|
||||
} else {
|
||||
// We are calling from browser, display progress bar.
|
||||
if ($this->useprogressbar === true) {
|
||||
$this->progress = new \core\progress\display_if_slow(get_string('processingfile', 'tool_lpimportcsv'));
|
||||
$this->progress->start_html();
|
||||
} else {
|
||||
// Avoid html output on CLI scripts.
|
||||
$this->progress = new \core\progress\none();
|
||||
}
|
||||
$this->progress->start_progress('', count($this->flat));
|
||||
// Build a tree from this flat list.
|
||||
raise_memory_limit(MEMORY_EXTRA);
|
||||
$this->add_children($this->framework, '');
|
||||
$this->progress->end_progress();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -278,6 +296,7 @@ class framework_importer {
|
||||
public function add_children(& $node, $parentidnumber) {
|
||||
foreach ($this->flat as $competency) {
|
||||
if ($competency->parentidnumber == $parentidnumber) {
|
||||
$this->progress->increment_progress();
|
||||
$node->children[] = $competency;
|
||||
$this->add_children($competency, $competency->idnumber);
|
||||
}
|
||||
@@ -443,17 +462,28 @@ class framework_importer {
|
||||
$record->contextid = context_system::instance()->id;
|
||||
|
||||
$framework = api::create_framework($record);
|
||||
if ($this->useprogressbar === true) {
|
||||
$this->progress = new \core\progress\display_if_slow(get_string('importingfile', 'tool_lpimportcsv'));
|
||||
$this->progress->start_html();
|
||||
} else {
|
||||
$this->progress = new \core\progress\none();
|
||||
}
|
||||
|
||||
$this->progress->start_progress('', (count($this->framework->children) * 2));
|
||||
raise_memory_limit(MEMORY_EXTRA);
|
||||
// Now all the children.
|
||||
foreach ($this->framework->children as $comp) {
|
||||
$this->progress->increment_progress();
|
||||
$this->create_competency($comp, null, $framework);
|
||||
}
|
||||
|
||||
// Now create the rules.
|
||||
foreach ($this->framework->children as $record) {
|
||||
$this->progress->increment_progress();
|
||||
$this->set_rules($record);
|
||||
$this->set_related($record);
|
||||
}
|
||||
$this->progress->end_progress();
|
||||
|
||||
$this->importer->cleanup();
|
||||
return $framework;
|
||||
|
||||
@@ -1,47 +0,0 @@
|
||||
<?php
|
||||
// This file is part of Moodle - http://moodle.org/
|
||||
//
|
||||
// Moodle is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU General Public License as published by
|
||||
// the Free Software Foundation, either version 3 of the License, or
|
||||
// (at your option) any later version.
|
||||
//
|
||||
// Moodle is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU General Public License
|
||||
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
/**
|
||||
* Page to continue after an action.
|
||||
*
|
||||
* @package tool_lpimportcsv
|
||||
* @copyright 2015 Damyon Wiese
|
||||
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
|
||||
*/
|
||||
|
||||
require_once(__DIR__ . '/../../../config.php');
|
||||
require_once($CFG->libdir.'/adminlib.php');
|
||||
|
||||
$pagetitle = get_string('pluginname', 'tool_lpimportcsv');
|
||||
|
||||
$context = context_system::instance();
|
||||
|
||||
$id = required_param('id', PARAM_INT);
|
||||
$url = new moodle_url("/admin/tool/lpimportcsv/index.php");
|
||||
$PAGE->set_context($context);
|
||||
$PAGE->set_url($url);
|
||||
$PAGE->set_title($pagetitle);
|
||||
$PAGE->set_pagelayout('admin');
|
||||
$PAGE->set_heading($pagetitle);
|
||||
|
||||
echo $OUTPUT->header();
|
||||
echo $OUTPUT->heading($pagetitle);
|
||||
$urlparams = ['competencyframeworkid' => $id, 'pagecontextid' => $context->id];
|
||||
$frameworksurl = new moodle_url('/admin/tool/lp/competencies.php', $urlparams);
|
||||
echo $OUTPUT->notification(get_string('competencyframeworkcreated', 'tool_lp'), 'notifysuccess');
|
||||
echo $OUTPUT->continue_button($frameworksurl);
|
||||
|
||||
echo $OUTPUT->footer();
|
||||
@@ -37,6 +37,7 @@ $PAGE->set_pagelayout('admin');
|
||||
$PAGE->set_heading($pagetitle);
|
||||
|
||||
$form = null;
|
||||
echo $OUTPUT->header();
|
||||
if (optional_param('needsconfirm', 0, PARAM_BOOL)) {
|
||||
$form = new \tool_lpimportcsv\form\import($url->out(false));
|
||||
} else if (optional_param('confirm', 0, PARAM_BOOL)) {
|
||||
@@ -53,7 +54,7 @@ if ($form->is_cancelled()) {
|
||||
|
||||
if ($data->confirm) {
|
||||
$importid = $data->importid;
|
||||
$importer = new \tool_lpimportcsv\framework_importer(null, null, null, $importid, $data);
|
||||
$importer = new \tool_lpimportcsv\framework_importer(null, null, null, $importid, $data, true);
|
||||
|
||||
$error = $importer->get_error();
|
||||
if ($error) {
|
||||
@@ -61,21 +62,23 @@ if ($form->is_cancelled()) {
|
||||
$form->set_import_error($error);
|
||||
} else {
|
||||
$framework = $importer->import();
|
||||
redirect(new moodle_url('continue.php', array('id' => $framework->get_id())));
|
||||
$urlparams = ['competencyframeworkid' => $framework->get_id(), 'pagecontextid' => $context->id];
|
||||
$frameworksurl = new moodle_url('/admin/tool/lp/competencies.php', $urlparams);
|
||||
echo $OUTPUT->notification(get_string('competencyframeworkcreated', 'tool_lp'), 'notifysuccess');
|
||||
echo $OUTPUT->continue_button($frameworksurl);
|
||||
die();
|
||||
}
|
||||
} else {
|
||||
$text = $form->get_file_content('importfile');
|
||||
$encoding = $data->encoding;
|
||||
$delimiter = $data->delimiter_name;
|
||||
$importer = new \tool_lpimportcsv\framework_importer($text, $encoding, $delimiter);
|
||||
$importer = new \tool_lpimportcsv\framework_importer($text, $encoding, $delimiter, 0, null, true);
|
||||
$confirmform = new \tool_lpimportcsv\form\import_confirm(null, $importer);
|
||||
$form = $confirmform;
|
||||
$pagetitle = get_string('confirmcolumnmappings', 'tool_lpimportcsv');
|
||||
}
|
||||
}
|
||||
|
||||
echo $OUTPUT->header();
|
||||
echo $OUTPUT->heading($pagetitle);
|
||||
|
||||
$form->display();
|
||||
|
||||
@@ -38,11 +38,13 @@ $string['importfile'] = 'CSV framework description file';
|
||||
$string['importfile_help'] = 'A competency framework may be imported via text file. The format of the file can be determined by creating a new competency framework on the site and then exporting it.';
|
||||
$string['importfile_link'] = 'admin/tool/lpimportcsv';
|
||||
$string['import'] = 'Import';
|
||||
$string['importingfile'] = 'Importing file data';
|
||||
$string['invalidimportfile'] = 'File format is invalid.';
|
||||
$string['isframework'] = 'Is framework';
|
||||
$string['noframeworks'] = 'No competency frameworks have been created yet';
|
||||
$string['parentidnumber'] = 'Parent ID number';
|
||||
$string['pluginname'] = 'Import competency framework';
|
||||
$string['processingfile'] = 'Processing file';
|
||||
$string['relatedidnumbers'] = 'Cross-referenced competency ID numbers';
|
||||
$string['ruleconfig'] = 'Rule config (optional)';
|
||||
$string['ruleoutcome'] = 'Rule outcome (optional)';
|
||||
|
||||
@@ -46,4 +46,4 @@ $string['pluginname'] = 'Moodle Mobile tools';
|
||||
$string['smartappbanners'] = 'Smart App Banners (iOS only)';
|
||||
$string['pluginnotenabledorconfigured'] = 'Plugin not enabled or configured.';
|
||||
$string['typeoflogin'] = 'Type of login';
|
||||
$string['typeoflogin_desc'] = 'Choose the type of login.';
|
||||
$string['typeoflogin_desc'] = 'If the site uses a SSO authentication method, then select via a browser window or via an embedded browser. An embedded browser provides a better user experience, though it doesn\'t work with all SSO plugins. If using SSO, autologinguests should be disabled.';
|
||||
|
||||
@@ -53,10 +53,13 @@ class eventobservers {
|
||||
* @param \core\event\course_deleted $event The course deleted event.
|
||||
*/
|
||||
public static function course_deleted(\core\event\course_deleted $event) {
|
||||
// Delete rules defined inside this course and associated subscriptions.
|
||||
$rules = rule_manager::get_rules_by_courseid($event->courseid, 0, 0, false);
|
||||
foreach ($rules as $rule) {
|
||||
rule_manager::delete_rule($rule->id, $event->get_context());
|
||||
}
|
||||
// Delete remaining subscriptions inside this course (from site-wide rules).
|
||||
subscription_manager::remove_all_subscriptions_in_course($event->get_context());
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -176,8 +176,12 @@ class subscription {
|
||||
if (empty($courseid)) {
|
||||
return get_string('site');
|
||||
} else {
|
||||
$course = get_course($courseid);
|
||||
return format_string($course->fullname, true, array('context' => $context));
|
||||
try {
|
||||
$course = get_course($courseid);
|
||||
return format_string($course->fullname, true, array('context' => $context));
|
||||
} catch (\dml_exception $e) {
|
||||
return '-';
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -118,9 +118,10 @@ class subscription_manager {
|
||||
|
||||
// If successful trigger a subscription_deleted event.
|
||||
if ($success) {
|
||||
if (!empty($subscription->courseid)) {
|
||||
if (!empty($subscription->courseid) &&
|
||||
($coursecontext = \context_course::instance($subscription->courseid, IGNORE_MISSING))) {
|
||||
$courseid = $subscription->courseid;
|
||||
$context = \context_course::instance($subscription->courseid);
|
||||
$context = $coursecontext;
|
||||
} else {
|
||||
$courseid = 0;
|
||||
$context = \context_system::instance();
|
||||
@@ -222,6 +223,31 @@ class subscription_manager {
|
||||
return $success;
|
||||
}
|
||||
|
||||
/**
|
||||
* Delete all subscriptions in a course.
|
||||
*
|
||||
* This is called after a course was deleted, context no longer exists but we kept the object
|
||||
*
|
||||
* @param \context_course $coursecontext the context of the course
|
||||
*/
|
||||
public static function remove_all_subscriptions_in_course($coursecontext) {
|
||||
global $DB;
|
||||
|
||||
// Store all the subscriptions we have to delete.
|
||||
if ($subscriptions = $DB->get_records('tool_monitor_subscriptions', ['courseid' => $coursecontext->instanceid])) {
|
||||
// Delete subscriptions in bulk.
|
||||
$DB->delete_records('tool_monitor_subscriptions', ['courseid' => $coursecontext->instanceid]);
|
||||
|
||||
// Trigger events one by one.
|
||||
foreach ($subscriptions as $subscription) {
|
||||
$params = ['objectid' => $subscription->id, 'context' => $coursecontext];
|
||||
$event = \tool_monitor\event\subscription_deleted::create($params);
|
||||
$event->add_record_snapshot('tool_monitor_subscriptions', $subscription);
|
||||
$event->trigger();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Get a subscription instance for an given subscription id.
|
||||
*
|
||||
|
||||
@@ -77,5 +77,25 @@ function xmldb_tool_monitor_upgrade($oldversion) {
|
||||
upgrade_plugin_savepoint(true, 2016052305, 'tool', 'monitor');
|
||||
}
|
||||
|
||||
// Automatically generated Moodle v3.2.0 release upgrade line.
|
||||
// Put any upgrade step following this.
|
||||
|
||||
if ($oldversion < 2016120501) {
|
||||
|
||||
// Delete "orphaned" subscriptions.
|
||||
$sql = "SELECT DISTINCT s.courseid
|
||||
FROM {tool_monitor_subscriptions} s
|
||||
LEFT OUTER JOIN {course} c ON c.id = s.courseid
|
||||
WHERE s.courseid <> 0 and c.id IS NULL";
|
||||
$deletedcourses = $DB->get_field_sql($sql);
|
||||
if ($deletedcourses) {
|
||||
list($sql, $params) = $DB->get_in_or_equal($deletedcourses);
|
||||
$DB->execute("DELETE FROM {tool_monitor_subscriptions} WHERE courseid " . $sql, $params);
|
||||
}
|
||||
|
||||
// Monitor savepoint reached.
|
||||
upgrade_plugin_savepoint(true, 2016120501, 'tool', 'monitor');
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -41,7 +41,7 @@ if (empty($courseid)) {
|
||||
// check system level capability.
|
||||
if (!has_capability('tool/monitor:subscribe', $context)) {
|
||||
// If not system level then check to see if they have access to any course level rules.
|
||||
if (tool_monitor_get_user_courses()){
|
||||
if (tool_monitor_can_subscribe()) {
|
||||
// Make them choose a course.
|
||||
$choose = true;
|
||||
} else {
|
||||
|
||||
@@ -75,12 +75,20 @@ function tool_monitor_extend_navigation_frontpage($navigation, $course, $context
|
||||
* @param context $coursecontext The context of the course
|
||||
*/
|
||||
function tool_monitor_extend_navigation_user_settings($navigation, $user, $usercontext, $course, $coursecontext) {
|
||||
global $USER, $SITE;
|
||||
global $USER, $PAGE;
|
||||
|
||||
// Don't bother doing needless calculations unless we are on the relevant pages.
|
||||
$onpreferencepage = $PAGE->url->compare(new moodle_url('/user/preferences.php'), URL_MATCH_BASE);
|
||||
$onmonitorpage = $PAGE->url->compare(new moodle_url('/admin/tool/monitor/index.php'), URL_MATCH_BASE);
|
||||
if (!$onpreferencepage && !$onmonitorpage) {
|
||||
return null;
|
||||
}
|
||||
|
||||
// Don't show the setting if the event monitor isn't turned on. No access to other peoples subscriptions.
|
||||
if (get_config('tool_monitor', 'enablemonitor') && $USER->id == $user->id) {
|
||||
// Now let's check to see if the user has any courses / site rules that they can subscribe to.
|
||||
if ($courses = tool_monitor_get_user_courses()) {
|
||||
// We skip doing a check here if we are on the event monitor page as the check is done internally on that page.
|
||||
if ($onmonitorpage || tool_monitor_can_subscribe()) {
|
||||
$url = new moodle_url('/admin/tool/monitor/index.php');
|
||||
$subsnode = navigation_node::create(get_string('managesubscriptions', 'tool_monitor'), $url,
|
||||
navigation_node::TYPE_SETTING, null, 'monitor', new pix_icon('i/settings', ''));
|
||||
@@ -92,6 +100,19 @@ function tool_monitor_extend_navigation_user_settings($navigation, $user, $userc
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Check if the user has the capacity to subscribe to an event monitor anywhere.
|
||||
*
|
||||
* @return bool True if a capability in a course is found. False otherwise.
|
||||
*/
|
||||
function tool_monitor_can_subscribe() {
|
||||
if (has_capability('tool/monitor:subscribe', context_system::instance())) {
|
||||
return true;
|
||||
}
|
||||
$courses = get_user_capability_course('tool/monitor:subscribe', null, true, '', '', 1);
|
||||
return empty($courses) ? false : true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get a list of courses and also include 'Site' for site wide rules.
|
||||
*
|
||||
@@ -103,8 +124,11 @@ function tool_monitor_get_user_courses() {
|
||||
if (has_capability('tool/monitor:subscribe', context_system::instance())) {
|
||||
$options[0] = get_string('site');
|
||||
}
|
||||
if ($courses = get_user_capability_course('tool/monitor:subscribe', null, true, 'fullname, visible', $orderby)) {
|
||||
|
||||
$fields = 'fullname, visible, ctxid, ctxpath, ctxdepth, ctxlevel, ctxinstance';
|
||||
if ($courses = get_user_capability_course('tool/monitor:subscribe', null, true, $fields, $orderby)) {
|
||||
foreach ($courses as $course) {
|
||||
context_helper::preload_from_record($course);
|
||||
$coursectx = context_course::instance($course->id);
|
||||
if ($course->visible || has_capability('moodle/course:viewhiddencourses', $coursectx)) {
|
||||
$options[$course->id] = format_string($course->fullname, true, array('context' => $coursectx));
|
||||
|
||||
@@ -103,7 +103,7 @@ Feature: tool_monitor_subscriptions
|
||||
Given I log in as "admin"
|
||||
And I follow "Preferences" in the user menu
|
||||
And I click on "Notification preferences" "link" in the "#page-content" "css_element"
|
||||
And I click on ".preference-state" "css_element" in the "Notifications of rule subscriptions" "table_row"
|
||||
And I click on "//td[@data-processor-name='popup']//label[@class='preference-state']" "xpath_element" in the "Notifications of rule subscriptions" "table_row"
|
||||
And I wait until the page is ready
|
||||
And I follow "Preferences" in the user menu
|
||||
And I follow "Event monitoring"
|
||||
@@ -124,7 +124,7 @@ Feature: tool_monitor_subscriptions
|
||||
Given I log in as "teacher1"
|
||||
And I follow "Preferences" in the user menu
|
||||
And I click on "Notification preferences" "link" in the "#page-content" "css_element"
|
||||
And I click on ".preference-state" "css_element" in the "Notifications of rule subscriptions" "table_row"
|
||||
And I click on "//td[@data-processor-name='popup']//label[@class='preference-state']" "xpath_element" in the "Notifications of rule subscriptions" "table_row"
|
||||
And I wait until the page is ready
|
||||
And I follow "Preferences" in the user menu
|
||||
And I follow "Event monitoring"
|
||||
|
||||
@@ -26,6 +26,6 @@
|
||||
|
||||
defined('MOODLE_INTERNAL') || die;
|
||||
|
||||
$plugin->version = 2016120500; // The current plugin version (Date: YYYYMMDDXX).
|
||||
$plugin->version = 2016120501; // The current plugin version (Date: YYYYMMDDXX).
|
||||
$plugin->requires = 2016112900; // Requires this Moodle version.
|
||||
$plugin->component = 'tool_monitor'; // Full name of the plugin (used for diagnostics).
|
||||
|
||||
@@ -65,6 +65,6 @@ Feature: Backup user data
|
||||
And I log out
|
||||
And I log in as "student1"
|
||||
And I follow "Course 1"
|
||||
When I go to "User report" in the course gradebook
|
||||
When I navigate to "User report" in the course gradebook
|
||||
Then "Quiz 1" row "Grade" column of "user-grade" table should contain "5"
|
||||
And "Quiz 1" row "Percentage" column of "user-grade" table should contain "50"
|
||||
|
||||
@@ -49,9 +49,10 @@ Feature: Basic recycle bin functionality
|
||||
And I should see "Deleting C2"
|
||||
And I should see "C2 has been completely deleted"
|
||||
And I press "Continue"
|
||||
And I go to the courses management page
|
||||
And I should not see "Course 2" in the "#course-listing" "css_element"
|
||||
When I navigate to "Recycle bin" node in "Category: Miscellaneous"
|
||||
And I am on course index
|
||||
And I should see "Course 1"
|
||||
And I should not see "Course 2"
|
||||
When I navigate to "Recycle bin" in current page administration
|
||||
Then I should see "Course 2"
|
||||
And I should see "Contents will be permanently deleted after 14 days"
|
||||
And I click on "Restore" "link" in the "region-main" "region"
|
||||
|
||||
@@ -75,7 +75,7 @@ if (!empty($delall) && confirm_sesskey()) {
|
||||
exit;
|
||||
}
|
||||
|
||||
if (!empty($ignore)) {
|
||||
if (!empty($ignore) && confirm_sesskey()) {
|
||||
unset($SESSION->users_result[$id]);
|
||||
echo json_encode(true);
|
||||
exit;
|
||||
|
||||
@@ -70,7 +70,7 @@ class tool_templatelibrary_external_testcase extends externallib_advanced_testca
|
||||
|
||||
$originaltheme = $CFG->theme;
|
||||
// Change the theme to 'base' because it overrides these templates.
|
||||
$CFG->theme = 'base';
|
||||
$CFG->theme = 'boost';
|
||||
|
||||
$template = external::load_canonical_template('core', 'notification_error');
|
||||
|
||||
|
||||
@@ -358,38 +358,40 @@ if ($formdata = $mform2->is_cancelled()) {
|
||||
|
||||
// add default values for remaining fields
|
||||
$formdefaults = array();
|
||||
foreach ($STD_FIELDS as $field) {
|
||||
if (isset($user->$field)) {
|
||||
continue;
|
||||
}
|
||||
// all validation moved to form2
|
||||
if (isset($formdata->$field)) {
|
||||
// process templates
|
||||
$user->$field = uu_process_template($formdata->$field, $user);
|
||||
$formdefaults[$field] = true;
|
||||
if (in_array($field, $upt->columns)) {
|
||||
$upt->track($field, s($user->$field), 'normal');
|
||||
if ($updatetype != UU_UPDATE_FILEOVERRIDE && $updatetype != UU_UPDATE_NOCHANGES) {
|
||||
foreach ($STD_FIELDS as $field) {
|
||||
if (isset($user->$field)) {
|
||||
continue;
|
||||
}
|
||||
// all validation moved to form2
|
||||
if (isset($formdata->$field)) {
|
||||
// process templates
|
||||
$user->$field = uu_process_template($formdata->$field, $user);
|
||||
$formdefaults[$field] = true;
|
||||
if (in_array($field, $upt->columns)) {
|
||||
$upt->track($field, s($user->$field), 'normal');
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
foreach ($PRF_FIELDS as $field) {
|
||||
if (isset($user->$field)) {
|
||||
continue;
|
||||
}
|
||||
if (isset($formdata->$field)) {
|
||||
// process templates
|
||||
$user->$field = uu_process_template($formdata->$field, $user);
|
||||
|
||||
// Form contains key and later code expects value.
|
||||
// Convert key to value for required profile fields.
|
||||
require_once($CFG->dirroot.'/user/profile/field/'.$proffields[$field]->datatype.'/field.class.php');
|
||||
$profilefieldclass = 'profile_field_'.$proffields[$field]->datatype;
|
||||
$profilefield = new $profilefieldclass($proffields[$field]->id);
|
||||
if (method_exists($profilefield, 'convert_external_data')) {
|
||||
$user->$field = $profilefield->edit_save_data_preprocess($user->$field, null);
|
||||
foreach ($PRF_FIELDS as $field) {
|
||||
if (isset($user->$field)) {
|
||||
continue;
|
||||
}
|
||||
if (isset($formdata->$field)) {
|
||||
// process templates
|
||||
$user->$field = uu_process_template($formdata->$field, $user);
|
||||
|
||||
$formdefaults[$field] = true;
|
||||
// Form contains key and later code expects value.
|
||||
// Convert key to value for required profile fields.
|
||||
require_once($CFG->dirroot.'/user/profile/field/'.$proffields[$field]->datatype.'/field.class.php');
|
||||
$profilefieldclass = 'profile_field_'.$proffields[$field]->datatype;
|
||||
$profilefield = new $profilefieldclass($proffields[$field]->id);
|
||||
if (method_exists($profilefield, 'convert_external_data')) {
|
||||
$user->$field = $profilefield->edit_save_data_preprocess($user->$field, null);
|
||||
}
|
||||
|
||||
$formdefaults[$field] = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -33,6 +33,7 @@ $string['deleteerrors'] = 'Delete errors';
|
||||
$string['encoding'] = 'Encoding';
|
||||
$string['errormnetadd'] = 'Can not add remote users';
|
||||
$string['errors'] = 'Errors';
|
||||
$string['invalidupdatetype'] = 'This option cannot be selected with the chosen upload type.';
|
||||
$string['invaliduserdata'] = 'Invalid data detected for user {$a} and it has been automatically cleaned.';
|
||||
$string['nochanges'] = 'No changes';
|
||||
$string['pluginname'] = 'User upload';
|
||||
|
||||
@@ -29,14 +29,13 @@ Feature: Upload users
|
||||
And I should see "Section 1"
|
||||
And I press "Upload users"
|
||||
And I press "Continue"
|
||||
And I follow "Browse list of users"
|
||||
And I navigate to "Users > Accounts > Browse list of users" in site administration
|
||||
And I should see "Tom Jones"
|
||||
And I should see "Trent Reznor"
|
||||
And I should see "reznor@example.com"
|
||||
And I am on site homepage
|
||||
And I follow "Maths"
|
||||
And I expand "Users" node
|
||||
And I follow "Groups"
|
||||
And I navigate to "Users > Groups" in current page administration
|
||||
And I set the field "groups" to "Section 1 (1)"
|
||||
And the "members" select box should contain "Tom Jones"
|
||||
|
||||
|
||||
@@ -350,6 +350,7 @@ class admin_uploaduser_form2 extends moodleform {
|
||||
$errors = parent::validation($data, $files);
|
||||
$columns = $this->_customdata['columns'];
|
||||
$optype = $data['uutype'];
|
||||
$updatetype = $data['uuupdatetype'];
|
||||
|
||||
// detect if password column needed in file
|
||||
if (!in_array('password', $columns)) {
|
||||
@@ -382,6 +383,12 @@ class admin_uploaduser_form2 extends moodleform {
|
||||
}
|
||||
}
|
||||
|
||||
// If the 'Existing user details' value is set we need to ensure that the
|
||||
// 'Upload type' is not set to something invalid.
|
||||
if (!empty($updatetype) && ($optype == UU_USER_ADDNEW || $optype == UU_USER_ADDINC)) {
|
||||
$errors['uuupdatetype'] = get_string('invalidupdatetype', 'tool_uploaduser');
|
||||
}
|
||||
|
||||
// look for other required data
|
||||
if ($optype != UU_USER_UPDATE) {
|
||||
$requiredusernames = useredit_get_required_name_fields();
|
||||
|
||||
@@ -42,5 +42,8 @@ function xmldb_tool_usertours_upgrade($oldversion) {
|
||||
upgrade_plugin_savepoint(true, 2016120501, 'tool', 'usertours');
|
||||
}
|
||||
|
||||
// Automatically generated Moodle v3.2.0 release upgrade line.
|
||||
// Put any upgrade step following this.
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -146,9 +146,9 @@ $string['tour1_content_navigation'] = 'Major navigation is now through this nav
|
||||
$string['tour1_title_customisation'] = 'Customisation';
|
||||
$string['tour1_content_customisation'] = 'To customise the look of your site and the front page, use the settings menu in the corner of this header. Try turning editing on right now.';
|
||||
$string['tour1_title_blockregion'] = 'Block region';
|
||||
$string['tour1_content_blockregion'] = 'There is still a block region over here. We recommend removing the Navigation and Settings blocks completely, as all the functionality is elsewhere in the Boost theme.';
|
||||
$string['tour1_content_blockregion'] = 'There is still a block region over here. We recommend removing the Navigation and Administration blocks completely, as all the functionality is elsewhere in the Boost theme.';
|
||||
$string['tour1_title_addingblocks'] = 'Adding blocks';
|
||||
$string['tour1_content_addingblocks'] = 'In fact, think carefully about including any blocks on your pages. Blocks are not shown on the Moodle mobile app, so as a general rule it\'s much better to make sure your site works well without any blocks.';
|
||||
$string['tour1_content_addingblocks'] = 'In fact, think carefully about including any blocks on your pages. Blocks are not shown on the Moodle Mobile app, so as a general rule it\'s much better to make sure your site works well without any blocks.';
|
||||
$string['tour1_title_end'] = 'End of tour';
|
||||
$string['tour1_content_end'] = 'This has been a user tour, a new feature in Moodle 3.2. It won\'t show again unless you reset it using the link in the footer. As an admin you can also create your own tours like this!';
|
||||
|
||||
@@ -158,14 +158,14 @@ $string['tour2_content_welcome'] = 'Welcome to the Boost theme for Moodle 3.2. I
|
||||
$string['tour2_title_customisation'] = 'Customisation';
|
||||
$string['tour2_content_customisation'] = 'To change any course settings, use the settings menu in the corner of this header. You will find a similar settings menu on the home page of every activity, too. Try turning editing on right now.';
|
||||
$string['tour2_title_navigation'] = 'Navigation';
|
||||
$string['tour2_content_navigation'] = 'Major navigation is now though this nav drawer. Use the button at the top to hide or show it. You will see that there are links for major sections of your course.';
|
||||
$string['tour2_content_navigation'] = 'Navigation is now through this nav drawer. Use the button at the top to hide or show it. You will see that there are links for sections of your course.';
|
||||
$string['tour2_title_opendrawer'] = 'Open the nav drawer';
|
||||
$string['tour2_content_opendrawer'] = 'Try opening the nav drawer now.';
|
||||
$string['tour2_title_participants'] = 'Course participants';
|
||||
$string['tour2_content_participants'] = 'View participants here. This is also where you go to add or remove students.';
|
||||
$string['tour2_title_addblock'] = 'Add a block';
|
||||
$string['tour2_content_addblock'] = 'If you enable editing mode you can add blocks from the nav drawer. However, think carefully about including any blocks on your pages. Blocks are not shown on Moodle mobile app, so for the best student experience it is much better to make sure your course works well without any blocks.';
|
||||
$string['tour2_content_addblock'] = 'If you turn editing on you can add blocks from the nav drawer. However, think carefully about including any blocks on your pages. Blocks are not shown on the Moodle Mobile app, so for the best user experience it is better to make sure your course works well without any blocks.';
|
||||
$string['tour2_title_addingblocks'] = 'Adding blocks';
|
||||
$string['tour2_content_addingblocks'] = 'You can add blocks to this page using this button. However, think carefully about including any blocks on your pages. Blocks are not shown on Moodle mobile app, so for the best student experience it is much better to make sure your course works well without any blocks.';
|
||||
$string['tour2_content_addingblocks'] = 'You can add blocks to this page using this button. However, think carefully about including any blocks on your pages. Blocks are not shown on the Moodle Mobile app, so for the best user experience it is better to make sure your course works well without any blocks.';
|
||||
$string['tour2_title_end'] = 'End of tour';
|
||||
$string['tour2_content_end'] = 'This has been a user tour, a new feature in Moodle 3.2. It won\'t show again unless you reset it using the link in the footer. The site admin can also create further tours for this site if required.';
|
||||
|
||||
@@ -25,7 +25,7 @@ Feature: Add a new user tour
|
||||
And I add steps to the "First tour" tour:
|
||||
| targettype | targetvalue_selector | Title | Content |
|
||||
| Selector | .usermenu | User menu | This is your personal user menu. You'll find your personal preferences and your user profile here. |
|
||||
When I click on "Dashboard" "link" in the "Navigation" "block"
|
||||
When I am on homepage
|
||||
Then I should see "Welcome to your personal learning space. We'd like to give you a quick tour to show you some of the areas you may find helpful"
|
||||
And I press "Next"
|
||||
And I should see "This area shows you what's happening in some of your courses"
|
||||
@@ -38,7 +38,7 @@ Feature: Add a new user tour
|
||||
And I should see "This area shows you what's happening in some of your courses"
|
||||
And I press "End tour"
|
||||
And I should not see "This area shows you what's happening in some of your courses"
|
||||
And I click on "Dashboard" "link" in the "Navigation" "block"
|
||||
And I am on homepage
|
||||
And I should not see "Welcome to your personal learning space. We'd like to give you a quick tour to show you some of the areas you may find helpful"
|
||||
And I should not see "This area shows you what's happening in some of your courses"
|
||||
And I follow "Reset user tour on this page"
|
||||
@@ -58,7 +58,7 @@ Feature: Add a new user tour
|
||||
And I add steps to the "First tour" tour:
|
||||
| targettype | Title | Content |
|
||||
| Display in middle of page | Welcome | Welcome to your personal learning space. We'd like to give you a quick tour to show you some of the areas you may find helpful |
|
||||
When I click on "Dashboard" "link" in the "Navigation" "block"
|
||||
When I am on homepage
|
||||
Then I should not see "Welcome to your personal learning space. We'd like to give you a quick tour to show you some of the areas you may find helpful"
|
||||
|
||||
@javascript
|
||||
@@ -77,5 +77,5 @@ Feature: Add a new user tour
|
||||
| Display in middle of page | Welcome | Welcome to your personal learning space. We'd like to give you a quick tour to show you some of the areas you may find helpful |
|
||||
And I open the User tour settings page
|
||||
When I click on "Enable" "link" in the "My first tour" "table_row"
|
||||
And I click on "Dashboard" "link" in the "Navigation" "block"
|
||||
And I am on homepage
|
||||
Then I should see "Welcome to your personal learning space. We'd like to give you a quick tour to show you some of the areas you may find helpful"
|
||||
|
||||
@@ -16,7 +16,7 @@ Feature: Apply tour filters to a tour
|
||||
And I add steps to the "First tour" tour:
|
||||
| targettype | Title | Content |
|
||||
| Display in middle of page | Welcome | Welcome to your personal learning space. We'd like to give you a quick tour to show you some of the areas you may find helpful |
|
||||
When I click on "Dashboard" "link" in the "Navigation" "block"
|
||||
When I am on homepage
|
||||
Then I should not see "Welcome to your personal learning space. We'd like to give you a quick tour to show you some of the areas you may find helpful"
|
||||
|
||||
@javascript
|
||||
|
||||
@@ -118,7 +118,7 @@ class tool_usertours_manager_testcase extends advanced_testcase {
|
||||
$rcm = $rc->getMethod($function);
|
||||
$rcm->setAccessible(true);
|
||||
|
||||
$this->setExpectedException('moodle_exception', 'A required parameter (sesskey) was missing');
|
||||
$this->expectException('moodle_exception');
|
||||
$rcm->invokeArgs($manager, $arguments);
|
||||
}
|
||||
|
||||
|
||||
+24
-2
@@ -99,9 +99,31 @@ if (!isset($config->removeuser)) {
|
||||
$yesno = array( get_string('no'), get_string('yes') );
|
||||
|
||||
$disabled = '';
|
||||
if (!ldap_paged_results_supported($config->ldap_version)) {
|
||||
$pagedresultssupported = false;
|
||||
if ($config->host_url !== '') {
|
||||
/**
|
||||
* We try to connect each and every time we open the config, because we want to set the Page
|
||||
* Size setting as enabled or disabled depending on the configured LDAP server supporting
|
||||
* pagination or not, and to notify the user about it. If the user changed the LDAP server (or
|
||||
* the LDAP protocol version) last time, it might happen that paged results are no longer
|
||||
* available and we want to show that to the user the next time she goes to the settings page.
|
||||
*/
|
||||
try {
|
||||
$ldapconn = $this->ldap_connect();
|
||||
$pagedresultssupported = ldap_paged_results_supported($config->ldap_version, $ldapconn);
|
||||
} catch (Exception $e) {
|
||||
// If we couldn't connect and get the supported options, we can only assume we don't support paged results.
|
||||
$pagedresultssupported = false;
|
||||
}
|
||||
}
|
||||
/* Make sure we only disable the paged result size setting and show the notification about it if
|
||||
* there is a configured server that we tried to contact. Othersiwe, if someone's LDAP server does
|
||||
* support paged results, they won't be able to turn it on the first time they set it up (because
|
||||
* the field will be disabled).
|
||||
*/
|
||||
if (($config->host_url !== '') && (!$pagedresultssupported)) {
|
||||
$disabled = ' disabled="disabled"';
|
||||
echo $OUTPUT->notification(get_string('pagedresultsnotsupp', 'auth_ldap'));
|
||||
echo $OUTPUT->notification(get_string('pagedresultsnotsupp', 'auth_ldap'), \core\output\notification::NOTIFY_INFO);
|
||||
}
|
||||
|
||||
?>
|
||||
|
||||
@@ -55,5 +55,8 @@ function xmldb_auth_cas_upgrade($oldversion) {
|
||||
// Moodle v3.1.0 release upgrade line.
|
||||
// Put any upgrade step following this.
|
||||
|
||||
// Automatically generated Moodle v3.2.0 release upgrade line.
|
||||
// Put any upgrade step following this.
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -151,6 +151,7 @@ class login implements renderable, templatable {
|
||||
$data->rememberusername = $this->rememberusername;
|
||||
$data->passwordautocomplete = $this->passwordautocomplete;
|
||||
$data->signupurl = $this->signupurl->out(false);
|
||||
$data->username = $this->username;
|
||||
|
||||
return $data;
|
||||
}
|
||||
|
||||
@@ -31,6 +31,9 @@ class auth_db_testcase extends advanced_testcase {
|
||||
/** @var string Original error log */
|
||||
protected $oldlog;
|
||||
|
||||
/** @var int The amount of users to create for the large user set deletion test */
|
||||
protected $largedeletionsetsize = 128;
|
||||
|
||||
protected function init_auth_database() {
|
||||
global $DB, $CFG;
|
||||
require_once("$CFG->dirroot/auth/db/auth.php");
|
||||
@@ -444,4 +447,56 @@ class auth_db_testcase extends advanced_testcase {
|
||||
|
||||
$this->cleanup_auth_database();
|
||||
}
|
||||
|
||||
/**
|
||||
* Testing the deletion of a user when there are many users in the external DB.
|
||||
*/
|
||||
public function test_deleting_with_many_users() {
|
||||
global $DB;
|
||||
|
||||
$this->resetAfterTest(true);
|
||||
$this->preventResetByRollback();
|
||||
$this->init_auth_database();
|
||||
$auth = get_auth_plugin('db');
|
||||
$auth->db_init();
|
||||
|
||||
// Set to delete from moodle when missing from DB.
|
||||
set_config('removeuser', AUTH_REMOVEUSER_FULLDELETE, 'auth/db');
|
||||
$auth->config->removeuser = AUTH_REMOVEUSER_FULLDELETE;
|
||||
|
||||
// Create users.
|
||||
$users = [];
|
||||
for ($i = 0; $i < $this->largedeletionsetsize; $i++) {
|
||||
$user = (object)array('username' => "u$i", 'name' => "u$i", 'pass' => 'heslo', 'email' => "u$i@example.com");
|
||||
$user->id = $DB->insert_record('auth_db_users', $user);
|
||||
$users[] = $user;
|
||||
}
|
||||
|
||||
// Sync to moodle.
|
||||
$trace = new null_progress_trace();
|
||||
$auth->sync_users($trace, true);
|
||||
|
||||
// Check user is there.
|
||||
$user = array_shift($users);
|
||||
$moodleuser = $DB->get_record('user', array('email' => $user->email, 'auth' => 'db'));
|
||||
$this->assertNotNull($moodleuser);
|
||||
$this->assertEquals($user->username, $moodleuser->username);
|
||||
|
||||
// Delete a user.
|
||||
$DB->delete_records('auth_db_users', array('id' => $user->id));
|
||||
|
||||
// Sync again.
|
||||
$auth->sync_users($trace, true);
|
||||
|
||||
// Check user is no longer there.
|
||||
$moodleuser = $DB->get_record('user', array('id' => $moodleuser->id));
|
||||
$this->assertFalse($auth->user_login($user->username, 'heslo'));
|
||||
$this->assertEquals(1, $moodleuser->deleted);
|
||||
|
||||
// Make sure it was the only user deleted.
|
||||
$numberdeleted = $DB->count_records('user', array('deleted' => 1, 'auth' => 'db'));
|
||||
$this->assertEquals(1, $numberdeleted);
|
||||
|
||||
$this->cleanup_auth_database();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -286,6 +286,10 @@ class auth_email_external extends external_api {
|
||||
// Validate the data sent.
|
||||
$data = $params;
|
||||
$data['email2'] = $data['email'];
|
||||
// Force policy agreed if a site policy is set. The client is responsible of implementing the interface check.
|
||||
if (!empty($CFG->sitepolicy)) {
|
||||
$data['policyagreed'] = 1;
|
||||
}
|
||||
unset($data['recaptcharesponse']);
|
||||
unset($data['customprofilefields']);
|
||||
// Add profile fields data.
|
||||
|
||||
+2
-2
@@ -695,7 +695,7 @@ class auth_plugin_ldap extends auth_plugin_base {
|
||||
array_push($contexts, $this->config->create_context);
|
||||
}
|
||||
|
||||
$ldap_pagedresults = ldap_paged_results_supported($this->config->ldap_version);
|
||||
$ldap_pagedresults = ldap_paged_results_supported($this->config->ldap_version, $ldapconnection);
|
||||
$ldap_cookie = '';
|
||||
foreach ($contexts as $context) {
|
||||
$context = trim($context);
|
||||
@@ -1540,7 +1540,7 @@ class auth_plugin_ldap extends auth_plugin_base {
|
||||
}
|
||||
|
||||
$ldap_cookie = '';
|
||||
$ldap_pagedresults = ldap_paged_results_supported($this->config->ldap_version);
|
||||
$ldap_pagedresults = ldap_paged_results_supported($this->config->ldap_version, $ldapconnection);
|
||||
foreach ($contexts as $context) {
|
||||
$context = trim($context);
|
||||
if (empty($context)) {
|
||||
|
||||
+24
-2
@@ -117,9 +117,31 @@ $fastpathoptions = array(AUTH_NTLM_FASTPATH_YESFORM => get_string('auth_ntlmsso_
|
||||
AUTH_NTLM_FASTPATH_ATTEMPT => get_string('auth_ntlmsso_ie_fastpath_attempt', 'auth_ldap'));
|
||||
|
||||
$disabled = '';
|
||||
if (!ldap_paged_results_supported($config->ldap_version)) {
|
||||
$pagedresultssupported = false;
|
||||
if ($config->host_url !== '') {
|
||||
/**
|
||||
* We try to connect each and every time we open the config, because we want to set the Page
|
||||
* Size setting as enabled or disabled depending on the configured LDAP server supporting
|
||||
* pagination or not, and to notify the user about it. If the user changed the LDAP server (or
|
||||
* the LDAP protocol version) last time, it might happen that paged results are no longer
|
||||
* available and we want to show that to the user the next time she goes to the settings page.
|
||||
*/
|
||||
try {
|
||||
$ldapconn = $this->ldap_connect();
|
||||
$pagedresultssupported = ldap_paged_results_supported($config->ldap_version, $ldapconn);
|
||||
} catch (Exception $e) {
|
||||
// If we couldn't connect and get the supported options, we can only assume we don't support paged results.
|
||||
$pagedresultssupported = false;
|
||||
}
|
||||
}
|
||||
/* Make sure we only disable the paged result size setting and show the notification about it if
|
||||
* there is a configured server that we tried to contact. Othersiwe, if someone's LDAP server does
|
||||
* support paged results, they won't be able to turn it on the first time they set it up (because
|
||||
* the field will be disabled).
|
||||
*/
|
||||
if (($config->host_url !== '') && (!$pagedresultssupported)) {
|
||||
$disabled = ' disabled="disabled"';
|
||||
echo $OUTPUT->notification(get_string('pagedresultsnotsupp', 'auth_ldap'));
|
||||
echo $OUTPUT->notification(get_string('pagedresultsnotsupp', 'auth_ldap'), \core\output\notification::NOTIFY_INFO);
|
||||
}
|
||||
|
||||
?>
|
||||
|
||||
@@ -55,5 +55,8 @@ function xmldb_auth_ldap_upgrade($oldversion) {
|
||||
// Moodle v3.1.0 release upgrade line.
|
||||
// Put any upgrade step following this.
|
||||
|
||||
// Automatically generated Moodle v3.2.0 release upgrade line.
|
||||
// Put any upgrade step following this.
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -132,7 +132,7 @@ $string['ntlmsso_attempting'] = 'Attempting Single Sign On via NTLM...';
|
||||
$string['ntlmsso_failed'] = 'Auto-login failed, try the normal login page...';
|
||||
$string['ntlmsso_isdisabled'] = 'NTLM SSO is disabled.';
|
||||
$string['ntlmsso_unknowntype'] = 'Unknown ntlmsso type!';
|
||||
$string['pagedresultsnotsupp'] = 'LDAP paged results not supported (either your PHP version lacks support or you have configured Moodle to use LDAP protocol version 2)';
|
||||
$string['pagedresultsnotsupp'] = 'LDAP paged results not supported (either your PHP version lacks support, you have configured Moodle to use LDAP protocol version 2 or Moodle cannot contact your LDAP server to see if paged support is available.)';
|
||||
$string['pagesize'] = 'Make sure this value is smaller than your LDAP server result set size limit (the maximum number of entries that can be returned in a single query)';
|
||||
$string['pagesize_key'] = 'Page size';
|
||||
$string['pluginname'] = 'LDAP server';
|
||||
|
||||
@@ -43,5 +43,8 @@ function xmldb_auth_manual_upgrade($oldversion) {
|
||||
// Moodle v3.1.0 release upgrade line.
|
||||
// Put any upgrade step following this.
|
||||
|
||||
// Automatically generated Moodle v3.2.0 release upgrade line.
|
||||
// Put any upgrade step following this.
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -43,5 +43,8 @@ function xmldb_auth_mnet_upgrade($oldversion) {
|
||||
// Moodle v3.1.0 release upgrade line.
|
||||
// Put any upgrade step following this.
|
||||
|
||||
// Automatically generated Moodle v3.2.0 release upgrade line.
|
||||
// Put any upgrade step following this.
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -0,0 +1,55 @@
|
||||
@core @core_auth
|
||||
Feature: Test the 'showlogfailures' feature works.
|
||||
In order to see my recent login failures when logging in
|
||||
As a user
|
||||
I need to have at least one failed login attempt and then log in
|
||||
|
||||
Background:
|
||||
Given the following "users" exist:
|
||||
| username |
|
||||
| teacher1 |
|
||||
And the following config values are set as admin:
|
||||
| displayloginfailures | 1 |
|
||||
|
||||
# Given the user has at least one failed login attempt, when they login, then they should see both header and footer notices.
|
||||
Scenario: Check that 'displayloginfailures' works without javascript for teachers.
|
||||
# Simulate a log in failure for the teacher.
|
||||
Given I am on homepage
|
||||
And I click on "Log in" "link" in the ".logininfo" "css_element"
|
||||
And I set the field "Username" to "teacher1"
|
||||
And I set the field "Password" to "wrongpass"
|
||||
And I press "Log in"
|
||||
And I should see "Invalid login, please try again"
|
||||
# Now, log in with the correct credentials.
|
||||
When I set the field "Username" to "teacher1"
|
||||
And I set the field "Password" to "teacher1"
|
||||
And I press "Log in"
|
||||
# Confirm the notices are displayed.
|
||||
Then I should see "1 failed logins since your last login" in the "header.navbar" "css_element"
|
||||
And I should see "1 failed logins since your last login" in the "page-footer" "region"
|
||||
# Confirm the notices disappear when navigating to another page.
|
||||
And I am on homepage
|
||||
And I should not see "1 failed logins since your last login" in the "header.navbar" "css_element"
|
||||
And I should not see "1 failed logins since your last login" in the "page-footer" "region"
|
||||
|
||||
# Given the user has at least one failed login attempt, when they login, then they should see both header and footer notices.
|
||||
Scenario: Check that 'displayloginfailures' works without javascript for admins.
|
||||
# Simulate a log in failure for the teacher.
|
||||
Given I am on homepage
|
||||
And I click on "Log in" "link" in the ".logininfo" "css_element"
|
||||
And I set the field "Username" to "admin"
|
||||
And I set the field "Password" to "wrongpass"
|
||||
And I press "Log in"
|
||||
And I should see "Invalid login, please try again"
|
||||
# Now, log in with the correct credentials.
|
||||
When I set the field "Username" to "admin"
|
||||
And I set the field "Password" to "admin"
|
||||
And I press "Log in"
|
||||
# Confirm the notices are displayed.
|
||||
Then I should see "1 failed logins since your last login" in the "header.navbar" "css_element"
|
||||
And I should see "1 failed logins since your last login (Logs)" in the "page-footer" "region"
|
||||
# Confirm that the link works and that the notices disappear when navigating to another page.
|
||||
And I click on "Logs" "link" in the "page-footer" "region"
|
||||
And I should see "User login failed" in the "table.reportlog" "css_element"
|
||||
And I should not see "1 failed logins since your last login" in the "header.navbar" "css_element"
|
||||
And I should not see "1 failed logins since your last login (Logs)" in the "page-footer" "region"
|
||||
@@ -0,0 +1,50 @@
|
||||
@core @core_auth
|
||||
Feature: Test the 'remember username' feature works.
|
||||
In order to see my saved username on the login form
|
||||
As a user
|
||||
I need to have logged in once before and clicked 'Remember username'
|
||||
|
||||
Background:
|
||||
Given the following "users" exist:
|
||||
| username |
|
||||
| teacher1 |
|
||||
|
||||
# Given the user has logged in and selected 'Remember username', when they log in again, then their username should be remembered.
|
||||
Scenario: Check that 'remember username' works without javascript for teachers.
|
||||
# Log in the first time and check the 'remember username' box.
|
||||
Given I am on homepage
|
||||
And I click on "Log in" "link" in the ".logininfo" "css_element"
|
||||
And I set the field "Username" to "teacher1"
|
||||
And I set the field "Password" to "teacher1"
|
||||
And I set the field "Remember username" to "1"
|
||||
And I press "Log in"
|
||||
And I log out
|
||||
# Log out and check that the username was remembered.
|
||||
When I am on homepage
|
||||
And I click on "Log in" "link" in the ".logininfo" "css_element"
|
||||
Then the field "username" matches value "teacher1"
|
||||
And the field "Remember username" matches value "1"
|
||||
|
||||
# Given the user has logged in before and selected 'Remember username', when they log in again and unset 'Remember username', then
|
||||
# their username should be forgotten for future log in attempts.
|
||||
Scenario: Check that 'remember username' unsetting works without javascript for teachers.
|
||||
# Log in the first time and check the 'remember username' box.
|
||||
Given I am on homepage
|
||||
And I click on "Log in" "link" in the ".logininfo" "css_element"
|
||||
And I set the field "Username" to "teacher1"
|
||||
And I set the field "Password" to "teacher1"
|
||||
And I set the field "Remember username" to "1"
|
||||
And I press "Log in"
|
||||
And I log out
|
||||
# Log in again, unsetting the 'remember username' field.
|
||||
When I am on homepage
|
||||
And I click on "Log in" "link" in the ".logininfo" "css_element"
|
||||
And I set the field "Password" to "teacher1"
|
||||
And I set the field "Remember username" to "0"
|
||||
And I press "Log in"
|
||||
And I log out
|
||||
# Check username has been forgotten.
|
||||
Then I am on homepage
|
||||
And I click on "Log in" "link" in the ".logininfo" "css_element"
|
||||
Then the field "username" matches value ""
|
||||
And the field "Remember username" matches value "0"
|
||||
@@ -1,3 +0,0 @@
|
||||
#fitem_id_availabilityconditionsjson .availability_grade input[type=text] {
|
||||
width: 3em;
|
||||
}
|
||||
@@ -115,7 +115,7 @@ Feature: availability_grade
|
||||
|
||||
# Give the assignment 40%.
|
||||
And I follow "A1"
|
||||
And I click on "View all submissions" "link" in the "Administration" "block"
|
||||
And I navigate to "View all submissions" in current page administration
|
||||
# Pick the grade link in the row that has s@example.com in it.
|
||||
And I click on "Grade" "link" in the "s@example.com" "table_row"
|
||||
And I set the field "Grade out of 100" to "40"
|
||||
|
||||
@@ -101,7 +101,7 @@ Feature: availability_profile
|
||||
|
||||
# Edit it again and check the setting still works.
|
||||
When I follow "P1"
|
||||
And I navigate to "Edit settings" node in "Page module administration"
|
||||
And I navigate to "Edit settings" in current page administration
|
||||
And I expand all fieldsets
|
||||
Then the field "User profile field" matches value "Super field"
|
||||
And the field "Value to compare against" matches value "Bananaman"
|
||||
|
||||
@@ -216,7 +216,7 @@ Feature: edit_availability
|
||||
|
||||
# Check the button still works after saving and editing.
|
||||
And I press "Save and display"
|
||||
And I navigate to "Edit settings" node in "Forum administration"
|
||||
And I navigate to "Edit settings" in current page administration
|
||||
And I expand all fieldsets
|
||||
And the "Add group/grouping access restriction" "button" should be disabled
|
||||
And I should see "Grouping" in the "Restrict access" "fieldset"
|
||||
|
||||
@@ -2,6 +2,11 @@ This files describes API changes in /availability/*.
|
||||
|
||||
The information here is intended only for developers.
|
||||
|
||||
=== 3.2 ===
|
||||
|
||||
* Condition plugins must replace the CSS selector "#fitem_id_availabilityconditionsjson" with ".availability-field".
|
||||
This selector is often used in your plugin's yui/src/form/js/form.js file.
|
||||
|
||||
=== 2.9 ===
|
||||
|
||||
* Condition plugins can now implement a new include_after_restore function to
|
||||
|
||||
@@ -2670,7 +2670,7 @@ class restore_calendarevents_structure_step extends restore_structure_step {
|
||||
'courseid' => $this->get_courseid(),
|
||||
'groupid' => $data->groupid,
|
||||
'userid' => $data->userid,
|
||||
'repeatid' => $data->repeatid,
|
||||
'repeatid' => $this->get_mappingid('event', $data->repeatid),
|
||||
'modulename' => $data->modulename,
|
||||
'eventtype' => $data->eventtype,
|
||||
'timestart' => $this->apply_date_offset($data->timestart),
|
||||
@@ -2688,18 +2688,27 @@ class restore_calendarevents_structure_step extends restore_structure_step {
|
||||
FROM {event}
|
||||
WHERE " . $DB->sql_compare_text('name', 255) . " = " . $DB->sql_compare_text('?', 255) . "
|
||||
AND courseid = ?
|
||||
AND repeatid = ?
|
||||
AND modulename = ?
|
||||
AND timestart = ?
|
||||
AND timeduration = ?
|
||||
AND " . $DB->sql_compare_text('description', 255) . " = " . $DB->sql_compare_text('?', 255);
|
||||
$arg = array ($params['name'], $params['courseid'], $params['repeatid'], $params['modulename'], $params['timestart'], $params['timeduration'], $params['description']);
|
||||
$arg = array ($params['name'], $params['courseid'], $params['modulename'], $params['timestart'], $params['timeduration'], $params['description']);
|
||||
$result = $DB->record_exists_sql($sql, $arg);
|
||||
if (empty($result)) {
|
||||
$newitemid = $DB->insert_record('event', $params);
|
||||
$this->set_mapping('event', $oldid, $newitemid);
|
||||
$this->set_mapping('event_description', $oldid, $newitemid, $restorefiles);
|
||||
}
|
||||
// With repeating events, each event has the repeatid pointed at the first occurrence.
|
||||
// Since the repeatid will be empty when the first occurrence is restored,
|
||||
// Get the repeatid from the second occurrence of the repeating event and use that to update the first occurrence.
|
||||
// Then keep a list of repeatids so we only perform this update once.
|
||||
static $repeatids = array();
|
||||
if (!empty($params['repeatid']) && !in_array($params['repeatid'], $repeatids)) {
|
||||
// This entry is repeated so the repeatid field must be set.
|
||||
$DB->set_field('event', 'repeatid', $params['repeatid'], array('id' => $params['repeatid']));
|
||||
$repeatids[] = $params['repeatid'];
|
||||
}
|
||||
|
||||
}
|
||||
protected function after_execute() {
|
||||
|
||||
@@ -519,7 +519,7 @@ class core_backup_renderer extends plugin_renderer_base {
|
||||
$method = 'get';
|
||||
}
|
||||
$url->param('sesskey', sesskey());
|
||||
$button = new single_button($url, get_string('continue'), $method);
|
||||
$button = new single_button($url, get_string('continue'), $method, true);
|
||||
$button->class = 'continuebutton';
|
||||
return $this->render($button);
|
||||
}
|
||||
|
||||
@@ -43,19 +43,6 @@ use Behat\Gherkin\Node\TableNode as TableNode,
|
||||
*/
|
||||
class behat_backup extends behat_base {
|
||||
|
||||
/**
|
||||
* Follow a link like 'Backup' or 'Import', where the link name comes from
|
||||
* a language string, in the settings nav block of a course.
|
||||
* @param string $langstring the lang string to look for. E.g. 'backup' or 'import'.
|
||||
* @param string $component (optional) second argument to {@link get_string}.
|
||||
*/
|
||||
protected function navigate_to_course_settings_link($langstring, $component = '') {
|
||||
$behatnavigation = new behat_navigation();
|
||||
$behatnavigation->setMink($this->getMink());
|
||||
$behatnavigation->i_navigate_to_node_in(get_string($langstring, $component),
|
||||
get_string('courseadministration'));
|
||||
}
|
||||
|
||||
/**
|
||||
* Backups the specified course using the provided options. If you are interested in restoring this backup would be
|
||||
* useful to provide a 'Filename' option.
|
||||
@@ -70,33 +57,31 @@ class behat_backup extends behat_base {
|
||||
|
||||
// Go to homepage.
|
||||
$this->getSession()->visit($this->locate_path('/?redirect=0'));
|
||||
$this->execute("behat_general::wait_until_the_page_is_ready");
|
||||
|
||||
// Click the course link.
|
||||
$this->find_link($backupcourse)->click();
|
||||
$this->execute("behat_general::click_link", $backupcourse);
|
||||
|
||||
// Click the backup link.
|
||||
$this->navigate_to_course_settings_link('backup');
|
||||
$this->wait();
|
||||
$this->execute("behat_navigation::i_navigate_to_in_current_page_administration", get_string('backup'));
|
||||
|
||||
// Initial settings.
|
||||
$this->fill_backup_restore_form($this->get_step_options($options, "Initial"));
|
||||
$this->find_button(get_string('backupstage1action', 'backup'))->press();
|
||||
$this->wait();
|
||||
$this->execute("behat_forms::press_button", get_string('backupstage1action', 'backup'));
|
||||
|
||||
// Schema settings.
|
||||
$this->fill_backup_restore_form($this->get_step_options($options, "Schema"));
|
||||
$this->find_button(get_string('backupstage2action', 'backup'))->press();
|
||||
$this->wait();
|
||||
$this->execute("behat_forms::press_button", get_string('backupstage2action', 'backup'));
|
||||
|
||||
// Confirmation and review, backup filename can also be specified.
|
||||
$this->fill_backup_restore_form($this->get_step_options($options, "Confirmation"));
|
||||
$this->find_button(get_string('backupstage4action', 'backup'))->press();
|
||||
$this->execute("behat_forms::press_button", get_string('backupstage4action', 'backup'));
|
||||
|
||||
// Waiting for it to finish.
|
||||
$this->wait(self::EXTENDED_TIMEOUT);
|
||||
$this->execute("behat_general::wait_until_the_page_is_ready");
|
||||
|
||||
// Last backup continue button.
|
||||
$this->find_button(get_string('backupstage16action', 'backup'))->press();
|
||||
$this->execute("behat_general::i_click_on", array(get_string('backupstage16action', 'backup'), 'button'));
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -116,21 +101,19 @@ class behat_backup extends behat_base {
|
||||
$this->getSession()->visit($this->locate_path('/?redirect=0'));
|
||||
|
||||
// Click the course link.
|
||||
$this->find_link($backupcourse)->click();
|
||||
$this->execute("behat_general::click_link", $backupcourse);
|
||||
|
||||
// Click the backup link.
|
||||
$this->find_link(get_string('backup'))->click();
|
||||
$this->wait();
|
||||
$this->execute("behat_navigation::i_navigate_to_in_current_page_administration", get_string('backup'));
|
||||
|
||||
// Initial settings.
|
||||
$this->find_button(get_string('jumptofinalstep', 'backup'))->press();
|
||||
$this->wait();
|
||||
$this->execute("behat_forms::press_button", get_string('jumptofinalstep', 'backup'));
|
||||
|
||||
// Waiting for it to finish.
|
||||
$this->wait(self::EXTENDED_TIMEOUT);
|
||||
$this->execute("behat_general::wait_until_the_page_is_ready");
|
||||
|
||||
// Last backup continue button.
|
||||
$this->find_button(get_string('backupstage16action', 'backup'))->press();
|
||||
$this->execute("behat_general::i_click_on", array(get_string('backupstage16action', 'backup'), 'button'));
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -152,15 +135,13 @@ class behat_backup extends behat_base {
|
||||
|
||||
// Go to homepage.
|
||||
$this->getSession()->visit($this->locate_path('/?redirect=0'));
|
||||
$this->wait();
|
||||
$this->execute("behat_general::wait_until_the_page_is_ready");
|
||||
|
||||
// Click the course link.
|
||||
$this->find_link($tocourse)->click();
|
||||
$this->wait();
|
||||
$this->execute("behat_general::click_link", $tocourse);
|
||||
|
||||
// Click the import link.
|
||||
$this->navigate_to_course_settings_link('import');
|
||||
$this->wait();
|
||||
$this->execute("behat_navigation::i_navigate_to_in_current_page_administration", get_string('import'));
|
||||
|
||||
// Select the course.
|
||||
$exception = new ExpectationException('"' . $fromcourse . '" course not found in the list of courses to import from',
|
||||
@@ -175,25 +156,24 @@ class behat_backup extends behat_base {
|
||||
$radiofield = new behat_form_field($this->getSession(), $radionode);
|
||||
$radiofield->set_value(1);
|
||||
|
||||
$this->find_button(get_string('continue'))->press();
|
||||
$this->wait();
|
||||
$this->execute("behat_forms::press_button", get_string('continue'));
|
||||
|
||||
// Initial settings.
|
||||
$this->fill_backup_restore_form($this->get_step_options($options, "Initial"));
|
||||
$this->find_button(get_string('importbackupstage1action', 'backup'))->press();
|
||||
$this->wait();
|
||||
$this->execute("behat_forms::press_button", get_string('importbackupstage1action', 'backup'));
|
||||
|
||||
// Schema settings.
|
||||
$this->fill_backup_restore_form($this->get_step_options($options, "Schema"));
|
||||
$this->find_button(get_string('importbackupstage2action', 'backup'))->press();
|
||||
$this->wait();
|
||||
$this->execute("behat_forms::press_button", get_string('importbackupstage2action', 'backup'));
|
||||
|
||||
// Run it.
|
||||
$this->find_button(get_string('importbackupstage4action', 'backup'))->press();
|
||||
$this->wait(self::EXTENDED_TIMEOUT);
|
||||
$this->execute("behat_forms::press_button", get_string('importbackupstage4action', 'backup'));
|
||||
|
||||
// Wait to ensure restore is complete.
|
||||
$this->execute("behat_general::wait_until_the_page_is_ready");
|
||||
|
||||
// Continue and redirect to 'to' course.
|
||||
$this->find_button(get_string('continue'))->press();
|
||||
$this->execute("behat_general::i_click_on", array(get_string('continue'), 'button'));
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -215,17 +195,16 @@ class behat_backup extends behat_base {
|
||||
$existingcourse = behat_context_helper::escape($existingcourse);
|
||||
|
||||
// Selecting the specified course (we can not call behat_forms::select_radio here as is in another behat subcontext).
|
||||
$radionode = $this->find('xpath', "//div[contains(concat(' ', normalize-space(@class), ' '), ' bcs-existing-course ')]" .
|
||||
$radionodexpath = "//div[contains(concat(' ', normalize-space(@class), ' '), ' bcs-existing-course ')]" .
|
||||
"/descendant::div[contains(concat(' ', normalize-space(@class), ' '), ' restore-course-search ')]" .
|
||||
"/descendant::tr[contains(., $existingcourse)]" .
|
||||
"/descendant::input[@type='radio']");
|
||||
$radionode->click();
|
||||
"/descendant::input[@type='radio']";
|
||||
$this->execute("behat_general::i_click_on", array($radionodexpath, 'xpath_element'));
|
||||
|
||||
// Pressing the continue button of the restore into an existing course section.
|
||||
$continuenode = $this->find('xpath', "//div[contains(concat(' ', normalize-space(@class), ' '), ' bcs-existing-course ')]" .
|
||||
"/descendant::input[@type='submit'][@value='" . get_string('continue') . "']");
|
||||
$continuenode->click();
|
||||
$this->wait();
|
||||
$continuenodexpath = "//div[contains(concat(' ', normalize-space(@class), ' '), ' bcs-existing-course ')]" .
|
||||
"/descendant::input[@type='submit'][@value='" . get_string('continue') . "']";
|
||||
$this->execute("behat_general::i_click_on", array($continuenodexpath, 'xpath_element'));
|
||||
|
||||
// Common restore process using provided key/value options.
|
||||
$this->process_restore($options);
|
||||
@@ -246,16 +225,15 @@ class behat_backup extends behat_base {
|
||||
$this->select_backup($backupfilename);
|
||||
|
||||
// The first category in the list.
|
||||
$radionode = $this->find('xpath', "//div[contains(concat(' ', normalize-space(@class), ' '), ' bcs-new-course ')]" .
|
||||
$radionodexpath = "//div[contains(concat(' ', normalize-space(@class), ' '), ' bcs-new-course ')]" .
|
||||
"/descendant::div[contains(concat(' ', normalize-space(@class), ' '), ' restore-course-search ')]" .
|
||||
"/descendant::input[@type='radio']");
|
||||
$radionode->click();
|
||||
"/descendant::input[@type='radio']";
|
||||
$this->execute("behat_general::i_click_on", array($radionodexpath, 'xpath_element'));
|
||||
|
||||
// Pressing the continue button of the restore into an existing course section.
|
||||
$continuenode = $this->find('xpath', "//div[contains(concat(' ', normalize-space(@class), ' '), ' bcs-new-course ')]" .
|
||||
"/descendant::input[@type='submit'][@value='" . get_string('continue') . "']");
|
||||
$continuenode->click();
|
||||
$this->wait();
|
||||
$continuenodexpath = "//div[contains(concat(' ', normalize-space(@class), ' '), ' bcs-new-course ')]" .
|
||||
"/descendant::input[@type='submit'][@value='" . get_string('continue') . "']";
|
||||
$this->execute("behat_general::i_click_on", array($continuenodexpath, 'xpath_element'));
|
||||
|
||||
// Common restore process using provided key/value options.
|
||||
$this->process_restore($options);
|
||||
@@ -276,15 +254,14 @@ class behat_backup extends behat_base {
|
||||
$this->select_backup($backupfilename);
|
||||
|
||||
// Merge without deleting radio option.
|
||||
$radionode = $this->find('xpath', "//div[contains(concat(' ', normalize-space(@class), ' '), 'bcs-current-course')]" .
|
||||
"/descendant::input[@type='radio'][@name='target'][@value='1']");
|
||||
$radionode->click();
|
||||
$radionodexpath = "//div[contains(concat(' ', normalize-space(@class), ' '), 'bcs-current-course')]" .
|
||||
"/descendant::input[@type='radio'][@name='target'][@value='1']";
|
||||
$this->execute("behat_general::i_click_on", array($radionodexpath, 'xpath_element'));
|
||||
|
||||
// Pressing the continue button of the restore merging section.
|
||||
$continuenode = $this->find('xpath', "//div[contains(concat(' ', normalize-space(@class), ' '), 'bcs-current-course')]" .
|
||||
"/descendant::input[@type='submit'][@value='" . get_string('continue') . "']");
|
||||
$continuenode->click();
|
||||
$this->wait();
|
||||
$continuenodexpath = "//div[contains(concat(' ', normalize-space(@class), ' '), 'bcs-current-course')]" .
|
||||
"/descendant::input[@type='submit'][@value='" . get_string('continue') . "']";
|
||||
$this->execute("behat_general::i_click_on", array($continuenodexpath, 'xpath_element'));
|
||||
|
||||
// Common restore process using provided key/value options.
|
||||
$this->process_restore($options);
|
||||
@@ -305,15 +282,14 @@ class behat_backup extends behat_base {
|
||||
$this->select_backup($backupfilename);
|
||||
|
||||
// Delete contents radio option.
|
||||
$radionode = $this->find('xpath', "//div[contains(concat(' ', normalize-space(@class), ' '), 'bcs-current-course')]" .
|
||||
"/descendant::input[@type='radio'][@name='target'][@value='0']");
|
||||
$radionode->click();
|
||||
$radionodexpath = "//div[contains(concat(' ', normalize-space(@class), ' '), 'bcs-current-course')]" .
|
||||
"/descendant::input[@type='radio'][@name='target'][@value='0']";
|
||||
$this->execute("behat_general::i_click_on", array($radionodexpath, 'xpath_element'));
|
||||
|
||||
// Pressing the continue button of the restore merging section.
|
||||
$continuenode = $this->find('xpath', "//div[contains(concat(' ', normalize-space(@class), ' '), 'bcs-current-course')]" .
|
||||
"/descendant::input[@type='submit'][@value='" . get_string('continue') . "']");
|
||||
$continuenode->click();
|
||||
$this->wait();
|
||||
$continuenodexpath = "//div[contains(concat(' ', normalize-space(@class), ' '), 'bcs-current-course')]" .
|
||||
"/descendant::input[@type='submit'][@value='" . get_string('continue') . "']";
|
||||
$this->execute("behat_general::i_click_on", array($continuenodexpath, 'xpath_element'));
|
||||
|
||||
// Common restore process using provided key/value options.
|
||||
$this->process_restore($options);
|
||||
@@ -340,7 +316,7 @@ class behat_backup extends behat_base {
|
||||
$restorelink->click();
|
||||
|
||||
// Confirm the backup contents.
|
||||
$restore = $this->find_button(get_string('continue'))->press();
|
||||
$this->find_button(get_string('continue'))->press();
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -356,23 +332,20 @@ class behat_backup extends behat_base {
|
||||
|
||||
// Settings.
|
||||
$this->fill_backup_restore_form($this->get_step_options($options, "Settings"));
|
||||
$this->find_button(get_string('restorestage4action', 'backup'))->press();
|
||||
$this->wait();
|
||||
$this->execute("behat_forms::press_button", get_string('restorestage4action', 'backup'));
|
||||
|
||||
// Schema.
|
||||
$this->fill_backup_restore_form($this->get_step_options($options, "Schema"));
|
||||
$this->find_button(get_string('restorestage8action', 'backup'))->press();
|
||||
$this->wait();
|
||||
$this->execute("behat_forms::press_button", get_string('restorestage8action', 'backup'));
|
||||
|
||||
// Review, no options here.
|
||||
$this->find_button(get_string('restorestage16action', 'backup'))->press();
|
||||
$this->wait();
|
||||
$this->execute("behat_forms::press_button", get_string('restorestage16action', 'backup'));
|
||||
|
||||
// Wait till the final button is visible.
|
||||
$this->execute("behat_general::wait_until_the_page_is_ready");
|
||||
|
||||
// Last restore continue button, redirected to restore course after this.
|
||||
$this->find_button(get_string('restorestage32action', 'backup'))->press();
|
||||
|
||||
// Long wait when waiting for the restore to finish.
|
||||
$this->wait(self::EXTENDED_TIMEOUT);
|
||||
$this->execute("behat_general::i_click_on", array(get_string('restorestage32action', 'backup'), 'button'));
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -431,25 +404,4 @@ class behat_backup extends behat_base {
|
||||
|
||||
return $pageoptions;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Waits until the DOM and the page Javascript code is ready.
|
||||
*
|
||||
* @param int $timeout The number of seconds that we wait.
|
||||
* @return void
|
||||
*/
|
||||
protected function wait($timeout = false) {
|
||||
|
||||
if (!$this->running_javascript()) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (!$timeout) {
|
||||
$timeout = self::TIMEOUT;
|
||||
}
|
||||
|
||||
$this->getSession()->wait($timeout * 1000, self::PAGE_READY_JS);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -41,7 +41,7 @@ Feature: Restore Moodle 2 course backups
|
||||
Then I should see "Course 1 restored in a new course"
|
||||
And I should see "Community finder" in the "Community finder" "block"
|
||||
And I should see "Test forum name"
|
||||
And I click on "Edit settings" "link" in the "Administration" "block"
|
||||
And I navigate to "Edit settings" node in "Course administration"
|
||||
And I expand all fieldsets
|
||||
And the field "id_format" matches value "Topics format"
|
||||
And the field "Number of sections" matches value "15"
|
||||
@@ -83,7 +83,7 @@ Feature: Restore Moodle 2 course backups
|
||||
When I restore "test_backup.mbz" backup into a new course using this options:
|
||||
Then I should see "Topic 1"
|
||||
And I should see "Test forum name"
|
||||
And I click on "Edit settings" "link" in the "Administration" "block"
|
||||
And I navigate to "Edit settings" node in "Course administration"
|
||||
And I expand all fieldsets
|
||||
And the field "id_format" matches value "Topics format"
|
||||
And I set the following fields to these values:
|
||||
@@ -95,14 +95,14 @@ Feature: Restore Moodle 2 course backups
|
||||
And I press "Save and display"
|
||||
And I should see "1 January - 7 January"
|
||||
And I should see "Test forum name"
|
||||
And I click on "Edit settings" "link" in the "Administration" "block"
|
||||
And I navigate to "Edit settings" node in "Course administration"
|
||||
And I expand all fieldsets
|
||||
And the field "id_format" matches value "Weekly format"
|
||||
And I set the following fields to these values:
|
||||
| id_format | Social format |
|
||||
And I press "Save and display"
|
||||
And I should see "An open forum for chatting about anything you want to"
|
||||
And I click on "Edit settings" "link" in the "Administration" "block"
|
||||
And I navigate to "Edit settings" node in "Course administration"
|
||||
And I expand all fieldsets
|
||||
And the field "id_format" matches value "Social format"
|
||||
And I press "Cancel"
|
||||
@@ -119,7 +119,7 @@ Feature: Restore Moodle 2 course backups
|
||||
| Confirmation | Filename | test_backup.mbz |
|
||||
And I restore "test_backup.mbz" backup into "Course 2" course using this options:
|
||||
| Schema | Overwrite course configuration | Yes |
|
||||
And I click on "Edit settings" "link" in the "Administration" "block"
|
||||
And I navigate to "Edit settings" node in "Course administration"
|
||||
And I expand all fieldsets
|
||||
Then the field "id_format" matches value "Topics format"
|
||||
And the field "Number of sections" matches value "15"
|
||||
|
||||
@@ -50,7 +50,7 @@ $PAGE->set_context($context);
|
||||
$title = get_string('backpackdetails', 'badges');
|
||||
$PAGE->set_title($title);
|
||||
$PAGE->set_heading(fullname($USER));
|
||||
$PAGE->set_pagelayout('mydashboard');
|
||||
$PAGE->set_pagelayout('standard');
|
||||
|
||||
$backpack = $DB->get_record('badge_backpack', array('userid' => $USER->id));
|
||||
$badgescache = cache::make('core', 'externalbadges');
|
||||
|
||||
+1
-1
@@ -89,7 +89,7 @@ $PAGE->set_context($context);
|
||||
$title = get_string('badges', 'badges');
|
||||
$PAGE->set_title($title);
|
||||
$PAGE->set_heading(fullname($USER));
|
||||
$PAGE->set_pagelayout('mydashboard');
|
||||
$PAGE->set_pagelayout('standard');
|
||||
|
||||
// Include JS files for backpack support.
|
||||
badges_setup_backpack_js();
|
||||
|
||||
@@ -26,6 +26,7 @@
|
||||
|
||||
require_once(__DIR__ . '/../config.php');
|
||||
require_once('preferences_form.php');
|
||||
require_once($CFG->dirroot.'/user/editlib.php');
|
||||
|
||||
$url = new moodle_url('/badges/preferences.php');
|
||||
|
||||
@@ -42,8 +43,8 @@ $mform = new badges_preferences_form();
|
||||
$mform->set_data(array('badgeprivacysetting' => get_user_preferences('badgeprivacysetting')));
|
||||
|
||||
if (!$mform->is_cancelled() && $data = $mform->get_data()) {
|
||||
$setting = $data->badgeprivacysetting;
|
||||
set_user_preference('badgeprivacysetting', $setting);
|
||||
useredit_update_user_preference(['id' => $USER->id,
|
||||
'preference_badgeprivacysetting' => $data->badgeprivacysetting]);
|
||||
}
|
||||
|
||||
if ($mform->is_cancelled()) {
|
||||
|
||||
@@ -14,12 +14,16 @@ Feature: Add badges to the system
|
||||
And I set the field "Default badge issuer name" to "Test Badge Site"
|
||||
And I set the field "Default badge issuer contact details" to "testuser@example.com"
|
||||
And I press "Save changes"
|
||||
And I follow "Badges"
|
||||
When I follow "Add a new badge"
|
||||
Then the field "issuercontact" matches value "testuser@example.com"
|
||||
And the field "issuername" matches value "Test Badge Site"
|
||||
|
||||
@javascript
|
||||
Scenario: Accessing the badges
|
||||
And I press "Customise this page"
|
||||
# TODO MDL-57120 site "Badges" link not accessible without navigation block.
|
||||
And I add the "Navigation" block if not present
|
||||
Given I navigate to "Site badges" node in "Site pages"
|
||||
Then I should see "There are no badges available."
|
||||
|
||||
|
||||
@@ -30,9 +30,7 @@ Feature: Award badges
|
||||
And I should not see "Criteria for this badge have not been set up yet."
|
||||
And I press "Enable access"
|
||||
And I press "Continue"
|
||||
And I click on "Admin User" "link"
|
||||
And I choose "Profile" in the open action menu
|
||||
And I click on "Edit profile" "link" in the "region-main" "region"
|
||||
And I open my profile in edit mode
|
||||
And I expand all fieldsets
|
||||
And I set the field "Phone" to "123456789"
|
||||
And I press "Update profile"
|
||||
|
||||
@@ -109,7 +109,7 @@ Feature: Block activity modules
|
||||
| workshop | Test workshop name | Test workshop description | C1 | workshop1 |
|
||||
|
||||
When I log in as "admin"
|
||||
And I follow "Courses"
|
||||
And I am on course index
|
||||
And I follow "Course 1"
|
||||
And I turn editing mode on
|
||||
And I add the "Activities" block
|
||||
|
||||
@@ -52,6 +52,7 @@ class block_activity_results_edit_form extends block_edit_form {
|
||||
$sql = 'SELECT id, itemname FROM {grade_items} WHERE courseid = ? and itemtype = ? and (gradetype = ? or gradetype = ?)';
|
||||
$params = array($this->page->course->id, 'mod', GRADE_TYPE_VALUE, GRADE_TYPE_SCALE);
|
||||
$activities = $DB->get_records_sql_menu($sql, $params);
|
||||
core_collator::asort($activities);
|
||||
|
||||
if (empty($activities)) {
|
||||
$mform->addElement('static', 'noactivitieswarning', get_string('config_select_activity', 'block_activity_results'),
|
||||
|
||||
@@ -50,7 +50,7 @@ Feature: The activity results block displays student scores
|
||||
And I press "Save and return to course"
|
||||
And I follow "Course 1"
|
||||
And I should see "Test page name"
|
||||
And I go to "View > Grader report" in the course gradebook
|
||||
And I navigate to "View > Grader report" in the course gradebook
|
||||
And I turn editing mode on
|
||||
And I give the grade "90.00" to the user "Student 1" for the grade item "Test assignment 1"
|
||||
And I give the grade "80.00" to the user "Student 2" for the grade item "Test assignment 1"
|
||||
|
||||
@@ -33,7 +33,7 @@ Feature: The activity results block displays student scores
|
||||
| id_config_nameformat | Display full names |
|
||||
And I press "Save changes"
|
||||
When I follow "Test assignment"
|
||||
And I click on "Edit settings" "link" in the "Administration" "block"
|
||||
And I navigate to "Edit settings" in current page administration
|
||||
And I set the following fields to these values:
|
||||
| id_grade_modgrade_type | None |
|
||||
And I press "Save and return to course"
|
||||
|
||||
@@ -32,7 +32,7 @@ Feature: The activity results block displays student scores
|
||||
| Description | Offline text |
|
||||
| assignsubmission_file_enabled | 0 |
|
||||
And I follow "Course 1"
|
||||
And I go to "View > Grader report" in the course gradebook
|
||||
And I navigate to "View > Grader report" in the course gradebook
|
||||
And I turn editing mode on
|
||||
And I give the grade "90.00" to the user "Student 1" for the grade item "Test assignment"
|
||||
And I give the grade "80.00" to the user "Student 2" for the grade item "Test assignment"
|
||||
|
||||
@@ -26,7 +26,7 @@ Feature: The activity results block displays student scores as scales
|
||||
| student5 | C1 | student |
|
||||
And I log in as "teacher1"
|
||||
And I follow "Course 1"
|
||||
And I go to "Scales" in the course gradebook
|
||||
And I navigate to "Scales" in the course gradebook
|
||||
And I press "Add a new scale"
|
||||
And I set the following fields to these values:
|
||||
| Name | My Scale |
|
||||
@@ -41,7 +41,7 @@ Feature: The activity results block displays student scores as scales
|
||||
| id_grade_modgrade_type | Scale |
|
||||
| id_grade_modgrade_scale | My Scale |
|
||||
And I follow "Course 1"
|
||||
And I go to "View > Grader report" in the course gradebook
|
||||
And I navigate to "View > Grader report" in the course gradebook
|
||||
And I turn editing mode on
|
||||
And I give the grade "Excellent!" to the user "Student 1" for the grade item "Test assignment"
|
||||
And I give the grade "Very good" to the user "Student 2" for the grade item "Test assignment"
|
||||
|
||||
@@ -43,7 +43,7 @@ Feature: The activity results block displays student scores as scales
|
||||
| student6 | G3 |
|
||||
And I log in as "teacher1"
|
||||
And I follow "Course 1"
|
||||
And I go to "Scales" in the course gradebook
|
||||
And I navigate to "Scales" in the course gradebook
|
||||
And I press "Add a new scale"
|
||||
And I set the following fields to these values:
|
||||
| Name | My Scale |
|
||||
@@ -59,7 +59,7 @@ Feature: The activity results block displays student scores as scales
|
||||
| id_grade_modgrade_scale | My Scale |
|
||||
| Group mode | Separate groups |
|
||||
And I follow "Course 1"
|
||||
And I go to "View > Grader report" in the course gradebook
|
||||
And I navigate to "View > Grader report" in the course gradebook
|
||||
And I turn editing mode on
|
||||
And I give the grade "Excellent!" to the user "Student 1" for the grade item "Test assignment"
|
||||
And I give the grade "Very good" to the user "Student 2" for the grade item "Test assignment"
|
||||
|
||||
@@ -50,7 +50,7 @@ Feature: The activity results block displays student scores
|
||||
| assignsubmission_file_enabled | 0 |
|
||||
| Group mode | Separate groups |
|
||||
And I follow "Course 1"
|
||||
And I go to "View > Grader report" in the course gradebook
|
||||
And I navigate to "View > Grader report" in the course gradebook
|
||||
And I turn editing mode on
|
||||
And I give the grade "100.00" to the user "Student 1" for the grade item "Test assignment"
|
||||
And I give the grade "90.00" to the user "Student 2" for the grade item "Test assignment"
|
||||
|
||||
@@ -50,7 +50,7 @@ Feature: The activity results block displays student scores
|
||||
| assignsubmission_file_enabled | 0 |
|
||||
| Group mode | Visible groups |
|
||||
And I follow "Course 1"
|
||||
And I go to "View > Grader report" in the course gradebook
|
||||
And I navigate to "View > Grader report" in the course gradebook
|
||||
And I turn editing mode on
|
||||
And I give the grade "100.00" to the user "Student 1" for the grade item "Test assignment"
|
||||
And I give the grade "90.00" to the user "Student 2" for the grade item "Test assignment"
|
||||
|
||||
@@ -32,7 +32,7 @@ Feature: The activity results block displays student scores
|
||||
| Description | Offline text |
|
||||
| assignsubmission_file_enabled | 0 |
|
||||
And I follow "Course 1"
|
||||
And I go to "View > Grader report" in the course gradebook
|
||||
And I navigate to "View > Grader report" in the course gradebook
|
||||
And I turn editing mode on
|
||||
And I give the grade "90.00" to the user "Student 1" for the grade item "Test assignment"
|
||||
And I give the grade "80.00" to the user "Student 2" for the grade item "Test assignment"
|
||||
|
||||
@@ -26,7 +26,7 @@ Feature: The activity results block displays student scores as scales
|
||||
| student5 | C1 | student |
|
||||
And I log in as "teacher1"
|
||||
And I follow "Course 1"
|
||||
And I go to "Scales" in the course gradebook
|
||||
And I navigate to "Scales" in the course gradebook
|
||||
And I press "Add a new scale"
|
||||
And I set the following fields to these values:
|
||||
| Name | My Scale |
|
||||
@@ -41,7 +41,7 @@ Feature: The activity results block displays student scores as scales
|
||||
| id_grade_modgrade_type | Scale |
|
||||
| id_grade_modgrade_scale | My Scale |
|
||||
And I follow "Course 1"
|
||||
And I go to "View > Grader report" in the course gradebook
|
||||
And I navigate to "View > Grader report" in the course gradebook
|
||||
And I turn editing mode on
|
||||
And I give the grade "Excellent!" to the user "Student 1" for the grade item "Test assignment"
|
||||
And I give the grade "Very good" to the user "Student 2" for the grade item "Test assignment"
|
||||
|
||||
@@ -43,7 +43,7 @@ Feature: The activity results block displays student scores as scales
|
||||
| student6 | G3 |
|
||||
And I log in as "teacher1"
|
||||
And I follow "Course 1"
|
||||
And I go to "Scales" in the course gradebook
|
||||
And I navigate to "Scales" in the course gradebook
|
||||
And I press "Add a new scale"
|
||||
And I set the following fields to these values:
|
||||
| Name | My Scale |
|
||||
@@ -59,7 +59,7 @@ Feature: The activity results block displays student scores as scales
|
||||
| id_grade_modgrade_scale | My Scale |
|
||||
| Group mode | Separate groups |
|
||||
And I follow "Course 1"
|
||||
And I go to "View > Grader report" in the course gradebook
|
||||
And I navigate to "View > Grader report" in the course gradebook
|
||||
And I turn editing mode on
|
||||
And I give the grade "Excellent!" to the user "Student 1" for the grade item "Test assignment"
|
||||
And I give the grade "Very good" to the user "Student 2" for the grade item "Test assignment"
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user