Compare commits

..

106 Commits

Author SHA1 Message Date
Huong Nguyen 375a116337 Moodle release 3.11.18 2023-12-08 09:21:33 +07:00
Sara Arjona 48798148dc weekly release 3.11.17+ 2023-12-07 16:22:22 +01:00
Paul Holden f5226e5c14 MDL-79980 mod_survey: remove responses link if user cannot access. 2023-12-07 12:09:53 +01:00
Brendan Heywood 48c204698d MDL-80309 tasks: Clean up mtrace logs 2023-12-07 12:07:22 +08:00
Paul Holden f988260db0 MDL-79980 mod_survey: respect activity group mode getting report. 2023-12-07 09:13:12 +08:00
Stephan Robotta 20b9a7964a MDL-41465 reports: In separate group mode, limit to same group users 2023-12-06 13:48:29 +07:00
Huong Nguyen 4301eca208 MDL-79759 repository_url: Remove types properties 2023-12-05 08:47:01 +07:00
David Woloszyn b4aa28fb2a MDL-79759 repository_url: Limit css imports and remove fragments
There are checks to urls that attempt to limit recurrsion when
parse_file is called. This is problematic for css import urls that
can call an indefinite amount of nested import urls. An import limit
has been introduced to address this. Fragments have also been removed.
2023-12-04 15:08:04 +07:00
Stevani Andolo 803e4c5c2e MDL-80174 tool_log: ensure "other" data is safely unserialized. 2023-12-04 13:41:58 +07:00
Paul Holden fe65dccec9 MDL-80268 badges: require capability to view awarded badges. 2023-12-04 10:16:01 +07:00
Paul Holden 6bddc0f54a MDL-79797 backup: ensure block config is safely unserialized. 2023-12-01 06:14:20 +01:00
Ilya Tregubov edced24880 weekly release 3.11.17+ 2023-12-01 13:12:48 +08:00
Ilya Tregubov a2b130b597 Merge branch 'MDL-79603-311' of https://github.com/andelacruz/moodle into MOODLE_311_STABLE 2023-11-28 13:55:08 +08:00
Huong Nguyen f53220798a weekly release 3.11.17+ 2023-11-24 12:23:59 +07:00
Huong Nguyen cfaabc4c5e Merge branch 'MDL-78496-311' of https://github.com/andrewnicols/moodle into MOODLE_311_STABLE 2023-11-23 09:24:24 +07:00
Andrew Nicols f02bdb5abc MDL-78496 environment: Moodle 4.4 requirements
The only changes to requirements since Moodle 4.3 are increases to:

* the minimum PHP version required; and
* the minimum required Moodle version.
2023-11-17 21:50:16 +08:00
Sara Arjona 77aee43990 weekly release 3.11.17+ 2023-11-16 16:23:00 +01:00
Sara Arjona 2058a17103 Merge branch 'MDL-79981-311' of https://github.com/andrewnicols/moodle into MOODLE_311_STABLE 2023-11-15 17:10:42 +01:00
Angelia Dela Cruz 461c5253ac MDL-79603 mod_scorm: Behat coverage for Scorm package display options 2023-11-15 12:57:13 +08:00
Ilya Tregubov fb4c35353e weekly release 3.11.17+ 2023-11-10 09:17:34 +08:00
Ilya Tregubov e2cd341d74 Merge branch 'MDL-80029-311' of https://github.com/junpataleta/moodle into MOODLE_311_STABLE 2023-11-09 09:36:58 +08:00
Andrew Nicols 28c0b1da10 MDL-79981 core: Add ability to manually run and filter phpunit on GHA 2023-11-08 12:54:21 +08:00
Jun Pataleta a4c5b3bbc7 MDL-80029 grade: Behat test fixes
* Feature: We can use a minimum grade different than zero
  - Use correct minimum input values.
  - Use data generators for faster test execution.
* Scenario: Disable category overriding
  - Use the field name to ensure that the correct field is being tested.

Cherry-picked from MDL-79062.
2023-11-07 20:46:21 +08:00
Jun Pataleta f4877790f9 weekly release 3.11.17+ 2023-10-27 09:43:22 +08:00
Jun Pataleta 41bd964b36 Merge branch 'MDL-79768-311-fix' of https://github.com/andelacruz/moodle into MOODLE_311_STABLE 2023-10-26 23:05:07 +08:00
Angelia Dela Cruz 71356844b9 MDL-79768 fix: Fixed random failing Behat due to time difference 2023-10-26 17:35:23 +08:00
Jun Pataleta 714f288a2a Merge branch 'MDL-79768-311' of https://github.com/andelacruz/moodle into MOODLE_311_STABLE 2023-10-26 10:46:46 +08:00
Angelia Dela Cruz 781b4aad36 MDL-79768 mod_data: Test for student can see upcoming data activity 2023-10-23 08:42:45 +08:00
Sara Arjona 0db96976f2 weekly release 3.11.17+ 2023-10-20 12:16:45 +02:00
Huong Nguyen 687b9e88ac Merge branch 'MDL-79689-311' of https://github.com/andelacruz/moodle into MOODLE_311_STABLE 2023-10-19 10:06:34 +07:00
Angelia Dela Cruz 2c265507e2 MDL-79689 mod_assign: Behat for enabling anonymous submissions 2023-10-18 12:24:21 +08:00
Ilya Tregubov 1f30f4b61a Merge branch 'MDL-79691-311' of https://github.com/andelacruz/moodle into MOODLE_311_STABLE 2023-10-17 10:30:28 +08:00
Angelia Dela Cruz 811738c8f3 MDL-79691 mod_h5pactivity: Behat coverage for H5P activity grades reset 2023-10-16 17:59:02 +08:00
Huong Nguyen 28008f4218 Merge branch 'MDL-79698-311' of https://github.com/andrewnicols/moodle into MOODLE_311_STABLE 2023-10-16 11:41:24 +07:00
Huong Nguyen cf24a2993a Merge branch 'MDL-79653-311' of https://github.com/andelacruz/moodle into MOODLE_311_STABLE 2023-10-16 10:56:13 +07:00
Andrew Nicols a1c66cd1bb MDL-79698 core: Correct duplicate array key in test provider 2023-10-13 15:44:48 +08:00
Ilya Tregubov bd61d3f99d weekly release 3.11.17+ 2023-10-13 13:39:52 +08:00
Angelia Dela Cruz 7a04961d55 MDL-79653 gradingform_guide: Behat coverage for deleting marking guide 2023-10-13 11:37:37 +08:00
Huong Nguyen 46d014e89a Merge branch 'MDL-79638-311' of https://github.com/andrewnicols/moodle into MOODLE_311_STABLE 2023-10-12 11:09:08 +07:00
Andrew Nicols 6c96bcd1ee MDL-79638 phpunit: Add unit test for increment resets 2023-10-11 00:10:33 +08:00
Andrew Nicols 0c5e7442b9 MDL-79638 phpunit: Adjust version checks for mysql/mariadb hack
This hack was introduced to work around a bug in MySQL 5.6.14 and
MariaDB at the time.

https://bugs.mysql.com/bug.php?id=69882

It was addressed a few months later in 5.6.16, and 5.7.4.
MariaDB merged version 5.6.16 of MySQL's InnoDB engine in MariaDB
10.0.11 and got the patch from there.

Moodle has required MySQL 5.7, and MariaDB 10.2.29 since Moodle 3.11 and
it is therefore safe to remove these hacks for these versions.
2023-10-11 00:03:42 +08:00
Jun Pataleta a11ca2d1ff Moodle release 3.11.17 2023-10-07 11:30:05 +08:00
Sara Arjona e2d19fccdd weekly release 3.11.16+ 2023-10-06 14:02:42 +02:00
Paul Holden 6e211165a5 MDL-79310 enrol: restrict searched users to those user can view. 2023-10-04 14:32:16 +08:00
Paul Holden cb041cbdf6 MDL-79310 forumreport_summary: report only on users who can be viewed. 2023-10-04 14:32:15 +08:00
Paul Holden e2e653ea38 MDL-79310 mod_forum: ensure only visible users can be exported. 2023-10-04 14:32:15 +08:00
Mikel Martín c5ff2f6ab2 MDL-79509 mod_wiki: Improve comment editing 2023-10-04 02:04:16 +02:00
Paul Holden 73280a536f MDL-72249 message: stricter cleaning of processor type parameter. 2023-10-04 02:04:16 +02:00
Paul Holden 119feea95d MDL-79426 gradeimport_csv: safely preview CSV content during import. 2023-10-04 02:04:16 +02:00
Paul Holden ae87081d8f MDL-79455 tool_uploadcourse: clean course data fields individually. 2023-10-04 02:04:16 +02:00
Paul Holden c7969fb552 MDL-79455 tool_uploadcourse: safe preview of uploaded course data. 2023-10-04 02:04:16 +02:00
Paul Holden 1f2fbeb50c MDL-79409 mod_imscp: appropriate unserialization of package structure. 2023-10-04 02:04:16 +02:00
Paul Holden c7728de187 MDL-79408 mod_lesson: safer unserializing/comparison of properties. 2023-10-04 02:04:16 +02:00
David Woloszyn 9ecef71191 MDL-77846 core: Make endpoint revision number checks stricter
In some places we prevented cache poisoning, in others we did not. We
also did not place any restriction on the minimum value for a revision.

This change introduces a new set of functions for configonly endpoints
which validates the revision numbers passed in. If the revision is
either too old, or too new, it is rejected and the file content is not
cached. The content is still served, but caching headers are not sent,
and any local storage caching is prevented.

The current time is used as the maximum version, with 60 seconds added
to allow for any clock skew between cluster nodes. Previously some
locations used one hour, but there should never be such a large clock
skew on a correctly configured system.

Co-authored-by: Andrew Nicols <andrew@nicols.co.uk>
2023-10-04 02:04:16 +02:00
Huong Nguyen 691c09afac MDL-66730 core_course: Improve permission check for category moving
Co-authored-by: Erica Bithell <egb10@cam.ac.uk>
2023-10-04 02:04:16 +02:00
Paul Holden 17d208e98b MDL-78820 h5p: use fullname of current user as the xAPI actor name. 2023-10-04 02:04:16 +02:00
meirzamoodle 382d16e311 MDL-78969 oauth2: remove auto-login after successful confirmation
With the new flow, users can go to the login page from the confirmed page,
and if the user successfully logs in, the user will be directed to the confirmed page.
To avoid that, the confirmed page can only be seen by users who are not logged in.
2023-10-04 02:04:16 +02:00
Jun Pataleta b807f99700 weekly release 3.11.16+ 2023-10-04 07:49:27 +08:00
Huong Nguyen 79fe14d66f Merge branch 'MDL-79247_311' of https://github.com/stronk7/moodle into MOODLE_311_STABLE 2023-10-03 09:58:52 +07:00
Eloy Lafuente (stronk7) ee20a85b7c MDL-79247 forum: Workaround same-time discussion modified dates bug
Within the forum_get_discussion_neighbours() function of forum
when the discussions timemodified (last post) is the same, there
is a bug that does strange things when calculating the prev and
next discussions.

Note that, in real life, this is really hard to achieve, but in tests,
when multiple discussions and post can be created by generators in the
same second (specially when the test machine is quick), chances of
facing that problem are higher.

By adding 1 second wait, we ensure that the discussions won't have
the same timemodified (last post) and workaround the problem.

No mater of that, the problem deserves an issue to be created
so we guarantee from code that it also works ok when the same
timemodified (last post) situation happens.
2023-10-01 23:47:32 +02:00
Eloy Lafuente (stronk7) d47d059ca0 MDL-79247 forum: Make discussion list ordering deterministic
Note that normally this doesn't matter much, but there are situations
when we want the discussion list ordering fully consistent /
deterministic.

Specifically, when discussions (or forum posts )are created in the
same second, or when the discussion titles are repeated, or 2
discussions have the same number of votes... (any criteria in general),
in the context of testing, we don't want the order
to be non-consistent, so we need to provide an extra sorting
criterion to make it fully deterministic.

So, in this case, we are adding a sort by discussion.id <<DIRECTION>>
that is an unique value, primary key... so cheap to calculate and,
that way, when the 1st sorting column has repeated values, the id
will decide.
2023-10-01 23:47:32 +02:00
Jun Pataleta 94695eb456 weekly release 3.11.16+ 2023-09-29 22:07:32 +08:00
Ilya Tregubov 972fc66150 Merge branch 'MDL-79360/311' of https://github.com/skodak/moodle into MOODLE_311_STABLE 2023-09-28 09:39:41 +08:00
Sara Arjona f31ece632b weekly release 3.11.16+ 2023-09-15 17:34:28 +02:00
Petr Skoda 5394d544e9 MDL-79360 filter: fix nolink tag regression from MDL-77525 2023-09-15 12:46:00 +02:00
Ilya Tregubov eba8369828 Merge branch 'MDL-79220-311' of https://github.com/andelacruz/moodle into MOODLE_311_STABLE 2023-09-14 17:44:40 +08:00
Ilya Tregubov 3a5ca89951 Merge branch 'MDL-79195-311' of https://github.com/andelacruz/moodle into MOODLE_311_STABLE 2023-09-14 09:39:01 +08:00
Ilya Tregubov 113b846fa9 Merge branch 'MDL-78806-311' of https://github.com/junpataleta/moodle into MOODLE_311_STABLE 2023-09-13 10:56:32 +08:00
Eloy Lafuente (stronk7) 4b72a9bf3f weekly release 3.11.16+ 2023-09-12 18:54:17 +02:00
Angelia Dela Cruz 5a2f76afa8 MDL-79195 core_course: Activity and resource description display behat 2023-09-12 12:54:19 +08:00
Huong Nguyen 52377ed1eb Merge branch 'MDL-79246-311' of https://github.com/andrewnicols/moodle into MOODLE_311_STABLE 2023-09-12 08:52:19 +07:00
Jun Pataleta 5cf07cf084 MDL-78806 mod_assign: Use new Behat step for checking page title 2023-09-10 23:34:31 +08:00
Jun Pataleta d61bd0f37f MDL-78806 behat: Create a step that for checking the page title
Create a Behat step "the page title should contain ':title'" to check
the page title.
2023-09-10 23:34:31 +08:00
Jun Pataleta 8a0e29ef91 weekly release 3.11.16+ 2023-09-08 22:35:24 +08:00
Angelia Dela Cruz b436c50274 MDL-79220 mod_glossary: Behat for glossary entry with attachment 2023-09-07 10:52:00 +08:00
Ilya Tregubov 605edbd719 Merge branch 'MDL-76459_311' of https://github.com/stronk7/moodle into MOODLE_311_STABLE 2023-09-06 10:04:13 +08:00
Andrew Nicols c30664ffc9 MDL-79246 gradingform_rubric: Use i_click_on for behat clicks 2023-09-04 09:13:16 +08:00
Eloy Lafuente (stronk7) 63111e47bf MDL-76459 xmldb: Add environmental check to verify $CFG->prefix
While, right now, sites using long (> 10 chars) $CFG->prefix
can continue working (because we still don't have any table
> 28 chars), as soon as some new table with long name is added,
it won't work with PostgreSQL anymore (if the 63 limit is raised).

Hence, this environmental check will verify on both install and
upgrade that the $CFG->prefix is always <= 10 chars.

Sites with longer prefixes will need to rename all their tables
(and maybe other objects, depending on the dbtype) to use a shorter
prefix.
2023-09-02 09:22:44 +02:00
Andrew Nicols 9b652a2582 weekly release 3.11.16+ 2023-09-02 08:18:44 +08:00
Andrew Nicols bce7262140 Merge branch 'MDL-77831-311' of https://github.com/mickhawkins/moodle into MOODLE_311_STABLE 2023-09-01 10:38:58 +08:00
Jun Pataleta 70612970af Merge branch 'MDL-79017-311' of https://github.com/paulholden/moodle into MOODLE_311_STABLE 2023-08-31 20:31:45 +08:00
Michael Hawkins e13ca87976 MDL-77831 core: Updated security.txt expiry and added additional info 2023-08-31 18:30:08 +08:00
Huong Nguyen 3179d4ec0e Merge branch 'MDL-79207-311' of https://github.com/andelacruz/moodle into MOODLE_311_STABLE 2023-08-31 12:28:01 +07:00
Angelia Dela Cruz fc85f207c1 MDL-79207 core_course: Behat coverage for activity and resource deletion 2023-08-31 11:28:58 +08:00
Jun Pataleta 2863ae670e weekly release 3.11.16+ 2023-08-26 11:03:35 +08:00
Jun Pataleta d5f69200ea Merge branch 'MDL-79015-311-fix' of https://github.com/lameze/moodle into MOODLE_311_STABLE 2023-08-25 09:54:59 +08:00
Simey Lameze f712df8c43 MDL-79015 behat: make verification step more specific 2023-08-25 09:04:26 +08:00
Sara Arjona 6caf5df4a5 Merge branch 'MDL-78965-311' of https://github.com/andelacruz/moodle into MOODLE_311_STABLE 2023-08-24 16:38:59 +02:00
Jun Pataleta 74cf92acb4 Merge branch 'MDL-79015-311' of https://github.com/andelacruz/moodle into MOODLE_311_STABLE 2023-08-24 15:53:27 +08:00
Angelia Dela Cruz 4ae3175b67 MDL-78965 mod_quiz: Behat coverage for quiz with certainty-based marking 2023-08-24 15:26:26 +08:00
Angelia Dela Cruz 1d02e9afab MDL-79015 mod_lesson: Behat coverage for lesson with access restriction 2023-08-24 13:44:40 +08:00
Jun Pataleta 696d6390d4 Merge branch 'MDL-78941-311' of https://github.com/andelacruz/moodle into MOODLE_311_STABLE 2023-08-24 13:05:28 +08:00
Angelia Dela Cruz 14d0110ac6 MDL-78941 mod_quiz: Behat coverage for student flagging quiz questions 2023-08-24 11:34:22 +08:00
Huong Nguyen 3c25374cc4 Merge branch 'MDL-78843-311' of https://github.com/lameze/moodle into MOODLE_311_STABLE 2023-08-24 08:58:56 +07:00
Paul Holden 8461a18143 MDL-79017 core: re-factor method to unserialize array.
We can use the existing helper for object unserialization as the
base for this method, rather than manual string parsing.
2023-08-21 21:02:51 +01:00
Ilya Tregubov a1dee0fff4 weekly release 3.11.16+ 2023-08-18 11:24:08 +08:00
Eloy Lafuente (stronk7) f5f6c30829 Merge branch 'MDL-78684-311-fix-2' of https://github.com/lameze/moodle into MOODLE_311_STABLE 2023-08-17 19:58:08 +02:00
Simey Lameze 7c45d12dce MDL-78684 behat: fix behat failures 2023-08-17 21:16:31 +08:00
Jun Pataleta b87e6ac0e6 Merge branch 'MDL-78938-311' of https://github.com/andrewnicols/moodle into MOODLE_311_STABLE 2023-08-17 09:57:04 +08:00
Andrew Nicols b89030e3ee Merge branch 'MDL-77695-311' of https://github.com/lameze/moodle into MOODLE_311_STABLE 2023-08-16 23:23:50 +08:00
Andrew Nicols b0f04ad753 Merge branch 'MDL-78684-311' of https://github.com/andelacruz/moodle into MOODLE_311_STABLE 2023-08-16 22:45:15 +08:00
Simey Lameze b24d54ac5a MDL-77695 behat: use automatic completion to award badges 2023-08-16 21:16:11 +08:00
Andrew Nicols 307c7244f0 MDL-78938 course: Wrap manual completion toggle in pending
This commit makes two changes to reduce random failures in behat:
- wrap the toggling of manually configured completion in pendingjs
- set the loading spinner content without forcing the completion toggle
  ws to wait for the loading spinner to update.
