Compare commits

...

129 Commits

Author SHA1 Message Date
Huong Nguyen b5f4e0ce3d Moodle release 4.0.12 2023-12-08 09:21:28 +07:00
Sara Arjona 182db0699f weekly release 4.0.11+ 2023-12-07 16:22:18 +01:00
Paul Holden fd464742ea MDL-79980 mod_survey: remove responses link if user cannot access. 2023-12-07 12:09:39 +01:00
Brendan Heywood ccadbc0893 MDL-80309 tasks: Clean up mtrace logs 2023-12-07 12:07:35 +08:00
Paul Holden 85493f06d2 MDL-79980 mod_survey: respect activity group mode getting report. 2023-12-07 09:31:26 +08:00
Stephan Robotta 3bae360d11 MDL-41465 reports: In separate group mode, limit to same group users 2023-12-06 13:49:02 +07:00
Paul Holden c5f290abb9 MDL-79797 backup: ensure block config is safely unserialized. 2023-12-06 13:24:21 +07:00
Huong Nguyen e5b51a2e4b MDL-79759 repository_url: Remove types properties 2023-12-05 08:45:51 +07:00
David Woloszyn ea8fa7e8ac 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:34 +07:00
Stevani Andolo fae835d215 MDL-80174 tool_log: ensure "other" data is safely unserialized. 2023-12-04 13:41:16 +07:00
Paul Holden e72871579a MDL-80268 badges: require capability to view awarded badges. 2023-12-04 10:15:32 +07:00
Ilya Tregubov 55be12a221 weekly release 4.0.11+ 2023-12-01 13:12:42 +08:00
Sara Arjona d254764656 Merge branch 'MDL-79275-400' of https://github.com/lameze/moodle into MOODLE_400_STABLE 2023-11-29 16:44:27 +01:00
Ilya Tregubov 1b9891dff5 Merge branch 'MDL-79603-400' of https://github.com/andelacruz/moodle into MOODLE_400_STABLE 2023-11-28 13:54:42 +08:00
Simey Lameze 0761f9e45d MDL-79275 behat: add one second wait to avoid random 2023-11-28 11:07:30 +08:00
Huong Nguyen d0f1ebd072 weekly release 4.0.11+ 2023-11-24 12:23:44 +07:00
Huong Nguyen 9aba7d704e Merge branch 'MDL-78496-400' of https://github.com/andrewnicols/moodle into MOODLE_400_STABLE 2023-11-23 09:24:06 +07:00
Sara Arjona d7685d56d3 weekly release 4.0.11+ 2023-11-16 16:22:54 +01:00
Sara Arjona 0976bde187 Merge branch 'MDL-79981-400' of https://github.com/andrewnicols/moodle into MOODLE_400_STABLE 2023-11-15 17:10:36 +01:00
Angelia Dela Cruz 859051c304 MDL-79603 mod_scorm: Behat coverage for Scorm package display options 2023-11-15 11:28:28 +08:00
Andrew Nicols 769cdff139 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-14 22:48:04 +08:00
Ilya Tregubov 6ffde95a56 weekly release 4.0.11+ 2023-11-10 09:17:29 +08:00
Ilya Tregubov bf167fd4f0 Merge branch 'MDL-80029-400' of https://github.com/junpataleta/moodle into MOODLE_400_STABLE 2023-11-09 09:36:24 +08:00
Andrew Nicols a0acf2b8e5 MDL-79981 core: Add ability to manually run and filter phpunit on GHA 2023-11-08 12:54:12 +08:00
Jun Pataleta 51340445df 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:14 +08:00
Jun Pataleta db759e7126 weekly release 4.0.11+ 2023-10-27 09:43:17 +08:00
Jun Pataleta 2728b6d4e4 Merge branch 'MDL-79768-400-fix' of https://github.com/andelacruz/moodle into MOODLE_400_STABLE 2023-10-26 23:05:21 +08:00
Angelia Dela Cruz bec4ef8a13 MDL-79768 fix: Fixed random failing Behat due to time difference 2023-10-26 17:39:15 +08:00
Jun Pataleta 285ddabc19 Merge branch 'MDL-79768-400' of https://github.com/andelacruz/moodle into MOODLE_400_STABLE 2023-10-26 10:46:59 +08:00
Angelia Dela Cruz afe29e3665 MDL-79768 mod_data: Test for student can see upcoming data activity 2023-10-23 08:44:52 +08:00
Sara Arjona d0c3bf9897 weekly release 4.0.11+ 2023-10-20 12:16:39 +02:00
Huong Nguyen a6ccf907bc Merge branch 'MDL-79689-400' of https://github.com/andelacruz/moodle into MOODLE_400_STABLE 2023-10-19 10:06:00 +07:00
Angelia Dela Cruz eaad28749f MDL-79689 mod_assign: Behat for enabling anonymous submissions 2023-10-18 11:06:14 +08:00
Ilya Tregubov 53f4d3e1d5 Merge branch 'MDL-79691-400' of https://github.com/andelacruz/moodle into MOODLE_400_STABLE 2023-10-17 10:29:31 +08:00
Angelia Dela Cruz 62d17a7ab3 MDL-79691 mod_h5pactivity: Behat coverage for H5P activity grades reset 2023-10-16 17:18:55 +08:00
Huong Nguyen c2b7d5cfca Merge branch 'MDL-79698-400' of https://github.com/andrewnicols/moodle into MOODLE_400_STABLE 2023-10-16 11:40:58 +07:00
Huong Nguyen 2ba7c8797b Merge branch 'MDL-79653-400' of https://github.com/andelacruz/moodle into MOODLE_400_STABLE 2023-10-16 10:55:46 +07:00
Andrew Nicols 86c984c612 MDL-79698 core: Correct duplicate array key in test provider 2023-10-13 15:44:40 +08:00
Ilya Tregubov d5f45b29e3 weekly release 4.0.11+ 2023-10-13 13:39:38 +08:00
Angelia Dela Cruz 44bee8c4cf MDL-79653 gradingform_guide: Behat coverage for deleting marking guide 2023-10-13 11:23:52 +08:00
Huong Nguyen b4d7cc89ba Merge branch 'MDL-79638-400' of https://github.com/andrewnicols/moodle into MOODLE_400_STABLE 2023-10-12 11:08:42 +07:00
Andrew Nicols 6ce2eab547 MDL-79638 phpunit: Add unit test for increment resets 2023-10-11 00:10:33 +08:00
Andrew Nicols a941d93de1 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:01:27 +08:00
Jun Pataleta b72ce02928 Moodle release 4.0.11 2023-10-07 11:29:58 +08:00
Sara Arjona bec75acf94 weekly release 4.0.10+ 2023-10-06 14:02:34 +02:00
Laurent David a58f091184 MDL-77795 mod_bigbluebuttonbn: Change meetingID on duplicate
* We need to set a different meetingID when duplicating or importing a
BigBlueButtonBN activity to prevent unwanted sharing of recordings between
meetings.
2023-10-06 08:49:29 +08:00
Paul Holden 21cb1ae77a MDL-79310 enrol: restrict searched users to those user can view. 2023-10-04 14:31:52 +08:00
Paul Holden c78948fe55 MDL-79310 forumreport_summary: report only on users who can be viewed. 2023-10-04 14:31:52 +08:00
Paul Holden c64f39d187 MDL-79310 mod_forum: ensure only visible users can be exported. 2023-10-04 14:31:51 +08:00
Mikel Martín 4777e96a28 MDL-79509 mod_wiki: Improve comment editing 2023-10-04 02:05:15 +02:00
Paul Holden ce38fda651 MDL-72249 message: stricter cleaning of processor type parameter. 2023-10-04 02:05:15 +02:00
Paul Holden 42fb4b1a6c MDL-79426 gradeimport_csv: safely preview CSV content during import. 2023-10-04 02:05:15 +02:00
Paul Holden 96223014bd MDL-79455 tool_uploadcourse: clean course data fields individually. 2023-10-04 02:05:15 +02:00
Paul Holden 5975ced7e1 MDL-79455 tool_uploadcourse: safe preview of uploaded course data. 2023-10-04 02:05:15 +02:00
Paul Holden c1663de71e MDL-79409 mod_imscp: appropriate unserialization of package structure. 2023-10-04 02:05:15 +02:00
Paul Holden de05fca77a MDL-79408 mod_lesson: safer unserializing/comparison of properties. 2023-10-04 02:05:15 +02:00
David Woloszyn 42518c7c4a 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:05:15 +02:00
Huong Nguyen 5316b55716 MDL-66730 core_course: Improve permission check for category moving
Co-authored-by: Erica Bithell <egb10@cam.ac.uk>
2023-10-04 02:05:15 +02:00
Paul Holden 1ae0262730 MDL-78820 h5p: use fullname of current user as the xAPI actor name. 2023-10-04 02:05:15 +02:00
meirzamoodle f0c3a4ae7c 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:05:15 +02:00
Paul Holden 1139407107 MDL-78971 quiz_grading: escape user identity fields on display. 2023-10-04 02:05:15 +02:00
Jun Pataleta 92b81af0a0 weekly release 4.0.10+ 2023-10-04 07:49:22 +08:00
Huong Nguyen 3dc44686bc Merge branch 'MDL-79247_400' of https://github.com/stronk7/moodle into MOODLE_400_STABLE 2023-10-03 09:58:25 +07:00
Eloy Lafuente (stronk7) 7db3ed235b 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:02 +02:00
Eloy Lafuente (stronk7) c0587ac3a4 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:02 +02:00
Jun Pataleta 0f8e3e7b88 weekly release 4.0.10+ 2023-09-29 22:07:26 +08:00
Jun Pataleta 43d08df446 Merge branch 'install_400_STABLE' of https://git.in.moodle.com/amosbot/moodle-install into MOODLE_400_STABLE 2023-09-29 22:07:24 +08:00
AMOS bot 32e72da2aa Automatically generated installer lang files 2023-09-29 00:08:01 +00:00
Ilya Tregubov 55430e7995 Merge branch 'MDL-79360/400' of https://github.com/skodak/moodle into MOODLE_400_STABLE 2023-09-28 09:38:59 +08:00
Sara Arjona a55231cec8 weekly release 4.0.10+ 2023-09-26 16:17:09 +02:00
Shamim Rezaie af6368c392 Merge branch 'MDL-75928-400' of https://github.com/lameze/moodle into MOODLE_400_STABLE 2023-09-25 17:52:35 +10:00
Simey Lameze 7a9b169ec3 MDL-75928 format_week: improve get_section_dates one week calc 2023-09-22 08:48:47 +08:00
Sara Arjona 168b8d84da weekly release 4.0.10+ 2023-09-15 17:34:16 +02:00
Petr Skoda 25bc96c1c1 MDL-79360 filter: fix nolink tag regression from MDL-77525 2023-09-15 12:45:31 +02:00
Ilya Tregubov 12fc97c1b7 Merge branch 'MDL-79220-400' of https://github.com/andelacruz/moodle into MOODLE_400_STABLE 2023-09-14 17:44:18 +08:00
Ilya Tregubov 660a6b1172 Merge branch 'MDL-79195-400' of https://github.com/andelacruz/moodle into MOODLE_400_STABLE 2023-09-14 09:38:25 +08:00
Ilya Tregubov 46ddf24625 Merge branch 'MDL-78806-400' of https://github.com/junpataleta/moodle into MOODLE_400_STABLE 2023-09-13 10:56:10 +08:00
Eloy Lafuente (stronk7) 548b78ea84 weekly release 4.0.10+ 2023-09-12 18:54:12 +02:00
Angelia Dela Cruz f2eaea0ac3 MDL-79195 core_course: Activity and resource description display behat 2023-09-12 12:38:36 +08:00
Huong Nguyen 6c0eb76077 Merge branch 'MDL-79246-400' of https://github.com/andrewnicols/moodle into MOODLE_400_STABLE 2023-09-12 08:51:48 +07:00
Jun Pataleta b82333dfd5 MDL-78806 mod_assign: Use new Behat step for checking page title 2023-09-10 23:33:44 +08:00
Jun Pataleta 21feaf77ba 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:33:43 +08:00
Jun Pataleta d011da5803 weekly release 4.0.10+ 2023-09-08 22:35:19 +08:00
Jun Pataleta 05b96be8d6 Merge branch 'install_400_STABLE' of https://git.in.moodle.com/amosbot/moodle-install into MOODLE_400_STABLE 2023-09-08 22:35:18 +08:00
Jun Pataleta ade72f1cb2 MDL-78549 multianswer: Prevent default when clicking feedback trigger 2023-09-08 14:50:44 +08:00
Huong Nguyen 0832e78ba9 Merge branch 'MDL-78549-400' of https://github.com/junpataleta/moodle into MOODLE_400_STABLE 2023-09-08 10:59:06 +07:00
AMOS bot ccc82fc95a Automatically generated installer lang files 2023-09-08 00:10:42 +00:00
Angelia Dela Cruz 48c594202a MDL-79220 mod_glossary: Behat for glossary entry with attachment 2023-09-07 10:31:16 +08:00
Ilya Tregubov 0add4b7a6f Merge branch 'MDL-76459_400' of https://github.com/stronk7/moodle into MOODLE_400_STABLE 2023-09-06 10:03:42 +08:00
AMOS bot 1d92692ad4 Automatically generated installer lang files 2023-09-05 14:25:06 +00:00
Jun Pataleta d70101e521 MDL-78549 qtype_multianswer: Configure feedback popover trigger via JS
* For some reason, the `data-trigger="hover focus"` does not work when
rendering the popover via HTML. It just defaults to click, so the
feedback popover for qtype_multianswer questions does not show on hover.
Configuring the feedback popover's trigger via JS seems to work.
2023-09-05 09:36:16 +08:00
AMOS bot b78c185e31 Automatically generated installer lang files 2023-09-05 00:11:46 +00:00
Andrew Nicols 2576867e7a MDL-79246 gradingform_rubric: Use i_click_on for behat clicks 2023-09-04 09:13:09 +08:00
Eloy Lafuente (stronk7) 955a276e6e 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:36 +02:00
Andrew Nicols e2111d83ee weekly release 4.0.10+ 2023-09-02 08:18:38 +08:00
Andrew Nicols c1b33a6caf Merge branch 'MDL-77831-400' of https://github.com/mickhawkins/moodle into MOODLE_400_STABLE 2023-09-01 10:38:44 +08:00
Jun Pataleta c5231e4d28 Merge branch 'MDL-79017-400' of https://github.com/paulholden/moodle into MOODLE_400_STABLE 2023-08-31 20:31:53 +08:00
Michael Hawkins 573aa1c5bc MDL-77831 core: Updated security.txt expiry and added additional info 2023-08-31 18:29:59 +08:00
Huong Nguyen cae6b09efa Merge branch 'MDL-79207-400' of https://github.com/andelacruz/moodle into MOODLE_400_STABLE 2023-08-31 12:27:27 +07:00
Angelia Dela Cruz 676f899142 MDL-79207 core_course: Behat coverage for activity and resource deletion 2023-08-31 11:01:54 +08:00
Sara Arjona 91c90b6f5d Merge branch 'MDL-78612-400' of https://github.com/andrewnicols/moodle into MOODLE_400_STABLE 2023-08-30 17:55:52 +02:00
Andrew Nicols 2e9dbfd2d1 MDL-78612 core: Wrap modal_factory.create in pendingPromise 2023-08-30 13:36:26 +08:00
Jun Pataleta 2ece3b7a84 weekly release 4.0.10+ 2023-08-26 11:03:29 +08:00
Jun Pataleta 57c7642210 Merge branch 'install_400_STABLE' of https://git.in.moodle.com/amosbot/moodle-install into MOODLE_400_STABLE 2023-08-26 11:03:26 +08:00
Jun Pataleta 11f782c4a4 Merge branch 'MDL-79015-400-fix' of https://github.com/lameze/moodle into MOODLE_400_STABLE 2023-08-25 09:53:54 +08:00
Simey Lameze 57a985b035 MDL-79015 behat: make verification step more specific 2023-08-25 08:59:13 +08:00
AMOS bot 7b63b9ad6c Automatically generated installer lang files 2023-08-25 00:11:54 +00:00
Sara Arjona b6a5b0c5d9 Merge branch 'MDL-78965-400' of https://github.com/andelacruz/moodle into MOODLE_400_STABLE 2023-08-24 16:38:45 +02:00
Jun Pataleta f636d3b8dc Merge branch 'MDL-79015-400' of https://github.com/andelacruz/moodle into MOODLE_400_STABLE 2023-08-24 15:53:20 +08:00
Angelia Dela Cruz f3dbd537a5 MDL-78965 mod_quiz: Behat coverage for quiz with certainty-based marking 2023-08-24 15:13:41 +08:00
Jun Pataleta f77b73fe51 Merge branch 'MDL-78941-400' of https://github.com/andelacruz/moodle into MOODLE_400_STABLE 2023-08-24 13:05:37 +08:00
Angelia Dela Cruz 599cd75fe6 MDL-79015 mod_lesson: Behat coverage for lesson with access restriction 2023-08-24 13:05:31 +08:00
Angelia Dela Cruz b784e61a0f MDL-78941 mod_quiz: Behat coverage for student flagging quiz questions 2023-08-24 11:13:50 +08:00
Huong Nguyen ac35349fcc Merge branch 'MDL-78843-400' of https://github.com/lameze/moodle into MOODLE_400_STABLE 2023-08-24 08:58:31 +07:00
Sara Arjona 567bb622b4 weekly release 4.0.10+ 2023-08-22 15:51:07 +02:00
Ilya Tregubov 818ac5cc6c Merge branch 'MDL-79078-400' of https://github.com/junpataleta/moodle into MOODLE_400_STABLE 2023-08-22 09:11:03 +08:00
Paul Holden 5e91f88d4b 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:48 +01:00
Jun Pataleta e9906db076 MDL-79078 grades: Wait for pending JS when navigating gradebook 2023-08-21 17:30:41 +08:00
Ilya Tregubov 456e8d0f73 weekly release 4.0.10+ 2023-08-18 11:24:03 +08:00
Eloy Lafuente (stronk7) 2c6c256c51 Merge branch 'MDL-78684-400-fix-2' of https://github.com/lameze/moodle into MOODLE_400_STABLE 2023-08-17 19:57:33 +02:00
Simey Lameze e6684a65d7 MDL-78684 behat: fix behat failures 2023-08-17 21:15:45 +08:00
Jun Pataleta 1bae9ad509 Merge branch 'MDL-78938-400' of https://github.com/andrewnicols/moodle into MOODLE_400_STABLE 2023-08-17 09:58:16 +08:00
Andrew Nicols d79615711c Merge branch 'MDL-77695-400' of https://github.com/lameze/moodle into MOODLE_400_STABLE 2023-08-16 23:23:37 +08:00
Andrew Nicols c9682dfece Merge branch 'MDL-78684-400' of https://github.com/andelacruz/moodle into MOODLE_400_STABLE 2023-08-16 22:45:00 +08:00
Andrew Nicols 72ec24d812 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 20:05:34 +08:00
Andrew Nicols 27efd067f8 MDL-78938 report_progres: Wrap completion status update in pending 2023-08-16 20:05:33 +08:00
Simey Lameze 750da4a57d MDL-77695 behat: use automatic completion to award badges 2023-08-16 11:22:33 +08:00
Simey Lameze c7e549a46f 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:05:24 +08:00
Angelia Dela Cruz 5017f192ba 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:53:59 +08:00
162 changed files with 2312 additions and 1017 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>
@@ -103,8 +103,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
@@ -138,17 +137,11 @@ Feature: Set up contextual data for tests
When I log in as "user1"
And I am on site homepage
Then edit mode should be available on the current page
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
Then edit mode should be available on the current page
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
Then edit mode should be available on the current page
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
Then edit mode should be available on the current page
And I log out
And I log in as "user5"
@@ -190,8 +183,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"
@@ -308,9 +300,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"
@@ -331,9 +321,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
@@ -359,9 +347,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"
@@ -380,9 +366,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 navigate to "More > Outcomes" in the course gradebook
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 press "Manage outcomes"
@@ -408,9 +392,7 @@ Feature: Set up contextual data for tests
| Test Outcome Grade Item 1 | C1 | OT1 | Grade category 1 |
And the following config values are set as admin:
| enableoutcomes | 1 |
When I log in as "admin"
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 Outcome Grade Item 1"
And I follow "Edit Test Outcome Grade Item 1"
And the field "Outcome" matches value "Grade outcome 1"
@@ -425,6 +407,5 @@ Feature: Set up contextual data for tests
And the following "blocks" exist:
| blockname | contextlevel | reference | pagetypepattern | defaultregion |
| online_users | Course | C1 | course-view-* | site-pre |
When I log in as "admin"
And I am on "Course 1" course homepage
When I am on the "Course 1" course page logged in as admin
Then I should see "Online users"
+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);
}
@@ -54,10 +54,7 @@ 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 "50"
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);
@@ -97,6 +87,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
@@ -1589,7 +1589,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
@@ -4339,7 +4339,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
@@ -229,12 +229,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
@@ -253,8 +260,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
@@ -265,6 +271,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,17 +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 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,16 +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 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 "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,19 @@ 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 "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:
| 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 turn editing mode on
And I am on the "Course 1" "grades > Grader report > View" page
And I give the grade "Excellent!" to the user "Student 1" for the grade item "Test assignment"
And I give the grade "Very good" to the user "Student 2" for the grade item "Test assignment"
And I give the grade "Very good" to the user "Student 3" for the grade item "Test assignment"
@@ -83,9 +77,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"
@@ -104,9 +96,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"
@@ -127,10 +117,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"
@@ -150,9 +138,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,21 +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 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
@@ -88,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"
@@ -106,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"
@@ -129,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"
@@ -153,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"
@@ -177,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"
@@ -201,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"
@@ -225,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,17 +42,13 @@ 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 "Settings" in current page administration
| activity | name | course | idnumber | section | assignsubmission_file_enabled |
| assign | Test assignment | C1 | assign1 | 1 | 0 |
And I am on the "Test assignment" "assign activity editing" page logged in as teacher1
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
And I am on the "Course 1" "grades > Grader report > view" page
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"
@@ -29,19 +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 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,16 @@ 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 "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 turn editing mode on
And I am on the "Course 1" "grades > Grader report > View" page
And I give the grade "Excellent!" to the user "Student 1" for the grade item "Test assignment"
And I give the grade "Very good" to the user "Student 2" for the grade item "Test assignment"
And I give the grade "Good" to the user "Student 3" for the grade item "Test assignment"
@@ -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 "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,19 +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 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
@@ -82,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"
@@ -100,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"
@@ -121,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"
@@ -143,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"
@@ -165,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"
@@ -188,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"
@@ -211,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,13 +46,10 @@ 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 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 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 "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"
@@ -86,9 +83,7 @@ Feature: The activity results block displays student in visible groups low score
| config_nameformat | Display full names |
| 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"
@@ -102,9 +97,7 @@ Feature: The activity results block displays student in visible groups low score
| config_nameformat | Display full names |
| 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"
@@ -123,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"
@@ -141,9 +132,7 @@ Feature: The activity results block displays student in visible groups low score
| config_nameformat | Display full names |
| 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"
@@ -159,9 +148,7 @@ Feature: The activity results block displays student in visible groups low score
| config_nameformat | Display full names |
| 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"
@@ -179,9 +166,7 @@ Feature: The activity results block displays student in visible groups low score
| config_nameformat | Display only ID numbers |
| 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"
@@ -196,9 +181,7 @@ Feature: The activity results block displays student in visible groups low score
| config_nameformat | Anonymous results |
| 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"
@@ -94,6 +94,7 @@ Feature: The my overview block allows users to hide their courses
When I click on "All" "link" in the "Course overview" "block"
And I click on ".coursemenubtn" "css_element" in the "//div[@class='card dashboard-card' and contains(.,'Course 2')]" "xpath_element"
And I click on "Remove from view" "link" in the "//div[@class='card dashboard-card' and contains(.,'Course 2')]" "xpath_element"
And I wait "1" seconds
Then I should not see "Course 2" in the "Course overview" "block"
Scenario: Test a course is never hidden with "All (including removed from view)" courses
@@ -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 "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"
@@ -22,7 +22,6 @@ Feature: Allow to mark course as completed without cron for activity completion
| course | CC1 |
| name | Test assignment name |
| idnumber | assign1 |
| description | Test assignment description |
And the following "blocks" exist:
| blockname | contextlevel | reference | pagetypepattern | defaultregion |
| completionstatus | Course | CC1 | course-view-* | side-pre |
@@ -87,7 +86,6 @@ Feature: Allow to mark course as completed without cron for activity completion
And I click on "Grade" "link" in the "student1@example.com" "table_row"
And I set the field "Grade out of 100" to "40"
And I click on "Save changes" "button"
And I am on "Completion course" course homepage
And I am on the "Completion course" course page logged in as student1
And I should see "Status: In progress"
And I am on the "Test assignment name2" "assign activity" page logged in as teacher1
@@ -95,14 +93,12 @@ Feature: Allow to mark course as completed without cron for activity completion
And I click on "Grade" "link" in the "student1@example.com" "table_row"
And I set the field "Grade out of 100" to "40"
And I click on "Save changes" "button"
And I am on "Completion course" course homepage
When I am on the "Completion course" course page logged in as student1
Then I should see "Status: Complete"
@javascript
Scenario: Course completion should not be updated when teacher grades assignment on course grader report page
Given I am on the "Completion course" course page logged in as teacher1
And I navigate to "View > Grader report" in the course gradebook
Given I am on the "Completion course" "grades > Grader report > View" page logged in as "teacher1"
And I turn editing mode on
And I give the grade "57" to the user "Student First" for the grade item "Test assignment name"
And I press "Save changes"
@@ -116,9 +112,7 @@ Feature: Allow to mark course as completed without cron for activity completion
@javascript
Scenario: Course completion should not be updated when teacher grades assignment on activity grader report page
Given I am on the "Completion course" course page logged in as teacher1
And I navigate to "View > Grader report" in the course gradebook
And I follow "Single view"
Given I am on the "Completion course" "grades > Single View > View" page logged in as "teacher1"
And I select "Student First" from the "Select a user above to view all their grades" singleselect
And I set the field "Override for Test assignment name" to "1"
When I set the following fields to these values:
@@ -27,26 +27,18 @@ Feature: Students will be marked as completed if they have achieved a passing gr
| completionpassgrade | 1 |
| completionusegrade | 1 |
| gradepass | 50 |
And I log in as "teacher1"
And I am on "Course 1" course homepage
And I am on the "Course 1" course page logged in as teacher1
And "Student First" user has not completed "Test assignment name" activity
And I log out
Scenario: Passing grade completion
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
And I turn editing mode on
And I give the grade "21" to the user "Student First" for the grade item "Test assignment name"
And I give the grade "50" to the user "Student Second" for the grade item "Test assignment name"
And I press "Save changes"
And I log out
When I log in as "student1"
And I am on "Course 1" course homepage
And the "Receive a grade" completion condition of "Test assignment name" is displayed as "done"
When I am on the "Course 1" course page logged in as student1
Then the "Receive a grade" completion condition of "Test assignment name" is displayed as "done"
And the "Receive a passing grade" completion condition of "Test assignment name" is displayed as "failed"
And I log out
And I log in as "student2"
And I am on "Course 1" course homepage
And I am on the "Course 1" course page logged in as student2
And the "Receive a grade" completion condition of "Test assignment name" is displayed as "done"
And the "Receive a passing grade" completion condition of "Test assignment name" is displayed as "done"
@@ -23,7 +23,6 @@ Feature: Students will be marked as completed and pass/fail
| course | C1 |
| idnumber | a1 |
| name | Test assignment name |
| intro | Submit your online text |
| assignsubmission_onlinetext_enabled | 1 |
| assignsubmission_file_enabled | 0 |
| completion | 2 |
@@ -31,39 +30,26 @@ Feature: Students will be marked as completed and pass/fail
| completionusegrade | 1 |
| gradepass | 50 |
| completionpassgrade | 1 |
And I log in as "teacher1"
And I am on "Course 1" course homepage
And I am on the "Course 1" course page logged in as teacher1
And "Student First" user has not completed "Test assignment name" activity
And I log out
And I am on the "Test assignment name" "assign activity" page logged in as student2
And I log out
And I am on the "Test assignment name" "assign activity" page logged in as student1
And I log out
Scenario: Confirm completion (incomplete/pass/fail) are set correctly
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
And I turn editing mode on
And I give the grade "21" to the user "Student First" for the grade item "Test assignment name"
And I give the grade "50" to the user "Student Second" for the grade item "Test assignment name"
And I give the grade "30" to the user "Student Third" for the grade item "Test assignment name"
And I press "Save changes"
And I log out
When I log in as "student1"
And I am on "Course 1" course homepage
And the "View" completion condition of "Test assignment name" is displayed as "done"
Given the following "grade grades" exist:
| gradeitem | user | grade |
| Test assignment name | student1 | 21.00 |
| Test assignment name | student2 | 50.00 |
| Test assignment name | student3 | 30.00 |
When I am on "Course 1" course homepage
Then the "View" completion condition of "Test assignment name" is displayed as "done"
And the "Receive a grade" completion condition of "Test assignment name" is displayed as "done"
And the "Receive a passing grade" completion condition of "Test assignment name" is displayed as "failed"
And I log out
And I log in as "student2"
And I am on "Course 1" course homepage
And I am on the "Course 1" course page logged in as student2
And the "View" completion condition of "Test assignment name" is displayed as "done"
And the "Receive a grade" completion condition of "Test assignment name" is displayed as "done"
And the "Receive a passing grade" completion condition of "Test assignment name" is displayed as "done"
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 the "View" completion condition of "Test assignment name" is displayed as "todo"
And the "Receive a grade" completion condition of "Test assignment name" is displayed as "done"
And the "Receive a passing grade" completion condition of "Test assignment name" is displayed as "failed"
@@ -22,7 +22,6 @@ Feature: Students will be shown relevant completion state based on grade item vi
| activity | assign |
| course | C1 |
| name | Test assignment name |
| intro | Submit your online text |
| assignsubmission_onlinetext_enabled | 1 |
| assignsubmission_file_enabled | 0 |
| completion | 2 |
@@ -31,34 +30,27 @@ Feature: Students will be shown relevant completion state based on grade item vi
| gradepass | 50 |
And I am on the "Course 1" course page logged in as teacher1
And "Student First" user has not completed "Test assignment name" activity
And I log out
And I am on the "Course 1" course page logged in as student1
And the "Receive a grade" completion condition of "Test assignment name" is displayed as "todo"
And the "Receive a passing grade" completion condition of "Test assignment name" is displayed as "todo"
And I log out
Scenario: Passing grade and receive a grade completions for visible grade item (passgrade completion enabled)
Given I am on the "Course 1" course page logged in as teacher1
And I navigate to "View > Grader report" in the course gradebook
And I turn editing mode on
And I give the grade "21" to the user "Student First" for the grade item "Test assignment name"
And I give the grade "50" to the user "Student Second" for the grade item "Test assignment name"
And I press "Save changes"
And I am on "Course 1" course homepage
Given the following "grade grades" exist:
| gradeitem | user | grade |
| Test assignment name | student1 | 21.00 |
| Test assignment name | student2 | 50.00 |
And I am on the "Course 1" course page logged in as teacher1
And "Student First" user has completed "Test assignment name" activity
And "Student Second" user has completed "Test assignment name" activity
And I log out
When I am on the "Course 1" course page logged in as student1
And the "Receive a grade" completion condition of "Test assignment name" is displayed as "done"
And the "Receive a passing grade" completion condition of "Test assignment name" is displayed as "failed"
And I log out
And I am on the "Course 1" course page logged in as student2
Then the "Receive a grade" completion condition of "Test assignment name" is displayed as "done"
And the "Receive a passing grade" completion condition of "Test assignment name" is displayed as "done"
Scenario: Passing grade and receive a grade completions for hidden grade item (passgrade completion enabled)
Given I am on the "Course 1" course page logged in as teacher1
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 hide the grade item "Test assignment name"
And I navigate to "View > Grader report" in the course gradebook
And I turn editing mode on
@@ -68,28 +60,22 @@ Feature: Students will be shown relevant completion state based on grade item vi
And I am on "Course 1" course homepage
And "Student First" user has not completed "Test assignment name" activity
And "Student Second" user has completed "Test assignment name" activity
And I log out
And I am on the "Course 1" course page logged in as student1
And the "Receive a grade" completion condition of "Test assignment name" is displayed as "done"
And the "Receive a passing grade" completion condition of "Test assignment name" is displayed as "todo"
And I log out
And I am on the "Course 1" course page logged in as student2
And the "Receive a grade" completion condition of "Test assignment name" is displayed as "done"
And the "Receive a passing grade" completion condition of "Test assignment name" is displayed as "done"
Scenario: Receive a grade completion for visible grade item (passgrade completion disabled)
Given I am on the "Test assignment name" Activity page logged in as teacher1
When I navigate to "Settings" in current page administration
Given I am on the "Test assignment name" "assign activity editing" page logged in as teacher1
And I set the following fields to these values:
| completionpassgrade | 0 |
And I press "Save and display"
And I log out
And I am on the "Course 1" course page logged in as student1
And the "Receive a grade" completion condition of "Test assignment name" is displayed as "todo"
And I should not see "Receive a passing grade"
And I log out
And I am on the "Course 1" 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"
And I turn editing mode on
And I give the grade "21" to the user "Student First" for the grade item "Test assignment name"
And I give the grade "50" to the user "Student Second" for the grade item "Test assignment name"
@@ -97,28 +83,22 @@ Feature: Students will be shown relevant completion state based on grade item vi
And I am on "Course 1" course homepage
And "Student First" user has completed "Test assignment name" activity
And "Student Second" user has completed "Test assignment name" activity
And I log out
When I am on the "Course 1" course page logged in as student1
# Once MDL-75582 is fixed "failed" should be changed to "done"
And the "Receive a grade" completion condition of "Test assignment name" is displayed as "failed"
And I should not see "Receive a passing grade"
And I log out
And I am on the "Course 1" course page logged in as student2
Then the "Receive a grade" completion condition of "Test assignment name" is displayed as "done"
Scenario: Receive a grade completion for hidden grade item (passgrade completion disabled)
Given I am on the "Test assignment name" Activity page logged in as teacher1
When I navigate to "Settings" in current page administration
Given I am on the "Test assignment name" "assign activity editing" page logged in as teacher1
And I set the following fields to these values:
| completionpassgrade | 0 |
And I press "Save and display"
And I log out
And I am on the "Course 1" course page logged in as student1
And the "Receive a grade" completion condition of "Test assignment name" is displayed as "todo"
And I should not see "Receive a passing grade"
And I log out
And I am on the "Course 1" course page logged in as teacher1
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 hide the grade item "Test assignment name"
And I navigate to "View > Grader report" in the course gradebook
And I turn editing mode on
@@ -128,10 +108,8 @@ Feature: Students will be shown relevant completion state based on grade item vi
And I am on "Course 1" course homepage
And "Student First" user has completed "Test assignment name" activity
And "Student Second" user has completed "Test assignment name" activity
And I log out
When I am on the "Course 1" course page logged in as student1
Then the "Receive a grade" completion condition of "Test assignment name" is displayed as "done"
And I should not see "Receive a passing grade"
And I log out
And I am on the "Course 1" course page logged in as student2
And the "Receive a grade" completion condition of "Test assignment name" is displayed as "done"
+2 -2
View File
@@ -1,4 +1,4 @@
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}}
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}}
/**
* Provides the functionality for toggling the manual completion state of a course module through
* the manual completion button.
@@ -6,6 +6,6 @@ define("core_course/manual_completion_toggle",["exports","core/templates","core/
* @module core_course/manual_completion_toggle
* @copyright 2021 Jun Pataleta <jun@moodle.com>
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/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);const SELECTORS_MANUAL_TOGGLE="button[data-action=toggle-manual-completion]",TOGGLE_TYPES_TOGGLE_MARK_DONE="manual:mark-done";let registered=!1;_exports.init=()=>{registered||(document.addEventListener("click",(e=>{const toggleButton=e.target.closest(SELECTORS_MANUAL_TOGGLE);toggleButton&&(e.preventDefault(),toggleManualCompletionState(toggleButton).catch(_notification.default.exception))})),registered=!0)};const toggleManualCompletionState=async toggleButton=>{const originalInnerHtml=toggleButton.innerHTML;toggleButton.setAttribute("disabled","disabled");const toggleType=toggleButton.getAttribute("data-toggletype"),cmid=toggleButton.getAttribute("data-cmid"),activityname=toggleButton.getAttribute("data-activityname"),completed=toggleType===TOGGLE_TYPES_TOGGLE_MARK_DONE,loadingHtml=await _templates.default.render("core/loading",{});await _templates.default.replaceNodeContents(toggleButton,loadingHtml,"");try{await(0,_repository.toggleManualCompletion)(cmid,completed);const templateContext={cmid:cmid,activityname:activityname,overallcomplete:completed,overallincomplete:!completed,istrackeduser:!0},renderObject=await _templates.default.renderForPromise("core_course/completion_manual",templateContext),newToggleButton=(await _templates.default.replaceNode(toggleButton,renderObject.html,renderObject.js)).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)}catch(exception){toggleButton.removeAttribute("disabled"),toggleButton.innerHTML=originalInnerHtml,_notification.default.exception(exception)}}}));
*/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);const SELECTORS_MANUAL_TOGGLE="button[data-action=toggle-manual-completion]",TOGGLE_TYPES_TOGGLE_MARK_DONE="manual:mark-done";let registered=!1;_exports.init=()=>{registered||(document.addEventListener("click",(e=>{const toggleButton=e.target.closest(SELECTORS_MANUAL_TOGGLE);toggleButton&&(e.preventDefault(),toggleManualCompletionState(toggleButton).catch(_notification.default.exception))})),registered=!0)};const toggleManualCompletionState=async toggleButton=>{const pendingPromise=new _pending.default("core_course:toggleManualCompletionState"),originalInnerHtml=toggleButton.innerHTML;toggleButton.setAttribute("disabled","disabled");const 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((loadingHtml=>{_templates.default.replaceNodeContents(toggleButton,loadingHtml,"")})).catch((()=>{}));try{await(0,_repository.toggleManualCompletion)(cmid,completed);const templateContext={cmid:cmid,activityname:activityname,overallcomplete:completed,overallincomplete:!completed,istrackeduser:!0},renderObject=await _templates.default.renderForPromise("core_course/completion_manual",templateContext),newToggleButton=(await _templates.default.replaceNode(toggleButton,renderObject.html,renderObject.js)).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)}catch(exception){toggleButton.removeAttribute("disabled"),toggleButton.innerHTML=originalInnerHtml,_notification.default.exception(exception)}pendingPromise.resolve()}}));
//# 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']);
+17 -6
View File
@@ -406,14 +406,25 @@ class format_weeks extends core_courseformat\base {
} else {
$sectionnum = $section;
}
$oneweekseconds = 604800;
// Hack alert. We add 2 hours to avoid possible DST problems. (e.g. we go into daylight
// savings and the date changes.
$startdate = $startdate + 7200;
// Create a DateTime object for the start date.
$startdateobj = new DateTime("@$startdate");
// Calculate the interval for one week.
$oneweekinterval = new DateInterval('P7D');
// Calculate the interval for the specified number of sections.
for ($i = 1; $i < $sectionnum; $i++) {
$startdateobj->add($oneweekinterval);
}
// Calculate the end date.
$enddateobj = clone $startdateobj;
$enddateobj->add($oneweekinterval);
$dates = new stdClass();
$dates->start = $startdate + ($oneweekseconds * ($sectionnum - 1));
$dates->end = $dates->start + $oneweekseconds;
$dates->start = $startdateobj->getTimestamp();
$dates->end = $enddateobj->getTimestamp();
return $dates;
}
@@ -219,8 +219,8 @@ class format_weeks_test extends \advanced_testcase {
$courseform = new \testable_course_edit_form(null, $args);
$courseform->definition_after_data();
// format_weeks::get_section_dates is adding 2h to avoid DST problems, we need to replicate it here.
$enddate = $params['startdate'] + (WEEKSECS * $params['numsections']) + 7200;
// Calculate the expected end date.
$enddate = $params['startdate'] + (WEEKSECS * $params['numsections']);
$weeksformat = course_get_format($course->id);
$this->assertEquals($enddate, $weeksformat->get_default_course_enddate($courseform->get_quick_form()));
@@ -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
@@ -363,6 +363,44 @@ class externallib_test 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"
@@ -25,14 +25,12 @@ 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! |
| activity | course | name |
| assign | C1 | The greatest assignment ever |
| assign | C1 | Rewarding assignment |
Given the following config values are set as admin:
| showuseridentity | email,profile_field_food |
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 am on the "Course 1" "grades > Grader report > View" page logged in as "teacher1"
And I should see "apple" in the "student1" "table_row"
And I should see "orange" in the "student2" "table_row"
And I turn editing mode on
@@ -41,10 +39,7 @@ Feature: A teacher checks the grade history report in a course
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 should see "apple" in the "student1" "table_row"
And I should see "orange" in the "student2" "table_row"
And I turn editing mode on
@@ -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 a user above to view all their grades" singleselect
@@ -93,10 +90,7 @@ Feature: We can use Single view
And the following should exist in the "generaltable" table:
| First name (Alternate name) Last name | 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 a user above to view all their grades" 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."
+1
View File
@@ -364,6 +364,7 @@ class behat_grade extends behat_base {
*/
public function i_navigate_to_export_page_in_the_course_gradebook($gradeexportoption) {
$this->i_navigate_to_in_the_course_gradebook("More > Export");
$this->wait_for_pending_js();
$this->select_in_gradebook_navigation_selector($gradeexportoption, 'gradesexportactionselect');
}
+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
+16 -28
View File
@@ -36,23 +36,20 @@ Feature: We can use calculated grade totals
| assign | C1 | a8 | Test assignment eight | Submit something! | Sub category 2 & | 20 |
| assign | C1 | a9 | Test assignment nine | Submit something! | Sub category 2 & | 10 |
| assign | C1 | 10 | Test assignment ten | Submit nothing! | Sub category 2 & | 15 |
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 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 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":
@@ -262,22 +259,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 |
@@ -306,8 +297,8 @@ Feature: We can use calculated grade totals
| Include outcomes in aggregation | 1 |
| Exclude empty grades | 0 |
And I set the following settings for grade item "Test outcome item one":
| Weight adjusted | 1 |
| aggregationcoef2 | 100 |
| Weight adjusted | 1 |
| aggregationcoef2 | 100 |
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"
@@ -377,10 +368,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 |
@@ -34,8 +34,7 @@ Feature: Changing the aggregation of an item affects its weight and extra credit
And I change window size to "large"
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
@@ -29,10 +29,7 @@ Feature: We can understand the gradebook user report
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 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 "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"
@@ -19,38 +19,18 @@ Feature: Editing a grade item
And I log in as "admin"
And the "multilang" filter is "on"
And the "multilang" filter applies to "content and headings"
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 | <span lang="en" class="multilang">EN</span><span lang="fr" class="multilang">FR</span> ABCDEF |
| Scale | F,E,D,C,B,A |
And I press "Save changes"
And I press "Add a new scale"
And I set the following fields to these values:
| 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 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 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 |
| Aggregation | Highest grade |
And I press "Save changes"
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> Item 1 |
| Grade category | EN Cat 1 |
And I press "Save changes"
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> Item 2 |
| Grade category | EN Cat 1 |
And I press "Save changes"
And the following "scales" exist:
| name | scale |
| <span lang="en" class="multilang">EN</span><span lang="fr" class="multilang">FR</span> ABCDEF | F,E,D,C,B,A |
| <span lang="en" class="multilang">EN</span><span lang="fr" class="multilang">FR</span> Letter scale | Disappointing, Good, Very good, Excellent |
And the following "grade categories" exist:
| fullname | course | aggregation |
| <span lang="en" class="multilang">EN</span><span lang="fr" class="multilang">FR</span> Cat 1 | C1 | 6 |
And the following "grade items" exist:
| itemname | course | category |
| <span lang="en" class="multilang">EN</span><span lang="fr" class="multilang">FR</span> Item 1 | C1 | <span lang="en" class="multilang">EN</span><span lang="fr" class="multilang">FR</span> Cat 1 |
| <span lang="en" class="multilang">EN</span><span lang="fr" class="multilang">FR</span> Item 2 | C1 | <span lang="en" class="multilang">EN</span><span lang="fr" class="multilang">FR</span> Cat 1 |
And I am on the "Course 1" "grades > gradebook setup" page logged in as "admin"
Scenario: Being able to change the grade type, scale and maximum grade for a grade category when there are no overridden grades
When I click on "Edit settings" "link" in the "EN Cat 1" "table_row"
@@ -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
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 "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
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 / Last name | 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 / Last name | 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 "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 "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 -1
View File
@@ -74,7 +74,7 @@ $string['pathserrcreatedataroot'] = 'مجلد البيانات ({$a->dataroot})
$string['pathshead'] = 'تأكيد المسارات';
$string['pathsrodataroot'] = 'مجلد البيانات الرئيسي غير قابل للكتابة.';
$string['pathsroparentdataroot'] = 'المجلد ذي الرتبة الأعلى ({$a->parent}) غير قابل للكتابة. مجلد البيانات ({$a->dataroot}) لا يمكن إنشاؤه من قِبَل برنامج التنصيب.';
$string['pathssubadmindir'] = 'القليل جداً من مستضيفي الويب يستعمل /admin بمثابة رابط للوصول إلى دفة القيادة أو ما سواها. لسوء الحظ هذا يتعارض مع الموضع القياسي لصفحات إدارة مودل. يمكنك حل هذه المشكلة عبر إعادة تسمية مجلد الإدارة admin في نسختك من هذا التنصيب، لتضع هذا الاسم الجديد هنا. مثلاً: <em>moodleadmin</em>. هذا من شأنه إصلاح روابط الإدارة في مودل.';
$string['pathssubadmindir'] = 'القليل جداً من مستضيفي الويب يستعمل /admin بمثابة رابط للوصول إلى لوحة التحكم أو ما سواها. لسوء الحظ هذا يتعارض مع الموضع القياسي لصفحات إدارة مودل. يمكنك حل هذه المشكلة عبر إعادة تسمية مجلد الإدارة admin في نسختك من هذا التنصيب، لتضع هذا الاسم الجديد هنا. مثلاً: <em>moodleadmin</em>. هذا من شأنه إصلاح روابط الإدارة في مودل.';
$string['pathssubdataroot'] = '<p>المجلد الذي يخزن فيه مودل كل المحتوى من الملفات التي يرفعها المستخدمون.</p>
<p>هذا المجلد ينبغي أن يكون قابلاً للقراءة والكتابة من قبل مستخدم مخدم الويب (عادة هو \'www-data\'، \'nobody\'، أو \'apache\').</p>
<p>ينبغي أن لا يكون متاحاً للوصول المباشر عبر الويب.</p>
+1 -1
View File
@@ -86,6 +86,6 @@ $string['welcomep20'] = 'Vous voyez cette page, car vous avez installé Moodle c
$string['welcomep30'] = 'Cette version de <b>{$a->installername}</b> comprend des logiciels qui créent un environnement dans lequel <b>Moodle</b> va fonctionner, à savoir :';
$string['welcomep40'] = 'Ce paquet contient également <b>Moodle {$a->moodlerelease} ({$a->moodleversion})</b>.';
$string['welcomep50'] = 'L\'utilisation de tous les logiciels de ce paquetage est soumis à l\'acceptation de leurs licences respectives. Le paquetage complet <strong>{$a->installername}</strong> est un <a href="https://www.opensource.org/docs/definition_plain.html">logiciel libre</a>. Il est distribué sous licence <a href="https://www.gnu.org/copyleft/gpl.html">GPL</a>.';
$string['welcomep60'] = 'Les pages suivantes vous aideront pas à pas à configurer et mettre en place <strong>Moodle</strong> sur votre ordinateur. Il vous sera possible d\'accepter les réglages par défaut ou, facultativement, de les adapter à vos propres besoins.';
$string['welcomep60'] = 'Les pages suivantes vous aideront pas à pas à configurer et installer <strong>Moodle</strong> sur votre ordinateur. Il vous sera possible d\'accepter les réglages par défaut ou, facultativement, de les adapter à vos propres besoins.';
$string['welcomep70'] = 'Cliquer sur le bouton « Suivant » ci-dessous pour continuer l\'installation de <b>Moodle</b>.';
$string['wwwroot'] = 'Adresse web';
+1 -1
View File
@@ -32,7 +32,7 @@ defined('MOODLE_INTERNAL') || die();
$string['admindirname'] = 'Adminmappe';
$string['availablelangs'] = 'Tilgjengelige språkpakker';
$string['chooselanguagehead'] = 'Velg et språk';
$string['chooselanguagesub'] = 'Velg et språk for installasjonen. Dette språket vil også bli brukt som standardspråk for nettstedet, men det kan endres senere.';
$string['chooselanguagesub'] = 'Velg et språk for installasjonen. Dette språket vil også bli brukt som standardspråk for portalen, men det kan endres senere.';
$string['clialreadyconfigured'] = 'Konfigurasjonsfilen config.php finnes allerede. Vennligst bruk admin/cli/install_database.php hvis du vil installere Moodle på denne portalen.';
$string['clialreadyinstalled'] = 'Filen config.php eksisterer allerede. Vennligst bruk admin/cli/install_database.php hvis du vil oppgradere Moodle på denne portalen.';
$string['cliinstallheader'] = 'Moodle {$a} kommandolinje installasjonsprogram';
+1
View File
@@ -461,6 +461,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';
+1 -1
View File
@@ -5,6 +5,6 @@
* @copyright 2016 Ryan Wyllie <ryan@moodle.com>
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
define("core/modal_factory",["jquery","core/modal_events","core/modal_registry","core/modal","core/modal_save_cancel","core/modal_cancel","core/local/modal/alert","core/templates","core/notification","core/custom_interaction_events","core/pending"],(function($,ModalEvents,ModalRegistry,Modal,ModalSaveCancel,ModalCancel,ModalAlert,Templates,Notification,CustomEvents,Pending){var TEMPLATES_DEFAULT="core/modal",TEMPLATES_SAVE_CANCEL="core/modal_save_cancel",TEMPLATES_CANCEL="core/modal_cancel",TEMPLATES_ALERT="core/local/modal/alert",TYPES={DEFAULT:"DEFAULT",SAVE_CANCEL:"SAVE_CANCEL",CANCEL:"CANCEL",ALERT:"ALERT"};ModalRegistry.register(TYPES.DEFAULT,Modal,TEMPLATES_DEFAULT),ModalRegistry.register(TYPES.SAVE_CANCEL,ModalSaveCancel,TEMPLATES_SAVE_CANCEL),ModalRegistry.register(TYPES.CANCEL,ModalCancel,TEMPLATES_CANCEL),ModalRegistry.register(TYPES.ALERT,ModalAlert,TEMPLATES_ALERT);var createFromType=function(registryConf,templateContext){var templateName=registryConf.template,modalPromise=Templates.render(templateName,templateContext).then((function(html){var modalElement=$(html);return function(registryConf,modalElement){return modalElement=$(modalElement),new(0,registryConf.module)(modalElement)}(registryConf,modalElement)})).fail(Notification.exception);return modalPromise};return{create:function(modalConfig,triggerElement){var registryConf,type=modalConfig.type||TYPES.DEFAULT,isLarge=!!modalConfig.large,isScrollable=!modalConfig.hasOwnProperty("scrollable")||modalConfig.scrollable,templateContext={};(registryConf=ModalRegistry.get(type))||Notification.exception({message:"Unable to find modal of type: "+type}),void 0!==modalConfig.templateContext&&(templateContext=modalConfig.templateContext);var modalPromise=createFromType(registryConf,templateContext).then((function(modal){return void 0!==modalConfig.title&&modal.setTitle(modalConfig.title),void 0!==modalConfig.body&&modal.setBody(modalConfig.body),void 0!==modalConfig.footer&&modal.setFooter(modalConfig.footer),modalConfig.buttons&&Object.entries(modalConfig.buttons).forEach((function(_ref){let[key,value]=_ref;modal.setButtonText(key,value)})),isLarge&&modal.setLarge(),void 0!==modalConfig.removeOnClose&&modal.setRemoveOnClose(modalConfig.removeOnClose),modal.setScrollable(isScrollable),modal}));return void 0!==triggerElement&&function(modalPromise,triggerElement,modalConfig){var actualTriggerElement=null,hasPreShowCallback="function"==typeof modalConfig.preShowCallback,triggeredCallback=function(e,data){var pendingPromise=new Pending("core/modal_factory:setUpTrigger:triggeredCallback");actualTriggerElement=$(e.currentTarget),modalPromise.then((function(modal){return hasPreShowCallback&&modalConfig.preShowCallback(actualTriggerElement,modal),modal.show(),modal})).then(pendingPromise.resolve),data.originalEvent.preventDefault()};if(Array.isArray(triggerElement)){var selector=triggerElement[1];triggerElement=triggerElement[0],CustomEvents.define(triggerElement,[CustomEvents.events.activate]),triggerElement.on(CustomEvents.events.activate,selector,triggeredCallback)}else CustomEvents.define(triggerElement,[CustomEvents.events.activate]),triggerElement.on(CustomEvents.events.activate,triggeredCallback);modalPromise.then((function(modal){return modal.getRoot().on(ModalEvents.hidden,(function(){null!==actualTriggerElement&&actualTriggerElement.focus()})),modal}))}(modalPromise,triggerElement,modalConfig),modalPromise},types:TYPES}}));
define("core/modal_factory",["jquery","core/modal_events","core/modal_registry","core/modal","core/modal_save_cancel","core/modal_cancel","core/local/modal/alert","core/templates","core/notification","core/custom_interaction_events","core/pending"],(function($,ModalEvents,ModalRegistry,Modal,ModalSaveCancel,ModalCancel,ModalAlert,Templates,Notification,CustomEvents,Pending){var TEMPLATES_DEFAULT="core/modal",TEMPLATES_SAVE_CANCEL="core/modal_save_cancel",TEMPLATES_CANCEL="core/modal_cancel",TEMPLATES_ALERT="core/local/modal/alert",TYPES={DEFAULT:"DEFAULT",SAVE_CANCEL:"SAVE_CANCEL",CANCEL:"CANCEL",ALERT:"ALERT"};ModalRegistry.register(TYPES.DEFAULT,Modal,TEMPLATES_DEFAULT),ModalRegistry.register(TYPES.SAVE_CANCEL,ModalSaveCancel,TEMPLATES_SAVE_CANCEL),ModalRegistry.register(TYPES.CANCEL,ModalCancel,TEMPLATES_CANCEL),ModalRegistry.register(TYPES.ALERT,ModalAlert,TEMPLATES_ALERT);var createFromType=function(registryConf,templateContext){var templateName=registryConf.template,modalPromise=Templates.render(templateName,templateContext).then((function(html){var modalElement=$(html);return function(registryConf,modalElement){return modalElement=$(modalElement),new(0,registryConf.module)(modalElement)}(registryConf,modalElement)})).fail(Notification.exception);return modalPromise};return{create:function(modalConfig,triggerElement){var registryConf,type=modalConfig.type||TYPES.DEFAULT,isLarge=!!modalConfig.large,isScrollable=!modalConfig.hasOwnProperty("scrollable")||modalConfig.scrollable,templateContext={};(registryConf=ModalRegistry.get(type))||Notification.exception({message:"Unable to find modal of type: "+type}),void 0!==modalConfig.templateContext&&(templateContext=modalConfig.templateContext);var pendingModalPromise=new Pending("core/modal_factory:create"),modalPromise=createFromType(registryConf,templateContext).then((function(modal){return void 0!==modalConfig.title&&modal.setTitle(modalConfig.title),void 0!==modalConfig.body&&modal.setBody(modalConfig.body),void 0!==modalConfig.footer&&modal.setFooter(modalConfig.footer),modalConfig.buttons&&Object.entries(modalConfig.buttons).forEach((function(_ref){let[key,value]=_ref;modal.setButtonText(key,value)})),isLarge&&modal.setLarge(),void 0!==modalConfig.removeOnClose&&modal.setRemoveOnClose(modalConfig.removeOnClose),modal.setScrollable(isScrollable),pendingModalPromise.resolve(),modal}));return void 0!==triggerElement&&function(modalPromise,triggerElement,modalConfig){var actualTriggerElement=null,hasPreShowCallback="function"==typeof modalConfig.preShowCallback,triggeredCallback=function(e,data){var pendingPromise=new Pending("core/modal_factory:setUpTrigger:triggeredCallback");actualTriggerElement=$(e.currentTarget),modalPromise.then((function(modal){return hasPreShowCallback&&modalConfig.preShowCallback(actualTriggerElement,modal),modal.show(),modal})).then(pendingPromise.resolve),data.originalEvent.preventDefault()};if(Array.isArray(triggerElement)){var selector=triggerElement[1];triggerElement=triggerElement[0],CustomEvents.define(triggerElement,[CustomEvents.events.activate]),triggerElement.on(CustomEvents.events.activate,selector,triggeredCallback)}else CustomEvents.define(triggerElement,[CustomEvents.events.activate]),triggerElement.on(CustomEvents.events.activate,triggeredCallback);modalPromise.then((function(modal){return modal.getRoot().on(ModalEvents.hidden,(function(){null!==actualTriggerElement&&actualTriggerElement.focus()})),modal}))}(modalPromise,triggerElement,modalConfig),modalPromise},types:TYPES}}));
//# sourceMappingURL=modal_factory.min.js.map
File diff suppressed because one or more lines are too long
+2 -1
View File
@@ -187,6 +187,7 @@ define(['jquery', 'core/modal_events', 'core/modal_registry', 'core/modal',
templateContext = modalConfig.templateContext;
}
var pendingModalPromise = new Pending('core/modal_factory:create');
var modalPromise = createFromType(registryConf, templateContext)
.then(function(modal) {
if (typeof modalConfig.title != 'undefined') {
@@ -217,7 +218,7 @@ define(['jquery', 'core/modal_events', 'core/modal_registry', 'core/modal',
}
modal.setScrollable(isScrollable);
pendingModalPromise.resolve();
return modal;
});
+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
@@ -1754,9 +1754,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) {
@@ -1799,6 +1801,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
@@ -10493,52 +10493,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
@@ -2280,4 +2280,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 -3
View File
@@ -23,9 +23,7 @@ Feature: Turn editing mode on
Given the following "activities" exist:
| activity | course | idnumber | name | intro |
| assign | C1 | assign1 | Test Assignment 1 | Test Assignment 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 am on the "Course 1" "grades > Grader report > View" page logged in as "teacher1"
And I turn editing mode on
And "Edit assign Test Assignment 1" "link" should exist
And I turn editing mode off

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