Compare commits
409 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 91e6642f16 | |||
| 62169983fd | |||
| 459659ce89 | |||
| 18e34acffb | |||
| 571777775e | |||
| 4945852c97 | |||
| a15550e7ff | |||
| 61bc6ed948 | |||
| 9e32013053 | |||
| 76420650aa | |||
| 922cc4d23e | |||
| 8cf476dc6d | |||
| dc9c9d16f4 | |||
| 0923a3979e | |||
| e6eb379544 | |||
| 59f6c64947 | |||
| 5aac33d755 | |||
| 82c04ab972 | |||
| 5047ae82f9 | |||
| 3ef202da9c | |||
| fd65fe1bdf | |||
| 9ffdcf3da1 | |||
| 8905ebffb7 | |||
| a3ed617072 | |||
| e3d93edc6d | |||
| 6f93f45c53 | |||
| d043d3daf7 | |||
| c85b2a4566 | |||
| 1933e6a39f | |||
| 68366595f2 | |||
| a8e8576e0b | |||
| a14e8aaae7 | |||
| 1b05063d00 | |||
| ae4ae605b4 | |||
| 9de452c011 | |||
| ff9d561d82 | |||
| 5acae49336 | |||
| c5f9df8d11 | |||
| 08d97e4b30 | |||
| 9a1aea7c91 | |||
| c662c08d89 | |||
| ab962f6e20 | |||
| a27734b6f1 | |||
| 3e11151348 | |||
| 9b01237187 | |||
| 63440b3216 | |||
| 410d8cf0ba | |||
| 9f24926e1a | |||
| cd2d34a055 | |||
| 11510dadbc | |||
| 6f40d9ffd7 | |||
| a5742d7845 | |||
| 6177a2f994 | |||
| ab0a36e796 | |||
| c3f70b3ef5 | |||
| abfdb19e80 | |||
| 4fb54bb52f | |||
| 46e3110812 | |||
| 2dc7fc1497 | |||
| e30c0b63b7 | |||
| 7dbeef905e | |||
| d7b79e57a9 | |||
| bcd8431a7f | |||
| 03795be887 | |||
| b74cea9834 | |||
| ce9eee67cb | |||
| 1d1b5908db | |||
| 10cb2941e5 | |||
| 1dc6a35d24 | |||
| 5c0af05e15 | |||
| 997d5e44a8 | |||
| d351633fb9 | |||
| db9b34b993 | |||
| e4919b0feb | |||
| 520a212057 | |||
| ad4e61c2a2 | |||
| 170a0d0eb9 | |||
| 7629c4ff44 | |||
| afc6f0953c | |||
| bbcf3db3c5 | |||
| acf600a9b4 | |||
| 917780c2cb | |||
| 124a575813 | |||
| 1d12df6e12 | |||
| e5acfffa04 | |||
| 9f2d2332de | |||
| d3e42f9a8b | |||
| b222d8927b | |||
| 44f4d3b123 | |||
| cfe04a6891 | |||
| 7f50d30e9f | |||
| 97fbf797c4 | |||
| 45561f7d84 | |||
| 3f3409cfd7 | |||
| 66c3430f2d | |||
| ac846f9fd7 | |||
| fe7295010e | |||
| 5fe5629ef2 | |||
| 6ec5cfa4e8 | |||
| 91430abc21 | |||
| a6ef6a2253 | |||
| e88e9f6327 | |||
| b755271b8d | |||
| f5aca82d20 | |||
| c7ac993b9e | |||
| 0bd734bdda | |||
| 79bfce98af | |||
| b3fa09d554 | |||
| 0ac092cc92 | |||
| 6b8b79c3f4 | |||
| b69cc0c26d | |||
| 6e4e0abad7 | |||
| 35b64b004a | |||
| b8949b4c90 | |||
| 89d84af752 | |||
| b7bf1d6fc3 | |||
| 68d5bfe6e3 | |||
| af4ff2b867 | |||
| 73ec043d4b | |||
| 951d0b8987 | |||
| 2578646f10 | |||
| 10b7e70014 | |||
| 3779f0fb4a | |||
| c52c8e85dd | |||
| c18f100ea0 | |||
| 954d38e6f2 | |||
| 79b2271482 | |||
| 819aa90469 | |||
| 6ac3d62125 | |||
| 6bdf4bb2b1 | |||
| 22c57001d1 | |||
| 92ee7151e5 | |||
| 0e2342d79d | |||
| bcfc49e3ab | |||
| 0fc9bfa71a | |||
| bed2352e67 | |||
| 38d1c5f174 | |||
| b98876efa1 | |||
| b0be75b9ac | |||
| 47cb335ea2 | |||
| e046077a13 | |||
| 96b5cb56e8 | |||
| bb7d15c7e0 | |||
| a8105bccf9 | |||
| 6a79b98768 | |||
| ded705eacd | |||
| 2e8bbe2c94 | |||
| 3e34904ce9 | |||
| b4deb483ce | |||
| ebc281d14f | |||
| fdf3daa6a9 | |||
| 8c540d58f2 | |||
| a75a0a596e | |||
| d7a0dcbdae | |||
| 2ef6a3b9b9 | |||
| 4aa826356b | |||
| f4727c3922 | |||
| 67dea5b53b | |||
| 3231d72a96 | |||
| f1a8189dfb | |||
| 395f8c49d8 | |||
| bdd7ea645e | |||
| 882d676a66 | |||
| 412231454f | |||
| e9c4e02202 | |||
| c17ed92914 | |||
| 3e592b11fe | |||
| d5e8ce4743 | |||
| 57d3069711 | |||
| a5b351cf10 | |||
| 2ad8691f81 | |||
| 4af519c068 | |||
| 079269febb | |||
| 3bdf0bdffe | |||
| 5f71eb0d12 | |||
| 4e233eb6b0 | |||
| 1eb52d00f1 | |||
| dee8468aa9 | |||
| 3c3bd19f49 | |||
| e2fd30a2c5 | |||
| 0db5c697d7 | |||
| 935664bc95 | |||
| 178fe9f0c7 | |||
| c65dabf79b | |||
| 2bcdfcf638 | |||
| d8e0807dd2 | |||
| 86e27a7eb1 | |||
| a52d5c9e28 | |||
| 442c94a808 | |||
| c270d87fec | |||
| 9047a30cd9 | |||
| 3970ad4264 | |||
| a51864ad26 | |||
| 1169389d47 | |||
| 09792257fd | |||
| 28005f7f39 | |||
| 576ae57607 | |||
| a2a899b204 | |||
| 82fdb9e20e | |||
| 9512b017b2 | |||
| 97ea22bc19 | |||
| c3c2180169 | |||
| e18af1ab61 | |||
| b31b0f7479 | |||
| 0f07221c64 | |||
| cf681dc724 | |||
| be8a7442e7 | |||
| 2f6c1b56e4 | |||
| e72f030874 | |||
| 91acee489d | |||
| 72d853549a | |||
| 4059ac3e29 | |||
| 1d724c4a4a | |||
| 73da2849e5 | |||
| 8dda51d57e | |||
| 5c945e1283 | |||
| ed5a1cdef1 | |||
| 5491e32ef3 | |||
| abd334b104 | |||
| 5014d7bbb4 | |||
| d32cccf278 | |||
| d6fc042d06 | |||
| 628c5c07de | |||
| eeabb5303f | |||
| 9f23aa9036 | |||
| 059dab5861 | |||
| 1da8cc11f2 | |||
| fe7f1346bf | |||
| e334506829 | |||
| d2c83565d9 | |||
| 3c311cc9af | |||
| b509652427 | |||
| 024fe89697 | |||
| dc5f74ce5d | |||
| e6d3a4817e | |||
| c807000e6d | |||
| 18e1093d07 | |||
| b401a8b4c9 | |||
| 6c3cf7dce0 | |||
| bafffc90d1 | |||
| 4f5d62730f | |||
| def6434c79 | |||
| e81aa45dec | |||
| 7075ea60ea | |||
| cecd6ed530 | |||
| 59227e27fa | |||
| 9434b600c9 | |||
| 62b3a19b17 | |||
| 2345dcbdfa | |||
| 8e90f17e65 | |||
| b312ed4b11 | |||
| 961137d435 | |||
| 33fc59cfc5 | |||
| 2273c1f8e7 | |||
| 84b160f432 | |||
| ff32f911a3 | |||
| d8cecb3d25 | |||
| 3054ef4de3 | |||
| a5aa29cd2a | |||
| 3ac9bda79a | |||
| cb6d999911 | |||
| 56c8910c4b | |||
| f37ded7607 | |||
| a70d3dcdb6 | |||
| 4e4264c058 | |||
| 470d53ca58 | |||
| 88d7a6c496 | |||
| 9879ed8f06 | |||
| db9c75632a | |||
| 4a8db46d03 | |||
| db19db585b | |||
| 2e9c7a7af5 | |||
| f3ef477d4c | |||
| 087043b0fe | |||
| bcada07b27 | |||
| 8ddac57a20 | |||
| 2a9a1b8117 | |||
| d91659242b | |||
| 18339a5fa7 | |||
| ea5509263a | |||
| 402709b93d | |||
| 570405db75 | |||
| 4df28116eb | |||
| cc2638d1b2 | |||
| af3eebdcf9 | |||
| 3769c65a97 | |||
| 8bdda22ea1 | |||
| 5dee6a318c | |||
| b280b960e3 | |||
| 3c566431b1 | |||
| 104eb90f4d | |||
| 692ca82c6d | |||
| 262c1241bf | |||
| 62036a3e8b | |||
| 371d086fcb | |||
| bd7702ca83 | |||
| 049c3e85f9 | |||
| 0423dd3b75 | |||
| 0733bec58f | |||
| 24496360d2 | |||
| ac4099d93b | |||
| fab09fb1c6 | |||
| 22d912df33 | |||
| 8f47df378a | |||
| 218d456ca0 | |||
| d9c38222f2 | |||
| c9af94efcd | |||
| bfcc39996f | |||
| 0b80e3a887 | |||
| 7a35fe7213 | |||
| 3222658b8b | |||
| 91e6a55056 | |||
| 6f97a0325c | |||
| 377aa25c81 | |||
| 15217816ff | |||
| 53f513b9c6 | |||
| a622730742 | |||
| 95e0d9ce66 | |||
| 2d78e70d7b | |||
| 01b8a0b596 | |||
| 6165917109 | |||
| a98016f5c7 | |||
| 686a27c470 | |||
| a6f69bb3e1 | |||
| 5b8f9536e0 | |||
| 0bf0a489fb | |||
| 7b5b10df16 | |||
| dfd3cf1ca2 | |||
| ca3cd0d583 | |||
| f526079781 | |||
| 4548c9ac70 | |||
| 8f15bff75d | |||
| 42c06e002a | |||
| a5cd8f3e91 | |||
| 7a6deae378 | |||
| 13d0035479 | |||
| fb22161d75 | |||
| 31e371e554 | |||
| 1aa2996451 | |||
| d33ae4187d | |||
| 1a6d3fe529 | |||
| ce7eed3bbc | |||
| 4ef6372aa4 | |||
| 289afaad9b | |||
| 052c85bd72 | |||
| 3cb0f37200 | |||
| 9113605691 | |||
| 352932e61f | |||
| 98080048cd | |||
| eb1b246855 | |||
| 0c357b9b3f | |||
| d0c63dda2e | |||
| 4b90d6a142 | |||
| 0e0af39f4b | |||
| 79d4938240 | |||
| 25be7facf2 | |||
| 36d7db23d0 | |||
| 020f7e655a | |||
| b613c4bbde | |||
| ace64f66e3 | |||
| e528b5dab4 | |||
| eb0e8f6bd5 | |||
| 76b28ab6c0 | |||
| 10bc8af009 | |||
| 32f001d98d | |||
| 029325bb3b | |||
| 2f6ef17322 | |||
| 10d4819083 | |||
| aa85dad6c1 | |||
| 3415229bf1 | |||
| 40d2a8cb93 | |||
| 932ebd1c2e | |||
| afd992fd6d | |||
| 167d24f052 | |||
| f45045aa85 | |||
| cc2512d450 | |||
| 3a1b6ac250 | |||
| 56edfcf6d5 | |||
| cd7b95205b | |||
| c6d04cbb1c | |||
| 13ba731659 | |||
| 7886051f83 | |||
| b1b41636a4 | |||
| fff6b8b710 | |||
| 64734d59af | |||
| 419fcadcc8 | |||
| 900534adc0 | |||
| a30b75f9f8 | |||
| 87dc0ccfc3 | |||
| 80db7a0873 | |||
| f77fe1c652 | |||
| 801ccfebe4 | |||
| e5e6bb9764 | |||
| 2d4d196f97 | |||
| 719b351f86 | |||
| fc2b45f960 | |||
| fb6e93d98a | |||
| 1281e34e02 | |||
| 865ca1d6a2 | |||
| 0f11899e33 | |||
| da0459f75f | |||
| 8a5b788914 | |||
| 5d893a4748 | |||
| a385c75dca | |||
| 62bd66ccf9 | |||
| 0e7a7318af | |||
| b29be1a2ed | |||
| 3180479b87 | |||
| 7c64a411d7 |
@@ -35,28 +35,29 @@ class block_management_table extends \core_admin\table\plugin_management_table {
|
||||
/** @var stdClass[] A list of basic block data */
|
||||
protected array $blockdata;
|
||||
|
||||
/** @var array<string,int> A list of course counts */
|
||||
protected array $courseblocks;
|
||||
|
||||
public function __construct() {
|
||||
global $DB;
|
||||
parent::__construct();
|
||||
$this->undeletableblocktypes = \block_manager::get_undeletable_block_types();
|
||||
|
||||
$sql = <<<EOF
|
||||
SELECT
|
||||
b.name,
|
||||
b.id,
|
||||
b.name,
|
||||
COUNT(DISTINCT binst.id) as totalcount,
|
||||
COUNT(DISTINCT bcinst.id) as courseviewcount
|
||||
FROM {block} b
|
||||
LEFT JOIN {block_instances} binst ON binst.blockname = b.name
|
||||
LEFT JOIN {block_instances} bcinst ON
|
||||
bcinst.blockname = b.name AND
|
||||
bcinst.pagetypepattern = 'course-view-*'
|
||||
GROUP BY b.id, b.name, b.visible, binst.blockname, bcinst.blockname
|
||||
ORDER BY b.name ASC
|
||||
EOF;
|
||||
|
||||
$sql = 'SELECT b.name,
|
||||
b.id,
|
||||
COUNT(DISTINCT binst.id) as totalcount
|
||||
FROM {block} b
|
||||
LEFT JOIN {block_instances} binst ON binst.blockname = b.name
|
||||
GROUP BY b.id,
|
||||
b.name
|
||||
ORDER BY b.name ASC';
|
||||
$this->blockdata = $DB->get_records_sql($sql);
|
||||
|
||||
$sql = "SELECT blockname
|
||||
FROM {block_instances}
|
||||
WHERE pagetypepattern = 'course-view-*'
|
||||
GROUP BY blockname";
|
||||
$this->courseblocks = $DB->get_records_sql($sql);
|
||||
}
|
||||
|
||||
protected function get_plugintype(): string {
|
||||
@@ -102,11 +103,10 @@ class block_management_table extends \core_admin\table\plugin_management_table {
|
||||
*/
|
||||
protected function col_instances(stdClass $row): string {
|
||||
$blockdata = $this->blockdata[$row->plugininfo->name];
|
||||
if ($blockdata->courseviewcount > 0) {
|
||||
if (array_key_exists($blockdata->name, $this->courseblocks)) {
|
||||
return html_writer::link(
|
||||
new moodle_url('/course/search.php', [
|
||||
'blocklist' => $row->plugininfo->name,
|
||||
'sesskey' => sesskey(),
|
||||
'blocklist' => $blockdata->id,
|
||||
]),
|
||||
$blockdata->totalcount,
|
||||
);
|
||||
|
||||
@@ -57,6 +57,7 @@ Options:
|
||||
--fullname=STRING Name of the site
|
||||
--shortname=STRING Name of the site
|
||||
--summary=STRING The summary to be displayed on the front page
|
||||
--supportemail=STRING Email address for support and help.
|
||||
-h, --help Print out this help
|
||||
|
||||
Example:
|
||||
@@ -98,6 +99,7 @@ list($options, $unrecognized) = cli_get_params(
|
||||
'fullname' => '',
|
||||
'shortname' => '',
|
||||
'summary' => '',
|
||||
'supportemail' => '',
|
||||
'agree-license' => false,
|
||||
'help' => false
|
||||
),
|
||||
@@ -136,6 +138,15 @@ if (!empty($options['adminemail']) && !validate_email($options['adminemail'])) {
|
||||
cli_error(get_string('cliincorrectvalueerror', 'admin', $a));
|
||||
}
|
||||
|
||||
// Validate that the supportemail provided was an e-mail address.
|
||||
if (!empty($options['supportemail']) && !validate_email($options['supportemail'])) {
|
||||
$a = (object) [
|
||||
'option' => 'supportemail',
|
||||
'value' => $options['supportemail']
|
||||
];
|
||||
cli_error(get_string('cliincorrectvalueerror', 'admin', $a));
|
||||
}
|
||||
|
||||
$options['lang'] = clean_param($options['lang'], PARAM_SAFEDIR);
|
||||
if (!file_exists($CFG->dirroot.'/install/lang/'.$options['lang'])) {
|
||||
$options['lang'] = 'en';
|
||||
|
||||
@@ -4114,4 +4114,193 @@
|
||||
</CUSTOM_CHECK>
|
||||
</CUSTOM_CHECKS>
|
||||
</MOODLE>
|
||||
<MOODLE version="4.3" requires="3.11.8">
|
||||
<UNICODE level="required">
|
||||
<FEEDBACK>
|
||||
<ON_ERROR message="unicoderequired" />
|
||||
</FEEDBACK>
|
||||
</UNICODE>
|
||||
<DATABASE level="required">
|
||||
<VENDOR name="mariadb" version="10.6.7" />
|
||||
<VENDOR name="mysql" version="8.0" />
|
||||
<VENDOR name="postgres" version="13" />
|
||||
<VENDOR name="mssql" version="14.0" />
|
||||
<VENDOR name="oracle" version="19" />
|
||||
</DATABASE>
|
||||
<PHP version="8.0.0" 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="required">
|
||||
<FEEDBACK>
|
||||
<ON_ERROR message="mbstringrequired" />
|
||||
</FEEDBACK>
|
||||
</PHP_EXTENSION>
|
||||
<PHP_EXTENSION name="curl" level="required">
|
||||
<FEEDBACK>
|
||||
<ON_ERROR message="curlrequired" />
|
||||
</FEEDBACK>
|
||||
</PHP_EXTENSION>
|
||||
<PHP_EXTENSION name="openssl" level="required">
|
||||
<FEEDBACK>
|
||||
<ON_ERROR message="opensslrequired" />
|
||||
</FEEDBACK>
|
||||
</PHP_EXTENSION>
|
||||
<PHP_EXTENSION name="tokenizer" level="optional">
|
||||
<FEEDBACK>
|
||||
<ON_CHECK message="tokenizerrecommended" />
|
||||
</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="xmlreader" level="required">
|
||||
</PHP_EXTENSION>
|
||||
<PHP_EXTENSION name="intl" level="required">
|
||||
<FEEDBACK>
|
||||
<ON_ERROR message="intlrequired" />
|
||||
</FEEDBACK>
|
||||
</PHP_EXTENSION>
|
||||
<PHP_EXTENSION name="json" level="required">
|
||||
</PHP_EXTENSION>
|
||||
<PHP_EXTENSION name="hash" level="required"/>
|
||||
<PHP_EXTENSION name="fileinfo" level="required"/>
|
||||
<PHP_EXTENSION name="sodium" level="required"/>
|
||||
<PHP_EXTENSION name="exif" level="optional"/>
|
||||
</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_CHECK file="lib/upgradelib.php" function="check_unoconv_version" level="optional">
|
||||
<FEEDBACK>
|
||||
<ON_CHECK message="unoconvwarning" />
|
||||
</FEEDBACK>
|
||||
</CUSTOM_CHECK>
|
||||
<CUSTOM_CHECK file="lib/upgradelib.php" function="check_libcurl_version" level="optional">
|
||||
<FEEDBACK>
|
||||
<ON_CHECK message="libcurlwarning" />
|
||||
</FEEDBACK>
|
||||
</CUSTOM_CHECK>
|
||||
<CUSTOM_CHECK file="lib/upgradelib.php" function="check_mysql_file_format" level="required">
|
||||
<FEEDBACK>
|
||||
<ON_ERROR message="unsupporteddbfileformat" />
|
||||
</FEEDBACK>
|
||||
</CUSTOM_CHECK>
|
||||
<CUSTOM_CHECK file="lib/upgradelib.php" function="check_mysql_file_per_table" level="required">
|
||||
<FEEDBACK>
|
||||
<ON_ERROR message="unsupporteddbfilepertable" />
|
||||
</FEEDBACK>
|
||||
</CUSTOM_CHECK>
|
||||
<CUSTOM_CHECK file="lib/upgradelib.php" function="check_mysql_large_prefix" level="required">
|
||||
<FEEDBACK>
|
||||
<ON_ERROR message="unsupporteddblargeprefix" />
|
||||
</FEEDBACK>
|
||||
</CUSTOM_CHECK>
|
||||
<CUSTOM_CHECK file="lib/upgradelib.php" function="check_is_https" level="optional">
|
||||
<FEEDBACK>
|
||||
<ON_CHECK message="ishttpswarning" />
|
||||
</FEEDBACK>
|
||||
</CUSTOM_CHECK>
|
||||
<CUSTOM_CHECK file="lib/upgradelib.php" function="check_mysql_incomplete_unicode_support" level="optional">
|
||||
<FEEDBACK>
|
||||
<ON_CHECK message="incompleteunicodesupport" />
|
||||
</FEEDBACK>
|
||||
</CUSTOM_CHECK>
|
||||
<CUSTOM_CHECK file="lib/upgradelib.php" function="check_sixtyfour_bits" level="required">
|
||||
<FEEDBACK>
|
||||
<ON_ERROR message="sixtyfourbitsrequired" />
|
||||
</FEEDBACK>
|
||||
</CUSTOM_CHECK>
|
||||
<CUSTOM_CHECK file="lib/upgradelib.php" function="check_max_input_vars" level="optional">
|
||||
</CUSTOM_CHECK>
|
||||
<CUSTOM_CHECK file="lib/upgradelib.php" function="check_admin_dir_usage" level="optional">
|
||||
<FEEDBACK>
|
||||
<ON_CHECK message="iscustomadminwarnings" />
|
||||
</FEEDBACK>
|
||||
</CUSTOM_CHECK>
|
||||
<CUSTOM_CHECK file="lib/upgradelib.php" function="check_xmlrpc_usage" level="optional">
|
||||
</CUSTOM_CHECK>
|
||||
<CUSTOM_CHECK file="lib/upgradelib.php" function="check_mod_assignment" level="required">
|
||||
</CUSTOM_CHECK>
|
||||
</CUSTOM_CHECKS>
|
||||
</MOODLE>
|
||||
</COMPATIBILITY_MATRIX>
|
||||
|
||||
+4
-8
@@ -96,20 +96,16 @@ function core_admin_pluginfile($course, $cm, $context, $filearea, $args, $forced
|
||||
send_file_not_found();
|
||||
}
|
||||
|
||||
// No need for resizing, but if the file should be cached we save it so we can serve it fast next time.
|
||||
if (empty($maxwidth) && empty($maxheight)) {
|
||||
// Check whether width/height are specified, and we can resize the image (some types such as ICO cannot be resized).
|
||||
if (($maxwidth === 0 && $maxheight === 0) ||
|
||||
!$filedata = $file->resize_image($maxwidth, $maxheight)) {
|
||||
|
||||
if ($lifetime) {
|
||||
file_safe_save_content($file->get_content(), $candidate);
|
||||
}
|
||||
send_stored_file($file, $lifetime, 0, false, $options);
|
||||
}
|
||||
|
||||
// Proceed with the resizing.
|
||||
$filedata = $file->resize_image($maxwidth, $maxheight);
|
||||
if (!$filedata) {
|
||||
send_file_not_found();
|
||||
}
|
||||
|
||||
// If we don't want to cached the file, serve now and quit.
|
||||
if (!$lifetime) {
|
||||
send_content_uncached($filedata, $filename);
|
||||
|
||||
@@ -26,6 +26,9 @@ namespace core_adminpresets\local\setting;
|
||||
*/
|
||||
class adminpresets_admin_setting_configmultiselect extends adminpresets_setting {
|
||||
|
||||
/** @var \admin_setting_configmultiselect $settingdata */
|
||||
protected $settingdata;
|
||||
|
||||
/**
|
||||
* Ensure that the $value values are setting choices.
|
||||
*
|
||||
|
||||
@@ -26,6 +26,9 @@ namespace core_adminpresets\local\setting;
|
||||
*/
|
||||
class adminpresets_admin_setting_configselect extends adminpresets_setting {
|
||||
|
||||
/** @var \admin_setting_configselect $settingdata */
|
||||
protected $settingdata;
|
||||
|
||||
/**
|
||||
* Sets the setting value cleaning it.
|
||||
*
|
||||
|
||||
@@ -26,6 +26,9 @@ namespace core_adminpresets\local\setting;
|
||||
*/
|
||||
class adminpresets_admin_setting_configtime extends adminpresets_setting {
|
||||
|
||||
/** @var \admin_setting_configtime $settingdata */
|
||||
protected $settingdata;
|
||||
|
||||
/**
|
||||
* To check that the value is one of the options
|
||||
*
|
||||
|
||||
@@ -28,6 +28,9 @@ namespace core_adminpresets\local\setting;
|
||||
*/
|
||||
class adminpresets_admin_setting_special_backupdays extends adminpresets_setting {
|
||||
|
||||
/** @var \admin_setting_special_backupdays $settingdata */
|
||||
protected $settingdata;
|
||||
|
||||
protected function set_value($value) {
|
||||
$this->value = clean_param($value, PARAM_SEQUENCE);
|
||||
$this->set_visiblevalue();
|
||||
|
||||
+3
@@ -26,6 +26,9 @@ namespace core_adminpresets\local\setting;
|
||||
*/
|
||||
class adminpresets_admin_setting_users_with_capability extends adminpresets_admin_setting_configmultiselect {
|
||||
|
||||
/** @var \admin_setting_configmultiselect $settingdata */
|
||||
protected $settingdata;
|
||||
|
||||
protected function set_behaviors() {
|
||||
$this->behaviors['loadchoices'] = &$this->settingdata;
|
||||
}
|
||||
|
||||
@@ -141,7 +141,6 @@ abstract class core_role_allow_role_page {
|
||||
$table->cellspacing = 0;
|
||||
$table->width = '90%';
|
||||
$table->align = array('left');
|
||||
$table->rotateheaders = true;
|
||||
$table->head = array(' ');
|
||||
$table->colclasses = array('');
|
||||
|
||||
|
||||
@@ -34,8 +34,11 @@ Feature: Manage availability conditions
|
||||
Given the following "courses" exist:
|
||||
| fullname | shortname | format |
|
||||
| Course 1 | C1 | topics |
|
||||
And the following "activity" exists:
|
||||
| activity | page |
|
||||
| course | C1 |
|
||||
| name | P1 |
|
||||
And I log in as "admin"
|
||||
And I am on site homepage
|
||||
When I navigate to "Plugins > Availability restrictions > Manage restrictions" in site administration
|
||||
|
||||
# Check the icon is there (it should be a Hide icon, meaning is currently visible).
|
||||
@@ -51,8 +54,7 @@ Feature: Manage availability conditions
|
||||
|
||||
# OK, toggling works. Set the grade one to Hide and we'll go see if it actually worked.
|
||||
And I click on "Hide" "icon" in the "Restriction by grade" "table_row"
|
||||
And I am on "Course 1" course homepage with editing mode on
|
||||
And I add a "Page" to section "1"
|
||||
And I am on the "P1" "page activity editing" page
|
||||
And I expand all fieldsets
|
||||
And I click on "Add restriction..." "button"
|
||||
And "Add restriction..." "dialogue" should be visible
|
||||
|
||||
@@ -21,12 +21,15 @@ Feature: Edit capabilities
|
||||
|
||||
Scenario: Default system capabilities modification
|
||||
Given I log in as "admin"
|
||||
And I set the following system permissions of "Teacher" role:
|
||||
And I navigate to "Users > Permissions > Define roles" in site administration
|
||||
And I click on "Edit Teacher role" "link"
|
||||
And I fill the capabilities form with the following permissions:
|
||||
| capability | permission |
|
||||
| block/mnet_hosts:myaddinstance | Allow |
|
||||
| moodle/site:messageanyuser | Inherit |
|
||||
| moodle/grade:managesharedforms | Prevent |
|
||||
| moodle/course:request | Prohibit |
|
||||
And I press "Save changes"
|
||||
When I follow "Edit Teacher role"
|
||||
Then "block/mnet_hosts:myaddinstance" capability has "Allow" permission
|
||||
And "moodle/site:messageanyuser" capability has "Not set" permission
|
||||
@@ -48,16 +51,12 @@ Feature: Edit capabilities
|
||||
And "mod/forum:addquestion" capability has "Allow" permission
|
||||
|
||||
Scenario: Module capabilities overrides
|
||||
Given I log in as "teacher1"
|
||||
And the following "activity" exists:
|
||||
Given the following "activity" exists:
|
||||
| activity | forum |
|
||||
| course | C1 |
|
||||
| idnumber | 00001 |
|
||||
| name | I'm the name |
|
||||
| intro | I'm the introduction |
|
||||
| section | 1 |
|
||||
And I am on "Course 1" course homepage with editing mode on
|
||||
And I follow "I'm the name"
|
||||
And I am on the "I'm the name" "forum activity" page logged in as teacher1
|
||||
And I navigate to "Permissions" in current page administration
|
||||
And I override the system permissions of "Student" role with:
|
||||
| mod/forum:deleteanypost | Prohibit |
|
||||
|
||||
+44
-2
@@ -379,19 +379,61 @@ class brickfield_accessibility_test {
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns an array of the newwindowphrases for all enabled language packs.
|
||||
* @return array of the newwindowphrases for all enabled language packs.
|
||||
*/
|
||||
public static function get_all_newwindowphrases(): array {
|
||||
// Need to process all enabled lang versions of newwindowphrases.
|
||||
return static::get_all_phrases('newwindowphrases');
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns an array of the invalidlinkphrases for all enabled language packs.
|
||||
* @return array of the invalidlinkphrases for all enabled language packs.
|
||||
*/
|
||||
public static function get_all_invalidlinkphrases(): array {
|
||||
// Need to process all enabled lang versions of invalidlinkphrases.
|
||||
return static::get_all_phrases('invalidlinkphrases');
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns an array of the relevant phrases for all enabled language packs.
|
||||
* @param string $stringname the language string identifier you want get the phrases for.
|
||||
* @return array of the invalidlinkphrases for all enabled language packs.
|
||||
*/
|
||||
protected static function get_all_phrases(string $stringname): array {
|
||||
$stringmgr = get_string_manager();
|
||||
$allstrings = [];
|
||||
$enabledlangs = get_string_manager()->get_list_of_translations();
|
||||
|
||||
// Somehow, an invalid string was requested. Add exception handling for this in the future.
|
||||
if (!$stringmgr->string_exists($stringname, manager::PLUGINNAME)) {
|
||||
return $allstrings;
|
||||
}
|
||||
|
||||
// Need to process all enabled lang versions of invalidlinkphrases.
|
||||
$enabledlangs = $stringmgr->get_list_of_translations();
|
||||
foreach ($enabledlangs as $lang => $value) {
|
||||
$tmpstring = (string)new \lang_string('invalidlinkphrases', manager::PLUGINNAME, null, $lang);
|
||||
$tmpstring = (string)new \lang_string($stringname, manager::PLUGINNAME, null, $lang);
|
||||
$tmplangarray = explode('|', $tmpstring);
|
||||
$allstrings = array_merge($allstrings, $tmplangarray);
|
||||
}
|
||||
// Removing duplicates if a lang is enabled, yet using default 'en' due to no relevant lang file.
|
||||
$allstrings = array_unique($allstrings);
|
||||
return $allstrings;
|
||||
}
|
||||
|
||||
/**
|
||||
* Assesses whether a string contains any readable text, which is text that
|
||||
* contains any characters other than whitespace characters.
|
||||
*
|
||||
* @param string $text
|
||||
* @return bool
|
||||
*/
|
||||
public static function is_text_readable(string $text): bool {
|
||||
// These characters in order are a space, tab, line feed, carriage return,
|
||||
// NUL-byte, vertical tab and non-breaking space unicode character \xc2\xa0.
|
||||
$emptycharacters = " \t\n\r\0\x0B\xc2\xa0";
|
||||
return trim($text, $emptycharacters) != '';
|
||||
}
|
||||
}
|
||||
|
||||
+19
-1
@@ -39,9 +39,27 @@ class a_links_dont_open_new_window extends brickfield_accessibility_test {
|
||||
* The main check function. This is called by the parent class to actually check content.
|
||||
*/
|
||||
public function check(): void {
|
||||
|
||||
// Need to process all enabled lang versions of newwindowphrases.
|
||||
$text = brickfield_accessibility_test::get_all_newwindowphrases();
|
||||
|
||||
foreach ($this->get_all_elements('a') as $a) {
|
||||
if ($a->hasAttribute('target') && !in_array($a->getAttribute('target'), $this->allowedtargets)) {
|
||||
$this->add_report($a);
|
||||
$phrasefound = false;
|
||||
foreach ($text as $phrase) {
|
||||
// Sanity check for readable text.
|
||||
if (!brickfield_accessibility_test::is_text_readable($phrase)) {
|
||||
break;
|
||||
}
|
||||
$pos = stripos($a->nodeValue, $phrase);
|
||||
if ($pos !== false) {
|
||||
$phrasefound = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (!$phrasefound) {
|
||||
$this->add_report($a);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+18
-1
@@ -39,9 +39,26 @@ class area_dont_open_new_window extends brickfield_accessibility_test {
|
||||
* The main check function. This is called by the parent class to actually check content
|
||||
*/
|
||||
public function check(): void {
|
||||
// Need to process all enabled lang versions of newwindowphrases.
|
||||
$text = brickfield_accessibility_test::get_all_newwindowphrases();
|
||||
|
||||
foreach ($this->get_all_elements('area') as $area) {
|
||||
if ($area->hasAttribute('target') && !in_array($area->getAttribute('target'), $this->allowedtargets)) {
|
||||
$this->add_report($area);
|
||||
$phrasefound = false;
|
||||
foreach ($text as $phrase) {
|
||||
// Sanity check for readable text.
|
||||
if (!brickfield_accessibility_test::is_text_readable($phrase)) {
|
||||
break;
|
||||
}
|
||||
$pos = stripos($area->getAttribute('alt'), $phrase);
|
||||
if ($pos !== false) {
|
||||
$phrasefound = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (!$phrasefound) {
|
||||
$this->add_report($area);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -76,7 +76,6 @@ class renderer extends plugin_renderer_base {
|
||||
$label = $tool->get_toolshortname();
|
||||
}
|
||||
$tab = new tabobject($idprefix . $toolname, $link, $label);
|
||||
$tab->extraclass = isset($extraclass[$toolname]) ? $extraclass[$toolname] : null;
|
||||
$tabs[] = $tab;
|
||||
}
|
||||
return $this->render(new tabtree($tabs, $idprefix . $filter->tab));
|
||||
|
||||
@@ -93,6 +93,7 @@ $string['invalidcourseid'] = 'Invalid course, please check your input';
|
||||
$string['invalidlinkphrases'] = 'click|click here|here|more|more here|info|info here|information|information here|read more|read more here|further information|further information here|further details|further details here';
|
||||
$string['module'] = 'Module';
|
||||
$string['modulename'] = 'Name';
|
||||
$string['newwindowphrases'] = 'new window|new-window|new_window';
|
||||
$string['noerrorsfound'] = 'No common accessibility errors were found for your search parameters. Congratulations!';
|
||||
$string['norecords'] = 'No relevant records were found for your search parameters.';
|
||||
$string['notregistered'] = 'Your accessibility toolkit needs to be registered.';
|
||||
|
||||
+16
@@ -87,6 +87,19 @@ EOD;
|
||||
</html>
|
||||
EOD;
|
||||
|
||||
/** @var string Html pass 4 */
|
||||
private $htmlpass4 = <<<EOD
|
||||
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN""http://www.w3.org/TR/REC-html40/loose.dtd">
|
||||
<html lang="en">
|
||||
<head>
|
||||
<title>A link can indicate that it will open in a new window</title>
|
||||
</head>
|
||||
<body>
|
||||
<a href="www.youtube.com" target="_blank">This is youtube (opens in a new window)</a>
|
||||
</body>
|
||||
</html>
|
||||
EOD;
|
||||
|
||||
/**
|
||||
* Test for links opening a new tab or window
|
||||
*/
|
||||
@@ -102,5 +115,8 @@ EOD;
|
||||
|
||||
$results = $this->get_checker_results($this->htmlpass3);
|
||||
$this->assertEmpty($results);
|
||||
|
||||
$results = $this->get_checker_results($this->htmlpass4);
|
||||
$this->assertEmpty($results);
|
||||
}
|
||||
}
|
||||
|
||||
+16
@@ -87,6 +87,19 @@ EOD;
|
||||
</html>
|
||||
EOD;
|
||||
|
||||
/** @var string Html pass 4 */
|
||||
private $htmlpass4 = <<<EOD
|
||||
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN""http://www.w3.org/TR/REC-html40/loose.dtd">
|
||||
<html lang="en">
|
||||
<head>
|
||||
<title>A link can indicate that it will open in a new window</title>
|
||||
</head>
|
||||
<body>
|
||||
<area target="_blank" alt="(opens in a new window)"></area>
|
||||
</body>
|
||||
</html>
|
||||
EOD;
|
||||
|
||||
/**
|
||||
* Test Area tags opening new window without warning
|
||||
*/
|
||||
@@ -102,5 +115,8 @@ EOD;
|
||||
|
||||
$results = $this->get_checker_results($this->htmlpass3);
|
||||
$this->assertEmpty($results);
|
||||
|
||||
$results = $this->get_checker_results($this->htmlpass4);
|
||||
$this->assertEmpty($results);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -288,7 +288,7 @@ class data_requests_table extends table_sql {
|
||||
$actionsmenu = new action_menu($actions);
|
||||
$actionsmenu->set_menu_trigger(get_string('actions'));
|
||||
$actionsmenu->set_owner_selector('request-actions-' . $requestid);
|
||||
$actionsmenu->set_constraint('[data-region=data-requests-table] > .no-overflow');
|
||||
$actionsmenu->set_boundary('window');
|
||||
|
||||
return $OUTPUT->render($actionsmenu);
|
||||
}
|
||||
|
||||
@@ -71,7 +71,7 @@
|
||||
{{/filter}}
|
||||
</div>
|
||||
|
||||
<div class="mt-1 mb-1" data-region="data-requests-table">
|
||||
<div class="position-relative mt-1 mb-1" data-region="data-requests-table">
|
||||
{{{datarequests}}}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -30,6 +30,12 @@ Feature: Protected data should not be deleted
|
||||
| Site purpose | PT1H | 0 |
|
||||
| prot | P1D | 1 |
|
||||
| unprot | P1D | 0 |
|
||||
And the following "mod_forum > discussions" exist:
|
||||
| user | forum | name | message |
|
||||
| u1 | forump1 | Discussion subject | Test post in forump1 |
|
||||
| u1 | forumu1 | Discussion subject | Test post in forumu1 |
|
||||
| u1 | forump2 | Discussion subject | Test post in forump2 |
|
||||
| u1 | forumu2 | Discussion subject | Test post in forumu2 |
|
||||
And I set the category and purpose for the "forump1" "forum" in course "C1" to "CAT" and "prot"
|
||||
And I set the category and purpose for the "forump2" "forum" in course "C2" to "CAT" and "prot"
|
||||
And I set the category and purpose for the "forumu1" "forum" in course "C1" to "CAT" and "unprot"
|
||||
@@ -38,47 +44,25 @@ Feature: Protected data should not be deleted
|
||||
|
||||
@javascripta
|
||||
Scenario: Unexpired and protected data is not removed
|
||||
Given I log in as "u1"
|
||||
And I am on "C1" course homepage
|
||||
And I add a new discussion to "forump1" forum with:
|
||||
| Subject | Discussion subject |
|
||||
| Message | Test post in forump1 |
|
||||
And I am on "C1" course homepage
|
||||
And I add a new discussion to "forumu1" forum with:
|
||||
| Subject | Discussion subject |
|
||||
| Message | Test post in forumu1 |
|
||||
And I am on "C2" course homepage
|
||||
And I add a new discussion to "forump2" forum with:
|
||||
| Subject | Discussion subject |
|
||||
| Message | Test post in forump2 |
|
||||
And I am on "C2" course homepage
|
||||
And I add a new discussion to "forumu2" forum with:
|
||||
| Subject | Discussion subject |
|
||||
| Message | Test post in forumu2 |
|
||||
And I log out
|
||||
And I log in as "admin"
|
||||
Given I log in as "admin"
|
||||
And I create a dataprivacy "delete" request for "u1"
|
||||
And I approve a dataprivacy "delete" request for "u1"
|
||||
And I run all adhoc tasks
|
||||
And I navigate to "Users > Privacy and policies > Data requests" in site administration
|
||||
And I should see "Deleted" in the "u1" "table_row"
|
||||
|
||||
And I am on "C1" course homepage
|
||||
And I follow "forump1"
|
||||
And I am on the "forump1" "forum activity" page
|
||||
And I follow "Discussion subject"
|
||||
Then I should not see "Test post in forump1"
|
||||
|
||||
When I am on "C1" course homepage
|
||||
And I follow "forumu1"
|
||||
When I am on the "forumu1" "forum activity" page
|
||||
And I follow "Discussion subject"
|
||||
Then I should not see "Test post in forumu1"
|
||||
|
||||
And I am on "C2" course homepage
|
||||
And I follow "forump2"
|
||||
And I am on the "forump2" "forum activity" page
|
||||
And I follow "Discussion subject"
|
||||
Then I should see "Test post in forump2"
|
||||
|
||||
When I am on "C2" course homepage
|
||||
And I follow "forumu2"
|
||||
When I am on the "forumu2" "forum activity" page
|
||||
And I follow "Discussion subject"
|
||||
Then I should not see "Test post in forumu2"
|
||||
|
||||
@@ -15,6 +15,17 @@ Feature: Manage plan workflow
|
||||
| usermanageowndraftplan | User manage own draft plan role | user |
|
||||
| usermanageownplan | User manage own plan role | user |
|
||||
| manageplan | Manager all plans role | manager |
|
||||
And the following "role capabilities" exist:
|
||||
| role | moodle/competency:planmanageowndraft | moodle/competency:planmanageown |
|
||||
| usermanageowndraftplan | allow | |
|
||||
| usermanageownplan | allow | allow |
|
||||
| manageplan | allow | allow |
|
||||
And the following "role capability" exists:
|
||||
| role | manageplan |
|
||||
| moodle/competency:planmanage | allow |
|
||||
| moodle/competency:planview | allow |
|
||||
| moodle/competency:planreview | allow |
|
||||
| moodle/competency:planrequestreview | allow |
|
||||
And the following "role assigns" exist:
|
||||
| user | role | contextlevel | reference |
|
||||
| user1 | usermanageowndraftplan | System | |
|
||||
@@ -40,23 +51,6 @@ Feature: Manage plan workflow
|
||||
And the following "blocks" exist:
|
||||
| blockname | contextlevel | reference | pagetypepattern | defaultregion |
|
||||
| lp | System | 1 | my-index | content |
|
||||
And I log in as "admin"
|
||||
And I set the following system permissions of "User manage own draft plan role" role:
|
||||
| capability | permission |
|
||||
| moodle/competency:planmanageowndraft | Allow |
|
||||
And I set the following system permissions of "User manage own plan role" role:
|
||||
| capability | permission |
|
||||
| moodle/competency:planmanageowndraft | Allow |
|
||||
| moodle/competency:planmanageown | Allow |
|
||||
And I set the following system permissions of "Manager all plans role" role:
|
||||
| capability | permission |
|
||||
| moodle/competency:planmanage | Allow |
|
||||
| moodle/competency:planmanagedraft | Allow |
|
||||
| moodle/competency:planmanageowndraft | Allow |
|
||||
| moodle/competency:planview | Allow |
|
||||
| moodle/competency:planreview | Allow |
|
||||
| moodle/competency:planrequestreview | Allow |
|
||||
And I log out
|
||||
|
||||
Scenario: User can manages his own plan draft
|
||||
Given I log in as "user1"
|
||||
|
||||
@@ -25,6 +25,8 @@
|
||||
require_once(__DIR__ . '/../../../config.php');
|
||||
require_once($CFG->libdir.'/adminlib.php');
|
||||
|
||||
admin_externalpage_setup('toollpexportcsv');
|
||||
|
||||
$pagetitle = get_string('exportnavlink', 'tool_lpimportcsv');
|
||||
|
||||
$context = context_system::instance();
|
||||
|
||||
@@ -25,6 +25,8 @@ define('NO_OUTPUT_BUFFERING', true);
|
||||
require_once(__DIR__ . '/../../../config.php');
|
||||
require_once($CFG->libdir.'/adminlib.php');
|
||||
|
||||
admin_externalpage_setup('toollpimportcsv');
|
||||
|
||||
$pagetitle = get_string('pluginname', 'tool_lpimportcsv');
|
||||
|
||||
$context = context_system::instance();
|
||||
|
||||
@@ -222,7 +222,7 @@ function tool_mobile_standard_footer_html() {
|
||||
global $CFG;
|
||||
$output = '';
|
||||
if (!empty($CFG->enablemobilewebservice) && $url = tool_mobile_create_app_download_url()) {
|
||||
$output .= html_writer::link($url, get_string('getmoodleonyourmobile', 'tool_mobile'));
|
||||
$output .= html_writer::link($url, get_string('getmoodleonyourmobile', 'tool_mobile'), ['class' => 'mobilelink']);
|
||||
}
|
||||
return $output;
|
||||
}
|
||||
|
||||
@@ -31,7 +31,6 @@ define('NO_DEBUG_DISPLAY', true);
|
||||
define('NO_MOODLE_COOKIES', true);
|
||||
|
||||
require_once(__DIR__ . '/../../../config.php');
|
||||
use tool_mobile\api;
|
||||
|
||||
header('Content-Type: application/json; charset: utf-8');
|
||||
|
||||
@@ -41,7 +40,9 @@ if (!empty($CFG->enablemobilewebservice) && !empty($mobilesettings->enablesmarta
|
||||
!empty($mobilesettings->androidappid)) {
|
||||
|
||||
$manifest = new StdClass;
|
||||
$manifest->short_name = format_string($SITE->shortname);
|
||||
$manifest->short_name = format_string($SITE->shortname, true, [
|
||||
'context' => \core\context\system::instance(),
|
||||
]);
|
||||
$manifest->prefer_related_applications = true;
|
||||
$manifest->icons = [(object)
|
||||
[
|
||||
|
||||
@@ -194,10 +194,9 @@ class subscription_manager {
|
||||
if (!is_null($coursecontext)) {
|
||||
$context = $coursecontext;
|
||||
$courseid = $subscription->courseid;
|
||||
} else if (!empty($subscription->courseid) && ($coursecontext =
|
||||
} else if (!empty($subscription->courseid) && ($context =
|
||||
\context_course::instance($subscription->courseid, IGNORE_MISSING))) {
|
||||
$courseid = $subscription->courseid;
|
||||
$context = $coursecontext;
|
||||
} else {
|
||||
$courseid = 0;
|
||||
$context = \context_system::instance();
|
||||
|
||||
@@ -169,10 +169,9 @@ Feature: tool_monitor_subscriptions
|
||||
And I should not see "You can manage rules the from the Event monitoring rules page."
|
||||
|
||||
Scenario: No manage rules link when user does not have permission
|
||||
Given I log in as "admin"
|
||||
And I set the following system permissions of "Non-editing teacher" role:
|
||||
| tool/monitor:managerules | Prohibit |
|
||||
And I log out
|
||||
Given the following "role capability" exists:
|
||||
| role | teacher |
|
||||
| tool/monitor:managerules | prohibit |
|
||||
And I log in as "teacher1"
|
||||
And I follow "Preferences" in the user menu
|
||||
And I follow "Event monitoring"
|
||||
|
||||
@@ -48,8 +48,8 @@ use tool_policy\policy_version;
|
||||
*/
|
||||
class page_viewalldoc implements renderable, templatable {
|
||||
|
||||
/** @var string Return url */
|
||||
private $returnurl;
|
||||
/** @var ?moodle_url Return url */
|
||||
private $returnurl = null;
|
||||
|
||||
/** @var array List current (active) policy versions. */
|
||||
private array $policies = [];
|
||||
@@ -59,7 +59,10 @@ class page_viewalldoc implements renderable, templatable {
|
||||
*
|
||||
*/
|
||||
public function __construct($returnurl) {
|
||||
$this->returnurl = $returnurl;
|
||||
if (!empty($returnurl)) {
|
||||
$this->returnurl = new moodle_url($returnurl);
|
||||
}
|
||||
|
||||
$this->prepare_global_page_access();
|
||||
$this->prepare_policies();
|
||||
}
|
||||
|
||||
@@ -48,11 +48,9 @@ Feature: Viewing acceptances reports and accepting on behalf of other users
|
||||
And "Pending" "text" should exist in the "User Two" "table_row"
|
||||
|
||||
Scenario: Agree on behalf of another user as a manager, single policy, javascript off
|
||||
Given I log in as "admin"
|
||||
And I set the following system permissions of "Manager" role:
|
||||
| capability | permission |
|
||||
| tool/policy:acceptbehalf | Allow |
|
||||
And I log out
|
||||
Given the following "role capability" exists:
|
||||
| role | manager |
|
||||
| tool/policy:acceptbehalf | allow |
|
||||
When I log in as "manager"
|
||||
And I press "Next"
|
||||
And I set the field "I agree to the This site policy" to "1"
|
||||
@@ -73,11 +71,9 @@ Feature: Viewing acceptances reports and accepting on behalf of other users
|
||||
|
||||
@javascript
|
||||
Scenario: Agree on behalf of another user as a manager, single policy, javascript on
|
||||
Given I log in as "admin"
|
||||
And I set the following system permissions of "Manager" role:
|
||||
| capability | permission |
|
||||
| tool/policy:acceptbehalf | Allow |
|
||||
And I log out
|
||||
Given the following "role capability" exists:
|
||||
| role | manager |
|
||||
| tool/policy:acceptbehalf | allow |
|
||||
When I log in as "manager"
|
||||
And I press "Next"
|
||||
And I set the field "I agree to the This site policy" to "1"
|
||||
@@ -135,13 +131,13 @@ Feature: Viewing acceptances reports and accepting on behalf of other users
|
||||
And "Pending" "text" should exist in the "This privacy policy" "table_row"
|
||||
|
||||
Scenario: Agree on behalf of another user as a manager, multiple policies, javascript off
|
||||
Given I log in as "admin"
|
||||
Given the following "role capability" exists:
|
||||
| role | manager |
|
||||
| tool/policy:acceptbehalf | allow |
|
||||
And I log in as "admin"
|
||||
And I navigate to "Users > Privacy and policies > Manage policies" in site administration
|
||||
And I click on "Set status to \"Active\"" "link" in the "This privacy policy" "table_row"
|
||||
And I press "Continue"
|
||||
And I set the following system permissions of "Manager" role:
|
||||
| capability | permission |
|
||||
| tool/policy:acceptbehalf | Allow |
|
||||
And I log out
|
||||
When I log in as "manager"
|
||||
And I press "Next"
|
||||
@@ -167,14 +163,14 @@ Feature: Viewing acceptances reports and accepting on behalf of other users
|
||||
|
||||
@javascript
|
||||
Scenario: Agree on behalf of another user as a manager, multiple policies, javascript on
|
||||
Given I log in as "admin"
|
||||
Given the following "role capability" exists:
|
||||
| role | manager |
|
||||
| tool/policy:acceptbehalf | allow |
|
||||
And I log in as "admin"
|
||||
And I navigate to "Users > Privacy and policies > Manage policies" in site administration
|
||||
And I click on "Actions" "link_or_button" in the "This privacy policy" "table_row"
|
||||
And I click on "Set status to \"Active\"" "link" in the "This privacy policy" "table_row"
|
||||
And I press "Activate"
|
||||
And I set the following system permissions of "Manager" role:
|
||||
| capability | permission |
|
||||
| tool/policy:acceptbehalf | Allow |
|
||||
And I log out
|
||||
When I log in as "manager"
|
||||
And I press "Next"
|
||||
@@ -215,11 +211,9 @@ Feature: Viewing acceptances reports and accepting on behalf of other users
|
||||
And I should not see "Policies and agreements"
|
||||
|
||||
Scenario: Policies and agreements profile link visible also for users who can access on behalf of others
|
||||
Given I log in as "admin"
|
||||
And I set the following system permissions of "Manager" role:
|
||||
| capability | permission |
|
||||
| tool/policy:acceptbehalf | Allow |
|
||||
And I log out
|
||||
Given the following "role capability" exists:
|
||||
| role | manager |
|
||||
| tool/policy:acceptbehalf | allow |
|
||||
And I log in as "manager"
|
||||
And I press "Next"
|
||||
And I set the field "I agree to the This site policy" to "1"
|
||||
@@ -231,11 +225,9 @@ Feature: Viewing acceptances reports and accepting on behalf of other users
|
||||
Then I should see "Policies and agreements"
|
||||
|
||||
Scenario: Agree on behalf of another user as an admin who is logged in as a manager
|
||||
Given I log in as "admin"
|
||||
And I set the following system permissions of "Manager" role:
|
||||
| capability | permission |
|
||||
| tool/policy:acceptbehalf | Allow |
|
||||
And I log out
|
||||
Given the following "role capability" exists:
|
||||
| role | manager |
|
||||
| tool/policy:acceptbehalf | allow |
|
||||
When I log in as "manager"
|
||||
And I press "Next"
|
||||
And I set the field "I agree to the This site policy" to "1"
|
||||
@@ -261,14 +253,14 @@ Feature: Viewing acceptances reports and accepting on behalf of other users
|
||||
|
||||
@javascript
|
||||
Scenario: Bulk agree on behalf of another users as a manager, multiple policies, javascript on
|
||||
Given I log in as "admin"
|
||||
Given the following "role capability" exists:
|
||||
| role | manager |
|
||||
| tool/policy:acceptbehalf | allow |
|
||||
And I log in as "admin"
|
||||
And I navigate to "Users > Privacy and policies > Manage policies" in site administration
|
||||
And I click on "Actions" "link_or_button" in the "This privacy policy" "table_row"
|
||||
And I click on "Set status to \"Active\"" "link" in the "This privacy policy" "table_row"
|
||||
And I press "Activate"
|
||||
And I set the following system permissions of "Manager" role:
|
||||
| capability | permission |
|
||||
| tool/policy:acceptbehalf | Allow |
|
||||
And I log out
|
||||
When I log in as "manager"
|
||||
And I press "Next"
|
||||
|
||||
@@ -101,7 +101,7 @@ class tool_uploadcourse_course {
|
||||
/** @var array fields allowed as course data. */
|
||||
static protected $validfields = array('fullname', 'shortname', 'idnumber', 'category', 'visible', 'startdate', 'enddate',
|
||||
'summary', 'format', 'theme', 'lang', 'newsitems', 'showgrades', 'showreports', 'legacyfiles', 'maxbytes',
|
||||
'groupmode', 'groupmodeforce', 'enablecompletion', 'downloadcontent');
|
||||
'groupmode', 'groupmodeforce', 'enablecompletion', 'downloadcontent', 'showactivitydates');
|
||||
|
||||
/** @var array fields required on course creation. */
|
||||
static protected $mandatoryfields = array('fullname', 'category');
|
||||
|
||||
@@ -192,6 +192,10 @@ class tool_uploadcourse_step2_form extends tool_uploadcourse_base_form {
|
||||
$mform->addHelpButton('defaults[enablecompletion]', 'enablecompletion', 'completion');
|
||||
}
|
||||
|
||||
$mform->addElement('selectyesno', 'defaults[showactivitydates]', get_string('showactivitydates'));
|
||||
$mform->addHelpButton('defaults[showactivitydates]', 'showactivitydates');
|
||||
$mform->setDefault('defaults[showactivitydates]', $courseconfig->showactivitydates);
|
||||
|
||||
// Add custom fields to the form.
|
||||
$handler = \core_course\customfield\course_handler::create();
|
||||
$handler->instance_form_definition($mform, 0, 'defaultvaluescustomfieldcategory', 'tool_uploadcourse');
|
||||
|
||||
@@ -166,6 +166,7 @@ $defaults['groupmodeforce'] = $courseconfig->groupmodeforce;
|
||||
$defaults['visible'] = $courseconfig->visible;
|
||||
$defaults['lang'] = $courseconfig->lang;
|
||||
$defaults['enablecompletion'] = $courseconfig->enablecompletion;
|
||||
$defaults['showactivitydates'] = $courseconfig->showactivitydates;
|
||||
|
||||
// Course template.
|
||||
if (isset($options['templatecourse'])) {
|
||||
|
||||
@@ -425,6 +425,7 @@ class course_test extends \advanced_testcase {
|
||||
'groupmode' => '2',
|
||||
'groupmodeforce' => '1',
|
||||
'enablecompletion' => '1',
|
||||
'showactivitydates' => '1',
|
||||
'tags' => 'Cat, Dog',
|
||||
|
||||
'role_teacher' => 'Knight',
|
||||
@@ -478,6 +479,7 @@ class course_test extends \advanced_testcase {
|
||||
$this->assertEquals($data['groupmode'], $course->groupmode);
|
||||
$this->assertEquals($data['groupmodeforce'], $course->groupmodeforce);
|
||||
$this->assertEquals($data['enablecompletion'], $course->enablecompletion);
|
||||
$this->assertEquals($data['showactivitydates'], $course->showactivitydates);
|
||||
$this->assertEquals($data['tags'], join(', ', \core_tag_tag::get_item_tags_array('core', 'course', $course->id)));
|
||||
|
||||
// Roles.
|
||||
@@ -530,6 +532,7 @@ class course_test extends \advanced_testcase {
|
||||
'groupmode' => '1',
|
||||
'groupmodeforce' => '0',
|
||||
'enablecompletion' => '0',
|
||||
'showactivitydates' => '0',
|
||||
|
||||
'role_teacher' => 'Teacher',
|
||||
'role_manager' => 'Manager',
|
||||
@@ -583,6 +586,7 @@ class course_test extends \advanced_testcase {
|
||||
$this->assertEquals($data['groupmode'], $course->groupmode);
|
||||
$this->assertEquals($data['groupmodeforce'], $course->groupmodeforce);
|
||||
$this->assertEquals($data['enablecompletion'], $course->enablecompletion);
|
||||
$this->assertEquals($data['showactivitydates'], $course->showactivitydates);
|
||||
|
||||
// Roles.
|
||||
$roleids = array();
|
||||
@@ -644,6 +648,7 @@ class course_test extends \advanced_testcase {
|
||||
'groupmode' => '2',
|
||||
'groupmodeforce' => '1',
|
||||
'enablecompletion' => '1',
|
||||
'showactivitydates' => '1',
|
||||
);
|
||||
|
||||
$this->assertFalse($DB->record_exists('course', array('shortname' => 'c1')));
|
||||
@@ -673,6 +678,7 @@ class course_test extends \advanced_testcase {
|
||||
$this->assertEquals($defaultdata['groupmode'], $course->groupmode);
|
||||
$this->assertEquals($defaultdata['groupmodeforce'], $course->groupmodeforce);
|
||||
$this->assertEquals($defaultdata['enablecompletion'], $course->enablecompletion);
|
||||
$this->assertEquals($defaultdata['showactivitydates'], $course->showactivitydates);
|
||||
|
||||
// Update.
|
||||
$cat = $this->getDataGenerator()->create_category();
|
||||
@@ -701,6 +707,7 @@ class course_test extends \advanced_testcase {
|
||||
'groupmode' => '1',
|
||||
'groupmodeforce' => '0',
|
||||
'enablecompletion' => '0',
|
||||
'showactivitydates' => '0',
|
||||
);
|
||||
|
||||
$this->assertTrue($DB->record_exists('course', array('shortname' => 'c1')));
|
||||
@@ -730,6 +737,7 @@ class course_test extends \advanced_testcase {
|
||||
$this->assertEquals($defaultdata['groupmode'], $course->groupmode);
|
||||
$this->assertEquals($defaultdata['groupmodeforce'], $course->groupmodeforce);
|
||||
$this->assertEquals($defaultdata['enablecompletion'], $course->enablecompletion);
|
||||
$this->assertEquals($defaultdata['showactivitydates'], $course->showactivitydates);
|
||||
}
|
||||
|
||||
public function test_rename() {
|
||||
|
||||
@@ -153,14 +153,10 @@ Feature: Apply tour filters to a tour
|
||||
| Course 1 | C1 | topics | 1 |
|
||||
| Course 2 | C2 | topics | 1 |
|
||||
And the following "activities" exist:
|
||||
| activity | course | name | firstpagetitle | wikimode |
|
||||
| wiki | C1 | Test wiki name | First page | collaborative |
|
||||
| activity | course | name | firstpagetitle | wikimode | idnumber | intro | type |
|
||||
| wiki | C1 | Test wiki name | First page | collaborative | | | |
|
||||
| forum | C2 | Test forum name | | | 001 | Test forum description | general |
|
||||
And I log in as "admin"
|
||||
And I am on "Course 2" course homepage with editing mode on
|
||||
And I add a "Forum" to section "1" and I fill the form with:
|
||||
| Forum name | Test forum name |
|
||||
| Forum type | Standard forum for general use |
|
||||
| Description | Test forum description |
|
||||
And I add a new user tour with:
|
||||
| Name | Wiki tour |
|
||||
| Description | A tour with both matches |
|
||||
|
||||
@@ -48,11 +48,7 @@ if ($confirmed) {
|
||||
throw new \moodle_exception('cannotfinduser', '', '', $userid);
|
||||
}
|
||||
|
||||
if (!$user->suspended) {
|
||||
complete_user_login($user);
|
||||
|
||||
\core\session\manager::apply_concurrent_login_limit($user->id, session_id());
|
||||
|
||||
if ($user->id == $USER->id) {
|
||||
// Check where to go, $redirect has a higher preference.
|
||||
if (empty($redirect) and !empty($SESSION->wantsurl) ) {
|
||||
$redirect = $SESSION->wantsurl;
|
||||
@@ -69,14 +65,24 @@ if ($confirmed) {
|
||||
$PAGE->set_heading($COURSE->fullname);
|
||||
echo $OUTPUT->header();
|
||||
echo $OUTPUT->box_start('generalbox centerpara boxwidthnormal boxaligncenter');
|
||||
echo "<h3>".get_string("thanks").", ". fullname($USER) . "</h3>\n";
|
||||
echo "<h3>".get_string("thanks").", ". fullname($user) . "</h3>\n";
|
||||
echo "<p>".get_string("confirmed")."</p>\n";
|
||||
echo $OUTPUT->single_button("$CFG->wwwroot/course/", get_string('courses'));
|
||||
// If $wantsurl and $redirect are empty, then the button will navigate the identical user to the dashboard.
|
||||
if ($user->id == $USER->id) {
|
||||
echo $OUTPUT->single_button("$CFG->wwwroot/course/", get_string('courses'));
|
||||
} else if (!isloggedin() || isguestuser()) {
|
||||
echo $OUTPUT->single_button(get_login_url(), get_string('login'));
|
||||
} else {
|
||||
echo $OUTPUT->single_button("$CFG->wwwroot/login/logout.php", get_string('logout'));
|
||||
}
|
||||
echo $OUTPUT->box_end();
|
||||
echo $OUTPUT->footer();
|
||||
exit;
|
||||
} else {
|
||||
\core\notification::error(get_string('confirmationinvalid', 'auth_oauth2'));
|
||||
// Avoid error if logged-in user visiting the page.
|
||||
if (!isloggedin()) {
|
||||
\core\notification::error(get_string('confirmationinvalid', 'auth_oauth2'));
|
||||
}
|
||||
}
|
||||
|
||||
redirect("$CFG->wwwroot/");
|
||||
|
||||
@@ -16,26 +16,15 @@ Feature: availability_completion
|
||||
| user | course | role |
|
||||
| teacher1 | C1 | editingteacher |
|
||||
| student1 | C1 | student |
|
||||
And the following "activities" exist:
|
||||
| activity | course | name | completion |
|
||||
| page | C1 | Page 1 | 1 |
|
||||
| page | C1 | Page 2 | |
|
||||
|
||||
@javascript
|
||||
Scenario: Test condition
|
||||
# Basic setup.
|
||||
Given I log in as "teacher1"
|
||||
And I am on "Course 1" course homepage with editing mode on
|
||||
|
||||
# Add a Page with a completion tickbox.
|
||||
And I add a "Page" to section "1" and I fill the form with:
|
||||
| Name | Page 1 |
|
||||
| Description | Test |
|
||||
| Page content | Test |
|
||||
| Completion tracking | 1 |
|
||||
|
||||
# And another one that depends on it (hidden otherwise).
|
||||
And I add a "Page" to section "2"
|
||||
And I set the following fields to these values:
|
||||
| Name | Page 2 |
|
||||
| Description | Test |
|
||||
| Page content | Test |
|
||||
Given I am on the "Page 2" "page activity editing" page logged in as "teacher1"
|
||||
And I expand all fieldsets
|
||||
And I click on "Add restriction..." "button"
|
||||
And I click on "Activity completion" "button" in the "Add restriction..." "dialogue"
|
||||
@@ -44,9 +33,7 @@ Feature: availability_completion
|
||||
And I press "Save and return to course"
|
||||
|
||||
# Log back in as student.
|
||||
When I log out
|
||||
And I log in as "student1"
|
||||
And I am on "Course 1" course homepage
|
||||
When I am on the "Course 1" "course" page logged in as "student1"
|
||||
|
||||
# Page 2 should not appear yet.
|
||||
Then I should not see "Page 2" in the "region-main" "region"
|
||||
@@ -58,27 +45,12 @@ Feature: availability_completion
|
||||
@javascript
|
||||
Scenario: Test completion and course cache rebuild
|
||||
Given the following "activities" exist:
|
||||
| activity | name | intro | course | idnumber |
|
||||
| forum | forum 1 | forum 1 | C1 | forum1 |
|
||||
And I log in as "teacher1"
|
||||
And I am on "Course 1" course homepage with editing mode on
|
||||
And I open "forum 1" actions menu
|
||||
And I click on "Edit settings" "link" in the "forum 1" activity
|
||||
And I set the following fields to these values:
|
||||
| Completion tracking | Show activity as complete when conditions are met |
|
||||
| completionview | 1 |
|
||||
| completionpostsenabled | 1 |
|
||||
| completionposts | 2 |
|
||||
And I press "Save and return to course"
|
||||
And I add a new discussion to "forum 1" forum with:
|
||||
| Subject | Forum post 1 |
|
||||
| Message | This is the body |
|
||||
And I am on "Course 1" course homepage with editing mode on
|
||||
And I add a "Page" to section "2"
|
||||
And I set the following fields to these values:
|
||||
| Name | Page 2 |
|
||||
| Description | Test |
|
||||
| Page content | Test |
|
||||
| activity | name | course | idnumber | completion | completionview | completionpostsenabled | completionposts |
|
||||
| forum | forum 1 | C1 | forum1 | 2 | 1 | 1 | 2 |
|
||||
And the following "mod_forum > discussions" exist:
|
||||
| forum | subject | message |
|
||||
| forum1 | Forum post 1 | This is the body |
|
||||
And I am on the "Page 2" "page activity editing" page logged in as "teacher1"
|
||||
And I expand all fieldsets
|
||||
And I press "Add restriction..."
|
||||
And I click on "Activity completion" "button" in the "Add restriction..." "dialogue"
|
||||
@@ -87,25 +59,18 @@ Feature: availability_completion
|
||||
| Required completion status | must be marked complete |
|
||||
| cm | forum 1 |
|
||||
And I press "Save and return to course"
|
||||
And I log out
|
||||
And I log in as "student1"
|
||||
When I am on "Course 1" course homepage
|
||||
When I am on the "Course 1" "course" page logged in as "student1"
|
||||
# Page 2 should not appear yet.
|
||||
Then I should not see "Page 2" in the "region-main" "region"
|
||||
And I click on "forum 1" "link" in the "region-main" "region"
|
||||
# Page 2 should not appear yet.
|
||||
And I should not see "Page 2" in the "region-main" "region"
|
||||
And I log out
|
||||
And I log in as "teacher1"
|
||||
And I am on "Course 1" course homepage
|
||||
And I am on the "forum 1" "forum activity editing" page
|
||||
And I am on the "forum 1" "forum activity editing" page logged in as "teacher1"
|
||||
And I expand all fieldsets
|
||||
And I set the following fields to these values:
|
||||
| completionpostsenabled | 0 |
|
||||
And I press "Save and display"
|
||||
And I log out
|
||||
And I log in as "student1"
|
||||
And I am on "Course 1" course homepage
|
||||
And I am on the "Course 1" "course" page logged in as "student1"
|
||||
And I click on "forum 1" "link" in the "region-main" "region"
|
||||
And I am on "Course 1" course homepage
|
||||
And I should see "Page 2" in the "region-main" "region"
|
||||
|
||||
@@ -18,21 +18,17 @@ Feature: Confirm that conditions on completion no longer cause a bug
|
||||
@javascript
|
||||
Scenario: Multiple completion conditions on glossary
|
||||
# Set up course.
|
||||
Given I log in as "teacher1"
|
||||
And I am on "Course 1" course homepage
|
||||
Given I am on the "Course 1" "course" page logged in as "teacher1"
|
||||
And I navigate to "Settings" in current page administration
|
||||
And I expand all fieldsets
|
||||
And I set the field "Enable completion tracking" to "Yes"
|
||||
And I press "Save and display"
|
||||
And I turn editing mode on
|
||||
|
||||
# Add a couple of Pages with manual completion.
|
||||
And I add a "Page" to section "1" and I fill the form with:
|
||||
| Name | Page1 |
|
||||
| Page content | x |
|
||||
And I add a "Page" to section "1" and I fill the form with:
|
||||
| Name | Page2 |
|
||||
| Page content | x |
|
||||
And the following "activities" exist:
|
||||
| activity | course | name | completion |
|
||||
| page | C1 | Page1 | 1 |
|
||||
| page | C1 | Page2 | 1 |
|
||||
|
||||
# Add a Glossary.
|
||||
When I add a "Glossary" to section "1"
|
||||
|
||||
@@ -16,19 +16,15 @@ Feature: availability_date
|
||||
| user | course | role |
|
||||
| teacher1 | C1 | editingteacher |
|
||||
| student1 | C1 | student |
|
||||
And the following "activities" exist:
|
||||
| activity | course | name |
|
||||
| page | C1 | Page 1 |
|
||||
| page | C1 | Page 2 |
|
||||
|
||||
@javascript
|
||||
Scenario: Test condition
|
||||
# Basic setup.
|
||||
Given I log in as "teacher1"
|
||||
And I am on "Course 1" course homepage with editing mode on
|
||||
|
||||
# Add a Page with a date condition that does match (from the past).
|
||||
And I add a "Page" to section "1"
|
||||
And I set the following fields to these values:
|
||||
| Name | Page 1 |
|
||||
| Description | Test |
|
||||
| Page content | Test |
|
||||
Given I am on the "Page 1" "page activity editing" page logged in as "teacher1"
|
||||
And I expand all fieldsets
|
||||
And I click on "Add restriction..." "button"
|
||||
And I click on "Date" "button" in the "Add restriction..." "dialogue"
|
||||
@@ -37,11 +33,7 @@ Feature: availability_date
|
||||
And I press "Save and return to course"
|
||||
|
||||
# Add a Page with a date condition that doesn't match (until the past).
|
||||
And I add a "Page" to section "2"
|
||||
And I set the following fields to these values:
|
||||
| Name | Page 2 |
|
||||
| Description | Test |
|
||||
| Page content | Test |
|
||||
And I am on the "Page 2" "page activity editing" page
|
||||
And I expand all fieldsets
|
||||
And I click on "Add restriction..." "button"
|
||||
And I click on "Date" "button" in the "Add restriction..." "dialogue"
|
||||
@@ -51,9 +43,7 @@ Feature: availability_date
|
||||
And I press "Save and return to course"
|
||||
|
||||
# Log back in as student.
|
||||
When I log out
|
||||
And I log in as "student1"
|
||||
And I am on "Course 1" course homepage
|
||||
When I am on the "Course 1" "course" page logged in as "student1"
|
||||
|
||||
# Page 1 should appear, but page 2 does not.
|
||||
Then I should see "Page 1" in the "region-main" "region"
|
||||
|
||||
@@ -17,26 +17,17 @@ Feature: availability_grade
|
||||
| teacher1 | C1 | editingteacher |
|
||||
| student1 | C1 | student |
|
||||
# Add an assignment.
|
||||
And the following "activity" exists:
|
||||
| activity | assign |
|
||||
| course | C1 |
|
||||
| section | 1 |
|
||||
| name | A1 |
|
||||
| intro | x |
|
||||
| assignsubmission_onlinetext_enabled | 1 |
|
||||
And the following "activities" exist:
|
||||
| activity | course | name | assignsubmission_onlinetext_enabled |
|
||||
| assign | C1 | A1 | 1 |
|
||||
| page | C1 | P1 | |
|
||||
| page | C1 | P2 | |
|
||||
| page | C1 | P3 | |
|
||||
| page | C1 | P4 | |
|
||||
|
||||
@javascript
|
||||
Scenario: Test condition
|
||||
# Basic setup.
|
||||
Given I log in as "teacher1"
|
||||
And I am on "Course 1" course homepage with editing mode on
|
||||
|
||||
# Add a Page with a grade condition for 'any grade'.
|
||||
And I add a "Page" to section "2"
|
||||
And I set the following fields to these values:
|
||||
| Name | P2 |
|
||||
| Description | x |
|
||||
| Page content | x |
|
||||
Given I am on the "P2" "page activity editing" page logged in as "teacher1"
|
||||
And I expand all fieldsets
|
||||
And I click on "Add restriction..." "button"
|
||||
And I click on "Grade" "button" in the "Add restriction..." "dialogue"
|
||||
@@ -45,11 +36,7 @@ Feature: availability_grade
|
||||
And I press "Save and return to course"
|
||||
|
||||
# Add a Page with a grade condition for 50%.
|
||||
And I add a "Page" to section "3"
|
||||
And I set the following fields to these values:
|
||||
| Name | P3 |
|
||||
| Description | x |
|
||||
| Page content | x |
|
||||
And I am on the "P3" "page activity editing" page
|
||||
And I expand all fieldsets
|
||||
And I click on "Add restriction..." "button"
|
||||
And I click on "Grade" "button" in the "Add restriction..." "dialogue"
|
||||
@@ -62,23 +49,16 @@ Feature: availability_grade
|
||||
And I press "Save and return to course"
|
||||
|
||||
# Check if disabling a part of the restriction is get saved.
|
||||
And I open "P3" actions menu
|
||||
And I click on "Edit settings" "link" in the "P3" activity
|
||||
And I am on the "P3" "page activity editing" page
|
||||
And I expand all fieldsets
|
||||
And I click on "max" "checkbox" in the ".availability-item" "css_element"
|
||||
And I press "Save and return to course"
|
||||
And I open "P3" actions menu
|
||||
And I click on "Edit settings" "link" in the "P3" activity
|
||||
And I expand all fieldsets
|
||||
And I am on the "P3" "page activity editing" page
|
||||
And the field "Maximum grade percentage (exclusive)" matches value ""
|
||||
And I am on "Course 1" course homepage
|
||||
|
||||
# Add a Page with a grade condition for 10%.
|
||||
And I add a "Page" to section "4"
|
||||
And I set the following fields to these values:
|
||||
| Name | P4 |
|
||||
| Description | x |
|
||||
| Page content | x |
|
||||
And I am on the "P4" "page activity editing" page
|
||||
And I expand all fieldsets
|
||||
And I click on "Add restriction..." "button"
|
||||
And I click on "Grade" "button" in the "Add restriction..." "dialogue"
|
||||
@@ -88,8 +68,6 @@ Feature: availability_grade
|
||||
And I set the field "Minimum grade percentage (inclusive)" to "10"
|
||||
And I press "Save and return to course"
|
||||
|
||||
And I log out
|
||||
|
||||
# Log in as student without a grade yet.
|
||||
When I am on the "A1" "assign activity" page logged in as student1
|
||||
|
||||
@@ -104,7 +82,6 @@ Feature: availability_grade
|
||||
And I should not see "P3" in the "region-main" "region"
|
||||
And I should not see "P4" in the "region-main" "region"
|
||||
And I should see "A1" in the "region-main" "region"
|
||||
And I log out
|
||||
|
||||
# Log back in as teacher.
|
||||
When I am on the "A1" "assign activity" page logged in as teacher1
|
||||
@@ -143,12 +120,8 @@ Feature: availability_grade
|
||||
And the "activitynames" filter applies to "content and headings"
|
||||
And I am on the "C1" "Course" page logged in as "teacher1"
|
||||
And I turn editing mode on
|
||||
And I add a "Page" to section "1"
|
||||
And I am on the "P1" "page activity editing" page
|
||||
And I expand all fieldsets
|
||||
And I set the following fields to these values:
|
||||
| Name | P1 |
|
||||
| Description | x |
|
||||
| Page content | x |
|
||||
And I click on "Add restriction..." "button"
|
||||
And I click on "Grade" "button" in the "Add restriction..." "dialogue"
|
||||
And I set the field "Grade" to "A-One"
|
||||
|
||||
@@ -16,15 +16,16 @@ Feature: availability_group
|
||||
| user | course | role |
|
||||
| teacher1 | C1 | editingteacher |
|
||||
| student1 | C1 | student |
|
||||
And the following "activities" exist:
|
||||
| activity | course | name |
|
||||
| page | C1 | P1 |
|
||||
| page | C1 | P2 |
|
||||
| page | C1 | P3 |
|
||||
|
||||
@javascript
|
||||
Scenario: Test condition
|
||||
# Basic setup.
|
||||
Given I log in as "teacher1"
|
||||
And I am on "Course 1" course homepage with editing mode on
|
||||
|
||||
# Start to add a Page. If there aren't any groups, there's no Group option.
|
||||
And I add a "Page" to section "1"
|
||||
Given I am on the "P1" "page activity editing" page logged in as "teacher1"
|
||||
And I expand all fieldsets
|
||||
And I click on "Add restriction..." "button"
|
||||
Then "Group" "button" should not exist in the "Add restriction..." "dialogue"
|
||||
@@ -37,8 +38,7 @@ Feature: availability_group
|
||||
| G2 | C1 | GI2 |
|
||||
# This step used to be 'And I follow "C1"', but Chrome thinks the breadcrumb
|
||||
# is not clickable, so we'll go via the home page instead.
|
||||
And I am on "Course 1" course homepage
|
||||
And I add a "Page" to section "1"
|
||||
And I am on the "P1" "page activity editing" page
|
||||
And I expand all fieldsets
|
||||
And I click on "Add restriction..." "button"
|
||||
Then "Group" "button" should exist in the "Add restriction..." "dialogue"
|
||||
@@ -47,18 +47,10 @@ Feature: availability_group
|
||||
Given I click on "Group" "button" in the "Add restriction..." "dialogue"
|
||||
And I set the field "Group" to "(Any group)"
|
||||
And I click on ".availability-item .availability-eye img" "css_element"
|
||||
And I set the following fields to these values:
|
||||
| Name | P1 |
|
||||
| Description | x |
|
||||
| Page content | x |
|
||||
And I click on "Save and return to course" "button"
|
||||
|
||||
# Page P2 with group G1.
|
||||
And I add a "Page" to section "2"
|
||||
And I set the following fields to these values:
|
||||
| Name | P2 |
|
||||
| Description | x |
|
||||
| Page content | x |
|
||||
And I am on the "P2" "page activity editing" page
|
||||
And I expand all fieldsets
|
||||
And I click on "Add restriction..." "button"
|
||||
And I click on "Group" "button" in the "Add restriction..." "dialogue"
|
||||
@@ -67,11 +59,7 @@ Feature: availability_group
|
||||
And I click on "Save and return to course" "button"
|
||||
|
||||
# Page P3 with group G2
|
||||
And I add a "Page" to section "3"
|
||||
And I set the following fields to these values:
|
||||
| Name | P3 |
|
||||
| Description | x |
|
||||
| Page content | x |
|
||||
And I am on the "P3" "page activity editing" page
|
||||
And I expand all fieldsets
|
||||
And I click on "Add restriction..." "button"
|
||||
And I click on "Group" "button" in the "Add restriction..." "dialogue"
|
||||
@@ -80,9 +68,7 @@ Feature: availability_group
|
||||
And I click on "Save and return to course" "button"
|
||||
|
||||
# Log back in as student.
|
||||
When I log out
|
||||
And I log in as "student1"
|
||||
And I am on "Course 1" course homepage
|
||||
When I am on the "Course 1" "course" page logged in as "student1"
|
||||
|
||||
# No pages should appear yet.
|
||||
Then I should not see "P1" in the "region-main" "region"
|
||||
@@ -93,8 +79,6 @@ Feature: availability_group
|
||||
Given the following "group members" exist:
|
||||
| user | group |
|
||||
| student1 | GI1 |
|
||||
And I log out
|
||||
And I log in as "student1"
|
||||
And I am on "Course 1" course homepage
|
||||
|
||||
# P1 (any groups) and P2 should show but not P3.
|
||||
@@ -113,19 +97,12 @@ Feature: availability_group
|
||||
# The activity names filter is enabled because it triggered a bug in older versions.
|
||||
And the "activitynames" filter is "on"
|
||||
And the "activitynames" filter applies to "content and headings"
|
||||
And I am on the "C1" "Course" page logged in as "teacher1"
|
||||
And I turn editing mode on
|
||||
And I add a "Page" to section "1"
|
||||
And I am on the "P1" "page activity editing" page logged in as "teacher1"
|
||||
And I expand all fieldsets
|
||||
And I set the following fields to these values:
|
||||
| Name | P1 |
|
||||
| Description | x |
|
||||
| Page content | x |
|
||||
And I click on "Add restriction..." "button"
|
||||
And I click on "Group" "button" in the "Add restriction..." "dialogue"
|
||||
And I set the field "Group" to "G-One"
|
||||
And I click on "Save and return to course" "button"
|
||||
And I log out
|
||||
|
||||
# Student sees information about no access to group, with group name in correct language.
|
||||
When I am on the "C1" "Course" page logged in as "student1"
|
||||
|
||||
@@ -22,15 +22,16 @@ Feature: availability_grouping
|
||||
And the following "group members" exist:
|
||||
| user | group |
|
||||
| student1 | GI1 |
|
||||
# Basic setup.
|
||||
And the following "activities" exist:
|
||||
| activity | course | name |
|
||||
| page | C1 | P1 |
|
||||
| page | C1 | P2 |
|
||||
|
||||
@javascript
|
||||
Scenario: Test condition
|
||||
# Basic setup.
|
||||
Given I log in as "teacher1"
|
||||
And I am on "Course 1" course homepage with editing mode on
|
||||
|
||||
# Start to add a Page. If there aren't any groupings, there's no Grouping option.
|
||||
And I add a "Page" to section "1"
|
||||
Given I am on the "P1" "page activity editing" page logged in as "teacher1"
|
||||
And I expand all fieldsets
|
||||
And I click on "Add restriction..." "button"
|
||||
Then "Grouping" "button" should not exist in the "Add restriction..." "dialogue"
|
||||
@@ -44,7 +45,7 @@ Feature: availability_grouping
|
||||
| name | course | idnumber |
|
||||
| GX1 | C1 | GXI1 |
|
||||
| GX2 | C1 | GXI2 |
|
||||
And I add a "Page" to section "1"
|
||||
And I am on the "P1" "page activity editing" page
|
||||
And I expand all fieldsets
|
||||
And I click on "Add restriction..." "button"
|
||||
Then "Grouping" "button" should exist in the "Add restriction..." "dialogue"
|
||||
@@ -53,18 +54,10 @@ Feature: availability_grouping
|
||||
Given I click on "Grouping" "button"
|
||||
And I set the field "Grouping" to "GX1"
|
||||
And I click on ".availability-item .availability-eye img" "css_element"
|
||||
And I set the following fields to these values:
|
||||
| Name | P1 |
|
||||
| Description | x |
|
||||
| Page content | x |
|
||||
And I click on "Save and return to course" "button"
|
||||
|
||||
# Page P2 with grouping GX2.
|
||||
And I add a "Page" to section "2"
|
||||
And I set the following fields to these values:
|
||||
| Name | P2 |
|
||||
| Description | x |
|
||||
| Page content | x |
|
||||
And I am on the "P2" "page activity editing" page
|
||||
And I expand all fieldsets
|
||||
And I click on "Add restriction..." "button"
|
||||
And I click on "Grouping" "button"
|
||||
@@ -73,21 +66,17 @@ Feature: availability_grouping
|
||||
And I click on "Save and return to course" "button"
|
||||
|
||||
# Log back in as student.
|
||||
When I log out
|
||||
And I log in as "student1"
|
||||
And I am on "Course 1" course homepage
|
||||
When I am on the "Course 1" "course" page logged in as "student1"
|
||||
|
||||
# No pages should appear yet.
|
||||
Then I should not see "P1" in the "region-main" "region"
|
||||
And I should not see "P2" in the "region-main" "region"
|
||||
|
||||
# Add group to grouping and log out/in again.
|
||||
And I log out
|
||||
And the following "grouping groups" exist:
|
||||
| grouping | group |
|
||||
| GXI1 | GI1 |
|
||||
And I log in as "student1"
|
||||
And I am on "Course 1" course homepage
|
||||
And I am on the "Course 1" "course" page logged in as "student1"
|
||||
|
||||
# P1 should show but not B2.
|
||||
Then I should see "P1" in the "region-main" "region"
|
||||
@@ -129,14 +118,10 @@ Feature: availability_grouping
|
||||
# The activity names filter is enabled because it triggered a bug in older versions.
|
||||
And the "activitynames" filter is "on"
|
||||
And the "activitynames" filter applies to "content and headings"
|
||||
And I am on the "C1" "Course" page logged in as "teacher1"
|
||||
And I turn editing mode on
|
||||
And I open "Test assign" actions menu
|
||||
And I choose "Edit settings" in the open action menu
|
||||
And I am on the "Test assign" "assign activity editing" page logged in as "teacher1"
|
||||
And I expand all fieldsets
|
||||
And I press "Add group/grouping access restriction"
|
||||
And I press "Save and return to course"
|
||||
And I log out
|
||||
|
||||
# Student sees information about no access to group, with group name in correct language.
|
||||
When I am on the "C1" "Course" page logged in as "student1"
|
||||
|
||||
@@ -16,19 +16,15 @@ Feature: availability_profile
|
||||
| user | course | role |
|
||||
| teacher1 | C1 | editingteacher |
|
||||
| student1 | C1 | student |
|
||||
And the following "activities" exist:
|
||||
| activity | course | name |
|
||||
| page | C1 | P1 |
|
||||
| page | C1 | P2 |
|
||||
|
||||
@javascript
|
||||
Scenario: Test condition
|
||||
# Basic setup.
|
||||
Given I log in as "teacher1"
|
||||
And I am on "Course 1" course homepage with editing mode on
|
||||
|
||||
# Add
|
||||
And I add a "Page" to section "1"
|
||||
And I set the following fields to these values:
|
||||
| Name | P1 |
|
||||
| Description | x |
|
||||
| Page content | x |
|
||||
Given I am on the "P1" "page activity editing" page logged in as "teacher1"
|
||||
And I expand all fieldsets
|
||||
And I click on "Add restriction..." "button"
|
||||
And I click on "User profile" "button"
|
||||
@@ -38,11 +34,7 @@ Feature: availability_profile
|
||||
And I click on "Save and return to course" "button"
|
||||
|
||||
# Add
|
||||
And I add a "Page" to section "2"
|
||||
And I set the following fields to these values:
|
||||
| Name | P2 |
|
||||
| Description | x |
|
||||
| Page content | x |
|
||||
And I am on the "P2" "page activity editing" page
|
||||
And I expand all fieldsets
|
||||
And I click on "Add restriction..." "button"
|
||||
And I click on "User profile" "button"
|
||||
@@ -52,9 +44,7 @@ Feature: availability_profile
|
||||
And I click on "Save and return to course" "button"
|
||||
|
||||
# Log back in as student.
|
||||
When I log out
|
||||
And I log in as "student1"
|
||||
And I am on "Course 1" course homepage
|
||||
When I am on the "Course 1" "course" page logged in as "student1"
|
||||
|
||||
# I see P1 but not P2.
|
||||
Then I should see "P1" in the "region-main" "region"
|
||||
@@ -72,12 +62,7 @@ Feature: availability_profile
|
||||
And I click on "Update profile" "button"
|
||||
|
||||
# Set Page activity which has requirement on this field.
|
||||
And I am on "Course 1" course homepage with editing mode on
|
||||
And I add a "Page" to section "1"
|
||||
And I set the following fields to these values:
|
||||
| Name | P1 |
|
||||
| Description | x |
|
||||
| Page content | x |
|
||||
And I am on the "P1" "page activity editing" page
|
||||
And I expand all fieldsets
|
||||
And I click on "Add restriction..." "button"
|
||||
And I click on "User profile" "button"
|
||||
@@ -94,9 +79,7 @@ Feature: availability_profile
|
||||
And the field "Value to compare against" matches value "Bananaman"
|
||||
|
||||
# Log out and back in as student. Should be able to see activity.
|
||||
And I log out
|
||||
And I log in as "student1"
|
||||
And I am on "Course 1" course homepage
|
||||
And I am on the "Course 1" "course" page logged in as "student1"
|
||||
Then I should see "P1" in the "region-main" "region"
|
||||
|
||||
@javascript
|
||||
@@ -110,14 +93,8 @@ Feature: availability_profile
|
||||
# The activity names filter is enabled because it triggered a bug in older versions.
|
||||
And the "activitynames" filter is "on"
|
||||
And the "activitynames" filter applies to "content and headings"
|
||||
And I am on the "C1" "Course" page logged in as "teacher1"
|
||||
And I turn editing mode on
|
||||
And I add a "Page" to section "1"
|
||||
And I am on the "P1" "page activity editing" page logged in as "teacher1"
|
||||
And I expand all fieldsets
|
||||
And I set the following fields to these values:
|
||||
| Name | P1 |
|
||||
| Description | x |
|
||||
| Page content | x |
|
||||
And I click on "Add restriction..." "button"
|
||||
And I click on "User profile" "button" in the "Add restriction..." "dialogue"
|
||||
And I set the following fields to these values:
|
||||
|
||||
@@ -34,19 +34,16 @@ Feature: display_availability
|
||||
| user | course | role |
|
||||
| teacher1 | C1 | editingteacher |
|
||||
| student1 | C1 | student |
|
||||
And the following "activities" exist:
|
||||
| activity | course | section | name |
|
||||
| page | C1 | 1 | Page 1 |
|
||||
| page | C1 | 2 | Page 2 |
|
||||
| page | C1 | 3 | Page 3 |
|
||||
|
||||
@javascript
|
||||
Scenario: Activity availability display
|
||||
# Set up.
|
||||
Given I log in as "teacher1"
|
||||
And I am on "Course 1" course homepage with editing mode on
|
||||
|
||||
# Add a Page with 1 restriction.
|
||||
When I add a "Page" to section "1"
|
||||
And I set the following fields to these values:
|
||||
| Name | Page 1 |
|
||||
| Description | Test |
|
||||
| Page content | Test |
|
||||
Given I am on the "Page 1" "page activity editing" page logged in as "teacher1"
|
||||
And I expand all fieldsets
|
||||
And I press "Add restriction..."
|
||||
And I click on "Date" "button" in the "Add restriction..." "dialogue"
|
||||
@@ -56,11 +53,7 @@ Feature: display_availability
|
||||
And I press "Save and return to course"
|
||||
|
||||
# Add a Page with 2 restrictions - one is set to hide from students if failed.
|
||||
And I add a "Page" to section "2"
|
||||
And I set the following fields to these values:
|
||||
| Name | Page 2 |
|
||||
| Description | Test |
|
||||
| Page content | Test |
|
||||
And I am on the "Page 2" "page activity editing" page
|
||||
And I expand all fieldsets
|
||||
And I press "Add restriction..."
|
||||
And I click on "Date" "button" in the "Add restriction..." "dialogue"
|
||||
@@ -75,12 +68,6 @@ Feature: display_availability
|
||||
And I set the field "Method of comparison" to "is equal to"
|
||||
And I press "Save and return to course"
|
||||
|
||||
# Add another Page with no restrictions.
|
||||
And I add a "Page" to section "3" and I fill the form with:
|
||||
| Name | Page 3 |
|
||||
| Description | Test |
|
||||
| Page content | Test |
|
||||
|
||||
# Page 1 should show in single-line format, showing the date
|
||||
Then I should see "Available until" in the "#section-1 .availabilityinfo" "css_element"
|
||||
And I should see "2013" in the "#section-1 .availabilityinfo" "css_element"
|
||||
@@ -98,9 +85,7 @@ Feature: display_availability
|
||||
And "#section-3 .availabilityinfo" "css_element" should not exist
|
||||
|
||||
# Change to student view.
|
||||
Given I log out
|
||||
And I log in as "student1"
|
||||
And I am on "Course 1" course homepage
|
||||
Given I am on the "C1" "Course" page logged in as "student1"
|
||||
|
||||
# Page 1 display still there but should not be a link.
|
||||
Then I should see "Page 1" in the "#section-1" "css_element"
|
||||
@@ -119,8 +104,8 @@ Feature: display_availability
|
||||
@javascript
|
||||
Scenario: Section availability display
|
||||
# Set up.
|
||||
Given I log in as "teacher1"
|
||||
And I am on "Course 1" course homepage with editing mode on
|
||||
Given I am on the "C1" "Course" page logged in as "teacher1"
|
||||
And I turn editing mode on
|
||||
|
||||
# Add a restriction to section 1 (visible to students).
|
||||
When I edit the section "1"
|
||||
@@ -144,29 +129,13 @@ Feature: display_availability
|
||||
# This is necessary because otherwise it fails in Chrome, see MDL-44959
|
||||
And I am on "Course 1" course homepage
|
||||
|
||||
# Add Pages to each section.
|
||||
And I add a "Page" to section "1" and I fill the form with:
|
||||
| Name | Page 1 |
|
||||
| Description | Test |
|
||||
| Page content | Test |
|
||||
And I add a "Page" to section "2" and I fill the form with:
|
||||
| Name | Page 2 |
|
||||
| Description | Test |
|
||||
| Page content | Test |
|
||||
And I add a "Page" to section "3" and I fill the form with:
|
||||
| Name | Page 3 |
|
||||
| Description | Test |
|
||||
| Page content | Test |
|
||||
|
||||
# Check display
|
||||
Then I should see "Available until" in the "#section-1 .availabilityinfo" "css_element"
|
||||
And I should see "Available until" in the "#section-2 .availabilityinfo" "css_element"
|
||||
And I should see "hidden otherwise" in the "#section-2 .availabilityinfo" "css_element"
|
||||
|
||||
# Change to student view.
|
||||
Given I log out
|
||||
And I log in as "student1"
|
||||
And I am on "Course 1" course homepage
|
||||
Given I am on the "Course 1" "Course" page logged in as "student1"
|
||||
|
||||
# The contents of both sections should be hidden.
|
||||
Then I should not see "Page 1" in the "region-main" "region"
|
||||
|
||||
@@ -27,6 +27,10 @@ Feature: edit_availability
|
||||
| user | course | role |
|
||||
| teacher1 | C1 | editingteacher |
|
||||
| student1 | C1 | student |
|
||||
And the following "activity" exists:
|
||||
| activity | forum |
|
||||
| course | C1 |
|
||||
| name | MyForum |
|
||||
|
||||
Scenario: Confirm the 'enable availability' option is working
|
||||
Given the following config values are set as admin:
|
||||
@@ -55,12 +59,8 @@ Feature: edit_availability
|
||||
| activity | page |
|
||||
| course | C1 |
|
||||
| idnumber | 0002 |
|
||||
| section | 1 |
|
||||
| name | Page2 |
|
||||
| intro | pageintro |
|
||||
And I am on "Course 1" course homepage
|
||||
And I follow "Page2"
|
||||
And I navigate to "Settings" in current page administration
|
||||
And I am on the "Page2" "page activity editing" page
|
||||
Then "Restrict access" "fieldset" should exist
|
||||
|
||||
Given I am on "Course 1" course homepage
|
||||
@@ -70,9 +70,12 @@ Feature: edit_availability
|
||||
@javascript
|
||||
Scenario: Edit availability using settings in activity form
|
||||
# Set up.
|
||||
Given I log in as "teacher1"
|
||||
And I am on "Course 1" course homepage with editing mode on
|
||||
And I add a "Page" to section "1"
|
||||
Given the following "activity" exists:
|
||||
| activity | page |
|
||||
| course | C1 |
|
||||
| section | 1 |
|
||||
| name | P1 |
|
||||
And I am on the "P1" "page activity editing" page logged in as "teacher1"
|
||||
And I expand all fieldsets
|
||||
Then I should see "None" in the "Restrict access" "fieldset"
|
||||
|
||||
@@ -178,9 +181,7 @@ Feature: edit_availability
|
||||
# Button does not exist when conditional access restrictions are turned off.
|
||||
Given the following config values are set as admin:
|
||||
| enableavailability | 0 |
|
||||
And I log in as "admin"
|
||||
And I am on "Course 1" course homepage with editing mode on
|
||||
And I add a "Forum" to section "1"
|
||||
And I am on the "MyForum" "forum activity editing" page logged in as admin
|
||||
When I expand all fieldsets
|
||||
Then "Add group/grouping access restriction" "button" should not exist
|
||||
|
||||
@@ -190,12 +191,7 @@ Feature: edit_availability
|
||||
Given the following "groupings" exist:
|
||||
| name | course | idnumber |
|
||||
| GX1 | C1 | GXI1 |
|
||||
And I log in as "admin"
|
||||
And I am on "Course 1" course homepage with editing mode on
|
||||
And I add a "Forum" to section "1"
|
||||
And I set the following fields to these values:
|
||||
| Forum name | MyForum |
|
||||
| Description | x |
|
||||
And I am on the "MyForum" "forum activity editing" page logged in as admin
|
||||
When I expand all fieldsets
|
||||
Then the "Add group/grouping access restriction" "button" should be disabled
|
||||
|
||||
|
||||
+17
-6
@@ -132,6 +132,7 @@ class core_backup_external extends external_api {
|
||||
array(
|
||||
'filename' => new external_value(PARAM_FILE, 'Backup filename', VALUE_REQUIRED, null, NULL_NOT_ALLOWED),
|
||||
'contextid' => new external_value(PARAM_INT, 'Context id', VALUE_REQUIRED, null, NULL_NOT_ALLOWED),
|
||||
'backupid' => new external_value(PARAM_ALPHANUMEXT, 'Backup id', VALUE_REQUIRED, null, NULL_NOT_ALLOWED),
|
||||
)
|
||||
);
|
||||
}
|
||||
@@ -142,9 +143,10 @@ class core_backup_external extends external_api {
|
||||
*
|
||||
* @param string $filename The file name of the backup file.
|
||||
* @param int $contextid The context the backup relates to.
|
||||
* @param string $backupid The backup ID to get the backup settings.
|
||||
* @since Moodle 3.7
|
||||
*/
|
||||
public static function get_async_backup_links_backup($filename, $contextid) {
|
||||
public static function get_async_backup_links_backup($filename, $contextid, $backupid) {
|
||||
// Release session lock.
|
||||
\core\session\manager::write_close();
|
||||
|
||||
@@ -153,7 +155,8 @@ class core_backup_external extends external_api {
|
||||
self::get_async_backup_links_backup_parameters(),
|
||||
array(
|
||||
'filename' => $filename,
|
||||
'contextid' => $contextid
|
||||
'contextid' => $contextid,
|
||||
'backupid' => $backupid,
|
||||
)
|
||||
);
|
||||
|
||||
@@ -162,10 +165,18 @@ class core_backup_external extends external_api {
|
||||
self::validate_context($context);
|
||||
require_capability('moodle/backup:backupcourse', $context);
|
||||
|
||||
if ($cm) {
|
||||
$filearea = 'activity';
|
||||
} else {
|
||||
$filearea = 'course';
|
||||
// Backups without user info or with the anonymise functionality enabled are sent
|
||||
// to user's "user_backup" file area.
|
||||
$filearea = 'backup';
|
||||
// Get useful info to render async status in correct area.
|
||||
$bc = \backup_controller::load_controller($backupid);
|
||||
list($hasusers, $isannon) = \async_helper::get_userdata_backup_settings($bc);
|
||||
if ($hasusers && !$isannon) {
|
||||
if ($cm) {
|
||||
$filearea = 'activity';
|
||||
} else {
|
||||
$filearea = 'course';
|
||||
}
|
||||
}
|
||||
|
||||
$results = \async_helper::get_backup_file_info($filename, $filearea, $contextid);
|
||||
|
||||
@@ -87,7 +87,7 @@ class async_backup_test extends \advanced_testcase {
|
||||
set_config('buffersize', 0, 'logstore_standard');
|
||||
get_log_manager(true);
|
||||
|
||||
// Start backup process.
|
||||
// Case 1: Make a course backup without users.
|
||||
$this->setUser($teacher->id);
|
||||
|
||||
// Make the backup controller for an async backup.
|
||||
@@ -132,6 +132,52 @@ class async_backup_test extends \advanced_testcase {
|
||||
'target' => 'course_backup'], '*', MUST_EXIST);
|
||||
$otherdata = json_decode($logrec->other);
|
||||
$this->assertEquals($backupid, $otherdata->backupid);
|
||||
|
||||
// Check backup was stored in correct area.
|
||||
$usercontextid = $DB->get_field('context', 'id', ['contextlevel' => CONTEXT_USER, 'instanceid' => $teacher->id]);
|
||||
$this->assertEquals(1, $DB->count_records('files', ['contextid' => $usercontextid,
|
||||
'component' => 'user', 'filearea' => 'backup', 'filename' => 'backup.mbz']));
|
||||
|
||||
// Case 2: Make a second backup with users and not anonymised.
|
||||
$this->setAdminUser();
|
||||
$bc = new backup_controller(backup::TYPE_1COURSE, $course->id, backup::FORMAT_MOODLE,
|
||||
backup::INTERACTIVE_YES, backup::MODE_ASYNC, $USER->id);
|
||||
$bc->get_plan()->get_setting('users')->set_status(\backup_setting::NOT_LOCKED);
|
||||
$bc->get_plan()->get_setting('users')->set_value(true);
|
||||
$bc->get_plan()->get_setting('anonymize')->set_value(false);
|
||||
$bc->finish_ui();
|
||||
$backupid = $bc->get_backupid();
|
||||
$bc->destroy();
|
||||
|
||||
// Create the adhoc task.
|
||||
$asynctask = new \core\task\asynchronous_backup_task();
|
||||
$asynctask->set_blocking(false);
|
||||
$asynctask->set_custom_data(['backupid' => $backupid]);
|
||||
\core\task\manager::queue_adhoc_task($asynctask);
|
||||
|
||||
// Execute adhoc task.
|
||||
$now = time();
|
||||
$task = \core\task\manager::get_next_adhoc_task($now);
|
||||
$task->execute();
|
||||
\core\task\manager::adhoc_task_complete($task);
|
||||
|
||||
$postbackuprec = $DB->get_record('backup_controllers', ['backupid' => $backupid]);
|
||||
|
||||
// Check backup was created successfully.
|
||||
$this->assertEquals(backup::STATUS_FINISHED_OK, $postbackuprec->status);
|
||||
$this->assertEquals(1.0, $postbackuprec->progress);
|
||||
$this->assertEquals($USER->id, $postbackuprec->userid);
|
||||
|
||||
// Check that the backupid was logged correctly.
|
||||
$logrec = $DB->get_record('logstore_standard_log', ['userid' => $postbackuprec->userid,
|
||||
'target' => 'course_backup'], '*', MUST_EXIST);
|
||||
$otherdata = json_decode($logrec->other);
|
||||
$this->assertEquals($backupid, $otherdata->backupid);
|
||||
|
||||
// Check backup was stored in correct area.
|
||||
$coursecontextid = $DB->get_field('context', 'id', ['contextlevel' => CONTEXT_COURSE, 'instanceid' => $course->id]);
|
||||
$this->assertEquals(1, $DB->count_records('files', ['contextid' => $coursecontextid,
|
||||
'component' => 'backup', 'filearea' => 'course', 'filename' => 'backup.mbz']));
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -313,39 +313,82 @@ class async_helper {
|
||||
* Get markup for in progress async backups,
|
||||
* to use in backup table UI.
|
||||
*
|
||||
* @param \core_backup_renderer $renderer The backup renderer object.
|
||||
* @param string $filearea The filearea to get backup data for.
|
||||
* @param integer $instanceid The context id to get backup data for.
|
||||
* @return array $tabledata the rows of table data.
|
||||
*/
|
||||
public static function get_async_backups($renderer, $instanceid) {
|
||||
public static function get_async_backups($filearea, $instanceid) {
|
||||
global $DB;
|
||||
|
||||
$tabledata = array();
|
||||
$backups = [];
|
||||
|
||||
// Get relevant backup ids based on context instance id.
|
||||
$select = 'itemid = :itemid AND execution = :execution AND status < :status1 AND status > :status2 ' .
|
||||
$table = 'backup_controllers';
|
||||
$select = 'execution = :execution AND status < :status1 AND status > :status2 ' .
|
||||
'AND operation = :operation';
|
||||
$params = [
|
||||
'itemid' => $instanceid,
|
||||
'execution' => backup::EXECUTION_DELAYED,
|
||||
'status1' => backup::STATUS_FINISHED_ERR,
|
||||
'status2' => backup::STATUS_NEED_PRECHECK,
|
||||
'operation' => 'backup',
|
||||
];
|
||||
$sort = 'timecreated DESC';
|
||||
$fields = 'id, backupid, status, timecreated';
|
||||
|
||||
$backups = $DB->get_records_select('backup_controllers', $select, $params, 'timecreated DESC', 'id, backupid, timecreated');
|
||||
foreach ($backups as $backup) {
|
||||
$bc = \backup_controller::load_controller($backup->backupid); // Get the backup controller.
|
||||
$filename = $bc->get_plan()->get_setting('filename')->get_value();
|
||||
$timecreated = $backup->timecreated;
|
||||
$status = $renderer->get_status_display($bc->get_status(), $bc->get_backupid());
|
||||
$bc->destroy();
|
||||
if ($filearea == 'backup') {
|
||||
// Get relevant backup ids based on user id.
|
||||
$params['userid'] = $instanceid;
|
||||
$select = 'userid = :userid AND ' . $select;
|
||||
$records = $DB->get_records_select($table, $select, $params, $sort, $fields);
|
||||
foreach ($records as $record) {
|
||||
$bc = \backup_controller::load_controller($record->backupid);
|
||||
|
||||
$tablerow = array($filename, userdate($timecreated), '-', '-', '-', $status);
|
||||
$tabledata[] = $tablerow;
|
||||
// Get useful info to render async status in correct area.
|
||||
list($hasusers, $isannon) = self::get_userdata_backup_settings($bc);
|
||||
// Backup has users and is not anonymised -> don't show it in users backup file area.
|
||||
if ($hasusers && !$isannon) {
|
||||
continue;
|
||||
}
|
||||
|
||||
$record->filename = $bc->get_plan()->get_setting('filename')->get_value();
|
||||
$bc->destroy();
|
||||
array_push($backups, $record);
|
||||
}
|
||||
} else {
|
||||
if ($filearea == 'course' || $filearea == 'activity') {
|
||||
// Get relevant backup ids based on context instance id.
|
||||
$params['itemid'] = $instanceid;
|
||||
$select = 'itemid = :itemid AND ' . $select;
|
||||
$records = $DB->get_records_select($table, $select, $params, $sort, $fields);
|
||||
foreach ($records as $record) {
|
||||
$bc = \backup_controller::load_controller($record->backupid);
|
||||
|
||||
// Get useful info to render async status in correct area.
|
||||
list($hasusers, $isannon) = self::get_userdata_backup_settings($bc);
|
||||
// Backup has no user or is anonymised -> don't show it in course/activity backup file area.
|
||||
if (!$hasusers || $isannon) {
|
||||
continue;
|
||||
}
|
||||
|
||||
$record->filename = $bc->get_plan()->get_setting('filename')->get_value();
|
||||
$bc->destroy();
|
||||
array_push($backups, $record);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return $tabledata;
|
||||
return $backups;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the user data settings for backups.
|
||||
*
|
||||
* @param \backup_controller $backupcontroller The backup controller object.
|
||||
* @return array Array of user data settings.
|
||||
*/
|
||||
public static function get_userdata_backup_settings(\backup_controller $backupcontroller): array {
|
||||
$hasusers = (bool)$backupcontroller->get_plan()->get_setting('users')->get_value(); // Backup has users.
|
||||
$isannon = (bool)$backupcontroller->get_plan()->get_setting('anonymize')->get_value(); // Backup is anonymised.
|
||||
return [$hasusers, $isannon];
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -331,7 +331,7 @@ abstract class backup_helper {
|
||||
// enabled are sent to user's "user_backup"
|
||||
// file area. Maintenance of such area is responsibility of
|
||||
// the user via corresponding file manager frontend
|
||||
if ($backupmode == backup::MODE_GENERAL && (!$hasusers || $isannon)) {
|
||||
if (($backupmode == backup::MODE_GENERAL || $backupmode == backup::MODE_ASYNC) && (!$hasusers || $isannon)) {
|
||||
$ctxid = context_user::instance($userid)->id;
|
||||
$component = 'user';
|
||||
$filearea = 'backup';
|
||||
|
||||
@@ -140,12 +140,11 @@ class async_helper_test extends \advanced_testcase {
|
||||
unset($bc);
|
||||
|
||||
$coursecontext = \context_course::instance($course->id);
|
||||
$renderer = $PAGE->get_renderer('core', 'backup');
|
||||
|
||||
$result = \async_helper::get_async_backups($renderer, $coursecontext->instanceid);
|
||||
$result = \async_helper::get_async_backups('course', $coursecontext->instanceid);
|
||||
|
||||
$this->assertEquals(1, count($result));
|
||||
$this->assertEquals('backup.mbz', $result[0][0]);
|
||||
$this->assertEquals('backup.mbz', $result[0]->filename);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
+1
-1
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@@ -100,7 +100,8 @@ define(['jquery', 'core/ajax', 'core/str', 'core/notification', 'core/templates'
|
||||
methodname: 'core_backup_get_async_backup_links_backup',
|
||||
args: {
|
||||
'filename': filename,
|
||||
'contextid': contextid
|
||||
'contextid': contextid,
|
||||
'backupid': backupid
|
||||
},
|
||||
}])[0].done(function(response) {
|
||||
// We have the data now update the UI.
|
||||
|
||||
@@ -619,10 +619,10 @@ class core_backup_renderer extends plugin_renderer_base {
|
||||
* @return string
|
||||
*/
|
||||
public function render_backup_files_viewer(backup_files_viewer $viewer) {
|
||||
global $CFG;
|
||||
|
||||
$files = $viewer->files;
|
||||
|
||||
$async = async_helper::is_async_enabled();
|
||||
$async = \async_helper::is_async_enabled();
|
||||
|
||||
$tablehead = array(
|
||||
get_string('filename', 'backup'),
|
||||
@@ -638,16 +638,21 @@ class core_backup_renderer extends plugin_renderer_base {
|
||||
$table->attributes['class'] = 'backup-files-table generaltable';
|
||||
$table->head = $tablehead;
|
||||
$table->width = '100%';
|
||||
$table->data = array();
|
||||
$table->data = [];
|
||||
|
||||
// First add in progress asynchronous backups.
|
||||
// Only if asynchronous backups are enabled.
|
||||
// Also only render async status in correct area. Courese OR activity (not both).
|
||||
if ($async
|
||||
&& (($viewer->filearea == 'course' && $viewer->currentcontext->contextlevel == CONTEXT_COURSE)
|
||||
|| ($viewer->filearea == 'activity' && $viewer->currentcontext->contextlevel == CONTEXT_MODULE))
|
||||
) {
|
||||
$table->data = \async_helper::get_async_backups($this, $viewer->currentcontext->instanceid);
|
||||
if ($async) {
|
||||
$tabledata = [];
|
||||
$backups = \async_helper::get_async_backups($viewer->filearea, $viewer->filecontext->instanceid);
|
||||
// For each backup get, new item name, time restore created and progress.
|
||||
foreach ($backups as $backup) {
|
||||
$status = $this->get_status_display($backup->status, $backup->backupid);
|
||||
$timecreated = $backup->timecreated;
|
||||
$tablerow = [$backup->filename, userdate($timecreated), '-', '-', '-', $status];
|
||||
$tabledata[] = $tablerow;
|
||||
}
|
||||
$table->data = $tabledata;
|
||||
}
|
||||
|
||||
// Add completed backups.
|
||||
|
||||
@@ -85,6 +85,7 @@ abstract class restore_search_base implements renderable {
|
||||
public function __construct(array $config = array()) {
|
||||
|
||||
$this->search = optional_param($this->get_varsearch(), self::DEFAULT_SEARCH, PARAM_NOTAGS);
|
||||
$this->search = trim($this->search);
|
||||
$this->maxresults = get_config('backup', 'import_general_maxresults');
|
||||
|
||||
foreach ($config as $name => $value) {
|
||||
|
||||
@@ -20,13 +20,13 @@ Feature: Import course's contents into another course
|
||||
Scenario: Import course's contents to another course
|
||||
Given I log in as "teacher1"
|
||||
And the following "activities" exist:
|
||||
| activity | name | intro | course | idnumber | section |
|
||||
| data | Test database name | Test database description | C1 | database1 | 2 |
|
||||
| forum | Test forum name | Test forum name description | C1 | forum1 | 1 |
|
||||
And I am on "Course 1" course homepage with editing mode on
|
||||
And I add the "Comments" block
|
||||
And I add the "Recent blog entries" block
|
||||
And I turn editing mode off
|
||||
| activity | name | course | idnumber |
|
||||
| data | Test database name | C1 | database1 |
|
||||
| forum | Test forum name | C1 | forum1 |
|
||||
And the following "blocks" exist:
|
||||
| blockname | contextlevel | reference | pagetypepattern | defaultregion |
|
||||
| comments | Course | C1 | course-view-* | side-pre |
|
||||
| blog_recent | Course | C1 | course-view-* | side-pre |
|
||||
When I import "Course 1" course into "Course 2" course using this options:
|
||||
Then I should see "Test database name"
|
||||
And I should see "Test forum name"
|
||||
|
||||
@@ -12,16 +12,16 @@ Feature: Restore Moodle 2 course backups
|
||||
| Course 3 | C3 | 0 | topics | 2 | 0 |
|
||||
| Course 4 | C4 | 0 | topics | 20 | 0 |
|
||||
And the following "activities" exist:
|
||||
| activity | course | idnumber | name | intro | section | externalurl |
|
||||
| assign | C3 | assign1 | Test assign name | Assign description | 1 | |
|
||||
| data | C3 | data1 | Test database name | Database description | 2 | |
|
||||
| url | C1 | url1 | Test URL name | Test URL description | 3 | http://www.moodle.org |
|
||||
| activity | course | idnumber | name | intro | section | externalurl |
|
||||
| assign | C3 | assign1 | Test assign name | Assign description | 1 | |
|
||||
| data | C3 | data1 | Test database name | Database description | 2 | |
|
||||
| forum | C1 | 0001 | Test forum name | | 1 | |
|
||||
| url | C1 | url1 | Test URL name | Test URL description | 3 | http://www.moodle.org |
|
||||
And I log in as "admin"
|
||||
And I am on "Course 1" course homepage with editing mode on
|
||||
And I add a "Forum" to section "1" and I fill the form with:
|
||||
| Forum name | Test forum name |
|
||||
| Description | Test forum description |
|
||||
And I add the "Activities" block
|
||||
And the following "blocks" exist:
|
||||
| blockname | contextlevel | reference | pagetypepattern | defaultregion |
|
||||
| activity_modules | Course | C1 | course-view-* | side-pre |
|
||||
|
||||
@javascript
|
||||
Scenario: Restore a course in another existing course
|
||||
@@ -63,10 +63,11 @@ Feature: Restore Moodle 2 course backups
|
||||
Scenario: Restore a backup into the same course removing it's contents before that
|
||||
When I backup "Course 1" course using this options:
|
||||
| Confirmation | Filename | test_backup.mbz |
|
||||
And I am on "Course 1" course homepage
|
||||
And I add a "Forum" to section "1" and I fill the form with:
|
||||
| Forum name | Test forum post backup name |
|
||||
| Description | Test forum post backup description |
|
||||
And the following "activity" exists:
|
||||
| activity | forum |
|
||||
| course | C1 |
|
||||
| section | 1 |
|
||||
| name | Test forum post backup name |
|
||||
And I am on the "Course 1" "restore" page
|
||||
And I merge "test_backup.mbz" backup into the current course after deleting it's contents using this options:
|
||||
| Schema | Section 3 | 0 |
|
||||
|
||||
@@ -50,7 +50,7 @@ if (!is_null($storedsecret)) {
|
||||
// Make sure we have all the required information before trying to save the connection.
|
||||
$backpackuid = $bp->authenticate();
|
||||
if (empty($backpackuid) || !empty($backpackuid->error)) {
|
||||
redirect(new moodle_url($redirect), get_string('backpackconnectionunexpectedresult', 'badges'),
|
||||
redirect(new moodle_url($redirect), get_string('backpackconnectionunexpectedresult', 'badges', $backpackuid->error),
|
||||
null, \core\output\notification::NOTIFY_ERROR);
|
||||
}
|
||||
|
||||
|
||||
@@ -125,29 +125,38 @@ class backpack extends external_backpack {
|
||||
* Validates form data
|
||||
*/
|
||||
public function validation($data, $files) {
|
||||
global $CFG;
|
||||
|
||||
$errors = parent::validation($data, $files);
|
||||
if (badges_open_badges_backpack_api() == OPEN_BADGES_V2P1) {
|
||||
return [];
|
||||
}
|
||||
|
||||
// We don't need to verify the email address if we're clearing a pending email verification attempt.
|
||||
if (isset($data['revertbutton'])) {
|
||||
return [];
|
||||
}
|
||||
|
||||
$errors = [];
|
||||
// Email and password can't be blank.
|
||||
if (empty($data['backpackemail'])) {
|
||||
$errors['backpackemail'] = get_string('backpackemail_required', 'badges');
|
||||
}
|
||||
if (empty($data['password'])) {
|
||||
$errors['password'] = get_string('password_required', 'badges');
|
||||
}
|
||||
if (!empty($errors)) {
|
||||
return $errors;
|
||||
}
|
||||
// We don't need to verify the email address if we're clearing a pending email verification attempt.
|
||||
if (!isset($data['revertbutton'])) {
|
||||
$check = new stdClass();
|
||||
$check->email = $data['backpackemail'];
|
||||
$check->password = $data['password'];
|
||||
$sitebackpack = badges_get_site_backpack($data['externalbackpackid']);
|
||||
$bp = new \core_badges\backpack_api($sitebackpack, $check);
|
||||
|
||||
$result = $bp->authenticate();
|
||||
if ($result === false || !empty($result->error)) {
|
||||
$errors['backpackemail'] = get_string('backpackconnectionunexpectedresult', 'badges');
|
||||
$msg = $bp->get_authentication_error();
|
||||
if (!empty($msg)) {
|
||||
$errors['backpackemail'] .= '<br/><br/>';
|
||||
$errors['backpackemail'] .= get_string('backpackconnectionunexpectedmessage', 'badges', $msg);
|
||||
}
|
||||
}
|
||||
// Check the given credentials (email and password) are valid for this backpack.
|
||||
$check = new stdClass();
|
||||
$check->email = $data['backpackemail'];
|
||||
$check->password = $data['password'];
|
||||
$sitebackpack = badges_get_site_backpack($data['externalbackpackid']);
|
||||
$bp = new \core_badges\backpack_api($sitebackpack, $check);
|
||||
|
||||
$result = $bp->authenticate();
|
||||
if ($result === false || !empty($result->error)) {
|
||||
$msg = $bp->get_authentication_error();
|
||||
$errors['backpackemail'] = get_string('backpackconnectionunexpectedresult', 'badges', $msg);
|
||||
}
|
||||
return $errors;
|
||||
}
|
||||
|
||||
@@ -236,6 +236,7 @@ class award_criteria_activity extends award_criteria {
|
||||
* @return array list($join, $where, $params)
|
||||
*/
|
||||
public function get_completed_criteria_sql() {
|
||||
global $DB;
|
||||
$join = '';
|
||||
$where = '';
|
||||
$params = array();
|
||||
@@ -257,18 +258,41 @@ class award_criteria_activity extends award_criteria {
|
||||
}
|
||||
return array($join, $where, $params);
|
||||
} else {
|
||||
foreach ($this->params as $param) {
|
||||
$join .= " LEFT JOIN {course_modules_completion} cmc{$param['module']} ON
|
||||
cmc{$param['module']}.userid = u.id AND
|
||||
cmc{$param['module']}.coursemoduleid = :completedmodule{$param['module']} AND
|
||||
( cmc{$param['module']}.completionstate = :completionpass{$param['module']} OR
|
||||
cmc{$param['module']}.completionstate = :completionfail{$param['module']} OR
|
||||
cmc{$param['module']}.completionstate = :completioncomplete{$param['module']} )";
|
||||
$where .= " AND cmc{$param['module']}.coursemoduleid IS NOT NULL ";
|
||||
$params["completedmodule{$param['module']}"] = $param['module'];
|
||||
$params["completionpass{$param['module']}"] = COMPLETION_COMPLETE_PASS;
|
||||
$params["completionfail{$param['module']}"] = COMPLETION_COMPLETE_FAIL;
|
||||
$params["completioncomplete{$param['module']}"] = COMPLETION_COMPLETE;
|
||||
// Get all cmids of modules related to the criteria.
|
||||
$cmids = array_map(fn ($x) => $x['module'], $this->params);
|
||||
list($cmcmodulessql, $paramscmc) = $DB->get_in_or_equal($cmids, SQL_PARAMS_NAMED);
|
||||
|
||||
// Create a sql query to get all users who have worked on these course modules.
|
||||
$sql = "SELECT DISTINCT userid FROM {course_modules_completion} cmc "
|
||||
. "WHERE coursemoduleid " . $cmcmodulessql . " AND "
|
||||
. "( cmc.completionstate IN ( :completionpass, :completionfail, :completioncomplete ) )";
|
||||
$paramscmcs = [
|
||||
'completionpass' => COMPLETION_COMPLETE_PASS,
|
||||
'completionfail' => COMPLETION_COMPLETE_FAIL,
|
||||
'completioncomplete' => COMPLETION_COMPLETE
|
||||
];
|
||||
$paramscmc = array_merge($paramscmc, $paramscmcs);
|
||||
$userids = $DB->get_records_sql($sql, $paramscmc);
|
||||
|
||||
// Now check each user if the user has a completion of each module.
|
||||
$useridsbadgeable = array_keys(array_filter(
|
||||
$userids,
|
||||
function ($user) use ($cmcmodulessql, $paramscmc, $cmids) {
|
||||
global $DB;
|
||||
$params = array_merge($paramscmc, ['userid' => $user->userid]);
|
||||
$select = "coursemoduleid " . $cmcmodulessql . " AND userid = :userid";
|
||||
$cmidsuser = $DB->get_fieldset_select('course_modules_completion', 'coursemoduleid', $select, $params);
|
||||
return empty(array_diff($cmidsuser, $cmids));
|
||||
}
|
||||
));
|
||||
|
||||
// Finally create a where statement (if neccessary) with all userids who are allowed to get the badge.
|
||||
// This list also includes all users who have previously received the badge. These are filtered out in the badge.php.
|
||||
$join = "";
|
||||
$where = "";
|
||||
if (!empty($useridsbadgeable)) {
|
||||
list($wherepart, $params) = $DB->get_in_or_equal($useridsbadgeable, SQL_PARAMS_NAMED);
|
||||
$where = " AND u.id " . $wherepart;
|
||||
}
|
||||
return array($join, $where, $params);
|
||||
}
|
||||
|
||||
@@ -139,6 +139,7 @@ if ($backpack) {
|
||||
badges_disconnect_user_backpack($USER->id);
|
||||
redirect(new moodle_url('/badges/mybackpack.php'));
|
||||
} else if (isset($data->backpackemail)) {
|
||||
// There are no errors, so the verification email can be sent.
|
||||
if (badges_send_verification_email($data->backpackemail, $data->externalbackpackid, $data->password)) {
|
||||
$a = get_user_preferences('badges_email_verify_backpackid');
|
||||
redirect(new moodle_url('/badges/mybackpack.php'),
|
||||
|
||||
@@ -31,6 +31,7 @@ require_once($CFG->libdir . '/badgeslib.php');
|
||||
require_once($CFG->dirroot . '/badges/lib.php');
|
||||
|
||||
use core_badges\helper;
|
||||
use core\task\manager;
|
||||
|
||||
class badgeslib_test extends advanced_testcase {
|
||||
protected $badgeid;
|
||||
@@ -511,6 +512,84 @@ class badgeslib_test extends advanced_testcase {
|
||||
$this->assertEquals(badge_message_from_template($message, $params), $result);
|
||||
}
|
||||
|
||||
/**
|
||||
* Test for working around the 61 tables join limit of mysql in award_criteria_activity in combination with the scheduled task.
|
||||
*
|
||||
* @covers \core_badges\badge::review_all_criteria
|
||||
*/
|
||||
public function test_badge_activity_criteria_with_a_huge_number_of_coursemodules() {
|
||||
global $CFG;
|
||||
require_once($CFG->dirroot.'/completion/criteria/completion_criteria_activity.php');
|
||||
|
||||
if (!PHPUNIT_LONGTEST) {
|
||||
$this->markTestSkipped('PHPUNIT_LONGTEST is not defined');
|
||||
}
|
||||
|
||||
// Messaging is not compatible with transactions.
|
||||
$this->preventResetByRollback();
|
||||
|
||||
// Create more than 61 modules to potentially trigger an mysql db error.
|
||||
$assigncount = 75;
|
||||
$assigns = [];
|
||||
for ($i = 1; $i <= $assigncount; $i++) {
|
||||
$assigns[] = $this->getDataGenerator()->create_module('assign', ['course' => $this->course->id], ['completion' => 1]);
|
||||
}
|
||||
$assigncmids = array_flip(array_map(fn ($assign) => $assign->cmid, $assigns));
|
||||
$criteriaactivityarray = array_fill_keys(array_keys($assigncmids), 1);
|
||||
|
||||
// Set completion criteria.
|
||||
$criteriadata = (object) [
|
||||
'id' => $this->course->id,
|
||||
'criteria_activity' => $criteriaactivityarray,
|
||||
];
|
||||
$criterion = new completion_criteria_activity();
|
||||
$criterion->update_config($criteriadata);
|
||||
|
||||
$badge = new badge($this->coursebadge);
|
||||
|
||||
$criteriaoverall = award_criteria::build(array('criteriatype' => BADGE_CRITERIA_TYPE_OVERALL, 'badgeid' => $badge->id));
|
||||
$criteriaoverall->save(array('agg' => BADGE_CRITERIA_AGGREGATION_ANY));
|
||||
$criteriaactivity = award_criteria::build(['criteriatype' => BADGE_CRITERIA_TYPE_ACTIVITY, 'badgeid' => $badge->id]);
|
||||
|
||||
$modulescrit = ['agg' => BADGE_CRITERIA_AGGREGATION_ALL];
|
||||
foreach ($assigns as $assign) {
|
||||
$modulescrit['module_' . $assign->cmid] = $assign->cmid;
|
||||
}
|
||||
$criteriaactivity->save($modulescrit);
|
||||
|
||||
// Take one assign to complete it later.
|
||||
$assigntemp = array_shift($assigns);
|
||||
|
||||
// Mark the user to complete the modules.
|
||||
foreach ($assigns as $assign) {
|
||||
$cmassign = get_coursemodule_from_id('assign', $assign->cmid);
|
||||
$completion = new \completion_info($this->course);
|
||||
$completion->update_state($cmassign, COMPLETION_COMPLETE, $this->user->id);
|
||||
}
|
||||
|
||||
// Run the scheduled task to issue the badge. But the badge should not be issued.
|
||||
ob_start();
|
||||
$task = manager::get_scheduled_task('core\task\badges_cron_task');
|
||||
$task->execute();
|
||||
ob_end_clean();
|
||||
|
||||
$this->assertFalse($badge->is_issued($this->user->id));
|
||||
|
||||
// Now complete the last uncompleted module.
|
||||
$cmassign = get_coursemodule_from_id('assign', $assigntemp->cmid);
|
||||
$completion = new \completion_info($this->course);
|
||||
$completion->update_state($cmassign, COMPLETION_COMPLETE, $this->user->id);
|
||||
|
||||
// Run the scheduled task to issue the badge. Now the badge schould be issued.
|
||||
ob_start();
|
||||
$task = manager::get_scheduled_task('core\task\badges_cron_task');
|
||||
$task->execute();
|
||||
ob_end_clean();
|
||||
|
||||
$this->assertDebuggingCalled('Error baking badge image!');
|
||||
$this->assertTrue($badge->is_issued($this->user->id));
|
||||
}
|
||||
|
||||
/**
|
||||
* Test badges observer when course module completion event id fired.
|
||||
*/
|
||||
|
||||
@@ -181,3 +181,18 @@ Feature: Backpack badges
|
||||
And I set the field "externalbackpackid" to "https://test.com/"
|
||||
And I should see "Email address"
|
||||
And I should see "Password"
|
||||
|
||||
@javascript
|
||||
Scenario: Check backpack form validation as a student
|
||||
Given I log in as "student1"
|
||||
And I follow "Preferences" in the user menu
|
||||
And I follow "Backpack settings"
|
||||
And I set the field "externalbackpackid" to "https://test.com/"
|
||||
And I set the field "password" to ""
|
||||
When I click on "Connect to backpack" "button"
|
||||
Then I should see "Password can't be blank"
|
||||
And I should not see "Email address can't be blank"
|
||||
And I set the field "backpackemail" to ""
|
||||
And I click on "Connect to backpack" "button"
|
||||
And I should see "Email address can't be blank"
|
||||
And I should see "Password can't be blank"
|
||||
|
||||
@@ -21,8 +21,10 @@ Feature: The activity results block doesn't display student scores for unsupport
|
||||
Given the following "activities" exist:
|
||||
| activity | name | intro | course | section | idnumber | assignsubmission_file_enabled |
|
||||
| assign | Test assignment | Offline text | C1 | 1 | assign1 | 0 |
|
||||
And the following "blocks" exist:
|
||||
| blockname | contextlevel | reference | pagetypepattern | defaultregion |
|
||||
| activity_results | Course | C1 | course-view-* | side-pre |
|
||||
And I am on "Course 1" course homepage
|
||||
And I add the "Activity results" block
|
||||
And I configure the "Activity results" block
|
||||
And I set the following fields to these values:
|
||||
| config_showbest | 1 |
|
||||
@@ -30,8 +32,7 @@ Feature: The activity results block doesn't display student scores for unsupport
|
||||
| config_gradeformat | Percentages |
|
||||
| config_nameformat | Display full names |
|
||||
And I press "Save changes"
|
||||
When I follow "Test assignment"
|
||||
And I navigate to "Settings" in current page administration
|
||||
When I am on the "Test assignment" "assign activity editing" page
|
||||
And I set the following fields to these values:
|
||||
| id_grade_modgrade_type | None |
|
||||
And I press "Save and return to course"
|
||||
|
||||
@@ -21,8 +21,6 @@ Feature: The activity results block can have administrator set defaults
|
||||
| course | C1 |
|
||||
| idnumber | 0001 |
|
||||
| name | Test assignment |
|
||||
| intro | Offline text |
|
||||
| section | 1 |
|
||||
| assignsubmission_file_enabled | 0 |
|
||||
And I log in as "teacher1"
|
||||
And I am on "Course 1" course homepage with editing mode on
|
||||
@@ -50,8 +48,10 @@ Feature: The activity results block can have administrator set defaults
|
||||
| config_showbest_locked | 1 | block_activity_results |
|
||||
| config_showworst | 0 | block_activity_results |
|
||||
| config_showworst_locked | 1 | block_activity_results |
|
||||
And the following "blocks" exist:
|
||||
| blockname | contextlevel | reference | pagetypepattern | defaultregion |
|
||||
| activity_results | Course | C1 | course-view-* | side-pre |
|
||||
And I am on "Course 1" course homepage
|
||||
And I add the "Activity results" block
|
||||
When I configure the "Activity results" block
|
||||
And the following fields match these values:
|
||||
| config_showbest | 0 |
|
||||
|
||||
@@ -14,13 +14,10 @@ Feature: Enable Block Badges on the frontpage and view awarded badges
|
||||
And the following "course enrolments" exist:
|
||||
| user | course | role |
|
||||
| teacher1 | C1 | editingteacher |
|
||||
And I log in as "admin"
|
||||
And I am on site homepage
|
||||
And I turn editing mode on
|
||||
And I add the "Latest badges" block
|
||||
And I log out
|
||||
And I log in as "teacher1"
|
||||
And I am on "Course 1" course homepage
|
||||
And the following "blocks" exist:
|
||||
| blockname | contextlevel | reference | pagetypepattern | defaultregion |
|
||||
| badges | System | 1 | site-index | side-pre |
|
||||
And I am on the "Course 1" course page logged in as teacher1
|
||||
# Issue badge 1 of 2
|
||||
And I navigate to "Badges > Add a new badge" in current page administration
|
||||
And I set the following fields to these values:
|
||||
@@ -37,7 +34,5 @@ Feature: Enable Block Badges on the frontpage and view awarded badges
|
||||
And I press "Award badge"
|
||||
And I set the field "potentialrecipients[]" to "Teacher 1 (teacher1@example.com)"
|
||||
And I press "Award badge"
|
||||
And I log out
|
||||
When I log in as "teacher1"
|
||||
And I am on site homepage
|
||||
When I am on site homepage
|
||||
Then I should see "Badge 1" in the "Latest badges" "block"
|
||||
|
||||
@@ -26,16 +26,12 @@ Feature: Enable Block blog menu in an activity
|
||||
| idnumber | 0001 |
|
||||
| section | 1 |
|
||||
| assignsubmission_file_enabled | 0 |
|
||||
And I log in as "teacher1"
|
||||
And I am on "Course 1" course homepage with editing mode on
|
||||
And I follow "Test assignment 1"
|
||||
And I add the "Blog menu" block
|
||||
And I log out
|
||||
And the following "blocks" exist:
|
||||
| blockname | contextlevel | reference | pagetypepattern | defaultregion |
|
||||
| blog_menu | Activity module | 0001 | mod-assign-view | side-pre |
|
||||
|
||||
Scenario: Students use the blog menu block to post blogs
|
||||
Given I log in as "student1"
|
||||
And I am on "Course 1" course homepage
|
||||
And I follow "Test assignment 1"
|
||||
Given I am on the "Test assignment 1" "assign activity" page logged in as student1
|
||||
And I follow "Add a new entry"
|
||||
When I set the following fields to these values:
|
||||
| Entry title | S1 First Blog |
|
||||
@@ -43,16 +39,13 @@ Feature: Enable Block blog menu in an activity
|
||||
And I press "Save changes"
|
||||
Then I should see "S1 First Blog"
|
||||
And I should see "This is my awesome blog!"
|
||||
And I am on "Course 1" course homepage
|
||||
And I follow "Test assignment 1"
|
||||
And I am on the "Test assignment 1" "assign activity" page
|
||||
And I follow "Blog entries"
|
||||
And I should see "S1 First Blog"
|
||||
And I should see "This is my awesome blog!"
|
||||
|
||||
Scenario: Students use the blog menu block to view their blogs about the activity
|
||||
Given I log in as "student1"
|
||||
And I am on "Course 1" course homepage
|
||||
And I follow "Test assignment 1"
|
||||
Given I am on the "Test assignment 1" "assign activity" page logged in as student1
|
||||
And I follow "Add an entry about this Assignment"
|
||||
And I set the following fields to these values:
|
||||
| Entry title | S1 First Blog |
|
||||
@@ -61,10 +54,7 @@ Feature: Enable Block blog menu in an activity
|
||||
And I should see "S1 First Blog"
|
||||
And I should see "This is my awesome blog about this Assignment!"
|
||||
And I should see "Associated Assignment: Test assignment 1"
|
||||
And I log out
|
||||
And I log in as "student2"
|
||||
And I am on "Course 1" course homepage
|
||||
And I follow "Test assignment 1"
|
||||
And I am on the "Test assignment 1" "assign activity" page logged in as student2
|
||||
And I follow "Add a new entry"
|
||||
And I set the following fields to these values:
|
||||
| Entry title | S2 Second Blog |
|
||||
@@ -73,8 +63,7 @@ Feature: Enable Block blog menu in an activity
|
||||
And I should see "S2 Second Blog"
|
||||
And I should see "My unrelated blog!"
|
||||
And I should not see "Associated Assignment: Test assignment 1"
|
||||
And I am on "Course 1" course homepage
|
||||
And I follow "Test assignment 1"
|
||||
And I am on the "Test assignment 1" "assign activity" page
|
||||
And I follow "Add an entry about this Assignment"
|
||||
And I set the following fields to these values:
|
||||
| Entry title | S2 First Blog |
|
||||
@@ -83,17 +72,14 @@ Feature: Enable Block blog menu in an activity
|
||||
And I should see "S2 First Blog"
|
||||
And I should see "My course blog is better!"
|
||||
And I should see "Associated Assignment: Test assignment 1"
|
||||
And I am on "Course 1" course homepage
|
||||
And I follow "Test assignment 1"
|
||||
And I am on the "Test assignment 1" "assign activity" page
|
||||
When I follow "View my entries about this Assignment"
|
||||
Then I should see "S2 First Blog"
|
||||
And I should not see "S2 Second Blog"
|
||||
And I should not see "S1 First Blog"
|
||||
|
||||
Scenario: Students use the blog menu block to view all blogs about the assignment
|
||||
Given I log in as "student1"
|
||||
And I am on "Course 1" course homepage
|
||||
And I follow "Test assignment 1"
|
||||
Given I am on the "Test assignment 1" "assign activity" page logged in as student1
|
||||
And I follow "Add an entry about this Assignment"
|
||||
And I set the following fields to these values:
|
||||
| Entry title | S1 First Blog |
|
||||
@@ -102,10 +88,7 @@ Feature: Enable Block blog menu in an activity
|
||||
And I should see "S1 First Blog"
|
||||
And I should see "This is my awesome blog about this Assignment!"
|
||||
And I should see "Associated Assignment: Test assignment 1"
|
||||
And I log out
|
||||
And I log in as "student2"
|
||||
And I am on "Course 1" course homepage
|
||||
And I follow "Test assignment 1"
|
||||
And I am on the "Test assignment 1" "assign activity" page logged in as student2
|
||||
And I follow "Add a new entry"
|
||||
And I set the following fields to these values:
|
||||
| Entry title | S2 Second Blog |
|
||||
@@ -114,8 +97,7 @@ Feature: Enable Block blog menu in an activity
|
||||
And I should see "S2 Second Blog"
|
||||
And I should see "My unrelated blog!"
|
||||
And I should not see "Associated Assignment: Test assignment 1"
|
||||
And I am on "Course 1" course homepage
|
||||
And I follow "Test assignment 1"
|
||||
And I am on the "Test assignment 1" "assign activity" page
|
||||
And I follow "Add an entry about this Assignment"
|
||||
And I set the following fields to these values:
|
||||
| Entry title | S2 First Blog |
|
||||
@@ -124,17 +106,14 @@ Feature: Enable Block blog menu in an activity
|
||||
And I should see "S2 First Blog"
|
||||
And I should see "My course blog is better!"
|
||||
And I should see "Associated Assignment: Test assignment 1"
|
||||
And I am on "Course 1" course homepage
|
||||
And I follow "Test assignment 1"
|
||||
And I am on the "Test assignment 1" "assign activity" page
|
||||
When I follow "View all entries about this Assignment"
|
||||
Then I should see "S1 First Blog"
|
||||
And I should see "S2 First Blog"
|
||||
And I should not see "S2 Second Blog"
|
||||
|
||||
Scenario: Students use the blog menu block to view all their blog entries
|
||||
Given I log in as "student1"
|
||||
And I am on "Course 1" course homepage
|
||||
And I follow "Test assignment 1"
|
||||
Given I am on the "Test assignment 1" "assign activity" page logged in as student1
|
||||
And I follow "Add an entry about this Assignment"
|
||||
And I set the following fields to these values:
|
||||
| Entry title | S1 First Blog |
|
||||
@@ -143,10 +122,7 @@ Feature: Enable Block blog menu in an activity
|
||||
And I should see "S1 First Blog"
|
||||
And I should see "This is my awesome blog about this Assignment!"
|
||||
And I should see "Associated Assignment: Test assignment 1"
|
||||
And I log out
|
||||
And I log in as "student2"
|
||||
And I am on "Course 1" course homepage
|
||||
And I follow "Test assignment 1"
|
||||
And I am on the "Test assignment 1" "assign activity" page logged in as student2
|
||||
And I follow "Add a new entry"
|
||||
And I set the following fields to these values:
|
||||
| Entry title | S2 Second Blog |
|
||||
@@ -155,8 +131,7 @@ Feature: Enable Block blog menu in an activity
|
||||
And I should see "S2 Second Blog"
|
||||
And I should see "My unrelated blog!"
|
||||
And I should not see "Associated Assignment: Test assignment 1"
|
||||
And I am on "Course 1" course homepage
|
||||
And I follow "Test assignment 1"
|
||||
And I am on the "Test assignment 1" "assign activity" page
|
||||
And I follow "Add an entry about this Assignment"
|
||||
And I set the following fields to these values:
|
||||
| Entry title | S2 First Blog |
|
||||
@@ -165,17 +140,14 @@ Feature: Enable Block blog menu in an activity
|
||||
And I should see "S2 First Blog"
|
||||
And I should see "My course blog is better!"
|
||||
And I should see "Associated Assignment: Test assignment 1"
|
||||
And I am on "Course 1" course homepage
|
||||
And I follow "Test assignment 1"
|
||||
And I am on the "Test assignment 1" "assign activity" page
|
||||
When I follow "Blog entries"
|
||||
Then I should see "S2 First Blog"
|
||||
And I should see "S2 Second Blog"
|
||||
And I should not see "S1 First Blog"
|
||||
|
||||
Scenario: Teacher searches for student blogs
|
||||
Given I log in as "student1"
|
||||
And I am on "Course 1" course homepage
|
||||
And I follow "Test assignment 1"
|
||||
Given I am on the "Test assignment 1" "assign activity" page logged in as student1
|
||||
And I follow "Add an entry about this Assignment"
|
||||
And I set the following fields to these values:
|
||||
| Entry title | S1 First Blog |
|
||||
@@ -184,10 +156,7 @@ Feature: Enable Block blog menu in an activity
|
||||
And I should see "S1 First Blog"
|
||||
And I should see "This is my awesome blog about this Assignment!"
|
||||
And I should see "Associated Assignment: Test assignment 1"
|
||||
And I log out
|
||||
And I log in as "student2"
|
||||
And I am on "Course 1" course homepage
|
||||
And I follow "Test assignment 1"
|
||||
And I am on the "Test assignment 1" "assign activity" page logged in as student2
|
||||
And I follow "Add a new entry"
|
||||
And I set the following fields to these values:
|
||||
| Entry title | S2 Second Blog |
|
||||
@@ -196,8 +165,7 @@ Feature: Enable Block blog menu in an activity
|
||||
And I should see "S2 Second Blog"
|
||||
And I should see "My unrelated blog!"
|
||||
And I should not see "Associated Assignment: Test assignment 1"
|
||||
And I am on "Course 1" course homepage
|
||||
And I follow "Test assignment 1"
|
||||
And I am on the "Test assignment 1" "assign activity" page
|
||||
And I follow "Add an entry about this Assignment"
|
||||
And I set the following fields to these values:
|
||||
| Entry title | S2 First Blog |
|
||||
@@ -206,10 +174,7 @@ Feature: Enable Block blog menu in an activity
|
||||
And I should see "S2 First Blog"
|
||||
And I should see "My course blog is better!"
|
||||
And I should see "Associated Assignment: Test assignment 1"
|
||||
And I log out
|
||||
When I log in as "teacher1"
|
||||
And I am on "Course 1" course homepage
|
||||
And I follow "Test assignment 1"
|
||||
When I am on the "Test assignment 1" "assign activity" page logged in as teacher1
|
||||
And I set the field "Search" to "First"
|
||||
And I press "Search"
|
||||
Then I should see "S1 First Blog"
|
||||
|
||||
@@ -18,14 +18,12 @@ Feature: Students can use block blog menu in a course
|
||||
| teacher1 | C1 | editingteacher |
|
||||
| student1 | C1 | student |
|
||||
| student2 | C1 | student |
|
||||
And I log in as "teacher1"
|
||||
And I am on "Course 1" course homepage with editing mode on
|
||||
And I add the "Blog menu" block
|
||||
And I log out
|
||||
And the following "blocks" exist:
|
||||
| blockname | contextlevel | reference | pagetypepattern | defaultregion |
|
||||
| blog_menu | Course | C1 | course-view-* | side-pre |
|
||||
|
||||
Scenario: Students use the blog menu block to post blogs
|
||||
Given I log in as "student1"
|
||||
And I am on "Course 1" course homepage
|
||||
Given I am on the "Course 1" course page logged in as student1
|
||||
And I follow "Add a new entry"
|
||||
When I set the following fields to these values:
|
||||
| Entry title | S1 First Blog |
|
||||
@@ -39,8 +37,7 @@ Feature: Students can use block blog menu in a course
|
||||
And I should see "This is my awesome blog!"
|
||||
|
||||
Scenario: Students use the blog menu block to view their blogs about the course
|
||||
Given I log in as "student1"
|
||||
And I am on "Course 1" course homepage
|
||||
Given I am on the "Course 1" course page logged in as student1
|
||||
And I follow "Add an entry about this course"
|
||||
And I set the following fields to these values:
|
||||
| Entry title | S1 First Blog |
|
||||
@@ -49,9 +46,7 @@ Feature: Students can use block blog menu in a course
|
||||
And I should see "S1 First Blog"
|
||||
And I should see "This is my awesome blog about this course!"
|
||||
And I should see "Associated Course: C1"
|
||||
And I log out
|
||||
And I log in as "student2"
|
||||
And I am on "Course 1" course homepage
|
||||
And I am on the "Course 1" course page logged in as student2
|
||||
And I follow "Add a new entry"
|
||||
And I set the following fields to these values:
|
||||
| Entry title | S2 Second Blog |
|
||||
@@ -76,8 +71,7 @@ Feature: Students can use block blog menu in a course
|
||||
And I should not see "S1 First Blog"
|
||||
|
||||
Scenario: Students use the blog menu block to view all blogs about the course
|
||||
Given I log in as "student1"
|
||||
And I am on "Course 1" course homepage
|
||||
Given I am on the "Course 1" course page logged in as student1
|
||||
And I follow "Add an entry about this course"
|
||||
And I set the following fields to these values:
|
||||
| Entry title | S1 First Blog |
|
||||
@@ -86,9 +80,7 @@ Feature: Students can use block blog menu in a course
|
||||
And I should see "S1 First Blog"
|
||||
And I should see "This is my awesome blog about this course!"
|
||||
And I should see "Associated Course: C1"
|
||||
And I log out
|
||||
And I log in as "student2"
|
||||
And I am on "Course 1" course homepage
|
||||
And I am on the "Course 1" course page logged in as student2
|
||||
And I follow "Add a new entry"
|
||||
And I set the following fields to these values:
|
||||
| Entry title | S2 Second Blog |
|
||||
@@ -113,8 +105,7 @@ Feature: Students can use block blog menu in a course
|
||||
And I should not see "S2 Second Blog"
|
||||
|
||||
Scenario: Students use the blog menu block to view all their blog entries
|
||||
Given I log in as "student1"
|
||||
And I am on "Course 1" course homepage
|
||||
Given I am on the "Course 1" course page logged in as student1
|
||||
And I follow "Add an entry about this course"
|
||||
And I set the following fields to these values:
|
||||
| Entry title | S1 First Blog |
|
||||
@@ -123,9 +114,7 @@ Feature: Students can use block blog menu in a course
|
||||
And I should see "S1 First Blog"
|
||||
And I should see "This is my awesome blog about this course!"
|
||||
And I should see "Associated Course: C1"
|
||||
And I log out
|
||||
And I log in as "student2"
|
||||
And I am on "Course 1" course homepage
|
||||
And I am on the "Course 1" course page logged in as student2
|
||||
And I follow "Add a new entry"
|
||||
And I set the following fields to these values:
|
||||
| Entry title | S2 Second Blog |
|
||||
@@ -150,8 +139,7 @@ Feature: Students can use block blog menu in a course
|
||||
And I should not see "S1 First Blog"
|
||||
|
||||
Scenario: Teacher searches for student blogs
|
||||
Given I log in as "student1"
|
||||
And I am on "Course 1" course homepage
|
||||
Given I am on the "Course 1" course page logged in as student1
|
||||
And I follow "Add an entry about this course"
|
||||
And I set the following fields to these values:
|
||||
| Entry title | S1 First Blog |
|
||||
@@ -160,9 +148,7 @@ Feature: Students can use block blog menu in a course
|
||||
And I should see "S1 First Blog"
|
||||
And I should see "This is my awesome blog about this course!"
|
||||
And I should see "Associated Course: C1"
|
||||
And I log out
|
||||
And I log in as "student2"
|
||||
And I am on "Course 1" course homepage
|
||||
And I am on the "Course 1" course page logged in as student2
|
||||
And I follow "Add a new entry"
|
||||
And I set the following fields to these values:
|
||||
| Entry title | S2 Second Blog |
|
||||
@@ -180,9 +166,7 @@ Feature: Students can use block blog menu in a course
|
||||
And I should see "S2 First Blog"
|
||||
And I should see "My course blog is better!"
|
||||
And I should see "Associated Course: C1"
|
||||
And I log out
|
||||
When I log in as "teacher1"
|
||||
And I am on "Course 1" course homepage
|
||||
When I am on the "Course 1" course page logged in as teacher1
|
||||
And I set the field "Search" to "First"
|
||||
And I press "Search"
|
||||
Then I should see "S1 First Blog"
|
||||
|
||||
@@ -8,11 +8,9 @@ Feature: Enable Block blog menu on the frontpage
|
||||
Given the following "users" exist:
|
||||
| username | firstname | lastname | email | idnumber |
|
||||
| student1 | Student | 1 | student1@example.com | S1 |
|
||||
And I log in as "admin"
|
||||
And I am on site homepage
|
||||
And I turn editing mode on
|
||||
And I add the "Blog menu" block
|
||||
And I log out
|
||||
And the following "blocks" exist:
|
||||
| blockname | contextlevel | reference | pagetypepattern | defaultregion |
|
||||
| blog_menu | System | 1 | site-index | side-pre |
|
||||
|
||||
Scenario: Students use the blog menu block to post blogs
|
||||
Given I log in as "student1"
|
||||
|
||||
@@ -26,17 +26,13 @@ Feature: Students can use the recent blog entries block to view recent entries o
|
||||
| intro | Offline text |
|
||||
| section | 1 |
|
||||
| assignsubmission_file_enabled | 0 |
|
||||
And I log in as "teacher1"
|
||||
And I am on "Course 1" course homepage with editing mode on
|
||||
And I follow "Test assignment 1"
|
||||
And I add the "Blog menu" block
|
||||
And I add the "Recent blog entries" block
|
||||
And I log out
|
||||
And the following "blocks" exist:
|
||||
| blockname | contextlevel | reference | pagetypepattern | defaultregion |
|
||||
| blog_menu | Activity module | 0001 | mod-assign-view | side-pre |
|
||||
| blog_recent | Activity module | 0001 | mod-assign-view | side-pre |
|
||||
|
||||
Scenario: Students use the recent blog entries block to view blogs
|
||||
Given I log in as "student1"
|
||||
And I am on "Course 1" course homepage
|
||||
And I follow "Test assignment 1"
|
||||
Given I am on the "Test assignment 1" "assign activity" page logged in as student1
|
||||
And I follow "Add an entry about this Assignment"
|
||||
When I set the following fields to these values:
|
||||
| Entry title | S1 First Blog |
|
||||
@@ -50,9 +46,7 @@ Feature: Students can use the recent blog entries block to view recent entries o
|
||||
And I should see "This is my awesome blog!"
|
||||
|
||||
Scenario: Students only see a few entries in the recent blog entries block
|
||||
Given I log in as "student1"
|
||||
And I am on "Course 1" course homepage
|
||||
And I follow "Test assignment 1"
|
||||
Given I am on the "Test assignment 1" "assign activity" page logged in as student1
|
||||
And I follow "Add an entry about this Assignment"
|
||||
# Blog 1 of 5
|
||||
And I set the following fields to these values:
|
||||
|
||||
@@ -16,17 +16,15 @@ Feature: Students can use the recent blog entries block to view recent entries o
|
||||
| user | course | role |
|
||||
| teacher1 | C1 | editingteacher |
|
||||
| student1 | C1 | student |
|
||||
And the following "blocks" exist:
|
||||
| blockname | contextlevel | reference | pagetypepattern | defaultregion |
|
||||
| blog_menu | Course | C1 | course-view-* | side-pre |
|
||||
| blog_recent | Course | C1 | course-view-* | side-pre |
|
||||
And the "multilang" filter is "on"
|
||||
And the "multilang" filter applies to "content and headings"
|
||||
And I log in as "teacher1"
|
||||
And I am on "Course 1" course homepage with editing mode on
|
||||
And I add the "Blog menu" block
|
||||
And I add the "Recent blog entries" block
|
||||
And I log out
|
||||
|
||||
Scenario: Students use the recent blog entries block to view blogs
|
||||
Given I log in as "student1"
|
||||
And I am on "Course 1" course homepage
|
||||
Given I am on the "Course 1" course page logged in as student1
|
||||
And I follow "Add an entry about this course"
|
||||
When I set the following fields to these values:
|
||||
| Entry title | S1 First Blog <span lang="RU" class="multilang">RUSSIAN</span><span lang="EN" class="multilang">ENGLISH</span> |
|
||||
@@ -40,8 +38,7 @@ Feature: Students can use the recent blog entries block to view recent entries o
|
||||
And I should see "This is my awesome blog!"
|
||||
|
||||
Scenario: Students only see a few entries in the recent blog entries block
|
||||
Given I log in as "student1"
|
||||
And I am on "Course 1" course homepage
|
||||
Given I am on the "Course 1" course page logged in as student1
|
||||
And I follow "Add an entry about this course"
|
||||
# Blog 1 of 5
|
||||
And I set the following fields to these values:
|
||||
|
||||
@@ -8,12 +8,14 @@ Feature: Feature: Students can use the recent blog entries block to view recent
|
||||
Given the following "users" exist:
|
||||
| username | firstname | lastname | email | idnumber |
|
||||
| student1 | Student | 1 | student1@example.com | S1 |
|
||||
And the following "blocks" exist:
|
||||
| blockname | contextlevel | reference | pagetypepattern | defaultregion |
|
||||
| blog_recent | System | 1 | site-index | side-pre |
|
||||
And the following config values are set as admin:
|
||||
| unaddableblocks | | theme_boost|
|
||||
And I log in as "admin"
|
||||
And I am on site homepage
|
||||
And I turn editing mode on
|
||||
And I add the "Recent blog entries" block
|
||||
And the following config values are set as admin:
|
||||
| unaddableblocks | | theme_boost|
|
||||
# TODO MDL-57120 site "Blogs" link not accessible without navigation block.
|
||||
And I add the "Navigation" block if not present
|
||||
And I log out
|
||||
|
||||
@@ -52,9 +52,10 @@ Feature: Enable the calendar block in a course and test it's functionality
|
||||
|
||||
@javascript
|
||||
Scenario: View a user event in the calendar block
|
||||
Given I log in as "teacher1"
|
||||
And I am on "Course 1" course homepage with editing mode on
|
||||
And I add the "Calendar" block
|
||||
Given the following "blocks" exist:
|
||||
| blockname | contextlevel | reference | pagetypepattern | defaultregion |
|
||||
| calendar_month | Course | C1 | course-view-* | side-pre |
|
||||
And I log in as "teacher1"
|
||||
And I create a calendar event with form data:
|
||||
| id_eventtype | User |
|
||||
| id_name | User Event |
|
||||
@@ -72,9 +73,7 @@ Feature: Enable the calendar block in a course and test it's functionality
|
||||
| user | group |
|
||||
| student1 | G1 |
|
||||
| student2 | G2 |
|
||||
When I log in as "teacher1"
|
||||
And I am on "Course 1" course homepage
|
||||
And I navigate to "Settings" in current page administration
|
||||
When I am on the "Course 1" "course editing" page logged in as teacher1
|
||||
And I set the following fields to these values:
|
||||
| id_groupmode | Separate groups |
|
||||
| id_groupmodeforce | Yes |
|
||||
@@ -87,12 +86,8 @@ Feature: Enable the calendar block in a course and test it's functionality
|
||||
| Type of event | group |
|
||||
| Group | Group 1 |
|
||||
| Event title | Group Event |
|
||||
And I log out
|
||||
Then I log in as "student1"
|
||||
And I am on "Course 1" course homepage
|
||||
And I am on the "Course 1" course page logged in as student1
|
||||
And I hover over today in the mini-calendar block
|
||||
And I should see "Group Event"
|
||||
And I log out
|
||||
And I log in as "student2"
|
||||
And I am on "Course 1" course homepage
|
||||
Then I should see "Group Event"
|
||||
And I am on the "Course 1" course page logged in as student2
|
||||
And I should not see "Group Event"
|
||||
|
||||
@@ -9,10 +9,10 @@ Feature: Enable the calendar block on the site front page
|
||||
Given the following "users" exist:
|
||||
| username | firstname | lastname | email | idnumber |
|
||||
| student1 | Student | 1 | student1@example.com | S1 |
|
||||
And the following "blocks" exist:
|
||||
| blockname | contextlevel | reference | pagetypepattern | defaultregion |
|
||||
| calendar_month | System | 1 | site-index | side-pre |
|
||||
And I log in as "admin"
|
||||
And I am on site homepage
|
||||
And I turn editing mode on
|
||||
And I add the "Calendar" block
|
||||
And I create a calendar event with form data:
|
||||
| id_eventtype | Site |
|
||||
| id_name | Site Event |
|
||||
|
||||
@@ -8,6 +8,9 @@ Feature: View a site event on the frontpage
|
||||
Given the following "users" exist:
|
||||
| username | firstname | lastname | email | idnumber |
|
||||
| teacher1 | Teacher | 1 | teacher1@example.com | T1 |
|
||||
And the following "blocks" exist:
|
||||
| blockname | contextlevel | reference | pagetypepattern | defaultregion |
|
||||
| calendar_upcoming | System | 1 | site-index | side-pre |
|
||||
|
||||
@javascript
|
||||
Scenario: View a site event in the upcoming events block on the frontpage
|
||||
@@ -15,9 +18,6 @@ Feature: View a site event on the frontpage
|
||||
And I create a calendar event with form data:
|
||||
| id_eventtype | Site |
|
||||
| id_name | My Site Event |
|
||||
And I am on site homepage
|
||||
And I turn editing mode on
|
||||
And I add the "Upcoming events" block
|
||||
And I log out
|
||||
When I log in as "teacher1"
|
||||
And I am on site homepage
|
||||
|
||||
@@ -16,12 +16,10 @@ Feature: Add a comment to the comments block
|
||||
| user | course | role |
|
||||
| teacher1 | C1 | editingteacher |
|
||||
| student1 | C1 | student |
|
||||
And I log in as "teacher1"
|
||||
And I am on "Course 1" course homepage with editing mode on
|
||||
And I add the "Comments" block
|
||||
And I log out
|
||||
And I log in as "student1"
|
||||
And I am on "Course 1" course homepage
|
||||
And the following "blocks" exist:
|
||||
| blockname | contextlevel | reference | pagetypepattern | defaultregion |
|
||||
| comments | Course | C1 | course-view-* | side-pre |
|
||||
And I am on the "Course 1" course page logged in as student1
|
||||
|
||||
@javascript
|
||||
Scenario: Add a comment with Javascript enabled
|
||||
|
||||
@@ -19,15 +19,12 @@ Feature: Enable Block comments on an activity page and view comments
|
||||
And the following "activities" exist:
|
||||
| activity | course | idnumber | name | intro |
|
||||
| page | C1 | page1 | Test page name | Test page description |
|
||||
And I log in as "teacher1"
|
||||
And I am on "Course 1" course homepage with editing mode on
|
||||
And I follow "Test page name"
|
||||
And I add the "Comments" block
|
||||
And the following "blocks" exist:
|
||||
| blockname | contextlevel | reference | pagetypepattern | defaultregion |
|
||||
| comments | Activity module | page1 | mod-page-* | side-pre |
|
||||
And I am on the "Test page name" "page activity" page logged in as teacher1
|
||||
And I follow "Show comments"
|
||||
And I add "I'm a comment from the teacher" comment to comments block
|
||||
And I log out
|
||||
When I log in as "student1"
|
||||
And I am on "Course 1" course homepage
|
||||
And I follow "Test page name"
|
||||
When I am on the "Test page name" "page activity" page logged in as student1
|
||||
And I follow "Show comments"
|
||||
Then I should see "I'm a comment from the teacher"
|
||||
|
||||
@@ -16,13 +16,12 @@ Feature: Enable Block comments on a course page and view comments
|
||||
| user | course | role |
|
||||
| teacher1 | C1 | editingteacher |
|
||||
| student1 | C1 | student |
|
||||
And I log in as "teacher1"
|
||||
And I am on "Course 1" course homepage with editing mode on
|
||||
And I add the "Comments" block
|
||||
And the following "blocks" exist:
|
||||
| blockname | contextlevel | reference | pagetypepattern | defaultregion |
|
||||
| comments | Course | C1 | course-view-* | side-pre |
|
||||
And I am on the "Course 1" course page logged in as teacher1
|
||||
And I follow "Show comments"
|
||||
And I add "I'm a comment from the teacher" comment to comments block
|
||||
And I log out
|
||||
When I log in as "student1"
|
||||
And I am on "Course 1" course homepage
|
||||
When I am on the "Course 1" course page logged in as student1
|
||||
And I follow "Show comments"
|
||||
Then I should see "I'm a comment from the teacher"
|
||||
|
||||
@@ -8,10 +8,11 @@ Feature: Enable Block comments on the frontpage and view comments
|
||||
Given the following "users" exist:
|
||||
| username | firstname | lastname | email | idnumber |
|
||||
| teacher1 | Teacher | 1 | teacher1@example.com | T1 |
|
||||
And the following "blocks" exist:
|
||||
| blockname | contextlevel | reference | pagetypepattern | defaultregion |
|
||||
| comments | System | 1 | site-index | side-pre |
|
||||
And I log in as "admin"
|
||||
And I am on site homepage
|
||||
And I turn editing mode on
|
||||
And I add the "Comments" block
|
||||
And I follow "Show comments"
|
||||
And I add "I'm a comment from admin" comment to comments block
|
||||
And I log out
|
||||
|
||||
@@ -17,16 +17,12 @@ Feature: Delete comment block messages
|
||||
| user | course | role |
|
||||
| teacher1 | C1 | editingteacher |
|
||||
| student1 | C1 | student |
|
||||
And I log in as "teacher1"
|
||||
And I am on "Course 1" course homepage with editing mode on
|
||||
And I add the "Comments" block
|
||||
And I log out
|
||||
And I log in as "student1"
|
||||
And I am on "Course 1" course homepage
|
||||
And the following "blocks" exist:
|
||||
| blockname | contextlevel | reference | pagetypepattern | defaultregion |
|
||||
| comments | Course | C1 | course-view-* | side-pre |
|
||||
And I am on the "Course 1" course page logged in as student1
|
||||
And I add "Comment from student1" comment to comments block
|
||||
And I log out
|
||||
And I log in as "teacher1"
|
||||
And I am on "Course 1" course homepage
|
||||
And I am on the "Course 1" course page logged in as teacher1
|
||||
And I add "Comment from teacher1" comment to comments block
|
||||
When I delete "Comment from student1" comment from comments block
|
||||
Then I should not see "Comment from student1"
|
||||
|
||||
@@ -18,24 +18,21 @@ Feature: Enable Block Completion in a course using manual completion by others
|
||||
| teacher1 | C1 | editingteacher |
|
||||
| teacher2 | C1 | teacher |
|
||||
| student1 | C1 | student |
|
||||
And the following "blocks" exist:
|
||||
| blockname | contextlevel | reference | pagetypepattern | defaultregion |
|
||||
| completionstatus | Course | C1 | course-view-* | side-pre |
|
||||
|
||||
Scenario: Add the block to a the course and mark a student complete.
|
||||
Given I log in as "teacher1"
|
||||
And I am on "Course 1" course homepage with editing mode on
|
||||
And I add the "Course completion status" block
|
||||
Given I am on the "Course 1" course page logged in as teacher1
|
||||
And I navigate to "Course completion" in current page administration
|
||||
And I expand all fieldsets
|
||||
And I set the following fields to these values:
|
||||
| Teacher | 1 |
|
||||
And I press "Save changes"
|
||||
And I log out
|
||||
When I log in as "student1"
|
||||
And I am on "Course 1" course homepage
|
||||
When I am on the "Course 1" course page logged in as student1
|
||||
And I should see "Status: Not yet started" in the "Course completion status" "block"
|
||||
And I should see "No" in the "Teacher" "table_row"
|
||||
And I log out
|
||||
And I log in as "teacher1"
|
||||
And I am on "Course 1" course homepage
|
||||
And I am on the "Course 1" course page logged in as teacher1
|
||||
And I navigate to "Reports" in current page administration
|
||||
And I click on "Course completion" "link" in the "region-main" "region"
|
||||
And I follow "Click to mark user complete"
|
||||
@@ -44,18 +41,14 @@ Feature: Enable Block Completion in a course using manual completion by others
|
||||
And I wait "1" seconds
|
||||
And I run the scheduled task "core\task\completion_regular_task"
|
||||
And I am on site homepage
|
||||
And I log out
|
||||
And I log in as "student1"
|
||||
And I am on "Course 1" course homepage
|
||||
And I am on the "Course 1" course page logged in as student1
|
||||
Then I should see "Status: Complete" in the "Course completion status" "block"
|
||||
And I should see "Yes" in the "Teacher" "table_row"
|
||||
And I follow "More details"
|
||||
And I should see "Yes" in the "Marked complete by Teacher" "table_row"
|
||||
|
||||
Scenario: Add the block to a the course and require multiple roles to mark a student complete.
|
||||
Given I log in as "teacher1"
|
||||
And I am on "Course 1" course homepage with editing mode on
|
||||
And I add the "Course completion status" block
|
||||
Given I am on the "Course 1" course page logged in as teacher1
|
||||
And I navigate to "Course completion" in current page administration
|
||||
And I expand all fieldsets
|
||||
And I set the following fields to these values:
|
||||
@@ -63,30 +56,22 @@ Feature: Enable Block Completion in a course using manual completion by others
|
||||
| Non-editing teacher | 1 |
|
||||
| id_role_aggregation | ALL selected roles to mark when the condition is met |
|
||||
And I press "Save changes"
|
||||
And I log out
|
||||
When I log in as "student1"
|
||||
And I am on "Course 1" course homepage
|
||||
When I am on the "Course 1" course page logged in as student1
|
||||
And I should see "Status: Not yet started" in the "Course completion status" "block"
|
||||
And I should see "No" in the "Teacher" "table_row"
|
||||
And I should see "No" in the "Non-editing teacher" "table_row"
|
||||
And I log out
|
||||
And I log in as "teacher1"
|
||||
And I am on "Course 1" course homepage
|
||||
And I am on the "Course 1" course page logged in as teacher1
|
||||
And I navigate to "Reports" in current page administration
|
||||
And I click on "Course completion" "link" in the "region-main" "region"
|
||||
And I follow "Click to mark user complete"
|
||||
And I log out
|
||||
And I log in as "student1"
|
||||
And I am on "Course 1" course homepage
|
||||
And I am on the "Course 1" course page logged in as student1
|
||||
And I should see "Status: In progress" in the "Course completion status" "block"
|
||||
And I should see "Yes" in the "Teacher" "table_row"
|
||||
And I should see "No" in the "Non-editing teacher" "table_row"
|
||||
And I follow "More details"
|
||||
And I should see "Yes" in the "Marked complete by Teacher" "table_row"
|
||||
And I should see "No" in the "Marked complete by Non-editing teacher" "table_row"
|
||||
And I log out
|
||||
And I log in as "teacher2"
|
||||
And I am on "Course 1" course homepage
|
||||
And I am on the "Course 1" course page logged in as teacher2
|
||||
And I navigate to "Reports" in current page administration
|
||||
And I click on "Course completion" "link" in the "region-main" "region"
|
||||
And I follow "Click to mark user complete"
|
||||
@@ -95,9 +80,7 @@ Feature: Enable Block Completion in a course using manual completion by others
|
||||
And I wait "1" seconds
|
||||
And I run the scheduled task "core\task\completion_regular_task"
|
||||
And I am on site homepage
|
||||
And I log out
|
||||
And I log in as "student1"
|
||||
And I am on "Course 1" course homepage
|
||||
And I am on the "Course 1" course page logged in as student1
|
||||
Then I should see "Status: Complete" in the "Course completion status" "block"
|
||||
And I should see "Yes" in the "Teacher" "table_row"
|
||||
And I should see "Yes" in the "Non-editing teacher" "table_row"
|
||||
|
||||
@@ -17,18 +17,17 @@ Feature: Enable Block Completion in a course using manual self completion
|
||||
| teacher1 | C1 | editingteacher |
|
||||
| student1 | C1 | student |
|
||||
And I enable "selfcompletion" "block" plugin
|
||||
And I log in as "teacher1"
|
||||
And I am on "Course 1" course homepage with editing mode on
|
||||
And I add the "Course completion status" block
|
||||
And I add the "Self completion" block
|
||||
And the following "blocks" exist:
|
||||
| blockname | contextlevel | reference | pagetypepattern | defaultregion |
|
||||
| completionstatus | Course | C1 | course-view-* | side-pre |
|
||||
| selfcompletion | Course | C1 | course-view-* | side-pre |
|
||||
And I am on the "Course 1" course page logged in as teacher1
|
||||
And I navigate to "Course completion" in current page administration
|
||||
And I expand all fieldsets
|
||||
And I set the following fields to these values:
|
||||
| id_criteria_self | 1 |
|
||||
And I press "Save changes"
|
||||
And I log out
|
||||
When I log in as "student1"
|
||||
And I am on "Course 1" course homepage
|
||||
When I am on the "Course 1" course page logged in as student1
|
||||
And I should see "Status: Not yet started" in the "Course completion status" "block"
|
||||
And I should see "No" in the "Self completion" "table_row"
|
||||
And I follow "Complete course"
|
||||
|
||||
@@ -17,21 +17,18 @@ Feature: Course summary block used in a course
|
||||
| student1 | C101 | student |
|
||||
| teacher1 | C101 | editingteacher |
|
||||
And I enable "course_summary" "block" plugin
|
||||
And I log in as "teacher1"
|
||||
And I am on "Course 1" course homepage with editing mode on
|
||||
And I add the "Course/site summary" block
|
||||
And I log out
|
||||
And the following "blocks" exist:
|
||||
| blockname | contextlevel | reference | pagetypepattern | defaultregion |
|
||||
| course_summary | Course | C101 | course-view-* | side-pre |
|
||||
|
||||
Scenario: Student can view course summary
|
||||
When I log in as "student1"
|
||||
And I am on "Course 1" course homepage
|
||||
When I am on the "Course 1" course page logged in as student1
|
||||
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 not see edit icon when edit mode is off
|
||||
When I log in as "teacher1"
|
||||
And I am on "Course 1" course homepage
|
||||
When I am on the "Course 1" course page logged in as teacher1
|
||||
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"
|
||||
|
||||
@@ -7,9 +7,10 @@ Feature: Course summary block used on the frontpage
|
||||
Background:
|
||||
Given I log in as "admin"
|
||||
And I enable "course_summary" "block" plugin
|
||||
And the following "blocks" exist:
|
||||
| blockname | contextlevel | reference | pagetypepattern | defaultregion |
|
||||
| course_summary | System | 1 | site-index | side-pre |
|
||||
And I am on site homepage
|
||||
And I turn editing mode on
|
||||
And I add the "Course/site summary" block
|
||||
And I navigate to "Site home > Site home settings" in site administration
|
||||
And I set the following fields to these values:
|
||||
| summary | Proved the summary block works! |
|
||||
|
||||
@@ -8,19 +8,16 @@ Feature: Login from a block
|
||||
Given the following "users" exist:
|
||||
| username | password | firstname | lastname | email |
|
||||
| testuser | testpass | Test | User | student1@example.com |
|
||||
And I log in as "admin"
|
||||
And I am on site homepage
|
||||
And I turn editing mode on
|
||||
And I add the "Login" block
|
||||
And the following "blocks" exist:
|
||||
| blockname | contextlevel | reference | pagetypepattern | defaultregion |
|
||||
| login | System | 1 | site-index | side-pre |
|
||||
|
||||
Scenario: Login block visible to non-logged in users
|
||||
Given I log out
|
||||
When I am on homepage
|
||||
Then "Login" "block" should exist
|
||||
|
||||
Scenario: Login as student through login block
|
||||
Given I log out
|
||||
And I am on homepage
|
||||
Given I am on homepage
|
||||
When I set the field "Username" to "testuser"
|
||||
And I set the field "Password" to "testpass"
|
||||
And I click on "Log in" "button" in the "Login" "block"
|
||||
|
||||
@@ -8,9 +8,9 @@ Feature: Add the network servers block when main feature is disabled
|
||||
Given I log in as "admin"
|
||||
And I navigate to "Plugins > Authentication > Manage authentication" in site administration
|
||||
And I click on "Enable" "icon" in the "MNet authentication" "table_row"
|
||||
And I am on site homepage
|
||||
And I turn editing mode on
|
||||
And I add the "Network servers" block
|
||||
And the following "blocks" exist:
|
||||
| blockname | contextlevel | reference | pagetypepattern | defaultregion |
|
||||
| mnet_hosts | System | 1 | site-index | side-pre |
|
||||
When I navigate to "Plugins > Authentication > Manage authentication" in site administration
|
||||
And I click on "Disable" "icon" in the "MNet authentication" "table_row"
|
||||
And I am on site homepage
|
||||
@@ -21,10 +21,11 @@ Feature: Add the network servers block when main feature is disabled
|
||||
Given I log in as "admin"
|
||||
And I navigate to "Plugins > Authentication > Manage authentication" in site administration
|
||||
And I click on "Enable" "icon" in the "MNet authentication" "table_row"
|
||||
And the following "blocks" exist:
|
||||
| blockname | contextlevel | reference | pagetypepattern | defaultregion |
|
||||
| mnet_hosts | System | 1 | site-index | side-pre |
|
||||
And I am on site homepage
|
||||
And I turn editing mode on
|
||||
And I add the "Network servers" block
|
||||
And I turn editing mode on
|
||||
And I open the "Network servers" blocks action menu
|
||||
And I click on "Delete Network servers block" "link" in the "Network servers" "block"
|
||||
And "Delete block?" "dialogue" should exist
|
||||
|
||||
@@ -59,13 +59,14 @@ Feature: The my overview block allows users to hide their courses
|
||||
And I click on "Removed from view" "link" in the "Course overview" "block"
|
||||
And I click on ".coursemenubtn" "css_element" in the "//div[@class='card dashboard-card' and contains(.,'Course 2')]" "xpath_element"
|
||||
And I click on "Restore to view" "link" in the "//div[@class='card dashboard-card' and contains(.,'Course 2')]" "xpath_element"
|
||||
And I reload the page
|
||||
And I should not see "Course 2" in the "Course overview" "block"
|
||||
And I click on "Removed from view" "button" in the "Course overview" "block"
|
||||
When I click on "All" "link" in the "Course overview" "block"
|
||||
And I reload the page
|
||||
Then I should see "Course 2" in the "Course overview" "block"
|
||||
|
||||
Scenario: Test show toggle functionality w/ favorites
|
||||
Scenario: Test star and unstar functionality
|
||||
Given I am on the "My courses" page logged in as "student1"
|
||||
And I click on "All" "button" in the "Course overview" "block"
|
||||
And I click on "All" "link" in the "Course overview" "block"
|
||||
|
||||
@@ -17,8 +17,8 @@ Feature: The logged in user block allows users to view their profile information
|
||||
And the following "activities" exist:
|
||||
| activity | course | idnumber | name | intro |
|
||||
| page | C1 | page1 | Test page name | Test page description |
|
||||
And I log in as "teacher1"
|
||||
And I am on "Course 1" course homepage with editing mode on
|
||||
And I follow "Test page name"
|
||||
When I add the "Logged in user" block
|
||||
And the following "blocks" exist:
|
||||
| blockname | contextlevel | reference | pagetypepattern | defaultregion |
|
||||
| myprofile | Activity module | page1 | mod-page-* | side-pre |
|
||||
When I am on the "Test page name" "page activity" page logged in as teacher1
|
||||
Then I should see "Teacher One" in the "Logged in user" "block"
|
||||
|
||||
@@ -8,11 +8,9 @@ Feature: The logged in user block allows users to view their profile information
|
||||
Given the following "users" exist:
|
||||
| username | firstname | lastname | email | idnumber |
|
||||
| teacher1 | Teacher | One | teacher1@example.com | T1 |
|
||||
And I log in as "admin"
|
||||
And I am on site homepage
|
||||
And I turn editing mode on
|
||||
And I add the "Logged in user" block
|
||||
And I log out
|
||||
And the following "blocks" exist:
|
||||
| blockname | contextlevel | reference | pagetypepattern | defaultregion |
|
||||
| myprofile | System | 1 | site-index | side-pre |
|
||||
|
||||
Scenario: Try to view the logged in user block as a guest
|
||||
Given I log in as "guest"
|
||||
|
||||
@@ -39,29 +39,23 @@ Feature: Displaying the link to the Participants page
|
||||
|
||||
@javascript
|
||||
Scenario: Course participants link is displayed to users depending on role permissions settings
|
||||
And I log in as "admin"
|
||||
And I am on "Course1" course homepage with editing mode on
|
||||
And I add a "Forum" to section "1" and I fill the form with:
|
||||
| Forum name | Test forum name |
|
||||
| Description | Test forum description |
|
||||
And I am on the "Course1" "enrolment methods" page
|
||||
Given the following "activities" exist:
|
||||
| activity | course | name |
|
||||
| forum | C1 | Test forum name |
|
||||
And I am on the "Course1" "enrolment methods" page logged in as admin
|
||||
And I click on "Edit" "link" in the "Guest access" "table_row"
|
||||
And I set the following fields to these values:
|
||||
| Allow guest access | Yes |
|
||||
And I press "Save changes"
|
||||
And I log out
|
||||
When I log in as "guest"
|
||||
And I am on "Course1" course homepage
|
||||
When I am on the "Course1" course page logged in as guest
|
||||
Then I should not see "Participants" in the "Navigation" "block"
|
||||
And I am on the "Test forum name" "forum activity" page
|
||||
And I should not see "Participants" in the "Navigation" "block"
|
||||
And I log out
|
||||
And I log in as "admin"
|
||||
And I set the following system permissions of "Guest" role:
|
||||
| capability | permission |
|
||||
| moodle/course:viewparticipants | Allow |
|
||||
And I log in as "guest"
|
||||
And I am on "Course1" course homepage
|
||||
And the following "role capability" exists:
|
||||
| role | guest |
|
||||
| moodle/course:viewparticipants | allow |
|
||||
And I am on the "Course1" course page logged in as guest
|
||||
And I should see "Participants" in the "Navigation" "block"
|
||||
And I am on the "Test forum name" "forum activity" page
|
||||
And I should see "Participants" in the "Navigation" "block"
|
||||
|
||||
@@ -9,17 +9,16 @@ Feature: Latest announcements block displays the course latest news
|
||||
Given the following "users" exist:
|
||||
| username | firstname | lastname | email |
|
||||
| teacher1 | Teacher | 1 | teacher1@example.com |
|
||||
And I log in as "admin"
|
||||
And I create a course with:
|
||||
| Course full name | Course 1 |
|
||||
| Course short name | C1 |
|
||||
| Number of announcements | 5 |
|
||||
And I enrol "Teacher 1" user as "Teacher"
|
||||
And I log out
|
||||
And I log in as "teacher1"
|
||||
And I am on "Course 1" course homepage with editing mode on
|
||||
And I add the "Latest announcements" block
|
||||
And I turn editing mode off
|
||||
And the following "courses" exist:
|
||||
| fullname | shortname | category | newsitems |
|
||||
| Course 1 | C1 | 0 | 5 |
|
||||
And the following "course enrolments" exist:
|
||||
| user | course | role |
|
||||
| teacher1 | C1 | editingteacher |
|
||||
And the following "blocks" exist:
|
||||
| blockname | contextlevel | reference | pagetypepattern | defaultregion |
|
||||
| news_items | Course | C1 | course-view-* | side-pre |
|
||||
And I am on the "Course 1" Course page logged in as teacher1
|
||||
When I add a new topic to "Announcements" forum with:
|
||||
| Subject | Discussion One |
|
||||
| Message | Not important |
|
||||
|
||||
@@ -17,10 +17,10 @@ Feature: The private files block allows users to store files privately in moodle
|
||||
And the following "activities" exist:
|
||||
| activity | course | idnumber | name | intro |
|
||||
| page | C1 | page1 | Test page name | Test page description |
|
||||
And I log in as "teacher1"
|
||||
And I am on "Course 1" course homepage with editing mode on
|
||||
And I am on the "Test page name" "page activity" page
|
||||
And I add the "Private files" block
|
||||
And the following "blocks" exist:
|
||||
| blockname | contextlevel | reference | pagetypepattern | defaultregion |
|
||||
| private_files | Activity module | page1 | mod-page-* | side-pre |
|
||||
And I am on the "Test page name" "page activity" page logged in as teacher1
|
||||
And I should see "No files available" in the "Private files" "block"
|
||||
When I follow "Manage private files..."
|
||||
And I upload "blocks/private_files/tests/fixtures/testfile.txt" file to "Files" filemanager
|
||||
|
||||
@@ -14,9 +14,11 @@ Feature: The private files block allows users to store files privately in moodle
|
||||
And the following "course enrolments" exist:
|
||||
| user | course | role |
|
||||
| teacher1 | C1 | editingteacher |
|
||||
And the following "blocks" exist:
|
||||
| blockname | contextlevel | reference | pagetypepattern | defaultregion |
|
||||
| private_files | Course | C1 | course-view-* | side-pre |
|
||||
And I log in as "teacher1"
|
||||
And I am on "Course 1" course homepage with editing mode on
|
||||
And I add the "Private files" block
|
||||
And I should see "No files available" in the "Private files" "block"
|
||||
When I follow "Manage private files..."
|
||||
And I upload "blocks/private_files/tests/fixtures/testfile.txt" file to "Files" filemanager
|
||||
|
||||
@@ -11,11 +11,9 @@ Feature: The private files block allows users to store files privately in moodle
|
||||
And the following "users" exist:
|
||||
| username | firstname | lastname | email |
|
||||
| teacher1 | Teacher | 1 | teacher1@example.com |
|
||||
And I log in as "admin"
|
||||
And I am on site homepage
|
||||
And I turn editing mode on
|
||||
And I add the "Private files" block
|
||||
And I log out
|
||||
And the following "blocks" exist:
|
||||
| blockname | contextlevel | reference | pagetypepattern | defaultregion |
|
||||
| private_files | System | 1 | site-index | side-pre |
|
||||
|
||||
Scenario: Try to view the private files block as a guest
|
||||
Given I log in as "guest"
|
||||
|
||||
@@ -47,38 +47,33 @@ Feature: View structural changes in recent activity block
|
||||
|
||||
Scenario: Check that Added module information is displayed respecting view capability
|
||||
Given the following "activities" exist:
|
||||
| activity | course | section | name | idnumber | description | groupmode | grouping | visible |
|
||||
| forum | C1 | 1 | ForumVisibleGroups | forum1 | No description | 2 | | 1 |
|
||||
| forum | C1 | 1 | ForumSeparateGroups | forum2 | No description | 1 | | 1 |
|
||||
| forum | C1 | 1 | ForumHidden | forum3 | No description | 1 | | 0 |
|
||||
| forum | C1 | 1 | ForumNoGroups | forum4 | No description | 0 | | 1 |
|
||||
| forum | C1 | 2 | ForumVisibleGroupsG1 | forum5 | No description | 2 | GG1 | 1 |
|
||||
| forum | C1 | 2 | ForumSeparateGroupsG1 | forum6 | No description | 1 | GG1 | 1 |
|
||||
| forum | C1 | 3 | ForumVisibleGroupsG2 | forum7 | No description | 2 | GG2 | 1 |
|
||||
| forum | C1 | 3 | ForumSeparateGroupsG2 | forum8 | No description | 1 | GG2 | 1 |
|
||||
And I log in as "teacher1"
|
||||
| activity | course | name | idnumber | groupmode | grouping | visible |
|
||||
| forum | C1 | ForumVisibleGroups | forum1 | 2 | | 1 |
|
||||
| forum | C1 | ForumSeparateGroups | forum2 | 1 | | 1 |
|
||||
| forum | C1 | ForumHidden | forum3 | 1 | | 0 |
|
||||
| forum | C1 | ForumNoGroups | forum4 | 0 | | 1 |
|
||||
| forum | C1 | ForumVisibleGroupsG1 | forum5 | 2 | GG1 | 1 |
|
||||
| forum | C1 | ForumSeparateGroupsG1 | forum6 | 1 | GG1 | 1 |
|
||||
| forum | C1 | ForumVisibleGroupsG2 | forum7 | 2 | GG2 | 1 |
|
||||
| forum | C1 | ForumSeparateGroupsG2 | forum8 | 1 | GG2 | 1 |
|
||||
|
||||
And I am on "Course 1" course homepage
|
||||
And I click on "ForumVisibleGroupsG1" "link"
|
||||
And I click on "Settings" "link"
|
||||
And I am on the "ForumVisibleGroupsG1" "forum activity editing" page logged in as teacher1
|
||||
And I set the following fields to these values:
|
||||
| Access restrictions | Grouping: Grouping 1 |
|
||||
And I press "Save and return to course"
|
||||
|
||||
And I click on "ForumSeparateGroupsG1" "link"
|
||||
And I click on "Settings" "link"
|
||||
And I am on the "ForumSeparateGroupsG1" "forum activity editing" page
|
||||
And I set the following fields to these values:
|
||||
| Access restrictions | Grouping: Grouping 1 |
|
||||
And I press "Save and return to course"
|
||||
|
||||
And I click on "ForumVisibleGroupsG2" "link"
|
||||
And I click on "Settings" "link"
|
||||
And I am on the "ForumVisibleGroupsG2" "forum activity editing" page
|
||||
And I set the following fields to these values:
|
||||
| Access restrictions | Grouping: Grouping 2 |
|
||||
And I press "Save and return to course"
|
||||
|
||||
And I click on "ForumSeparateGroupsG2" "link"
|
||||
And I click on "Settings" "link"
|
||||
And I am on the "ForumSeparateGroupsG2" "forum activity editing" page
|
||||
|
||||
And I set the following fields to these values:
|
||||
| Access restrictions | Grouping: Grouping 2 |
|
||||
And I press "Save and return to course"
|
||||
@@ -94,10 +89,8 @@ Feature: View structural changes in recent activity block
|
||||
And I should see "ForumSeparateGroupsG1" in the "Recent activity" "block"
|
||||
And I should see "ForumVisibleGroupsG2" in the "Recent activity" "block"
|
||||
And I should see "ForumSeparateGroupsG2" in the "Recent activity" "block"
|
||||
And I log out
|
||||
|
||||
And I log in as "student1"
|
||||
And I am on "Course 1" course homepage
|
||||
And I am on the "Course 1" course page logged in as student1
|
||||
And I should see "ForumVisibleGroups" in the "Recent activity" "block"
|
||||
And I should see "ForumSeparateGroups" in the "Recent activity" "block"
|
||||
And I should see "ForumNoGroups" in the "Recent activity" "block"
|
||||
@@ -106,10 +99,8 @@ Feature: View structural changes in recent activity block
|
||||
And I should see "ForumSeparateGroupsG1" in the "Recent activity" "block"
|
||||
And I should not see "ForumVisibleGroupsG2" in the "Recent activity" "block"
|
||||
And I should not see "ForumSeparateGroupsG2" in the "Recent activity" "block"
|
||||
And I log out
|
||||
|
||||
And I log in as "student2"
|
||||
And I am on "Course 1" course homepage
|
||||
And I am on the "Course 1" course page logged in as student2
|
||||
And I should see "ForumVisibleGroups" in the "Recent activity" "block"
|
||||
And I should see "ForumSeparateGroups" in the "Recent activity" "block"
|
||||
And I should see "ForumNoGroups" in the "Recent activity" "block"
|
||||
@@ -118,10 +109,8 @@ Feature: View structural changes in recent activity block
|
||||
And I should not see "ForumSeparateGroupsG1" in the "Recent activity" "block"
|
||||
And I should see "ForumVisibleGroupsG2" in the "Recent activity" "block"
|
||||
And I should see "ForumSeparateGroupsG2" in the "Recent activity" "block"
|
||||
And I log out
|
||||
|
||||
And I log in as "student3"
|
||||
And I am on "Course 1" course homepage
|
||||
And I am on the "Course 1" course page logged in as student3
|
||||
And I should see "ForumVisibleGroups" in the "Recent activity" "block"
|
||||
And I should see "ForumSeparateGroups" in the "Recent activity" "block"
|
||||
And I should see "ForumNoGroups" in the "Recent activity" "block"
|
||||
@@ -130,17 +119,14 @@ Feature: View structural changes in recent activity block
|
||||
And I should see "ForumSeparateGroupsG1" in the "Recent activity" "block"
|
||||
And I should see "ForumVisibleGroupsG2" in the "Recent activity" "block"
|
||||
And I should see "ForumSeparateGroupsG2" in the "Recent activity" "block"
|
||||
And I log out
|
||||
|
||||
# Teachers have capability to see all groups and hidden activities
|
||||
And I log in as "assistant1"
|
||||
And I am on "Course 1" course homepage
|
||||
And I am on the "Course 1" course page logged in as assistant1
|
||||
And I should see "ForumHidden" in the "Recent activity" "block"
|
||||
And I should see "ForumVisibleGroupsG1" in the "Recent activity" "block"
|
||||
And I should see "ForumSeparateGroupsG1" in the "Recent activity" "block"
|
||||
And I should see "ForumVisibleGroupsG2" in the "Recent activity" "block"
|
||||
And I should see "ForumSeparateGroupsG2" in the "Recent activity" "block"
|
||||
And I log out
|
||||
|
||||
Scenario: Updates and deletes in recent activity block
|
||||
Given the following "activity" exists:
|
||||
@@ -148,7 +134,6 @@ Feature: View structural changes in recent activity block
|
||||
| course | C1 |
|
||||
| idnumber | forum1 |
|
||||
| name | ForumNew |
|
||||
| description | No description |
|
||||
When I log in as "teacher1"
|
||||
And I am on "Course 1" course homepage with editing mode on
|
||||
And I add the "Recent activity" block
|
||||
@@ -158,8 +143,7 @@ Feature: View structural changes in recent activity block
|
||||
|
||||
# Update forum as a teacher after a second to ensure we have a new timestamp for recent activity.
|
||||
And I wait "1" seconds
|
||||
And I log in as "student1"
|
||||
And I am on "Course 1" course homepage
|
||||
And I am on the "Course 1" course page logged in as student1
|
||||
And I should see "Added Forum" in the "Recent activity" "block"
|
||||
And I should see "ForumNew" in the "Recent activity" "block"
|
||||
And I log out
|
||||
@@ -167,10 +151,7 @@ Feature: View structural changes in recent activity block
|
||||
And I wait "1" seconds
|
||||
|
||||
# Update forum as a teacher
|
||||
And I log in as "teacher1"
|
||||
And I am on "Course 1" course homepage
|
||||
And I follow "ForumNew"
|
||||
And I navigate to "Settings" in current page administration
|
||||
And I am on the "ForumNew" "forum activity editing" page logged in as teacher1
|
||||
And I set the following fields to these values:
|
||||
| name | ForumUpdated |
|
||||
And I press "Save and return to course"
|
||||
@@ -178,8 +159,7 @@ Feature: View structural changes in recent activity block
|
||||
And I wait "1" seconds
|
||||
# Student 1 already saw that forum was created, now he can see that forum was updated
|
||||
|
||||
And I log in as "student1"
|
||||
And I am on "Course 1" course homepage
|
||||
And I am on the "Course 1" course page logged in as student1
|
||||
And I should not see "Added Forum" in the "Recent activity" "block"
|
||||
And I should not see "ForumNew" in the "Recent activity" "block"
|
||||
And I should see "Updated Forum" in the "Recent activity" "block"
|
||||
@@ -188,8 +168,7 @@ Feature: View structural changes in recent activity block
|
||||
And I wait "1" seconds
|
||||
# Student 2 has bigger interval and he can see one entry that forum was created but with the new name
|
||||
|
||||
And I log in as "student2"
|
||||
And I am on "Course 1" course homepage
|
||||
And I am on the "Course 1" course page logged in as student2
|
||||
And I should see "Added Forum" in the "Recent activity" "block"
|
||||
And I should not see "ForumNew" in the "Recent activity" "block"
|
||||
And I should not see "Updated Forum" in the "Recent activity" "block"
|
||||
@@ -206,8 +185,7 @@ Feature: View structural changes in recent activity block
|
||||
And I wait "1" seconds
|
||||
# Students 1 and 2 see that forum was deleted
|
||||
|
||||
And I log in as "student1"
|
||||
And I am on "Course 1" course homepage
|
||||
And I am on the "Course 1" course page logged in as student1
|
||||
And I should not see "Added Forum" in the "Recent activity" "block"
|
||||
And I should not see "ForumNew" in the "Recent activity" "block"
|
||||
And I should not see "Updated Forum" in the "Recent activity" "block"
|
||||
@@ -217,8 +195,7 @@ Feature: View structural changes in recent activity block
|
||||
And I wait "1" seconds
|
||||
# Student 3 never knew that forum was created, so he does not see anything
|
||||
|
||||
And I log in as "student3"
|
||||
And I am on "Course 1" course homepage
|
||||
And I am on the "Course 1" course page logged in as student3
|
||||
And I should not see "Added Forum" in the "Recent activity" "block"
|
||||
And I should not see "ForumNew" in the "Recent activity" "block"
|
||||
And I should not see "Updated Forum" in the "Recent activity" "block"
|
||||
|
||||
@@ -16,27 +16,22 @@ Feature: The search forums block allows users to search for forum posts on cours
|
||||
| user | course | role |
|
||||
| teacher1 | C1 | editingteacher |
|
||||
| student1 | C1 | student |
|
||||
And I log in as "teacher1"
|
||||
And I am on "Course 1" course homepage
|
||||
And I navigate to "Settings" in current page administration
|
||||
And the following "blocks" exist:
|
||||
| blockname | contextlevel | reference | pagetypepattern | defaultregion |
|
||||
| news_items | Course | C1 | course-view-* | side-pre |
|
||||
| search_forums | Course | C1 | course-view-* | side-pre |
|
||||
And I am on the "Course 1" "course editing" page logged in as teacher1
|
||||
And I set the field "id_newsitems" to "1"
|
||||
And I press "Save and display"
|
||||
And I turn editing mode on
|
||||
And I add the "Latest announcements" block
|
||||
And I add the "Search forums" block
|
||||
And I log out
|
||||
|
||||
Scenario: Use the search forum block in a course without any forum posts
|
||||
Given I log in as "student1"
|
||||
And I am on "Course 1" course homepage
|
||||
Given I am on the "Course 1" course page logged in as student1
|
||||
When I set the field "Search" to "Moodle"
|
||||
And I press "Search"
|
||||
Then I should see "No posts"
|
||||
|
||||
Scenario: Use the search forum block in a course with a hidden forum and search for posts
|
||||
Given I log in as "teacher1"
|
||||
And I am on "Course 1" course homepage
|
||||
And I add a new topic to "Announcements" forum with:
|
||||
Given I add a new topic to "Announcements" forum with:
|
||||
| Subject | My subject |
|
||||
| Message | My message |
|
||||
And I am on "Course 1" course homepage with editing mode on
|
||||
@@ -45,24 +40,18 @@ Feature: The search forums block allows users to search for forum posts on cours
|
||||
And I expand all fieldsets
|
||||
And I set the field "id_visible" to "0"
|
||||
And I press "Save and return to course"
|
||||
And I log out
|
||||
When I log in as "student1"
|
||||
And I am on "Course 1" course homepage
|
||||
When I am on the "Course 1" course page logged in as student1
|
||||
And "Search forums" "block" should exist
|
||||
When I set the field "Search" to "message"
|
||||
And I set the field "Search" to "message"
|
||||
And I press "Search"
|
||||
Then I should see "No posts"
|
||||
|
||||
Scenario: Use the search forum block in a course and search for posts
|
||||
Given I log in as "teacher1"
|
||||
And I am on "Course 1" course homepage
|
||||
And I add a new topic to "Announcements" forum with:
|
||||
Given I add a new topic to "Announcements" forum with:
|
||||
| Subject | My subject |
|
||||
| Message | My message |
|
||||
And I log out
|
||||
When I log in as "student1"
|
||||
And I am on "Course 1" course homepage
|
||||
When I am on the "Course 1" course page logged in as student1
|
||||
And "Search forums" "block" should exist
|
||||
When I set the field "Search" to "message"
|
||||
And I set the field "Search" to "message"
|
||||
And I press "Search"
|
||||
Then I should see "My subject"
|
||||
|
||||
@@ -8,11 +8,9 @@ Feature: The search forums block allows users to search for forum posts on front
|
||||
Given the following "users" exist:
|
||||
| username | firstname | lastname | email | idnumber |
|
||||
| student1 | Student | 1 | student1@example.com | S1 |
|
||||
And I log in as "admin"
|
||||
And I am on site homepage
|
||||
And I turn editing mode on
|
||||
And I add the "Search forums" block
|
||||
And I log out
|
||||
And the following "blocks" exist:
|
||||
| blockname | contextlevel | reference | pagetypepattern | defaultregion |
|
||||
| search_forums | System | 1 | site-index | side-pre |
|
||||
|
||||
Scenario: Use the search forum block on the frontpage and search for posts as a user
|
||||
Given I log in as "student1"
|
||||
|
||||
@@ -18,16 +18,13 @@ Feature: The Section links block can be configured to display section name in ad
|
||||
| student1 | C1 | student |
|
||||
And the following config values are set as admin:
|
||||
| showsectionname | 1 | block_section_links |
|
||||
And I log in as "admin"
|
||||
And I am on "Course 1" course homepage with editing mode on
|
||||
And the following config values are set as admin:
|
||||
| unaddableblocks | | theme_boost|
|
||||
And I add the "Section links" block
|
||||
And I log out
|
||||
And the following "blocks" exist:
|
||||
| blockname | contextlevel | reference | pagetypepattern | defaultregion |
|
||||
| section_links | Course | C1 | course-view-* | side-pre |
|
||||
|
||||
Scenario: Student can see section name under the Section links block
|
||||
Given I log in as "student1"
|
||||
When I am on "Course 1" course homepage
|
||||
When I am on the "Course 1" course page logged in as student1
|
||||
Then I should see "7: Topic 7" in the "Section links" "block"
|
||||
And I follow "7: Topic 7"
|
||||
And I should see "First assignment"
|
||||
|
||||
@@ -4,12 +4,19 @@ Feature: Add URL to main menu block
|
||||
As a admin
|
||||
I need to add URLs to the main menu block and check it works.
|
||||
|
||||
Background:
|
||||
Given the following "courses" exist:
|
||||
| fullname | shortname | category | enablecompletion |
|
||||
| Course 1 | C1 | 0 | 1 |
|
||||
| Course 2 | C2 | 0 | |
|
||||
And the following "blocks" exist:
|
||||
| blockname | contextlevel | reference | pagetypepattern | defaultregion |
|
||||
| site_main_menu | System | 1 | site-index | side-pre |
|
||||
|
||||
@javascript
|
||||
Scenario: Add a URL in menu block and ensure it appears
|
||||
Given I log in as "admin"
|
||||
And I am on site homepage
|
||||
And I turn editing mode on
|
||||
And I add the "Main menu" block
|
||||
And the following "activity" exists:
|
||||
| activity | url |
|
||||
| course | Acceptance test site |
|
||||
@@ -22,20 +29,15 @@ Feature: Add URL to main menu block
|
||||
And I set the following fields to these values:
|
||||
| id_display | In pop-up |
|
||||
And I press "Save and return to course"
|
||||
And I turn editing mode on
|
||||
Then "reference link" "link" should exist in the "Main menu" "block"
|
||||
And "Add an activity or resource" "button" should exist in the "Main menu" "block"
|
||||
|
||||
@javascript
|
||||
Scenario: Add a URL in menu block can appear in the entire site
|
||||
Given the following "course" exists:
|
||||
| fullname | Course 1 |
|
||||
| shortname | C1 |
|
||||
| category | 0 |
|
||||
| enablecompletion | 1 |
|
||||
When I log in as "admin"
|
||||
And I am on site homepage
|
||||
And I turn editing mode on
|
||||
And I add the "Main menu" block
|
||||
And I configure the "Main menu" block
|
||||
And I set the following fields to these values:
|
||||
| Page contexts | Display throughout the entire site |
|
||||
@@ -61,15 +63,9 @@ Feature: Add URL to main menu block
|
||||
|
||||
@javascript
|
||||
Scenario: Add a URL in menu block can appear in any front page
|
||||
Given the following "course" exists:
|
||||
| fullname | Course 1 |
|
||||
| shortname | C1 |
|
||||
| category | 0 |
|
||||
| enablecompletion | 1 |
|
||||
When I log in as "admin"
|
||||
And I am on site homepage
|
||||
And I turn editing mode on
|
||||
And I add the "Main menu" block
|
||||
And I configure the "Main menu" block
|
||||
And I set the following fields to these values:
|
||||
| Page contexts | Display on the site home and any pages added to the site home. |
|
||||
@@ -95,22 +91,17 @@ Feature: Add URL to main menu block
|
||||
|
||||
@javascript
|
||||
Scenario: When the "Main Menu" block is displayed throrought the entire site, adding an URL in a course
|
||||
results in adding it in the course and not in the frontpage
|
||||
Given the following "course" exists:
|
||||
| fullname | Course 1 |
|
||||
| shortname | C1 |
|
||||
| category | 0 |
|
||||
And I log in as "admin"
|
||||
results in adding it in the course and not in the frontpage
|
||||
Given I log in as "admin"
|
||||
And I am on site homepage
|
||||
And I turn editing mode on
|
||||
And I add the "Main menu" block
|
||||
And I configure the "Main menu" block
|
||||
And I set the following fields to these values:
|
||||
| Page contexts | Display throughout the entire site |
|
||||
And I press "Save changes"
|
||||
When the following "activity" exists:
|
||||
| activity | url |
|
||||
| course | C1 |
|
||||
| course | C2 |
|
||||
| name | reference link |
|
||||
| intro | mooooooooodle |
|
||||
| externalurl | http://www.moodle.com |
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user