2023-08-16 21:03:03 +08:00
Andrew Nicols 5ddc9ac171 MDL-78938 report_progres: Wrap completion status update in pending 2023-08-16 21:03:03 +08:00
Simey Lameze d51b5bf5b1 MDL-78843 behat: update get_forum_id to search for idnumber or name
This commit also converts manual steps to create discussions on the
Annoucements forum to data generator.
2023-08-10 10:13:50 +08:00
Angelia Dela Cruz 59dd8d9c07 MDL-78684 Behat: Replace gradebook navigation to use page resolvers
This commit also does other things such as:
- Replace manual steps to setup gradebook by data generators
- Added support for outcomes and scales page resolvers
- Behat clean up
2023-08-01 15:52:07 +08:00
140 changed files with 2174 additions and 955 deletions
+7 -1
View File
@@ -7,6 +7,12 @@ on:
- MOODLE_[0-9]+_STABLE
tags-ignore:
- v[0-9]+.[0-9]+.[0-9]+*
workflow_dispatch:
inputs:
phpunit_extra_options:
description: Additional options to apply to PHPUnit
required: false
default: ''
env:
php: 8.0
@@ -114,4 +120,4 @@ jobs:
env:
dbtype: ${{ matrix.db }}
phpunit_options: ${{ secrets.phpunit_options }}
run: vendor/bin/phpunit $phpunit_options
run: vendor/bin/phpunit $phpunit_options ${{ inputs.phpunit_extra_options }}
+193
View File
@@ -4301,6 +4301,199 @@
</CUSTOM_CHECK>
<CUSTOM_CHECK file="lib/upgradelib.php" function="check_mod_assignment" level="required">
</CUSTOM_CHECK>
<CUSTOM_CHECK file="lib/upgradelib.php" function="check_db_prefix_length" level="required">
</CUSTOM_CHECK>
</CUSTOM_CHECKS>
</MOODLE>
<MOODLE version="4.4" requires="4.1.2">
<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.1.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_CHECK file="lib/upgradelib.php" function="check_db_prefix_length" level="required">
</CUSTOM_CHECK>
</CUSTOM_CHECKS>
</MOODLE>
</COMPATIBILITY_MATRIX>
@@ -105,8 +105,7 @@ Feature: Set up contextual data for tests
And the following "course enrolments" exist:
| user | course | role |
| student1 | C1 | student |
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 I should see "Topic 1"
Scenario: Add role assigns
@@ -140,17 +139,11 @@ Feature: Set up contextual data for tests
When I log in as "user1"
And I am on site homepage
Then "Edit settings" "link" should exist in current page administration
And I log out
And I log in as "user2"
And I am on "Course 1" course homepage
And I am on the "Course 1" course page logged in as user2
And "Turn editing on" "button" should exist
And I log out
And I log in as "user3"
And I am on "Course 1" course homepage
And I am on the "Course 1" course page logged in as user3
And "Turn editing on" "button" should exist
And I log out
And I log in as "user4"
And I am on "Course 1" course homepage
And I am on the "Course 1" course page logged in as user4
And "Turn editing on" "button" should exist
And I log out
And I log in as "user5"
@@ -192,8 +185,7 @@ Feature: Set up contextual data for tests
And the following "activities" exist:
| activity | name | intro | course | idnumber | grade |
| assign | Test assignment name with scale | Test assignment description | C1 | assign1 | Test Scale 1 |
When I log in as "admin"
And I am on "Course 1" course homepage
When I am on the "Course 1" course page logged in as admin
Then I should see "Test assignment name"
# Assignment 2.2 module type is disabled by default
# And I should see "Test assignment22 name"
@@ -311,9 +303,7 @@ Feature: Set up contextual data for tests
And the following "grade categories" exist:
| fullname | course | gradecategory |
| Grade sub category 2 | C1 | Grade category 1 |
When I log in as "admin"
And I am on "Course 1" course homepage
And I navigate to "View > Grader report" in the course gradebook
When I am on the "Course 1" "grades > Grader report > View" page logged in as "admin"
Then I should see "Grade category 1"
And I should see "Grade sub category 2"
@@ -334,9 +324,7 @@ Feature: Set up contextual data for tests
| itemname | course | gradecategory |
| Test Grade Item 2 | C1 | Grade category 1 |
| Test Grade Item 3 | C1 | Grade sub category 2 |
When I log in as "admin"
And I am on "Course 1" course homepage
And I navigate to "Setup > Gradebook setup" in the course gradebook
When I am on the "Course 1" "grades > gradebook setup" page logged in as "admin"
Then I should see "Test Grade Item 1"
And I follow "Edit Test Grade Item 1"
And I expand all fieldsets
@@ -362,9 +350,7 @@ Feature: Set up contextual data for tests
And the following "scales" exist:
| name | scale |
| Test Scale 1 | Disappointing, Good, Very good, Excellent |
When I log in as "admin"
And I am on "Course 1" course homepage
And I navigate to "Scales" in the course gradebook
When I am on the "Course 1" "grades > scales" page logged in as admin
Then I should see "Test Scale 1"
And I should see "Disappointing, Good, Very good, Excellent"
@@ -383,9 +369,7 @@ Feature: Set up contextual data for tests
| Grade outcome 2 | OT2 | C1 | Test Scale 1 |
And the following config values are set as admin:
| enableoutcomes | 1 |
When I log in as "admin"
And I am on "Course 1" course homepage
And I follow "Outcomes"
When I am on the "Course 1" "grades > outcomes" page logged in as admin
Then I should see "Grade outcome 1" in the "#addoutcomes" "css_element"
And I should see "Grade outcome 2" in the "#removeoutcomes" "css_element"
And I follow "Edit outcomes"
+1 -1
View File
@@ -75,7 +75,7 @@ trait reader {
*/
public static function decode_other(?string $other) {
if ($other === 'N;' || preg_match('~^.:~', $other)) {
return unserialize($other);
return unserialize($other, ['allowed_classes' => [stdClass::class]]);
} else {
return json_decode($other, true);
}
@@ -59,9 +59,6 @@ Feature: Backup user data
And I navigate to "Recycle bin" in current page administration
And I should see "Quiz 1"
And I click on "Restore" "link" in the "region-main" "region"
And I log out
And I log in as "student1"
And I am on "Course 1" course homepage
When I navigate to "User report" in the course gradebook
When I am on the "Course 1" "grades > User report > View" page logged in as "student1"
Then "Quiz 1" row "Grade" column of "user-grade" table should contain "5"
And "Quiz 1" row "Percentage" column of "user-grade" table should contain "50"
+10
View File
@@ -37,3 +37,13 @@ function tool_task_status_checks() : array {
];
}
/**
* Function used to handle mtrace by outputting the text to normal browser window.
*
* @param string $message Message to output
* @param string $eol End of line character
*/
function tool_task_mtrace_wrapper(string $message, string $eol): void {
$message = s($message);
echo $message . $eol;
}
+1 -10
View File
@@ -30,16 +30,6 @@ require('../../../config.php');
require_once($CFG->libdir.'/cronlib.php');
/**
* Function used to handle mtrace by outputting the text to normal browser window.
*
* @param string $message Message to output
* @param string $eol End of line character
*/
function tool_task_mtrace_wrapper($message, $eol) {
echo s($message . $eol);
}
// Allow execution of single task. This requires login and has different rules.
$taskname = required_param('task', PARAM_RAW_TRIMMED);
@@ -101,6 +91,7 @@ require_sesskey();
// Prepare to handle output via mtrace.
echo html_writer::start_tag('pre');
require('lib.php');
$CFG->mtrace_wrapper = 'tool_task_mtrace_wrapper';
// Run the specified task (this will output an error if it doesn't exist).
+6 -3
View File
@@ -173,13 +173,16 @@ class tool_uploadcourse_tracker {
} else {
$outcome = $OUTPUT->pix_icon('i/invalid', '');
}
echo html_writer::start_tag('tr', array('class' => 'r' . $this->rownb % 2));
echo html_writer::tag('td', $line, array('class' => 'c' . $ci++));
echo html_writer::tag('td', $outcome, array('class' => 'c' . $ci++));
echo html_writer::tag('td', isset($data['id']) ? $data['id'] : '', array('class' => 'c' . $ci++));
echo html_writer::tag('td', isset($data['shortname']) ? $data['shortname'] : '', array('class' => 'c' . $ci++));
echo html_writer::tag('td', isset($data['fullname']) ? $data['fullname'] : '', array('class' => 'c' . $ci++));
echo html_writer::tag('td', isset($data['idnumber']) ? $data['idnumber'] : '', array('class' => 'c' . $ci++));
// Ensure our data is suitable for HTML output.
echo html_writer::tag('td', isset($data['shortname']) ? s($data['shortname']) : '', array('class' => 'c' . $ci++));
echo html_writer::tag('td', isset($data['fullname']) ? s($data['fullname']) : '', array('class' => 'c' . $ci++));
echo html_writer::tag('td', isset($data['idnumber']) ? s($data['idnumber']) : '', array('class' => 'c' . $ci++));
echo html_writer::tag('td', $status, array('class' => 'c' . $ci++));
echo html_writer::end_tag('tr');
}
+11 -9
View File
@@ -40,7 +40,7 @@ if (!\auth_oauth2\api::is_enabled()) {
$confirmed = $auth->user_confirm($username, $usersecret);
if ($confirmed == AUTH_CONFIRM_ALREADY) {
if ($confirmed == AUTH_CONFIRM_ALREADY && !isloggedin()) {
$user = get_complete_user_data('username', $username);
$PAGE->navbar->add(get_string("alreadyconfirmed"));
$PAGE->set_title(get_string("alreadyconfirmed"));
@@ -61,11 +61,7 @@ if ($confirmed == AUTH_CONFIRM_ALREADY) {
print_error('cannotfinduser', '', '', s($username));
}
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;
@@ -82,14 +78,20 @@ if ($confirmed == AUTH_CONFIRM_ALREADY) {
$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 (!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'));
if (!isloggedin()) {
\core\notification::error(get_string('confirmationinvalid', 'auth_oauth2'));
}
}
redirect("$CFG->wwwroot/");
+7 -1
View File
@@ -1527,7 +1527,13 @@ class backup_block_instance_structure_step extends backup_structure_step {
// Transform configdata information if needed (process links and friends)
$blockrec = $DB->get_record('block_instances', array('id' => $this->task->get_blockid()));
if ($attrstotransform = $this->task->get_configdata_encoded_attributes()) {
$configdata = (array)unserialize(base64_decode($blockrec->configdata));
$configdata = array_filter(
(array) unserialize_object(base64_decode($blockrec->configdata)),
static function($value): bool {
return !($value instanceof __PHP_Incomplete_Class);
}
);
foreach ($configdata as $attribute => $value) {
if (in_array($attribute, $attrstotransform)) {
$configdata[$attribute] = $this->contenttransformer->process($value);
+7 -1
View File
@@ -4331,7 +4331,13 @@ class restore_block_instance_structure_step extends restore_structure_step {
// Let's look for anything within configdata neededing processing
// (nulls and uses of legacy file.php)
if ($attrstotransform = $this->task->get_configdata_encoded_attributes()) {
$configdata = (array) unserialize_object(base64_decode($data->configdata));
$configdata = array_filter(
(array) unserialize_object(base64_decode($data->configdata)),
static function($value): bool {
return !($value instanceof __PHP_Incomplete_Class);
}
);
foreach ($configdata as $attribute => $value) {
if (in_array($attribute, $attrstotransform)) {
$configdata[$attribute] = $this->contentprocessor->process_cdata($value);
+2
View File
@@ -54,6 +54,8 @@ $badge = new badge($badgeid);
$context = $badge->get_context();
$navurl = new moodle_url('/badges/index.php', array('type' => $badge->type));
require_capability('moodle/badges:viewawarded', $context);
if ($badge->type == BADGE_TYPE_COURSE) {
if (empty($CFG->badges_allowcoursebadges)) {
print_error('coursebadgesdisabled', 'badges');
+11 -4
View File
@@ -225,12 +225,19 @@ Feature: Award badges
@javascript
Scenario: Award badge on course completion
Given I log in as "teacher1"
Given the following "activity" exists:
| activity | chat |
| course | C1 |
| name | Music history |
| section | 1 |
| completion | 2 |
| completionview | 1 |
And I log in as "teacher1"
And I am on "Course 1" course homepage
And I navigate to "Course completion" in current page administration
And I set the field "id_overall_aggregation" to "2"
And I click on "Condition: Activity completion" "link"
And I set the field "Assignment - Test assignment name" to "1"
And I set the field "Chat - Music history" to "1"
And I press "Save changes"
And I am on "Course 1" course homepage
And I navigate to "Badges > Add a new badge" in current page administration
@@ -250,8 +257,7 @@ Feature: Award badges
And I follow "Profile" in the user menu
And I click on "Course 1" "link" in the "region-main" "region"
Then I should not see "badges"
And I am on "Course 1" course homepage
And I toggle the manual completion state of "Test assignment name"
When I am on the "Music history" "chat activity" page
And I log out
# Completion cron won't mark the whole course completed unless the
# individual criteria was marked completed more than a second ago. So
@@ -262,6 +268,7 @@ Feature: Award badges
# The student should now see their badge.
And I log in as "student1"
And I follow "Profile" in the user menu
And I click on "Course 1" "link" in the "region-main" "region"
Then I should see "Course Badge"
@javascript
@@ -32,18 +32,15 @@ Feature: The activity results block displays student scores
And the following "activities" exist:
| activity | name | content | course | section | idnumber |
| page | Test page name | This is a page | C1 | 1 | page1 |
And the following "grade grades" exist:
| gradeitem | user | grade |
| Test assignment 1 | student1 | 90.00 |
| Test assignment 1 | student2 | 80.00 |
| Test assignment 1 | student3 | 70.00 |
| Test assignment 1 | student4 | 60.00 |
| Test assignment 1 | student5 | 50.00 |
And I log in as "teacher1"
And I am on "Course 1" course homepage with editing mode on
And I should see "Test page name"
And I navigate to "View > Grader report" in the course gradebook
And I turn editing mode on
And I give the grade "90.00" to the user "Student 1" for the grade item "Test assignment 1"
And I give the grade "80.00" to the user "Student 2" for the grade item "Test assignment 1"
And I give the grade "70.00" to the user "Student 3" for the grade item "Test assignment 1"
And I give the grade "60.00" to the user "Student 4" for the grade item "Test assignment 1"
And I give the grade "50.00" to the user "Student 5" for the grade item "Test assignment 1"
And I press "Save changes"
And I am on "Course 1" course homepage
Scenario: Configure the block on a non-graded activity to show 3 high scores
Given I follow "Test page name"
@@ -27,17 +27,15 @@ Feature: The activity results block displays student high scores
And 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 "grade grades" exist:
| gradeitem | user | grade |
| Test assignment | student1 | 90.00 |
| Test assignment | student2 | 80.00 |
| Test assignment | student3 | 70.00 |
| Test assignment | student4 | 60.00 |
| Test assignment | student5 | 50.00 |
And I log in as "teacher1"
And I am on "Course 1" course homepage with editing mode on
And I navigate to "View > Grader report" in the course gradebook
And I turn editing mode on
And I give the grade "90.00" to the user "Student 1" for the grade item "Test assignment"
And I give the grade "80.00" to the user "Student 2" for the grade item "Test assignment"
And I give the grade "70.00" to the user "Student 3" for the grade item "Test assignment"
And I give the grade "60.00" to the user "Student 4" for the grade item "Test assignment"
And I give the grade "50.00" to the user "Student 5" for the grade item "Test assignment"
And I press "Save changes"
And I am on "Course 1" course homepage
Scenario: Configure the block on the course page to show 0 high scores
Given I add the "Activity results" block
@@ -31,23 +31,15 @@ Feature: The activity results block displays students high scores in group as sc
| name | Test assignment |
| intro | Offline text |
| assignsubmission_file_enabled | 0 |
And I log in as "teacher1"
And I am on "Course 1" course homepage
And I navigate to "Scales" in the course gradebook
And I press "Add a new scale"
And I set the following fields to these values:
| Name | My Scale |
| Scale | Disappointing, Not good enough, Average, Good, Very good, Excellent! |
And I press "Save changes"
And I am on "Course 1" course homepage
And I follow "Test assignment"
And I navigate to "Edit settings" in current page administration
And the following "scales" exist:
| name | scale |
| My Scale | Disappointing, Not good enough, Average, Good, Very good, Excellent! |
And I am on the "Test assignment" "assign activity editing" page logged in as teacher1
And I set the following fields to these values:
| id_grade_modgrade_type | Scale |
| id_grade_modgrade_scale | My Scale |
And I press "Save and return to course"
And I am on "Course 1" course homepage
And I navigate to "View > Grader report" in the course gradebook
And I am on the "Course 1" "grades > Grader report > View" page
And I turn editing mode on
And I give the grade "Excellent!" to the user "Student 1" for the grade item "Test assignment"
And I give the grade "Very good" to the user "Student 2" for the grade item "Test assignment"
@@ -44,25 +44,17 @@ Feature: The activity results block displays student in group high scores as sca
And the following "activities" exist:
| activity | name | intro | course | section | idnumber |
| assign | Test assignment | Offline text | C1 | 1 | assign1 |
And I log in as "teacher1"
And I am on "Course 1" course homepage with editing mode on
And I navigate to "Scales" in the course gradebook
And I press "Add a new scale"
And I set the following fields to these values:
| Name | My Scale |
| Scale | Disappointing, Not good enough, Average, Good, Very good, Excellent! |
And I press "Save changes"
And I am on "Course 1" course homepage
And I follow "Test assignment"
And I navigate to "Edit settings" in current page administration
And the following "scales" exist:
| name | scale |
| My Scale | Disappointing, Not good enough, Average, Good, Very good, Excellent! |
And I am on the "Test assignment" "assign activity editing" page logged in as teacher1
And I set the following fields to these values:
| assignsubmission_file_enabled | 0 |
| id_grade_modgrade_type | Scale |
| id_grade_modgrade_scale | My Scale |
| Group mode | Separate groups |
And I press "Save and return to course"
And I am on "Course 1" course homepage
And I navigate to "View > Grader report" in the course gradebook
And I am on the "Course 1" "grades > Grader report > View" page
And I turn editing mode on
And I give the grade "Excellent!" to the user "Student 1" for the grade item "Test assignment"
And I give the grade "Very good" to the user "Student 2" for the grade item "Test assignment"
@@ -71,7 +63,7 @@ Feature: The activity results block displays student in group high scores as sca
And I give the grade "Good" to the user "Student 5" for the grade item "Test assignment"
And I give the grade "Average" to the user "Student 6" for the grade item "Test assignment"
And I press "Save changes"
And I am on "Course 1" course homepage
And I am on "Course 1" course homepage with editing mode on
Scenario: Try to configure the block on the course page to show 1 high score
Given I add the "Activity results" block
@@ -84,9 +76,7 @@ Feature: The activity results block displays student in group high scores as sca
And I press "Save changes"
Then I should see "Group 1" in the "Activity results" "block"
And I should see "Excellent!" in the "Activity results" "block"
And I log out
And I log in as "student1"
And I am on "Course 1" course homepage
And I am on the "Course 1" course page logged in as student1
And I should see "Student 1" in the "Activity results" "block"
And I should see "Excellent!" in the "Activity results" "block"
@@ -105,9 +95,7 @@ Feature: The activity results block displays student in group high scores as sca
And I should see "Very good" in the "Activity results" "block"
And I should see "Group 3" in the "Activity results" "block"
And I should see "Good" in the "Activity results" "block"
And I log out
And I log in as "student3"
And I am on "Course 1" course homepage
And I am on the "Course 1" course page logged in as student3
And I should see "Student 3" in the "Activity results" "block"
And I should see "Very good" in the "Activity results" "block"
And I should see "Student 4" in the "Activity results" "block"
@@ -128,10 +116,8 @@ Feature: The activity results block displays student in group high scores as sca
And I should see "Excellent!" in the "Activity results" "block"
And I should see "Very good" in the "Activity results" "block"
And I should see "Good" in the "Activity results" "block"
And I log out
# Students cannot see user identity fields.
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 "User" in the "Activity results" "block"
And I should not see "User S1" in the "Activity results" "block"
And I should see "Excellent!" in the "Activity results" "block"
@@ -151,9 +137,7 @@ Feature: The activity results block displays student in group high scores as sca
And I should see "Excellent!" in the "Activity results" "block"
And I should see "Very good" in the "Activity results" "block"
And I should see "Good" in the "Activity results" "block"
And I log out
And I log in as "student1"
And I am on "Course 1" course homepage
And I am on the "Course 1" course page logged in as student1
And I should see "User" in the "Activity results" "block"
And I should see "Excellent!" in the "Activity results" "block"
And I should see "Very good" in the "Activity results" "block"
@@ -46,22 +46,19 @@ Feature: The activity results block displays student in separate groups scores
| course | C1 |
| idnumber | 0001 |
| name | Test assignment |
| intro | Offline text |
| section | 1 |
| assignsubmission_file_enabled | 0 |
| groupmode | 1 |
And the following "grade grades" exist:
| gradeitem | user | grade |
| Test assignment | student1 | 100.00 |
| Test assignment | student2 | 90.00 |
| Test assignment | student3 | 90.00 |
| Test assignment | student4 | 80.00 |
| Test assignment | student5 | 80.00 |
| Test assignment | student6 | 70.00 |
And I log in as "teacher1"
And I am on "Course 1" course homepage with editing mode on
And I navigate to "View > Grader report" in the course gradebook
And I turn editing mode on
And I give the grade "100.00" to the user "Student 1" for the grade item "Test assignment"
And I give the grade "90.00" to the user "Student 2" for the grade item "Test assignment"
And I give the grade "90.00" to the user "Student 3" for the grade item "Test assignment"
And I give the grade "80.00" to the user "Student 4" for the grade item "Test assignment"
And I give the grade "80.00" to the user "Student 5" for the grade item "Test assignment"
And I give the grade "70.00" to the user "Student 6" for the grade item "Test assignment"
And I press "Save changes"
And I am on "Course 1" course homepage
Scenario: Configure the block on the course page to show 1 high score
Given I add the "Activity results" block
@@ -89,9 +86,7 @@ Feature: The activity results block displays student in separate groups scores
And I press "Save changes"
Then I should see "Group 1" in the "Activity results" "block"
And I should see "95.00/100.00" in the "Activity results" "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 "Student 1" in the "Activity results" "block"
And I should see "100.00/100.00" in the "Activity results" "block"
@@ -107,9 +102,7 @@ Feature: The activity results block displays student in separate groups scores
And I press "Save changes"
Then I should see "Group 1" in the "Activity results" "block"
And I should see "95.00" in the "Activity results" "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 "Student 1" in the "Activity results" "block"
And I should see "100.00" in the "Activity results" "block"
@@ -130,9 +123,7 @@ Feature: The activity results block displays student in separate groups scores
And I should see "85%" in the "Activity results" "block"
And I should see "Group 3" in the "Activity results" "block"
And I should see "75%" in the "Activity results" "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 "Student 1" in the "Activity results" "block"
And I should see "100%" in the "Activity results" "block"
And I should see "Student 2" in the "Activity results" "block"
@@ -154,9 +145,7 @@ Feature: The activity results block displays student in separate groups scores
And I should see "85.00/100.00" in the "Activity results" "block"
And I should see "Group 3" in the "Activity results" "block"
And I should see "75.00/100.00" in the "Activity results" "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 "Student 3" in the "Activity results" "block"
And I should see "90.00/100.00" in the "Activity results" "block"
And I should see "Student 4" in the "Activity results" "block"
@@ -178,9 +167,7 @@ Feature: The activity results block displays student in separate groups scores
And I should see "85.00" in the "Activity results" "block"
And I should see "Group 3" in the "Activity results" "block"
And I should see "75.00" in the "Activity results" "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 "Student 1" in the "Activity results" "block"
And I should see "100.00" in the "Activity results" "block"
And I should see "Student 2" in the "Activity results" "block"
@@ -202,10 +189,8 @@ Feature: The activity results block displays student in separate groups scores
And I should see "95.00%" in the "Activity results" "block"
And I should see "85.00%" in the "Activity results" "block"
And I should see "75.00%" in the "Activity results" "block"
And I log out
# Students cannot see user identity fields.
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 "User" in the "Activity results" "block"
And I should not see "User S1" in the "Activity results" "block"
And I should see "100.00%" in the "Activity results" "block"
@@ -226,9 +211,7 @@ Feature: The activity results block displays student in separate groups scores
And I should see "95.00%" in the "Activity results" "block"
And I should see "85.00%" in the "Activity results" "block"
And I should see "75.00%" in the "Activity results" "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 "User" in the "Activity results" "block"
And I should see "100.00%" in the "Activity results" "block"
And I should see "90.00%" in the "Activity results" "block"
@@ -42,26 +42,18 @@ Feature: The activity results block displays student in visible groups scores
| student5 | G3 |
| student6 | G3 |
And the following "activities" exist:
| activity | name | intro | course | idnumber | section | assignsubmission_file_enabled |
| assign | Test assignment | Test assignment | C1 | assign1 | 1 | 0 |
And I log in as "teacher1"
And I am on "Course 1" course homepage with editing mode on
And I follow "Test assignment"
And I navigate to "Edit settings" in current page administration
And I set the following fields to these values:
| Group mode | Visible groups |
And I press "Save and return to course"
And I am on "Course 1" course homepage
And I navigate to "View > Grader report" in the course gradebook
| activity | name | course | idnumber | assignsubmission_file_enabled | groupmode |
| assign | Test assignment | C1 | assign1 | 0 | 2 |
And the following "grade grades" exist:
| gradeitem | user | grade |
| Test assignment | student1 | 100.00 |
| Test assignment | student2 | 90.00 |
| Test assignment | student3 | 90.00 |
| Test assignment | student4 | 80.00 |
| Test assignment | student5 | 80.00 |
| Test assignment | student6 | 70.00 |
And I am on the "Course 1" course page logged in as teacher1
And I turn editing mode on
And I give the grade "100.00" to the user "Student 1" for the grade item "Test assignment"
And I give the grade "90.00" to the user "Student 2" for the grade item "Test assignment"
And I give the grade "90.00" to the user "Student 3" for the grade item "Test assignment"
And I give the grade "80.00" to the user "Student 4" for the grade item "Test assignment"
And I give the grade "80.00" to the user "Student 5" for the grade item "Test assignment"
And I give the grade "70.00" to the user "Student 6" for the grade item "Test assignment"
And I press "Save changes"
And I am on "Course 1" course homepage
Scenario: Configure the block on the course page to show 1 high score
Given I add the "Activity results" block
@@ -29,20 +29,16 @@ Feature: The activity results block displays student low scores
| course | C1 |
| idnumber | 0001 |
| name | Test assignment |
| intro | Offline text |
| section | 1 |
| assignsubmission_file_enabled | 0 |
And the following "grade grades" exist:
| gradeitem | user | grade |
| Test assignment | student1 | 90.00 |
| Test assignment | student2 | 80.00 |
| Test assignment | student3 | 70.00 |
| Test assignment | student4 | 60.00 |
| Test assignment | student5 | 50.00 |
And I log in as "teacher1"
And I am on "Course 1" course homepage with editing mode on
And I navigate to "View > Grader report" in the course gradebook
And I turn editing mode on
And I give the grade "90.00" to the user "Student 1" for the grade item "Test assignment"
And I give the grade "80.00" to the user "Student 2" for the grade item "Test assignment"
And I give the grade "70.00" to the user "Student 3" for the grade item "Test assignment"
And I give the grade "60.00" to the user "Student 4" for the grade item "Test assignment"
And I give the grade "50.00" to the user "Student 5" for the grade item "Test assignment"
And I press "Save changes"
And I am on "Course 1" course homepage
Scenario: Configure the block on the course page to show 1 low score
Given I add the "Activity results" block
@@ -32,23 +32,15 @@ Feature: The activity results block displays student low scores as scales
| idnumber | 0001 |
| section | 1 |
| assignsubmission_file_enabled | 0 |
And I log in as "teacher1"
And I am on "Course 1" course homepage
And I navigate to "Scales" in the course gradebook
And I press "Add a new scale"
And I set the following fields to these values:
| Name | My Scale |
| Scale | Disappointing, Not good enough, Average, Good, Very good, Excellent! |
And I press "Save changes"
And I am on "Course 1" course homepage with editing mode on
And I follow "Test assignment"
And I navigate to "Edit settings" in current page administration
And the following "scales" exist:
| name | scale |
| My Scale | Disappointing, Not good enough, Average, Good, Very good, Excellent! |
And I am on the "Test assignment" "assign activity editing" page logged in as teacher1
And I set the following fields to these values:
| id_grade_modgrade_type | Scale |
| id_grade_modgrade_scale | My Scale |
And I press "Save and return to course"
And I am on "Course 1" course homepage
And I navigate to "View > Grader report" in the course gradebook
And I am on the "Course 1" "grades > Grader report > View" page
And I turn editing mode on
And I give the grade "Excellent!" to the user "Student 1" for the grade item "Test assignment"
And I give the grade "Very good" to the user "Student 2" for the grade item "Test assignment"
@@ -56,7 +48,7 @@ Feature: The activity results block displays student low scores as scales
And I give the grade "Average" to the user "Student 4" for the grade item "Test assignment"
And I give the grade "Not good enough" to the user "Student 5" for the grade item "Test assignment"
And I press "Save changes"
And I am on "Course 1" course homepage
And I am on "Course 1" course homepage with editing mode on
Scenario: Configure the block on the course page to show 1 low score
Given I add the "Activity results" block
@@ -49,23 +49,16 @@ Feature: The activity results block displays students in groups low scores as sc
| description | Offline text |
| assignsubmission_file_enabled | 0 |
| groupmode | 1 |
And I log in as "teacher1"
And I am on "Course 1" course homepage
And I navigate to "Scales" in the course gradebook
And I press "Add a new scale"
And I set the following fields to these values:
| Name | My Scale |
| Scale | Disappointing, Not good enough, Average, Good, Very good, Excellent! |
And I press "Save changes"
And I am on "Course 1" course homepage
And I follow "Test assignment"
And I navigate to "Edit settings" in current page administration
And the following "scales" exist:
| name | scale |
| My Scale | Disappointing, Not good enough, Average, Good, Very good, Excellent! |
And I change window size to "large"
And I am on the "Test assignment" "assign activity editing" page logged in as teacher1
And I set the following fields to these values:
| id_grade_modgrade_type | Scale |
| id_grade_modgrade_scale | My Scale |
And I press "Save and return to course"
And I am on "Course 1" course homepage
And I navigate to "View > Grader report" in the course gradebook
And I am on the "Course 1" "grades > Grader report > View" page
And I turn editing mode on
And I give the grade "Excellent!" to the user "Student 1" for the grade item "Test assignment"
And I give the grade "Very good" to the user "Student 2" for the grade item "Test assignment"
@@ -87,9 +80,7 @@ Feature: The activity results block displays students in groups low scores as sc
And I press "Save changes"
Then I should see "Group 3" in the "Activity results" "block"
And I should see "Good" in the "Activity results" "block"
And I log out
And I log in as "student5"
And I am on "Course 1" course homepage
And I am on the "Course 1" course page logged in as student5
And I should see "Student 6" in the "Activity results" "block"
And I should see "Average" in the "Activity results" "block"
@@ -106,9 +97,7 @@ Feature: The activity results block displays students in groups low scores as sc
And I should see "Very good" in the "Activity results" "block"
And I should see "Group 3" in the "Activity results" "block"
And I should see "Good" in the "Activity results" "block"
And I log out
And I log in as "student3"
And I am on "Course 1" course homepage
And I am on the "Course 1" course page logged in as student3
And I should see "Student 3" in the "Activity results" "block"
And I should see "Very good" in the "Activity results" "block"
And I should see "Student 4" in the "Activity results" "block"
@@ -128,10 +117,8 @@ Feature: The activity results block displays students in groups low scores as sc
Then I should see "Group" in the "Activity results" "block"
And I should see "Very good" in the "Activity results" "block"
And I should see "Good" in the "Activity results" "block"
And I log out
# Students cannot see user identity fields.
And I log in as "student5"
And I am on "Course 1" course homepage
And I am on the "Course 1" course page logged in as student5
And I should see "User" in the "Activity results" "block"
And I should not see "User S5" in the "Activity results" "block"
And I should see "Good" in the "Activity results" "block"
@@ -150,9 +137,7 @@ Feature: The activity results block displays students in groups low scores as sc
Then I should see "Group" in the "Activity results" "block"
And I should see "Very good" in the "Activity results" "block"
And I should see "Good" in the "Activity results" "block"
And I log out
And I log in as "student5"
And I am on "Course 1" course homepage
And I am on the "Course 1" course page logged in as student5
And I should see "User" in the "Activity results" "block"
And I should see "Good" in the "Activity results" "block"
And I should see "Average" in the "Activity results" "block"
@@ -42,20 +42,18 @@ Feature: The activity results block displays students in separate groups scores
| student5 | G3 |
| student6 | G3 |
And the following "activities" exist:
| activity | course | idnumber | name | intro | assignsubmission_file_enabled | groupmode |
| assign | C1 | a1 | Test assignment | Offline text | 0 | 1 |
| activity | course | idnumber | name | assignsubmission_file_enabled | groupmode |
| assign | C1 | a1 | Test assignment | 0 | 1 |
And the following "grade grades" exist:
| gradeitem | user | grade |
| Test assignment | student1 | 100.00 |
| Test assignment | student2 | 90.00 |
| Test assignment | student3 | 90.00 |
| Test assignment | student4 | 80.00 |
| Test assignment | student5 | 80.00 |
| Test assignment | student6 | 70.00 |
And I log in as "teacher1"
And I am on "Course 1" course homepage with editing mode on
And I navigate to "View > Grader report" in the course gradebook
And I turn editing mode on
And I give the grade "100.00" to the user "Student 1" for the grade item "Test assignment"
And I give the grade "90.00" to the user "Student 2" for the grade item "Test assignment"
And I give the grade "90.00" to the user "Student 3" for the grade item "Test assignment"
And I give the grade "80.00" to the user "Student 4" for the grade item "Test assignment"
And I give the grade "80.00" to the user "Student 5" for the grade item "Test assignment"
And I give the grade "70.00" to the user "Student 6" for the grade item "Test assignment"
And I press "Save changes"
And I am on "Course 1" course homepage
Scenario: Configure the block on the course page to show 1 low score
Given I add the "Activity results" block
@@ -83,9 +81,7 @@ Feature: The activity results block displays students in separate groups scores
And I press "Save changes"
Then I should see "Group 3" in the "Activity results" "block"
And I should see "75.00/100.00" in the "Activity results" "block"
And I log out
And I log in as "student5"
And I am on "Course 1" course homepage
And I am on the "Course 1" course page logged in as student5
And I should see "Student 6" in the "Activity results" "block"
And I should see "70.00/100.00" in the "Activity results" "block"
@@ -101,9 +97,7 @@ Feature: The activity results block displays students in separate groups scores
And I press "Save changes"
Then I should see "Group 3" in the "Activity results" "block"
And I should see "75.00" in the "Activity results" "block"
And I log out
And I log in as "student5"
And I am on "Course 1" course homepage
And I am on the "Course 1" course page logged in as student5
And I should see "Student 6" in the "Activity results" "block"
And I should see "70.00" in the "Activity results" "block"
@@ -122,9 +116,7 @@ Feature: The activity results block displays students in separate groups scores
And I should see "85%" in the "Activity results" "block"
And I should see "Group 3" in the "Activity results" "block"
And I should see "75%" in the "Activity results" "block"
And I log out
And I log in as "student5"
And I am on "Course 1" course homepage
And I am on the "Course 1" course page logged in as student5
And I should see "Student 6" in the "Activity results" "block"
And I should see "70%" in the "Activity results" "block"
And I should see "Student 5" in the "Activity results" "block"
@@ -144,9 +136,7 @@ Feature: The activity results block displays students in separate groups scores
And I should see "85.00/100.00" in the "Activity results" "block"
And I should see "Group 3" in the "Activity results" "block"
And I should see "75.00/100.00" in the "Activity results" "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 "Student 3" in the "Activity results" "block"
And I should see "90.00/100.00" in the "Activity results" "block"
And I should see "Student 4" in the "Activity results" "block"
@@ -166,9 +156,7 @@ Feature: The activity results block displays students in separate groups scores
And I should see "85.00" in the "Activity results" "block"
And I should see "Group 3" in the "Activity results" "block"
And I should see "75.00" in the "Activity results" "block"
And I log out
And I log in as "student5"
And I am on "Course 1" course homepage
And I am on the "Course 1" course page logged in as student5
And I should see "Student 5" in the "Activity results" "block"
And I should see "80.00" in the "Activity results" "block"
And I should see "Student 6" in the "Activity results" "block"
@@ -189,10 +177,8 @@ Feature: The activity results block displays students in separate groups scores
Then I should see "Group" in the "Activity results" "block"
And I should see "85.00%" in the "Activity results" "block"
And I should see "75.00%" in the "Activity results" "block"
And I log out
# Students cannot see user identity fields.
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 "User" in the "Activity results" "block"
And I should not see "User S1" in the "Activity results" "block"
And I should see "100.00%" in the "Activity results" "block"
@@ -212,9 +198,7 @@ Feature: The activity results block displays students in separate groups scores
Then I should see "Group" in the "Activity results" "block"
And I should see "85.00%" in the "Activity results" "block"
And I should see "75.00%" in the "Activity results" "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 "User" in the "Activity results" "block"
And I should see "100.00%" in the "Activity results" "block"
And I should see "90.00%" in the "Activity results" "block"
@@ -46,22 +46,18 @@ Feature: The activity results block displays student in visible groups low score
| course | C1 |
| idnumber | 0001 |
| name | Test assignment |
| intro | Offline text |
| section | 1 |
| assignsubmission_file_enabled | 0 |
| groupmode | 2 |
And the following "grade grades" exist:
| gradeitem | user | grade |
| Test assignment | student1 | 100.00 |
| Test assignment | student2 | 90.00 |
| Test assignment | student3 | 90.00 |
| Test assignment | student4 | 80.00 |
| Test assignment | student5 | 80.00 |
| Test assignment | student6 | 70.00 |
And I log in as "teacher1"
And I am on "Course 1" course homepage with editing mode on
And I navigate to "View > Grader report" in the course gradebook
And I turn editing mode on
And I give the grade "100.00" to the user "Student 1" for the grade item "Test assignment"
And I give the grade "90.00" to the user "Student 2" for the grade item "Test assignment"
And I give the grade "90.00" to the user "Student 3" for the grade item "Test assignment"
And I give the grade "80.00" to the user "Student 4" for the grade item "Test assignment"
And I give the grade "80.00" to the user "Student 5" for the grade item "Test assignment"
And I give the grade "70.00" to the user "Student 6" for the grade item "Test assignment"
And I press "Save changes"
And I am on "Course 1" course homepage
Scenario: Configure the block on the course page to show 1 low score
Given I add the "Activity results" block
@@ -87,9 +83,7 @@ Feature: The activity results block displays student in visible groups low score
| id_config_nameformat | Display full names |
| id_config_usegroups | Yes |
And I press "Save changes"
And I log out
Then I log in as "student1"
And I am on "Course 1" course homepage
Then I am on the "Course 1" course page logged in as student1
And I should see "Group 3" in the "Activity results" "block"
And I should see "75.00/100.00" in the "Activity results" "block"
@@ -103,9 +97,7 @@ Feature: The activity results block displays student in visible groups low score
| id_config_nameformat | Display full names |
| id_config_usegroups | Yes |
And I press "Save changes"
And I log out
Then I log in as "student1"
And I am on "Course 1" course homepage
Then I am on the "Course 1" course page logged in as student1
And I should see "Group 3" in the "Activity results" "block"
And I should see "75.00" in the "Activity results" "block"
@@ -124,9 +116,7 @@ Feature: The activity results block displays student in visible groups low score
And I should see "85%" in the "Activity results" "block"
And I should see "Group 3" in the "Activity results" "block"
And I should see "75%" in the "Activity results" "block"
And I log out
And I log in as "student5"
And I am on "Course 1" course homepage
And I am on the "Course 1" course page logged in as student5
Then I should see "Group 2" in the "Activity results" "block"
And I should see "85%" in the "Activity results" "block"
And I should see "Group 3" in the "Activity results" "block"
@@ -142,9 +132,7 @@ Feature: The activity results block displays student in visible groups low score
| id_config_nameformat | Display full names |
| id_config_usegroups | Yes |
And I press "Save changes"
And I log out
Then I log in as "student1"
And I am on "Course 1" course homepage
Then I am on the "Course 1" course page logged in as student1
And I should see "Group 2" in the "Activity results" "block"
And I should see "85.00/100.00" in the "Activity results" "block"
And I should see "Group 3" in the "Activity results" "block"
@@ -160,9 +148,7 @@ Feature: The activity results block displays student in visible groups low score
| id_config_nameformat | Display full names |
| id_config_usegroups | Yes |
And I press "Save changes"
And I log out
Then I log in as "student1"
And I am on "Course 1" course homepage
Then I am on the "Course 1" course page logged in as student1
And I should see "Group 2" in the "Activity results" "block"
And I should see "85.00" in the "Activity results" "block"
And I should see "Group 3" in the "Activity results" "block"
@@ -180,9 +166,7 @@ Feature: The activity results block displays student in visible groups low score
| id_config_nameformat | Display only ID numbers |
| id_config_usegroups | Yes |
And I press "Save changes"
And I log out
Then I log in as "student1"
And I am on "Course 1" course homepage
Then I am on the "Course 1" course page logged in as student1
And I should see "Group" in the "Activity results" "block"
And I should see "85.00%" in the "Activity results" "block"
And I should see "75.00%" in the "Activity results" "block"
@@ -197,9 +181,7 @@ Feature: The activity results block displays student in visible groups low score
| id_config_nameformat | Anonymous results |
| id_config_usegroups | Yes |
And I press "Save changes"
And I log out
Then I log in as "student1"
And I am on "Course 1" course homepage
Then I am on the "Course 1" course page logged in as student1
And I should see "Group" in the "Activity results" "block"
And I should see "85.00%" in the "Activity results" "block"
And I should see "75.00%" in the "Activity results" "block"
@@ -18,17 +18,12 @@ Feature: Latest announcements block displays the course latest news
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 |
And I add a new topic to "Announcements" forum with:
| Subject | Discussion Two |
| Message | Not important |
And I add a new topic to "Announcements" forum with:
| Subject | Discussion Three |
| Message | Not important |
And I am on "Course 1" course homepage
And the following "mod_forum > discussions" exist:
| user | forum | name | message |
| teacher1 | Announcements | Discussion One | Not important |
| teacher1 | Announcements | Discussion Two | Not important |
| teacher1 | Announcements | Discussion Three | Not important |
When I am on the "Course 1" Course page logged in as teacher1
Then I should see "Discussion One" in the "Latest announcements" "block"
And I should see "Discussion Two" in the "Latest announcements" "block"
And I should see "Discussion Three" in the "Latest announcements" "block"
@@ -23,6 +23,9 @@ Feature: The search forums block allows users to search for forum posts on cours
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 the following "mod_forum > discussions" exist:
| user | forum | name | message |
| teacher1 | Announcements | My subject | My message |
Scenario: Use the search forum block in a course without any forum posts
Given I am on the "Course 1" course page logged in as student1
@@ -31,12 +34,7 @@ Feature: The search forums block allows users to search for forum posts on cours
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 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
And I follow "Announcements"
And I navigate to "Edit settings" in current page administration
Given I am on the "Announcements" "forum activity editing" page logged in as teacher1
And I expand all fieldsets
And I set the field "id_visible" to "0"
And I press "Save and return to course"
@@ -47,10 +45,7 @@ Feature: The search forums block allows users to search for forum posts on cours
Then I should see "No posts"
Scenario: Use the search forum block in a course and search for posts
Given I add a new topic to "Announcements" forum with:
| Subject | My subject |
| Message | My message |
When I am on the "Course 1" course page logged in as student1
Given I am on the "Course 1" course page logged in as student1
And "Search forums" "block" should exist
And I set the field "Search" to "message"
And I press "Search"
+1 -1
View File
@@ -1,3 +1,3 @@
function _typeof(obj){return _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(obj){return typeof obj}:function(obj){return obj&&"function"==typeof Symbol&&obj.constructor===Symbol&&obj!==Symbol.prototype?"symbol":typeof obj},_typeof(obj)}define("core_course/manual_completion_toggle",["exports","core/templates","core/notification","core_course/repository","core_course/events"],(function(_exports,_templates,_notification,_repository,CourseEvents){function _getRequireWildcardCache(nodeInterop){if("function"!=typeof WeakMap)return null;var cacheBabelInterop=new WeakMap,cacheNodeInterop=new WeakMap;return(_getRequireWildcardCache=function(nodeInterop){return nodeInterop?cacheNodeInterop:cacheBabelInterop})(nodeInterop)}function _interopRequireDefault(obj){return obj&&obj.__esModule?obj:{default:obj}}function asyncGeneratorStep(gen,resolve,reject,_next,_throw,key,arg){try{var info=gen[key](arg),value=info.value}catch(error){return void reject(error)}info.done?resolve(value):Promise.resolve(value).then(_next,_throw)}Object.defineProperty(_exports,"__esModule",{value:!0}),_exports.init=void 0,_templates=_interopRequireDefault(_templates),_notification=_interopRequireDefault(_notification),CourseEvents=function(obj,nodeInterop){if(!nodeInterop&&obj&&obj.__esModule)return obj;if(null===obj||"object"!==_typeof(obj)&&"function"!=typeof obj)return{default:obj};var cache=_getRequireWildcardCache(nodeInterop);if(cache&&cache.has(obj))return cache.get(obj);var newObj={},hasPropertyDescriptor=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var key in obj)if("default"!==key&&Object.prototype.hasOwnProperty.call(obj,key)){var desc=hasPropertyDescriptor?Object.getOwnPropertyDescriptor(obj,key):null;desc&&(desc.get||desc.set)?Object.defineProperty(newObj,key,desc):newObj[key]=obj[key]}newObj.default=obj,cache&&cache.set(obj,newObj);return newObj}(CourseEvents);var SELECTORS_MANUAL_TOGGLE="button[data-action=toggle-manual-completion]",TOGGLE_TYPES_TOGGLE_MARK_DONE="manual:mark-done",registered=!1;_exports.init=function(){registered||(document.addEventListener("click",(function(e){var toggleButton=e.target.closest(SELECTORS_MANUAL_TOGGLE);toggleButton&&(e.preventDefault(),toggleManualCompletionState(toggleButton).catch(_notification.default.exception))})),registered=!0)};var fn,_ref,toggleManualCompletionState=(fn=regeneratorRuntime.mark((function _callee(toggleButton){var originalInnerHtml,toggleType,cmid,activityname,completed,loadingHtml,templateContext,renderObject,replacedNode,newToggleButton,withAvailability,toggledEvent;return regeneratorRuntime.wrap((function(_context){for(;;)switch(_context.prev=_context.next){case 0:return originalInnerHtml=toggleButton.innerHTML,toggleButton.setAttribute("disabled","disabled"),toggleType=toggleButton.getAttribute("data-toggletype"),cmid=toggleButton.getAttribute("data-cmid"),activityname=toggleButton.getAttribute("data-activityname"),completed=toggleType===TOGGLE_TYPES_TOGGLE_MARK_DONE,_context.next=8,_templates.default.render("core/loading",{});case 8:return loadingHtml=_context.sent,_context.next=11,_templates.default.replaceNodeContents(toggleButton,loadingHtml,"");case 11:return _context.prev=11,_context.next=14,(0,_repository.toggleManualCompletion)(cmid,completed);case 14:return templateContext={cmid:cmid,activityname:activityname,overallcomplete:completed,overallincomplete:!completed,istrackeduser:!0},_context.next=17,_templates.default.renderForPromise("core_course/completion_manual",templateContext);case 17:return renderObject=_context.sent,_context.next=20,_templates.default.replaceNode(toggleButton,renderObject.html,renderObject.js);case 20:replacedNode=_context.sent,newToggleButton=replacedNode.pop(),withAvailability=toggleButton.getAttribute("data-withavailability"),toggledEvent=new CustomEvent(CourseEvents.manualCompletionToggled,{bubbles:!0,detail:{cmid:cmid,activityname:activityname,completed:completed,withAvailability:withAvailability}}),newToggleButton.dispatchEvent(toggledEvent),_context.next=32;break;case 27:_context.prev=27,_context.t0=_context.catch(11),toggleButton.removeAttribute("disabled"),toggleButton.innerHTML=originalInnerHtml,_notification.default.exception(_context.t0);case 32:case"end":return _context.stop()}}),_callee,null,[[11,27]])})),_ref=function(){var self=this,args=arguments;return new Promise((function(resolve,reject){var gen=fn.apply(self,args);function _next(value){asyncGeneratorStep(gen,resolve,reject,_next,_throw,"next",value)}function _throw(err){asyncGeneratorStep(gen,resolve,reject,_next,_throw,"throw",err)}_next(void 0)}))},function(_x){return _ref.apply(this,arguments)})}));
function _typeof(obj){return _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(obj){return typeof obj}:function(obj){return obj&&"function"==typeof Symbol&&obj.constructor===Symbol&&obj!==Symbol.prototype?"symbol":typeof obj},_typeof(obj)}define("core_course/manual_completion_toggle",["exports","core/templates","core/notification","core_course/repository","core_course/events","core/pending"],(function(_exports,_templates,_notification,_repository,CourseEvents,_pending){function _getRequireWildcardCache(nodeInterop){if("function"!=typeof WeakMap)return null;var cacheBabelInterop=new WeakMap,cacheNodeInterop=new WeakMap;return(_getRequireWildcardCache=function(nodeInterop){return nodeInterop?cacheNodeInterop:cacheBabelInterop})(nodeInterop)}function _interopRequireDefault(obj){return obj&&obj.__esModule?obj:{default:obj}}function asyncGeneratorStep(gen,resolve,reject,_next,_throw,key,arg){try{var info=gen[key](arg),value=info.value}catch(error){return void reject(error)}info.done?resolve(value):Promise.resolve(value).then(_next,_throw)}Object.defineProperty(_exports,"__esModule",{value:!0}),_exports.init=void 0,_templates=_interopRequireDefault(_templates),_notification=_interopRequireDefault(_notification),CourseEvents=function(obj,nodeInterop){if(!nodeInterop&&obj&&obj.__esModule)return obj;if(null===obj||"object"!==_typeof(obj)&&"function"!=typeof obj)return{default:obj};var cache=_getRequireWildcardCache(nodeInterop);if(cache&&cache.has(obj))return cache.get(obj);var newObj={},hasPropertyDescriptor=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var key in obj)if("default"!==key&&Object.prototype.hasOwnProperty.call(obj,key)){var desc=hasPropertyDescriptor?Object.getOwnPropertyDescriptor(obj,key):null;desc&&(desc.get||desc.set)?Object.defineProperty(newObj,key,desc):newObj[key]=obj[key]}newObj.default=obj,cache&&cache.set(obj,newObj);return newObj}(CourseEvents),_pending=_interopRequireDefault(_pending);var SELECTORS_MANUAL_TOGGLE="button[data-action=toggle-manual-completion]",TOGGLE_TYPES_TOGGLE_MARK_DONE="manual:mark-done",registered=!1;_exports.init=function(){registered||(document.addEventListener("click",(function(e){var toggleButton=e.target.closest(SELECTORS_MANUAL_TOGGLE);toggleButton&&(e.preventDefault(),toggleManualCompletionState(toggleButton).catch(_notification.default.exception))})),registered=!0)};var fn,_ref,toggleManualCompletionState=(fn=regeneratorRuntime.mark((function _callee(toggleButton){var pendingPromise,originalInnerHtml,toggleType,cmid,activityname,completed,templateContext,renderObject,replacedNode,newToggleButton,withAvailability,toggledEvent;return regeneratorRuntime.wrap((function(_context){for(;;)switch(_context.prev=_context.next){case 0:return pendingPromise=new _pending.default("core_course:toggleManualCompletionState"),originalInnerHtml=toggleButton.innerHTML,toggleButton.setAttribute("disabled","disabled"),toggleType=toggleButton.getAttribute("data-toggletype"),cmid=toggleButton.getAttribute("data-cmid"),activityname=toggleButton.getAttribute("data-activityname"),completed=toggleType===TOGGLE_TYPES_TOGGLE_MARK_DONE,_templates.default.renderForPromise("core/loading",{}).then((function(loadingHtml){_templates.default.replaceNodeContents(toggleButton,loadingHtml,"")})).catch((function(){})),_context.prev=8,_context.next=11,(0,_repository.toggleManualCompletion)(cmid,completed);case 11:return templateContext={cmid:cmid,activityname:activityname,overallcomplete:completed,overallincomplete:!completed,istrackeduser:!0},_context.next=14,_templates.default.renderForPromise("core_course/completion_manual",templateContext);case 14:return renderObject=_context.sent,_context.next=17,_templates.default.replaceNode(toggleButton,renderObject.html,renderObject.js);case 17:replacedNode=_context.sent,newToggleButton=replacedNode.pop(),withAvailability=toggleButton.getAttribute("data-withavailability"),toggledEvent=new CustomEvent(CourseEvents.manualCompletionToggled,{bubbles:!0,detail:{cmid:cmid,activityname:activityname,completed:completed,withAvailability:withAvailability}}),newToggleButton.dispatchEvent(toggledEvent),_context.next=29;break;case 24:_context.prev=24,_context.t0=_context.catch(8),toggleButton.removeAttribute("disabled"),toggleButton.innerHTML=originalInnerHtml,_notification.default.exception(_context.t0);case 29:pendingPromise.resolve();case 30:case"end":return _context.stop()}}),_callee,null,[[8,24]])})),_ref=function(){var self=this,args=arguments;return new Promise((function(resolve,reject){var gen=fn.apply(self,args);function _next(value){asyncGeneratorStep(gen,resolve,reject,_next,_throw,"next",value)}function _throw(err){asyncGeneratorStep(gen,resolve,reject,_next,_throw,"throw",err)}_next(void 0)}))},function(_x){return _ref.apply(this,arguments)})}));
//# sourceMappingURL=manual_completion_toggle.min.js.map
File diff suppressed because one or more lines are too long
+8 -2
View File
@@ -26,6 +26,7 @@ import Templates from 'core/templates';
import Notification from 'core/notification';
import {toggleManualCompletion} from 'core_course/repository';
import * as CourseEvents from 'core_course/events';
import Pending from 'core/pending';
/**
* Selectors in the manual completion template.
@@ -77,6 +78,7 @@ export const init = () => {
* @returns {Promise<void>}
*/
const toggleManualCompletionState = async(toggleButton) => {
const pendingPromise = new Pending('core_course:toggleManualCompletionState');
// Make a copy of the original content of the button.
const originalInnerHtml = toggleButton.innerHTML;
@@ -91,8 +93,11 @@ const toggleManualCompletionState = async(toggleButton) => {
const completed = toggleType === TOGGLE_TYPES.TOGGLE_MARK_DONE;
// Replace the button contents with the loading icon.
const loadingHtml = await Templates.render('core/loading', {});
await Templates.replaceNodeContents(toggleButton, loadingHtml, '');
Templates.renderForPromise('core/loading', {})
.then((loadingHtml) => {
Templates.replaceNodeContents(toggleButton, loadingHtml, '');
return;
}).catch(() => {});
try {
// Call the webservice to update the manual completion status.
@@ -134,4 +139,5 @@ const toggleManualCompletionState = async(toggleButton) => {
// Show the exception.
Notification.exception(exception);
}
pendingPromise.resolve();
};
+13
View File
@@ -2144,6 +2144,19 @@ class core_course_external extends external_api {
self::validate_context($categorycontext);
require_capability('moodle/category:manage', $categorycontext);
// If the category parent is being changed, check for capability in the new parent category
if (isset($cat['parent']) && ($cat['parent'] !== $category->parent)) {
if ($cat['parent'] == 0) {
// Creating a top level category requires capability in the system context
$parentcontext = context_system::instance();
} else {
// Category context
$parentcontext = context_coursecat::instance($cat['parent']);
}
self::validate_context($parentcontext);
require_capability('moodle/category:manage', $parentcontext);
}
// this will throw an exception if descriptionformat is not valid
external_validate_format($cat['descriptionformat']);
@@ -0,0 +1,39 @@
@core @core_course
Feature: Delete activity and resource works correctly
As a teacher
I want to be able to delete an activity and resource
So that I can remove it from the course
Background:
Given the following "users" exist:
| username | firstname | lastname | email |
| teacher1 | Teacher | 1 | teacher1@example.com |
And the following "courses" exist:
| fullname | shortname | category |
| Course 1 | C1 | 0 |
And the following "course enrolments" exist:
| user | course | role |
| teacher1 | C1 | editingteacher |
And the following "activities" exist:
| activity | course | name | intro |
| label | C1 | Label 1 | Label 1 |
| glossary | C1 | Glossary 1 | Glossary 1 |
@javascript
Scenario: Activity and resource can be deleted properly
Given I am on the "Course 1" course page logged in as teacher1
And I turn editing mode on
And I open "Label 1" actions menu
When I click on "Delete" "link" in the "Label 1" activity
And I click on "Yes" "button" in the "Confirm" "dialogue"
# Confirm that label is successfully deleted
Then I should not see "Label 1"
And I open "Glossary 1" actions menu
And I click on "Delete" "link" in the "Glossary 1" activity
And I click on "Yes" "button" in the "Confirm" "dialogue"
# Confirm that glossary is successfully deleted
And I should not see "Glossary 1"
# Reload the page and confirm that both the label and glossary are really deleted
And I reload the page
And I should not see "Label 1"
And I should not see "Glossary 1"
@@ -0,0 +1,71 @@
@core @core_course
Feature: Display activity and resource description
In order to display activity and resource description
As teacher
I should be able to enable "Display description on course page"
Background:
Given the following "users" exist:
| username | firstname | lastname | email |
| teacher1 | Teacher | 1 | teacher1@example.com |
And the following "courses" exist:
| fullname | shortname |
| Course 1 | C1 |
And the following "course enrolments" exist:
| user | course | role |
| teacher1 | C1 | editingteacher |
Scenario Outline: Display activity and resource descriptions
# Generate activity/resource with description
Given the following "activities" exist:
| activity | course | name | intro | showdescription |
| <acttype> | C1 | <actname> | <actname> intro | 1 |
When I am on the "Course 1" course page logged in as teacher1
# Confirm that activity name and description are displayed
Then I should see "<actname>" in the "region-main" "region"
And I should see "<actname> intro" in the "region-main" "region"
Examples:
| acttype | actname |
| assign | Assign 1 |
| book | Book 1 |
| chat | Chat 1 |
| data | Database 1 |
| feedback | Feedback 1 |
| forum | Forum 1 |
| label | Label 1 |
| lti | LTI 1 |
| page | Page 1 |
| quiz | Quiz 1 |
| resource | Resource 1 |
| imscp | IMSCP 1 |
| folder | Folder 1 |
| glossary | Glossary 1 |
| scorm | Scorm 1 |
| lesson | Lesson 1 |
| survey | Survey 1 |
| url | URL 1 |
| wiki | Wiki 1 |
| workshop | Workshop 1 |
Scenario: Display url activity description with pop-up display
# Generate url activity with description and popup appearance
Given the following "activities" exist:
| activity | course | name | intro | showdescription | display | popupwidth | popupheight |
| url | C1 | URL 1 | URL 1 intro | 1 | 6 | 620 | 450 |
When I am on the "Course 1" course page logged in as teacher1
# Confirm that activity name and description are displayed
Then I should see "URL 1" in the "region-main" "region"
And I should see "URL 1 intro" in the "region-main" "region"
Scenario: Display activity with image description
# Generate page activity with image embedded in description
Given the following "activities" exist:
| activity | course | name | intro | showdescription |
| page | C1 | Page 1 | Page 1 intro with image: <img src="http://download.moodle.org/unittest/test.jpg"> | 1 |
When I am on the "Course 1" course page logged in as teacher1
# Confirm that activity name and description are displayed
Then I should see "Page 1" in the "region-main" "region"
And I should see "Page 1 intro with image:" in the "region-main" "region"
# Confirm that image element exists
And "//img[contains(@src, 'http://download.moodle.org/unittest/test.jpg')]" "xpath_element" should exist in the "region-main" "region"
+38
View File
@@ -362,6 +362,44 @@ class core_course_externallib_testcase extends externallib_advanced_testcase {
core_course_external::update_categories($categories);
}
/**
* Test update_categories method for moving categories
*/
public function test_update_categories_moving() {
$this->resetAfterTest();
// Create data.
$categorya = self::getDataGenerator()->create_category([
'name' => 'CAT_A',
]);
$categoryasub = self::getDataGenerator()->create_category([
'name' => 'SUBCAT_A',
'parent' => $categorya->id
]);
$categoryb = self::getDataGenerator()->create_category([
'name' => 'CAT_B',
]);
// Create a new test user.
$testuser = self::getDataGenerator()->create_user();
$this->setUser($testuser);
// Set the capability for CAT_A only.
$contextcata = context_coursecat::instance($categorya->id);
$roleid = $this->assignUserCapability('moodle/category:manage', $contextcata->id);
// Then we move SUBCAT_A parent: CAT_A => CAT_B.
$categories = [
[
'id' => $categoryasub->id,
'parent' => $categoryb->id
]
];
$this->expectException('required_capability_exception');
core_course_external::update_categories($categories);
}
/**
* Test create_courses numsections
*/
+16 -5
View File
@@ -570,17 +570,28 @@ class course_enrolment_manager {
*/
public function search_users(string $search = '', bool $searchanywhere = false, int $page = 0, int $perpage = 25,
bool $returnexactcount = false) {
global $USER;
[$ufields, $joins, $params, $wherecondition] = $this->get_basic_search_conditions($search, $searchanywhere);
$groupmode = groups_get_course_groupmode($this->course);
if ($groupmode == SEPARATEGROUPS && !has_capability('moodle/site:accessallgroups', $this->context)) {
$groups = groups_get_all_groups($this->course->id, $USER->id, 0, 'g.id');
$groupids = array_column($groups, 'id');
} else {
$groupids = [];
}
[$enrolledsql, $enrolledparams] = get_enrolled_sql($this->context, '', $groupids);
$fields = 'SELECT ' . $ufields;
$countfields = 'SELECT COUNT(u.id)';
$sql = " FROM {user} u
$joins
JOIN {user_enrolments} ue ON ue.userid = u.id
JOIN {enrol} e ON ue.enrolid = e.id
WHERE $wherecondition
AND e.courseid = :courseid";
$params['courseid'] = $this->course->id;
JOIN ($enrolledsql) je ON je.id = u.id
WHERE $wherecondition";
$params = array_merge($params, $enrolledparams);
return $this->execute_search_queries($search, $fields, $countfields, $sql, $params, $page, $perpage, 0, $returnexactcount);
}
+56 -1
View File
@@ -16,6 +16,7 @@
namespace core_enrol;
use context_course;
use course_enrolment_manager;
/**
@@ -25,10 +26,11 @@ use course_enrolment_manager;
* @category test
* @copyright 2016 Ruslan Kabalin, Lancaster University
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
* @covers \course_enrolment_manager
*/
class course_enrolment_manager_test extends \advanced_testcase {
/**
* The course context used in tests.
* The course used in tests.
* @var stdClass
*/
private $course = null;
@@ -546,4 +548,57 @@ class course_enrolment_manager_test extends \advanced_testcase {
$this->assertArrayNotHasKey('totalusers', $users);
}
}
/**
* Test that search_users observes course group mode restrictions correctly
*/
public function test_search_users_course_groupmode(): void {
global $DB, $PAGE;
$this->resetAfterTest();
$teacher = $this->getDataGenerator()->create_and_enrol($this->course, 'teacher');
$this->getDataGenerator()->create_group_member(['groupid' => $this->groups['group1']->id, 'userid' => $teacher->id]);
$this->setUser($teacher);
$users = (new course_enrolment_manager($PAGE, $this->course))->search_users('', false, 0, 25, true);
$this->assertEqualsCanonicalizing([
$teacher->username,
$this->users['user0']->username,
$this->users['user1']->username,
$this->users['user21']->username,
$this->users['user22']->username,
$this->users['userall']->username,
$this->users['usertch']->username,
], array_column($users['users'], 'username'));
$this->assertEquals(7, $users['totalusers']);
// Switch course to separate groups.
$this->course->groupmode = SEPARATEGROUPS;
update_course($this->course);
$users = (new course_enrolment_manager($PAGE, $this->course))->search_users('', false, 0, 25, true);
$this->assertEqualsCanonicalizing([
$teacher->username,
$this->users['user1']->username,
$this->users['userall']->username,
], array_column($users['users'], 'username'));
$this->assertEquals(3, $users['totalusers']);
// Allow teacher to access all groups.
$roleid = $DB->get_field('role', 'id', ['shortname' => 'teacher']);
assign_capability('moodle/site:accessallgroups', CAP_ALLOW, $roleid, context_course::instance($this->course->id)->id);
$users = (new course_enrolment_manager($PAGE, $this->course))->search_users('', false, 0, 25, true);
$this->assertEqualsCanonicalizing([
$teacher->username,
$this->users['user0']->username,
$this->users['user1']->username,
$this->users['user21']->username,
$this->users['user22']->username,
$this->users['userall']->username,
$this->users['usertch']->username,
], array_column($users['users'], 'username'));
$this->assertEquals(7, $users['totalusers']);
}
}
+37
View File
@@ -1122,6 +1122,43 @@ class enrollib_test extends advanced_testcase {
$this->assertCount(1, enrol_get_course_users($course1->id, true));
}
/**
* test_course_users in groups
*
* @covers \enrol_get_course_users()
* @return void
*/
public function test_course_users_in_groups() {
$this->resetAfterTest();
$user1 = $this->getDataGenerator()->create_user();
$user2 = $this->getDataGenerator()->create_user();
$user3 = $this->getDataGenerator()->create_user();
$course = $this->getDataGenerator()->create_course();
$group1 = $this->getDataGenerator()->create_group(['courseid' => $course->id]);
$group2 = $this->getDataGenerator()->create_group(['courseid' => $course->id]);
$this->getDataGenerator()->enrol_user($user1->id, $course->id);
$this->getDataGenerator()->enrol_user($user2->id, $course->id);
$this->getDataGenerator()->enrol_user($user3->id, $course->id);
$this->getDataGenerator()->create_group_member(['groupid' => $group1->id, 'userid' => $user1->id]);
$this->getDataGenerator()->create_group_member(['groupid' => $group2->id, 'userid' => $user1->id]);
$this->getDataGenerator()->create_group_member(['groupid' => $group2->id, 'userid' => $user2->id]);
$this->assertCount(3, enrol_get_course_users($course->id));
$this->assertCount(1, enrol_get_course_users($course->id, false, [], [], [$group1->id]));
$this->assertCount(2, enrol_get_course_users($course->id, false, [], [], [$group2->id]));
$instances = enrol_get_instances($course->id, true);
$manualinstance = reset($instances);
$manualplugin = enrol_get_plugin('manual');
$manualplugin->update_user_enrol($manualinstance, $user1->id, ENROL_USER_SUSPENDED);
$this->assertCount(2, enrol_get_course_users($course->id, false, [], [], [$group2->id]));
$this->assertCount(1, enrol_get_course_users($course->id, true, [], [], [$group2->id]));
}
/**
* Test count of enrolled users
*
+4 -6
View File
@@ -20,12 +20,10 @@ Feature: I need to export grades as text
| activity | course | idnumber | name | intro | assignsubmission_onlinetext_enabled |
| assign | C1 | a1 | Test assignment name | Submit your online text | 1 |
| assign | C1 | a2 | Test assignment name 2 | Submit your online text | 1 |
And I log in as "teacher1"
And I am on "Course 1" course homepage
And I navigate to "View > Grader report" in the course gradebook
And I turn editing mode on
And I give the grade "80.00" to the user "Student 1" for the grade item "Test assignment name"
And I press "Save changes"
And the following "grade grades" exist:
| gradeitem | user | grade |
| Test assignment name | student1 | 80.00 |
And I am on the "Course 1" "grades > Grader report > View" page logged in as "teacher1"
@javascript
Scenario: Export grades as text
+7 -9
View File
@@ -19,15 +19,13 @@ Feature: I need to export grades as xml
| student1 | C1 | student |
| student2 | C1 | student |
And the following "activities" exist:
| activity | course | idnumber | name | intro |
| assign | C1 | a1 | Test assignment name | Submit something! |
And I log in as "teacher1"
And I am on "Course 1" course homepage
And I navigate to "View > Grader report" in the course gradebook
And I turn editing mode on
And I give the grade "80.00" to the user "Student 1" for the grade item "Test assignment name"
And I give the grade "42.00" to the user "Student 2" for the grade item "Test assignment name"
And I press "Save changes"
| activity | course | idnumber | name |
| assign | C1 | a1 | Test assignment name |
And the following "grade grades" exist:
| gradeitem | user | grade |
| Test assignment name | student1 | 80.00 |
| Test assignment name | student2 | 42.00 |
And I am on the "Course 1" course page logged in as teacher1
@javascript
Scenario: Export grades as XML
@@ -0,0 +1,41 @@
@gradingform @gradingform_guide
Feature: Teacher can delete marking guide
As a teacher,
I should be able to delete a marking guide
Background:
Given the following "users" exist:
| username | firstname | lastname | email |
| teacher1 | Teacher | One | teacher1@example.com |
And the following "courses" exist:
| fullname | shortname | format |
| Course 1 | C1 | topics |
And the following "course enrolments" exist:
| user | course | role |
| teacher1 | C1 | editingteacher |
And the following "activities" exist:
| activity | course | name | advancedgradingmethod_submissions |
| assign | C1 | Assign 1 | guide |
And I am on the "Course 1" course page logged in as teacher1
And I go to "Assign 1" advanced grading definition page
And I set the following fields to these values:
| Name | Marking guide 1 |
And I define the following marking guide:
| Criterion name | Description for students | Description for markers | Maximum score |
| Criterion 1 | Criterion 1 description for student | Criterion 1 description for markers | 100 |
And I press "Save marking guide and make it ready"
Scenario: Delete a marking guide
Given I am on the "Course 1" course page
And I go to "Assign 1" advanced grading page
When I click on "Delete the currently defined form" "link"
And I press "Cancel"
# Confirm that marking guide was not deleted if Cancel is pressed
Then I should see "Marking guide 1 Ready for use"
And I should see "Criterion 1"
And I click on "Delete the currently defined form" "link"
And I press "Continue"
# Confirm that marking guide was deleted successfully if Continue is pressed
And I should see "Please note: the advanced grading form is not ready at the moment. Simple grading method will be used until the form has a valid status."
And I should not see "Marking guide 1 Ready for use"
And I should not see "Criterion 1"
@@ -27,9 +27,9 @@
require_once(__DIR__ . '/../../../../../../lib/behat/behat_base.php');
use Behat\Gherkin\Node\TableNode as TableNode,
Behat\Mink\Exception\ElementNotFoundException as ElementNotFoundException,
Behat\Mink\Exception\ExpectationException as ExpectationException;
use Behat\Gherkin\Node\TableNode;
use Behat\Mink\Exception\ElementNotFoundException;
use Behat\Mink\Exception\ExpectationException;
/**
* Steps definitions to help with rubrics.
@@ -66,7 +66,6 @@ class behat_gradingform_rubric extends behat_base {
* @param TableNode $rubric
*/
public function i_define_the_following_rubric(TableNode $rubric) {
// Being a smart method is nothing good when we talk about step definitions, in
// this case we didn't have any other options as there are no labels no elements
// id we can point to without having to "calculate" them.
@@ -80,7 +79,6 @@ class behat_gradingform_rubric extends behat_base {
// Cleaning the current ones.
$deletebuttons = $this->find_all('css', "input[value='" . get_string('criteriondelete', 'gradingform_rubric') . "']");
if ($deletebuttons) {
// We should reverse the deletebuttons because otherwise once we delete
// the first one the DOM will change and the [X] one will not exist anymore.
$deletebuttons = array_reverse($deletebuttons, true);
@@ -132,7 +130,10 @@ class behat_gradingform_rubric extends behat_base {
}
// Add new criterion.
$addcriterionbutton->click();
$this->execute('behat_general::i_click_on', [
$addcriterionbutton,
'NodeElement',
]);
$criterionroot = 'rubric[criteria][NEWID' . ($criterionit + 1) . ']';
@@ -158,12 +159,14 @@ class behat_gradingform_rubric extends behat_base {
if ($this->running_javascript()) {
$deletelevel = $this->find_button($criterionroot . '[levels][NEWID' . $i . '][delete]');
$this->click_and_confirm($deletelevel);
} else {
// Only if the level exists.
$buttonname = $criterionroot . '[levels][NEWID' . $i . '][delete]';
if ($deletelevel = $this->getSession()->getPage()->findButton($buttonname)) {
$deletelevel->click();
$this->execute('behat_general::i_click_on', [
$deletelevel,
'NodeElement',
]);
}
}
}
@@ -171,7 +174,10 @@ class behat_gradingform_rubric extends behat_base {
// Adding levels if we don't have enough.
$addlevel = $this->find_button($criterionroot . '[levels][addlevel]');
for ($i = ($defaultnumberoflevels + 1); $i <= $nlevels; $i++) {
$addlevel->click();
$this->execute('behat_general::i_click_on', [
$addlevel,
'NodeElement',
]);
}
}
@@ -226,7 +232,6 @@ class behat_gradingform_rubric extends behat_base {
* @param string $criterionname
*/
public function i_replace_rubric_level_with($currentvalue, $value, $criterionname) {
$currentvalueliteral = behat_context_helper::escape($currentvalue);
$criterionliteral = behat_context_helper::escape($criterionname);
@@ -247,14 +252,15 @@ class behat_gradingform_rubric extends behat_base {
"/descendant::textarea[text()=$currentvalueliteral]";
if ($this->running_javascript()) {
$spansufix = "/ancestor::div[@class='level-wrapper']" .
"/descendant::div[@class='definition']" .
"/descendant::span[@class='textvalue']";
// Expanding the level input boxes.
$spannode = $this->find('xpath', $inputxpath . $spansufix . '|' . $textareaxpath . $spansufix);
$spannode->click();
$this->execute('behat_general::i_click_on', [
$inputxpath . $spansufix . '|' . $textareaxpath . $spansufix,
'xpath',
]);
$inputfield = $this->find('xpath', $inputxpath . '|' . $textareaxpath);
$inputfield->setValue($value);
@@ -263,7 +269,6 @@ class behat_gradingform_rubric extends behat_base {
$fieldnode = $this->find('xpath', $inputxpath . '|' . $textareaxpath);
$this->set_rubric_field_value($fieldnode->getAttribute('name'), $value);
}
}
/**
@@ -275,7 +280,6 @@ class behat_gradingform_rubric extends behat_base {
* @param TableNode $rubric
*/
public function i_grade_by_filling_the_rubric_with(TableNode $rubric) {
$criteria = $rubric->getRowsHash();
$stepusage = '"I grade by filling the rubric with:" step needs you to provide a table where each row is a criterion' .
@@ -288,7 +292,6 @@ class behat_gradingform_rubric extends behat_base {
// First element -> name, second -> points, third -> Remark.
foreach ($criteria as $name => $criterion) {
// We only expect the points and the remark, as the criterion name is $name.
if (count($criterion) !== 2) {
throw new ExpectationException($stepusage, $this->getSession());
@@ -349,7 +352,6 @@ class behat_gradingform_rubric extends behat_base {
* @return void
*/
public function the_level_with_points_was_previously_selected_for_the_rubric_criterion($points, $criterionname) {
$levelxpath = $this->get_criterion_xpath($criterionname) .
$this->get_level_xpath($points) .
"[contains(concat(' ', normalize-space(@class), ' '), ' currentchecked ')]";
@@ -378,7 +380,6 @@ class behat_gradingform_rubric extends behat_base {
* @return void
*/
public function the_level_with_points_is_selected_for_the_rubric_criterion($points, $criterionname) {
$levelxpath = $this->get_criterion_xpath($criterionname) .
$this->get_level_xpath($points);
@@ -409,7 +410,6 @@ class behat_gradingform_rubric extends behat_base {
* @return void
*/
public function the_level_with_points_is_not_selected_for_the_rubric_criterion($points, $criterionname) {
$levelxpath = $this->get_criterion_xpath($criterionname) .
$this->get_level_xpath($points);
@@ -437,12 +437,13 @@ class behat_gradingform_rubric extends behat_base {
* @return void
*/
protected function set_rubric_field_value($name, $value, $visible = false) {
// Fields are hidden by default.
if ($this->running_javascript() == true && $visible === false) {
$xpath = "//*[@name='$name']/following-sibling::*[contains(concat(' ', normalize-space(@class), ' '), ' plainvalue ')]";
$textnode = $this->find('xpath', $xpath);
$textnode->click();
$this->execute('behat_general::i_click_on', [
$xpath,
'xpath',
]);
}
// Set the value now.
@@ -457,19 +458,20 @@ class behat_gradingform_rubric extends behat_base {
* @return void
*/
protected function click_and_confirm($node) {
// Clicks to perform the action.
$node->click();
$this->execute('behat_general::i_click_on', [
$node,
'NodeElement',
]);
// Confirms the delete.
if ($this->running_javascript()) {
$confirmbutton = $this->get_node_in_container(
'button',
$this->execute('behat_general::i_click_on_in_the', [
get_string('yes'),
'button',
get_string('confirmation', 'admin'),
'dialogue',
get_string('confirmation', 'admin')
);
$confirmbutton->click();
]);
}
}
+4 -2
View File
@@ -67,8 +67,10 @@ class gradeimport_csv_renderer extends plugin_renderer_base {
$html = $this->output->heading(get_string('importpreview', 'grades'));
$table = new html_table();
$table->head = $header;
$table->data = $data;
$table->head = array_map('s', $header);
$table->data = array_map(static function($row) {
return array_map('s', $row);
}, $data);
$html .= html_writer::table($table);
return $html;
@@ -75,8 +75,7 @@ Feature: We can change what we are viewing on the grader report
And the following "role capability" exists:
| role | editingteacher |
| moodle/grade:viewhidden | prevent |
And I am on the "C1" "course" page logged in as "teacher1"
And I navigate to "View > Grader report" in the course gradebook
And I am on the "Course 1" "grades > Grader report > View" page logged in as "teacher1"
Then I should see "Test assignment name 1" in the "user-grades" "table"
And I should see "Test assignment name 2" in the "user-grades" "table"
And I should see "Manual grade"
@@ -22,22 +22,17 @@ Feature: A teacher checks the grade history report in a course
| student1 | C1 | student |
| student2 | C1 | student |
And the following "activities" exist:
| activity | course | section | name | intro |
| assign | C1 | 1 | The greatest assignment ever | Write a behat test for Moodle - it's amazing |
| assign | C1 | 1 | Rewarding assignment | After writing your behat test go grab a beer! |
And I log in as "teacher1"
And I am on "Course 1" course homepage with editing mode on
And I navigate to "View > Grader report" in the course gradebook
| activity | course | name |
| assign | C1 | The greatest assignment ever |
| assign | C1 | Rewarding assignment |
And I am on the "Course 1" "grades > Grader report > View" page logged in as "teacher1"
And I turn editing mode on
And I give the grade "50.00" to the user "Student 1" for the grade item "The greatest assignment ever"
And I give the grade "60.00" to the user "Student 1" for the grade item "Rewarding assignment"
And I give the grade "50.00" to the user "Student 2" for the grade item "The greatest assignment ever"
And I give the grade "60.00" to the user "Student 2" for the grade item "Rewarding assignment"
And I press "Save changes"
And I log out
And I log in as "teacher2"
And I am on "Course 1" course homepage
And I navigate to "View > Grader report" in the course gradebook
And I am on the "Course 1" "grades > Grader report > View" page logged in as "teacher2"
And I turn editing mode on
And I give the grade "70.00" to the user "Student 1" for the grade item "The greatest assignment ever"
And I give the grade "80.00" to the user "Student 1" for the grade item "Rewarding assignment"
@@ -1,4 +1,4 @@
@core @core_grades @gradereport_singleview
@core @core_grades @gradereport_singleview @javascript
Feature: We can use Single view
As a teacher
In order to view and edit grades
@@ -7,7 +7,7 @@ Feature: We can use Single view
Background:
Given the following "courses" exist:
| fullname | shortname | category |
| Course 1 | C1 | 0 |
| Course 1 | C1 | 0 |
And the following "users" exist:
| username | firstname | lastname | email | idnumber | middlename | alternatename | firstnamephonetic | lastnamephonetic |
| teacher1 | Teacher | 1 | teacher1@example.com | t1 | | fred | | |
@@ -53,11 +53,8 @@ Feature: We can use Single view
And the following config values are set as admin:
| fullnamedisplay | firstnamephonetic,lastnamephonetic |
| alternativefullnameformat | middlename, alternatename, firstname, lastname |
And I log in as "teacher1"
And I am on "Course 1" course homepage
Given I navigate to "View > Grader report" in the course gradebook
And I am on the "Course 1" "grades > Grader report > View" page logged in as "teacher1"
@javascript
Scenario: I can update grades, add feedback and exclude grades.
Given I navigate to "View > Single view" in the course gradebook
And I select "Student" from the "Select user..." singleselect
@@ -97,10 +94,7 @@ Feature: We can use Single view
And the following should exist in the "generaltable" table:
| First name (Alternate name) Surname | Grade |
| Ann, Jill, Grainne, Beauchamp | Very good |
And I log out
And I log in as "teacher2"
And I am on "Course 1" course homepage
Given I navigate to "View > Single view" in the course gradebook
And I am on the "Course 1" "grades > Single view > View" page logged in as "teacher2"
And I select "Student" from the "Select user..." singleselect
And the "Exclude for Test assignment one" "checkbox" should be disabled
And the "Override for Test assignment one" "checkbox" should be enabled
@@ -30,9 +30,7 @@ Feature: View the user report as the student will see it
| activity | course | idnumber | name | intro | grade |
| assign | C1 | a5 | Test assignment five | Submit something! | 100 |
| assign | C1 | a6 | Test assignment six | Submit something! | 100 |
And I log in as "teacher1"
And I am on "Course 1" course homepage
And I navigate to "Setup > Gradebook setup" in the course gradebook
When I am on the "C1" "grades > gradebook setup" page logged in as "teacher1"
And I hide the grade item "Test assignment six"
And I hide the grade item "Sub category 2"
And I navigate to "View > Grader report" in the course gradebook
@@ -5,12 +5,10 @@ Feature: We can use the user report
Background:
Given the following "courses" exist:
| fullname | shortname | category |
| Course 1 | C1 | 0 |
| fullname | shortname | category | groupmode |
| Course 1 | C1 | 0 | 1 |
Scenario: Verify we can view a user grade report with no users enrolled.
Given I log in as "admin"
And I am on "Course 1" course homepage
And I navigate to "View > User report" in the course gradebook
When I am on the "Course 1" "grades > User report > View" page logged in as "admin"
And I select "All users (0)" from the "Select all or one user" singleselect
Then I should see "There are no students enrolled in this course."
+12
View File
@@ -35,6 +35,8 @@ class behat_grades extends behat_base {
* | [report] view | Course name | The view page for the specified course and report |
* | gradebook setup | Course name | The gradebook setup page for the specified course |
* | course grade settings | Course name | The grade settings page |
* | outcomes | Course name | The grade outcomes page |
* | scales | Course name | The grade scales page |
*
* @param string $type identifies which type of page this is - for example "Grader > View"
* @param string $identifier identifies the particular page - for example "Course name"
@@ -86,6 +88,16 @@ class behat_grades extends behat_base {
"/grade/edit/settings/index.php",
['id' => $this->get_course_id($identifier)]
);
case 'outcomes':
return new moodle_url(
"/grade/edit/outcome/course.php",
['id' => $this->get_course_id($identifier)]
);
case 'scales':
return new moodle_url(
"/grade/edit/scale/index.php",
['id' => $this->get_course_id($identifier)]
);
default:
throw new \coding_exception(
"Unknown page type '$type' for page identifier '$identifier'"
+6 -10
View File
@@ -17,9 +17,7 @@ Feature: Site settings can be used to hide parts of the gradebook UI
And the following "activities" exist:
| activity | course | idnumber | name | intro |
| assign | C1 | assign1 | Assignment1 | Assignment 1 intro |
And I log in as "admin"
And I am on "Course 1" course homepage
And I navigate to "View > Grader report" in the course gradebook
And I am on the "Course 1" "grades > Grader report > View" page logged in as "admin"
And I turn editing mode on
@javascript
@@ -29,8 +27,7 @@ Feature: Site settings can be used to hide parts of the gradebook UI
Then I navigate to "Grades > General settings" in site administration
And I set the field "Show minimum grade" to "0"
And I press "Save changes"
And I am on "Course 1" course homepage
And I navigate to "View > Grader report" in the course gradebook
And I am on the "Course 1" "grades > Grader report > View" page
And I click on "Edit assign Assignment1" "link"
And I should not see "Minimum grade"
@@ -46,10 +43,9 @@ Feature: Site settings can be used to hide parts of the gradebook UI
@javascript
Scenario: Disable category overriding
And "tr .course input[type='text']" "css_element" should exist
Then I navigate to "Grades > Grade category settings" in site administration
Given "Student 1 Course total" "field" should exist
And I navigate to "Grades > Grade category settings" in site administration
And I set the field "Allow category grades to be manually overridden" to "0"
And I press "Save changes"
And I am on "Course 1" course homepage
And I navigate to "View > Grader report" in the course gradebook
And "tr .course input[type='text']" "css_element" should not exist
When I am on the "Course 1" "grades > Grader report > View" page
Then "Student 1 Course total" "field" should not exist
+21 -32
View File
@@ -1,4 +1,4 @@
@core @core_grades
@core @core_grades @javascript
Feature: We can use calculated grade totals
In order to calculate grade totals
As an teacher
@@ -39,20 +39,18 @@ Feature: We can use calculated grade totals
And I log in as "admin"
And I set the following administration settings values:
| grade_aggregations_visible | Mean of grades,Weighted mean of grades,Simple weighted mean of grades,Mean of grades (with extra credits),Median of grades,Lowest grade,Highest grade,Mode of grades,Natural |
And I log out
And I log in as "teacher1"
And I am on "Course 1" course homepage
And I navigate to "View > Grader report" in the course gradebook
And the following "grade grades" exist:
| gradeitem | user | grade |
| Test assignment one & | student1 | 60.00 |
| Test assignment two | student1 | 20.00 |
| Test assignment three | student1 | 40.00 |
| Test assignment five | student1 | 10.00 |
| Test assignment six | student1 | 5.00 |
| Test assignment eight | student1 | 10.00 |
| Test assignment nine | student1 | 5.00 |
And I am on the "Course 1" "grades > Grader report > View" page logged in as "teacher1"
And I turn editing mode on
And I change window size to "large"
And I give the grade "60.00" to the user "Student 1" for the grade item "Test assignment one &"
And I give the grade "20.00" to the user "Student 1" for the grade item "Test assignment two"
And I give the grade "40.00" to the user "Student 1" for the grade item "Test assignment three"
And I give the grade "10.00" to the user "Student 1" for the grade item "Test assignment five"
And I give the grade "5.00" to the user "Student 1" for the grade item "Test assignment six"
And I give the grade "10.00" to the user "Student 1" for the grade item "Test assignment eight"
And I give the grade "5.00" to the user "Student 1" for the grade item "Test assignment nine"
And I press "Save changes"
And I set the following settings for grade item "Test assignment two":
| Hidden | 1 |
And I set the following settings for grade item "Test assignment five":
@@ -241,6 +239,7 @@ Feature: We can use calculated grade totals
| Aggregation | Natural |
| Include outcomes in aggregation | 1 |
| Exclude empty grades | 0 |
And I change window size to "large"
And I navigate to "View > Grader report" in the course gradebook
And I give the grade "Excellent" to the user "Student 1" for the grade item "Test outcome item one"
And I press "Save changes"
@@ -254,22 +253,16 @@ Feature: We can use calculated grade totals
Then I should see "114.82 (18.27 %)" in the "overview-grade" "table"
And I click on "Course 1" "link" in the "region-main" "region"
And "Test outcome item one" row "Grade" column of "user-grade" table should contain "Excellent (100.00 %)"
And I log out
And I log in as "teacher1"
And I am on "Course 1" course homepage
And I navigate to "Setup > Gradebook setup" in the course gradebook
And I am on the "Course 1" "grades > gradebook setup" page logged in as "teacher1"
And I set the following settings for grade item "Test outcome item one":
| Extra credit | 1 |
| Extra credit | 1 |
And I log out
And I log in as "student1"
And I follow "Grades" in the user menu
Then I should see "114.00 (18.39 %)" in the "overview-grade" "table"
And I click on "Course 1" "link" in the "region-main" "region"
And "Test outcome item one" row "Grade" column of "user-grade" table should contain "Excellent (100.00 %)"
And I log out
And I log in as "teacher1"
And I am on "Course 1" course homepage
And I navigate to "Setup > Gradebook setup" in the course gradebook
And I am on the "Course 1" "grades > gradebook setup" page logged in as "teacher1"
And I set the following settings for grade item "Course 1":
| Aggregation | Natural |
| Include outcomes in aggregation | 0 |
@@ -300,6 +293,7 @@ Feature: We can use calculated grade totals
And I set the following settings for grade item "Test outcome item one":
| Weight adjusted | 1 |
| aggregationcoef2 | 100 |
And I change window size to "large"
And I navigate to "View > Grader report" in the course gradebook
And I give the grade "Excellent" to the user "Student 1" for the grade item "Test outcome item one"
And I press "Save changes"
@@ -368,10 +362,7 @@ Feature: We can use calculated grade totals
| Test assignment four | 30.93 % | - | 0150 | 0.00 % |
Scenario: Natural aggregation with drop lowest
When I log out
And I log in as "admin"
And I am on "Course 1" course homepage
And I navigate to "View > Grader report" in the course gradebook
When I am on the "Course 1" "grades > Grader report > View" page logged in as "admin"
And I turn editing mode on
And I set the following settings for grade item "Sub category 1":
| Aggregation | Natural |
@@ -418,9 +409,9 @@ Feature: We can use calculated grade totals
And I should see "270.00 (27.27 %)" in the ".course" "css_element"
And I turn editing mode on
And I set the following settings for grade item "Manual item 2":
| Extra credit | 0 |
| Maximum grade | 200 |
| Rescale existing grades | No |
| Maximum grade | 200 |
| Extra credit | 0 |
# Change window size to ultra-wide to avoid 'out-of-bounds' random failures.
And I change window size to "5120x2160"
And I give the grade "21.00" to the user "Student 1" for the grade item "Manual item 2"
@@ -431,9 +422,9 @@ Feature: We can use calculated grade totals
And I should see "270.00 (22.69 %)" in the ".course" "css_element"
And I turn editing mode on
And I set the following settings for grade item "Manual item 2":
| Extra credit | 0 |
| Maximum grade | 100 |
| Rescale existing grades | No |
| Maximum grade | 100 |
| Extra credit | 0 |
# Change window size to ultra-wide to avoid 'out-of-bounds' random failures.
And I change window size to "5120x2160"
And I give the grade "21.00" to the user "Student 1" for the grade item "Manual item 2"
@@ -451,7 +442,6 @@ Feature: We can use calculated grade totals
And I navigate to "View > Grader report" in the course gradebook
And I should see "270.00 (24.77 %)" in the ".course" "css_element"
@javascript
Scenario: Natural aggregation from the setup screen
And I navigate to "Setup > Gradebook setup" in the course gradebook
@@ -504,7 +494,6 @@ Feature: We can use calculated grade totals
And I reset weights for grade category "Sub category 2 &"
And the field "Weight of Test assignment ten" matches value "33.333"
@javascript
Scenario: Natural aggregation with weights of zero
When I set the following settings for grade item "Course 1":
| Aggregation | Natural |
@@ -33,8 +33,7 @@ Feature: Changing the aggregation of an item affects its weight and extra credit
And I log in as "admin"
And I set the following administration settings values:
| grade_aggregations_visible | Mean of grades,Weighted mean of grades,Simple weighted mean of grades,Mean of grades (with extra credits),Median of grades,Lowest grade,Highest grade,Mode of grades,Natural |
And I am on "Course 1" course homepage
And I navigate to "View > Grader report" in the course gradebook
And I am on the "Course 1" "grades > Grader report > View" page
And I turn editing mode on
And I follow "Edit Cat mean"
And I set the following fields to these values:
@@ -18,9 +18,7 @@ Feature: Calculated grade items can be used in the gradebook
| teacher1 | C1 | editingteacher |
| student1 | C1 | student |
| student2 | C1 | student |
And I log in as "admin"
And I am on "Course 1" course homepage
And I navigate to "Setup > Gradebook setup" in the course gradebook
And I am on the "Course 1" "grades > gradebook setup" page logged in as "admin"
@javascript
Scenario: The max grade for a category item, with a calculation using Natural aggregation, can be changed
@@ -19,9 +19,7 @@ Feature: Gradebook calculations for calculated grade items before the fix 201506
| teacher1 | C1 | editingteacher |
| student1 | C1 | student |
| student2 | C1 | student |
And I log in as "admin"
And I am on "Course 1" course homepage
And I navigate to "Setup > Gradebook setup" in the course gradebook
And I am on the "Course 1" "grades > gradebook setup" page logged in as "admin"
@javascript
Scenario: The max grade for a category item, with a calculation using Natural aggregation, can be changed
@@ -24,23 +24,20 @@ Feature: We can understand the gradebook user report
| assign | C1 | a4 | <span lang="en" class="multilang">EN</span><span lang="fr" class="multilang">FR</span> Test assignment four | Submit something! |
| assign | C1 | a5 | <span lang="en" class="multilang">EN</span><span lang="fr" class="multilang">FR</span> Test assignment five | Submit something! |
| assign | C1 | a6 | <span lang="en" class="multilang">EN</span><span lang="fr" class="multilang">FR</span> Test assignment six | Submit something! |
And the following "grade grades" exist:
| gradeitem | user | grade |
| <span lang="en" class="multilang">EN</span><span lang="fr" class="multilang">FR</span> Test assignment one | student1 | 60.00 |
| <span lang="en" class="multilang">EN</span><span lang="fr" class="multilang">FR</span> Test assignment two | student1 | 20.00 |
| <span lang="en" class="multilang">EN</span><span lang="fr" class="multilang">FR</span> Test assignment three | student1 | 40.00 |
| <span lang="en" class="multilang">EN</span><span lang="fr" class="multilang">FR</span> Test assignment four | student1 | 10.00 |
| <span lang="en" class="multilang">EN</span><span lang="fr" class="multilang">FR</span> Test assignment five | student1 | 70.00 |
| <span lang="en" class="multilang">EN</span><span lang="fr" class="multilang">FR</span> Test assignment six | student1 | 30.00 |
And the "multilang" filter is "on"
And the "multilang" filter applies to "content and headings"
And I log in as "admin"
And I set the following administration settings values:
| grade_aggregations_visible | Mean of grades,Weighted mean of grades,Simple weighted mean of grades,Mean of grades (with extra credits),Median of grades,Lowest grade,Highest grade,Mode of grades,Natural |
And I log out
And I log in as "teacher1"
And I am on "Course 1" course homepage
And I navigate to "View > Grader report" in the course gradebook
And I turn editing mode on
And I give the grade "60.00" to the user "Student 1" for the grade item "EN Test assignment one"
And I give the grade "20.00" to the user "Student 1" for the grade item "EN Test assignment two"
And I give the grade "40.00" to the user "Student 1" for the grade item "EN Test assignment three"
And I give the grade "10.00" to the user "Student 1" for the grade item "EN Test assignment four"
And I give the grade "70.00" to the user "Student 1" for the grade item "EN Test assignment five"
And I give the grade "30.00" to the user "Student 1" for the grade item "EN Test assignment six"
And I press "Save changes"
And I am on the "Course 1" "grades > course grade settings" page logged in as "teacher1"
And I navigate to "Setup > Course grade settings" in the course gradebook
And I set the field "Show weightings" to "Show"
And I set the field "Show contribution to course total" to "Show"
@@ -32,10 +32,7 @@ Feature: Editing a grade item
And I press "Save changes"
And I set the following administration settings values:
| grade_aggregations_visible | Mean of grades,Weighted mean of grades,Simple weighted mean of grades,Mean of grades (with extra credits),Median of grades,Lowest grade,Highest grade,Mode of grades,Natural |
And I log out
And I log in as "teacher1"
And I am on "Course 1" course homepage
And I navigate to "Setup > Gradebook setup" in the course gradebook
And I am on the "Course 1" "grades > gradebook setup" page logged in as teacher1
And I press "Add category"
And I set the following fields to these values:
| Category name | <span lang="en" class="multilang">EN</span><span lang="fr" class="multilang">FR</span> Cat 1 |
@@ -19,8 +19,7 @@ Feature: Extra credit contributions are normalised when going out of bounds
And I log in as "admin"
And I set the following administration settings values:
| grade_aggregations_visible | Simple weighted mean of grades,Mean of grades (with extra credits),Natural |
And I am on "Course 1" course homepage
And I navigate to "Setup > Gradebook setup" in the course gradebook
And I am on the "Course 1" "grades > gradebook setup" page
And I press "Add grade item"
And I set the following fields to these values:
| Item name | Manual item 1 |
@@ -42,10 +41,7 @@ Feature: Extra credit contributions are normalised when going out of bounds
And I set the field "Show weighting" to "Show"
And I set the field "Show contribution to course total" to "Show"
And I press "Save changes"
And I log out
And I log in as "teacher1"
And I am on "Course 1" course homepage
And I navigate to "View > Grader report" in the course gradebook
And I am on the "Course 1" "grades > Grader report > View" page logged in as "teacher1"
And I turn editing mode on
And I give the grade "80.00" to the user "Student 1" for the grade item "Manual item 1"
And I give the grade "10.00" to the user "Student 1" for the grade item "Manual item 2"
@@ -19,9 +19,7 @@ Feature: We can change the maximum and minimum number of points for manual items
| teacher1 | C1 | editingteacher |
| student1 | C1 | student |
| student2 | C1 | student |
And I log in as "teacher1"
And I am on "Course 1" course homepage
And I navigate to "Setup > Gradebook setup" in the course gradebook
And I am on the "Course 1" "grades > gradebook setup" page logged in as "teacher1"
And I press "Add grade item"
And I set the following fields to these values:
| Item name | Manual item 1 |
@@ -34,8 +32,7 @@ Feature: We can change the maximum and minimum number of points for manual items
And I press "Save changes"
Scenario: Change maximum number of points on a graded item.
And I am on "Course 1" course homepage
And I navigate to "View > Grader report" in the course gradebook
Given I am on the "Course 1" "grades > Grader report > View" page
And I turn editing mode on
And I give the grade "10.00" to the user "Student 1" for the grade item "Manual item 1"
And I give the grade "8.00" to the user "Student 2" for the grade item "Manual item 1"
+4 -12
View File
@@ -29,8 +29,7 @@ Feature: Student and teacher's view of aggregated grade items is consistent when
And I log in as "admin"
And the "multilang" filter is "on"
And the "multilang" filter applies to "content and headings"
And I am on "Course 1" course homepage
And I navigate to "Setup > Gradebook setup" in the course gradebook
And I am on the "Course 1" "grades > gradebook setup" page
And I press "Add grade item"
And I set the following fields to these values:
| Item name | calculated |
@@ -42,10 +41,7 @@ Feature: Student and teacher's view of aggregated grade items is consistent when
And I navigate to "Grades > Report settings > User report" in site administration
And I set the field "s__grade_report_user_showtotalsifcontainhidden" to "Show totals excluding hidden items"
And I press "Save changes"
When I log out
And I log in as "teacher1"
And I am on "Course 1" course homepage
And I navigate to "View > Grader report" in the course gradebook
When I am on the "Course 1" "grades > Grader report > View" page logged in as teacher1
And I turn editing mode on
And I give the grade "50.00" to the user "Student 1" for the grade item "Test assignment one"
And I give the grade "50.00" to the user "Student 1" for the grade item "Test assignment three"
@@ -53,8 +49,7 @@ Feature: Student and teacher's view of aggregated grade items is consistent when
And I set the following settings for grade item "Test assignment four":
| Hidden | 1 |
And I press "Save changes"
And I am on "Course 1" course homepage
And I navigate to "View > User report" in the course gradebook
And I am on the "Course 1" "grades > User report > View" page
And I select "Myself" from the "View report as" singleselect
And I select "Student 1" from the "Select all or one user" singleselect
Then the following should exist in the "user-grade" table:
@@ -63,10 +58,7 @@ Feature: Student and teacher's view of aggregated grade items is consistent when
| Test assignment two | 0.00 %( Empty ) | - | 0100 | - | 0.00 % |
| Test assignment three | 100.00 % | 50.00 | 0100 | 50.00 % | 25.00 % |
| Course total | - | 100.00 | 0200 | 50.00 % | - |
When I log out
And I log in as "student1"
And I am on "Course 1" course homepage
And I navigate to "User report" in the course gradebook
When I am on the "Course 1" "grades > User report > View" page logged in as student1
Then the following should exist in the "user-grade" table:
| Grade item | Calculated weight | Grade | Range | Percentage | Contribution to course total |
| Test assignment one | 100.00 % | 50.00 | 0100 | 50.00 % | 25.00 % |
@@ -17,9 +17,7 @@ Feature: Hidden grade items should be hidden when grade category is locked, but
| user | course | role |
| teacher1 | C1 | editingteacher |
| student1 | C1 | student |
And I log in as "admin"
And I am on "Course 1" course homepage
And I navigate to "Setup > Gradebook setup" in the course gradebook
And I am on the "Course 1" "grades > gradebook setup" page logged in as "admin"
And I press "Add category"
And I set the following fields to these values:
| Category name | Test locked category |
@@ -30,23 +28,16 @@ Feature: Hidden grade items should be hidden when grade category is locked, but
| Hidden | 1 |
| Grade category | Test locked category |
And I press "Save changes"
And I log out
And I log in as "teacher1"
And I am on "Course 1" course homepage
And I navigate to "View > Grader report" in the course gradebook
And I am on the "Course 1" "grades > Grader report > View" page logged in as "teacher1"
And I turn editing mode on
And I give the grade "50.00" to the user "Student 1" for the grade item "Hidden item"
And I press "Save changes"
And I navigate to "Setup > Gradebook setup" in the course gradebook
And I set the following settings for grade item "Test locked category":
| Locked | 1 |
And I press "Save changes"
And I log out
Scenario: Hidden grade items in locked category is hidden for teacher
Given I log in as "teacher1"
And I am on "Course 1" course homepage
And I navigate to "View > User report" in the course gradebook
Given I am on the "Course 1" "grades > User report > View" page logged in as teacher1
And I select "Myself" from the "View report as" singleselect
When I select "Student 1" from the "Select all or one user" singleselect
Then the following should exist in the "user-grade" table:
@@ -55,9 +46,7 @@ Feature: Hidden grade items should be hidden when grade category is locked, but
| Course total | - | 50.00 | 0100 | 50.00 % | - |
Scenario: Hidden grade items in locked category is hidden for student
Given I log in as "student1"
And I am on "Course 1" course homepage
When I navigate to "User report" in the course gradebook
When I am on the "Course 1" "grades > User report > View" page logged in as student1
Then the following should exist in the "user-grade" table:
| Grade item | Calculated weight | Grade | Range | Percentage | Contribution to course total |
| Test locked category total | 100.00 % | - | 0100 | - | - |
@@ -65,9 +54,7 @@ Feature: Hidden grade items should be hidden when grade category is locked, but
And I should not see "Hidden item"
Scenario: Hidden grade items in overridden category should show
Given I log in as "teacher1"
And I am on "Course 1" course homepage
And I navigate to "Setup > Gradebook setup" in the course gradebook
Given I am on the "Course 1" "grades > gradebook setup" page logged in as teacher1
And I press "Add category"
And I set the following fields to these values:
| Category name | Test overridden category B|
@@ -81,10 +68,7 @@ Feature: Hidden grade items should be hidden when grade category is locked, but
And I turn editing mode on
And I give the grade "50.00" to the user "Student 1" for the grade item "Test overridden category B total"
And I press "Save changes"
And I log out
And I log in as "student1"
And I am on "Course 1" course homepage
And I navigate to "User report" in the course gradebook
And I am on the "Course 1" "grades > User report > View" page logged in as "student1"
Then the following should exist in the "user-grade" table:
| Grade item | Calculated weight | Grade | Range | Percentage | Contribution to course total |
| Test locked category total | 50.00 % | - | 0100 | - | - |
@@ -25,9 +25,7 @@ Feature: We can duplicate grade items that already exist.
| Item1 | C1 | Category1 | 001 | Value | 80.00 | 5.00 | 40.00 | 1 | 1 | 0 | 1 |
Scenario: Ensure the duplicated grade item settings match the original grade item
Given I log in as "teacher1"
And I am on "Course 1" course homepage
And I navigate to "Setup > Gradebook setup" in the course gradebook
Given I am on the "Course 1" "grades > gradebook setup" page logged in as "teacher1"
And I should not see "Duplicate Category1"
And I should not see "Duplicate Assignment1"
When I duplicate the grade item "Item1"
@@ -26,28 +26,19 @@ Feature: Teacher can unhide grades on the edit page allowing students to view th
| Grade out of 100 | 50 |
| Feedback comments | I'm the teacher feedback |
And I press "Save changes"
And I am on "Course 1" course homepage
And I log out
And I am on the "Test assignment name" "assign activity" page logged in as student1
And I should see "50.00"
And I should see "I'm the teacher feedback" in the "Feedback comments" "table_row"
And I log out
And I log in as "teacher1"
And I am on "Course 1" course homepage
And I navigate to "Setup > Gradebook setup" in the course gradebook
And I am on the "Course 1" "grades > gradebook setup" page logged in as "teacher1"
@javascript
Scenario: Hiding the activity using the drop-down hide link and then unhiding the activity using the edit settings form page
Given I click on "Edit" "link" in the "Test assignment name" "table_row"
And I click on "Hide" "link" in the "Test assignment name" "table_row"
And I log out
And I am on the "Test assignment name" "assign activity" page logged in as student1
And I should not see "50.00"
And I should not see "I'm the teacher feedback"
And I log out
And I log in as "teacher1"
And I am on "Course 1" course homepage
And I navigate to "Setup > Gradebook setup" in the course gradebook
And I am on the "Course 1" "grades > gradebook setup" page logged in as "teacher1"
And I click on "Edit" "link" in the "Test assignment name" "table_row"
And I click on "Edit settings" "link" in the "Test assignment name" "table_row"
And the field "Hidden" matches value "1"
@@ -68,13 +59,9 @@ Feature: Teacher can unhide grades on the edit page allowing students to view th
And I am on the "Test assignment name" "assign activity" page logged in as student1
And I should not see "50.00"
And I should not see "I'm the teacher feedback"
And I log out
And I log in as "teacher1"
And I am on "Course 1" course homepage
And I navigate to "Setup > Gradebook setup" in the course gradebook
And I am on the "Course 1" "grades > gradebook setup" page logged in as "teacher1"
And I click on "Edit" "link" in the "Test assignment name" "table_row"
And I click on "Show" "link" in the "Test assignment name" "table_row"
And I log out
And I am on the "Test assignment name" "assign activity" page logged in as student1
Then I should see "50.00"
And I should see "I'm the teacher feedback" in the "Feedback comments" "table_row"
@@ -83,20 +70,15 @@ Feature: Teacher can unhide grades on the edit page allowing students to view th
Scenario: Hiding the category using the drop-down hide link and then unhiding the category using the edit settings form page
Given I click on "Edit" "link" in the "Course 1" "table_row"
And I click on "Hide" "link" in the "Course 1" "table_row"
And I log out
And I am on the "Test assignment name" "assign activity" page logged in as student1
And I should not see "50.00"
And I should not see "I'm the teacher feedback"
And I log out
And I log in as "teacher1"
And I am on "Course 1" course homepage
And I navigate to "Setup > Gradebook setup" in the course gradebook
And I am on the "Course 1" "grades > gradebook setup" page logged in as "teacher1"
And I click on "Edit" "link" in the "Course 1" "table_row"
And I click on "Edit settings" "link" in the "Course 1" "table_row"
And the field "Hidden" matches value "1"
And I set the field "Hidden" to "0"
And I press "Save changes"
And I log out
And I am on the "Test assignment name" "assign activity" page logged in as student1
Then I should see "50.00"
And I should see "I'm the teacher feedback" in the "Feedback comments" "table_row"
@@ -107,17 +89,12 @@ Feature: Teacher can unhide grades on the edit page allowing students to view th
And I click on "Edit settings" "link" in the "Course 1" "table_row"
And I set the field "Hidden" to "1"
And I press "Save changes"
And I log out
And I am on the "Test assignment name" "assign activity" page logged in as student1
And I should not see "50.00"
And I should not see "I'm the teacher feedback"
And I log out
And I log in as "teacher1"
And I am on "Course 1" course homepage
And I navigate to "Setup > Gradebook setup" in the course gradebook
And I am on the "Course 1" "grades > gradebook setup" page logged in as "teacher1"
And I click on "Edit" "link" in the "Course 1" "table_row"
And I click on "Show" "link" in the "Course 1" "table_row"
And I log out
And I am on the "Test assignment name" "assign activity" page logged in as student1
Then I should see "50.00"
And I should see "I'm the teacher feedback" in the "Feedback comments" "table_row"
@@ -30,8 +30,7 @@ Feature: Grade item validation
| Name | <span lang="en" class="multilang">EN</span><span lang="fr" class="multilang">FR</span> Letter scale |
| Scale | Disappointing, Good, Very good, Excellent |
And I press "Save changes"
And I am on "Course 1" course homepage
And I navigate to "Setup > Gradebook setup" in the course gradebook
And I am on the "Course 1" "grades > gradebook setup" page
And I press "Add grade item"
And I set the following fields to these values:
| Item name | <span lang="en" class="multilang">EN</span><span lang="fr" class="multilang">FR</span> MI 1 |
@@ -20,9 +20,7 @@ Feature: We can customise the letter boundary of a course.
And the following "activities" exist:
| activity | course | idnumber | name | intro | grade |
| assign | C1 | a1 | Test assignment one | Submit something! | 100 |
And I log in as "teacher1"
And I am on "Course 1" course homepage
And I navigate to "Setup > Course grade settings" in the course gradebook
And I am on the "Course 1" "grades > course grade settings" page logged in as "teacher1"
And I set the following fields to these values:
| Grade display type | Letter |
And I press "Save changes"
@@ -21,9 +21,7 @@ Feature: We can customise the letter boundary of a course in gradebook version 2
And the following "activities" exist:
| activity | course | idnumber | name | intro | grade |
| assign | C1 | a1 | Test assignment one | Submit something! | 100 |
And I log in as "teacher1"
And I am on "Course 1" course homepage
And I navigate to "Setup > Course grade settings" in the course gradebook
And I am on the "Course 1" "grades > course grade settings" page logged in as "teacher1"
And I set the following fields to these values:
| Grade display type | Letter |
And I press "Save changes"
@@ -8,9 +8,7 @@ Feature: We can view the logs for any changes to grade letters.
Given the following "courses" exist:
| fullname | shortname | category |
| Course 1 | C1 | 0 |
And I log in as "admin"
And I am on "Course 1" course homepage
And I navigate to "Setup > Course grade settings" in the course gradebook
And I am on the "Course 1" "grades > course grade settings" page logged in as "admin"
And I set the following fields to these values:
| Grade display type | Letter |
And I press "Save changes"
+18 -55
View File
@@ -19,51 +19,23 @@ Feature: We can use a minimum grade different than zero
| student1 | C1 | student |
| student2 | C1 | student |
And the following "grade categories" exist:
| fullname | course |
| Sub category 1 | C1 |
| Sub category 2 | C1 |
| fullname | course | aggregateonlygraded |
| Sub category 1 | C1 | 0 |
| Sub category 2 | C1 | 0 |
And the following "grade items" exist:
| itemname | grademin | course |
| Manual item 1 | -100 | C1 |
| Manual item 2 | 50 | C1 |
And the following "grade items" exist:
| itemname | grademin | grademax | course | gradecategory |
| Manual item 3 | -100 | 50 | C1 | Sub category 1 |
And the following "grade items" exist:
| itemname | grademin | course | gradecategory |
| Manual item 4 | -100 | C1 | Sub category 1 |
| Manual item 5 | 50 | C1 | Sub category 2 |
| Manual item 6 | 50 | C1 | Sub category 2 |
And I log in as "admin"
And I set the following administration settings values:
| grade_aggregations_visible | Mean of grades,Weighted mean of grades,Simple weighted mean of grades,Mean of grades (with extra credits),Median of grades,Lowest grade,Highest grade,Mode of grades,Natural |
And I am on "Course 1" course homepage
And I navigate to "Setup > Gradebook setup" in the course gradebook
And I press "Add grade item"
And I set the following fields to these values:
| Item name | Manual item 1 |
| Minimum grade | -100 |
| Grade category | Course 1 |
And I press "Save changes"
And I press "Add grade item"
And I set the following fields to these values:
| Item name | Manual item 2 |
| Minimum grade | 50 |
| Grade category | Course 1 |
And I press "Save changes"
And I press "Add grade item"
And I set the following fields to these values:
| Item name | Manual item 3 |
| Maximum grade | 50 |
| Minimum grade | -100 |
| Grade category | Sub category 1 |
And I press "Save changes"
And I press "Add grade item"
And I set the following fields to these values:
| Item name | Manual item 4 |
| Minimum grade | -100 |
| Grade category | Sub category 1 |
And I press "Save changes"
And I press "Add grade item"
And I set the following fields to these values:
| Item name | Manual item 5 |
| Minimum grade | 50 |
| Grade category | Sub category 2 |
And I press "Save changes"
And I press "Add grade item"
And I set the following fields to these values:
| Item name | Manual item 6 |
| Minimum grade | 50 |
| Grade category | Sub category 2 |
And I press "Save changes"
And I am on the "Course 1" "grades > gradebook setup" page
And I navigate to "Setup > Course grade settings" in the course gradebook
And I set the field "Show weightings" to "Show"
And I set the field "Show contribution to course total" to "Show"
@@ -71,20 +43,11 @@ Feature: We can use a minimum grade different than zero
@javascript
Scenario: Natural aggregation with negative and positive grade
And I navigate to "Setup > Gradebook setup" in the course gradebook
And I set the following settings for grade item "Sub category 1":
| Aggregation | Natural |
| Exclude empty grades | 0 |
And I set the following settings for grade item "Sub category 2":
| Aggregation | Natural |
| Exclude empty grades | 0 |
Given I navigate to "Setup > Gradebook setup" in the course gradebook
And I set the following settings for grade item "Course 1":
| Aggregation | Natural |
| Exclude empty grades | 0 |
And I log out
And I log in as "teacher1"
And I am on "Course 1" course homepage
And I navigate to "View > Grader report" in the course gradebook
And I am on the "Course 1" "grades > Grader report > View" page logged in as "teacher1"
And I turn editing mode on
When I give the grade "-25.00" to the user "Student 1" for the grade item "Manual item 1"
And I give the grade "50.00" to the user "Student 1" for the grade item "Manual item 2"
+2 -6
View File
@@ -24,8 +24,7 @@ Feature: We can choose what min or max grade to use when aggregating grades.
And I log in as "admin"
And I set the following administration settings values:
| grade_minmaxtouse | Min and max grades as specified in grade item settings |
And I am on "C1" course homepage
And I navigate to "Setup > Gradebook setup" in the course gradebook
And I am on the "C1" "grades > gradebook setup" page
And I press "Add grade item"
And I set the following fields to these values:
| Item name | MI 1 |
@@ -63,10 +62,7 @@ Feature: We can choose what min or max grade to use when aggregating grades.
And I navigate to "Setup > Gradebook setup" in the course gradebook
And I set the following settings for grade item "CAT1":
| Aggregation | Natural |
And I log out
And I log in as "teacher1"
And I am on "C1" course homepage
And I navigate to "View > Grader report" in the course gradebook
And I am on the "C1" "grades > Grader report > View" page logged in as "teacher1"
And I turn editing mode on
And I give the grade "75.00" to the user "Student 1" for the grade item "MI 1"
And I give the grade "25.00" to the user "Student 1" for the grade item "MI 2"
@@ -23,9 +23,7 @@ Feature: Weights in natural aggregation are adjusted if the items are excluded f
| assign | C1 | a3 | Test assignment three | x | 200 |
| assign | C1 | a4 | Test assignment four (extra) | x | 20 |
| assign | C1 | a5 | Test assignment five (extra) | x | 10 |
And I log in as "teacher1"
And I am on "Course 1" course homepage
And I navigate to "Setup > Gradebook setup" in the course gradebook
And I am on the "Course 1" "grades > gradebook setup" page logged in as "teacher1"
And I set the following settings for grade item "Test assignment four (extra)":
| Extra credit | 1 |
And I set the following settings for grade item "Test assignment five (extra)":
@@ -24,9 +24,7 @@ Feature: Gradebook calculations for extra credit items before the fix 20150619
| assign | C1 | a3 | Test assignment three | x | 200 |
| assign | C1 | a4 | Test assignment four (extra) | x | 20 |
| assign | C1 | a5 | Test assignment five (extra) | x | 10 |
And I log in as "teacher1"
And I am on "Course 1" course homepage
And I navigate to "Setup > Gradebook setup" in the course gradebook
And I am on the "Course 1" "grades > gradebook setup" page logged in as "teacher1"
And I set the following settings for grade item "Test assignment four (extra)":
| Extra credit | 1 |
And I set the following settings for grade item "Test assignment five (extra)":
@@ -32,9 +32,7 @@ Feature: We can use natural aggregation and weights will be normalised to a tota
| assign | C1 | a7 | Test assignment seven | Submit nothing! | <span lang="en" class="multilang">EN</span><span lang="fr" class="multilang">FR</span> Sub category 1 | 15 |
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
And I navigate to "Setup > Gradebook setup" in the course gradebook
And I am on the "Course 1" "grades > gradebook setup" page logged in as "teacher1"
@javascript
Scenario: Setting all weights in a category to exactly one hundred in total.
@@ -31,9 +31,7 @@ Feature: Gradebook calculations for natural weights normalisation before the fix
| assign | C1 | a5 | Test assignment five | Submit something! | Sub category 1 | 20 |
| assign | C1 | a6 | Test assignment six | Submit something! | Sub category 1 | 10 |
| assign | C1 | a7 | Test assignment seven | Submit nothing! | Sub category 1 | 15 |
And I log in as "teacher1"
And I am on "Course 1" course homepage
And I navigate to "Setup > Gradebook setup" in the course gradebook
And I am on the "Course 1" "grades > gradebook setup" page logged in as "teacher1"
@javascript
Scenario: Grade items weights are normalised when all grade item weights are overridden (sum exactly 100). Extra credit is set to zero (before the fix 20150619).
@@ -30,8 +30,7 @@ Feature: Regrading grades does not unnecessarily mark some as overriden
And I press "Save and show next"
And I set the field "Grade out of 100" to "60"
And I press "Save changes"
And I am on "Course 1" course homepage
And I navigate to "View > Grader report" in the course gradebook
And I am on the "Course 1" "grades > Grader report > View" page
And the following should exist in the "gradereport-grader-table" table:
| | | |
| First name / Surname | Assignment 1 | Course total |
@@ -40,7 +39,6 @@ Feature: Regrading grades does not unnecessarily mark some as overriden
And I turn editing mode on
And I give the grade "80.00" to the user "Student 2" for the grade item "Course total"
And I press "Save changes"
And I navigate to "View > Grader report" in the course gradebook
And I navigate to "Setup > Gradebook setup" in the course gradebook
And I click on "Edit" "link" in the ".coursecategory" "css_element"
And I click on "Edit settings" "link" in the ".coursecategory" "css_element"
@@ -64,8 +62,7 @@ Feature: Regrading grades does not unnecessarily mark some as overriden
And I press "Save and show next"
And I set the field "Grade out of 100" to "70"
And I press "Save changes"
When I am on "Course 1" course homepage
And I navigate to "View > Grader report" in the course gradebook
When I am on the "Course 1" "grades > Grader report > View" page
Then the following should exist in the "gradereport-grader-table" table:
| | | |
| First name / Surname | Assignment 1 | Course total |
@@ -1,4 +1,4 @@
@core @core_grades
@core @core_grades @javascript
Feature: Control the aggregation of the scales
In order to use control the aggregation of the scales
As an admin
@@ -34,12 +34,9 @@ Feature: Control the aggregation of the scales
| Scale me | C1 | Letterscale |
And the following config values are set as admin:
| grade_includescalesinaggregation | 0 |
And I log out
Scenario Outline: Scales can be excluded from aggregation
Given I log in as "teacher1"
And I am on "Course 1" course homepage
And I navigate to "View > Grader report" in the course gradebook
Given I am on the "Course 1" "grades > Grader report > View" page logged in as "teacher1"
And I turn editing mode on
When I give the grade "10" to the user "Student 1" for the grade item "Grade me"
And I give the grade "B" to the user "Student 1" for the grade item "Scale me"
@@ -57,10 +54,7 @@ Feature: Control the aggregation of the scales
And I log in as "admin"
And I set the following administration settings values:
| grade_includescalesinaggregation | 1 |
And I log out
And I log in as "teacher1"
And I am on "Course 1" course homepage
And I navigate to "View > User report" in the course gradebook
And I am on the "Course 1" "grades > User report > View" page logged in as "teacher1"
And I select "Student 1" from the "Select all or one user" singleselect
And the following should exist in the "user-grade" table:
| Grade item | Grade | Percentage | Contribution to course total |
@@ -80,11 +74,8 @@ Feature: Control the aggregation of the scales
| Highest grade | Highest grade. | 10.00 | 10.00 % | 10.00 | 0.00 | 75.00 | 75.00 % | 0.00 % | 75.00 % |
| Mode of grades | Mode of grades. | 10.00 | 10.00 % | 10.00 | 0.00 | 75.00 | 75.00 % | 0.00 % | 75.00 % |
@javascript
Scenario: Weights of scales cannot be edited when they are not aggregated
Given I log in as "teacher1"
And I am on "Course 1" course homepage
And I navigate to "View > Grader report" in the course gradebook
Given I am on the "Course 1" "grades > Grader report > View" page logged in as "teacher1"
And I turn editing mode on
When I set the following settings for grade item "Course 1":
| Aggregation | Natural |
@@ -48,8 +48,7 @@ Feature: View gradebook when single item scales are used
And I click on "Grade" "link" in the "Student 1" "table_row"
And I set the field "Grade" to "A"
And I press "Save changes"
And I am on "Course 1" course homepage
And I navigate to "Setup > Course grade settings" in the course gradebook
When I am on the "Course 1" "grades > course grade settings" page
And I set the field "Show weightings" to "Show"
And I set the field "Show contribution to course total" to "Show"
And I press "Save changes"
+6 -28
View File
@@ -18,31 +18,13 @@ Feature: We can enter in grades and view reports from the gradebook
| teacher1 | C1 | editingteacher |
| student1 | C1 | student |
And the following "activities" exist:
| activity | name | intro | course | section | idnumber |
| assign | Test assignment name 1 | Submit your online text | C1 | 1 | assign1 |
| assign | Test assignment name 2 | Submit your online text | C1 | 1 | assign2 |
| activity | name | course | idnumber | assignsubmission_onlinetext_enabled |
| assign | Test assignment name 1 | C1 | assign1 | 1 |
| assign | Test assignment name 2 | C1 | assign2 | 1 |
And I log in as "admin"
And I set the following administration settings values:
| grade_aggregations_visible | Mean of grades,Weighted mean of grades,Simple weighted mean of grades,Mean of grades (with extra credits),Median of grades,Lowest grade,Highest grade,Mode of grades,Natural |
And I log out
And I log in as "teacher1"
And I am on "Course 1" course homepage
And I follow "Test assignment name 1"
And I navigate to "Edit settings" in current page administration
And I set the following fields to these values:
| Description | Submit your online text |
| assignsubmission_onlinetext_enabled | 1 |
And I press "Save and return to course"
And I follow "Test assignment name 2"
And I navigate to "Edit settings" in current page administration
And I set the following fields to these values:
| Description | Submit your online text |
| assignsubmission_onlinetext_enabled | 1 |
And I press "Save and return to course"
And I log out
And I log in as "student1"
And I am on "Course 1" course homepage
And I follow "Test assignment name 1"
And I am on the "Test assignment name 1" "assign activity" page logged in as student1
When I press "Add submission"
And I set the following fields to these values:
| Online text | This is a submission for assignment 1 |
@@ -50,8 +32,7 @@ Feature: We can enter in grades and view reports from the gradebook
And I press "Submit assignment"
And I press "Continue"
Then I should see "Submitted for grading"
And I am on "Course 1" course homepage
And I follow "Test assignment name 2"
And I am on the "Test assignment name 2" "assign activity" page
When I press "Add submission"
And I set the following fields to these values:
| Online text | This is a submission for assignment 2 |
@@ -59,10 +40,7 @@ Feature: We can enter in grades and view reports from the gradebook
And I press "Submit assignment"
And I press "Continue"
Then I should see "Submitted for grading"
And I log out
And I log in as "teacher1"
And I am on "Course 1" course homepage
And I navigate to "View > Grader report" in the course gradebook
And I am on the "Course 1" "grades > Grader report > View" page logged in as "teacher1"
And I turn editing mode on
And I give the grade "80.00" to the user "Student 1" for the grade item "Test assignment name 1"
And I give the grade "90.00" to the user "Student 1" for the grade item "Test assignment name 2"
+1 -1
View File
@@ -333,7 +333,7 @@ class helper {
// When there is a logged in user, her information will be passed to the player. It will be used for tracking.
$usersettings = [];
if (isloggedin()) {
$usersettings['name'] = $USER->username;
$usersettings['name'] = fullname($USER, has_capability('moodle/site:viewfullnames', $systemcontext));
$usersettings['id'] = $USER->id;
}
$settings = array(
+1
View File
@@ -459,6 +459,7 @@ $string['customusermenuitems'] = 'User menu items';
$string['datarootsecurityerror'] = '<p><strong>SECURITY WARNING!</strong></p><p>Your dataroot directory is in the wrong location and is exposed to the web. This means that all your private files are available to anyone in the world, and some of them could be used by a cracker to obtain unauthorised administrative access to your site!</p>
<p>You <em>must</em> move dataroot directory ({$a}) to a new location that is not within your public web directory, and update the <code>$CFG->dataroot</code> setting in your config.php accordingly.</p>';
$string['datarootsecuritywarning'] = 'Your site configuration might not be secure. Please make sure that your dataroot directory ({$a}) is not directly accessible via web.';
$string['dbprefixtoolong'] = 'Your site\'s database prefix ($CFG->prefix) is too long ({$a->current} characters). The maximum number of characters allowed is {$a->maximum}.';
$string['dbsessions'] = 'Use database for session information';
$string['debug'] = 'Debug messages';
$string['debugall'] = 'ALL: Show all reasonable PHP debug messages';
+29 -1
View File
@@ -1133,12 +1133,40 @@ class manager {
$command = "{$phpbinary} {$scriptpath} {$taskarg}";
// Execute it.
passthru($command);
self::passthru_via_mtrace($command);
}
return true;
}
/**
* This behaves similar to passthru but filters every line via
* the mtrace function so it can be post processed.
*
* @param string $command to run
* @return void
*/
public static function passthru_via_mtrace(string $command) {
$descriptorspec = [
0 => ['pipe', 'r'], // STDIN.
1 => ['pipe', 'w'], // STDOUT.
2 => ['pipe', 'w'], // STDERR.
];
flush();
$process = proc_open($command, $descriptorspec, $pipes, realpath('./'), []);
if (is_resource($process)) {
while ($s = fgets($pipes[1])) {
mtrace($s, '');
flush();
}
}
fclose($pipes[0]);
fclose($pipes[1]);
fclose($pipes[2]);
proc_close($process);
}
/**
* For a given scheduled task record, this method will check to see if any overrides have
* been applied in config and return a copy of the record with any overridden values.
+54
View File
@@ -205,3 +205,57 @@ function min_get_slash_argument($clean = true) {
}
return $relativepath;
}
/**
* Get the lowest possible currently valid revision number.
*
* This is based on the current Moodle version.
*
* @return int Unix timestamp
*/
function min_get_minimum_revision(): int {
static $timestamp = null;
if ($timestamp === null) {
global $CFG;
require("{$CFG->dirroot}/version.php");
// Get YYYYMMDD from version.
$datestring = floor($version / 100);
// Parse the date components.
$year = intval(substr($datestring, 0, 4));
$month = intval(substr($datestring, 4, 2));
$day = intval(substr($datestring, 6, 2));
// Return converted GMT Unix timestamp.
$timestamp = gmmktime(0, 0, 0, $month, $day, $year);
}
return $timestamp;
}
/**
* Get the highest possible currently valid revision number.
*
* This is based on the current time, allowing for a small amount of clock skew between servers.
*
* Future values beyond the clock skew are not allowed to avoid the possibility of cache poisoning.
*
* @return int
*/
function min_get_maximum_revision(): int {
return time() + 60;
}
/**
* Helper function to determine if the given revision number is valid.
*
* @param int $revision A numeric revision to check for validity
* @return bool Whether the revision is valid
*/
function min_is_revision_valid_and_current(int $revision): bool {
// Invalid revision.
if ($revision <= 0) {
return false;
}
// Check revision is within range.
return $revision >= min_get_minimum_revision() && $revision <= min_get_maximum_revision();
}
+13 -1
View File
@@ -1742,9 +1742,11 @@ function enrol_get_course_by_user_enrolment_id($ueid) {
* @param bool $onlyactive consider only active enrolments in enabled plugins and time restrictions
* @param array $usersfilter Limit the results obtained to this list of user ids. $uefilter compatibility not guaranteed.
* @param array $uefilter Limit the results obtained to this list of user enrolment ids. $usersfilter compatibility not guaranteed.
* @param array $usergroups Limit the results of users to the ones that belong to one of the submitted group ids.
* @return stdClass[]
*/
function enrol_get_course_users($courseid = false, $onlyactive = false, $usersfilter = array(), $uefilter = array()) {
function enrol_get_course_users($courseid = false, $onlyactive = false, $usersfilter = [], $uefilter = [],
$usergroups = []) {
global $DB;
if (!$courseid && !$usersfilter && !$uefilter) {
@@ -1787,6 +1789,16 @@ function enrol_get_course_users($courseid = false, $onlyactive = false, $usersfi
$params = $params + $ueparams;
}
// Only select enrolled users that belong to a specific group(s).
if (!empty($usergroups)) {
$usergroups = array_map(function ($item) { // Sanitize groupid to int to be save for sql.
return (int)$item;
}, $usergroups);
list($ugsql, $ugparams) = $DB->get_in_or_equal($usergroups, SQL_PARAMS_NAMED);
$conditions[] = 'ue.userid IN (SELECT userid FROM {groups_members} WHERE groupid ' . $ugsql . ')';
$params = $params + $ugparams;
}
return $DB->get_records_sql($sql . ' ' . implode(' AND ', $conditions), $params);
}
+4 -2
View File
@@ -228,8 +228,10 @@ class filter_manager {
public function filter_text($text, $context, array $options = array(),
array $skipfilters = null) {
$text = $this->apply_filter_chain($text, $this->get_text_filters($context), $options, $skipfilters);
// Remove <nolink> tags for XHTML compatibility.
$text = str_replace(array('<nolink>', '</nolink>'), '', $text);
if (!isset($options['stage']) || $options['stage'] === 'post_clean') {
// Remove <nolink> tags for XHTML compatibility after the last filtering stage.
$text = str_replace(array('<nolink>', '</nolink>'), '', $text);
}
return $text;
}
+6 -2
View File
@@ -47,6 +47,11 @@ if ($slashargument = min_get_slash_argument()) {
$file = min_optional_param('jsfile', '', 'RAW'); // 'file' would collide with URL rewriting!
}
if (!min_is_revision_valid_and_current($rev)) {
// If the rev is invalid, normalise it to -1 to disable all caching.
$rev = -1;
}
// some security first - pick only files with .js extension in dirroot
$jsfiles = array();
$files = explode(',', $file);
@@ -79,8 +84,7 @@ if (!$jsfiles) {
$etag = sha1($rev.implode(',', $jsfiles));
// Use the caching only for meaningful revision numbers which prevents future cache poisoning.
if ($rev > 0 and $rev < (time() + 60*60)) {
if ($rev > 0) {
$candidate = $CFG->localcachedir.'/js/'.$etag;
if (file_exists($candidate)) {
+16 -35
View File
@@ -10323,52 +10323,33 @@ function get_course_display_name_for_list($course) {
* Safe analogue of unserialize() that can only parse arrays
*
* Arrays may contain only integers or strings as both keys and values. Nested arrays are allowed.
* Note: If any string (key or value) has semicolon (;) as part of the string parsing will fail.
* This is a simple method to substitute unnecessary unserialize() in code and not intended to cover all possible cases.
*
* @param string $expression
* @return array|bool either parsed array or false if parsing was impossible.
*/
function unserialize_array($expression) {
$subs = [];
// Find nested arrays, parse them and store in $subs , substitute with special string.
while (preg_match('/([\^;\}])(a:\d+:\{[^\{\}]*\})/', $expression, $matches) && strlen($matches[2]) < strlen($expression)) {
$key = '--SUB' . count($subs) . '--';
$subs[$key] = unserialize_array($matches[2]);
if ($subs[$key] === false) {
return false;
}
$expression = str_replace($matches[2], $key . ';', $expression);
}
// Check the expression is an array.
if (!preg_match('/^a:(\d+):\{([^\}]*)\}$/', $expression, $matches1)) {
if (!preg_match('/^a:(\d+):/', $expression)) {
return false;
}
// Get the size and elements of an array (key;value;key;value;....).
$parts = explode(';', $matches1[2]);
$size = intval($matches1[1]);
if (count($parts) < $size * 2 + 1) {
return false;
}
// Analyze each part and make sure it is an integer or string or a substitute.
$value = [];
for ($i = 0; $i < $size * 2; $i++) {
if (preg_match('/^i:(\d+)$/', $parts[$i], $matches2)) {
$parts[$i] = (int)$matches2[1];
} else if (preg_match('/^s:(\d+):"(.*)"$/', $parts[$i], $matches3) && strlen($matches3[2]) == (int)$matches3[1]) {
$parts[$i] = $matches3[2];
} else if (preg_match('/^--SUB\d+--$/', $parts[$i])) {
$parts[$i] = $subs[$parts[$i]];
} else {
return false;
$values = (array) unserialize_object($expression);
// Callback that returns true if the given value is an unserialized object, executes recursively.
$invalidvaluecallback = static function($value) use (&$invalidvaluecallback): bool {
if (is_array($value)) {
return (bool) array_filter($value, $invalidvaluecallback);
}
return ($value instanceof stdClass) || ($value instanceof __PHP_Incomplete_Class);
};
// Iterate over the result to ensure there are no stray objects.
if (array_filter($values, $invalidvaluecallback)) {
return false;
}
// Combine keys and values.
for ($i = 0; $i < $size * 2; $i += 2) {
$value[$parts[$i]] = $parts[$i+1];
}
return $value;
return $values;
}
/**
+17 -21
View File
@@ -643,7 +643,7 @@ abstract class testing_util {
$borkedmysql = false;
if ($DB->get_dbfamily() === 'mysql') {
$version = $DB->get_server_info();
if (version_compare($version['version'], '5.6.0') == 1 and version_compare($version['version'], '5.6.16') == -1) {
if (version_compare($version['version'], '5.7.4', '<')) {
// Everything that comes from Oracle is evil!
//
// See http://dev.mysql.com/doc/refman/5.6/en/alter-table.html
@@ -652,31 +652,27 @@ abstract class testing_util {
// From 5.6.16 release notes:
// InnoDB: The ALTER TABLE INPLACE algorithm would fail to decrease the auto-increment value.
// (Bug #17250787, Bug #69882)
$borkedmysql = true;
} else if (version_compare($version['version'], '10.0.0') == 1) {
// And MariaDB is no better!
// Let's hope they pick the patch sometime later...
// This also impacts MySQL < 5.7.4.
$borkedmysql = true;
}
}
if ($borkedmysql) {
$mysqlsequences = array();
$prefix = $DB->get_prefix();
$rs = $DB->get_recordset_sql("SHOW TABLE STATUS LIKE ?", array($prefix.'%'));
foreach ($rs as $info) {
$table = strtolower($info->name);
if (strpos($table, $prefix) !== 0) {
// Incorrect table match caused by _ char.
continue;
}
if (!is_null($info->auto_increment)) {
$table = preg_replace('/^'.preg_quote($prefix, '/').'/', '', $table);
$mysqlsequences[$table] = $info->auto_increment;
if ($borkedmysql) {
$mysqlsequences = array();
$prefix = $DB->get_prefix();
$rs = $DB->get_recordset_sql("SHOW TABLE STATUS LIKE ?", array($prefix.'%'));
foreach ($rs as $info) {
$table = strtolower($info->name);
if (strpos($table, $prefix) !== 0) {
// Incorrect table match caused by _ char.
continue;
}
if (!is_null($info->auto_increment)) {
$table = preg_replace('/^'.preg_quote($prefix, '/').'/', '', $table);
$mysqlsequences[$table] = $info->auto_increment;
}
}
$rs->close();
}
$rs->close();
}
foreach ($data as $table => $records) {
+85
View File
@@ -0,0 +1,85 @@
<?php
// This file is part of Moodle - http://moodle.org/
//
// Moodle is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// Moodle is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
namespace core\testing;
/**
* Testing util tests.
*
* @package core
* @category phpunit
* @copyright 2023 Andrew Lyons <andrew@nicols.co.uk>
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
class util_test extends \advanced_testcase {
/**
* Note: This test is required for the other two parts because the first time
* a table is written to it may not have had the initial value reset.
*
* @coversNothing
*/
public function test_increment_reset_part_one(): void {
global $DB;
switch ($DB->get_dbfamily()) {
case 'mssql':
$this->markTestSkipped('MSSQL does not support sequences');
return;
case 'mysql':
$version = $DB->get_server_info();
if (version_compare($version['version'], '5.7.4', '<')) {
return;
}
}
$this->resetAfterTest();
$DB->insert_record('config_plugins', [
'plugin' => 'example',
'name' => 'test_increment',
'value' => 0,
]);
}
/**
* @coversNothing
* @depends test_increment_reset_part_one
*/
public function test_increment_reset_part_two(): int {
global $DB;
$this->resetAfterTest();
return $DB->insert_record('config_plugins', [
'plugin' => 'example',
'name' => 'test_increment',
'value' => 0,
]);
}
/**
* @depends test_increment_reset_part_two
*/
public function test_increment_reset_part_three(int $previousid): void {
global $DB;
$this->resetAfterTest();
$id = $DB->insert_record('config_plugins', [
'plugin' => 'example',
'name' => 'test_increment',
'value' => 0,
]);
$this->assertEquals($previousid, $id);
}
}
+32
View File
@@ -2189,4 +2189,36 @@ EOF;
}
}
/**
* Check that the page title contains a given string.
*
* @Given the page title should contain ":title"
* @param string $title The string that should be present on the page title.
*/
public function the_page_title_should_contain(string $title): void {
$session = $this->getSession();
if ($this->running_javascript()) {
// When running on JS, the page title can be changed via JS, so it's more reliable to get the actual page title via JS.
$actualtitle = $session->evaluateScript("return document.title");
} else {
$titleelement = $session->getPage()->find('css', 'head title');
if ($titleelement === null) {
// Throw an exception if a page title is not present on the page.
throw new ElementNotFoundException(
$this->getSession(),
'<title> element',
'css',
'head title'
);
}
$actualtitle = $titleelement->getText();
}
if (strpos($actualtitle, $title) === false) {
throw new ExpectationException(
"'$title' was not found from the current page title '$actualtitle'",
$session
);
}
}
}
+1 -1
View File
@@ -762,7 +762,7 @@ class core_component_testcase extends advanced_testcase {
'separators' => ['\\'],
'result' => $CFG->dirroot . "/test/src/Multiple/Namespaces.php",
],
'Getting a file with multiple namespaces' => [
'Getting a file with multiple namespaces (non-existent)' => [
'classname' => 'Nonexistant\\Namespace\\Test',
'prefix' => "Test",
'path' => 'test/src',
+72 -1
View File
@@ -21,7 +21,6 @@ defined('MOODLE_INTERNAL') || die();
// Global $CFG not used here intentionally to make sure it is not required inside the lib.
require_once(__DIR__ . '/../configonlylib.php');
/**
* Unit tests for config only library functions.
*
@@ -144,4 +143,76 @@ class configonlylib_test extends \advanced_testcase {
// Windows dir separators are removed, multiple ... gets collapsed to one .
$this->assertSame('/standardcore/./5/u/f1', min_get_slash_argument());
}
/**
* Test the min_get_minimum_version function.
*
* @covers ::min_get_minimum_version
*/
public function test_min_get_minimum_version(): void {
// This is fairly hard to write a test for, but we can at least check that it returns a number
// greater than the version when the feature was first introduced.
$firstintroduced = 1621209600; // Equivalent to 20210517 00:00:00 GMT.
$this->assertGreaterThanOrEqual($firstintroduced, min_get_minimum_revision());
}
/**
* Test the min_get_maximum_version function.
*
* @covers ::min_get_maximum_version
*/
public function test_min_get_maximum_version(): void {
// The maximum version should be set to a time in the near future.
// This is currently defined as "in the next minute".
// Note: We use a 65 second window to allow for slow test runners.
$this->assertGreaterThan(time(), min_get_maximum_revision());
$this->assertLessThanOrEqual(time() + 65, min_get_maximum_revision());
}
/**
* Test the min_is_revision_valid_and_current function.
*
* @covers ::min_is_revision_valid_and_current
* @dataProvider min_is_revision_valid_and_current_provider
*/
public function test_min_is_revision_valid_and_current(int $revision, bool $expected): void {
$this->assertEquals($expected, min_is_revision_valid_and_current($revision));
}
/**
* Data provider for the min_is_revision_valid_and_current tests.
*
* @return array
*/
public function min_is_revision_valid_and_current_provider(): array {
return [
'Negative value' => [-1, false],
'Empty value' => [0, false],
'A time before the minimum accepted value' => [min_get_minimum_revision() - 1, false],
'The minimum accepted value' => [min_get_minimum_revision(), true],
'The current time' => [time(), true],
// Note: We have to be careful using time values because the data provider is run at the start of the phpunit run,
// but the test may not be run for some time.
// On a slower machine and/or database, this could be several hours.
// For a more specific time we must have a specific test function.
'A time in the future' => [time() + DAYSECS, false]
];
}
/**
* Test the min_is_revision_valid_and_current function with close times.
*
* Note: These tests are incompatible with data providers.
*
* @covers ::min_is_revision_valid_and_current
*/
public function test_min_is_revision_valid_and_current_close_proximity(): void {
// A time in the near future.
$this->assertTrue(min_is_revision_valid_and_current(time() + 55));
// A time in the too-far future.
$this->assertFalse(min_is_revision_valid_and_current(time() + 70));
}
}
+9 -7
View File
@@ -4541,24 +4541,26 @@ EOF;
public function test_unserialize_array() {
$a = [1, 2, 3];
$this->assertEquals($a, unserialize_array(serialize($a)));
$this->assertEquals($a, unserialize_array(serialize($a)));
$a = ['a' => 1, 2 => 2, 'b' => 'cde'];
$this->assertEquals($a, unserialize_array(serialize($a)));
$this->assertEquals($a, unserialize_array(serialize($a)));
$a = ['a' => 1, 2 => 2, 'b' => 'c"d"e'];
$this->assertEquals($a, unserialize_array(serialize($a)));
$a = ['a' => 1, 2 => ['c' => 'd', 'e' => 'f'], 'b' => 'cde'];
$this->assertEquals($a, unserialize_array(serialize($a)));
// Can not unserialize if any string contains semicolons.
$a = ['a' => 1, 2 => ['c' => 'd', 'e' => ['f' => 'g']], 'b' => 'cde'];
$this->assertEquals($a, unserialize_array(serialize($a)));
$a = ['a' => 1, 2 => 2, 'b' => 'c"d";e'];
$this->assertEquals(false, unserialize_array(serialize($a)));
$this->assertEquals($a, unserialize_array(serialize($a)));
// Can not unserialize if there are any objects.
$a = (object)['a' => 1, 2 => 2, 'b' => 'cde'];
$this->assertEquals(false, unserialize_array(serialize($a)));
$this->assertFalse(unserialize_array(serialize($a)));
$a = ['a' => 1, 2 => 2, 'b' => (object)['a' => 'cde']];
$this->assertEquals(false, unserialize_array(serialize($a)));
$this->assertFalse(unserialize_array(serialize($a)));
$a = ['a' => 1, 2 => 2, 'b' => ['c' => (object)['a' => 'cde']]];
$this->assertFalse(unserialize_array(serialize($a)));
$a = ['a' => 1, 2 => 2, 'b' => ['c' => new lang_string('no')]];
$this->assertFalse(unserialize_array(serialize($a)));
// Array used in the grader report.
$a = array('aggregatesonly' => [51, 34], 'gradesonly' => [21, 45, 78]);
+38
View File
@@ -19,6 +19,8 @@ namespace core;
/**
* Unit tests for format_text defined in weblib.php.
*
* @covers ::format_text
*
* @package core
* @category test
* @copyright 2015 The Open University
@@ -88,6 +90,42 @@ class weblib_format_text_test extends \advanced_testcase {
format_text('<p>:-)</p>', FORMAT_MOODLE, array('filter' => false)));
}
/**
* Make sure that nolink tags and spans prevent linking in filters that support it.
*/
public function test_format_text_nolink() {
global $CFG;
$this->resetAfterTest();
filter_set_global_state('activitynames', TEXTFILTER_ON);
$course = $this->getDataGenerator()->create_course();
$context = \context_course::instance($course->id);
$page = $this->getDataGenerator()->create_module('page',
['course' => $course->id, 'name' => 'Test 1']);
$cm = get_coursemodule_from_instance('page', $page->id, $page->course, false, MUST_EXIST);
$pageurl = $CFG->wwwroot. '/mod/page/view.php?id=' . $cm->id;
$this->assertSame(
'<p>Read <a class="autolink" title="Test 1" href="' . $pageurl . '">Test 1</a>.</p>',
format_text('<p>Read Test 1.</p>', FORMAT_HTML, ['context' => $context]));
$this->assertSame(
'<p>Read <a class="autolink" title="Test 1" href="' . $pageurl . '">Test 1</a>.</p>',
format_text('<p>Read Test 1.</p>', FORMAT_HTML, ['context' => $context, 'noclean' => true]));
$this->assertSame(
'<p>Read Test 1.</p>',
format_text('<p><nolink>Read Test 1.</nolink></p>', FORMAT_HTML, ['context' => $context, 'noclean' => false]));
$this->assertSame(
'<p>Read Test 1.</p>',
format_text('<p><nolink>Read Test 1.</nolink></p>', FORMAT_HTML, ['context' => $context, 'noclean' => true]));
$this->assertSame(
'<p><span class="nolink">Read Test 1.</span></p>',
format_text('<p><span class="nolink">Read Test 1.</span></p>', FORMAT_HTML, ['context' => $context]));
}
public function test_format_text_overflowdiv() {
$this->assertEquals('<div class="no-overflow"><p>Hello world</p></div>',
format_text('<p>Hello world</p>', FORMAT_HTML, array('overflowdiv' => true)));
+10
View File
@@ -1,6 +1,16 @@
This files describes API changes in core libraries and APIs,
information provided here is intended especially for developers.
=== 3.11.18 ===
* In enrollib.php, the method enrol_get_course_users() got an optional 5th parameter $usergroups that
defaults to an empty array. Here, user group ids can be provided, to select enrolled users in a course
that are also members of these groups.
=== 3.11.17 ===
* New Behat step \behat_general::the_page_title_should_contain() has been added to allow checking of page titles. You can use this
when writing feature files to check that the page title contains the expected string.
e.g. `And the page title should contain "Some title"`
=== 3.11.15 ===
* Added a new parameter in address_in_subnet to give us the ability to check for 0.0.0.0 or not.
+20
View File
@@ -2487,6 +2487,26 @@ function check_igbinary322_version(environment_results $result) {
return $result;
}
/**
* This function checks that the database prefix ($CFG->prefix) is <= 10
*
* @param environment_results $result
* @return environment_results|null updated results object, or null if the prefix check is passing ok.
*/
function check_db_prefix_length(environment_results $result) {
global $CFG;
$prefixlen = strlen($CFG->prefix) ?? 0;
if ($prefixlen > 10) {
$parameters = (object)['current' => $prefixlen, 'maximum' => 10];
$result->setFeedbackStr(['dbprefixtoolong', 'admin', $parameters]);
$result->setInfo('db prefix too long');
$result->setStatus(false);
return $result;
}
return null; // All, good. By returning null we hide the check.
}
/**
* Assert the upgrade key is provided, if it is defined.
*
+2 -2
View File
@@ -2830,7 +2830,7 @@ class core_message_external extends external_api {
return new external_function_parameters(
array(
'userid' => new external_value(PARAM_INT, 'id of the user, 0 for current user', VALUE_REQUIRED),
'name' => new external_value(PARAM_TEXT, 'The name of the message processor'),
'name' => new external_value(PARAM_SAFEDIR, 'The name of the message processor'),
'formvalues' => new external_multiple_structure(
new external_single_structure(
array(
@@ -2906,7 +2906,7 @@ class core_message_external extends external_api {
return new external_function_parameters(
array(
'userid' => new external_value(PARAM_INT, 'id of the user, 0 for current user'),
'name' => new external_value(PARAM_TEXT, 'The name of the message processor', VALUE_REQUIRED),
'name' => new external_value(PARAM_SAFEDIR, 'The name of the message processor', VALUE_REQUIRED),
)
);
}
+2 -2
View File
@@ -702,8 +702,8 @@ function message_output_fragment_processor_settings($args = []) {
throw new moodle_exception('Must provide a userid');
}
$type = $args['type'];
$userid = $args['userid'];
$type = clean_param($args['type'], PARAM_SAFEDIR);
$userid = clean_param($args['userid'], PARAM_INT);
$user = core_user::get_user($userid, '*', MUST_EXIST);
if (!core_message_can_edit_message_profile($user)) {
@@ -0,0 +1,47 @@
@mod @mod_assign
Feature: Teacher can enable anonymous submissions for an assignment
In order to make an anonymous submission to an assignment
As a teacher
I should be able to enable anonymous submissions
Background:
Given the following "courses" exist:
| fullname | shortname | category |
| Course 1 | C1 | 0 |
And the following "users" exist:
| username | firstname | lastname | email |
| teacher1 | Teacher | One | teacher1@example.com |
| student1 | Student | One | student1@example.com |
And the following "course enrolments" exist:
| user | course | role |
| teacher1 | C1 | editingteacher |
| student1 | C1 | student |
And the following "activities" exist:
| activity | course | name | assignsubmission_onlinetext_enabled | blindmarking |
| assign | C1 | Assign 1 | 1 | 1 |
@javascript
Scenario: Teacher can enable anonymous submissions
# Submit an assignment as student1
Given the following "mod_assign > submissions" exist:
| assign | user | onlinetext |
| Assign 1 | student1 | I'm the student's first submission |
When I am on the "Assign 1" "assign activity editing" page logged in as teacher1
# Confirm that anonymous submissions can't be changed to no anymore
Then "blindmarking" "select" should not exist
And I press "Cancel"
And I am on the "Assign 1" "assign activity" page
And I navigate to "View all submissions" in current page administration
# Confirm that Participant [n] is displayed instead of Student One - student name is hidden
And I should not see "Student One" in the "Participant" "table_row"
And I click on "Grade" "link" in the "Participant" "table_row"
And I set the field "Grade out of 100" to "70"
And I press "Save changes"
And I am on the "Assign 1" "assign activity" page
And I navigate to "View all submissions" in current page administration
And I select "Reveal student identities" from the "Grading action" singleselect
And I should see "Are you sure you want to reveal student identities for this assignment? This operation cannot be undone. Once the student identities have been revealed, the marks will be released to the gradebook."
And I press "Continue"
# Confirm that student identity is no longer hidden and grade is retained
And I should not see "Participant" in the "Student One" "table_row"
And I should see "70.00" in the "Student One" "table_row"
@@ -24,7 +24,6 @@ Feature: Bulk released grades should not be sent to gradebook while submissions
| activity | assign |
| course | C1 |
| name | Test assignment name |
| intro | Test assignment description |
| assignsubmission_onlinetext_enabled | 1 |
| assignsubmission_file_enabled | 0 |
| markingworkflow | 1 |
@@ -32,31 +31,23 @@ Feature: Bulk released grades should not be sent to gradebook while submissions
| assignfeedback_comments_enabled | 1 |
| assignfeedback_editpdf_enabled | 1 |
# Add a submission.
And I log in as "student1"
And I am on "Course 1" course homepage
When I follow "Test assignment name"
And I am on the "Test assignment name" "assign activity" page logged in as "student1"
Then I should not see "Feedback"
And I should see "Not marked" in the "Grading status" "table_row"
And I press "Add submission"
And I set the following fields to these values:
| Online text | I'm student1's submission |
And I press "Save changes"
And I log out
# Add another submission.
And I log in as "student2"
And I am on "Course 1" course homepage
When I follow "Test assignment name"
And I am on the "Test assignment name" "assign activity" page logged in as "student2"
Then I should not see "Feedback"
And I should see "Not marked" in the "Grading status" "table_row"
And I press "Add submission"
And I set the following fields to these values:
| Online text | I'm student2's submission |
And I press "Save changes"
And I log out
# Mark the submissions.
And I log in as "teacher1"
And I am on "Course 1" course homepage
And I follow "Test assignment name"
And I am on the "Test assignment name" "assign activity" page logged in as "teacher1"
And I navigate to "View all submissions" in current page administration
Then I should see "Not marked" in the "I'm student1's submission" "table_row"
And I click on "Grade" "link" in the "I'm student1's submission" "table_row"
@@ -93,37 +84,22 @@ Feature: Bulk released grades should not be sent to gradebook while submissions
And I navigate to "View all submissions" in current page administration
Then I should see "Released" in the "I'm student1's submission" "table_row"
And I should see "Released" in the "I'm student2's submission" "table_row"
And I log out
And I log in as "student1"
And I am on "Course 1" course homepage
And I navigate to "User report" in the course gradebook
And I am on the "Course 1" "grades > User report > View" page logged in as "student1"
Then I should not see "50"
And I should not see "Great job!"
And I log out
And I log in as "student2"
And I am on "Course 1" course homepage
And I navigate to "User report" in the course gradebook
And I am on the "Course 1" "grades > User report > View" page logged in as "student2"
Then I should not see "50"
And I should not see "Great job!"
And I log out
And I log in as "teacher1"
And I am on "Course 1" course homepage
And I follow "Test assignment name"
And I am on the "Test assignment name" "assign activity" page logged in as "teacher1"
And I navigate to "View all submissions" in current page administration
And I set the field "Grading action" to "Reveal student identities"
And I press "Continue"
Then I should see "Released" in the "Student 1" "table_row"
And I should see "Released" in the "Student 2" "table_row"
And I log out
And I log in as "student1"
And I am on "Course 1" course homepage
And I navigate to "User report" in the course gradebook
And I am on the "Course 1" "grades > User report > View" page logged in as "student1"
Then I should see "50"
And I should see "Great job!"
And I log out
And I log in as "student2"
And I am on "Course 1" course homepage
And I navigate to "User report" in the course gradebook
And I am on the "Course 1" "grades > User report > View" page logged in as "student2"
Then I should see "50"
And I should see "Great job!"
@@ -143,15 +119,9 @@ Feature: Bulk released grades should not be sent to gradebook while submissions
And I navigate to "View all submissions" in current page administration
Then I should see "Released" in the "Student 1" "table_row"
And I should see "Released" in the "Student 2" "table_row"
And I log out
And I log in as "student1"
And I am on "Course 1" course homepage
And I navigate to "User report" in the course gradebook
And I am on the "Course 1" "grades > User report > View" page logged in as "student1"
Then I should see "50"
And I should see "Great job!"
And I log out
And I log in as "student2"
And I am on "Course 1" course homepage
And I navigate to "User report" in the course gradebook
And I am on the "Course 1" "grades > User report > View" page logged in as "student2"
Then I should see "50"
And I should see "Great job!"
+7 -18
View File
@@ -20,22 +20,13 @@ Feature: Outcome grading
| student1 | C1 | student |
And the following config values are set as admin:
| enableoutcomes | 1 |
And I log in as "admin"
And I navigate to "Grades > Scales" in site administration
And I press "Add a new scale"
And I set the following fields to these values:
| Name | Test Scale |
| Scale | Disappointing, Excellent, Good, Very good, Excellent |
And I press "Save changes"
And I navigate to "Grades > Outcomes" in site administration
And I press "Add a new outcome"
And I set the following fields to these values:
| Full name | Outcome Test |
| Short name | OT |
| Scale | Test Scale |
And I press "Save changes"
And I am on "Course 1" course homepage
And I navigate to "Outcomes" in current page administration
And the following "scales" exist:
| name | scale |
| Test Scale | Disappointing, Excellent, Good, Very good, Excellent |
And the following "grade outcomes" exist:
| fullname | shortname | scale |
| Outcome Test | OT | Test Scale |
And I am on the "Course 1" "grades > outcomes" page logged in as admin
And I set the field "Available standard outcomes" to "Outcome Test"
And I click on "#add" "css_element"
And I log out
@@ -49,13 +40,11 @@ Feature: Outcome grading
| Description | Test assignment description |
| assignsubmission_onlinetext_enabled | 1 |
| Outcome Test | 1 |
And I log out
And I am on the "Test assignment name" "assign activity" page logged in as student1
And I press "Add submission"
And I set the following fields to these values:
| Online text | My online text |
And I press "Save changes"
And I log out
When I am on the "Test assignment name" "assign activity" page logged in as teacher1
And I navigate to "View all submissions" in current page administration
And I click on "Grade" "link" in the "Student 0" "table_row"
+5 -5
View File
@@ -21,14 +21,14 @@ Feature: In an assignment, page titles are informative
Scenario: I view an assignment as a student and take an action
When I am on the "History of ants" Activity page logged in as student1
Then "title[text() = 'C1: History of ants']" "xpath_element" should exist in the "head" "css_element"
Then the page title should contain "C1: History of ants"
And I press "Add submission"
And "title[text() = 'C1: History of ants - Edit submission']" "xpath_element" should exist in the "head" "css_element"
And the page title should contain "C1: History of ants - Edit submission"
Scenario: I view an assignment as a teacher and take an action
When I am on the "History of ants" Activity page logged in as teacher1
Then "title[text() = 'C1: History of ants']" "xpath_element" should exist in the "head" "css_element"
Then the page title should contain "C1: History of ants"
And I navigate to "View all submissions" in current page administration
And "title[text() = 'C1: History of ants - Grading']" "xpath_element" should exist in the "head" "css_element"
And the page title should contain "C1: History of ants - Grading"
And I click on "Grade" "link" in the "Student 1" "table_row"
And "title[text() = 'C1: History of ants - Grading']" "xpath_element" should exist in the "head" "css_element"
And the page title should contain "C1: History of ants - Grading"
+11 -39
View File
@@ -32,8 +32,7 @@ Feature: In an assignment, teachers grade multiple students on one page
And I navigate to "View all submissions" in current page administration
When I click on "Grade" "link" in the "Student 1" "table_row"
And I press "Save changes"
And I click on "Edit settings" "link"
And I follow "Test assignment name"
And I am on the "Test assignment name" "assign activity" page
Then I should see "1" in the "Needs grading" "table_row"
@skip_chrome_zerosize
@@ -53,9 +52,7 @@ Feature: In an assignment, teachers grade multiple students on one page
| student2 | C1 | student |
And the following config values are set as admin:
| enableoutcomes | 1 |
When I log in as "teacher1"
And I am on "Course 1" course homepage
And I navigate to "Outcomes" in current page administration
When I am on the "Course 1" "grades > outcomes" page logged in as teacher1
And I follow "Edit outcomes"
And I press "Add a new outcome"
And I follow "Add a new scale"
@@ -63,8 +60,7 @@ Feature: In an assignment, teachers grade multiple students on one page
| Name | 1337dom scale |
| Scale | Noob, Nub, 1337, HaXor |
And I press "Save changes"
And I am on "Course 1" course homepage
And I navigate to "Outcomes" in current page administration
And I am on the "Course 1" "grades > outcomes" page
And I follow "Edit outcomes"
And I press "Add a new outcome"
And I set the following fields to these values:
@@ -79,26 +75,17 @@ Feature: In an assignment, teachers grade multiple students on one page
| assignsubmission_onlinetext_enabled | 1 |
| assignsubmission_file_enabled | 0 |
| M8d skillZ! | 1 |
And I log out
And I log in as "student1"
And I am on "Course 1" course homepage
And I follow "Test assignment name"
And I am on the "Test assignment name" "assign activity" page logged in as student1
And I press "Add submission"
And I set the following fields to these values:
| Online text | I'm the student1 submission |
And I press "Save changes"
And I log out
And I log in as "student2"
And I am on "Course 1" course homepage
And I follow "Test assignment name"
And I am on the "Test assignment name" "assign activity" page logged in as student2
When I press "Add submission"
And I set the following fields to these values:
| Online text | I'm the student2 submission |
And I press "Save changes"
And I log out
And I log in as "teacher1"
And I am on "Course 1" course homepage
And I follow "Test assignment name"
And I am on the "Test assignment name" "assign activity" page logged in as teacher1
And I navigate to "View all submissions" in current page administration
And I click on "Grade" "link" in the "Student 1" "table_row"
And I set the following fields to these values:
@@ -114,28 +101,19 @@ Feature: In an assignment, teachers grade multiple students on one page
And I press "Save all quick grading changes"
And I should see "The grade changes were saved"
And I press "Continue"
And I log out
And I log in as "student1"
And I am on "Course 1" course homepage
And I follow "Test assignment name"
And I am on the "Test assignment name" "assign activity" page logged in as student1
And I should see "I'm the teacher first feedback"
And I should see "60.0"
And I follow "Grades" in the user menu
And I click on "Course 1" "link" in the "region-main" "region"
And I should see "1337"
And I log out
And I log in as "student2"
And I am on "Course 1" course homepage
And I follow "Test assignment name"
And I am on the "Test assignment name" "assign activity" page logged in as student2
And I should not see "I'm the teacher first feedback"
And I should not see "60.0"
And I follow "Grades" in the user menu
And I click on "Course 1" "link" in the "region-main" "region"
And I should not see "1337"
And I log out
And I log in as "teacher1"
And I am on "Course 1" course homepage
And I follow "Test assignment name"
And I am on the "Test assignment name" "assign activity" page logged in as teacher1
And I navigate to "View all submissions" in current page administration
And I click on "Hide User picture" "link"
And I click on "Hide Full name" "link"
@@ -153,19 +131,13 @@ Feature: In an assignment, teachers grade multiple students on one page
And I press "Save all quick grading changes"
And I should see "The grade changes were saved"
And I press "Continue"
And I log out
And I log in as "student1"
And I am on "Course 1" course homepage
And I follow "Test assignment name"
And I am on the "Test assignment name" "assign activity" page logged in as student1
And I should see "I'm the teacher first feedback"
And I should see "60.0"
And I follow "Grades" in the user menu
And I click on "Course 1" "link" in the "region-main" "region"
And I should see "1337"
And I log out
And I log in as "student2"
And I am on "Course 1" course homepage
And I follow "Test assignment name"
And I am on the "Test assignment name" "assign activity" page logged in as student2
And I should not see "I'm the teacher first feedback"
And I should not see "60.0"
And I follow "Grades" in the user menu
@@ -66,10 +66,7 @@ Feature: Assignments correctly add feedback to the grade report when workflow an
And I should see "Released" in the "I'm the student's first submission" "table_row"
And I set the field "Grading action" to "Reveal student identities"
And I press "Continue"
And I log out
And I am on the "C1" Course page logged in as student1
And I navigate to "User report" in the course gradebook
And I am on the "Course 1" "grades > User report > View" page logged in as "student1"
Then I should see "50"
And I should see "Great job! Lol, not really."
@@ -92,10 +89,7 @@ Feature: Assignments correctly add feedback to the grade report when workflow an
And I follow "Test assignment name"
And I navigate to "View all submissions" in current page administration
And I should see "Released" in the "Student 1" "table_row"
And I log out
And I am on the "C1" Course page logged in as student1
And I navigate to "User report" in the course gradebook
And I am on the "Course 1" "grades > User report > View" page logged in as "student1"
Then I should see "50"
And I should see "Great job! Lol, not really."
@@ -0,0 +1,42 @@
@mod @mod_data
Feature: Students can view upcoming data activities in the timeline block
In order for student to see upcoming data activities in timeline block
As a teacher
I should be able to set the availability dates of data activities
Background:
Given the following "users" exist:
| username | firstname | lastname | email |
| student1 | Student | One | student1@example.com |
And the following "courses" exist:
| fullname | shortname |
| Course 1 | C1 |
And the following "course enrolments" exist:
| user | course | role |
| student1 | C1 | student |
@javascript
Scenario Outline: Student can view upcoming data activities in the timeline block
Given the following "activities" exist:
| activity | course | name | id_timeavailablefrom_enabled | timeavailablefrom | id_timeavailableto_enabled | timeavailableto |
| data | C1 | DB Past | 1 | <pastfrom> | 1 | <pastto> |
| data | C1 | DB Future | 1 | <futurefrom> | 1 | <futureto> |
| data | C1 | DB No date | 0 | | 0 | |
# Confirm that student can see future but not past db activity in the timeline block
When I log in as "student 1"
Then I should not see "DB Past" in the "Timeline" "block"
# Also confirm that student can't see db activity where availability is disabled
And I should not see "DB No Date" in the "Timeline" "block"
And I should see "DB Future" in the "Timeline" "block"
# Confirm link works and redirects to db activity
And I click on "DB Future" "link" in the "Timeline" "block"
And the activity date in "DB Future" should contain "Opens:"
And the activity date in "DB Future" should contain "<futurefrom>%A, %d %B %Y, %I:%M##"
And the activity date in "DB Future" should contain "Closes:"
And the activity date in "DB Future" should contain "<futureto>%A, %d %B %Y, %I:%M##"
Examples:
| pastfrom | pastto | futurefrom | futureto |
| ##1 month ago## | ##yesterday## | ##tomorrow## | ##tomorrow +1day## |
| ##yesterday## | ##yesterday +3hours## | ##tomorrow noon## | ##tomorrow noon +3hours## |
| ##6 months ago## | ##1 week ago## | ##tomorrow +5days## | ##tomorrow +6days## |

Some files were not shown because too many files have changed in this diff Show More