Compare commits
646 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| d16cdbd81f | |||
| dccbafa7e9 | |||
| db0f899c72 | |||
| 505b87d89d | |||
| 8069645f56 | |||
| e4ddf13091 | |||
| 08aeda7b07 | |||
| 97ef1d1420 | |||
| 9c56531610 | |||
| 0d8bbb774e | |||
| 518f8a7ced | |||
| ebbb58556a | |||
| 0f479ba76e | |||
| 3c3ed4c0f8 | |||
| 17babdbaf7 | |||
| dcc8e34187 | |||
| 39dce68e4a | |||
| 374639d3e6 | |||
| 62fe924127 | |||
| 69e22263ad | |||
| d3b1d6a004 | |||
| a286741d9c | |||
| d9ddd1d13d | |||
| 82470d8ebc | |||
| 0272a95dc8 | |||
| 048f8d9ae7 | |||
| e259354c91 | |||
| 5994edb30b | |||
| 0d8ad43873 | |||
| 91d5491ee2 | |||
| 8d94e92599 | |||
| 8e00c5c8ed | |||
| 078babf6d2 | |||
| 9a03fe6ebd | |||
| 8a48bf5beb | |||
| 2780c284c5 | |||
| e73d9075e9 | |||
| 0cad1c25dc | |||
| 80ea373e2c | |||
| 13f89eaf11 | |||
| c72cac3879 | |||
| 7238ffc65d | |||
| 75bc323bf1 | |||
| 15d4f7a72a | |||
| e056d8b19d | |||
| 26ec60a016 | |||
| 2de94975a3 | |||
| ab7493b61c | |||
| b826a2a180 | |||
| 384711fe8c | |||
| 401c7b680d | |||
| 333097ea67 | |||
| 1d96718214 | |||
| 012f850733 | |||
| 690d2c69a3 | |||
| a0c5c98dc5 | |||
| 9e1feec44b | |||
| 2a416b3466 | |||
| a3fbe80044 | |||
| 38ac93aace | |||
| 403a814535 | |||
| 7dabe1053c | |||
| e1011a09cf | |||
| 81c8f80dae | |||
| 65d64de0cd | |||
| 94d60b142c | |||
| 561f53a702 | |||
| 27527f6c36 | |||
| a53db0ab73 | |||
| e493cb7d9c | |||
| 0dc39f21c3 | |||
| 2d89b5ea52 | |||
| 6af476cab2 | |||
| 785f9f97a8 | |||
| 110843c03c | |||
| 396e086575 | |||
| c2ab40848b | |||
| 7f4cd77843 | |||
| b074e8a1a2 | |||
| affd686294 | |||
| 2d645be2a5 | |||
| fc1c26b8c0 | |||
| 3891d6d398 | |||
| 33b8447c60 | |||
| 755f2c3eae | |||
| 9f5dd71d82 | |||
| c4ad68a8b7 | |||
| 5276206f43 | |||
| 890de8ab6a | |||
| 747f4468fb | |||
| 86ecd214da | |||
| 2fae9db702 | |||
| 8ec0823dfe | |||
| 0f64a45eaf | |||
| 38b700180f | |||
| 31f6946c8f | |||
| 5a03c7b447 | |||
| d242d558ae | |||
| 60059b9216 | |||
| 14695e5f4c | |||
| ae73287803 | |||
| 0b8f8f3402 | |||
| 89db762c0e | |||
| 5d11d337d2 | |||
| e6e3aa975a | |||
| e8af997888 | |||
| 464f907c4c | |||
| 3f355629ee | |||
| 5adb27669c | |||
| e794852ff5 | |||
| 23c63a1afe | |||
| c44388a7cf | |||
| 61bc523600 | |||
| 4ee2ff34b1 | |||
| df1e5786c2 | |||
| 4818800a69 | |||
| 8b936c2483 | |||
| 89a1d7cc73 | |||
| 2f1de062c6 | |||
| 500202997b | |||
| a17167118a | |||
| 7361129133 | |||
| f3629d3204 | |||
| 116a88c6bc | |||
| 97898d4faa | |||
| 122214a8db | |||
| b957465b35 | |||
| 59a0253332 | |||
| 04422a0396 | |||
| c3033419cc | |||
| a99bf936fb | |||
| 84a77ce35d | |||
| cc3992585a | |||
| 00802d0930 | |||
| ff4cc15c72 | |||
| 1caf3fe169 | |||
| d69efaf872 | |||
| 3e7d409d72 | |||
| b967175480 | |||
| 9678041d7d | |||
| 1a62cb7567 | |||
| 3a1a3639aa | |||
| 89349cd5a7 | |||
| 4211ec36a5 | |||
| 328a9d57ca | |||
| 62f2a0d05a | |||
| 278eba8cfa | |||
| 36f5996a19 | |||
| 54e328d0f6 | |||
| 4e07b2cfbd | |||
| ae5cf0490f | |||
| 6f08d4ee0b | |||
| ad552b3502 | |||
| 3de05a67ed | |||
| 5e3989dfcf | |||
| e634f04355 | |||
| 5eb6f7500a | |||
| 694b4d4274 | |||
| baddb058a9 | |||
| 8d77d104bf | |||
| 6a66d9b08d | |||
| f788c16f00 | |||
| 66620e48b7 | |||
| f3a92d07b6 | |||
| 8dfc18bed3 | |||
| 1199aab2c1 | |||
| 48cf88458c | |||
| 45600c4a0b | |||
| 4b0075414e | |||
| b9c333f5db | |||
| ea5431e351 | |||
| 4c4295061c | |||
| 33eb190484 | |||
| 1240c086eb | |||
| f056d6fb88 | |||
| 8fa1397886 | |||
| 0baa4c581e | |||
| 998305db0a | |||
| fd9c9c807f | |||
| 66270fd6e6 | |||
| 07ae362341 | |||
| 51ad4489b9 | |||
| 3439a8196e | |||
| 165d174c7f | |||
| 3874af089a | |||
| 28c0272a16 | |||
| 7bf842111f | |||
| 8cf4568280 | |||
| 5526ce914b | |||
| a5ef15bbb0 | |||
| d4e7c98dd6 | |||
| 184ed2b8f9 | |||
| 2fe04a14e2 | |||
| f6dd11e3ff | |||
| 2825fc7249 | |||
| cfb85df80c | |||
| 8229a2b85d | |||
| fc1a399565 | |||
| f4b608041c | |||
| 0e967898bd | |||
| 6e1654b79b | |||
| 3c5a929ef2 | |||
| e45ba0143b | |||
| 63f070cab1 | |||
| b61dfdaf8f | |||
| 021f11b6b6 | |||
| 516280b3a0 | |||
| 90c5e7f8d1 | |||
| 2d98e42166 | |||
| a4e43f3d13 | |||
| 014be0ff8b | |||
| 5afb2e2601 | |||
| f907ed40e6 | |||
| be2dd2fd10 | |||
| 9c56b617f5 | |||
| d5956a3f17 | |||
| 986906d64b | |||
| 2ce6daca4b | |||
| 9620e23384 | |||
| 502a3b29b6 | |||
| 597b71cf55 | |||
| f190723ad5 | |||
| 83da404228 | |||
| 411a25c7eb | |||
| 1e7d81b51d | |||
| 1ef65952ee | |||
| b7075e690c | |||
| d1d6c611ef | |||
| 3e520d2b7c | |||
| b521ed1eae | |||
| 9d9a0b070a | |||
| 0084e7efd7 | |||
| 64a5038847 | |||
| 8dcf53b73e | |||
| a923ed028d | |||
| c4277bcdd0 | |||
| c78df8f42b | |||
| ddf844a904 | |||
| 3e443eb1f3 | |||
| fd673f2b8d | |||
| 616de3dff9 | |||
| b93f4c7570 | |||
| 1a968ade33 | |||
| 68d41752c5 | |||
| 48c50f4e7f | |||
| a15378e431 | |||
| e30f11ede6 | |||
| 607d46adc9 | |||
| f548f950ea | |||
| 491f57a2b0 | |||
| 9a99818016 | |||
| 0b6cc260c7 | |||
| 4789682191 | |||
| 5ddcdfd743 | |||
| 9873593120 | |||
| 8b94100661 | |||
| 3f0687bcdf | |||
| a9bb11731c | |||
| c773d10247 | |||
| 7e0516eab3 | |||
| 45e37067f6 | |||
| 4529cf6c76 | |||
| 81ebc2746e | |||
| 5821639bb7 | |||
| 12c17ffaee | |||
| 05d6d57101 | |||
| 663287d08f | |||
| eb7fb32928 | |||
| 1542f9d5b0 | |||
| 7634d30a74 | |||
| 9376718334 | |||
| e265092be4 | |||
| b7191a5616 | |||
| 3a325f777f | |||
| 2496ea3f9a | |||
| c2cc463678 | |||
| 7ba5567205 | |||
| 7fd11cca1d | |||
| fb4df94831 | |||
| c8722df0c0 | |||
| 9878e8e170 | |||
| b26b240790 | |||
| ee990ba3bb | |||
| 6283c33979 | |||
| 8aa81abdc0 | |||
| 8f75fc3657 | |||
| bc1d433972 | |||
| 7ba8e5dbd9 | |||
| 09bb6f19e5 | |||
| 4b25851bcc | |||
| dfc8d9a23b | |||
| f91e143f1d | |||
| 578558f070 | |||
| 48125a9408 | |||
| 3f4249d198 | |||
| ddda4a8827 | |||
| 804122a7a0 | |||
| cd6c041b41 | |||
| 56add3f0f3 | |||
| a61abb5557 | |||
| 08d116cd3d | |||
| cf44cfc398 | |||
| 5f65bb2e43 | |||
| 5dda224ef6 | |||
| 19ad96aee3 | |||
| 7cff64fdbf | |||
| 65734f149f | |||
| f1178ebcd9 | |||
| 7ca8c34045 | |||
| 77e072ebec | |||
| 12c232df76 | |||
| 48d8989f13 | |||
| 17bed94dd7 | |||
| 817cae1ac7 | |||
| 3a4d04cdb7 | |||
| 493e0febed | |||
| 546a71cf7e | |||
| f14252ba8e | |||
| 992c414ee4 | |||
| 7823046588 | |||
| ba646064b8 | |||
| c3728be605 | |||
| c5a43c1e74 | |||
| a36700bc41 | |||
| 47f708bec6 | |||
| 6050de43d8 | |||
| 3b9ba0034c | |||
| 7cb98a969e | |||
| b098545057 | |||
| 83aec89c42 | |||
| fad4180820 | |||
| dbb540329b | |||
| 61cb6bfaf4 | |||
| 864c61ecba | |||
| 4641507d92 | |||
| 9b67f1b9db | |||
| fd42923e67 | |||
| 8c5be66b12 | |||
| 2b459a6e97 | |||
| 2d8d39406b | |||
| 4c142669dc | |||
| 691ed15ce2 | |||
| 45e41c4fbe | |||
| 7277f5a28e | |||
| fe8900c83e | |||
| c2681c14b7 | |||
| 0362b18553 | |||
| 3ee30709a5 | |||
| 71321b2461 | |||
| 2efa73d91e | |||
| fb290224b0 | |||
| 971602a6c2 | |||
| 582460fbb6 | |||
| 64c2c2c091 | |||
| 5566ccf52c | |||
| 942ec23dd1 | |||
| b320590668 | |||
| 665c1f7105 | |||
| 68a0906ad7 | |||
| c0f9d4014a | |||
| a9b82ea745 | |||
| df8b69a470 | |||
| fb861fd51d | |||
| fb8af88c5c | |||
| 010931d695 | |||
| d51a20234e | |||
| a65c0dc2f2 | |||
| c88bedf4dd | |||
| 8c13b827a9 | |||
| 26fa4746c9 | |||
| 16bb5d56c5 | |||
| d37c325ff6 | |||
| 0e5b2e1997 | |||
| 3391ec00f0 | |||
| 0c15e941dd | |||
| bf54c89e8f | |||
| bd7583c7fa | |||
| befdd07ceb | |||
| b007713333 | |||
| f755308c8c | |||
| b828920455 | |||
| ff1c3e67af | |||
| 4bb31de252 | |||
| 34776dac4f | |||
| 89e0f80a84 | |||
| fdcdcba552 | |||
| 4ed6a0b3d6 | |||
| 936ef246c4 | |||
| 9b9c0ebf1a | |||
| b63ab17d52 | |||
| ccd130374b | |||
| 5f46076e1e | |||
| 4dfa85c18b | |||
| 5d563e92b0 | |||
| ca46e95170 | |||
| c31327ceb0 | |||
| b60cf799e0 | |||
| 37c98b2b4f | |||
| e566327fa6 | |||
| a0b2d4e707 | |||
| 1d9eb4709d | |||
| cd58862cc8 | |||
| 716b0ac977 | |||
| 19c7f9d457 | |||
| ab029256b3 | |||
| 19cc1b1839 | |||
| 418c59f945 | |||
| 55ae536cb8 | |||
| 812a994f6f | |||
| ebd2721708 | |||
| ad0f3b0986 | |||
| a6739f12aa | |||
| e0e4779523 | |||
| 81fcf79f04 | |||
| 1542061801 | |||
| c2fbd20021 | |||
| fd3acdf024 | |||
| acbdf41d83 | |||
| b340da9420 | |||
| e945bad970 | |||
| 3ee3b0276d | |||
| 9a2c7d2f03 | |||
| 51e39264eb | |||
| f6e0465718 | |||
| 8e496bbf97 | |||
| 12621418bd | |||
| a56ffba668 | |||
| a583fd0f8d | |||
| 577030b4c2 | |||
| 0a64621644 | |||
| b6b07a3d24 | |||
| d711d02fa3 | |||
| 63ccf4da71 | |||
| 126fa4b314 | |||
| 9eec9e3eae | |||
| 2e707c274a | |||
| 7c399ad875 | |||
| 50868598fb | |||
| 718caae926 | |||
| 2f39d695c3 | |||
| 8ba76c053c | |||
| c7fa026645 | |||
| bb10739913 | |||
| 1fe476078c | |||
| 68b5527fd2 | |||
| 5a92a95e9c | |||
| 7821a81662 | |||
| 7e99fac4b3 | |||
| 259db679f0 | |||
| caeaef8c16 | |||
| c8c806eea9 | |||
| 9d00644da6 | |||
| de7b0a3be0 | |||
| 27f4084642 | |||
| b880d690d7 | |||
| 7f67cf5102 | |||
| ee598ac82a | |||
| f6057175fb | |||
| 9b8d2eda4d | |||
| ad7c52eb85 | |||
| 0cd5052f4b | |||
| 6fb37f884f | |||
| 54a669fa52 | |||
| 63ba497c29 | |||
| 529162a2c3 | |||
| 656af10fc1 | |||
| dc325d9891 | |||
| 1ad598584d | |||
| 59a5dbe18b | |||
| 1f77dcd5b3 | |||
| 2c3fec1406 | |||
| 78cdc5327b | |||
| e6311ee386 | |||
| 580ea641f1 | |||
| aa6ad4698a | |||
| 02bb527c56 | |||
| 5e295f8af5 | |||
| 5528d4e20f | |||
| c2df6f969e | |||
| 03ab23d34a | |||
| 373861c951 | |||
| 6f1eec32e5 | |||
| 6c5f5bd8ef | |||
| 5f68e420d0 | |||
| f3669c2a69 | |||
| 3ad7079217 | |||
| 693f5eff05 | |||
| 4e435ac25a | |||
| e735a8f7d6 | |||
| 8aa7c69eb5 | |||
| 82e8cc50eb | |||
| d44d5d0257 | |||
| 208f6dfce0 | |||
| d4b743890c | |||
| ad81b49f4a | |||
| d2d18b2abf | |||
| f0e56d7197 | |||
| e3e4358287 | |||
| 73062f6503 | |||
| cf945e8ffb | |||
| e494eb4743 | |||
| 284fd4d3ac | |||
| 2ac1086916 | |||
| 6d9b42695a | |||
| cded277648 | |||
| c84f6fd713 | |||
| 00a51457f4 | |||
| 55f93cb5f0 | |||
| f3acb82953 | |||
| 8db4327324 | |||
| 048a0996f1 | |||
| 9aed16a38f | |||
| 87b01f2599 | |||
| cd5f5147df | |||
| d7a5af3f74 | |||
| cfcef5d0e2 | |||
| 9d6ce46e15 | |||
| 2523ec4ba9 | |||
| 1f93fcfe46 | |||
| 845360bec9 | |||
| e619162d7d | |||
| 68ca374e7d | |||
| 54c92105cc | |||
| 8143c179f2 | |||
| 014eee157d | |||
| 3cad70efa0 | |||
| cbd5cc6c97 | |||
| 8ae030ea26 | |||
| 833042d716 | |||
| 7dd1a2adff | |||
| 0e1967f0ef | |||
| b3be78703e | |||
| e81c36413e | |||
| 0c9eba6722 | |||
| 550445a364 | |||
| a6174e039b | |||
| 86e12fc481 | |||
| 3876164bb9 | |||
| 9c409941ac | |||
| 3c32d705b4 | |||
| 725b10cbea | |||
| 3d7be50b95 | |||
| 4287eb3f85 | |||
| 3a1c91bbe0 | |||
| 3fb95da969 | |||
| bca5897d9d | |||
| 0df572a400 | |||
| ee64a43e1f | |||
| eaaf824878 | |||
| e914864d08 | |||
| fb289cac64 | |||
| 13aa85310e | |||
| 3153e64879 | |||
| 43c37c2a6c | |||
| 74898ce3a9 | |||
| 5a30263466 | |||
| f7265106ef | |||
| 5230bba5a5 | |||
| 7d5747f1d1 | |||
| 392dccf38b | |||
| 4addd78dfc | |||
| 8422607979 | |||
| 1283e4c1b5 | |||
| afd9a1766d | |||
| 679b9927fe | |||
| bb126a9b18 | |||
| e5cd1282a1 | |||
| 33a42e94b4 | |||
| 49e36faa06 | |||
| 67885c39ae | |||
| a12ee735fe | |||
| 71b39748eb | |||
| b17f884ee0 | |||
| 8503ae7558 | |||
| 50ee86edc8 | |||
| 6d1170ad84 | |||
| 55ef80065e | |||
| 5cf8645e95 | |||
| 26385f6e34 | |||
| b44fd9143c | |||
| e9a554e24e | |||
| c1a2d364dd | |||
| 2dd2288807 | |||
| bc9cfd8e92 | |||
| 49abb3dbd1 | |||
| 8c632bed76 | |||
| 90728c0471 | |||
| e6ad581ef1 | |||
| 5e59d05dcb | |||
| 0be4b0e256 | |||
| 68bd2b3132 | |||
| e544b6b02a | |||
| 204f6198de | |||
| 6fc0e628c2 | |||
| b5f95a5aec | |||
| e3ba5c0bf7 | |||
| 868fccdfec | |||
| 34ed3b47d1 | |||
| 49e22cf34c | |||
| 99e496e085 | |||
| c4f82182b7 | |||
| 9b0671bf64 | |||
| 8754df0a60 | |||
| 9931445ebb | |||
| 468ed9d2cf | |||
| b5c0915c78 | |||
| a9c345ff81 | |||
| 5c3cf3991a | |||
| 3576fc22c1 | |||
| 05fcce2d37 | |||
| 96a2f1bf90 | |||
| c666cd83d5 | |||
| 3f922fc16b | |||
| d97841bd6a | |||
| e198c711d6 | |||
| 13cc47d30f | |||
| 3bf7532b3a | |||
| 94990b79dd | |||
| 1f7c86cd14 | |||
| 95950c4696 | |||
| 5830edf9ec | |||
| beed73ad0f | |||
| f65bf24e5c | |||
| e6b37361a1 | |||
| 6e29f12837 | |||
| ee7300f6e6 | |||
| 761e4380ef | |||
| 146cf59327 | |||
| 8f0336c473 | |||
| cc895e58d4 | |||
| 85dcae6808 | |||
| 1c496f6923 | |||
| c6b86ab0c0 | |||
| ebc0351e54 | |||
| 5dab1b52ba | |||
| 56c0af9224 | |||
| 30d813d44e | |||
| b7dffc34f5 | |||
| 2e3e1ae283 | |||
| 776f291ffd | |||
| a0c74d2ad9 | |||
| 95778c3e51 | |||
| 328732592e | |||
| cdf0f5c144 | |||
| 8049148bcf | |||
| fc95ad105d |
+122
-21
@@ -24,6 +24,7 @@
|
||||
|
||||
module.exports = function(grunt) {
|
||||
var path = require('path'),
|
||||
fs = require('fs'),
|
||||
tasks = {},
|
||||
cwd = process.env.PWD || process.cwd();
|
||||
|
||||
@@ -49,6 +50,17 @@ module.exports = function(grunt) {
|
||||
}
|
||||
)
|
||||
}
|
||||
},
|
||||
less: {
|
||||
bootstrapbase: {
|
||||
files: {
|
||||
"theme/bootstrapbase/style/moodle.css": "theme/bootstrapbase/less/moodle.less",
|
||||
"theme/bootstrapbase/style/editor.css": "theme/bootstrapbase/less/editor.less",
|
||||
},
|
||||
options: {
|
||||
compress: true
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
@@ -102,22 +114,107 @@ module.exports = function(grunt) {
|
||||
args.push('--lint-stderr');
|
||||
}
|
||||
|
||||
// Actually run shifter.
|
||||
shifter = exec("node", args, {
|
||||
cwd: cwd,
|
||||
stdio: 'inherit',
|
||||
env: process.env
|
||||
});
|
||||
if (grunt.option('no-color')) {
|
||||
args.push('--color=false');
|
||||
}
|
||||
|
||||
// Tidy up after exec.
|
||||
shifter.on('exit', function (code) {
|
||||
if (code) {
|
||||
grunt.fail.fatal('Shifter failed with code: ' + code);
|
||||
} else {
|
||||
grunt.log.ok('Shifter build complete.');
|
||||
done();
|
||||
}
|
||||
});
|
||||
var execShifter = function() {
|
||||
|
||||
shifter = exec("node", args, {
|
||||
cwd: cwd,
|
||||
stdio: 'inherit',
|
||||
env: process.env
|
||||
});
|
||||
|
||||
// Tidy up after exec.
|
||||
shifter.on('exit', function (code) {
|
||||
if (code) {
|
||||
grunt.fail.fatal('Shifter failed with code: ' + code);
|
||||
} else {
|
||||
grunt.log.ok('Shifter build complete.');
|
||||
done();
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
// Actually run shifter.
|
||||
if (!options.recursive) {
|
||||
execShifter();
|
||||
} else {
|
||||
// Check that there are yui modules otherwise shifter ends with exit code 1.
|
||||
var found = false;
|
||||
var hasYuiModules = function(directory, callback) {
|
||||
fs.readdir(directory, function(err, files) {
|
||||
if (err) {
|
||||
return callback(err, null);
|
||||
}
|
||||
|
||||
// If we already found a match there is no need to continue scanning.
|
||||
if (found === true) {
|
||||
return;
|
||||
}
|
||||
|
||||
// We need to track the number of files to know when we return a result.
|
||||
var pending = files.length;
|
||||
|
||||
// We first check files, so if there is a match we don't need further
|
||||
// async calls and we just return a true.
|
||||
for (var i = 0; i < files.length; i++) {
|
||||
if (files[i] === 'yui') {
|
||||
return callback(null, true);
|
||||
}
|
||||
}
|
||||
|
||||
// Iterate through subdirs if there were no matches.
|
||||
files.forEach(function (file) {
|
||||
|
||||
var p = path.join(directory, file);
|
||||
stat = fs.statSync(p);
|
||||
if (!stat.isDirectory()) {
|
||||
pending--;
|
||||
} else {
|
||||
|
||||
// We defer the pending-1 until we scan the whole dir and subdirs.
|
||||
hasYuiModules(p, function(err, result) {
|
||||
if (err) {
|
||||
return callback(err);
|
||||
}
|
||||
|
||||
if (result === true) {
|
||||
// Once we get a true we notify the caller.
|
||||
found = true;
|
||||
return callback(null, true);
|
||||
}
|
||||
|
||||
pending--;
|
||||
if (pending === 0) {
|
||||
// Notify the caller that the whole dir has been scaned and there are no matches.
|
||||
return callback(null, false);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
// No subdirs here, otherwise the return would be deferred until all subdirs are scanned.
|
||||
if (pending === 0) {
|
||||
return callback(null, false);
|
||||
}
|
||||
});
|
||||
});
|
||||
};
|
||||
|
||||
hasYuiModules(cwd, function(err, result) {
|
||||
if (err) {
|
||||
grunt.fail.fatal(err.message);
|
||||
}
|
||||
|
||||
if (result === true) {
|
||||
execShifter();
|
||||
} else {
|
||||
grunt.log.ok('No YUI modules to build.');
|
||||
done();
|
||||
}
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
tasks.startup = function() {
|
||||
@@ -126,13 +223,11 @@ module.exports = function(grunt) {
|
||||
grunt.task.run('shifter');
|
||||
// Are we in an AMD directory?
|
||||
} else if (path.basename(cwd) == 'amd') {
|
||||
grunt.task.run('jshint');
|
||||
grunt.task.run('uglify');
|
||||
grunt.task.run('amd');
|
||||
} else {
|
||||
// Run them all!.
|
||||
grunt.task.run('shifter');
|
||||
grunt.task.run('jshint');
|
||||
grunt.task.run('uglify');
|
||||
grunt.task.run('css');
|
||||
grunt.task.run('js');
|
||||
}
|
||||
};
|
||||
|
||||
@@ -140,9 +235,15 @@ module.exports = function(grunt) {
|
||||
// Register NPM tasks.
|
||||
grunt.loadNpmTasks('grunt-contrib-uglify');
|
||||
grunt.loadNpmTasks('grunt-contrib-jshint');
|
||||
grunt.loadNpmTasks('grunt-contrib-less');
|
||||
|
||||
// Register the shifter task.
|
||||
// Register JS tasks.
|
||||
grunt.registerTask('shifter', 'Run Shifter against the current directory', tasks.shifter);
|
||||
grunt.registerTask('amd', ['jshint', 'uglify']);
|
||||
grunt.registerTask('js', ['amd', 'shifter']);
|
||||
|
||||
// Register CSS taks.
|
||||
grunt.registerTask('css', ['less:bootstrapbase']);
|
||||
|
||||
// Register the startup task.
|
||||
grunt.registerTask('startup', 'Run the correct tasks for the current directory', tasks.startup);
|
||||
|
||||
@@ -64,6 +64,8 @@ echo "<form id=\"authmenu\" method=\"post\" action=\"auth_config.php\">\n";
|
||||
echo "<div>\n";
|
||||
echo "<input type=\"hidden\" name=\"sesskey\" value=\"".sesskey()."\" />\n";
|
||||
echo "<input type=\"hidden\" name=\"auth\" value=\"".$auth."\" />\n";
|
||||
// HACK to prevent browsers from automatically inserting the user's password into the wrong fields.
|
||||
echo prevent_form_autofill_password();
|
||||
|
||||
// auth plugin description
|
||||
echo $OUTPUT->box_start();
|
||||
@@ -146,8 +148,8 @@ function print_auth_lock_options($auth, $user_fields, $helptext, $retrieveopts,
|
||||
// If custom field then pick name from database.
|
||||
$fieldshortname = str_replace('profile_field_', '', $fieldname);
|
||||
$fieldname = $customfieldname[$fieldshortname]->name;
|
||||
} elseif (preg_match('/^(.+?)(\d+)$/', $fieldname, $matches)) {
|
||||
$fieldname = get_string($matches[1]) . ' ' . $matches[2];
|
||||
} elseif ($fieldname == 'phone1') {
|
||||
$fieldname = get_string('phone');
|
||||
} elseif ($fieldname == 'url') {
|
||||
$fieldname = get_string('webpage');
|
||||
} else {
|
||||
|
||||
+2
-1
@@ -155,7 +155,8 @@
|
||||
} else if ($blocksettings instanceof admin_settingpage) {
|
||||
$settings = '<a href="'.$CFG->wwwroot.'/'.$CFG->admin.'/settings.php?section=blocksetting'.$block->name.'">'.$strsettings.'</a>';
|
||||
} else {
|
||||
$settings = '<a href="block.php?block='.$blockid.'">'.$strsettings.'</a>';
|
||||
debugging('Warning: block_'.$block->name.' returns true in has_config() but does not provide a settings.php file',
|
||||
DEBUG_DEVELOPER);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1420,4 +1420,142 @@
|
||||
</CUSTOM_CHECK>
|
||||
</CUSTOM_CHECKS>
|
||||
</MOODLE>
|
||||
<MOODLE version="3.0" requires="2.2">
|
||||
<UNICODE level="required">
|
||||
<FEEDBACK>
|
||||
<ON_ERROR message="unicoderequired" />
|
||||
</FEEDBACK>
|
||||
</UNICODE>
|
||||
<DATABASE level="required">
|
||||
<VENDOR name="mariadb" version="5.5.31" />
|
||||
<VENDOR name="mysql" version="5.5.31" />
|
||||
<VENDOR name="postgres" version="9.1" />
|
||||
<VENDOR name="mssql" version="10.0" />
|
||||
<VENDOR name="oracle" version="10.2" />
|
||||
</DATABASE>
|
||||
<PHP version="5.4.4" level="required">
|
||||
</PHP>
|
||||
<PCREUNICODE level="optional">
|
||||
<FEEDBACK>
|
||||
<ON_CHECK message="pcreunicodewarning" />
|
||||
</FEEDBACK>
|
||||
</PCREUNICODE>
|
||||
<PHP_EXTENSIONS>
|
||||
<PHP_EXTENSION name="iconv" level="required">
|
||||
<FEEDBACK>
|
||||
<ON_ERROR message="iconvrequired" />
|
||||
</FEEDBACK>
|
||||
</PHP_EXTENSION>
|
||||
<PHP_EXTENSION name="mbstring" level="optional">
|
||||
<FEEDBACK>
|
||||
<ON_CHECK message="mbstringrecommended" />
|
||||
</FEEDBACK>
|
||||
</PHP_EXTENSION>
|
||||
<PHP_EXTENSION name="curl" level="required">
|
||||
<FEEDBACK>
|
||||
<ON_ERROR message="curlrequired" />
|
||||
</FEEDBACK>
|
||||
</PHP_EXTENSION>
|
||||
<PHP_EXTENSION name="openssl" level="optional">
|
||||
<FEEDBACK>
|
||||
<ON_CHECK message="opensslrecommended" />
|
||||
</FEEDBACK>
|
||||
</PHP_EXTENSION>
|
||||
<PHP_EXTENSION name="tokenizer" level="optional">
|
||||
<FEEDBACK>
|
||||
<ON_CHECK message="tokenizerrecommended" />
|
||||
</FEEDBACK>
|
||||
</PHP_EXTENSION>
|
||||
<PHP_EXTENSION name="xmlrpc" level="optional">
|
||||
<FEEDBACK>
|
||||
<ON_CHECK message="xmlrpcrecommended" />
|
||||
</FEEDBACK>
|
||||
</PHP_EXTENSION>
|
||||
<PHP_EXTENSION name="soap" level="optional">
|
||||
<FEEDBACK>
|
||||
<ON_CHECK message="soaprecommended" />
|
||||
</FEEDBACK>
|
||||
</PHP_EXTENSION>
|
||||
<PHP_EXTENSION name="ctype" level="required">
|
||||
<FEEDBACK>
|
||||
<ON_ERROR message="ctyperequired" />
|
||||
</FEEDBACK>
|
||||
</PHP_EXTENSION>
|
||||
<PHP_EXTENSION name="zip" level="required">
|
||||
<FEEDBACK>
|
||||
<ON_ERROR message="ziprequired" />
|
||||
</FEEDBACK>
|
||||
</PHP_EXTENSION>
|
||||
<PHP_EXTENSION name="zlib" level="required">
|
||||
</PHP_EXTENSION>
|
||||
<PHP_EXTENSION name="gd" level="required">
|
||||
<FEEDBACK>
|
||||
<ON_ERROR message="gdrequired" />
|
||||
</FEEDBACK>
|
||||
</PHP_EXTENSION>
|
||||
<PHP_EXTENSION name="simplexml" level="required">
|
||||
<FEEDBACK>
|
||||
<ON_ERROR message="simplexmlrequired" />
|
||||
</FEEDBACK>
|
||||
</PHP_EXTENSION>
|
||||
<PHP_EXTENSION name="spl" level="required">
|
||||
<FEEDBACK>
|
||||
<ON_ERROR message="splrequired" />
|
||||
</FEEDBACK>
|
||||
</PHP_EXTENSION>
|
||||
<PHP_EXTENSION name="pcre" level="required">
|
||||
</PHP_EXTENSION>
|
||||
<PHP_EXTENSION name="dom" level="required">
|
||||
</PHP_EXTENSION>
|
||||
<PHP_EXTENSION name="xml" level="required">
|
||||
</PHP_EXTENSION>
|
||||
<PHP_EXTENSION name="intl" level="optional">
|
||||
<FEEDBACK>
|
||||
<ON_CHECK message="intlrecommended" />
|
||||
</FEEDBACK>
|
||||
</PHP_EXTENSION>
|
||||
<PHP_EXTENSION name="json" level="required">
|
||||
</PHP_EXTENSION>
|
||||
<PHP_EXTENSION name="hash" level="required"/>
|
||||
</PHP_EXTENSIONS>
|
||||
<PHP_SETTINGS>
|
||||
<PHP_SETTING name="memory_limit" value="96M" level="required">
|
||||
<FEEDBACK>
|
||||
<ON_ERROR message="settingmemorylimit" />
|
||||
</FEEDBACK>
|
||||
</PHP_SETTING>
|
||||
<PHP_SETTING name="file_uploads" value="1" level="optional">
|
||||
<FEEDBACK>
|
||||
<ON_CHECK message="settingfileuploads" />
|
||||
</FEEDBACK>
|
||||
</PHP_SETTING>
|
||||
<PHP_SETTING name="opcache.enable" value="1" level="optional">
|
||||
<FEEDBACK>
|
||||
<ON_CHECK message="opcacherecommended" />
|
||||
</FEEDBACK>
|
||||
</PHP_SETTING>
|
||||
</PHP_SETTINGS>
|
||||
<CUSTOM_CHECKS>
|
||||
<CUSTOM_CHECK file="lib/upgradelib.php" function="check_database_storage_engine" level="required">
|
||||
<FEEDBACK>
|
||||
<ON_ERROR message="unsupporteddbstorageengine" />
|
||||
</FEEDBACK>
|
||||
</CUSTOM_CHECK>
|
||||
<CUSTOM_CHECK file="question/engine/upgrade/upgradelib.php" function="quiz_attempts_upgraded" level="required">
|
||||
<FEEDBACK>
|
||||
<ON_ERROR message="quizattemptsupgradedmessage" />
|
||||
</FEEDBACK>
|
||||
</CUSTOM_CHECK>
|
||||
<CUSTOM_CHECK file="lib/upgradelib.php" function="check_slasharguments" level="optional">
|
||||
<FEEDBACK>
|
||||
<ON_CHECK message="slashargumentswarning" />
|
||||
</FEEDBACK>
|
||||
</CUSTOM_CHECK>
|
||||
<CUSTOM_CHECK file="lib/upgradelib.php" function="check_database_tables_row_format" level="optional">
|
||||
<FEEDBACK>
|
||||
<ON_CHECK message="unsupporteddbtablerowformat" />
|
||||
</FEEDBACK>
|
||||
</CUSTOM_CHECK>
|
||||
</CUSTOM_CHECKS>
|
||||
</MOODLE>
|
||||
</COMPATIBILITY_MATRIX>
|
||||
|
||||
@@ -39,6 +39,8 @@ require_once($CFG->dirroot . '/' . $CFG->admin . '/registration/forms.php');
|
||||
require_once($CFG->dirroot . '/webservice/lib.php');
|
||||
require_once($CFG->dirroot . '/' . $CFG->admin . '/registration/lib.php');
|
||||
|
||||
require_sesskey();
|
||||
|
||||
$huburl = required_param('huburl', PARAM_URL);
|
||||
$huburl = rtrim($huburl, "/");
|
||||
|
||||
|
||||
+6
-2
@@ -50,7 +50,8 @@ $table->set_attribute('class', 'admintable generaltable');
|
||||
$table->setup();
|
||||
|
||||
$plugins = array();
|
||||
foreach (core_component::get_plugin_list('report') as $plugin => $plugindir) {
|
||||
$availableplugins = core_component::get_plugin_list('report');
|
||||
foreach ($availableplugins as $plugin => $plugindir) {
|
||||
if (get_string_manager()->string_exists('pluginname', 'report_' . $plugin)) {
|
||||
$strpluginname = get_string('pluginname', 'report_' . $plugin);
|
||||
} else {
|
||||
@@ -80,7 +81,10 @@ foreach ($plugins as $plugin => $name) {
|
||||
$uninstall = html_writer::link($uninstallurl, $struninstall);
|
||||
}
|
||||
|
||||
$stores = $logmanager->get_supported_logstores('report_' . $plugin);
|
||||
$stores = array();
|
||||
if (isset($availableplugins[$plugin])) {
|
||||
$stores = $logmanager->get_supported_logstores('report_' . $plugin);
|
||||
}
|
||||
if ($stores === false) {
|
||||
$supportedstores = get_string('logstorenotrequired', 'admin');
|
||||
} else if (!empty($stores)) {
|
||||
|
||||
@@ -64,7 +64,8 @@ preferences,moodle|/user/preferences.php|preferences',
|
||||
array('0' => new lang_string('default', 'calendar'),
|
||||
'%I:%M %p' => new lang_string('timeformat_12', 'calendar'),
|
||||
'%H:%M' => new lang_string('timeformat_24', 'calendar'))));
|
||||
$temp->add(new admin_setting_configselect('calendar_startwday', new lang_string('configstartwday', 'admin'), new lang_string('helpstartofweek', 'admin'), 0,
|
||||
$temp->add(new admin_setting_configselect('calendar_startwday', new lang_string('configstartwday', 'admin'),
|
||||
new lang_string('helpstartofweek', 'admin'), get_string('firstdayofweek', 'langconfig'),
|
||||
array(
|
||||
0 => new lang_string('sunday', 'calendar'),
|
||||
1 => new lang_string('monday', 'calendar'),
|
||||
|
||||
@@ -35,7 +35,8 @@ if ($hassiteconfig) { // speedup for non-admins, add all caps used on this page
|
||||
$params = new stdClass();
|
||||
$params->bytes = $defaultuserquota;
|
||||
$params->displaysize = display_size($defaultuserquota);
|
||||
$temp->add(new admin_setting_configtext('userquota', new lang_string('userquota', 'admin'), new lang_string('configuserquota', 'admin', $params), $defaultuserquota));
|
||||
$temp->add(new admin_setting_configtext('userquota', new lang_string('userquota', 'admin'),
|
||||
new lang_string('configuserquota', 'admin', $params), $defaultuserquota, PARAM_INT, 30));
|
||||
|
||||
$temp->add(new admin_setting_configcheckbox('allowobjectembed', new lang_string('allowobjectembed', 'admin'), new lang_string('configallowobjectembed', 'admin'), 0));
|
||||
$temp->add(new admin_setting_configcheckbox('enabletrusttext', new lang_string('enabletrusttext', 'admin'), new lang_string('configenabletrusttext', 'admin'), 0));
|
||||
|
||||
@@ -11,7 +11,7 @@ $hassiteconfig = has_capability('moodle/site:config', $systemcontext);
|
||||
$ADMIN->add('root', new admin_externalpage('adminnotifications', new lang_string('notifications'), "$CFG->wwwroot/$CFG->admin/index.php"));
|
||||
|
||||
$ADMIN->add('root', new admin_externalpage('registrationmoodleorg', new lang_string('registration', 'admin'),
|
||||
"$CFG->wwwroot/$CFG->admin/registration/register.php?huburl=" . HUB_MOODLEORGHUBURL . "&hubname=Moodle.org"));
|
||||
"$CFG->wwwroot/$CFG->admin/registration/register.php?huburl=" . HUB_MOODLEORGHUBURL . "&hubname=Moodle.org&sesskey=" . sesskey()));
|
||||
$ADMIN->add('root', new admin_externalpage('registrationhub', new lang_string('registerwith', 'hub'),
|
||||
"$CFG->wwwroot/$CFG->admin/registration/register.php", 'moodle/site:config', true));
|
||||
$ADMIN->add('root', new admin_externalpage('registrationhubs', new lang_string('hubs', 'admin'),
|
||||
|
||||
@@ -1,54 +0,0 @@
|
||||
@tool @tool_behat
|
||||
Feature: Page contents assertions
|
||||
In order to write good tests
|
||||
As a tests writer
|
||||
I need to check the page contents
|
||||
|
||||
@javascript
|
||||
Scenario: Basic contents assertions
|
||||
Given I log in as "admin"
|
||||
And I am on site homepage
|
||||
And I expand "Users" node
|
||||
And I follow "Groups"
|
||||
And I press "Create group"
|
||||
And I set the following fields to these values:
|
||||
| Group name | I'm the name |
|
||||
| Group description | I'm the description |
|
||||
And I press "Save changes"
|
||||
When I follow "Overview"
|
||||
And I wait until the page is ready
|
||||
And I wait "2" seconds
|
||||
And I hover "#region-main .generaltable td span" "css_element"
|
||||
Then I should see "I'm the description"
|
||||
And "Grouping" "select" in the "region-main" "region" should be visible
|
||||
And "Group" "select" should be visible
|
||||
And "Activity report" "link" in the "Administration" "block" should not be visible
|
||||
And "Event monitoring rules" "link" should not be visible
|
||||
And I should see "Filter groups by"
|
||||
And I should not see "Filter groupssss by"
|
||||
And I should see "Group members" in the "#region-main table th.c1" "css_element"
|
||||
And I should not see "Group membersssss" in the "#region-main table th.c1" "css_element"
|
||||
And I follow "Groups"
|
||||
And the "#groupeditform #showcreateorphangroupform" "css_element" should be enabled
|
||||
And the "#groupeditform #showeditgroupsettingsform" "css_element" should be disabled
|
||||
|
||||
@javascript
|
||||
Scenario: Locators inside specific DOM nodes using CSS selectors
|
||||
Given the following "courses" exist:
|
||||
| fullname | shortname | category |
|
||||
| Course 1 | C1 | 0 |
|
||||
And I log in as "admin"
|
||||
And I am on site homepage
|
||||
And I follow "Course 1"
|
||||
When I dock "Administration" block
|
||||
Then I should not see "Question bank" in the ".block-region" "css_element"
|
||||
And I click on "//div[@id='dock']/descendant::h2[normalize-space(.)='Administration']" "xpath_element"
|
||||
|
||||
@javascript
|
||||
Scenario: Locators inside specific DOM nodes using XPath
|
||||
Given the following "courses" exist:
|
||||
| fullname | shortname | category |
|
||||
| Course 1 | C1 | 0 |
|
||||
And I log in as "admin"
|
||||
When I dock "Administration" block
|
||||
Then I should not see "Turn editing on" in the ".block-region" "css_element"
|
||||
@@ -424,9 +424,9 @@ Feature: Set up contextual data for tests
|
||||
And the following "grade categories" exist:
|
||||
| fullname | course |
|
||||
| Grade category 1 | C1 |
|
||||
And the following "grade items" exist:
|
||||
| itemname | course | outcome | gradecategory |
|
||||
| Test Outcome Grade Item 1 | C1 | OT1 | Grade category 1 |
|
||||
And the following "grade items" exist:
|
||||
| itemname | course | outcome | gradecategory |
|
||||
| Test Outcome Grade Item 1 | C1 | OT1 | Grade category 1 |
|
||||
And the following config values are set as admin:
|
||||
| enableoutcomes | 1 |
|
||||
When I log in as "admin"
|
||||
@@ -441,3 +441,15 @@ Feature: Set up contextual data for tests
|
||||
And I expand all fieldsets
|
||||
And "//div[contains(@class, 'fitem')]/div[contains(@class, 'fitemtitle')]/div[contains(@class, fstaticlabel) and contains(., 'Grade category')]/../../div[contains(@class, 'felement') and contains(., 'Grade category 1')]" "xpath_element" should exist
|
||||
And I press "Cancel"
|
||||
|
||||
Scenario: Add a block
|
||||
Given the following "courses" exist:
|
||||
| fullname | shortname |
|
||||
| Course 1 | C1 |
|
||||
And the following "blocks" exist:
|
||||
| blockname | contextlevel | reference | pagetypepattern | defaultregion |
|
||||
| online_users | Course | C1 | course-view-* | site-pre |
|
||||
When I log in as "admin"
|
||||
And I am on site homepage
|
||||
And I follow "Course 1"
|
||||
Then I should see "Online users"
|
||||
|
||||
@@ -137,6 +137,17 @@ Feature: Verify that all form fields values can be get and set
|
||||
And I press "Save my choice"
|
||||
And the field "one" matches value "1"
|
||||
And the field "two" matches value ""
|
||||
# Check if field xpath set/match works.
|
||||
And I am on site homepage
|
||||
And I follow "Course 1"
|
||||
And I navigate to "Edit settings" node in "Course administration"
|
||||
And I set the field with xpath "//input[@id='id_idnumber']" to "Course id number"
|
||||
And the field with xpath "//input[@name='idnumber']" matches value "Course id number"
|
||||
And the field with xpath "//input[@name='idnumber']" does not match value ""
|
||||
And I press "Save and display"
|
||||
And I navigate to "Edit settings" node in "Course administration"
|
||||
And the field "Course ID number" matches value "Course id number"
|
||||
|
||||
|
||||
Scenario: with JS disabled all form fields getters and setters works as expected
|
||||
|
||||
|
||||
@@ -253,7 +253,8 @@ class tool_generator_course_backend extends tool_generator_backend {
|
||||
$courserecord = array(
|
||||
'shortname' => $this->shortname,
|
||||
'fullname' => $this->fullname,
|
||||
'numsections' => self::$paramsections[$this->size]
|
||||
'numsections' => self::$paramsections[$this->size],
|
||||
'startdate' => usergetmidnight(time())
|
||||
);
|
||||
if (strlen($this->summary) > 0) {
|
||||
$courserecord['summary'] = $this->summary;
|
||||
|
||||
@@ -102,6 +102,10 @@ class manager {
|
||||
try {
|
||||
$this->client->login();
|
||||
mtrace("Connection established.");
|
||||
|
||||
// Ensure that mailboxes exist.
|
||||
$this->ensure_mailboxes_exist();
|
||||
|
||||
return true;
|
||||
|
||||
} catch (\Horde_Imap_Client_Exception $e) {
|
||||
@@ -741,6 +745,27 @@ class manager {
|
||||
return in_array($flag, $flags);
|
||||
}
|
||||
|
||||
/**
|
||||
* Ensure that all mailboxes exist.
|
||||
*/
|
||||
private function ensure_mailboxes_exist() {
|
||||
$requiredmailboxes = array(
|
||||
self::MAILBOX,
|
||||
self::CONFIRMATIONFOLDER,
|
||||
);
|
||||
|
||||
$existingmailboxes = $this->client->listMailboxes($requiredmailboxes);
|
||||
foreach ($requiredmailboxes as $mailbox) {
|
||||
if (isset($existingmailboxes[$mailbox])) {
|
||||
// This mailbox was found.
|
||||
continue;
|
||||
}
|
||||
|
||||
mtrace("Unable to find the '{$mailbox}' mailbox - creating it.");
|
||||
$this->client->createMailbox($mailbox);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Attempt to determine whether this message is a bulk message (e.g. automated reply).
|
||||
*
|
||||
|
||||
+5
-1
@@ -78,8 +78,12 @@
|
||||
echo $OUTPUT->header();
|
||||
$fullname = fullname($user, true);
|
||||
echo $OUTPUT->heading(get_string('deleteuser', 'admin'));
|
||||
|
||||
$optionsyes = array('delete'=>$delete, 'confirm'=>md5($delete), 'sesskey'=>sesskey());
|
||||
echo $OUTPUT->confirm(get_string('deletecheckfull', '', "'$fullname'"), new moodle_url($returnurl, $optionsyes), $returnurl);
|
||||
$deleteurl = new moodle_url($returnurl, $optionsyes);
|
||||
$deletebutton = new single_button($deleteurl, get_string('delete'), 'post');
|
||||
|
||||
echo $OUTPUT->confirm(get_string('deletecheckfull', '', "'$fullname'"), $deletebutton, $returnurl);
|
||||
echo $OUTPUT->footer();
|
||||
die;
|
||||
} else if (data_submitted() and !$user->deleted) {
|
||||
|
||||
@@ -309,7 +309,7 @@ class auth_db_testcase extends advanced_testcase {
|
||||
require_once($CFG->libdir.'/password_compat/lib/password.php');
|
||||
set_config('passtype', 'saltedcrypt', 'auth/db');
|
||||
$auth->config->passtype = 'saltedcrypt';
|
||||
$user3->pass = password_hash('heslo', PASSWORD_BCRYPT, array('salt' => 'best_salt_ever_moodle_rocks_dont_tell'));
|
||||
$user3->pass = password_hash('heslo', PASSWORD_BCRYPT);
|
||||
$DB->update_record('auth_db_users', $user3);
|
||||
$this->assertTrue($auth->user_login('u3', 'heslo'));
|
||||
|
||||
|
||||
@@ -47,7 +47,7 @@ $string['auth_ldap_expiration_desc'] = 'Select No to disable expired password ch
|
||||
$string['auth_ldap_expiration_key'] = 'Expiration';
|
||||
$string['auth_ldap_expiration_warning_desc'] = 'Number of days before password expiration warning is issued.';
|
||||
$string['auth_ldap_expiration_warning_key'] = 'Expiration warning';
|
||||
$string['auth_ldap_expireattr_desc'] = 'Optional: overrides ldap-attribute that stores password expiration time';
|
||||
$string['auth_ldap_expireattr_desc'] = 'Optional: Overrides the LDAP attribute that stores password expiration time.';
|
||||
$string['auth_ldap_expireattr_key'] = 'Expiration attribute';
|
||||
$string['auth_ldapextrafields'] = 'These fields are optional. You can choose to pre-fill some Moodle user fields with information from the <b>LDAP fields</b> that you specify here. <p>If you leave these fields blank, then nothing will be transferred from LDAP and Moodle defaults will be used instead.</p><p>In either case, the user will be able to edit all of these fields after they log in.</p>';
|
||||
$string['auth_ldap_graceattr_desc'] = 'Optional: Overrides gracelogin attribute';
|
||||
@@ -71,7 +71,7 @@ $string['auth_ldap_noconnect_all'] = 'LDAP-module cannot connect to any servers:
|
||||
$string['auth_ldap_noextension'] = '<em>The PHP LDAP module does not seem to be present. Please ensure it is installed and enabled if you want to use this authentication plugin.</em>';
|
||||
$string['auth_ldap_no_mbstring'] = 'You need the mbstring extension to create users in Active Directory.';
|
||||
$string['auth_ldapnotinstalled'] = 'Cannot use LDAP authentication. The PHP LDAP module is not installed.';
|
||||
$string['auth_ldap_objectclass'] = 'Optional: Overrides objectClass used to name/search users on ldap_user_type. Usually you dont need to chage this.';
|
||||
$string['auth_ldap_objectclass'] = 'Optional: Overrides objectClass used to name/search users on ldap_user_type. Usually you don\'t need to change this.';
|
||||
$string['auth_ldap_objectclass_key'] = 'Object class';
|
||||
$string['auth_ldap_opt_deref'] = 'Determines how aliases are handled during search. Select one of the following values: "No" (LDAP_DEREF_NEVER) or "Yes" (LDAP_DEREF_ALWAYS)';
|
||||
$string['auth_ldap_opt_deref_key'] = 'Dereference aliases';
|
||||
|
||||
@@ -60,7 +60,7 @@ if (!isset($config->changepasswordurl)) {
|
||||
</tr>
|
||||
|
||||
<tr valign="top" >
|
||||
<td align="right"><?php echo html_writer::label(get_string('auth_radiustype_key', 'auth_radius'), 'menuradiustype'); ?>: </td>
|
||||
<td align="right"><?php echo html_writer::label(get_string('auth_radiustype_key', 'auth_radius') . ':', 'menuradiustype'); ?> </td>
|
||||
<td>
|
||||
<?php
|
||||
|
||||
|
||||
@@ -210,7 +210,8 @@ class auth_plugin_shibboleth extends auth_plugin_base {
|
||||
}
|
||||
|
||||
// Overwrite redirect in order to send user to Shibboleth logout page and let him return back
|
||||
$redirect = $this->config->logout_handler.'?return='.urlencode($temp_redirect);
|
||||
$redirecturl = new moodle_url($this->config->logout_handler, array('return' => $temp_redirect));
|
||||
$redirect = $redirecturl->out();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -328,7 +328,14 @@ class tree extends tree_node {
|
||||
// Loop through all valid children.
|
||||
foreach ($this->children as $index => $child) {
|
||||
if (!$child->is_applied_to_user_lists()) {
|
||||
continue;
|
||||
if ($andoperator) {
|
||||
continue;
|
||||
} else {
|
||||
// OR condition with one option that doesn't restrict user
|
||||
// lists = everyone is allowed.
|
||||
$anyconditions = false;
|
||||
break;
|
||||
}
|
||||
}
|
||||
$childresult = $child->filter_user_list($users, $innernot, $info, $checker);
|
||||
if ($andoperator) {
|
||||
@@ -359,7 +366,14 @@ class tree extends tree_node {
|
||||
$childresults = array();
|
||||
foreach ($this->children as $index => $child) {
|
||||
if (!$child->is_applied_to_user_lists()) {
|
||||
continue;
|
||||
if ($andoperator) {
|
||||
continue;
|
||||
} else {
|
||||
// OR condition with one option that doesn't restrict user
|
||||
// lists = everyone is allowed.
|
||||
$childresults = array();
|
||||
break;
|
||||
}
|
||||
}
|
||||
$childresult = $child->get_user_list_sql($innernot, $info, $onlyactive);
|
||||
if ($childresult[0]) {
|
||||
|
||||
@@ -234,4 +234,68 @@ class condition extends \core_availability\condition {
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Changes all date restrictions on a course by the specified shift amount.
|
||||
* Used by the course reset feature.
|
||||
*
|
||||
* @param int $courseid Course id
|
||||
* @param int $timeshift Offset in seconds
|
||||
*/
|
||||
public static function update_all_dates($courseid, $timeshift) {
|
||||
global $DB;
|
||||
|
||||
$modinfo = get_fast_modinfo($courseid);
|
||||
$anychanged = false;
|
||||
|
||||
// Adjust dates from all course modules.
|
||||
foreach ($modinfo->cms as $cm) {
|
||||
if (!$cm->availability) {
|
||||
continue;
|
||||
}
|
||||
$info = new \core_availability\info_module($cm);
|
||||
$tree = $info->get_availability_tree();
|
||||
$dates = $tree->get_all_children('availability_date\condition');
|
||||
$changed = false;
|
||||
foreach ($dates as $date) {
|
||||
$date->time += $timeshift;
|
||||
$changed = true;
|
||||
}
|
||||
|
||||
// Save the updated course module.
|
||||
if ($changed) {
|
||||
$DB->set_field('course_modules', 'availability', json_encode($tree->save()),
|
||||
array('id' => $cm->id));
|
||||
$anychanged = true;
|
||||
}
|
||||
}
|
||||
|
||||
// Adjust dates from all course sections.
|
||||
foreach ($modinfo->get_section_info_all() as $section) {
|
||||
if (!$section->availability) {
|
||||
continue;
|
||||
}
|
||||
|
||||
$info = new \core_availability\info_section($section);
|
||||
$tree = $info->get_availability_tree();
|
||||
$dates = $tree->get_all_children('availability_date\condition');
|
||||
$changed = false;
|
||||
foreach ($dates as $date) {
|
||||
$date->time += $timeshift;
|
||||
$changed = true;
|
||||
}
|
||||
|
||||
// Save the updated course module.
|
||||
if ($changed) {
|
||||
$DB->set_field('course_sections', 'availability', json_encode($tree->save()),
|
||||
array('id' => $section->id));
|
||||
$anychanged = true;
|
||||
}
|
||||
}
|
||||
|
||||
// Ensure course cache is cleared if required.
|
||||
if ($anychanged) {
|
||||
rebuild_course_cache($courseid, true);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -25,6 +25,7 @@
|
||||
defined('MOODLE_INTERNAL') || die();
|
||||
|
||||
use availability_date\condition;
|
||||
use core_availability\tree;
|
||||
|
||||
/**
|
||||
* Unit tests for the date condition.
|
||||
@@ -236,4 +237,53 @@ class availability_date_condition_testcase extends advanced_testcase {
|
||||
$information = $date->get_standalone_description(true, true, $info);
|
||||
$this->assertRegExp('~from.*5 March 2014([^0-9]*)$~', $information);
|
||||
}
|
||||
|
||||
/**
|
||||
* Tests the update_all_dates function.
|
||||
*/
|
||||
public function test_update_all_dates() {
|
||||
global $DB;
|
||||
$this->resetAfterTest();
|
||||
|
||||
// Create a course with 3 pages.
|
||||
$generator = $this->getDataGenerator();
|
||||
$course = $generator->create_course();
|
||||
$rec = array('course' => $course);
|
||||
$page1 = $generator->get_plugin_generator('mod_page')->create_instance($rec);
|
||||
$page2 = $generator->get_plugin_generator('mod_page')->create_instance($rec);
|
||||
$page3 = $generator->get_plugin_generator('mod_page')->create_instance($rec);
|
||||
|
||||
// Set the availability page 2 to a simple date condition. You can access
|
||||
// it from 1337 onwards.
|
||||
$simplecondition = tree::get_root_json(array(
|
||||
condition::get_json(condition::DIRECTION_FROM, 1337)));
|
||||
$DB->set_field('course_modules', 'availability',
|
||||
json_encode($simplecondition), array('id' => $page2->cmid));
|
||||
|
||||
// Set page 3 to a complex set of conditions including a nested date condition.
|
||||
// You can access it until 1459, *or* after 2810 if you belong to a group.
|
||||
$complexcondition = tree::get_root_json(array(
|
||||
condition::get_json(condition::DIRECTION_UNTIL, 1459),
|
||||
tree::get_nested_json(array(
|
||||
condition::get_json(condition::DIRECTION_FROM, 2810),
|
||||
\availability_group\condition::get_json()))),
|
||||
tree::OP_OR);
|
||||
$DB->set_field('course_modules', 'availability',
|
||||
json_encode($complexcondition), array('id' => $page3->cmid));
|
||||
|
||||
// Now use the update_all_dates function to move date forward 100000.
|
||||
condition::update_all_dates($course->id, 100000);
|
||||
|
||||
// Get the expected conditions after adjusting time, and compare to database.
|
||||
$simplecondition->c[0]->t = 101337;
|
||||
$complexcondition->c[0]->t = 101459;
|
||||
$complexcondition->c[1]->c[0]->t = 102810;
|
||||
$this->assertEquals($simplecondition, json_decode(
|
||||
$DB->get_field('course_modules', 'availability', array('id' => $page2->cmid))));
|
||||
$this->assertEquals($complexcondition, json_decode(
|
||||
$DB->get_field('course_modules', 'availability', array('id' => $page3->cmid))));
|
||||
|
||||
// The one without availability conditions should still be null.
|
||||
$this->assertNull($DB->get_field('course_modules', 'availability', array('id' => $page1->cmid)));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -246,7 +246,12 @@ class condition extends \core_availability\condition {
|
||||
* @return stdClass Object representing condition
|
||||
*/
|
||||
public static function get_json($groupid = 0) {
|
||||
return (object)array('type' => 'group', 'id' => (int)$groupid);
|
||||
$result = (object)array('type' => 'group');
|
||||
// Id is only included if set.
|
||||
if ($groupid) {
|
||||
$result->id = (int)$groupid;
|
||||
}
|
||||
return $result;
|
||||
}
|
||||
|
||||
public function get_user_list_sql($not, \core_availability\info $info, $onlyactive) {
|
||||
|
||||
@@ -35,7 +35,7 @@ use core_availability\info_section;
|
||||
* @copyright 2014 The Open University
|
||||
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
|
||||
*/
|
||||
class info_testcase extends \advanced_testcase {
|
||||
class info_testcase extends advanced_testcase {
|
||||
public function setUp() {
|
||||
// Load the mock condition so that it can be used.
|
||||
require_once(__DIR__ . '/fixtures/mock_condition.php');
|
||||
@@ -87,8 +87,8 @@ class info_testcase extends \advanced_testcase {
|
||||
// Check invalid one.
|
||||
$info = new info_module($cm3);
|
||||
$this->assertFalse($info->is_available($information));
|
||||
$debugging = phpunit_util::get_debugging_messages();
|
||||
phpunit_util::reset_debugging();
|
||||
$debugging = $this->getDebuggingMessages();
|
||||
$this->resetDebugging();
|
||||
$this->assertEquals(1, count($debugging));
|
||||
$this->assertContains('Invalid availability', $debugging[0]->message);
|
||||
|
||||
@@ -141,8 +141,8 @@ class info_testcase extends \advanced_testcase {
|
||||
// Check invalid one.
|
||||
$info = new info_section($sections[3]);
|
||||
$this->assertFalse($info->is_available($information));
|
||||
$debugging = phpunit_util::get_debugging_messages();
|
||||
phpunit_util::reset_debugging();
|
||||
$debugging = $this->getDebuggingMessages();
|
||||
$this->resetDebugging();
|
||||
$this->assertEquals(1, count($debugging));
|
||||
$this->assertContains('Invalid availability', $debugging[0]->message);
|
||||
|
||||
|
||||
@@ -600,6 +600,15 @@ class tree_testcase extends \advanced_testcase {
|
||||
ksort($result);
|
||||
$this->assertEquals(array(1, 3), array_keys($result));
|
||||
|
||||
// Tree with OR condition one of which doesn't filter.
|
||||
$structure = tree::get_root_json(array(
|
||||
self::mock(array('filter' => array(3))),
|
||||
self::mock(array())), tree::OP_OR);
|
||||
$tree = new tree($structure);
|
||||
$result = $tree->filter_user_list($users, false, $info, $checker);
|
||||
ksort($result);
|
||||
$this->assertEquals(array(1, 2, 3), array_keys($result));
|
||||
|
||||
// Tree with two condition that both filter (&).
|
||||
$structure = tree::get_root_json(array(
|
||||
self::mock(array('filter' => array(2, 3))),
|
||||
@@ -718,6 +727,16 @@ class tree_testcase extends \advanced_testcase {
|
||||
$result = $DB->get_fieldset_sql($sql, $params);
|
||||
sort($result);
|
||||
$this->assertEquals(array($userinneither->id), $result);
|
||||
|
||||
// Tree with 'OR' of group conditions and a non-filtering condition.
|
||||
// The non-filtering condition should mean that ALL users are included.
|
||||
$tree = new tree(tree::get_root_json(array(
|
||||
\availability_group\condition::get_json($group1->id),
|
||||
\availability_date\condition::get_json(\availability_date\condition::DIRECTION_UNTIL, 3)
|
||||
), tree::OP_OR));
|
||||
list($sql, $params) = $tree->get_user_list_sql(false, $info, false);
|
||||
$this->assertEquals('', $sql);
|
||||
$this->assertEquals(array(), $params);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -27,8 +27,18 @@ class cc_assesment_question_truefalse extends cc_assesment_question_proc_base {
|
||||
public function __construct($quiz, $questions, $manifest, $section, $question_node, $rootpath, $contextid, $outdir) {
|
||||
parent::__construct($quiz, $questions, $manifest, $section, $question_node, $rootpath, $contextid, $outdir);
|
||||
$this->qtype = cc_qti_profiletype::true_false;
|
||||
$this->correct_answer_node_id = $this->questions->nodeValue(
|
||||
'plugin_qtype_truefalse_question/truefalse/trueanswer', $this->question_node);
|
||||
|
||||
// Determine the correct answer by finding out which answer has the non zero fraction...
|
||||
// This is because a true / false question type can have 'false' as the correct answer.
|
||||
$answers = $this->questions->nodeList('plugin_qtype_truefalse_question/answers/answer', $this->question_node);
|
||||
foreach ($answers as $answer) {
|
||||
$fraction = $this->questions->nodeValue('fraction', $answer);
|
||||
|
||||
if ($fraction != 0) {
|
||||
$this->correct_answer_node_id = (int)$this->questions->nodeValue('@id', $answer);
|
||||
}
|
||||
}
|
||||
|
||||
$maximum_quiz_grade = (int)$this->quiz->nodeValue('/activity/quiz/grade');
|
||||
$this->total_grade_value = ($maximum_quiz_grade + 1).'.0000000';
|
||||
}
|
||||
|
||||
@@ -885,27 +885,30 @@ class cc_quiz extends entities {
|
||||
|
||||
$sheet_question_categories_question = cc2moodle::loadsheet(SHEET_COURSE_QUESTION_CATEGORIES_QUESTION_CATEGORY_QUESTION_TRUE_FALSE);
|
||||
|
||||
$max_score = 0;
|
||||
$true_answer_id = 0;
|
||||
$false_answer_id = 0;
|
||||
$trueanswer = null;
|
||||
$falseanswer = null;
|
||||
|
||||
if (!empty($question['answers'])) {
|
||||
|
||||
// Identify the true and false answers.
|
||||
foreach ($question['answers'] as $answer) {
|
||||
if ($answer['score'] > $max_score) {
|
||||
$max_score = $answer['score'];
|
||||
$true_answer_id = $answer['id'];
|
||||
if ($answer['identifier'] == 'true') {
|
||||
$trueanswer = $answer;
|
||||
} else if ($answer['identifier'] == 'false') {
|
||||
$falseanswer = $answer;
|
||||
} else {
|
||||
// Should not happen, but just in case.
|
||||
throw new coding_exception("Unknown answer identifier detected" .
|
||||
" in true/false quiz question with id {$question['id']}.");
|
||||
}
|
||||
|
||||
$node_course_question_categories_question_answer .= $this->create_node_course_question_categories_question_category_question_answer($answer);
|
||||
}
|
||||
|
||||
foreach ($question['answers'] as $answer) {
|
||||
|
||||
if ($answer['id'] != $true_answer_id) {
|
||||
$max_score = $answer['score'];
|
||||
$false_answer_id = $answer['id'];
|
||||
}
|
||||
// Make sure the true and false answer was found.
|
||||
if (is_null($trueanswer) || is_null($falseanswer)) {
|
||||
throw new coding_exception("Unable to correctly identify the " .
|
||||
"true and false answers in the question with id {$question['id']}.");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -914,8 +917,8 @@ class cc_quiz extends entities {
|
||||
'[#false_answer_id#]');
|
||||
|
||||
$replace_values = array($node_course_question_categories_question_answer,
|
||||
$true_answer_id,
|
||||
$false_answer_id);
|
||||
$trueanswer['id'],
|
||||
$falseanswer['id']);
|
||||
|
||||
$node_question_categories_question = str_replace($find_tags, $replace_values, $sheet_question_categories_question);
|
||||
|
||||
|
||||
@@ -908,27 +908,30 @@ class cc11_quiz extends entities11 {
|
||||
|
||||
$sheet_question_categories_question = cc112moodle::loadsheet(SHEET_COURSE_QUESTION_CATEGORIES_QUESTION_CATEGORY_QUESTION_TRUE_FALSE);
|
||||
|
||||
$max_score = 0;
|
||||
$true_answer_id = 0;
|
||||
$false_answer_id = 0;
|
||||
$trueanswer = null;
|
||||
$falseanswer = null;
|
||||
|
||||
if (!empty($question['answers'])) {
|
||||
|
||||
// Identify the true and false answers.
|
||||
foreach ($question['answers'] as $answer) {
|
||||
if ($answer['score'] > $max_score) {
|
||||
$max_score = $answer['score'];
|
||||
$true_answer_id = $answer['id'];
|
||||
if ($answer['identifier'] == 'true') {
|
||||
$trueanswer = $answer;
|
||||
} else if ($answer['identifier'] == 'false') {
|
||||
$falseanswer = $answer;
|
||||
} else {
|
||||
// Should not happen, but just in case.
|
||||
throw new coding_exception("Unknown answer identifier detected " .
|
||||
"in true/false quiz question with id {$question['id']}.");
|
||||
}
|
||||
|
||||
$node_course_question_categories_question_answer .= $this->create_node_course_question_categories_question_category_question_answer($answer);
|
||||
}
|
||||
|
||||
foreach ($question['answers'] as $answer) {
|
||||
|
||||
if ($answer['id'] != $true_answer_id) {
|
||||
$max_score = $answer['score'];
|
||||
$false_answer_id = $answer['id'];
|
||||
}
|
||||
// Make sure the true and false answer was found.
|
||||
if (is_null($trueanswer) || is_null($falseanswer)) {
|
||||
throw new coding_exception("Unable to correctly identify the " .
|
||||
"true and false answers in the question with id {$question['id']}.");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -937,8 +940,8 @@ class cc11_quiz extends entities11 {
|
||||
'[#false_answer_id#]');
|
||||
|
||||
$replace_values = array($node_course_question_categories_question_answer,
|
||||
$true_answer_id,
|
||||
$false_answer_id);
|
||||
$trueanswer['id'],
|
||||
$falseanswer['id']);
|
||||
|
||||
$node_question_categories_question = str_replace($find_tags, $replace_values, $sheet_question_categories_question);
|
||||
|
||||
|
||||
@@ -169,13 +169,39 @@ abstract class restore_check {
|
||||
}
|
||||
}
|
||||
|
||||
// Ensure the user has the rolldates capability. If not we want to lock this
|
||||
// settings so that they cannot change it.
|
||||
$hasrolldatescap = has_capability('moodle/restore:rolldates', $coursectx, $userid);
|
||||
if ($type == backup::TYPE_1COURSE && !$hasrolldatescap) {
|
||||
$datesetting = $restore_controller->get_plan()->get_setting('course_startdate');
|
||||
if ($datesetting) {
|
||||
$datesetting->set_status(base_setting::LOCKED_BY_PERMISSION);
|
||||
if ($type == backup::TYPE_1COURSE) {
|
||||
// Ensure the user has the rolldates capability. If not we want to lock this
|
||||
// settings so that they cannot change it.
|
||||
$hasrolldatescap = has_capability('moodle/restore:rolldates', $coursectx, $userid);
|
||||
if (!$hasrolldatescap) {
|
||||
$datesetting = $restore_controller->get_plan()->get_setting('course_startdate');
|
||||
if ($datesetting) {
|
||||
$datesetting->set_status(base_setting::LOCKED_BY_PERMISSION);
|
||||
}
|
||||
}
|
||||
|
||||
// Ensure the user has the changefullname capability. If not we want to lock
|
||||
// the setting so that they cannot change it.
|
||||
$haschangefullnamecap = has_capability('moodle/course:changefullname', $coursectx, $userid);
|
||||
if (!$haschangefullnamecap) {
|
||||
$fullnamesetting = $restore_controller->get_plan()->get_setting('course_fullname');
|
||||
$fullnamesetting->set_status(base_setting::LOCKED_BY_PERMISSION);
|
||||
}
|
||||
|
||||
// Ensure the user has the changeshortname capability. If not we want to lock
|
||||
// the setting so that they cannot change it.
|
||||
$haschangeshortnamecap = has_capability('moodle/course:changeshortname', $coursectx, $userid);
|
||||
if (!$haschangeshortnamecap) {
|
||||
$shortnamesetting = $restore_controller->get_plan()->get_setting('course_shortname');
|
||||
$shortnamesetting->set_status(base_setting::LOCKED_BY_PERMISSION);
|
||||
}
|
||||
|
||||
// Ensure the user has the update capability. If not we want to lock
|
||||
// the overwrite setting so that they cannot change it.
|
||||
$hasupdatecap = has_capability('moodle/course:update', $coursectx, $userid);
|
||||
if (!$hasupdatecap) {
|
||||
$overwritesetting = $restore_controller->get_plan()->get_setting('overwrite_conf');
|
||||
$overwritesetting->set_status(base_setting::LOCKED_BY_PERMISSION);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -97,7 +97,10 @@ class restore_log_rule implements processable {
|
||||
return $this->module . '-' . $this->action;
|
||||
}
|
||||
|
||||
public function process($log) {
|
||||
public function process($inputlog) {
|
||||
|
||||
// There might be multiple rules that process this log, we can't alter it in the process of checking it.
|
||||
$log = clone($inputlog);
|
||||
|
||||
// Reset the allpairs array
|
||||
$this->allpairs = array();
|
||||
|
||||
@@ -89,11 +89,12 @@ class restore_logs_processor {
|
||||
}
|
||||
// Arrived here log is empty, no rule was able to perform the conversion, log the problem
|
||||
if (empty($newlog)) {
|
||||
self::$task->log('Log module-action "' . $keyname . '" process problem. Not restored', backup::LOG_DEBUG);
|
||||
self::$task->log('Log module-action "' . $keyname . '" process problem. Not restored. ' .
|
||||
json_encode($log), backup::LOG_DEBUG);
|
||||
}
|
||||
|
||||
} else { // Action not found log the problem
|
||||
self::$task->log('Log module-action "' . $keyname . '" unknown. Not restored', backup::LOG_DEBUG);
|
||||
self::$task->log('Log module-action "' . $keyname . '" unknown. Not restored. '.json_encode($log), backup::LOG_DEBUG);
|
||||
$newlog = false;
|
||||
|
||||
}
|
||||
|
||||
@@ -0,0 +1,52 @@
|
||||
<?php
|
||||
// This file is part of Moodle - http://moodle.org/
|
||||
//
|
||||
// Moodle is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU General Public License as published by
|
||||
// the Free Software Foundation, either version 3 of the License, or
|
||||
// (at your option) any later version.
|
||||
//
|
||||
// Moodle is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU General Public License
|
||||
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
/**
|
||||
* @package core_backup
|
||||
* @category test
|
||||
* @copyright 2015 onwards Eloy Lafuente (stronk7) {@link http://stronk7.com}
|
||||
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
|
||||
*/
|
||||
|
||||
defined('MOODLE_INTERNAL') || die();
|
||||
|
||||
// Include all the needed stuff
|
||||
global $CFG;
|
||||
require_once($CFG->dirroot . '/backup/util/includes/restore_includes.php');
|
||||
|
||||
|
||||
class backup_restore_log_rule_testcase extends basic_testcase {
|
||||
|
||||
function test_process_keeps_log_unmodified() {
|
||||
|
||||
// Prepare a tiny log entry.
|
||||
$originallog = new stdClass();
|
||||
$originallog->url = 'original';
|
||||
$originallog->info = 'original';
|
||||
$log = clone($originallog);
|
||||
|
||||
// Process it with a tiny log rule, only modifying url and info.
|
||||
$lr = new restore_log_rule('test', 'test', 'changed', 'changed');
|
||||
$result = $lr->process($log);
|
||||
|
||||
// The log has been processed.
|
||||
$this->assertEquals('changed', $result->url);
|
||||
$this->assertEquals('changed', $result->info);
|
||||
|
||||
// But the original log has been kept unmodified by the process() call.
|
||||
$this->assertEquals($originallog, $log);
|
||||
}
|
||||
}
|
||||
@@ -45,7 +45,7 @@ class edit_backpack_form extends moodleform {
|
||||
$mform->addElement('html', html_writer::tag('span', '', array('class' => 'notconnected', 'id' => 'connection-error')));
|
||||
$mform->addElement('header', 'backpackheader', get_string('backpackconnection', 'badges'));
|
||||
$mform->addHelpButton('backpackheader', 'backpackconnection', 'badges');
|
||||
$mform->addElement('static', 'url', get_string('url'), 'http://' . BADGE_BACKPACKURL);
|
||||
$mform->addElement('static', 'url', get_string('url'), BADGE_BACKPACKURL);
|
||||
$status = html_writer::tag('span', get_string('notconnected', 'badges'),
|
||||
array('class' => 'notconnected', 'id' => 'connection-status'));
|
||||
$mform->addElement('static', 'status', get_string('status'), $status);
|
||||
@@ -67,7 +67,7 @@ class edit_backpack_form extends moodleform {
|
||||
$mform->addElement('hidden', 'userid', $USER->id);
|
||||
$mform->setType('userid', PARAM_INT);
|
||||
|
||||
$mform->addElement('hidden', 'backpackurl', 'http://' . BADGE_BACKPACKURL);
|
||||
$mform->addElement('hidden', 'backpackurl', BADGE_BACKPACKURL);
|
||||
$mform->setType('backpackurl', PARAM_URL);
|
||||
|
||||
}
|
||||
@@ -118,7 +118,7 @@ class edit_collections_form extends moodleform {
|
||||
|
||||
$mform->addElement('header', 'backpackheader', get_string('backpackconnection', 'badges'));
|
||||
$mform->addHelpButton('backpackheader', 'backpackconnection', 'badges');
|
||||
$mform->addElement('static', 'url', get_string('url'), 'http://' . BADGE_BACKPACKURL);
|
||||
$mform->addElement('static', 'url', get_string('url'), BADGE_BACKPACKURL);
|
||||
|
||||
$status = html_writer::tag('span', get_string('connected', 'badges'), array('class' => 'connected'));
|
||||
$mform->addElement('static', 'status', get_string('status'), $status);
|
||||
|
||||
@@ -87,7 +87,7 @@ if (!isset($data->status) || $data->status != 'okay') {
|
||||
|
||||
// Make sure email matches a backpack.
|
||||
$check = new stdClass();
|
||||
$check->backpackurl = 'http://' . BADGE_BACKPACKURL;
|
||||
$check->backpackurl = BADGE_BACKPACKURL;
|
||||
$check->email = $data->email;
|
||||
|
||||
$bp = new OpenBadgesBackpackHandler($check);
|
||||
@@ -106,7 +106,7 @@ if (isset($request->status) && $request->status == 'missing') {
|
||||
$obj = new stdClass();
|
||||
$obj->userid = $USER->id;
|
||||
$obj->email = $data->email;
|
||||
$obj->backpackurl = 'http://' . BADGE_BACKPACKURL;
|
||||
$obj->backpackurl = BADGE_BACKPACKURL;
|
||||
$obj->backpackuid = $backpackuid;
|
||||
$obj->autosync = 0;
|
||||
$obj->password = '';
|
||||
|
||||
@@ -170,33 +170,31 @@ class award_criteria_profile extends award_criteria {
|
||||
}
|
||||
|
||||
$join = '';
|
||||
$where = '';
|
||||
$whereparts = array();
|
||||
$sqlparams = array();
|
||||
$rule = ($this->method == BADGE_CRITERIA_AGGREGATION_ANY) ? ' OR ' : ' AND ';
|
||||
|
||||
foreach ($this->params as $param) {
|
||||
if (is_numeric($param['field'])) {
|
||||
$infodata[] = " uid.fieldid = :fieldid{$param['field']} ";
|
||||
$sqlparams["fieldid{$param['field']}"] = $param['field'];
|
||||
// This is a custom field.
|
||||
$idx = count($whereparts) + 1;
|
||||
$join .= " LEFT JOIN {user_info_data} uid{$idx} ON uid{$idx}.userid = u.id AND uid{$idx}.fieldid = :fieldid{$idx} ";
|
||||
$sqlparams["fieldid{$idx}"] = $param['field'];
|
||||
$whereparts[] = "uid{$idx}.id IS NOT NULL";
|
||||
} else {
|
||||
$userdata[] = $DB->sql_isnotempty('u', "u.{$param['field']}", false, true);
|
||||
// This is a field from {user} table.
|
||||
$whereparts[] = $DB->sql_isnotempty('u', "u.{$param['field']}", false, true);
|
||||
}
|
||||
}
|
||||
|
||||
// Add user custom field parameters if there are any.
|
||||
if (!empty($infodata)) {
|
||||
$extraon = implode($rule, $infodata);
|
||||
$join = " LEFT JOIN {user_info_data} uid ON uid.userid = u.id AND ({$extraon})";
|
||||
}
|
||||
|
||||
// Add user table field parameters if there are any.
|
||||
if (!empty($userdata)) {
|
||||
$extraon = implode($rule, $userdata);
|
||||
$where = " AND ({$extraon})";
|
||||
}
|
||||
|
||||
$sqlparams['userid'] = $userid;
|
||||
$sql = "SELECT u.* FROM {user} u " . $join . " WHERE u.id = :userid " . $where;
|
||||
|
||||
if ($whereparts) {
|
||||
$where = " AND (" . implode($rule, $whereparts) . ")";
|
||||
} else {
|
||||
$where = '';
|
||||
}
|
||||
$sql = "SELECT 1 FROM {user} u " . $join . " WHERE u.id = :userid $where";
|
||||
$overall = $DB->record_exists_sql($sql, $sqlparams);
|
||||
|
||||
return $overall;
|
||||
@@ -212,29 +210,26 @@ class award_criteria_profile extends award_criteria {
|
||||
global $DB;
|
||||
|
||||
$join = '';
|
||||
$where = '';
|
||||
$whereparts = array();
|
||||
$params = array();
|
||||
$rule = ($this->method == BADGE_CRITERIA_AGGREGATION_ANY) ? ' OR ' : ' AND ';
|
||||
|
||||
foreach ($this->params as $param) {
|
||||
if (is_numeric($param['field'])) {
|
||||
$infodata[] = " uid.fieldid = :fieldid{$param['field']} ";
|
||||
$params["fieldid{$param['field']}"] = $param['field'];
|
||||
// This is a custom field.
|
||||
$idx = count($whereparts);
|
||||
$join .= " LEFT JOIN {user_info_data} uid{$idx} ON uid{$idx}.userid = u.id AND uid{$idx}.fieldid = :fieldid{$idx} ";
|
||||
$params["fieldid{$idx}"] = $param['field'];
|
||||
$whereparts[] = "uid{$idx}.id IS NOT NULL";
|
||||
} else {
|
||||
$userdata[] = $DB->sql_isnotempty('u', "u.{$param['field']}", false, true);
|
||||
$whereparts[] = $DB->sql_isnotempty('u', "u.{$param['field']}", false, true);
|
||||
}
|
||||
}
|
||||
|
||||
// Add user custom fields if there are any.
|
||||
if (!empty($infodata)) {
|
||||
$extraon = implode($rule, $infodata);
|
||||
$join = " LEFT JOIN {user_info_data} uid ON uid.userid = u.id AND ({$extraon})";
|
||||
}
|
||||
|
||||
// Add user table fields if there are any.
|
||||
if (!empty($userdata)) {
|
||||
$extraon = implode($rule, $userdata);
|
||||
$where = " AND ({$extraon})";
|
||||
if ($whereparts) {
|
||||
$where = " AND (" . implode($rule, $whereparts) . ")";
|
||||
} else {
|
||||
$where = '';
|
||||
}
|
||||
return array($join, $where, $params);
|
||||
}
|
||||
|
||||
+3
-1
@@ -61,6 +61,8 @@ $PAGE->set_heading($badge->name);
|
||||
$PAGE->set_title($badge->name);
|
||||
$PAGE->navbar->add($badge->name);
|
||||
|
||||
require_capability('moodle/badges:viewbadges', $context);
|
||||
|
||||
echo $OUTPUT->header();
|
||||
echo $OUTPUT->heading(print_badge_image($badge, $context, 'small') . ' ' . $badge->name);
|
||||
|
||||
@@ -75,4 +77,4 @@ echo $output->print_badge_status_box($badge);
|
||||
$output->print_badge_tabs($badgeid, $context, 'overview');
|
||||
echo $output->print_badge_overview($badge, $context);
|
||||
|
||||
echo $OUTPUT->footer();
|
||||
echo $OUTPUT->footer();
|
||||
|
||||
@@ -28,6 +28,7 @@ defined('MOODLE_INTERNAL') || die();
|
||||
|
||||
global $CFG;
|
||||
require_once($CFG->libdir . '/badgeslib.php');
|
||||
require_once($CFG->dirroot . '/badges/lib.php');
|
||||
|
||||
class core_badges_badgeslib_testcase extends advanced_testcase {
|
||||
protected $badgeid;
|
||||
@@ -344,6 +345,11 @@ class core_badges_badgeslib_testcase extends advanced_testcase {
|
||||
$criteria_overall = award_criteria::build(array('criteriatype' => BADGE_CRITERIA_TYPE_ACTIVITY, 'badgeid' => $badge->id));
|
||||
$criteria_overall->save(array('agg' => BADGE_CRITERIA_AGGREGATION_ANY, 'module_'.$this->module->cmid => $this->module->cmid));
|
||||
|
||||
// Assert the badge will not be issued to the user as is.
|
||||
$badge = new badge($this->coursebadge);
|
||||
$badge->review_all_criteria();
|
||||
$this->assertFalse($badge->is_issued($this->user->id));
|
||||
|
||||
// Set completion for forum activity.
|
||||
$c = new completion_info($this->course);
|
||||
$activities = $c->get_activities();
|
||||
@@ -379,6 +385,11 @@ class core_badges_badgeslib_testcase extends advanced_testcase {
|
||||
|
||||
$ccompletion = new completion_completion(array('course' => $this->course->id, 'userid' => $this->user->id));
|
||||
|
||||
// Assert the badge will not be issued to the user as is.
|
||||
$badge = new badge($this->coursebadge);
|
||||
$badge->review_all_criteria();
|
||||
$this->assertFalse($badge->is_issued($this->user->id));
|
||||
|
||||
// Mark course as complete.
|
||||
$sink = $this->redirectEmails();
|
||||
$ccompletion->mark_complete();
|
||||
@@ -394,18 +405,33 @@ class core_badges_badgeslib_testcase extends advanced_testcase {
|
||||
* Test badges observer when user_updated event is fired.
|
||||
*/
|
||||
public function test_badges_observer_profile_criteria_review() {
|
||||
global $CFG, $DB;
|
||||
require_once($CFG->dirroot.'/user/profile/lib.php');
|
||||
|
||||
// Add a custom field of textarea type.
|
||||
$customprofileid = $DB->insert_record('user_info_field', array(
|
||||
'shortname' => 'newfield', 'name' => 'Description of new field', 'categoryid' => 1,
|
||||
'datatype' => 'textarea'));
|
||||
|
||||
$this->preventResetByRollback(); // Messaging is not compatible with transactions.
|
||||
$badge = new badge($this->coursebadge);
|
||||
$this->assertFalse($badge->is_issued($this->user->id));
|
||||
|
||||
$criteria_overall = award_criteria::build(array('criteriatype' => BADGE_CRITERIA_TYPE_OVERALL, 'badgeid' => $badge->id));
|
||||
$criteria_overall->save(array('agg' => BADGE_CRITERIA_AGGREGATION_ANY));
|
||||
$criteria_overall1 = award_criteria::build(array('criteriatype' => BADGE_CRITERIA_TYPE_PROFILE, 'badgeid' => $badge->id));
|
||||
$criteria_overall1->save(array('agg' => BADGE_CRITERIA_AGGREGATION_ALL, 'field_address' => 'address', 'field_aim' => 'aim'));
|
||||
$criteria_overall1->save(array('agg' => BADGE_CRITERIA_AGGREGATION_ALL, 'field_address' => 'address', 'field_aim' => 'aim',
|
||||
'field_' . $customprofileid => $customprofileid));
|
||||
|
||||
// Assert the badge will not be issued to the user as is.
|
||||
$badge = new badge($this->coursebadge);
|
||||
$badge->review_all_criteria();
|
||||
$this->assertFalse($badge->is_issued($this->user->id));
|
||||
|
||||
// Set the required fields and make sure the badge got issued.
|
||||
$this->user->address = 'Test address';
|
||||
$this->user->aim = '999999999';
|
||||
$sink = $this->redirectEmails();
|
||||
profile_save_data((object)array('id' => $this->user->id, 'profile_field_newfield' => 'X'));
|
||||
user_update_user($this->user, false);
|
||||
$this->assertCount(1, $sink->get_messages());
|
||||
$sink->close();
|
||||
@@ -447,4 +473,69 @@ class core_badges_badgeslib_testcase extends advanced_testcase {
|
||||
$this->assertStringMatchesFormat($testassertion->class, json_encode($assertion->get_badge_class()));
|
||||
$this->assertStringMatchesFormat($testassertion->issuer, json_encode($assertion->get_issuer()));
|
||||
}
|
||||
|
||||
/**
|
||||
* Tests the core_badges_myprofile_navigation() function.
|
||||
*/
|
||||
public function test_core_badges_myprofile_navigation() {
|
||||
// Set up the test.
|
||||
$tree = new \core_user\output\myprofile\tree();
|
||||
$this->setAdminUser();
|
||||
$badge = new badge($this->badgeid);
|
||||
$badge->issue($this->user->id, true);
|
||||
$iscurrentuser = true;
|
||||
$course = null;
|
||||
|
||||
// Enable badges.
|
||||
set_config('enablebadges', true);
|
||||
|
||||
// Check the node tree is correct.
|
||||
core_badges_myprofile_navigation($tree, $this->user, $iscurrentuser, $course);
|
||||
$reflector = new ReflectionObject($tree);
|
||||
$nodes = $reflector->getProperty('nodes');
|
||||
$nodes->setAccessible(true);
|
||||
$this->assertArrayHasKey('localbadges', $nodes->getValue($tree));
|
||||
}
|
||||
|
||||
/**
|
||||
* Tests the core_badges_myprofile_navigation() function with badges disabled..
|
||||
*/
|
||||
public function test_core_badges_myprofile_navigation_badges_disabled() {
|
||||
// Set up the test.
|
||||
$tree = new \core_user\output\myprofile\tree();
|
||||
$this->setAdminUser();
|
||||
$badge = new badge($this->badgeid);
|
||||
$badge->issue($this->user->id, true);
|
||||
$iscurrentuser = false;
|
||||
$course = null;
|
||||
|
||||
// Disable badges.
|
||||
set_config('enablebadges', false);
|
||||
|
||||
// Check the node tree is correct.
|
||||
core_badges_myprofile_navigation($tree, $this->user, $iscurrentuser, $course);
|
||||
$reflector = new ReflectionObject($tree);
|
||||
$nodes = $reflector->getProperty('nodes');
|
||||
$nodes->setAccessible(true);
|
||||
$this->assertArrayNotHasKey('localbadges', $nodes->getValue($tree));
|
||||
}
|
||||
|
||||
/**
|
||||
* Tests the core_badges_myprofile_navigation() function with a course badge.
|
||||
*/
|
||||
public function test_core_badges_myprofile_navigation_with_course_badge() {
|
||||
// Set up the test.
|
||||
$tree = new \core_user\output\myprofile\tree();
|
||||
$this->setAdminUser();
|
||||
$badge = new badge($this->coursebadge);
|
||||
$badge->issue($this->user->id, true);
|
||||
$iscurrentuser = false;
|
||||
|
||||
// Check the node tree is correct.
|
||||
core_badges_myprofile_navigation($tree, $this->user, $iscurrentuser, $this->course);
|
||||
$reflector = new ReflectionObject($tree);
|
||||
$nodes = $reflector->getProperty('nodes');
|
||||
$nodes->setAccessible(true);
|
||||
$this->assertArrayHasKey('localbadges', $nodes->getValue($tree));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -75,6 +75,8 @@ if ($type == BADGE_TYPE_SITE) {
|
||||
$PAGE->set_heading($coursename);
|
||||
}
|
||||
|
||||
require_capability('moodle/badges:viewbadges', $PAGE->context);
|
||||
|
||||
$PAGE->set_title($title);
|
||||
$output = $PAGE->get_renderer('core', 'badges');
|
||||
|
||||
|
||||
@@ -92,7 +92,7 @@ class block_activity_results extends block_base {
|
||||
return $result;
|
||||
}
|
||||
// See if it is a gradable activity.
|
||||
if (($rec->gradetype != GRADE_TYPE_VALUE) || ($rec->gradetype != GRADE_TYPE_SCALE)) {
|
||||
if (($rec->gradetype != GRADE_TYPE_VALUE) && ($rec->gradetype != GRADE_TYPE_SCALE)) {
|
||||
return $result;
|
||||
}
|
||||
return $rec;
|
||||
|
||||
@@ -1,6 +1,11 @@
|
||||
.block_activity_results {text-align: center;}
|
||||
.block_activity_results h1 {margin: 4px;font-size: 1.1em;}
|
||||
.block_activity_results table.grades {text-align: left;width: 100%;}
|
||||
.block_activity_results table.grades .number{text-align: right;width:10%;}
|
||||
.block_activity_results table.grades {text-align: left; width: 100%;}
|
||||
.block_activity_results table.grades .number{text-align: left; width:10%;}
|
||||
.block_activity_results table.grades .name{text-align: left; width:77%;}
|
||||
.block_activity_results table.grades .grade {text-align: right;}
|
||||
.block_activity_results table.grades caption {margin: 1em 0px 0px 0px;border-bottom-width: 1px;border-bottom-style: solid;font-weight: bold;}
|
||||
.block_activity_results table.grades caption {font-weight: bold; font-size: 18px;}
|
||||
|
||||
.dir-rtl .block_activity_results table.grades {text-align: right;}
|
||||
.dir-rtl .block_activity_results table.grades .number{text-align: right;}
|
||||
.dir-rtl .block_activity_results table.grades .name{text-align: right;}
|
||||
|
||||
@@ -28,31 +28,44 @@ Feature: The activity results block displays student scores
|
||||
And I follow "Course 1"
|
||||
And I turn editing mode on
|
||||
And I add a "Assignment" to section "1" and I fill the form with:
|
||||
| Assignment name | Test assignment |
|
||||
| Assignment name | Test assignment 1 |
|
||||
| Description | Offline text |
|
||||
| assignsubmission_file_enabled | 0 |
|
||||
And I follow "Course 1"
|
||||
And I add a "Assignment" to section "1" and I fill the form with:
|
||||
| Assignment name | Test assignment 2 |
|
||||
| Description | Offline text |
|
||||
| assignsubmission_file_enabled | 0 |
|
||||
And I follow "Course 1"
|
||||
And I add a "Assignment" to section "1" and I fill the form with:
|
||||
| Assignment name | Test assignment 3 |
|
||||
| Description | Offline text |
|
||||
| assignsubmission_file_enabled | 0 |
|
||||
And I follow "Course 1"
|
||||
And I add a "Page" to section "1"
|
||||
And I set the following fields to these values:
|
||||
| Name | Test page name |
|
||||
| Description | Test page description |
|
||||
| Page content | This is a page |
|
||||
And I press "Save and return to course"
|
||||
And I follow "Course 1"
|
||||
And I should see "Test page name"
|
||||
And I navigate to "Grades" node in "Course administration"
|
||||
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"
|
||||
And I give the grade "70.00" to the user "Student 3" for the grade item "Test assignment"
|
||||
And I give the grade "60.00" to the user "Student 4" for the grade item "Test assignment"
|
||||
And I give the grade "50.00" to the user "Student 5" for the grade item "Test assignment"
|
||||
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"
|
||||
And I give the grade "70.00" to the user "Student 3" for the grade item "Test assignment 1"
|
||||
And I give the grade "60.00" to the user "Student 4" for the grade item "Test assignment 1"
|
||||
And I give the grade "50.00" to the user "Student 5" for the grade item "Test assignment 1"
|
||||
And I press "Save changes"
|
||||
And I follow "Course 1"
|
||||
|
||||
Scenario: Configure the block on a non-graded activity to show 3 high scores
|
||||
Given I add a "Page" to section "1"
|
||||
Given I follow "Test page name"
|
||||
And I add the "Activity results" block
|
||||
When I configure the "Activity results" block
|
||||
And I set the following fields to these values:
|
||||
| Name | Test page name |
|
||||
| Description | Test page description |
|
||||
| page | This is a page |
|
||||
And I press "Save and display"
|
||||
When I add the "Activity results" block
|
||||
And I configure the "Activity results" block
|
||||
And I set the following fields to these values:
|
||||
| id_config_activitygradeitemid | Test assignment |
|
||||
| id_config_activitygradeitemid | Test assignment 1 |
|
||||
| id_config_showbest | 3 |
|
||||
| id_config_showworst | 0 |
|
||||
| id_config_gradeformat | Absolute numbers |
|
||||
@@ -63,4 +76,25 @@ Scenario: Configure the block on a non-graded activity to show 3 high scores
|
||||
And I should see "Student 2" in the "Activity results" "block"
|
||||
And I should see "80.00" in the "Activity results" "block"
|
||||
And I should see "Student 3" in the "Activity results" "block"
|
||||
And I should see "70.00" in the "Activity results" "block"
|
||||
And I should see "70.00" in the "Activity results" "block"
|
||||
|
||||
Scenario: Block should select current activity by default
|
||||
Given I follow "Test assignment 1"
|
||||
When I add the "Activity results" block
|
||||
And I configure the "Activity results" block
|
||||
Then the field "id_config_activitygradeitemid" matches value "Test assignment 1"
|
||||
And I follow "Course 1"
|
||||
And I follow "Test assignment 2"
|
||||
And I add the "Activity results" block
|
||||
And I configure the "Activity results" block
|
||||
And the field "id_config_activitygradeitemid" matches value "Test assignment 2"
|
||||
And I follow "Course 1"
|
||||
And I follow "Test assignment 3"
|
||||
And I add the "Activity results" block
|
||||
And I configure the "Activity results" block
|
||||
And the field "id_config_activitygradeitemid" matches value "Test assignment 3"
|
||||
And I follow "Course 1"
|
||||
And I follow "Test page name"
|
||||
And I add the "Activity results" block
|
||||
And I configure the "Activity results" block
|
||||
And the field "id_config_activitygradeitemid" does not match value "Test page name"
|
||||
|
||||
@@ -0,0 +1,111 @@
|
||||
@block @block_activity_results
|
||||
Feature: The activity results block displays student scores as scales
|
||||
In order to be display student scores as scales
|
||||
As a user
|
||||
I need to see the activity results block
|
||||
|
||||
Background:
|
||||
Given the following "users" exist:
|
||||
| username | firstname | lastname | email | idnumber |
|
||||
| teacher1 | Teacher | 1 | teacher1@example.com | T1 |
|
||||
| student1 | Student | 1 | student1@example.com | S1 |
|
||||
| student2 | Student | 2 | student2@example.com | S2 |
|
||||
| student3 | Student | 3 | student3@example.com | S3 |
|
||||
| student4 | Student | 4 | student4@example.com | S4 |
|
||||
| student5 | Student | 5 | student5@example.com | S5 |
|
||||
And the following "courses" exist:
|
||||
| fullname | shortname | category |
|
||||
| Course 1 | C1 | 0 |
|
||||
And the following "course enrolments" exist:
|
||||
| user | course | role |
|
||||
| teacher1 | C1 | editingteacher |
|
||||
| student1 | C1 | student |
|
||||
| student2 | C1 | student |
|
||||
| student3 | C1 | student |
|
||||
| student4 | C1 | student |
|
||||
| student5 | C1 | student |
|
||||
And I log in as "teacher1"
|
||||
And I follow "Course 1"
|
||||
And I navigate to "Grades" node in "Course administration"
|
||||
And I navigate to "Scales" node in "Grade administration"
|
||||
And I press "Add a new scale"
|
||||
And I set the following fields to these values:
|
||||
| Name | My Scale |
|
||||
| Scale | Disappointing, Not good enough, Average, Good, Very good, Excellent! |
|
||||
And I press "Save changes"
|
||||
And I follow "Course 1"
|
||||
And I turn editing mode on
|
||||
And I add a "Assignment" to section "1" and I fill the form with:
|
||||
| Assignment name | Test assignment |
|
||||
| Description | Offline text |
|
||||
| assignsubmission_file_enabled | 0 |
|
||||
| id_modgrade_type | Scale |
|
||||
| id_modgrade_scale | My Scale |
|
||||
And I follow "Course 1"
|
||||
And I navigate to "Grades" node in "Course administration"
|
||||
And I turn editing mode on
|
||||
And I give the grade "Excellent!" to the user "Student 1" for the grade item "Test assignment"
|
||||
And I give the grade "Very good" to the user "Student 2" for the grade item "Test assignment"
|
||||
And I give the grade "Good" to the user "Student 3" for the grade item "Test assignment"
|
||||
And I give the grade "Average" to the user "Student 4" for the grade item "Test assignment"
|
||||
And I give the grade "Not good enough" to the user "Student 5" for the grade item "Test assignment"
|
||||
And I press "Save changes"
|
||||
And I follow "Course 1"
|
||||
|
||||
Scenario: Configure the block on the course page to show 1 high score
|
||||
Given I add the "Activity results" block
|
||||
When I configure the "Activity results" block
|
||||
And I set the following fields to these values:
|
||||
| id_config_showbest | 1 |
|
||||
| id_config_showworst | 0 |
|
||||
| id_config_nameformat | Display full names |
|
||||
| id_config_decimalpoints | 0 |
|
||||
And I press "Save changes"
|
||||
Then I should see "Student 1" in the "Activity results" "block"
|
||||
And I should see "Excellent!" in the "Activity results" "block"
|
||||
|
||||
Scenario: Try to configure the block on the course page to show multiple high scores using full names
|
||||
Given I add the "Activity results" block
|
||||
When I configure the "Activity results" block
|
||||
And I set the following fields to these values:
|
||||
| id_config_showbest | 3 |
|
||||
| id_config_showworst | 0 |
|
||||
| id_config_nameformat | Display full names |
|
||||
And I press "Save changes"
|
||||
Then I should see "Student 1" in the "Activity results" "block"
|
||||
And I should see "Excellent!" in the "Activity results" "block"
|
||||
And I should see "Student 2" in the "Activity results" "block"
|
||||
And I should see "Very good" in the "Activity results" "block"
|
||||
And I should see "Student 3" in the "Activity results" "block"
|
||||
And I should see "Good" in the "Activity results" "block"
|
||||
|
||||
Scenario: Try to configure the block on the course page to show multiple high scores using ID numbers
|
||||
Given I add the "Activity results" block
|
||||
When I configure the "Activity results" block
|
||||
And I set the following fields to these values:
|
||||
| id_config_showbest | 3 |
|
||||
| id_config_showworst | 0 |
|
||||
| id_config_nameformat | Display only ID numbers |
|
||||
And I press "Save changes"
|
||||
Then I should see "User S1" in the "Activity results" "block"
|
||||
And I should see "Excellent!" in the "Activity results" "block"
|
||||
And I should see "User S2" in the "Activity results" "block"
|
||||
And I should see "Very good" in the "Activity results" "block"
|
||||
And I should see "User S3" in the "Activity results" "block"
|
||||
And I should see "Good" in the "Activity results" "block"
|
||||
|
||||
Scenario: Try to configure the block on the course page to show multiple high scores using anonymous names
|
||||
Given I add the "Activity results" block
|
||||
When I configure the "Activity results" block
|
||||
And I set the following fields to these values:
|
||||
| id_config_showbest | 3 |
|
||||
| id_config_showworst | 0 |
|
||||
| id_config_nameformat | Anonymous results |
|
||||
And I press "Save changes"
|
||||
Then I should see "User" in the "Activity results" "block"
|
||||
And I should not see "Student 1" in the "Activity results" "block"
|
||||
And I should see "Excellent!" in the "Activity results" "block"
|
||||
And I should not see "Student 2" in the "Activity results" "block"
|
||||
And I should see "Very good" in the "Activity results" "block"
|
||||
And I should not see "Student 3" in the "Activity results" "block"
|
||||
And I should see "Good" in the "Activity results" "block"
|
||||
@@ -0,0 +1,153 @@
|
||||
@block @block_activity_results
|
||||
Feature: The activity results block displays student scores as scales
|
||||
In order to be display student scores as scales
|
||||
As a user
|
||||
I need to see the activity results block
|
||||
|
||||
Background:
|
||||
Given the following "users" exist:
|
||||
| username | firstname | lastname | email | idnumber |
|
||||
| teacher1 | Teacher | 1 | teacher1@example.com | T1 |
|
||||
| student1 | Student | 1 | student1@example.com | S1 |
|
||||
| student2 | Student | 2 | student2@example.com | S2 |
|
||||
| student3 | Student | 3 | student3@example.com | S3 |
|
||||
| student4 | Student | 4 | student4@example.com | S4 |
|
||||
| student5 | Student | 5 | student5@example.com | S5 |
|
||||
| student6 | Student | 6 | student6@example.com | S6 |
|
||||
And the following "courses" exist:
|
||||
| fullname | shortname | category |
|
||||
| Course 1 | C1 | 0 |
|
||||
And the following "groups" exist:
|
||||
| name | course | idnumber |
|
||||
| Group 1 | C1 | G1 |
|
||||
| Group 2 | C1 | G2 |
|
||||
| Group 3 | C1 | G3 |
|
||||
| Group 4 | C1 | G4 |
|
||||
| Group 5 | C1 | G5 |
|
||||
And the following "course enrolments" exist:
|
||||
| user | course | role |
|
||||
| teacher1 | C1 | editingteacher |
|
||||
| student1 | C1 | student |
|
||||
| student2 | C1 | student |
|
||||
| student3 | C1 | student |
|
||||
| student4 | C1 | student |
|
||||
| student5 | C1 | student |
|
||||
| student6 | C1 | student |
|
||||
And the following "group members" exist:
|
||||
| user | group |
|
||||
| student1 | G1 |
|
||||
| student2 | G1 |
|
||||
| student3 | G2 |
|
||||
| student4 | G2 |
|
||||
| student5 | G3 |
|
||||
| student6 | G3 |
|
||||
And I log in as "teacher1"
|
||||
And I follow "Course 1"
|
||||
And I navigate to "Grades" node in "Course administration"
|
||||
And I navigate to "Scales" node in "Grade administration"
|
||||
And I press "Add a new scale"
|
||||
And I set the following fields to these values:
|
||||
| Name | My Scale |
|
||||
| Scale | Disappointing, Not good enough, Average, Good, Very good, Excellent! |
|
||||
And I press "Save changes"
|
||||
And I follow "Course 1"
|
||||
And I turn editing mode on
|
||||
And I add a "Assignment" to section "1" and I fill the form with:
|
||||
| Assignment name | Test assignment |
|
||||
| Description | Offline text |
|
||||
| assignsubmission_file_enabled | 0 |
|
||||
| id_modgrade_type | Scale |
|
||||
| id_modgrade_scale | My Scale |
|
||||
| Group mode | Separate groups |
|
||||
And I follow "Course 1"
|
||||
And I navigate to "Grades" node in "Course administration"
|
||||
And I turn editing mode on
|
||||
And I give the grade "Excellent!" to the user "Student 1" for the grade item "Test assignment"
|
||||
And I give the grade "Very good" to the user "Student 2" for the grade item "Test assignment"
|
||||
And I give the grade "Very good" to the user "Student 3" for the grade item "Test assignment"
|
||||
And I give the grade "Good" to the user "Student 4" for the grade item "Test assignment"
|
||||
And I give the grade "Good" to the user "Student 5" for the grade item "Test assignment"
|
||||
And I give the grade "Average" to the user "Student 6" for the grade item "Test assignment"
|
||||
And I press "Save changes"
|
||||
And I follow "Course 1"
|
||||
|
||||
Scenario: Try to configure the block on the course page to show 1 high score
|
||||
Given I add the "Activity results" block
|
||||
When I configure the "Activity results" block
|
||||
And I set the following fields to these values:
|
||||
| id_config_showbest | 1 |
|
||||
| id_config_showworst | 0 |
|
||||
| id_config_nameformat | Display full names |
|
||||
| id_config_usegroups | Yes |
|
||||
And I press "Save changes"
|
||||
Then I should see "Group 1" in the "Activity results" "block"
|
||||
And I should see "Excellent!" in the "Activity results" "block"
|
||||
And I log out
|
||||
And I log in as "student1"
|
||||
And I follow "Course 1"
|
||||
And I should see "Student 1" in the "Activity results" "block"
|
||||
And I should see "Excellent!" in the "Activity results" "block"
|
||||
|
||||
Scenario: Try to configure the block on the course page to show multiple high scores using full names
|
||||
Given I add the "Activity results" block
|
||||
When I configure the "Activity results" block
|
||||
And I set the following fields to these values:
|
||||
| id_config_showbest | 3 |
|
||||
| id_config_showworst | 0 |
|
||||
| id_config_nameformat | Display full names |
|
||||
| id_config_usegroups | Yes |
|
||||
And I press "Save changes"
|
||||
Then I should see "Group 1" in the "Activity results" "block"
|
||||
And I should see "Excellent!" in the "Activity results" "block"
|
||||
And I should see "Group 2" in the "Activity results" "block"
|
||||
And I should see "Very good" in the "Activity results" "block"
|
||||
And I should see "Group 3" in the "Activity results" "block"
|
||||
And I should see "Good" in the "Activity results" "block"
|
||||
And I log out
|
||||
And I log in as "student3"
|
||||
And I follow "Course 1"
|
||||
And I should see "Student 3" in the "Activity results" "block"
|
||||
And I should see "Very good" in the "Activity results" "block"
|
||||
And I should see "Student 4" in the "Activity results" "block"
|
||||
And I should see "Good" in the "Activity results" "block"
|
||||
|
||||
Scenario: Try to configure the block on the course page to show multiple high scores using ID numbers
|
||||
Given I add the "Activity results" block
|
||||
When I configure the "Activity results" block
|
||||
And I set the following fields to these values:
|
||||
| id_config_showbest | 3 |
|
||||
| id_config_showworst | 0 |
|
||||
| id_config_nameformat | Display only ID numbers |
|
||||
| id_config_usegroups | Yes |
|
||||
And I press "Save changes"
|
||||
Then I should see "Group" in the "Activity results" "block"
|
||||
And I should see "Excellent!" in the "Activity results" "block"
|
||||
And I should see "Very good" in the "Activity results" "block"
|
||||
And I should see "Good" in the "Activity results" "block"
|
||||
And I log out
|
||||
And I log in as "student1"
|
||||
And I follow "Course 1"
|
||||
And I should see "User S1" in the "Activity results" "block"
|
||||
And I should see "Excellent!" in the "Activity results" "block"
|
||||
And I should see "User S2" in the "Activity results" "block"
|
||||
And I should see "Very good" in the "Activity results" "block"
|
||||
|
||||
Scenario: Try to configure the block on the course page to show multiple high scores using anonymous names
|
||||
Given I add the "Activity results" block
|
||||
When I configure the "Activity results" block
|
||||
And I set the following fields to these values:
|
||||
| id_config_showbest | 3 |
|
||||
| id_config_showworst | 0 |
|
||||
| id_config_nameformat | Anonymous results |
|
||||
| id_config_usegroups | Yes |
|
||||
And I press "Save changes"
|
||||
Then I should see "Group" in the "Activity results" "block"
|
||||
And I should see "Excellent!" in the "Activity results" "block"
|
||||
And I should see "Very good" in the "Activity results" "block"
|
||||
And I should see "Good" in the "Activity results" "block"
|
||||
And I log out
|
||||
And I log in as "student1"
|
||||
And I follow "Course 1"
|
||||
And I should see "User" in the "Activity results" "block"
|
||||
And I should see "Excellent!" in the "Activity results" "block"
|
||||
And I should see "Very good" in the "Activity results" "block"
|
||||
@@ -33,19 +33,15 @@ Feature: The activity results block displays student scores
|
||||
| student4 | C1 | student |
|
||||
| student5 | C1 | student |
|
||||
| student6 | C1 | student |
|
||||
|
||||
@javascript
|
||||
Scenario: Configure the block on the course page to show 1 high score
|
||||
Given I log in as "teacher1"
|
||||
And I follow "Course 1"
|
||||
And I expand "Users" node
|
||||
And I follow "Groups"
|
||||
And I add "Student 1 (student1@example.com)" user to "Group 1" group members
|
||||
And I add "Student 2 (student2@example.com)" user to "Group 1" group members
|
||||
And I add "Student 3 (student3@example.com)" user to "Group 2" group members
|
||||
And I add "Student 4 (student4@example.com)" user to "Group 2" group members
|
||||
And I add "Student 5 (student5@example.com)" user to "Group 3" group members
|
||||
And I add "Student 6 (student6@example.com)" user to "Group 3" group members
|
||||
And the following "group members" exist:
|
||||
| user | group |
|
||||
| student1 | G1 |
|
||||
| student2 | G1 |
|
||||
| student3 | G2 |
|
||||
| student4 | G2 |
|
||||
| student5 | G3 |
|
||||
| student6 | G3 |
|
||||
And I log in as "teacher1"
|
||||
And I follow "Course 1"
|
||||
And I turn editing mode on
|
||||
And I add a "Assignment" to section "1" and I fill the form with:
|
||||
@@ -64,7 +60,9 @@ Feature: The activity results block displays student scores
|
||||
And I give the grade "70.00" to the user "Student 6" for the grade item "Test assignment"
|
||||
And I press "Save changes"
|
||||
And I follow "Course 1"
|
||||
And I add the "Activity results" block
|
||||
|
||||
Scenario: Configure the block on the course page to show 1 high score
|
||||
Given I add the "Activity results" block
|
||||
When I configure the "Activity results" block
|
||||
And I set the following fields to these values:
|
||||
| id_config_showbest | 1 |
|
||||
@@ -77,37 +75,8 @@ Feature: The activity results block displays student scores
|
||||
Then I should see "Group 1" in the "Activity results" "block"
|
||||
And I should see "95%" in the "Activity results" "block"
|
||||
|
||||
@javascript
|
||||
Scenario: Try to configure the block on the course page to show 1 high score as a fraction
|
||||
Given I log in as "teacher1"
|
||||
And I follow "Course 1"
|
||||
And I expand "Users" node
|
||||
And I follow "Groups"
|
||||
And I add "Student 1 (student1@example.com)" user to "Group 1" group members
|
||||
And I add "Student 2 (student2@example.com)" user to "Group 1" group members
|
||||
And I add "Student 3 (student3@example.com)" user to "Group 2" group members
|
||||
And I add "Student 4 (student4@example.com)" user to "Group 2" group members
|
||||
And I add "Student 5 (student5@example.com)" user to "Group 3" group members
|
||||
And I add "Student 6 (student6@example.com)" user to "Group 3" group members
|
||||
And I follow "Course 1"
|
||||
And I turn editing mode on
|
||||
And I add a "Assignment" to section "1" and I fill the form with:
|
||||
| Assignment name | Test assignment |
|
||||
| Description | Offline text |
|
||||
| assignsubmission_file_enabled | 0 |
|
||||
| Group mode | Separate groups |
|
||||
And I follow "Course 1"
|
||||
And I navigate to "Grades" node in "Course administration"
|
||||
And I turn editing mode on
|
||||
And I give the grade "100.00" to the user "Student 1" for the grade item "Test assignment"
|
||||
And I give the grade "90.00" to the user "Student 2" for the grade item "Test assignment"
|
||||
And I give the grade "90.00" to the user "Student 3" for the grade item "Test assignment"
|
||||
And I give the grade "80.00" to the user "Student 4" for the grade item "Test assignment"
|
||||
And I give the grade "80.00" to the user "Student 5" for the grade item "Test assignment"
|
||||
And I give the grade "70.00" to the user "Student 6" for the grade item "Test assignment"
|
||||
And I press "Save changes"
|
||||
And I follow "Course 1"
|
||||
And I add the "Activity results" block
|
||||
Given I add the "Activity results" block
|
||||
When I configure the "Activity results" block
|
||||
And I set the following fields to these values:
|
||||
| id_config_showbest | 1 |
|
||||
@@ -124,37 +93,8 @@ Feature: The activity results block displays student scores
|
||||
And I should see "Student 1" in the "Activity results" "block"
|
||||
And I should see "100.00/100.00" in the "Activity results" "block"
|
||||
|
||||
@javascript
|
||||
Scenario: Try to configure the block on the course page to show 1 high score as a absolute numbers
|
||||
Given I log in as "teacher1"
|
||||
And I follow "Course 1"
|
||||
And I expand "Users" node
|
||||
And I follow "Groups"
|
||||
And I add "Student 1 (student1@example.com)" user to "Group 1" group members
|
||||
And I add "Student 2 (student2@example.com)" user to "Group 1" group members
|
||||
And I add "Student 3 (student3@example.com)" user to "Group 2" group members
|
||||
And I add "Student 4 (student4@example.com)" user to "Group 2" group members
|
||||
And I add "Student 5 (student5@example.com)" user to "Group 3" group members
|
||||
And I add "Student 6 (student6@example.com)" user to "Group 3" group members
|
||||
And I follow "Course 1"
|
||||
And I turn editing mode on
|
||||
And I add a "Assignment" to section "1" and I fill the form with:
|
||||
| Assignment name | Test assignment |
|
||||
| Description | Offline text |
|
||||
| assignsubmission_file_enabled | 0 |
|
||||
| Group mode | Separate groups |
|
||||
And I follow "Course 1"
|
||||
And I navigate to "Grades" node in "Course administration"
|
||||
And I turn editing mode on
|
||||
And I give the grade "100.00" to the user "Student 1" for the grade item "Test assignment"
|
||||
And I give the grade "90.00" to the user "Student 2" for the grade item "Test assignment"
|
||||
And I give the grade "90.00" to the user "Student 3" for the grade item "Test assignment"
|
||||
And I give the grade "80.00" to the user "Student 4" for the grade item "Test assignment"
|
||||
And I give the grade "80.00" to the user "Student 5" for the grade item "Test assignment"
|
||||
And I give the grade "70.00" to the user "Student 6" for the grade item "Test assignment"
|
||||
And I press "Save changes"
|
||||
And I follow "Course 1"
|
||||
And I add the "Activity results" block
|
||||
Given I add the "Activity results" block
|
||||
When I configure the "Activity results" block
|
||||
And I set the following fields to these values:
|
||||
| id_config_showbest | 1 |
|
||||
@@ -171,37 +111,8 @@ Feature: The activity results block displays student scores
|
||||
And I should see "Student 1" in the "Activity results" "block"
|
||||
And I should see "100.00" in the "Activity results" "block"
|
||||
|
||||
@javascript
|
||||
Scenario: Try to configure the block on the course page to show multiple high scores as percentages
|
||||
Given I log in as "teacher1"
|
||||
And I follow "Course 1"
|
||||
And I expand "Users" node
|
||||
And I follow "Groups"
|
||||
And I add "Student 1 (student1@example.com)" user to "Group 1" group members
|
||||
And I add "Student 2 (student2@example.com)" user to "Group 1" group members
|
||||
And I add "Student 3 (student3@example.com)" user to "Group 2" group members
|
||||
And I add "Student 4 (student4@example.com)" user to "Group 2" group members
|
||||
And I add "Student 5 (student5@example.com)" user to "Group 3" group members
|
||||
And I add "Student 6 (student6@example.com)" user to "Group 3" group members
|
||||
And I follow "Course 1"
|
||||
And I turn editing mode on
|
||||
And I add a "Assignment" to section "1" and I fill the form with:
|
||||
| Assignment name | Test assignment |
|
||||
| Description | Offline text |
|
||||
| assignsubmission_file_enabled | 0 |
|
||||
| Group mode | Separate groups |
|
||||
And I follow "Course 1"
|
||||
And I navigate to "Grades" node in "Course administration"
|
||||
And I turn editing mode on
|
||||
And I give the grade "100.00" to the user "Student 1" for the grade item "Test assignment"
|
||||
And I give the grade "90.00" to the user "Student 2" for the grade item "Test assignment"
|
||||
And I give the grade "90.00" to the user "Student 3" for the grade item "Test assignment"
|
||||
And I give the grade "80.00" to the user "Student 4" for the grade item "Test assignment"
|
||||
And I give the grade "80.00" to the user "Student 5" for the grade item "Test assignment"
|
||||
And I give the grade "70.00" to the user "Student 6" for the grade item "Test assignment"
|
||||
And I press "Save changes"
|
||||
And I follow "Course 1"
|
||||
And I add the "Activity results" block
|
||||
Given I add the "Activity results" block
|
||||
When I configure the "Activity results" block
|
||||
And I set the following fields to these values:
|
||||
| id_config_showbest | 3 |
|
||||
@@ -225,37 +136,8 @@ Feature: The activity results block displays student scores
|
||||
And I should see "Student 2" in the "Activity results" "block"
|
||||
And I should see "90%" in the "Activity results" "block"
|
||||
|
||||
@javascript
|
||||
Scenario: Try to configure the block on the course page to show multiple high scores as fractions
|
||||
Given I log in as "teacher1"
|
||||
And I follow "Course 1"
|
||||
And I expand "Users" node
|
||||
And I follow "Groups"
|
||||
And I add "Student 1 (student1@example.com)" user to "Group 1" group members
|
||||
And I add "Student 2 (student2@example.com)" user to "Group 1" group members
|
||||
And I add "Student 3 (student3@example.com)" user to "Group 2" group members
|
||||
And I add "Student 4 (student4@example.com)" user to "Group 2" group members
|
||||
And I add "Student 5 (student5@example.com)" user to "Group 3" group members
|
||||
And I add "Student 6 (student6@example.com)" user to "Group 3" group members
|
||||
And I follow "Course 1"
|
||||
And I turn editing mode on
|
||||
And I add a "Assignment" to section "1" and I fill the form with:
|
||||
| Assignment name | Test assignment |
|
||||
| Description | Offline text |
|
||||
| assignsubmission_file_enabled | 0 |
|
||||
| Group mode | Separate groups |
|
||||
And I follow "Course 1"
|
||||
And I navigate to "Grades" node in "Course administration"
|
||||
And I turn editing mode on
|
||||
And I give the grade "100.00" to the user "Student 1" for the grade item "Test assignment"
|
||||
And I give the grade "90.00" to the user "Student 2" for the grade item "Test assignment"
|
||||
And I give the grade "90.00" to the user "Student 3" for the grade item "Test assignment"
|
||||
And I give the grade "80.00" to the user "Student 4" for the grade item "Test assignment"
|
||||
And I give the grade "80.00" to the user "Student 5" for the grade item "Test assignment"
|
||||
And I give the grade "70.00" to the user "Student 6" for the grade item "Test assignment"
|
||||
And I press "Save changes"
|
||||
And I follow "Course 1"
|
||||
And I add the "Activity results" block
|
||||
Given I add the "Activity results" block
|
||||
When I configure the "Activity results" block
|
||||
And I set the following fields to these values:
|
||||
| id_config_showbest | 3 |
|
||||
@@ -278,37 +160,8 @@ Feature: The activity results block displays student scores
|
||||
And I should see "Student 4" in the "Activity results" "block"
|
||||
And I should see "80.00/100.00" in the "Activity results" "block"
|
||||
|
||||
@javascript
|
||||
Scenario: Try to configure the block on the course page to show multiple high scores as absolute numbers
|
||||
Given I log in as "teacher1"
|
||||
And I follow "Course 1"
|
||||
And I expand "Users" node
|
||||
And I follow "Groups"
|
||||
And I add "Student 1 (student1@example.com)" user to "Group 1" group members
|
||||
And I add "Student 2 (student2@example.com)" user to "Group 1" group members
|
||||
And I add "Student 3 (student3@example.com)" user to "Group 2" group members
|
||||
And I add "Student 4 (student4@example.com)" user to "Group 2" group members
|
||||
And I add "Student 5 (student5@example.com)" user to "Group 3" group members
|
||||
And I add "Student 6 (student6@example.com)" user to "Group 3" group members
|
||||
And I follow "Course 1"
|
||||
And I turn editing mode on
|
||||
And I add a "Assignment" to section "1" and I fill the form with:
|
||||
| Assignment name | Test assignment |
|
||||
| Description | Offline text |
|
||||
| assignsubmission_file_enabled | 0 |
|
||||
| Group mode | Separate groups |
|
||||
And I follow "Course 1"
|
||||
And I navigate to "Grades" node in "Course administration"
|
||||
And I turn editing mode on
|
||||
And I give the grade "100.00" to the user "Student 1" for the grade item "Test assignment"
|
||||
And I give the grade "90.00" to the user "Student 2" for the grade item "Test assignment"
|
||||
And I give the grade "90.00" to the user "Student 3" for the grade item "Test assignment"
|
||||
And I give the grade "80.00" to the user "Student 4" for the grade item "Test assignment"
|
||||
And I give the grade "80.00" to the user "Student 5" for the grade item "Test assignment"
|
||||
And I give the grade "70.00" to the user "Student 6" for the grade item "Test assignment"
|
||||
And I press "Save changes"
|
||||
And I follow "Course 1"
|
||||
And I add the "Activity results" block
|
||||
Given I add the "Activity results" block
|
||||
When I configure the "Activity results" block
|
||||
And I set the following fields to these values:
|
||||
| id_config_showbest | 3 |
|
||||
@@ -331,37 +184,8 @@ Feature: The activity results block displays student scores
|
||||
And I should see "Student 2" in the "Activity results" "block"
|
||||
And I should see "90.00" in the "Activity results" "block"
|
||||
|
||||
@javascript
|
||||
Scenario: Try to configure the block on the course page to show multiple high scores using ID numbers
|
||||
Given I log in as "teacher1"
|
||||
And I follow "Course 1"
|
||||
And I expand "Users" node
|
||||
And I follow "Groups"
|
||||
And I add "Student 1 (student1@example.com)" user to "Group 1" group members
|
||||
And I add "Student 2 (student2@example.com)" user to "Group 1" group members
|
||||
And I add "Student 3 (student3@example.com)" user to "Group 2" group members
|
||||
And I add "Student 4 (student4@example.com)" user to "Group 2" group members
|
||||
And I add "Student 5 (student5@example.com)" user to "Group 3" group members
|
||||
And I add "Student 6 (student6@example.com)" user to "Group 3" group members
|
||||
And I follow "Course 1"
|
||||
And I turn editing mode on
|
||||
And I add a "Assignment" to section "1" and I fill the form with:
|
||||
| Assignment name | Test assignment |
|
||||
| Description | Offline text |
|
||||
| assignsubmission_file_enabled | 0 |
|
||||
| Group mode | Separate groups |
|
||||
And I follow "Course 1"
|
||||
And I navigate to "Grades" node in "Course administration"
|
||||
And I turn editing mode on
|
||||
And I give the grade "100.00" to the user "Student 1" for the grade item "Test assignment"
|
||||
And I give the grade "90.00" to the user "Student 2" for the grade item "Test assignment"
|
||||
And I give the grade "90.00" to the user "Student 3" for the grade item "Test assignment"
|
||||
And I give the grade "80.00" to the user "Student 4" for the grade item "Test assignment"
|
||||
And I give the grade "80.00" to the user "Student 5" for the grade item "Test assignment"
|
||||
And I give the grade "70.00" to the user "Student 6" for the grade item "Test assignment"
|
||||
And I press "Save changes"
|
||||
And I follow "Course 1"
|
||||
And I add the "Activity results" block
|
||||
Given I add the "Activity results" block
|
||||
When I configure the "Activity results" block
|
||||
And I set the following fields to these values:
|
||||
| id_config_showbest | 3 |
|
||||
@@ -382,37 +206,8 @@ Feature: The activity results block displays student scores
|
||||
And I should see "User S2" in the "Activity results" "block"
|
||||
And I should see "90.00%" in the "Activity results" "block"
|
||||
|
||||
@javascript
|
||||
Scenario: Try to configure the block on the course page to show multiple high scores using anonymous names
|
||||
Given I log in as "teacher1"
|
||||
And I follow "Course 1"
|
||||
And I expand "Users" node
|
||||
And I follow "Groups"
|
||||
And I add "Student 1 (student1@example.com)" user to "Group 1" group members
|
||||
And I add "Student 2 (student2@example.com)" user to "Group 1" group members
|
||||
And I add "Student 3 (student3@example.com)" user to "Group 2" group members
|
||||
And I add "Student 4 (student4@example.com)" user to "Group 2" group members
|
||||
And I add "Student 5 (student5@example.com)" user to "Group 3" group members
|
||||
And I add "Student 6 (student6@example.com)" user to "Group 3" group members
|
||||
And I follow "Course 1"
|
||||
And I turn editing mode on
|
||||
And I add a "Assignment" to section "1" and I fill the form with:
|
||||
| Assignment name | Test assignment |
|
||||
| Description | Offline text |
|
||||
| assignsubmission_file_enabled | 0 |
|
||||
| Group mode | Separate groups |
|
||||
And I follow "Course 1"
|
||||
And I navigate to "Grades" node in "Course administration"
|
||||
And I turn editing mode on
|
||||
And I give the grade "100.00" to the user "Student 1" for the grade item "Test assignment"
|
||||
And I give the grade "90.00" to the user "Student 2" for the grade item "Test assignment"
|
||||
And I give the grade "90.00" to the user "Student 3" for the grade item "Test assignment"
|
||||
And I give the grade "80.00" to the user "Student 4" for the grade item "Test assignment"
|
||||
And I give the grade "80.00" to the user "Student 5" for the grade item "Test assignment"
|
||||
And I give the grade "70.00" to the user "Student 6" for the grade item "Test assignment"
|
||||
And I press "Save changes"
|
||||
And I follow "Course 1"
|
||||
And I add the "Activity results" block
|
||||
Given I add the "Activity results" block
|
||||
When I configure the "Activity results" block
|
||||
And I set the following fields to these values:
|
||||
| id_config_showbest | 3 |
|
||||
|
||||
@@ -33,19 +33,15 @@ Feature: The activity results block displays student scores
|
||||
| student4 | C1 | student |
|
||||
| student5 | C1 | student |
|
||||
| student6 | C1 | student |
|
||||
|
||||
@javascript
|
||||
Scenario: Configure the block on the course page to show 1 high score
|
||||
Given I log in as "teacher1"
|
||||
And I follow "Course 1"
|
||||
And I expand "Users" node
|
||||
And I follow "Groups"
|
||||
And I add "Student 1 (student1@example.com)" user to "Group 1" group members
|
||||
And I add "Student 2 (student2@example.com)" user to "Group 1" group members
|
||||
And I add "Student 3 (student3@example.com)" user to "Group 2" group members
|
||||
And I add "Student 4 (student4@example.com)" user to "Group 2" group members
|
||||
And I add "Student 5 (student5@example.com)" user to "Group 3" group members
|
||||
And I add "Student 6 (student6@example.com)" user to "Group 3" group members
|
||||
And the following "group members" exist:
|
||||
| user | group |
|
||||
| student1 | G1 |
|
||||
| student2 | G1 |
|
||||
| student3 | G2 |
|
||||
| student4 | G2 |
|
||||
| student5 | G3 |
|
||||
| student6 | G3 |
|
||||
And I log in as "teacher1"
|
||||
And I follow "Course 1"
|
||||
And I turn editing mode on
|
||||
And I add a "Assignment" to section "1" and I fill the form with:
|
||||
@@ -64,7 +60,9 @@ Feature: The activity results block displays student scores
|
||||
And I give the grade "70.00" to the user "Student 6" for the grade item "Test assignment"
|
||||
And I press "Save changes"
|
||||
And I follow "Course 1"
|
||||
And I add the "Activity results" block
|
||||
|
||||
Scenario: Configure the block on the course page to show 1 high score
|
||||
Given I add the "Activity results" block
|
||||
When I configure the "Activity results" block
|
||||
And I set the following fields to these values:
|
||||
| id_config_showbest | 1 |
|
||||
@@ -77,37 +75,8 @@ Feature: The activity results block displays student scores
|
||||
Then I should see "Group 1" in the "Activity results" "block"
|
||||
And I should see "95%" in the "Activity results" "block"
|
||||
|
||||
@javascript
|
||||
Scenario: Try to configure the block on the course page to show 1 high score as a fraction
|
||||
Given I log in as "teacher1"
|
||||
And I follow "Course 1"
|
||||
And I expand "Users" node
|
||||
And I follow "Groups"
|
||||
And I add "Student 1 (student1@example.com)" user to "Group 1" group members
|
||||
And I add "Student 2 (student2@example.com)" user to "Group 1" group members
|
||||
And I add "Student 3 (student3@example.com)" user to "Group 2" group members
|
||||
And I add "Student 4 (student4@example.com)" user to "Group 2" group members
|
||||
And I add "Student 5 (student5@example.com)" user to "Group 3" group members
|
||||
And I add "Student 6 (student6@example.com)" user to "Group 3" group members
|
||||
And I follow "Course 1"
|
||||
And I turn editing mode on
|
||||
And I add a "Assignment" to section "1" and I fill the form with:
|
||||
| Assignment name | Test assignment |
|
||||
| Description | Offline text |
|
||||
| assignsubmission_file_enabled | 0 |
|
||||
| Group mode | Visible groups |
|
||||
And I follow "Course 1"
|
||||
And I navigate to "Grades" node in "Course administration"
|
||||
And I turn editing mode on
|
||||
And I give the grade "100.00" to the user "Student 1" for the grade item "Test assignment"
|
||||
And I give the grade "90.00" to the user "Student 2" for the grade item "Test assignment"
|
||||
And I give the grade "90.00" to the user "Student 3" for the grade item "Test assignment"
|
||||
And I give the grade "80.00" to the user "Student 4" for the grade item "Test assignment"
|
||||
And I give the grade "80.00" to the user "Student 5" for the grade item "Test assignment"
|
||||
And I give the grade "70.00" to the user "Student 6" for the grade item "Test assignment"
|
||||
And I press "Save changes"
|
||||
And I follow "Course 1"
|
||||
And I add the "Activity results" block
|
||||
Given I add the "Activity results" block
|
||||
When I configure the "Activity results" block
|
||||
And I set the following fields to these values:
|
||||
| id_config_showbest | 1 |
|
||||
@@ -122,37 +91,8 @@ Feature: The activity results block displays student scores
|
||||
And I should see "Group 1" in the "Activity results" "block"
|
||||
And I should see "95.00/100.00" in the "Activity results" "block"
|
||||
|
||||
@javascript
|
||||
Scenario: Try to configure the block on the course page to show 1 high score as a absolute numbers
|
||||
Given I log in as "teacher1"
|
||||
And I follow "Course 1"
|
||||
And I expand "Users" node
|
||||
And I follow "Groups"
|
||||
And I add "Student 1 (student1@example.com)" user to "Group 1" group members
|
||||
And I add "Student 2 (student2@example.com)" user to "Group 1" group members
|
||||
And I add "Student 3 (student3@example.com)" user to "Group 2" group members
|
||||
And I add "Student 4 (student4@example.com)" user to "Group 2" group members
|
||||
And I add "Student 5 (student5@example.com)" user to "Group 3" group members
|
||||
And I add "Student 6 (student6@example.com)" user to "Group 3" group members
|
||||
And I follow "Course 1"
|
||||
And I turn editing mode on
|
||||
And I add a "Assignment" to section "1" and I fill the form with:
|
||||
| Assignment name | Test assignment |
|
||||
| Description | Offline text |
|
||||
| assignsubmission_file_enabled | 0 |
|
||||
| Group mode | Visible groups |
|
||||
And I follow "Course 1"
|
||||
And I navigate to "Grades" node in "Course administration"
|
||||
And I turn editing mode on
|
||||
And I give the grade "100.00" to the user "Student 1" for the grade item "Test assignment"
|
||||
And I give the grade "90.00" to the user "Student 2" for the grade item "Test assignment"
|
||||
And I give the grade "90.00" to the user "Student 3" for the grade item "Test assignment"
|
||||
And I give the grade "80.00" to the user "Student 4" for the grade item "Test assignment"
|
||||
And I give the grade "80.00" to the user "Student 5" for the grade item "Test assignment"
|
||||
And I give the grade "70.00" to the user "Student 6" for the grade item "Test assignment"
|
||||
And I press "Save changes"
|
||||
And I follow "Course 1"
|
||||
And I add the "Activity results" block
|
||||
Given I add the "Activity results" block
|
||||
When I configure the "Activity results" block
|
||||
And I set the following fields to these values:
|
||||
| id_config_showbest | 1 |
|
||||
@@ -167,37 +107,8 @@ Feature: The activity results block displays student scores
|
||||
And I should see "Group 1" in the "Activity results" "block"
|
||||
And I should see "95.00" in the "Activity results" "block"
|
||||
|
||||
@javascript
|
||||
Scenario: Try to configure the block on the course page to show multiple high scores as percentages
|
||||
Given I log in as "teacher1"
|
||||
And I follow "Course 1"
|
||||
And I expand "Users" node
|
||||
And I follow "Groups"
|
||||
And I add "Student 1 (student1@example.com)" user to "Group 1" group members
|
||||
And I add "Student 2 (student2@example.com)" user to "Group 1" group members
|
||||
And I add "Student 3 (student3@example.com)" user to "Group 2" group members
|
||||
And I add "Student 4 (student4@example.com)" user to "Group 2" group members
|
||||
And I add "Student 5 (student5@example.com)" user to "Group 3" group members
|
||||
And I add "Student 6 (student6@example.com)" user to "Group 3" group members
|
||||
And I follow "Course 1"
|
||||
And I turn editing mode on
|
||||
And I add a "Assignment" to section "1" and I fill the form with:
|
||||
| Assignment name | Test assignment |
|
||||
| Description | Offline text |
|
||||
| assignsubmission_file_enabled | 0 |
|
||||
| Group mode | Visible groups |
|
||||
And I follow "Course 1"
|
||||
And I navigate to "Grades" node in "Course administration"
|
||||
And I turn editing mode on
|
||||
And I give the grade "100.00" to the user "Student 1" for the grade item "Test assignment"
|
||||
And I give the grade "90.00" to the user "Student 2" for the grade item "Test assignment"
|
||||
And I give the grade "90.00" to the user "Student 3" for the grade item "Test assignment"
|
||||
And I give the grade "80.00" to the user "Student 4" for the grade item "Test assignment"
|
||||
And I give the grade "80.00" to the user "Student 5" for the grade item "Test assignment"
|
||||
And I give the grade "70.00" to the user "Student 6" for the grade item "Test assignment"
|
||||
And I press "Save changes"
|
||||
And I follow "Course 1"
|
||||
And I add the "Activity results" block
|
||||
Given I add the "Activity results" block
|
||||
When I configure the "Activity results" block
|
||||
And I set the following fields to these values:
|
||||
| id_config_showbest | 3 |
|
||||
@@ -217,37 +128,8 @@ Feature: The activity results block displays student scores
|
||||
And I should see "Group 3" in the "Activity results" "block"
|
||||
And I should see "75%" in the "Activity results" "block"
|
||||
|
||||
@javascript
|
||||
Scenario: Try to configure the block on the course page to show multiple high scores as fractions
|
||||
Given I log in as "teacher1"
|
||||
And I follow "Course 1"
|
||||
And I expand "Users" node
|
||||
And I follow "Groups"
|
||||
And I add "Student 1 (student1@example.com)" user to "Group 1" group members
|
||||
And I add "Student 2 (student2@example.com)" user to "Group 1" group members
|
||||
And I add "Student 3 (student3@example.com)" user to "Group 2" group members
|
||||
And I add "Student 4 (student4@example.com)" user to "Group 2" group members
|
||||
And I add "Student 5 (student5@example.com)" user to "Group 3" group members
|
||||
And I add "Student 6 (student6@example.com)" user to "Group 3" group members
|
||||
And I follow "Course 1"
|
||||
And I turn editing mode on
|
||||
And I add a "Assignment" to section "1" and I fill the form with:
|
||||
| Assignment name | Test assignment |
|
||||
| Description | Offline text |
|
||||
| assignsubmission_file_enabled | 0 |
|
||||
| Group mode | Visible groups |
|
||||
And I follow "Course 1"
|
||||
And I navigate to "Grades" node in "Course administration"
|
||||
And I turn editing mode on
|
||||
And I give the grade "100.00" to the user "Student 1" for the grade item "Test assignment"
|
||||
And I give the grade "90.00" to the user "Student 2" for the grade item "Test assignment"
|
||||
And I give the grade "90.00" to the user "Student 3" for the grade item "Test assignment"
|
||||
And I give the grade "80.00" to the user "Student 4" for the grade item "Test assignment"
|
||||
And I give the grade "80.00" to the user "Student 5" for the grade item "Test assignment"
|
||||
And I give the grade "70.00" to the user "Student 6" for the grade item "Test assignment"
|
||||
And I press "Save changes"
|
||||
And I follow "Course 1"
|
||||
And I add the "Activity results" block
|
||||
Given I add the "Activity results" block
|
||||
When I configure the "Activity results" block
|
||||
And I set the following fields to these values:
|
||||
| id_config_showbest | 3 |
|
||||
@@ -266,37 +148,8 @@ Feature: The activity results block displays student scores
|
||||
And I should see "Group 3" in the "Activity results" "block"
|
||||
And I should see "75.00/100.00" in the "Activity results" "block"
|
||||
|
||||
@javascript
|
||||
Scenario: Try to configure the block on the course page to show multiple high scores as absolute numbers
|
||||
Given I log in as "teacher1"
|
||||
And I follow "Course 1"
|
||||
And I expand "Users" node
|
||||
And I follow "Groups"
|
||||
And I add "Student 1 (student1@example.com)" user to "Group 1" group members
|
||||
And I add "Student 2 (student2@example.com)" user to "Group 1" group members
|
||||
And I add "Student 3 (student3@example.com)" user to "Group 2" group members
|
||||
And I add "Student 4 (student4@example.com)" user to "Group 2" group members
|
||||
And I add "Student 5 (student5@example.com)" user to "Group 3" group members
|
||||
And I add "Student 6 (student6@example.com)" user to "Group 3" group members
|
||||
And I follow "Course 1"
|
||||
And I turn editing mode on
|
||||
And I add a "Assignment" to section "1" and I fill the form with:
|
||||
| Assignment name | Test assignment |
|
||||
| Description | Offline text |
|
||||
| assignsubmission_file_enabled | 0 |
|
||||
| Group mode | Visible groups |
|
||||
And I follow "Course 1"
|
||||
And I navigate to "Grades" node in "Course administration"
|
||||
And I turn editing mode on
|
||||
And I give the grade "100.00" to the user "Student 1" for the grade item "Test assignment"
|
||||
And I give the grade "90.00" to the user "Student 2" for the grade item "Test assignment"
|
||||
And I give the grade "90.00" to the user "Student 3" for the grade item "Test assignment"
|
||||
And I give the grade "80.00" to the user "Student 4" for the grade item "Test assignment"
|
||||
And I give the grade "80.00" to the user "Student 5" for the grade item "Test assignment"
|
||||
And I give the grade "70.00" to the user "Student 6" for the grade item "Test assignment"
|
||||
And I press "Save changes"
|
||||
And I follow "Course 1"
|
||||
And I add the "Activity results" block
|
||||
Given I add the "Activity results" block
|
||||
When I configure the "Activity results" block
|
||||
And I set the following fields to these values:
|
||||
| id_config_showbest | 3 |
|
||||
@@ -315,37 +168,8 @@ Feature: The activity results block displays student scores
|
||||
And I should see "Group 3" in the "Activity results" "block"
|
||||
And I should see "75.00" in the "Activity results" "block"
|
||||
|
||||
@javascript
|
||||
Scenario: Try to configure the block on the course page to show multiple high scores using ID numbers
|
||||
Given I log in as "teacher1"
|
||||
And I follow "Course 1"
|
||||
And I expand "Users" node
|
||||
And I follow "Groups"
|
||||
And I add "Student 1 (student1@example.com)" user to "Group 1" group members
|
||||
And I add "Student 2 (student2@example.com)" user to "Group 1" group members
|
||||
And I add "Student 3 (student3@example.com)" user to "Group 2" group members
|
||||
And I add "Student 4 (student4@example.com)" user to "Group 2" group members
|
||||
And I add "Student 5 (student5@example.com)" user to "Group 3" group members
|
||||
And I add "Student 6 (student6@example.com)" user to "Group 3" group members
|
||||
And I follow "Course 1"
|
||||
And I turn editing mode on
|
||||
And I add a "Assignment" to section "1" and I fill the form with:
|
||||
| Assignment name | Test assignment |
|
||||
| Description | Offline text |
|
||||
| assignsubmission_file_enabled | 0 |
|
||||
| Group mode | Visible groups |
|
||||
And I follow "Course 1"
|
||||
And I navigate to "Grades" node in "Course administration"
|
||||
And I turn editing mode on
|
||||
And I give the grade "100.00" to the user "Student 1" for the grade item "Test assignment"
|
||||
And I give the grade "90.00" to the user "Student 2" for the grade item "Test assignment"
|
||||
And I give the grade "90.00" to the user "Student 3" for the grade item "Test assignment"
|
||||
And I give the grade "80.00" to the user "Student 4" for the grade item "Test assignment"
|
||||
And I give the grade "80.00" to the user "Student 5" for the grade item "Test assignment"
|
||||
And I give the grade "70.00" to the user "Student 6" for the grade item "Test assignment"
|
||||
And I press "Save changes"
|
||||
And I follow "Course 1"
|
||||
And I add the "Activity results" block
|
||||
Given I add the "Activity results" block
|
||||
When I configure the "Activity results" block
|
||||
And I set the following fields to these values:
|
||||
| id_config_showbest | 3 |
|
||||
@@ -362,37 +186,8 @@ Feature: The activity results block displays student scores
|
||||
And I should see "85.00%" in the "Activity results" "block"
|
||||
And I should see "75.00%" in the "Activity results" "block"
|
||||
|
||||
@javascript
|
||||
Scenario: Try to configure the block on the course page to show multiple high scores using anonymous names
|
||||
Given I log in as "teacher1"
|
||||
And I follow "Course 1"
|
||||
And I expand "Users" node
|
||||
And I follow "Groups"
|
||||
And I add "Student 1 (student1@example.com)" user to "Group 1" group members
|
||||
And I add "Student 2 (student2@example.com)" user to "Group 1" group members
|
||||
And I add "Student 3 (student3@example.com)" user to "Group 2" group members
|
||||
And I add "Student 4 (student4@example.com)" user to "Group 2" group members
|
||||
And I add "Student 5 (student5@example.com)" user to "Group 3" group members
|
||||
And I add "Student 6 (student6@example.com)" user to "Group 3" group members
|
||||
And I follow "Course 1"
|
||||
And I turn editing mode on
|
||||
And I add a "Assignment" to section "1" and I fill the form with:
|
||||
| Assignment name | Test assignment |
|
||||
| Description | Offline text |
|
||||
| assignsubmission_file_enabled | 0 |
|
||||
| Group mode | Visible groups |
|
||||
And I follow "Course 1"
|
||||
And I navigate to "Grades" node in "Course administration"
|
||||
And I turn editing mode on
|
||||
And I give the grade "100.00" to the user "Student 1" for the grade item "Test assignment"
|
||||
And I give the grade "90.00" to the user "Student 2" for the grade item "Test assignment"
|
||||
And I give the grade "90.00" to the user "Student 3" for the grade item "Test assignment"
|
||||
And I give the grade "80.00" to the user "Student 4" for the grade item "Test assignment"
|
||||
And I give the grade "80.00" to the user "Student 5" for the grade item "Test assignment"
|
||||
And I give the grade "70.00" to the user "Student 6" for the grade item "Test assignment"
|
||||
And I press "Save changes"
|
||||
And I follow "Course 1"
|
||||
And I add the "Activity results" block
|
||||
Given I add the "Activity results" block
|
||||
When I configure the "Activity results" block
|
||||
And I set the following fields to these values:
|
||||
| id_config_showbest | 3 |
|
||||
|
||||
@@ -0,0 +1,112 @@
|
||||
@block @block_activity_results
|
||||
Feature: The activity results block displays student scores as scales
|
||||
In order to be display student scores as scales
|
||||
As a user
|
||||
I need to see the activity results block
|
||||
|
||||
Background:
|
||||
Given the following "users" exist:
|
||||
| username | firstname | lastname | email | idnumber |
|
||||
| teacher1 | Teacher | 1 | teacher1@example.com | T1 |
|
||||
| student1 | Student | 1 | student1@example.com | S1 |
|
||||
| student2 | Student | 2 | student2@example.com | S2 |
|
||||
| student3 | Student | 3 | student3@example.com | S3 |
|
||||
| student4 | Student | 4 | student4@example.com | S4 |
|
||||
| student5 | Student | 5 | student5@example.com | S5 |
|
||||
And the following "courses" exist:
|
||||
| fullname | shortname | category |
|
||||
| Course 1 | C1 | 0 |
|
||||
And the following "course enrolments" exist:
|
||||
| user | course | role |
|
||||
| teacher1 | C1 | editingteacher |
|
||||
| student1 | C1 | student |
|
||||
| student2 | C1 | student |
|
||||
| student3 | C1 | student |
|
||||
| student4 | C1 | student |
|
||||
| student5 | C1 | student |
|
||||
And I log in as "teacher1"
|
||||
And I follow "Course 1"
|
||||
And I navigate to "Grades" node in "Course administration"
|
||||
And I navigate to "Scales" node in "Grade administration"
|
||||
And I press "Add a new scale"
|
||||
And I set the following fields to these values:
|
||||
| Name | My Scale |
|
||||
| Scale | Disappointing, Not good enough, Average, Good, Very good, Excellent! |
|
||||
And I press "Save changes"
|
||||
And I follow "Course 1"
|
||||
And I turn editing mode on
|
||||
And I add a "Assignment" to section "1" and I fill the form with:
|
||||
| Assignment name | Test assignment |
|
||||
| Description | Offline text |
|
||||
| assignsubmission_file_enabled | 0 |
|
||||
| id_modgrade_type | Scale |
|
||||
| id_modgrade_scale | My Scale |
|
||||
And I follow "Course 1"
|
||||
And I navigate to "Grades" node in "Course administration"
|
||||
And I turn editing mode on
|
||||
And I give the grade "Excellent!" to the user "Student 1" for the grade item "Test assignment"
|
||||
And I give the grade "Very good" to the user "Student 2" for the grade item "Test assignment"
|
||||
And I give the grade "Good" to the user "Student 3" for the grade item "Test assignment"
|
||||
And I give the grade "Average" to the user "Student 4" for the grade item "Test assignment"
|
||||
And I give the grade "Not good enough" to the user "Student 5" for the grade item "Test assignment"
|
||||
And I press "Save changes"
|
||||
And I follow "Course 1"
|
||||
|
||||
Scenario: Configure the block on the course page to show 1 low score
|
||||
Given I add the "Activity results" block
|
||||
When I configure the "Activity results" block
|
||||
And I set the following fields to these values:
|
||||
| id_config_showbest | 0 |
|
||||
| id_config_showworst | 1 |
|
||||
| id_config_gradeformat | Percentages |
|
||||
| id_config_nameformat | Display full names |
|
||||
| id_config_decimalpoints | 0 |
|
||||
And I press "Save changes"
|
||||
Then I should see "Student 5" in the "Activity results" "block"
|
||||
And I should see "Not good enough" in the "Activity results" "block"
|
||||
|
||||
Scenario: Try to configure the block on the course page to show multiple low scores using full names
|
||||
Given I add the "Activity results" block
|
||||
When I configure the "Activity results" block
|
||||
And I set the following fields to these values:
|
||||
| id_config_showbest | 0 |
|
||||
| id_config_showworst | 3 |
|
||||
| id_config_nameformat | Display full names |
|
||||
And I press "Save changes"
|
||||
Then I should see "Student 5" in the "Activity results" "block"
|
||||
And I should see "Not good enough" in the "Activity results" "block"
|
||||
And I should see "Student 4" in the "Activity results" "block"
|
||||
And I should see "Average" in the "Activity results" "block"
|
||||
And I should see "Student 3" in the "Activity results" "block"
|
||||
And I should see "Good" in the "Activity results" "block"
|
||||
|
||||
Scenario: Try to configure the block on the course page to show multiple low scores using ID numbers
|
||||
Given I add the "Activity results" block
|
||||
When I configure the "Activity results" block
|
||||
And I set the following fields to these values:
|
||||
| id_config_showbest | 0 |
|
||||
| id_config_showworst | 3 |
|
||||
| id_config_nameformat | Display only ID numbers |
|
||||
And I press "Save changes"
|
||||
Then I should see "User S5" in the "Activity results" "block"
|
||||
And I should see "Not good enough" in the "Activity results" "block"
|
||||
And I should see "User S4" in the "Activity results" "block"
|
||||
And I should see "Average" in the "Activity results" "block"
|
||||
And I should see "User S3" in the "Activity results" "block"
|
||||
And I should see "Good" in the "Activity results" "block"
|
||||
|
||||
Scenario: Try to configure the block on the course page to show multiple low scores using anonymous names
|
||||
Given I add the "Activity results" block
|
||||
When I configure the "Activity results" block
|
||||
And I set the following fields to these values:
|
||||
| id_config_showbest | 0 |
|
||||
| id_config_showworst | 3 |
|
||||
| id_config_nameformat | Anonymous results |
|
||||
And I press "Save changes"
|
||||
Then I should see "User" in the "Activity results" "block"
|
||||
And I should not see "Student 5" in the "Activity results" "block"
|
||||
And I should see "Not good enough" in the "Activity results" "block"
|
||||
And I should not see "Student 4" in the "Activity results" "block"
|
||||
And I should see "Average" in the "Activity results" "block"
|
||||
And I should not see "Student 3" in the "Activity results" "block"
|
||||
And I should see "Good" in the "Activity results" "block"
|
||||
@@ -0,0 +1,150 @@
|
||||
@block @block_activity_results
|
||||
Feature: The activity results block displays student scores as scales
|
||||
In order to be display student scores as scales
|
||||
As a user
|
||||
I need to see the activity results block
|
||||
|
||||
Background:
|
||||
Given the following "users" exist:
|
||||
| username | firstname | lastname | email | idnumber |
|
||||
| teacher1 | Teacher | 1 | teacher1@example.com | T1 |
|
||||
| student1 | Student | 1 | student1@example.com | S1 |
|
||||
| student2 | Student | 2 | student2@example.com | S2 |
|
||||
| student3 | Student | 3 | student3@example.com | S3 |
|
||||
| student4 | Student | 4 | student4@example.com | S4 |
|
||||
| student5 | Student | 5 | student5@example.com | S5 |
|
||||
| student6 | Student | 6 | student6@example.com | S6 |
|
||||
And the following "courses" exist:
|
||||
| fullname | shortname | category |
|
||||
| Course 1 | C1 | 0 |
|
||||
And the following "groups" exist:
|
||||
| name | course | idnumber |
|
||||
| Group 1 | C1 | G1 |
|
||||
| Group 2 | C1 | G2 |
|
||||
| Group 3 | C1 | G3 |
|
||||
| Group 4 | C1 | G4 |
|
||||
| Group 5 | C1 | G5 |
|
||||
And the following "course enrolments" exist:
|
||||
| user | course | role |
|
||||
| teacher1 | C1 | editingteacher |
|
||||
| student1 | C1 | student |
|
||||
| student2 | C1 | student |
|
||||
| student3 | C1 | student |
|
||||
| student4 | C1 | student |
|
||||
| student5 | C1 | student |
|
||||
| student6 | C1 | student |
|
||||
And the following "group members" exist:
|
||||
| user | group |
|
||||
| student1 | G1 |
|
||||
| student2 | G1 |
|
||||
| student3 | G2 |
|
||||
| student4 | G2 |
|
||||
| student5 | G3 |
|
||||
| student6 | G3 |
|
||||
And I log in as "teacher1"
|
||||
And I follow "Course 1"
|
||||
And I navigate to "Grades" node in "Course administration"
|
||||
And I navigate to "Scales" node in "Grade administration"
|
||||
And I press "Add a new scale"
|
||||
And I set the following fields to these values:
|
||||
| Name | My Scale |
|
||||
| Scale | Disappointing, Not good enough, Average, Good, Very good, Excellent! |
|
||||
And I press "Save changes"
|
||||
And I follow "Course 1"
|
||||
And I turn editing mode on
|
||||
And I add a "Assignment" to section "1" and I fill the form with:
|
||||
| Assignment name | Test assignment |
|
||||
| Description | Offline text |
|
||||
| assignsubmission_file_enabled | 0 |
|
||||
| id_modgrade_type | Scale |
|
||||
| id_modgrade_scale | My Scale |
|
||||
| Group mode | Separate groups |
|
||||
And I follow "Course 1"
|
||||
And I navigate to "Grades" node in "Course administration"
|
||||
And I turn editing mode on
|
||||
And I give the grade "Excellent!" to the user "Student 1" for the grade item "Test assignment"
|
||||
And I give the grade "Very good" to the user "Student 2" for the grade item "Test assignment"
|
||||
And I give the grade "Very good" to the user "Student 3" for the grade item "Test assignment"
|
||||
And I give the grade "Good" to the user "Student 4" for the grade item "Test assignment"
|
||||
And I give the grade "Good" to the user "Student 5" for the grade item "Test assignment"
|
||||
And I give the grade "Average" to the user "Student 6" for the grade item "Test assignment"
|
||||
And I press "Save changes"
|
||||
And I follow "Course 1"
|
||||
|
||||
Scenario: Try to configure the block on the course page to show 1 low score
|
||||
Given I add the "Activity results" block
|
||||
When I configure the "Activity results" block
|
||||
And I set the following fields to these values:
|
||||
| id_config_showbest | 0 |
|
||||
| id_config_showworst | 1 |
|
||||
| id_config_nameformat | Display full names |
|
||||
| id_config_usegroups | Yes |
|
||||
And I press "Save changes"
|
||||
Then I should see "Group 3" in the "Activity results" "block"
|
||||
And I should see "Good" in the "Activity results" "block"
|
||||
And I log out
|
||||
And I log in as "student5"
|
||||
And I follow "Course 1"
|
||||
And I should see "Student 6" in the "Activity results" "block"
|
||||
And I should see "Average" in the "Activity results" "block"
|
||||
|
||||
Scenario: Try to configure the block on the course page to show multiple high scores using full names
|
||||
Given I add the "Activity results" block
|
||||
When I configure the "Activity results" block
|
||||
And I set the following fields to these values:
|
||||
| id_config_showbest | 0 |
|
||||
| id_config_showworst | 2 |
|
||||
| id_config_nameformat | Display full names |
|
||||
| id_config_usegroups | Yes |
|
||||
And I press "Save changes"
|
||||
Then I should see "Group 2" in the "Activity results" "block"
|
||||
And I should see "Very good" in the "Activity results" "block"
|
||||
And I should see "Group 3" in the "Activity results" "block"
|
||||
And I should see "Good" in the "Activity results" "block"
|
||||
And I log out
|
||||
And I log in as "student3"
|
||||
And I follow "Course 1"
|
||||
And I should see "Student 3" in the "Activity results" "block"
|
||||
And I should see "Very good" in the "Activity results" "block"
|
||||
And I should see "Student 4" in the "Activity results" "block"
|
||||
And I should see "Good" in the "Activity results" "block"
|
||||
|
||||
Scenario: Try to configure the block on the course page to show multiple high scores using ID numbers
|
||||
Given I add the "Activity results" block
|
||||
When I configure the "Activity results" block
|
||||
And I set the following fields to these values:
|
||||
| id_config_showbest | 0 |
|
||||
| id_config_showworst | 2 |
|
||||
| id_config_nameformat | Display only ID numbers |
|
||||
| id_config_usegroups | Yes |
|
||||
And I press "Save changes"
|
||||
Then I should see "Group" in the "Activity results" "block"
|
||||
And I should see "Very good" in the "Activity results" "block"
|
||||
And I should see "Good" in the "Activity results" "block"
|
||||
And I log out
|
||||
And I log in as "student5"
|
||||
And I follow "Course 1"
|
||||
And I should see "User S5" in the "Activity results" "block"
|
||||
And I should see "Good" in the "Activity results" "block"
|
||||
And I should see "User S6" in the "Activity results" "block"
|
||||
And I should see "Average" in the "Activity results" "block"
|
||||
|
||||
Scenario: Try to configure the block on the course page to show multiple high scores using anonymous names
|
||||
Given I add the "Activity results" block
|
||||
When I configure the "Activity results" block
|
||||
And I set the following fields to these values:
|
||||
| id_config_showbest | 0 |
|
||||
| id_config_showworst | 2 |
|
||||
| id_config_nameformat | Anonymous results |
|
||||
| id_config_usegroups | Yes |
|
||||
And I press "Save changes"
|
||||
Then I should see "Group" in the "Activity results" "block"
|
||||
And I should see "Very good" in the "Activity results" "block"
|
||||
And I should see "Good" in the "Activity results" "block"
|
||||
And I log out
|
||||
And I log in as "student5"
|
||||
And I follow "Course 1"
|
||||
And I should see "User" in the "Activity results" "block"
|
||||
And I should see "Good" in the "Activity results" "block"
|
||||
And I should see "Average" in the "Activity results" "block"
|
||||
|
||||
@@ -33,19 +33,15 @@ Feature: The activity results block displays student scores
|
||||
| student4 | C1 | student |
|
||||
| student5 | C1 | student |
|
||||
| student6 | C1 | student |
|
||||
|
||||
@javascript
|
||||
Scenario: Configure the block on the course page to show 1 low score
|
||||
Given I log in as "teacher1"
|
||||
And I follow "Course 1"
|
||||
And I expand "Users" node
|
||||
And I follow "Groups"
|
||||
And I add "Student 1 (student1@example.com)" user to "Group 1" group members
|
||||
And I add "Student 2 (student2@example.com)" user to "Group 1" group members
|
||||
And I add "Student 3 (student3@example.com)" user to "Group 2" group members
|
||||
And I add "Student 4 (student4@example.com)" user to "Group 2" group members
|
||||
And I add "Student 5 (student5@example.com)" user to "Group 3" group members
|
||||
And I add "Student 6 (student6@example.com)" user to "Group 3" group members
|
||||
And the following "group members" exist:
|
||||
| user | group |
|
||||
| student1 | G1 |
|
||||
| student2 | G1 |
|
||||
| student3 | G2 |
|
||||
| student4 | G2 |
|
||||
| student5 | G3 |
|
||||
| student6 | G3 |
|
||||
And I log in as "teacher1"
|
||||
And I follow "Course 1"
|
||||
And I turn editing mode on
|
||||
And I add a "Assignment" to section "1" and I fill the form with:
|
||||
@@ -64,7 +60,9 @@ Feature: The activity results block displays student scores
|
||||
And I give the grade "70.00" to the user "Student 6" for the grade item "Test assignment"
|
||||
And I press "Save changes"
|
||||
And I follow "Course 1"
|
||||
And I add the "Activity results" block
|
||||
|
||||
Scenario: Configure the block on the course page to show 1 low score
|
||||
Given I add the "Activity results" block
|
||||
When I configure the "Activity results" block
|
||||
And I set the following fields to these values:
|
||||
| id_config_showbest | 0 |
|
||||
@@ -77,37 +75,8 @@ Feature: The activity results block displays student scores
|
||||
Then I should see "Group 3" in the "Activity results" "block"
|
||||
And I should see "75%" in the "Activity results" "block"
|
||||
|
||||
@javascript
|
||||
Scenario: Try to configure the block on the course page to show 1 low score as a fraction
|
||||
Given I log in as "teacher1"
|
||||
And I follow "Course 1"
|
||||
And I expand "Users" node
|
||||
And I follow "Groups"
|
||||
And I add "Student 1 (student1@example.com)" user to "Group 1" group members
|
||||
And I add "Student 2 (student2@example.com)" user to "Group 1" group members
|
||||
And I add "Student 3 (student3@example.com)" user to "Group 2" group members
|
||||
And I add "Student 4 (student4@example.com)" user to "Group 2" group members
|
||||
And I add "Student 5 (student5@example.com)" user to "Group 3" group members
|
||||
And I add "Student 6 (student6@example.com)" user to "Group 3" group members
|
||||
And I follow "Course 1"
|
||||
And I turn editing mode on
|
||||
And I add a "Assignment" to section "1" and I fill the form with:
|
||||
| Assignment name | Test assignment |
|
||||
| Description | Offline text |
|
||||
| assignsubmission_file_enabled | 0 |
|
||||
| Group mode | Separate groups |
|
||||
And I follow "Course 1"
|
||||
And I navigate to "Grades" node in "Course administration"
|
||||
And I turn editing mode on
|
||||
And I give the grade "100.00" to the user "Student 1" for the grade item "Test assignment"
|
||||
And I give the grade "90.00" to the user "Student 2" for the grade item "Test assignment"
|
||||
And I give the grade "90.00" to the user "Student 3" for the grade item "Test assignment"
|
||||
And I give the grade "80.00" to the user "Student 4" for the grade item "Test assignment"
|
||||
And I give the grade "80.00" to the user "Student 5" for the grade item "Test assignment"
|
||||
And I give the grade "70.00" to the user "Student 6" for the grade item "Test assignment"
|
||||
And I press "Save changes"
|
||||
And I follow "Course 1"
|
||||
And I add the "Activity results" block
|
||||
Given I add the "Activity results" block
|
||||
When I configure the "Activity results" block
|
||||
And I set the following fields to these values:
|
||||
| id_config_showbest | 0 |
|
||||
@@ -124,37 +93,8 @@ Feature: The activity results block displays student scores
|
||||
And I should see "Student 6" in the "Activity results" "block"
|
||||
And I should see "70.00/100.00" in the "Activity results" "block"
|
||||
|
||||
@javascript
|
||||
Scenario: Try to configure the block on the course page to show 1 low score as a absolute numbers
|
||||
Given I log in as "teacher1"
|
||||
And I follow "Course 1"
|
||||
And I expand "Users" node
|
||||
And I follow "Groups"
|
||||
And I add "Student 1 (student1@example.com)" user to "Group 1" group members
|
||||
And I add "Student 2 (student2@example.com)" user to "Group 1" group members
|
||||
And I add "Student 3 (student3@example.com)" user to "Group 2" group members
|
||||
And I add "Student 4 (student4@example.com)" user to "Group 2" group members
|
||||
And I add "Student 5 (student5@example.com)" user to "Group 3" group members
|
||||
And I add "Student 6 (student6@example.com)" user to "Group 3" group members
|
||||
And I follow "Course 1"
|
||||
And I turn editing mode on
|
||||
And I add a "Assignment" to section "1" and I fill the form with:
|
||||
| Assignment name | Test assignment |
|
||||
| Description | Offline text |
|
||||
| assignsubmission_file_enabled | 0 |
|
||||
| Group mode | Separate groups |
|
||||
And I follow "Course 1"
|
||||
And I navigate to "Grades" node in "Course administration"
|
||||
And I turn editing mode on
|
||||
And I give the grade "100.00" to the user "Student 1" for the grade item "Test assignment"
|
||||
And I give the grade "90.00" to the user "Student 2" for the grade item "Test assignment"
|
||||
And I give the grade "90.00" to the user "Student 3" for the grade item "Test assignment"
|
||||
And I give the grade "80.00" to the user "Student 4" for the grade item "Test assignment"
|
||||
And I give the grade "80.00" to the user "Student 5" for the grade item "Test assignment"
|
||||
And I give the grade "70.00" to the user "Student 6" for the grade item "Test assignment"
|
||||
And I press "Save changes"
|
||||
And I follow "Course 1"
|
||||
And I add the "Activity results" block
|
||||
Given I add the "Activity results" block
|
||||
When I configure the "Activity results" block
|
||||
And I set the following fields to these values:
|
||||
| id_config_showbest | 0 |
|
||||
@@ -171,37 +111,8 @@ Feature: The activity results block displays student scores
|
||||
And I should see "Student 6" in the "Activity results" "block"
|
||||
And I should see "70.00" in the "Activity results" "block"
|
||||
|
||||
@javascript
|
||||
Scenario: Try to configure the block on the course page to show multiple low scores as percentages
|
||||
Given I log in as "teacher1"
|
||||
And I follow "Course 1"
|
||||
And I expand "Users" node
|
||||
And I follow "Groups"
|
||||
And I add "Student 1 (student1@example.com)" user to "Group 1" group members
|
||||
And I add "Student 2 (student2@example.com)" user to "Group 1" group members
|
||||
And I add "Student 3 (student3@example.com)" user to "Group 2" group members
|
||||
And I add "Student 4 (student4@example.com)" user to "Group 2" group members
|
||||
And I add "Student 5 (student5@example.com)" user to "Group 3" group members
|
||||
And I add "Student 6 (student6@example.com)" user to "Group 3" group members
|
||||
And I follow "Course 1"
|
||||
And I turn editing mode on
|
||||
And I add a "Assignment" to section "1" and I fill the form with:
|
||||
| Assignment name | Test assignment |
|
||||
| Description | Offline text |
|
||||
| assignsubmission_file_enabled | 0 |
|
||||
| Group mode | Separate groups |
|
||||
And I follow "Course 1"
|
||||
And I navigate to "Grades" node in "Course administration"
|
||||
And I turn editing mode on
|
||||
And I give the grade "100.00" to the user "Student 1" for the grade item "Test assignment"
|
||||
And I give the grade "90.00" to the user "Student 2" for the grade item "Test assignment"
|
||||
And I give the grade "90.00" to the user "Student 3" for the grade item "Test assignment"
|
||||
And I give the grade "80.00" to the user "Student 4" for the grade item "Test assignment"
|
||||
And I give the grade "80.00" to the user "Student 5" for the grade item "Test assignment"
|
||||
And I give the grade "70.00" to the user "Student 6" for the grade item "Test assignment"
|
||||
And I press "Save changes"
|
||||
And I follow "Course 1"
|
||||
And I add the "Activity results" block
|
||||
Given I add the "Activity results" block
|
||||
When I configure the "Activity results" block
|
||||
And I set the following fields to these values:
|
||||
| id_config_showbest | 0 |
|
||||
@@ -223,37 +134,8 @@ Feature: The activity results block displays student scores
|
||||
And I should see "Student 5" in the "Activity results" "block"
|
||||
And I should see "80%" in the "Activity results" "block"
|
||||
|
||||
@javascript
|
||||
Scenario: Try to configure the block on the course page to show multiple low scores as fractions
|
||||
Given I log in as "teacher1"
|
||||
And I follow "Course 1"
|
||||
And I expand "Users" node
|
||||
And I follow "Groups"
|
||||
And I add "Student 1 (student1@example.com)" user to "Group 1" group members
|
||||
And I add "Student 2 (student2@example.com)" user to "Group 1" group members
|
||||
And I add "Student 3 (student3@example.com)" user to "Group 2" group members
|
||||
And I add "Student 4 (student4@example.com)" user to "Group 2" group members
|
||||
And I add "Student 5 (student5@example.com)" user to "Group 3" group members
|
||||
And I add "Student 6 (student6@example.com)" user to "Group 3" group members
|
||||
And I follow "Course 1"
|
||||
And I turn editing mode on
|
||||
And I add a "Assignment" to section "1" and I fill the form with:
|
||||
| Assignment name | Test assignment |
|
||||
| Description | Offline text |
|
||||
| assignsubmission_file_enabled | 0 |
|
||||
| Group mode | Separate groups |
|
||||
And I follow "Course 1"
|
||||
And I navigate to "Grades" node in "Course administration"
|
||||
And I turn editing mode on
|
||||
And I give the grade "100.00" to the user "Student 1" for the grade item "Test assignment"
|
||||
And I give the grade "90.00" to the user "Student 2" for the grade item "Test assignment"
|
||||
And I give the grade "90.00" to the user "Student 3" for the grade item "Test assignment"
|
||||
And I give the grade "80.00" to the user "Student 4" for the grade item "Test assignment"
|
||||
And I give the grade "80.00" to the user "Student 5" for the grade item "Test assignment"
|
||||
And I give the grade "70.00" to the user "Student 6" for the grade item "Test assignment"
|
||||
And I press "Save changes"
|
||||
And I follow "Course 1"
|
||||
And I add the "Activity results" block
|
||||
Given I add the "Activity results" block
|
||||
When I configure the "Activity results" block
|
||||
And I set the following fields to these values:
|
||||
| id_config_showbest | 0 |
|
||||
@@ -274,37 +156,8 @@ Feature: The activity results block displays student scores
|
||||
And I should see "Student 4" in the "Activity results" "block"
|
||||
And I should see "80.00/100.00" in the "Activity results" "block"
|
||||
|
||||
@javascript
|
||||
Scenario: Try to configure the block on the course page to show multiple low scores as absolute numbers
|
||||
Given I log in as "teacher1"
|
||||
And I follow "Course 1"
|
||||
And I expand "Users" node
|
||||
And I follow "Groups"
|
||||
And I add "Student 1 (student1@example.com)" user to "Group 1" group members
|
||||
And I add "Student 2 (student2@example.com)" user to "Group 1" group members
|
||||
And I add "Student 3 (student3@example.com)" user to "Group 2" group members
|
||||
And I add "Student 4 (student4@example.com)" user to "Group 2" group members
|
||||
And I add "Student 5 (student5@example.com)" user to "Group 3" group members
|
||||
And I add "Student 6 (student6@example.com)" user to "Group 3" group members
|
||||
And I follow "Course 1"
|
||||
And I turn editing mode on
|
||||
And I add a "Assignment" to section "1" and I fill the form with:
|
||||
| Assignment name | Test assignment |
|
||||
| Description | Offline text |
|
||||
| assignsubmission_file_enabled | 0 |
|
||||
| Group mode | Separate groups |
|
||||
And I follow "Course 1"
|
||||
And I navigate to "Grades" node in "Course administration"
|
||||
And I turn editing mode on
|
||||
And I give the grade "100.00" to the user "Student 1" for the grade item "Test assignment"
|
||||
And I give the grade "90.00" to the user "Student 2" for the grade item "Test assignment"
|
||||
And I give the grade "90.00" to the user "Student 3" for the grade item "Test assignment"
|
||||
And I give the grade "80.00" to the user "Student 4" for the grade item "Test assignment"
|
||||
And I give the grade "80.00" to the user "Student 5" for the grade item "Test assignment"
|
||||
And I give the grade "70.00" to the user "Student 6" for the grade item "Test assignment"
|
||||
And I press "Save changes"
|
||||
And I follow "Course 1"
|
||||
And I add the "Activity results" block
|
||||
Given I add the "Activity results" block
|
||||
When I configure the "Activity results" block
|
||||
And I set the following fields to these values:
|
||||
| id_config_showbest | 0 |
|
||||
@@ -325,37 +178,8 @@ Feature: The activity results block displays student scores
|
||||
And I should see "Student 6" in the "Activity results" "block"
|
||||
And I should see "70.00" in the "Activity results" "block"
|
||||
|
||||
@javascript
|
||||
Scenario: Try to configure the block on the course page to show multiple low scores using ID numbers
|
||||
Given I log in as "teacher1"
|
||||
And I follow "Course 1"
|
||||
And I expand "Users" node
|
||||
And I follow "Groups"
|
||||
And I add "Student 1 (student1@example.com)" user to "Group 1" group members
|
||||
And I add "Student 2 (student2@example.com)" user to "Group 1" group members
|
||||
And I add "Student 3 (student3@example.com)" user to "Group 2" group members
|
||||
And I add "Student 4 (student4@example.com)" user to "Group 2" group members
|
||||
And I add "Student 5 (student5@example.com)" user to "Group 3" group members
|
||||
And I add "Student 6 (student6@example.com)" user to "Group 3" group members
|
||||
And I follow "Course 1"
|
||||
And I turn editing mode on
|
||||
And I add a "Assignment" to section "1" and I fill the form with:
|
||||
| Assignment name | Test assignment |
|
||||
| Description | Offline text |
|
||||
| assignsubmission_file_enabled | 0 |
|
||||
| Group mode | Separate groups |
|
||||
And I follow "Course 1"
|
||||
And I navigate to "Grades" node in "Course administration"
|
||||
And I turn editing mode on
|
||||
And I give the grade "100.00" to the user "Student 1" for the grade item "Test assignment"
|
||||
And I give the grade "90.00" to the user "Student 2" for the grade item "Test assignment"
|
||||
And I give the grade "90.00" to the user "Student 3" for the grade item "Test assignment"
|
||||
And I give the grade "80.00" to the user "Student 4" for the grade item "Test assignment"
|
||||
And I give the grade "80.00" to the user "Student 5" for the grade item "Test assignment"
|
||||
And I give the grade "70.00" to the user "Student 6" for the grade item "Test assignment"
|
||||
And I press "Save changes"
|
||||
And I follow "Course 1"
|
||||
And I add the "Activity results" block
|
||||
Given I add the "Activity results" block
|
||||
When I configure the "Activity results" block
|
||||
And I set the following fields to these values:
|
||||
| id_config_showbest | 0 |
|
||||
@@ -375,37 +199,8 @@ Feature: The activity results block displays student scores
|
||||
And I should see "User S2" in the "Activity results" "block"
|
||||
And I should see "90.00%" in the "Activity results" "block"
|
||||
|
||||
@javascript
|
||||
Scenario: Try to configure the block on the course page to show multiple low scores using anonymous names
|
||||
Given I log in as "teacher1"
|
||||
And I follow "Course 1"
|
||||
And I expand "Users" node
|
||||
And I follow "Groups"
|
||||
And I add "Student 1 (student1@example.com)" user to "Group 1" group members
|
||||
And I add "Student 2 (student2@example.com)" user to "Group 1" group members
|
||||
And I add "Student 3 (student3@example.com)" user to "Group 2" group members
|
||||
And I add "Student 4 (student4@example.com)" user to "Group 2" group members
|
||||
And I add "Student 5 (student5@example.com)" user to "Group 3" group members
|
||||
And I add "Student 6 (student6@example.com)" user to "Group 3" group members
|
||||
And I follow "Course 1"
|
||||
And I turn editing mode on
|
||||
And I add a "Assignment" to section "1" and I fill the form with:
|
||||
| Assignment name | Test assignment |
|
||||
| Description | Offline text |
|
||||
| assignsubmission_file_enabled | 0 |
|
||||
| Group mode | Separate groups |
|
||||
And I follow "Course 1"
|
||||
And I navigate to "Grades" node in "Course administration"
|
||||
And I turn editing mode on
|
||||
And I give the grade "100.00" to the user "Student 1" for the grade item "Test assignment"
|
||||
And I give the grade "90.00" to the user "Student 2" for the grade item "Test assignment"
|
||||
And I give the grade "90.00" to the user "Student 3" for the grade item "Test assignment"
|
||||
And I give the grade "80.00" to the user "Student 4" for the grade item "Test assignment"
|
||||
And I give the grade "80.00" to the user "Student 5" for the grade item "Test assignment"
|
||||
And I give the grade "70.00" to the user "Student 6" for the grade item "Test assignment"
|
||||
And I press "Save changes"
|
||||
And I follow "Course 1"
|
||||
And I add the "Activity results" block
|
||||
Given I add the "Activity results" block
|
||||
When I configure the "Activity results" block
|
||||
And I set the following fields to these values:
|
||||
| id_config_showbest | 0 |
|
||||
|
||||
@@ -33,19 +33,15 @@ Feature: The activity results block displays student scores
|
||||
| student4 | C1 | student |
|
||||
| student5 | C1 | student |
|
||||
| student6 | C1 | student |
|
||||
|
||||
@javascript
|
||||
Scenario: Configure the block on the course page to show 1 low score
|
||||
Given I log in as "teacher1"
|
||||
And I follow "Course 1"
|
||||
And I expand "Users" node
|
||||
And I follow "Groups"
|
||||
And I add "Student 1 (student1@example.com)" user to "Group 1" group members
|
||||
And I add "Student 2 (student2@example.com)" user to "Group 1" group members
|
||||
And I add "Student 3 (student3@example.com)" user to "Group 2" group members
|
||||
And I add "Student 4 (student4@example.com)" user to "Group 2" group members
|
||||
And I add "Student 5 (student5@example.com)" user to "Group 3" group members
|
||||
And I add "Student 6 (student6@example.com)" user to "Group 3" group members
|
||||
And the following "group members" exist:
|
||||
| user | group |
|
||||
| student1 | G1 |
|
||||
| student2 | G1 |
|
||||
| student3 | G2 |
|
||||
| student4 | G2 |
|
||||
| student5 | G3 |
|
||||
| student6 | G3 |
|
||||
And I log in as "teacher1"
|
||||
And I follow "Course 1"
|
||||
And I turn editing mode on
|
||||
And I add a "Assignment" to section "1" and I fill the form with:
|
||||
@@ -64,7 +60,9 @@ Feature: The activity results block displays student scores
|
||||
And I give the grade "70.00" to the user "Student 6" for the grade item "Test assignment"
|
||||
And I press "Save changes"
|
||||
And I follow "Course 1"
|
||||
And I add the "Activity results" block
|
||||
|
||||
Scenario: Configure the block on the course page to show 1 low score
|
||||
Given I add the "Activity results" block
|
||||
When I configure the "Activity results" block
|
||||
And I set the following fields to these values:
|
||||
| id_config_showbest | 0 |
|
||||
@@ -77,37 +75,8 @@ Feature: The activity results block displays student scores
|
||||
Then I should see "Group 3" in the "Activity results" "block"
|
||||
And I should see "75%" in the "Activity results" "block"
|
||||
|
||||
@javascript
|
||||
Scenario: Try to configure the block on the course page to show 1 low score as a fraction
|
||||
Given I log in as "teacher1"
|
||||
And I follow "Course 1"
|
||||
And I expand "Users" node
|
||||
And I follow "Groups"
|
||||
And I add "Student 1 (student1@example.com)" user to "Group 1" group members
|
||||
And I add "Student 2 (student2@example.com)" user to "Group 1" group members
|
||||
And I add "Student 3 (student3@example.com)" user to "Group 2" group members
|
||||
And I add "Student 4 (student4@example.com)" user to "Group 2" group members
|
||||
And I add "Student 5 (student5@example.com)" user to "Group 3" group members
|
||||
And I add "Student 6 (student6@example.com)" user to "Group 3" group members
|
||||
And I follow "Course 1"
|
||||
And I turn editing mode on
|
||||
And I add a "Assignment" to section "1" and I fill the form with:
|
||||
| Assignment name | Test assignment |
|
||||
| Description | Offline text |
|
||||
| assignsubmission_file_enabled | 0 |
|
||||
| Group mode | Visible groups |
|
||||
And I follow "Course 1"
|
||||
And I navigate to "Grades" node in "Course administration"
|
||||
And I turn editing mode on
|
||||
And I give the grade "100.00" to the user "Student 1" for the grade item "Test assignment"
|
||||
And I give the grade "90.00" to the user "Student 2" for the grade item "Test assignment"
|
||||
And I give the grade "90.00" to the user "Student 3" for the grade item "Test assignment"
|
||||
And I give the grade "80.00" to the user "Student 4" for the grade item "Test assignment"
|
||||
And I give the grade "80.00" to the user "Student 5" for the grade item "Test assignment"
|
||||
And I give the grade "70.00" to the user "Student 6" for the grade item "Test assignment"
|
||||
And I press "Save changes"
|
||||
And I follow "Course 1"
|
||||
And I add the "Activity results" block
|
||||
Given I add the "Activity results" block
|
||||
When I configure the "Activity results" block
|
||||
And I set the following fields to these values:
|
||||
| id_config_showbest | 0 |
|
||||
@@ -122,37 +91,8 @@ Feature: The activity results block displays student scores
|
||||
And I should see "Group 3" in the "Activity results" "block"
|
||||
And I should see "75.00/100.00" in the "Activity results" "block"
|
||||
|
||||
@javascript
|
||||
Scenario: Try to configure the block on the course page to show 1 low score as a absolute numbers
|
||||
Given I log in as "teacher1"
|
||||
And I follow "Course 1"
|
||||
And I expand "Users" node
|
||||
And I follow "Groups"
|
||||
And I add "Student 1 (student1@example.com)" user to "Group 1" group members
|
||||
And I add "Student 2 (student2@example.com)" user to "Group 1" group members
|
||||
And I add "Student 3 (student3@example.com)" user to "Group 2" group members
|
||||
And I add "Student 4 (student4@example.com)" user to "Group 2" group members
|
||||
And I add "Student 5 (student5@example.com)" user to "Group 3" group members
|
||||
And I add "Student 6 (student6@example.com)" user to "Group 3" group members
|
||||
And I follow "Course 1"
|
||||
And I turn editing mode on
|
||||
And I add a "Assignment" to section "1" and I fill the form with:
|
||||
| Assignment name | Test assignment |
|
||||
| Description | Offline text |
|
||||
| assignsubmission_file_enabled | 0 |
|
||||
| Group mode | Visible groups |
|
||||
And I follow "Course 1"
|
||||
And I navigate to "Grades" node in "Course administration"
|
||||
And I turn editing mode on
|
||||
And I give the grade "100.00" to the user "Student 1" for the grade item "Test assignment"
|
||||
And I give the grade "90.00" to the user "Student 2" for the grade item "Test assignment"
|
||||
And I give the grade "90.00" to the user "Student 3" for the grade item "Test assignment"
|
||||
And I give the grade "80.00" to the user "Student 4" for the grade item "Test assignment"
|
||||
And I give the grade "80.00" to the user "Student 5" for the grade item "Test assignment"
|
||||
And I give the grade "70.00" to the user "Student 6" for the grade item "Test assignment"
|
||||
And I press "Save changes"
|
||||
And I follow "Course 1"
|
||||
And I add the "Activity results" block
|
||||
Given I add the "Activity results" block
|
||||
When I configure the "Activity results" block
|
||||
And I set the following fields to these values:
|
||||
| id_config_showbest | 0 |
|
||||
@@ -167,37 +107,8 @@ Feature: The activity results block displays student scores
|
||||
And I should see "Group 3" in the "Activity results" "block"
|
||||
And I should see "75.00" in the "Activity results" "block"
|
||||
|
||||
@javascript
|
||||
Scenario: Try to configure the block on the course page to show multiple low scores as percentages
|
||||
Given I log in as "teacher1"
|
||||
And I follow "Course 1"
|
||||
And I expand "Users" node
|
||||
And I follow "Groups"
|
||||
And I add "Student 1 (student1@example.com)" user to "Group 1" group members
|
||||
And I add "Student 2 (student2@example.com)" user to "Group 1" group members
|
||||
And I add "Student 3 (student3@example.com)" user to "Group 2" group members
|
||||
And I add "Student 4 (student4@example.com)" user to "Group 2" group members
|
||||
And I add "Student 5 (student5@example.com)" user to "Group 3" group members
|
||||
And I add "Student 6 (student6@example.com)" user to "Group 3" group members
|
||||
And I follow "Course 1"
|
||||
And I turn editing mode on
|
||||
And I add a "Assignment" to section "1" and I fill the form with:
|
||||
| Assignment name | Test assignment |
|
||||
| Description | Offline text |
|
||||
| assignsubmission_file_enabled | 0 |
|
||||
| Group mode | Visible groups |
|
||||
And I follow "Course 1"
|
||||
And I navigate to "Grades" node in "Course administration"
|
||||
And I turn editing mode on
|
||||
And I give the grade "100.00" to the user "Student 1" for the grade item "Test assignment"
|
||||
And I give the grade "90.00" to the user "Student 2" for the grade item "Test assignment"
|
||||
And I give the grade "90.00" to the user "Student 3" for the grade item "Test assignment"
|
||||
And I give the grade "80.00" to the user "Student 4" for the grade item "Test assignment"
|
||||
And I give the grade "80.00" to the user "Student 5" for the grade item "Test assignment"
|
||||
And I give the grade "70.00" to the user "Student 6" for the grade item "Test assignment"
|
||||
And I press "Save changes"
|
||||
And I follow "Course 1"
|
||||
And I add the "Activity results" block
|
||||
Given I add the "Activity results" block
|
||||
When I configure the "Activity results" block
|
||||
And I set the following fields to these values:
|
||||
| id_config_showbest | 0 |
|
||||
@@ -219,37 +130,8 @@ Feature: The activity results block displays student scores
|
||||
And I should see "Group 3" in the "Activity results" "block"
|
||||
And I should see "75%" in the "Activity results" "block"
|
||||
|
||||
@javascript
|
||||
Scenario: Try to configure the block on the course page to show multiple low scores as fractions
|
||||
Given I log in as "teacher1"
|
||||
And I follow "Course 1"
|
||||
And I expand "Users" node
|
||||
And I follow "Groups"
|
||||
And I add "Student 1 (student1@example.com)" user to "Group 1" group members
|
||||
And I add "Student 2 (student2@example.com)" user to "Group 1" group members
|
||||
And I add "Student 3 (student3@example.com)" user to "Group 2" group members
|
||||
And I add "Student 4 (student4@example.com)" user to "Group 2" group members
|
||||
And I add "Student 5 (student5@example.com)" user to "Group 3" group members
|
||||
And I add "Student 6 (student6@example.com)" user to "Group 3" group members
|
||||
And I follow "Course 1"
|
||||
And I turn editing mode on
|
||||
And I add a "Assignment" to section "1" and I fill the form with:
|
||||
| Assignment name | Test assignment |
|
||||
| Description | Offline text |
|
||||
| assignsubmission_file_enabled | 0 |
|
||||
| Group mode | Visible groups |
|
||||
And I follow "Course 1"
|
||||
And I navigate to "Grades" node in "Course administration"
|
||||
And I turn editing mode on
|
||||
And I give the grade "100.00" to the user "Student 1" for the grade item "Test assignment"
|
||||
And I give the grade "90.00" to the user "Student 2" for the grade item "Test assignment"
|
||||
And I give the grade "90.00" to the user "Student 3" for the grade item "Test assignment"
|
||||
And I give the grade "80.00" to the user "Student 4" for the grade item "Test assignment"
|
||||
And I give the grade "80.00" to the user "Student 5" for the grade item "Test assignment"
|
||||
And I give the grade "70.00" to the user "Student 6" for the grade item "Test assignment"
|
||||
And I press "Save changes"
|
||||
And I follow "Course 1"
|
||||
And I add the "Activity results" block
|
||||
Given I add the "Activity results" block
|
||||
When I configure the "Activity results" block
|
||||
And I set the following fields to these values:
|
||||
| id_config_showbest | 0 |
|
||||
@@ -266,37 +148,8 @@ Feature: The activity results block displays student scores
|
||||
And I should see "Group 3" in the "Activity results" "block"
|
||||
And I should see "75.00/100.00" in the "Activity results" "block"
|
||||
|
||||
@javascript
|
||||
Scenario: Try to configure the block on the course page to show multiple low scores as absolute numbers
|
||||
Given I log in as "teacher1"
|
||||
And I follow "Course 1"
|
||||
And I expand "Users" node
|
||||
And I follow "Groups"
|
||||
And I add "Student 1 (student1@example.com)" user to "Group 1" group members
|
||||
And I add "Student 2 (student2@example.com)" user to "Group 1" group members
|
||||
And I add "Student 3 (student3@example.com)" user to "Group 2" group members
|
||||
And I add "Student 4 (student4@example.com)" user to "Group 2" group members
|
||||
And I add "Student 5 (student5@example.com)" user to "Group 3" group members
|
||||
And I add "Student 6 (student6@example.com)" user to "Group 3" group members
|
||||
And I follow "Course 1"
|
||||
And I turn editing mode on
|
||||
And I add a "Assignment" to section "1" and I fill the form with:
|
||||
| Assignment name | Test assignment |
|
||||
| Description | Offline text |
|
||||
| assignsubmission_file_enabled | 0 |
|
||||
| Group mode | Visible groups |
|
||||
And I follow "Course 1"
|
||||
And I navigate to "Grades" node in "Course administration"
|
||||
And I turn editing mode on
|
||||
And I give the grade "100.00" to the user "Student 1" for the grade item "Test assignment"
|
||||
And I give the grade "90.00" to the user "Student 2" for the grade item "Test assignment"
|
||||
And I give the grade "90.00" to the user "Student 3" for the grade item "Test assignment"
|
||||
And I give the grade "80.00" to the user "Student 4" for the grade item "Test assignment"
|
||||
And I give the grade "80.00" to the user "Student 5" for the grade item "Test assignment"
|
||||
And I give the grade "70.00" to the user "Student 6" for the grade item "Test assignment"
|
||||
And I press "Save changes"
|
||||
And I follow "Course 1"
|
||||
And I add the "Activity results" block
|
||||
Given I add the "Activity results" block
|
||||
When I configure the "Activity results" block
|
||||
And I set the following fields to these values:
|
||||
| id_config_showbest | 0 |
|
||||
@@ -313,37 +166,8 @@ Feature: The activity results block displays student scores
|
||||
And I should see "Group 3" in the "Activity results" "block"
|
||||
And I should see "75.00" in the "Activity results" "block"
|
||||
|
||||
@javascript
|
||||
Scenario: Try to configure the block on the course page to show multiple low scores using ID numbers
|
||||
Given I log in as "teacher1"
|
||||
And I follow "Course 1"
|
||||
And I expand "Users" node
|
||||
And I follow "Groups"
|
||||
And I add "Student 1 (student1@example.com)" user to "Group 1" group members
|
||||
And I add "Student 2 (student2@example.com)" user to "Group 1" group members
|
||||
And I add "Student 3 (student3@example.com)" user to "Group 2" group members
|
||||
And I add "Student 4 (student4@example.com)" user to "Group 2" group members
|
||||
And I add "Student 5 (student5@example.com)" user to "Group 3" group members
|
||||
And I add "Student 6 (student6@example.com)" user to "Group 3" group members
|
||||
And I follow "Course 1"
|
||||
And I turn editing mode on
|
||||
And I add a "Assignment" to section "1" and I fill the form with:
|
||||
| Assignment name | Test assignment |
|
||||
| Description | Offline text |
|
||||
| assignsubmission_file_enabled | 0 |
|
||||
| Group mode | Visible groups |
|
||||
And I follow "Course 1"
|
||||
And I navigate to "Grades" node in "Course administration"
|
||||
And I turn editing mode on
|
||||
And I give the grade "100.00" to the user "Student 1" for the grade item "Test assignment"
|
||||
And I give the grade "90.00" to the user "Student 2" for the grade item "Test assignment"
|
||||
And I give the grade "90.00" to the user "Student 3" for the grade item "Test assignment"
|
||||
And I give the grade "80.00" to the user "Student 4" for the grade item "Test assignment"
|
||||
And I give the grade "80.00" to the user "Student 5" for the grade item "Test assignment"
|
||||
And I give the grade "70.00" to the user "Student 6" for the grade item "Test assignment"
|
||||
And I press "Save changes"
|
||||
And I follow "Course 1"
|
||||
And I add the "Activity results" block
|
||||
Given I add the "Activity results" block
|
||||
When I configure the "Activity results" block
|
||||
And I set the following fields to these values:
|
||||
| id_config_showbest | 0 |
|
||||
@@ -359,37 +183,8 @@ Feature: The activity results block displays student scores
|
||||
And I should see "85.00%" in the "Activity results" "block"
|
||||
And I should see "75.00%" in the "Activity results" "block"
|
||||
|
||||
@javascript
|
||||
Scenario: Try to configure the block on the course page to show multiple low scores using anonymous names
|
||||
Given I log in as "teacher1"
|
||||
And I follow "Course 1"
|
||||
And I expand "Users" node
|
||||
And I follow "Groups"
|
||||
And I add "Student 1 (student1@example.com)" user to "Group 1" group members
|
||||
And I add "Student 2 (student2@example.com)" user to "Group 1" group members
|
||||
And I add "Student 3 (student3@example.com)" user to "Group 2" group members
|
||||
And I add "Student 4 (student4@example.com)" user to "Group 2" group members
|
||||
And I add "Student 5 (student5@example.com)" user to "Group 3" group members
|
||||
And I add "Student 6 (student6@example.com)" user to "Group 3" group members
|
||||
And I follow "Course 1"
|
||||
And I turn editing mode on
|
||||
And I add a "Assignment" to section "1" and I fill the form with:
|
||||
| Assignment name | Test assignment |
|
||||
| Description | Offline text |
|
||||
| assignsubmission_file_enabled | 0 |
|
||||
| Group mode | Visible groups |
|
||||
And I follow "Course 1"
|
||||
And I navigate to "Grades" node in "Course administration"
|
||||
And I turn editing mode on
|
||||
And I give the grade "100.00" to the user "Student 1" for the grade item "Test assignment"
|
||||
And I give the grade "90.00" to the user "Student 2" for the grade item "Test assignment"
|
||||
And I give the grade "90.00" to the user "Student 3" for the grade item "Test assignment"
|
||||
And I give the grade "80.00" to the user "Student 4" for the grade item "Test assignment"
|
||||
And I give the grade "80.00" to the user "Student 5" for the grade item "Test assignment"
|
||||
And I give the grade "70.00" to the user "Student 6" for the grade item "Test assignment"
|
||||
And I press "Save changes"
|
||||
And I follow "Course 1"
|
||||
And I add the "Activity results" block
|
||||
Given I add the "Activity results" block
|
||||
When I configure the "Activity results" block
|
||||
And I set the following fields to these values:
|
||||
| id_config_showbest | 0 |
|
||||
|
||||
@@ -23,6 +23,12 @@
|
||||
*/
|
||||
|
||||
class block_course_summary extends block_base {
|
||||
|
||||
/**
|
||||
* @var bool Flag to indicate whether the header should be hidden or not.
|
||||
*/
|
||||
private $headerhidden = true;
|
||||
|
||||
function init() {
|
||||
$this->title = get_string('pluginname', 'block_course_summary');
|
||||
}
|
||||
@@ -32,8 +38,10 @@ class block_course_summary extends block_base {
|
||||
}
|
||||
|
||||
function specialization() {
|
||||
if($this->page->pagetype == PAGE_COURSE_VIEW && $this->page->course->id != SITEID) {
|
||||
// Page type starts with 'course-view' and the page's course ID is not equal to the site ID.
|
||||
if (strpos($this->page->pagetype, PAGE_COURSE_VIEW) === 0 && $this->page->course->id != SITEID) {
|
||||
$this->title = get_string('coursesummary', 'block_course_summary');
|
||||
$this->headerhidden = false;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -71,7 +79,7 @@ class block_course_summary extends block_base {
|
||||
}
|
||||
|
||||
function hide_header() {
|
||||
return true;
|
||||
return $this->headerhidden;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -25,19 +25,22 @@ Feature: Course summary block used in a course
|
||||
Scenario: Student can view course summary
|
||||
When I log in as "student1"
|
||||
And I follow "Course 1"
|
||||
Then "Course/site summary" "block" should exist
|
||||
And I should see "Proved the course summary block works!" in the "Course/site summary" "block"
|
||||
Then "Course summary" "block" should exist
|
||||
And I should see "Course summary" in the "Course summary" "block"
|
||||
And I should see "Proved the course summary block works!" in the "Course summary" "block"
|
||||
|
||||
Scenario: Teacher can see an edit icon when edit mode is on and follow it to the course edit page
|
||||
When I log in as "teacher1"
|
||||
And I follow "Course 1"
|
||||
And I turn editing mode on
|
||||
Then I should see "Proved the course summary block works!" in the "Course/site summary" "block"
|
||||
And I click on "Edit" "link" in the "Course/site summary" "block"
|
||||
Then I should see "Proved the course summary block works!" in the "Course summary" "block"
|
||||
And I should see "Course summary" in the "Course summary" "block"
|
||||
And I click on "Edit" "link" in the "Course summary" "block"
|
||||
Then I should see "Edit course settings" in the "h2" "css_element"
|
||||
|
||||
Scenario: Teacher can not see edit icon when edit mode is off
|
||||
When I log in as "teacher1"
|
||||
And I follow "Course 1"
|
||||
Then I should see "Proved the course summary block works!" in the "Course/site summary" "block"
|
||||
And "Edit" "link" should not exist in the "Course/site summary" "block"
|
||||
Then I should see "Proved the course summary block works!" in the "Course summary" "block"
|
||||
And I should see "Course summary" in the "Course summary" "block"
|
||||
And "Edit" "link" should not exist in the "Course summary" "block"
|
||||
|
||||
@@ -17,6 +17,7 @@ Feature: Course summary block used on the frontpage
|
||||
Scenario: Guest can view site summary
|
||||
When I am on site homepage
|
||||
Then "Course/site summary" "block" should exist
|
||||
And I should not see "Course summary" in the "Course/site summary" "block"
|
||||
And I should see "Proved the summary block works!" in the "Course/site summary" "block"
|
||||
|
||||
Scenario: Admin can see an edit icon when edit mode is on and follow it to the front page settings
|
||||
@@ -24,6 +25,7 @@ Feature: Course summary block used on the frontpage
|
||||
And I am on site homepage
|
||||
And I follow "Turn editing on"
|
||||
Then I should see "Proved the summary block works!" in the "Course/site summary" "block"
|
||||
And I should not see "Course summary" in the "Course/site summary" "block"
|
||||
And I click on "Edit" "link" in the "Course/site summary" "block"
|
||||
Then I should see "Front page settings" in the "h2" "css_element"
|
||||
|
||||
@@ -31,4 +33,5 @@ Feature: Course summary block used on the frontpage
|
||||
When I log in as "admin"
|
||||
And I am on site homepage
|
||||
Then I should see "Proved the summary block works!" in the "Course/site summary" "block"
|
||||
And I should not see "Course summary" in the "Course/site summary" "block"
|
||||
And "Edit" "link" should not exist in the "Course/site summary" "block"
|
||||
|
||||
@@ -84,14 +84,13 @@ class block_glossary_random extends block_base {
|
||||
$limitfrom = 0;
|
||||
$limitnum = 1;
|
||||
|
||||
$BROWSE = 'timemodified';
|
||||
$orderby = 'timemodified ASC';
|
||||
|
||||
switch ($this->config->type) {
|
||||
|
||||
case BGR_RANDOMLY:
|
||||
$i = rand(1,$numberofentries);
|
||||
$limitfrom = $i-1;
|
||||
$SORT = 'ASC';
|
||||
break;
|
||||
|
||||
case BGR_NEXTONE:
|
||||
@@ -104,11 +103,10 @@ class block_glossary_random extends block_base {
|
||||
$i = 1;
|
||||
}
|
||||
$limitfrom = $i-1;
|
||||
$SORT = 'ASC';
|
||||
break;
|
||||
|
||||
case BGR_NEXTALPHA:
|
||||
$BROWSE = 'concept';
|
||||
$orderby = 'concept ASC';
|
||||
if (isset($this->config->previous)) {
|
||||
$i = $this->config->previous + 1;
|
||||
} else {
|
||||
@@ -118,20 +116,19 @@ class block_glossary_random extends block_base {
|
||||
$i = 1;
|
||||
}
|
||||
$limitfrom = $i-1;
|
||||
$SORT = 'ASC';
|
||||
break;
|
||||
|
||||
default: // BGR_LASTMODIFIED
|
||||
$i = $numberofentries;
|
||||
$limitfrom = 0;
|
||||
$SORT = 'DESC';
|
||||
$orderby = 'timemodified DESC, id DESC';
|
||||
break;
|
||||
}
|
||||
|
||||
if ($entry = $DB->get_records_sql("SELECT id, concept, definition, definitionformat, definitiontrust
|
||||
FROM {glossary_entries}
|
||||
WHERE glossaryid = ? AND approved = 1
|
||||
ORDER BY $BROWSE $SORT", array($this->config->glossary), $limitfrom, $limitnum)) {
|
||||
ORDER BY $orderby", array($this->config->glossary), $limitfrom, $limitnum)) {
|
||||
|
||||
$entry = reset($entry);
|
||||
|
||||
|
||||
@@ -104,6 +104,23 @@ class block_html extends block_base {
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Copy any block-specific data when copying to a new block instance.
|
||||
* @param int $fromid the id number of the block instance to copy from
|
||||
* @return boolean
|
||||
*/
|
||||
public function instance_copy($fromid) {
|
||||
$fromcontext = context_block::instance($fromid);
|
||||
$fs = get_file_storage();
|
||||
// This extra check if file area is empty adds one query if it is not empty but saves several if it is.
|
||||
if (!$fs->is_area_empty($fromcontext->id, 'block_html', 'content', 0, false)) {
|
||||
$draftitemid = 0;
|
||||
file_prepare_draft_area($draftitemid, $fromcontext->id, 'block_html', 'content', 0, array('subdirs' => true));
|
||||
file_save_draft_area_files($draftitemid, $this->context->id, 'block_html', 'content', 0, array('subdirs' => true));
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
function content_is_trusted() {
|
||||
global $SCRIPT;
|
||||
|
||||
|
||||
@@ -133,7 +133,7 @@ class block_myprofile extends block_base {
|
||||
|
||||
if(!empty($this->config->display_phone2) && !empty($USER->phone2)) {
|
||||
$this->content->text .= '<div class="myprofileitem phone2">';
|
||||
$this->content->text .= get_string('phone').': ' . s($USER->phone2);
|
||||
$this->content->text .= get_string('phone2').': ' . s($USER->phone2);
|
||||
$this->content->text .= '</div>';
|
||||
}
|
||||
|
||||
|
||||
@@ -34,8 +34,8 @@ $string['display_skype'] = 'Display Skype';
|
||||
$string['display_yahoo'] = 'Display Yahoo';
|
||||
$string['display_aim'] = 'Display AIM';
|
||||
$string['display_msn'] = 'Display MSN';
|
||||
$string['display_phone1'] = 'Display phone number 1';
|
||||
$string['display_phone2'] = 'Display phone number 2';
|
||||
$string['display_phone1'] = 'Display phone';
|
||||
$string['display_phone2'] = 'Display mobile phone';
|
||||
$string['display_institution'] = 'Display institution';
|
||||
$string['display_address'] = 'Display address';
|
||||
$string['display_firstaccess'] = 'Display first access';
|
||||
|
||||
@@ -35,29 +35,4 @@ defined('MOODLE_INTERNAL') || die();
|
||||
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
|
||||
*/
|
||||
class block_online_users_generator extends testing_block_generator {
|
||||
|
||||
/**
|
||||
* Create new block instance
|
||||
* @param array|stdClass $record
|
||||
* @param array $options
|
||||
* @return stdClass activity record with extra cmid field
|
||||
*/
|
||||
public function create_instance($record = null, array $options = null) {
|
||||
global $DB, $CFG;
|
||||
require_once("$CFG->dirroot/mod/page/locallib.php");
|
||||
|
||||
$this->instancecount++;
|
||||
|
||||
$record = (object)(array)$record;
|
||||
$options = (array)$options;
|
||||
|
||||
$record = $this->prepare_record($record);
|
||||
|
||||
$id = $DB->insert_record('block_instances', $record);
|
||||
context_block::instance($id);
|
||||
|
||||
$instance = $DB->get_record('block_instances', array('id'=>$id), '*', MUST_EXIST);
|
||||
|
||||
return $instance;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -23,7 +23,7 @@
|
||||
*/
|
||||
|
||||
$string['anycategory'] = 'Any category';
|
||||
$string['apierror'] = 'The Youtube API key is not set. Contact your administrator.';
|
||||
$string['apierror'] = 'The YouTube API key is not set. Contact your administrator.';
|
||||
$string['apikey'] = 'API key';
|
||||
$string['apikeyinfo'] = 'Get a <a href="https://developers.google.com/youtube/v3/getting-started">Google API key</a> for your Moodle site.';
|
||||
$string['autosvehicles'] = 'Autos & Vehicles';
|
||||
@@ -42,7 +42,7 @@ $string['numberofvideos'] = 'Number of videos';
|
||||
$string['peopleblogs'] = 'People & Blogs';
|
||||
$string['petsanimals'] = 'Pets & Animals';
|
||||
$string['pluginname'] = 'YouTube';
|
||||
$string['requesterror'] = 'Data could not be obtained from the server. Contact your administrator if the problem persist.';
|
||||
$string['requesterror'] = 'Data could not be obtained from the server. Contact your administrator if the problem persists.';
|
||||
$string['scienceandtech'] = 'Science & Tech';
|
||||
$string['sports'] = 'Sports';
|
||||
$string['tag_youtube:addinstance'] = 'Add a new YouTube block';
|
||||
|
||||
@@ -30,6 +30,7 @@
|
||||
*/
|
||||
class block_tags_edit_form extends block_edit_form {
|
||||
protected function specific_definition($mform) {
|
||||
global $CFG;
|
||||
// Fields for editing HTML block title and contents.
|
||||
$mform->addElement('header', 'configheader', get_string('blocksettings', 'block'));
|
||||
|
||||
@@ -44,8 +45,10 @@ class block_tags_edit_form extends block_edit_form {
|
||||
$mform->addElement('select', 'config_numberoftags', get_string('numberoftags', 'blog'), $numberoftags);
|
||||
$mform->setDefault('config_numberoftags', 80);
|
||||
|
||||
$defaults = array('default'=>'default', 'official'=>'official', ''=>'both');
|
||||
$mform->addElement('select', 'config_tagtype', get_string('defaultdisplay', 'block_tags'), $defaults);
|
||||
$mform->setDefault('config_tagtype', '');
|
||||
if (!empty($CFG->block_tags_showcoursetags)) {
|
||||
$defaults = array('default'=>'default', 'official'=>'official', ''=>'both');
|
||||
$mform->addElement('select', 'config_tagtype', get_string('defaultdisplay', 'block_tags'), $defaults);
|
||||
$mform->setDefault('config_tagtype', '');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+9
-4
@@ -26,6 +26,7 @@
|
||||
require_once(dirname(dirname(__FILE__)).'/config.php');
|
||||
require_once('lib.php');
|
||||
require_once('locallib.php');
|
||||
require_once($CFG->dirroot .'/comment/lib.php');
|
||||
|
||||
$action = required_param('action', PARAM_ALPHA);
|
||||
$id = optional_param('entryid', 0, PARAM_INT);
|
||||
@@ -115,6 +116,9 @@ $output = $PAGE->get_renderer('blog');
|
||||
$strblogs = get_string('blogs', 'blog');
|
||||
|
||||
if ($action === 'delete') {
|
||||
// Init comment JS strings.
|
||||
comment::init();
|
||||
|
||||
if (empty($entry->id)) {
|
||||
print_error('wrongentryid', 'blog');
|
||||
}
|
||||
@@ -134,14 +138,15 @@ if ($action === 'delete') {
|
||||
$PAGE->set_heading($SITE->fullname);
|
||||
echo $OUTPUT->header();
|
||||
|
||||
echo $OUTPUT->confirm(get_string('blogdeleteconfirm', 'blog'),
|
||||
new moodle_url('edit.php', $optionsyes),
|
||||
new moodle_url('index.php', $optionsno));
|
||||
|
||||
echo '<br />';
|
||||
// Output the entry.
|
||||
$entry->prepare_render();
|
||||
echo $output->render($entry);
|
||||
|
||||
echo '<br />';
|
||||
echo $OUTPUT->confirm(get_string('blogdeleteconfirm', 'blog'),
|
||||
new moodle_url('edit.php', $optionsyes),
|
||||
new moodle_url('index.php', $optionsno));
|
||||
echo $OUTPUT->footer();
|
||||
die;
|
||||
}
|
||||
|
||||
+2
-2
@@ -63,9 +63,9 @@ if ($entryid and !isset($userid)) {
|
||||
$userid = $entry->userid;
|
||||
}
|
||||
|
||||
if (isset($userid) && !isset($courseid)) {
|
||||
if (isset($userid) && empty($courseid)) {
|
||||
$context = context_user::instance($userid);
|
||||
} else if (isset($courseid) && $courseid != SITEID) {
|
||||
} else if (!empty($courseid) && $courseid != SITEID) {
|
||||
$context = context_course::instance($courseid);
|
||||
} else {
|
||||
$context = context_system::instance();
|
||||
|
||||
@@ -0,0 +1,43 @@
|
||||
@core @core_blog
|
||||
Feature: Delete a blog entry
|
||||
In order to manage my blog entries
|
||||
As a user
|
||||
I need to be able to delete entries I no longer wish to appear
|
||||
|
||||
Background:
|
||||
Given the following "users" exist:
|
||||
| username | firstname | lastname | email |
|
||||
| testuser | Test | User | moodle@example.com |
|
||||
And I log in as "testuser"
|
||||
And I expand "Site pages" node
|
||||
And I follow "Site blogs"
|
||||
And I follow "Add a new entry"
|
||||
And I set the following fields to these values:
|
||||
| Entry title | Blog post one |
|
||||
| Blog entry body | User 1 blog post content |
|
||||
And I press "Save changes"
|
||||
And I follow "Add a new entry"
|
||||
And I set the following fields to these values:
|
||||
| Entry title | Blog post two |
|
||||
| Blog entry body | User 1 blog post content |
|
||||
And I press "Save changes"
|
||||
And I am on site homepage
|
||||
And I expand "Site pages" node
|
||||
And I follow "Site blogs"
|
||||
|
||||
Scenario: Delete blog post results in post deleted
|
||||
Given I follow "Blog post one"
|
||||
And I follow "Delete"
|
||||
And I should see "Delete this blog entry?"
|
||||
When I press "Continue"
|
||||
Then I should not see "Blog post one"
|
||||
And I should see "Blog post two"
|
||||
|
||||
Scenario: Delete confirmation screen works and allows cancel
|
||||
Given I follow "Blog post one"
|
||||
When I follow "Delete"
|
||||
Then I should see "Delete this blog entry?"
|
||||
And I press "Cancel"
|
||||
And I should see "Blog post one"
|
||||
And I should see "Blog post two"
|
||||
|
||||
@@ -30,7 +30,7 @@ require_once($CFG->dirroot . '/blog/lib.php');
|
||||
/**
|
||||
* Test functions that rely on the DB tables
|
||||
*/
|
||||
class core_bloglib_testcase extends advanced_testcase {
|
||||
class core_blog_lib_testcase extends advanced_testcase {
|
||||
|
||||
private $courseid;
|
||||
private $cmid;
|
||||
@@ -472,5 +472,73 @@ class core_bloglib_testcase extends advanced_testcase {
|
||||
$this->assertEquals($url, $event->get_url());
|
||||
$this->assertEventContextNotUsed($event);
|
||||
}
|
||||
|
||||
/**
|
||||
* Tests the core_blog_myprofile_navigation() function.
|
||||
*/
|
||||
public function test_core_blog_myprofile_navigation() {
|
||||
global $USER;
|
||||
|
||||
// Set up the test.
|
||||
$tree = new \core_user\output\myprofile\tree();
|
||||
$this->setAdminUser();
|
||||
$iscurrentuser = true;
|
||||
$course = null;
|
||||
|
||||
// Enable blogs.
|
||||
set_config('enableblogs', true);
|
||||
|
||||
// Check the node tree is correct.
|
||||
core_blog_myprofile_navigation($tree, $USER, $iscurrentuser, $course);
|
||||
$reflector = new ReflectionObject($tree);
|
||||
$nodes = $reflector->getProperty('nodes');
|
||||
$nodes->setAccessible(true);
|
||||
$this->assertArrayHasKey('blogs', $nodes->getValue($tree));
|
||||
}
|
||||
|
||||
/**
|
||||
* Tests the core_blog_myprofile_navigation() function as a guest.
|
||||
*/
|
||||
public function test_core_blog_myprofile_navigation_as_guest() {
|
||||
global $USER;
|
||||
|
||||
// Set up the test.
|
||||
$tree = new \core_user\output\myprofile\tree();
|
||||
$iscurrentuser = false;
|
||||
$course = null;
|
||||
|
||||
// Set user as guest.
|
||||
$this->setGuestUser();
|
||||
|
||||
// Check the node tree is correct.
|
||||
core_blog_myprofile_navigation($tree, $USER, $iscurrentuser, $course);
|
||||
$reflector = new ReflectionObject($tree);
|
||||
$nodes = $reflector->getProperty('nodes');
|
||||
$nodes->setAccessible(true);
|
||||
$this->assertArrayNotHasKey('blogs', $nodes->getValue($tree));
|
||||
}
|
||||
|
||||
/**
|
||||
* Tests the core_blog_myprofile_navigation() function when blogs are disabled.
|
||||
*/
|
||||
public function test_core_blog_myprofile_navigation_blogs_disabled() {
|
||||
global $USER;
|
||||
|
||||
// Set up the test.
|
||||
$tree = new \core_user\output\myprofile\tree();
|
||||
$this->setAdminUser();
|
||||
$iscurrentuser = false;
|
||||
$course = null;
|
||||
|
||||
// Disable blogs.
|
||||
set_config('enableblogs', false);
|
||||
|
||||
// Check the node tree is correct.
|
||||
core_blog_myprofile_navigation($tree, $USER, $iscurrentuser, $course);
|
||||
$reflector = new ReflectionObject($tree);
|
||||
$nodes = $reflector->getProperty('nodes');
|
||||
$nodes->setAccessible(true);
|
||||
$this->assertArrayNotHasKey('blogs', $nodes->getValue($tree));
|
||||
}
|
||||
}
|
||||
|
||||
Vendored
+6
-2
@@ -1270,7 +1270,9 @@ class cache_application extends cache implements cache_loader_with_locking {
|
||||
$this->delete_many($todelete);
|
||||
}
|
||||
// Set the time of the last invalidation.
|
||||
$this->set('lastinvalidation', cache::now());
|
||||
if ($purgeall || !empty($todelete)) {
|
||||
$this->set('lastinvalidation', cache::now());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1669,7 +1671,9 @@ class cache_session extends cache {
|
||||
$this->delete_many($todelete);
|
||||
}
|
||||
// Set the time of the last invalidation.
|
||||
$this->set('lastsessioninvalidation', cache::now());
|
||||
if ($purgeall || !empty($todelete)) {
|
||||
$this->set('lastsessioninvalidation', cache::now());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Vendored
+42
@@ -989,6 +989,48 @@ class core_cache_testcase extends advanced_testcase {
|
||||
));
|
||||
$cache = cache::make('phpunit', 'eventinvalidationtest');
|
||||
$this->assertFalse($cache->get('testkey1'));
|
||||
|
||||
// Test 3: Verify that an existing lastinvalidation cache file is updated when needed.
|
||||
|
||||
// Make a new cache class. This should should invalidate testkey2.
|
||||
$cache = cache::make('phpunit', 'eventinvalidationtest');
|
||||
// Timestamp should have updated to cache::now().
|
||||
$this->assertEquals(cache::now(), $cache->get('lastinvalidation'));
|
||||
|
||||
// Set testkey2 data.
|
||||
$cache->set('testkey2', 'test data 2');
|
||||
// Backdate the event invalidation time by 30 seconds.
|
||||
$invalidationcache = cache::make('core', 'eventinvalidation');
|
||||
$invalidationcache->set('crazyevent', array('testkey2' => cache::now() - 30));
|
||||
// Lastinvalidation should already be cache::now().
|
||||
$this->assertEquals(cache::now(), $cache->get('lastinvalidation'));
|
||||
// Set it to 15 seconds ago so that we know if it changes.
|
||||
$cache->set('lastinvalidation', cache::now() - 15);
|
||||
// Make a new cache class. This should not invalidate anything.
|
||||
cache_factory::instance()->reset_cache_instances();
|
||||
$cache = cache::make('phpunit', 'eventinvalidationtest');
|
||||
// Lastinvalidation shouldn't change since it was already newer than invalidation event.
|
||||
$this->assertEquals(cache::now() - 15, $cache->get('lastinvalidation'));
|
||||
|
||||
// Now set the event invalidation to newer than the lastinvalidation time.
|
||||
$invalidationcache->set('crazyevent', array('testkey2' => cache::now() - 5));
|
||||
// Make a new cache class. This should should invalidate testkey2.
|
||||
cache_factory::instance()->reset_cache_instances();
|
||||
$cache = cache::make('phpunit', 'eventinvalidationtest');
|
||||
// Lastinvalidation timestamp should have updated to cache::now().
|
||||
$this->assertEquals(cache::now(), $cache->get('lastinvalidation'));
|
||||
|
||||
// Now simulate a purge_by_event 5 seconds ago.
|
||||
$invalidationcache = cache::make('core', 'eventinvalidation');
|
||||
$invalidationcache->set('crazyevent', array('purged' => cache::now() - 5));
|
||||
// Set our lastinvalidation timestamp to 15 seconds ago.
|
||||
$cache->set('lastinvalidation', cache::now() - 15);
|
||||
// Make a new cache class. This should invalidate the cache.
|
||||
cache_factory::instance()->reset_cache_instances();
|
||||
$cache = cache::make('phpunit', 'eventinvalidationtest');
|
||||
// Lastinvalidation timestamp should have updated to cache::now().
|
||||
$this->assertEquals(cache::now(), $cache->get('lastinvalidation'));
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -189,10 +189,14 @@ foreach($events as $event) {
|
||||
$ev->add_property('class', 'PUBLIC'); // PUBLIC / PRIVATE / CONFIDENTIAL
|
||||
$ev->add_property('last-modified', Bennu::timestamp_to_datetime($event->timemodified));
|
||||
$ev->add_property('dtstamp', Bennu::timestamp_to_datetime()); // now
|
||||
$ev->add_property('dtstart', Bennu::timestamp_to_datetime($event->timestart)); // when event starts
|
||||
if ($event->timeduration > 0) {
|
||||
//dtend is better than duration, because it works in Microsoft Outlook and works better in Korganizer
|
||||
$ev->add_property('dtstart', Bennu::timestamp_to_datetime($event->timestart)); // when event starts.
|
||||
$ev->add_property('dtend', Bennu::timestamp_to_datetime($event->timestart + $event->timeduration));
|
||||
} else {
|
||||
// When no duration is present, ie an all day event, VALUE should be date instead of time and dtend = dtstart + 1 day.
|
||||
$ev->add_property('dtstart', Bennu::timestamp_to_date($event->timestart), array('value' => 'DATE')); // All day event.
|
||||
$ev->add_property('dtend', Bennu::timestamp_to_date($event->timestart + DAYSECS), array('value' => 'DATE')); // All day event.
|
||||
}
|
||||
if ($event->courseid != 0) {
|
||||
$coursecontext = context_course::instance($event->courseid);
|
||||
|
||||
@@ -173,6 +173,8 @@ class core_calendar_external extends external_api {
|
||||
|
||||
// Let us findout courses that we can return events from.
|
||||
if (!$hassystemcap) {
|
||||
$courses = enrol_get_my_courses('id');
|
||||
$courses = array_keys($courses);
|
||||
foreach ($params['events']['courseids'] as $id) {
|
||||
try {
|
||||
$context = context_course::instance($id);
|
||||
@@ -185,7 +187,6 @@ class core_calendar_external extends external_api {
|
||||
'warningcode' => 'nopermissions',
|
||||
'message' => 'No access rights in course context '.$e->getMessage().$e->getTraceAsString()
|
||||
);
|
||||
continue;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
|
||||
@@ -363,6 +363,13 @@ class core_calendar_externallib_testcase extends externallib_advanced_testcase {
|
||||
$events = external_api::clean_returnvalue(core_calendar_external::get_calendar_events_returns(), $events);
|
||||
$this->assertEquals(1, count($events['events'])); // site.
|
||||
$this->assertEquals(0, count($events['warnings']));
|
||||
|
||||
// Try getting a course event by its id.
|
||||
$paramevents = array ('eventids' => array($courseevent->id));
|
||||
$events = core_calendar_external::get_calendar_events($paramevents, $options);
|
||||
$events = external_api::clean_returnvalue(core_calendar_external::get_calendar_events_returns(), $events);
|
||||
$this->assertEquals(1, count($events['events']));
|
||||
$this->assertEquals(0, count($events['warnings']));
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -78,13 +78,8 @@ class core_calendar_lib_testcase extends advanced_testcase {
|
||||
global $CFG;
|
||||
require_once($CFG->dirroot . '/lib/cronlib.php');
|
||||
|
||||
// Moodle ICal URL (moodle.org events).
|
||||
$presetwhat = 'all';
|
||||
$presettime = 'recentupcoming';
|
||||
$userid = 1;
|
||||
$authtoken = 'a8bcfee2fb868a05357f650bd65dc0699b026524';
|
||||
$subscriptionurl = 'https://moodle.org/calendar/export_execute.php'
|
||||
. '?preset_what='.$presetwhat.'&preset_time='.$presettime.'&userid='.$userid.'&authtoken='.$authtoken;
|
||||
// ICal URL from external test repo.
|
||||
$subscriptionurl = $this->getExternalTestFileUrl('/ical.ics');
|
||||
|
||||
$subscription = new stdClass();
|
||||
$subscription->eventtype = 'site';
|
||||
|
||||
+19
-10
@@ -256,15 +256,17 @@ function cohort_get_available_cohorts($currentcontext, $withmembers = 0, $offset
|
||||
$groupbysql = '';
|
||||
$havingsql = '';
|
||||
if ($withmembers) {
|
||||
$groupbysql = " GROUP BY $fieldssql";
|
||||
$fieldssql .= ', s.memberscnt';
|
||||
$subfields = "c.id, COUNT(DISTINCT cm.userid) AS memberscnt";
|
||||
$groupbysql = " GROUP BY c.id";
|
||||
$fromsql = " LEFT JOIN {cohort_members} cm ON cm.cohortid = c.id ";
|
||||
$fieldssql .= ', COUNT(DISTINCT cm.userid) AS memberscnt';
|
||||
if (in_array($withmembers,
|
||||
array(COHORT_COUNT_ENROLLED_MEMBERS, COHORT_WITH_ENROLLED_MEMBERS_ONLY, COHORT_WITH_NOTENROLLED_MEMBERS_ONLY))) {
|
||||
list($esql, $params2) = get_enrolled_sql($currentcontext);
|
||||
$fromsql .= " LEFT JOIN ($esql) u ON u.id = cm.userid ";
|
||||
$params = array_merge($params2, $params);
|
||||
$fieldssql .= ', COUNT(DISTINCT u.id) AS enrolledcnt';
|
||||
$fieldssql .= ', s.enrolledcnt';
|
||||
$subfields .= ', COUNT(DISTINCT u.id) AS enrolledcnt';
|
||||
}
|
||||
if ($withmembers == COHORT_WITH_MEMBERS_ONLY) {
|
||||
$havingsql = " HAVING COUNT(DISTINCT cm.userid) > 0";
|
||||
@@ -280,13 +282,20 @@ function cohort_get_available_cohorts($currentcontext, $withmembers = 0, $offset
|
||||
$params = array_merge($params, $searchparams);
|
||||
}
|
||||
|
||||
$sql = "SELECT $fieldssql
|
||||
FROM {cohort} c
|
||||
$fromsql
|
||||
WHERE $wheresql
|
||||
$groupbysql
|
||||
$havingsql
|
||||
ORDER BY c.name, c.idnumber";
|
||||
if ($withmembers) {
|
||||
$sql = "SELECT " . str_replace('c.', 'cohort.', $fieldssql) . "
|
||||
FROM {cohort} cohort
|
||||
JOIN (SELECT $subfields
|
||||
FROM {cohort} c $fromsql
|
||||
WHERE $wheresql $groupbysql $havingsql
|
||||
) s ON cohort.id = s.id
|
||||
ORDER BY cohort.name, cohort.idnumber";
|
||||
} else {
|
||||
$sql = "SELECT $fieldssql
|
||||
FROM {cohort} c $fromsql
|
||||
WHERE $wheresql
|
||||
ORDER BY c.name, c.idnumber";
|
||||
}
|
||||
|
||||
return $DB->get_records_sql($sql, $params, $offset, $limit);
|
||||
}
|
||||
|
||||
@@ -232,6 +232,20 @@ abstract class completion_criteria extends data_object {
|
||||
*/
|
||||
abstract public function get_details($completion);
|
||||
|
||||
/**
|
||||
* Return pix_icon for display in reports.
|
||||
*
|
||||
* @param string $alt The alt text to use for the icon
|
||||
* @param array $attributes html attributes
|
||||
* @return pix_icon
|
||||
*/
|
||||
public function get_icon($alt, array $attributes = null) {
|
||||
global $COMPLETION_CRITERIA_TYPES;
|
||||
|
||||
$criteriatype = $COMPLETION_CRITERIA_TYPES[$this->criteriatype];
|
||||
return new pix_icon('i/'.$criteriatype, $alt, 'moodle', $attributes);
|
||||
}
|
||||
|
||||
/**
|
||||
* Return criteria status text for display in reports
|
||||
*
|
||||
|
||||
@@ -288,4 +288,15 @@ class completion_criteria_activity extends completion_criteria {
|
||||
|
||||
return $details;
|
||||
}
|
||||
|
||||
/**
|
||||
* Return pix_icon for display in reports.
|
||||
*
|
||||
* @param string $alt The alt text to use for the icon
|
||||
* @param array $attributes html attributes
|
||||
* @return pix_icon
|
||||
*/
|
||||
public function get_icon($alt, array $attributes = null) {
|
||||
return new pix_icon('icon', $alt, 'mod_'.$this->module, $attributes);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -202,4 +202,15 @@ class completion_criteria_date extends completion_criteria {
|
||||
|
||||
return $details;
|
||||
}
|
||||
|
||||
/**
|
||||
* Return pix_icon for display in reports.
|
||||
*
|
||||
* @param string $alt The alt text to use for the icon
|
||||
* @param array $attributes html attributes
|
||||
* @return pix_icon
|
||||
*/
|
||||
public function get_icon($alt, array $attributes = null) {
|
||||
return new pix_icon('i/calendar', $alt, 'moodle', $attributes);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -248,4 +248,15 @@ class completion_criteria_grade extends completion_criteria {
|
||||
|
||||
return $details;
|
||||
}
|
||||
|
||||
/**
|
||||
* Return pix_icon for display in reports.
|
||||
*
|
||||
* @param string $alt The alt text to use for the icon
|
||||
* @param array $attributes html attributes
|
||||
* @return pix_icon
|
||||
*/
|
||||
public function get_icon($alt, array $attributes = null) {
|
||||
return new pix_icon('i/grades', $alt, 'moodle', $attributes);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -149,4 +149,15 @@ class completion_criteria_self extends completion_criteria {
|
||||
|
||||
return $details;
|
||||
}
|
||||
|
||||
/**
|
||||
* Return pix_icon for display in reports.
|
||||
*
|
||||
* @param string $alt The alt text to use for the icon
|
||||
* @param array $attributes html attributes
|
||||
* @return pix_icon
|
||||
*/
|
||||
public function get_icon($alt, array $attributes = null) {
|
||||
return new pix_icon('i/completion_self', $alt, 'moodle', $attributes);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -131,4 +131,15 @@ class completion_criteria_unenrol extends completion_criteria {
|
||||
$details['status'] = '';
|
||||
return $details;
|
||||
}
|
||||
|
||||
/**
|
||||
* Return pix_icon for display in reports.
|
||||
*
|
||||
* @param string $alt The alt text to use for the icon
|
||||
* @param array $attributes html attributes
|
||||
* @return pix_icon
|
||||
*/
|
||||
public function get_icon($alt, array $attributes = null) {
|
||||
return new pix_icon('i/user', $alt, 'moodle', $attributes);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -122,4 +122,40 @@ class behat_completion extends behat_base {
|
||||
new Given('I press "'.get_string('savechangesanddisplay').'"')
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Checks if the activity with specified name is maked as complete.
|
||||
*
|
||||
* @Given /^the "(?P<activityname_string>(?:[^"]|\\")*)" "(?P<activitytype_string>(?:[^"]|\\")*)" activity with "(manual|auto)" completion should be marked as complete$/
|
||||
* @return array
|
||||
*/
|
||||
public function activity_marked_as_complete($activityname, $activitytype, $completiontype) {
|
||||
if ($completiontype == "manual") {
|
||||
$imgalttext = get_string("completion-alt-manual-y", 'core_completion', $activityname);
|
||||
} else {
|
||||
$imgalttext = get_string("completion-alt-auto-y", 'core_completion', $activityname);
|
||||
}
|
||||
$csselementforactivitytype = "li.modtype_".strtolower($activitytype);
|
||||
|
||||
return new Given('"//img[contains(@alt, \''.$imgalttext.'\')]" "xpath_element" ' .
|
||||
'should exist in the "'.$csselementforactivitytype.'" "css_element"');
|
||||
}
|
||||
|
||||
/**
|
||||
* Checks if the activity with specified name is maked as complete.
|
||||
*
|
||||
* @Given /^the "(?P<activityname_string>(?:[^"]|\\")*)" "(?P<activitytype_string>(?:[^"]|\\")*)" activity with "(manual|auto)" completion should be marked as not complete$/
|
||||
* @return array
|
||||
*/
|
||||
public function activity_marked_as_not_complete($activityname, $activitytype, $completiontype) {
|
||||
if ($completiontype == "manual") {
|
||||
$imgalttext = get_string("completion-alt-manual-n", 'core_completion', $activityname);
|
||||
} else {
|
||||
$imgalttext = get_string("completion-alt-auto-n", 'core_completion', $activityname);
|
||||
}
|
||||
$csselementforactivitytype = "li.modtype_".strtolower($activitytype);
|
||||
|
||||
return new Given('"//img[contains(@alt, \''.$imgalttext.'\')]" "xpath_element" ' .
|
||||
'should exist in the "'.$csselementforactivitytype.'" "css_element"');
|
||||
}
|
||||
}
|
||||
|
||||
@@ -74,10 +74,10 @@ Feature: Restrict sections availability through completion or grade conditions
|
||||
And I expand all fieldsets
|
||||
And I click on "Add restriction..." "button"
|
||||
And I click on "Grade" "button" in the "Add restriction..." "dialogue"
|
||||
And I click on "min" "checkbox"
|
||||
And I set the following fields to these values:
|
||||
| id | Grade assignment |
|
||||
| minval | 20 |
|
||||
| id | Grade assignment |
|
||||
| min | 1 |
|
||||
| minval | 20 |
|
||||
And I press "Save changes"
|
||||
And I log out
|
||||
When I log in as "student1"
|
||||
|
||||
@@ -41,12 +41,9 @@ Feature: Allow teachers to manually mark users as complete when configured
|
||||
And I follow "View course report"
|
||||
And I should see "Student First"
|
||||
And I follow "Click to mark user complete"
|
||||
# Running cron just after clicking sometimes fail, so navigate back
|
||||
# and ensure the student completion is updated before running cron.
|
||||
And I am on site homepage
|
||||
And I follow "Completion course"
|
||||
And I follow "View course report"
|
||||
And "//img[contains(@alt, 'Completed')]" "xpath_element" should exist in the "student1" "table_row"
|
||||
# Running cron just after clicking sometimes fail, as record
|
||||
# should be created before the cron runs.
|
||||
And I wait "1" seconds
|
||||
And I trigger cron
|
||||
And I am on site homepage
|
||||
And I log out
|
||||
|
||||
+1
-1
@@ -8,6 +8,6 @@
|
||||
"require-dev": {
|
||||
"phpunit/phpunit": "3.7.*",
|
||||
"phpunit/dbUnit": "1.2.*",
|
||||
"moodlehq/behat-extension": "1.29.5"
|
||||
"moodlehq/behat-extension": "1.29.7"
|
||||
}
|
||||
}
|
||||
|
||||
Generated
+58
-57
@@ -4,7 +4,8 @@
|
||||
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file",
|
||||
"This file is @generated automatically"
|
||||
],
|
||||
"hash": "e57a3c4f1934098d77de54215b059ba1",
|
||||
"hash": "fce02b5a02caca2fa2580c06c00a3aae",
|
||||
"content-hash": "f53746369a68b1323a9a37a6d0737307",
|
||||
"packages": [],
|
||||
"packages-dev": [
|
||||
{
|
||||
@@ -405,16 +406,16 @@
|
||||
},
|
||||
{
|
||||
"name": "doctrine/annotations",
|
||||
"version": "v1.2.4",
|
||||
"version": "v1.2.7",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/doctrine/annotations.git",
|
||||
"reference": "b5202eb9e83f8db52e0e58867e0a46e63be8332e"
|
||||
"reference": "f25c8aab83e0c3e976fd7d19875f198ccf2f7535"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/doctrine/annotations/zipball/b5202eb9e83f8db52e0e58867e0a46e63be8332e",
|
||||
"reference": "b5202eb9e83f8db52e0e58867e0a46e63be8332e",
|
||||
"url": "https://api.github.com/repos/doctrine/annotations/zipball/f25c8aab83e0c3e976fd7d19875f198ccf2f7535",
|
||||
"reference": "f25c8aab83e0c3e976fd7d19875f198ccf2f7535",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
@@ -469,20 +470,20 @@
|
||||
"docblock",
|
||||
"parser"
|
||||
],
|
||||
"time": "2014-12-23 22:40:37"
|
||||
"time": "2015-08-31 12:32:49"
|
||||
},
|
||||
{
|
||||
"name": "doctrine/cache",
|
||||
"version": "v1.4.1",
|
||||
"version": "v1.5.4",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/doctrine/cache.git",
|
||||
"reference": "c9eadeb743ac6199f7eec423cb9426bc518b7b03"
|
||||
"reference": "47cdc76ceb95cc591d9c79a36dc3794975b5d136"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/doctrine/cache/zipball/c9eadeb743ac6199f7eec423cb9426bc518b7b03",
|
||||
"reference": "c9eadeb743ac6199f7eec423cb9426bc518b7b03",
|
||||
"url": "https://api.github.com/repos/doctrine/cache/zipball/47cdc76ceb95cc591d9c79a36dc3794975b5d136",
|
||||
"reference": "47cdc76ceb95cc591d9c79a36dc3794975b5d136",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
@@ -503,8 +504,8 @@
|
||||
}
|
||||
},
|
||||
"autoload": {
|
||||
"psr-0": {
|
||||
"Doctrine\\Common\\Cache\\": "lib/"
|
||||
"psr-4": {
|
||||
"Doctrine\\Common\\Cache\\": "lib/Doctrine/Common/Cache"
|
||||
}
|
||||
},
|
||||
"notification-url": "https://packagist.org/downloads/",
|
||||
@@ -539,7 +540,7 @@
|
||||
"cache",
|
||||
"caching"
|
||||
],
|
||||
"time": "2015-04-15 00:11:59"
|
||||
"time": "2015-12-19 05:03:47"
|
||||
},
|
||||
{
|
||||
"name": "doctrine/collections",
|
||||
@@ -682,16 +683,16 @@
|
||||
},
|
||||
{
|
||||
"name": "doctrine/inflector",
|
||||
"version": "v1.0.1",
|
||||
"version": "v1.1.0",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/doctrine/inflector.git",
|
||||
"reference": "0bcb2e79d8571787f18b7eb036ed3d004908e604"
|
||||
"reference": "90b2128806bfde671b6952ab8bea493942c1fdae"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/doctrine/inflector/zipball/0bcb2e79d8571787f18b7eb036ed3d004908e604",
|
||||
"reference": "0bcb2e79d8571787f18b7eb036ed3d004908e604",
|
||||
"url": "https://api.github.com/repos/doctrine/inflector/zipball/90b2128806bfde671b6952ab8bea493942c1fdae",
|
||||
"reference": "90b2128806bfde671b6952ab8bea493942c1fdae",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
@@ -703,7 +704,7 @@
|
||||
"type": "library",
|
||||
"extra": {
|
||||
"branch-alias": {
|
||||
"dev-master": "1.0.x-dev"
|
||||
"dev-master": "1.1.x-dev"
|
||||
}
|
||||
},
|
||||
"autoload": {
|
||||
@@ -745,7 +746,7 @@
|
||||
"singularize",
|
||||
"string"
|
||||
],
|
||||
"time": "2014-12-20 21:24:13"
|
||||
"time": "2015-11-06 14:35:42"
|
||||
},
|
||||
{
|
||||
"name": "doctrine/lexer",
|
||||
@@ -1009,16 +1010,16 @@
|
||||
},
|
||||
{
|
||||
"name": "moodlehq/behat-extension",
|
||||
"version": "v1.29.5",
|
||||
"version": "v1.29.7",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/moodlehq/moodle-behat-extension.git",
|
||||
"reference": "0ea55a59bfbfef4e8dcf47067c56779e5a02cd63"
|
||||
"reference": "be645f6c345cc71cc0fb20e438a20c25791ccae4"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/moodlehq/moodle-behat-extension/zipball/0ea55a59bfbfef4e8dcf47067c56779e5a02cd63",
|
||||
"reference": "0ea55a59bfbfef4e8dcf47067c56779e5a02cd63",
|
||||
"url": "https://api.github.com/repos/moodlehq/moodle-behat-extension/zipball/be645f6c345cc71cc0fb20e438a20c25791ccae4",
|
||||
"reference": "be645f6c345cc71cc0fb20e438a20c25791ccae4",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
@@ -1027,6 +1028,8 @@
|
||||
"behat/mink-extension": "1.2.0",
|
||||
"behat/mink-goutte-driver": "1.0.9",
|
||||
"behat/mink-selenium2-driver": "1.1.1",
|
||||
"doctrine/cache": "1.5.4",
|
||||
"doctrine/common": "2.5.0",
|
||||
"guzzlehttp/guzzle": "~3.1",
|
||||
"php": ">=5.4.4",
|
||||
"symfony/symfony": "2.4.10"
|
||||
@@ -1055,9 +1058,9 @@
|
||||
"Moodle"
|
||||
],
|
||||
"support": {
|
||||
"source": "https://github.com/moodlehq/moodle-behat-extension/tree/v1.29.5"
|
||||
"source": "https://github.com/moodlehq/moodle-behat-extension/tree/v1.29.7"
|
||||
},
|
||||
"time": "2015-05-15 02:00:06"
|
||||
"time": "2016-01-08 05:29:02"
|
||||
},
|
||||
{
|
||||
"name": "phpunit/dbunit",
|
||||
@@ -1180,16 +1183,16 @@
|
||||
},
|
||||
{
|
||||
"name": "phpunit/php-file-iterator",
|
||||
"version": "1.4.0",
|
||||
"version": "1.4.1",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/sebastianbergmann/php-file-iterator.git",
|
||||
"reference": "a923bb15680d0089e2316f7a4af8f437046e96bb"
|
||||
"reference": "6150bf2c35d3fc379e50c7602b75caceaa39dbf0"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/sebastianbergmann/php-file-iterator/zipball/a923bb15680d0089e2316f7a4af8f437046e96bb",
|
||||
"reference": "a923bb15680d0089e2316f7a4af8f437046e96bb",
|
||||
"url": "https://api.github.com/repos/sebastianbergmann/php-file-iterator/zipball/6150bf2c35d3fc379e50c7602b75caceaa39dbf0",
|
||||
"reference": "6150bf2c35d3fc379e50c7602b75caceaa39dbf0",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
@@ -1223,20 +1226,20 @@
|
||||
"filesystem",
|
||||
"iterator"
|
||||
],
|
||||
"time": "2015-04-02 05:19:05"
|
||||
"time": "2015-06-21 13:08:43"
|
||||
},
|
||||
{
|
||||
"name": "phpunit/php-text-template",
|
||||
"version": "1.2.0",
|
||||
"version": "1.2.1",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/sebastianbergmann/php-text-template.git",
|
||||
"reference": "206dfefc0ffe9cebf65c413e3d0e809c82fbf00a"
|
||||
"reference": "31f8b717e51d9a2afca6c9f046f5d69fc27c8686"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/sebastianbergmann/php-text-template/zipball/206dfefc0ffe9cebf65c413e3d0e809c82fbf00a",
|
||||
"reference": "206dfefc0ffe9cebf65c413e3d0e809c82fbf00a",
|
||||
"url": "https://api.github.com/repos/sebastianbergmann/php-text-template/zipball/31f8b717e51d9a2afca6c9f046f5d69fc27c8686",
|
||||
"reference": "31f8b717e51d9a2afca6c9f046f5d69fc27c8686",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
@@ -1245,20 +1248,17 @@
|
||||
"type": "library",
|
||||
"autoload": {
|
||||
"classmap": [
|
||||
"Text/"
|
||||
"src/"
|
||||
]
|
||||
},
|
||||
"notification-url": "https://packagist.org/downloads/",
|
||||
"include-path": [
|
||||
""
|
||||
],
|
||||
"license": [
|
||||
"BSD-3-Clause"
|
||||
],
|
||||
"authors": [
|
||||
{
|
||||
"name": "Sebastian Bergmann",
|
||||
"email": "sb@sebastian-bergmann.de",
|
||||
"email": "sebastian@phpunit.de",
|
||||
"role": "lead"
|
||||
}
|
||||
],
|
||||
@@ -1267,20 +1267,20 @@
|
||||
"keywords": [
|
||||
"template"
|
||||
],
|
||||
"time": "2014-01-30 17:20:04"
|
||||
"time": "2015-06-21 13:50:34"
|
||||
},
|
||||
{
|
||||
"name": "phpunit/php-timer",
|
||||
"version": "1.0.5",
|
||||
"version": "1.0.7",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/sebastianbergmann/php-timer.git",
|
||||
"reference": "19689d4354b295ee3d8c54b4f42c3efb69cbc17c"
|
||||
"reference": "3e82f4e9fc92665fafd9157568e4dcb01d014e5b"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/sebastianbergmann/php-timer/zipball/19689d4354b295ee3d8c54b4f42c3efb69cbc17c",
|
||||
"reference": "19689d4354b295ee3d8c54b4f42c3efb69cbc17c",
|
||||
"url": "https://api.github.com/repos/sebastianbergmann/php-timer/zipball/3e82f4e9fc92665fafd9157568e4dcb01d014e5b",
|
||||
"reference": "3e82f4e9fc92665fafd9157568e4dcb01d014e5b",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
@@ -1289,13 +1289,10 @@
|
||||
"type": "library",
|
||||
"autoload": {
|
||||
"classmap": [
|
||||
"PHP/"
|
||||
"src/"
|
||||
]
|
||||
},
|
||||
"notification-url": "https://packagist.org/downloads/",
|
||||
"include-path": [
|
||||
""
|
||||
],
|
||||
"license": [
|
||||
"BSD-3-Clause"
|
||||
],
|
||||
@@ -1311,7 +1308,7 @@
|
||||
"keywords": [
|
||||
"timer"
|
||||
],
|
||||
"time": "2013-08-02 07:42:54"
|
||||
"time": "2015-06-21 08:01:12"
|
||||
},
|
||||
{
|
||||
"name": "phpunit/php-token-stream",
|
||||
@@ -1529,12 +1526,12 @@
|
||||
"target-dir": "Symfony/Component/Icu",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/symfony/Icu.git",
|
||||
"url": "https://github.com/symfony/icu.git",
|
||||
"reference": "d4d85d6055b87f394d941b45ddd3a9173e1e3d2a"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/symfony/Icu/zipball/d4d85d6055b87f394d941b45ddd3a9173e1e3d2a",
|
||||
"url": "https://api.github.com/repos/symfony/icu/zipball/d4d85d6055b87f394d941b45ddd3a9173e1e3d2a",
|
||||
"reference": "d4d85d6055b87f394d941b45ddd3a9173e1e3d2a",
|
||||
"shasum": ""
|
||||
},
|
||||
@@ -1687,25 +1684,29 @@
|
||||
},
|
||||
{
|
||||
"name": "twig/twig",
|
||||
"version": "v1.18.1",
|
||||
"version": "v1.23.1",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/twigphp/Twig.git",
|
||||
"reference": "9f70492f44398e276d1b81c1b43adfe6751c7b7f"
|
||||
"reference": "d9b6333ae8dd2c8e3fd256e127548def0bc614c6"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/twigphp/Twig/zipball/9f70492f44398e276d1b81c1b43adfe6751c7b7f",
|
||||
"reference": "9f70492f44398e276d1b81c1b43adfe6751c7b7f",
|
||||
"url": "https://api.github.com/repos/twigphp/Twig/zipball/d9b6333ae8dd2c8e3fd256e127548def0bc614c6",
|
||||
"reference": "d9b6333ae8dd2c8e3fd256e127548def0bc614c6",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
"php": ">=5.2.7"
|
||||
},
|
||||
"require-dev": {
|
||||
"symfony/debug": "~2.7",
|
||||
"symfony/phpunit-bridge": "~2.7"
|
||||
},
|
||||
"type": "library",
|
||||
"extra": {
|
||||
"branch-alias": {
|
||||
"dev-master": "1.18-dev"
|
||||
"dev-master": "1.23-dev"
|
||||
}
|
||||
},
|
||||
"autoload": {
|
||||
@@ -1740,7 +1741,7 @@
|
||||
"keywords": [
|
||||
"templating"
|
||||
],
|
||||
"time": "2015-04-19 08:30:27"
|
||||
"time": "2015-11-05 12:49:06"
|
||||
}
|
||||
],
|
||||
"aliases": [],
|
||||
|
||||
@@ -1130,7 +1130,7 @@ class core_course_management_renderer extends plugin_renderer_base {
|
||||
$totalpages = ceil($totalcourses / $perpage);
|
||||
if ($showtotals) {
|
||||
if ($totalpages == 0) {
|
||||
$str = get_string('nocoursesfound', 'moodle', $search);
|
||||
$str = get_string('nocoursesfound', 'moodle', s($search));
|
||||
} else if ($totalpages == 1) {
|
||||
$str = get_string('showingacourses', 'moodle', $totalcourses);
|
||||
} else {
|
||||
|
||||
+3
-2
@@ -76,11 +76,12 @@ $strdeletecoursecheck = get_string("deletecoursecheck");
|
||||
$message = "{$strdeletecoursecheck}<br /><br />{$coursefullname} ({$courseshortname})";
|
||||
|
||||
$continueurl = new moodle_url('/course/delete.php', array('id' => $course->id, 'delete' => md5($course->timemodified)));
|
||||
$continuebutton = new single_button($continueurl, get_string('delete'), 'post');
|
||||
|
||||
$PAGE->navbar->add($strdeletecheck);
|
||||
$PAGE->set_title("$SITE->shortname: $strdeletecheck");
|
||||
$PAGE->set_heading($SITE->fullname);
|
||||
echo $OUTPUT->header();
|
||||
echo $OUTPUT->confirm($message, $continueurl, $categoryurl);
|
||||
echo $OUTPUT->confirm($message, $continuebutton, $categoryurl);
|
||||
echo $OUTPUT->footer();
|
||||
exit;
|
||||
exit;
|
||||
|
||||
@@ -66,7 +66,7 @@ if ($deletesection) {
|
||||
echo $OUTPUT->box_start('noticebox');
|
||||
$optionsyes = array('id' => $id, 'confirm' => 1, 'delete' => 1, 'sesskey' => sesskey());
|
||||
$deleteurl = new moodle_url('/course/editsection.php', $optionsyes);
|
||||
$formcontinue = new single_button($deleteurl, get_string('continue'));
|
||||
$formcontinue = new single_button($deleteurl, get_string('delete'));
|
||||
$formcancel = new single_button($cancelurl, get_string('cancel'), 'get');
|
||||
echo $OUTPUT->confirm(get_string('confirmdeletesection', '',
|
||||
get_section_name($course, $sectioninfo)), $formcontinue, $formcancel);
|
||||
|
||||
@@ -23,6 +23,7 @@ Background:
|
||||
And I press "Post to forum"
|
||||
And I wait to be redirected
|
||||
And I follow "Course 1"
|
||||
And I wait "1" seconds
|
||||
And I press "Add a new discussion topic"
|
||||
And I set the following fields to these values:
|
||||
| Subject | Forum Post 9 |
|
||||
@@ -30,6 +31,7 @@ Background:
|
||||
And I press "Post to forum"
|
||||
And I wait to be redirected
|
||||
And I follow "Course 1"
|
||||
And I wait "1" seconds
|
||||
And I press "Add a new discussion topic"
|
||||
And I set the following fields to these values:
|
||||
| Subject | Forum Post 8 |
|
||||
@@ -37,6 +39,7 @@ Background:
|
||||
And I press "Post to forum"
|
||||
And I wait to be redirected
|
||||
And I follow "Course 1"
|
||||
And I wait "1" seconds
|
||||
And I press "Add a new discussion topic"
|
||||
And I set the following fields to these values:
|
||||
| Subject | Forum Post 7 |
|
||||
@@ -44,6 +47,7 @@ Background:
|
||||
And I press "Post to forum"
|
||||
And I wait to be redirected
|
||||
And I follow "Course 1"
|
||||
And I wait "1" seconds
|
||||
And I press "Add a new discussion topic"
|
||||
And I set the following fields to these values:
|
||||
| Subject | Forum Post 6 |
|
||||
@@ -51,6 +55,7 @@ Background:
|
||||
And I press "Post to forum"
|
||||
And I wait to be redirected
|
||||
And I follow "Course 1"
|
||||
And I wait "1" seconds
|
||||
And I press "Add a new discussion topic"
|
||||
And I set the following fields to these values:
|
||||
| Subject | Forum Post 5 |
|
||||
@@ -58,6 +63,7 @@ Background:
|
||||
And I press "Post to forum"
|
||||
And I wait to be redirected
|
||||
And I follow "Course 1"
|
||||
And I wait "1" seconds
|
||||
And I press "Add a new discussion topic"
|
||||
And I set the following fields to these values:
|
||||
| Subject | Forum Post 4 |
|
||||
@@ -65,6 +71,7 @@ Background:
|
||||
And I press "Post to forum"
|
||||
And I wait to be redirected
|
||||
And I follow "Course 1"
|
||||
And I wait "1" seconds
|
||||
And I press "Add a new discussion topic"
|
||||
And I set the following fields to these values:
|
||||
| Subject | Forum Post 3 |
|
||||
@@ -72,6 +79,7 @@ Background:
|
||||
And I press "Post to forum"
|
||||
And I wait to be redirected
|
||||
And I follow "Course 1"
|
||||
And I wait "1" seconds
|
||||
And I press "Add a new discussion topic"
|
||||
And I set the following fields to these values:
|
||||
| Subject | Forum Post 2 |
|
||||
@@ -79,6 +87,7 @@ Background:
|
||||
And I press "Post to forum"
|
||||
And I wait to be redirected
|
||||
And I follow "Course 1"
|
||||
And I wait "1" seconds
|
||||
And I press "Add a new discussion topic"
|
||||
And I set the following fields to these values:
|
||||
| Subject | Forum Post 1 |
|
||||
|
||||
@@ -43,7 +43,7 @@ Feature: Sections can be edited and deleted in topics format
|
||||
Scenario: Deleting the last section in topics format
|
||||
When I click on "Delete topic" "link" in the "li#section-5" "css_element"
|
||||
Then I should see "Are you absolutely sure you want to completely delete \"Topic 5\" and all the activities it contains?"
|
||||
And I press "Continue"
|
||||
And I press "Delete"
|
||||
And I should not see "Topic 5"
|
||||
And I navigate to "Edit settings" node in "Course administration"
|
||||
And I expand all fieldsets
|
||||
@@ -51,7 +51,7 @@ Feature: Sections can be edited and deleted in topics format
|
||||
|
||||
Scenario: Deleting the middle section in topics format
|
||||
When I click on "Delete topic" "link" in the "li#section-4" "css_element"
|
||||
And I press "Continue"
|
||||
And I press "Delete"
|
||||
Then I should not see "Topic 5"
|
||||
And I should not see "Test chat name"
|
||||
And I should see "Test choice name" in the "li#section-4" "css_element"
|
||||
@@ -63,7 +63,7 @@ Feature: Sections can be edited and deleted in topics format
|
||||
When I follow "Reduce the number of sections"
|
||||
Then I should see "Orphaned activities (section 5)" in the "li#section-5" "css_element"
|
||||
And I click on "Delete topic" "link" in the "li#section-5" "css_element"
|
||||
And I press "Continue"
|
||||
And I press "Delete"
|
||||
And I should not see "Topic 5"
|
||||
And I should not see "Orphaned activities"
|
||||
And "li#section-5" "css_element" should not exist
|
||||
@@ -77,7 +77,7 @@ Feature: Sections can be edited and deleted in topics format
|
||||
And "li#section-5.orphaned" "css_element" should exist
|
||||
And "li#section-4.orphaned" "css_element" should not exist
|
||||
And I click on "Delete topic" "link" in the "li#section-1" "css_element"
|
||||
And I press "Continue"
|
||||
And I press "Delete"
|
||||
And I should not see "Test book name"
|
||||
And I should see "Orphaned activities (section 4)" in the "li#section-4" "css_element"
|
||||
And "li#section-5" "css_element" should not exist
|
||||
|
||||
@@ -45,7 +45,7 @@ Feature: Sections can be edited and deleted in weeks format
|
||||
Given I should see "29 May - 4 June" in the "li#section-5" "css_element"
|
||||
When I click on "Delete week" "link" in the "li#section-5" "css_element"
|
||||
Then I should see "Are you absolutely sure you want to completely delete \"29 May - 4 June\" and all the activities it contains?"
|
||||
And I press "Continue"
|
||||
And I press "Delete"
|
||||
And I should not see "29 May - 4 June"
|
||||
And I navigate to "Edit settings" node in "Course administration"
|
||||
And I expand all fieldsets
|
||||
@@ -54,7 +54,7 @@ Feature: Sections can be edited and deleted in weeks format
|
||||
Scenario: Deleting the middle section in weeks format
|
||||
Given I should see "29 May - 4 June" in the "li#section-5" "css_element"
|
||||
When I click on "Delete week" "link" in the "li#section-4" "css_element"
|
||||
And I press "Continue"
|
||||
And I press "Delete"
|
||||
Then I should not see "29 May - 4 June"
|
||||
And I should not see "Test chat name"
|
||||
And I should see "Test choice name" in the "li#section-4" "css_element"
|
||||
@@ -66,7 +66,7 @@ Feature: Sections can be edited and deleted in weeks format
|
||||
When I follow "Reduce the number of sections"
|
||||
Then I should see "Orphaned activities (section 5)" in the "li#section-5" "css_element"
|
||||
And I click on "Delete week" "link" in the "li#section-5" "css_element"
|
||||
And I press "Continue"
|
||||
And I press "Delete"
|
||||
And I should not see "29 May - 4 June"
|
||||
And I should not see "Orphaned activities"
|
||||
And "li#section-5" "css_element" should not exist
|
||||
@@ -80,7 +80,7 @@ Feature: Sections can be edited and deleted in weeks format
|
||||
And "li#section-5.orphaned" "css_element" should exist
|
||||
And "li#section-4.orphaned" "css_element" should not exist
|
||||
And I click on "Delete week" "link" in the "li#section-1" "css_element"
|
||||
And I press "Continue"
|
||||
And I press "Delete"
|
||||
And I should not see "Test book name"
|
||||
And I should see "Orphaned activities (section 4)" in the "li#section-4" "css_element"
|
||||
And "li#section-5" "css_element" should not exist
|
||||
|
||||
+3
-2
@@ -106,7 +106,8 @@ if (!empty($add)) {
|
||||
$optionsyes = array('confirm'=>1, 'delete'=>$cm->id, 'sesskey'=>sesskey(), 'sr' => $sectionreturn);
|
||||
|
||||
$strdeletecheck = get_string('deletecheck', '', $fullmodulename);
|
||||
$strdeletecheckfull = get_string('deletecheckfull', '', "$fullmodulename '$cm->name'");
|
||||
$strparams = (object)array('type' => $fullmodulename, 'name' => $cm->name);
|
||||
$strdeletechecktypename = get_string('deletechecktypename', '', $strparams);
|
||||
|
||||
$PAGE->set_pagetype('mod-' . $cm->modname . '-delete');
|
||||
$PAGE->set_title($strdeletecheck);
|
||||
@@ -117,7 +118,7 @@ if (!empty($add)) {
|
||||
echo $OUTPUT->box_start('noticebox');
|
||||
$formcontinue = new single_button(new moodle_url("$CFG->wwwroot/course/mod.php", $optionsyes), get_string('yes'));
|
||||
$formcancel = new single_button($return, get_string('no'), 'get');
|
||||
echo $OUTPUT->confirm($strdeletecheckfull, $formcontinue, $formcancel);
|
||||
echo $OUTPUT->confirm($strdeletechecktypename, $formcontinue, $formcancel);
|
||||
echo $OUTPUT->box_end();
|
||||
echo $OUTPUT->footer();
|
||||
|
||||
|
||||
+4
-5
@@ -187,15 +187,14 @@ if (!empty($add)) {
|
||||
|
||||
if ($items = grade_item::fetch_all(array('itemtype'=>'mod', 'itemmodule'=>$data->modulename,
|
||||
'iteminstance'=>$data->instance, 'courseid'=>$course->id))) {
|
||||
// add existing outcomes
|
||||
// Add existing outcomes.
|
||||
foreach ($items as $item) {
|
||||
if (!empty($item->gradepass)) {
|
||||
if (!empty($item->outcomeid)) {
|
||||
$data->{'outcome_' . $item->outcomeid} = 1;
|
||||
} else if (!empty($item->gradepass)) {
|
||||
$decimalpoints = $item->get_decimals();
|
||||
$data->gradepass = format_float($item->gradepass, $decimalpoints);
|
||||
}
|
||||
if (!empty($item->outcomeid)) {
|
||||
$data->{'outcome_'.$item->outcomeid} = 1;
|
||||
}
|
||||
}
|
||||
|
||||
// set category if present
|
||||
|
||||
+1
-1
@@ -212,7 +212,7 @@ if (!empty($activities)) {
|
||||
echo $OUTPUT->spacer(array('height'=>30, 'br'=>true)); // should be done with CSS instead
|
||||
}
|
||||
echo $OUTPUT->box_start();
|
||||
if (!empty($activity->name)) {
|
||||
if (strval($activity->name) !== '') {
|
||||
echo html_writer::tag('h2', $activity->name);
|
||||
}
|
||||
$inbox = true;
|
||||
|
||||
+1
-1
@@ -173,7 +173,7 @@ switch($requestmethod) {
|
||||
$module->name = clean_param($title, PARAM_CLEANHTML);
|
||||
}
|
||||
|
||||
if (!empty($module->name)) {
|
||||
if (strval($module->name) !== '') {
|
||||
$DB->update_record($cm->modname, $module);
|
||||
$cm->name = $module->name;
|
||||
\core\event\course_module_updated::create_from_cm($cm, $modcontext)->trigger();
|
||||
|
||||
@@ -54,7 +54,7 @@ Feature: Test we can both create and delete a course.
|
||||
# Redirect
|
||||
And I should see "Delete TCCAC"
|
||||
And I should see "Test course: create a course (TCCAC)"
|
||||
And I press "Continue"
|
||||
And I press "Delete"
|
||||
# Redirect
|
||||
And I should see "Deleting TCCAC"
|
||||
And I should see "TCCAC has been completely deleted"
|
||||
@@ -93,7 +93,7 @@ Feature: Test we can both create and delete a course.
|
||||
# Redirect
|
||||
And I should see "Delete TCCAC"
|
||||
And I should see "Test course: create a course (TCCAC)"
|
||||
And I press "Continue"
|
||||
And I press "Delete"
|
||||
# Redirect
|
||||
And I should see "Deleting TCCAC"
|
||||
And I should see "TCCAC has been completely deleted"
|
||||
|
||||
@@ -0,0 +1,31 @@
|
||||
@core @core_course
|
||||
Feature: Rename roles in a course
|
||||
In order to account for course-level differences
|
||||
As a teacher
|
||||
I need to be able to rename roles
|
||||
|
||||
Background:
|
||||
Given the following "users" exist:
|
||||
| username | firstname | lastname | email |
|
||||
| student1 | Student | 1 | student1@example.com |
|
||||
| teacher1 | Teacher | 1 | teacher1@example.com |
|
||||
And the following "courses" exist:
|
||||
| fullname | shortname |
|
||||
| Course 1 | C1 |
|
||||
And the following "course enrolments" exist:
|
||||
| user | course | role |
|
||||
| student1 | C1 | student |
|
||||
| teacher1 | C1 | editingteacher |
|
||||
|
||||
Scenario: Teacher can rename roles
|
||||
Given I log in as "teacher1"
|
||||
And I follow "Course 1"
|
||||
And I click on "Edit settings" "link" in the "Administration" "block"
|
||||
And I should see "Role renaming"
|
||||
When I set the following fields to these values:
|
||||
| Your word for 'Teacher' | Lecturer |
|
||||
| Your word for 'Student' | Learner |
|
||||
And I press "Save and display"
|
||||
And I navigate to "Enrolled users" node in "Course administration > Users"
|
||||
Then I should see "Lecturer" in the "Teacher 1" "table_row"
|
||||
And I should see "Learner" in the "Student 1" "table_row"
|
||||
@@ -688,6 +688,8 @@ Y.extend(RESOURCETOOLBOX, TOOLBOX, {
|
||||
newtitlestr = M.util.get_string('clicktochangeinbrackets', 'moodle', M.util.get_string(newtitle, 'moodle'));
|
||||
|
||||
// Change the UI
|
||||
var oldAction = button.getData('action');
|
||||
button.replaceClass('editing_' + oldAction, 'editing_' + newtitle);
|
||||
buttonimg.setAttrs({
|
||||
'src': iconsrc
|
||||
});
|
||||
|
||||
File diff suppressed because one or more lines are too long
@@ -688,6 +688,8 @@ Y.extend(RESOURCETOOLBOX, TOOLBOX, {
|
||||
newtitlestr = M.util.get_string('clicktochangeinbrackets', 'moodle', M.util.get_string(newtitle, 'moodle'));
|
||||
|
||||
// Change the UI
|
||||
var oldAction = button.getData('action');
|
||||
button.replaceClass('editing_' + oldAction, 'editing_' + newtitle);
|
||||
buttonimg.setAttrs({
|
||||
'src': iconsrc
|
||||
});
|
||||
|
||||
+2
@@ -484,6 +484,8 @@ Y.extend(RESOURCETOOLBOX, TOOLBOX, {
|
||||
newtitlestr = M.util.get_string('clicktochangeinbrackets', 'moodle', M.util.get_string(newtitle, 'moodle'));
|
||||
|
||||
// Change the UI
|
||||
var oldAction = button.getData('action');
|
||||
button.replaceClass('editing_' + oldAction, 'editing_' + newtitle);
|
||||
buttonimg.setAttrs({
|
||||
'src': iconsrc
|
||||
});
|
||||
|
||||
@@ -264,9 +264,9 @@ class enrol_database_plugin extends enrol_plugin {
|
||||
FROM {enrol} e
|
||||
JOIN {course} c ON c.id = e.courseid
|
||||
JOIN {role_assignments} ra ON ra.itemid = e.id
|
||||
LEFT JOIN {user_enrolments} ue ON ue.enrolid = e.id
|
||||
LEFT JOIN {user_enrolments} ue ON ue.enrolid = e.id AND ue.userid = ra.userid
|
||||
WHERE ra.userid = :userid AND e.enrol = 'database'";
|
||||
$rs = $DB->get_recordset_sql($sql, array('userid'=>$user->id));
|
||||
$rs = $DB->get_recordset_sql($sql, array('userid' => $user->id));
|
||||
foreach ($rs as $instance) {
|
||||
if (!$instance->cvisible and $ignorehidden) {
|
||||
continue;
|
||||
|
||||
+38
-9
@@ -378,7 +378,10 @@ class core_enrol_external extends external_api {
|
||||
)
|
||||
), 'Option names:
|
||||
* withcapability (string) return only users with this capability. This option requires \'moodle/role:review\' on the course context.
|
||||
* groupid (integer) return only users in this group id. This option requires \'moodle/site:accessallgroups\' on the course context.
|
||||
* groupid (integer) return only users in this group id. If the course has groups enabled and this param
|
||||
isn\'t defined, returns all the viewable users.
|
||||
This option requires \'moodle/site:accessallgroups\' on the course context if the
|
||||
user doesn\'t belong to the group.
|
||||
* onlyactive (integer) return only users with active enrolments and matching time restrictions. This option requires \'moodle/course:enrolreview\' on the course context.
|
||||
* userfields (\'string, string, ...\') return only the values of these user fields.
|
||||
* limitfrom (integer) sql limit from.
|
||||
@@ -466,7 +469,7 @@ class core_enrol_external extends external_api {
|
||||
require_capability('moodle/role:review', $coursecontext);
|
||||
}
|
||||
// need accessallgroups capability if you want to overwrite this option
|
||||
if (!empty($groupid) && groups_is_member($groupid)) {
|
||||
if (!empty($groupid) && !groups_is_member($groupid)) {
|
||||
require_capability('moodle/site:accessallgroups', $coursecontext);
|
||||
}
|
||||
// to overwrite this option, you need course:enrolereview permission
|
||||
@@ -478,10 +481,29 @@ class core_enrol_external extends external_api {
|
||||
$ctxselect = ', ' . context_helper::get_preload_record_columns_sql('ctx');
|
||||
$ctxjoin = "LEFT JOIN {context} ctx ON (ctx.instanceid = u.id AND ctx.contextlevel = :contextlevel)";
|
||||
$enrolledparams['contextlevel'] = CONTEXT_USER;
|
||||
$sql = "SELECT u.* $ctxselect
|
||||
FROM {user} u $ctxjoin
|
||||
WHERE u.id IN ($enrolledsql)
|
||||
ORDER BY u.id ASC";
|
||||
|
||||
$groupjoin = '';
|
||||
if (empty($groupid) && groups_get_course_groupmode($course) == SEPARATEGROUPS &&
|
||||
!has_capability('moodle/site:accessallgroups', $coursecontext)) {
|
||||
// Filter by groups the user can view.
|
||||
$usergroups = groups_get_user_groups($course->id);
|
||||
if (!empty($usergroups['0'])) {
|
||||
list($groupsql, $groupparams) = $DB->get_in_or_equal($usergroups['0'], SQL_PARAMS_NAMED);
|
||||
$groupjoin = "JOIN {groups_members} gm ON (u.id = gm.userid AND gm.groupid $groupsql)";
|
||||
$enrolledparams = array_merge($enrolledparams, $groupparams);
|
||||
} else {
|
||||
// User doesn't belong to any group, so he can't see any user. Return an empty array.
|
||||
return array();
|
||||
}
|
||||
}
|
||||
$sql = "SELECT us.*
|
||||
FROM {user} us
|
||||
JOIN (
|
||||
SELECT DISTINCT u.id $ctxselect
|
||||
FROM {user} u $ctxjoin $groupjoin
|
||||
WHERE u.id IN ($enrolledsql)
|
||||
) q ON q.id = us.id
|
||||
ORDER BY us.id ASC";
|
||||
$enrolledusers = $DB->get_recordset_sql($sql, $enrolledparams, $limitfrom, $limitnumber);
|
||||
$users = array();
|
||||
foreach ($enrolledusers as $user) {
|
||||
@@ -596,14 +618,21 @@ class core_enrol_external extends external_api {
|
||||
*
|
||||
* @param int $courseid
|
||||
* @return array of course enrolment methods
|
||||
* @throws moodle_exception
|
||||
*/
|
||||
public static function get_course_enrolment_methods($courseid) {
|
||||
global $DB;
|
||||
|
||||
$params = self::validate_parameters(self::get_course_enrolment_methods_parameters(), array('courseid' => $courseid));
|
||||
|
||||
$coursecontext = context_course::instance($params['courseid']);
|
||||
$categorycontext = $coursecontext->get_parent_context();
|
||||
self::validate_context($categorycontext);
|
||||
// Note that we can't use validate_context because the user is not enrolled in the course.
|
||||
require_login(null, false, null, false, true);
|
||||
|
||||
$course = $DB->get_record('course', array('id' => $params['courseid']), '*', MUST_EXIST);
|
||||
$context = context_course::instance($course->id);
|
||||
if (!$course->visible and !has_capability('moodle/course:viewhiddencourses', $context)) {
|
||||
throw new moodle_exception('coursehidden');
|
||||
}
|
||||
|
||||
$result = array();
|
||||
$enrolinstances = enrol_get_instances($params['courseid'], true);
|
||||
|
||||
@@ -446,7 +446,7 @@ class enrol_flatfile_plugin extends enrol_plugin {
|
||||
$notify = false;
|
||||
if ($ue = $DB->get_record('user_enrolments', array('enrolid'=>$instance->id, 'userid'=>$user->id))) {
|
||||
// Update only.
|
||||
$this->update_user_enrol($instance, $user->id, ENROL_USER_ACTIVE, $roleid, $timestart, $timeend);
|
||||
$this->update_user_enrol($instance, $user->id, ENROL_USER_ACTIVE, $timestart, $timeend);
|
||||
if (!$DB->record_exists('role_assignments', array('contextid'=>$context->id, 'roleid'=>$roleid, 'userid'=>$user->id, 'component'=>'enrol_flatfile', 'itemid'=>$instance->id))) {
|
||||
role_assign($roleid, $user->id, $context->id, 'enrol_flatfile', $instance->id);
|
||||
}
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user