Compare commits

...

221 Commits

Author SHA1 Message Date
Eloy Lafuente (stronk7) 07f6358b03 Moodle release 3.2.1 2017-01-08 11:04:37 +01:00
AMOS bot 7ffb98d0f5 Automatically generated installer lang files 2017-01-08 00:04:57 +08:00
Dan Poltawski dda99bb3f2 weekly release 3.2+ 2017-01-06 01:30:59 +00:00
Dan Poltawski 9cff26295b Merge branch 'install_32_STABLE' of https://git.in.moodle.com/amosbot/moodle-install into MOODLE_32_STABLE 2017-01-06 01:30:57 +00:00
David Mudrák 5865a6875b MDL-57580 mod_assign: Fix the incorrect type of some input parameters
The PARAM_TEXT has been misused in certain cases here. The 'action'
parameter seems to always be alphabetic, with values like
savesubmission, editsubmission and others as handled in assign::view().

Fixing the action handling fixes the reported XSS issue. While working
on it, I spotted two more places where PARAM_TEXT does not seem
appropriate. I include changes for them too, even if they are no
strictly related to the reported bug and there are no known ways to
abuse it.

* The 'plugin' looks like PARAM_PLUGIN and is even declared as such in
  some other parts of the assignment code (such as feedback forms).

* The 'workflowstate' is one of the ASSIGN_MARKING_WORKFLOW_STATE
  constants and is supposed to be alpha in external function input
  parameters handling, too.
2017-01-05 17:39:51 +01:00
Dan Poltawski ef2eed1b3c Merge branch 'MDL-57563-32-enfix' of git://github.com/mudrd8mz/moodle into MOODLE_32_STABLE 2017-01-05 10:11:40 +00:00
Rajesh Taneja 6601017d02 MDL-57531 behat: Set noreplyaddress to valid address
noreplyaddress should be a valid address, else
it will not be saved. For behat we don't send
email, so set it to noreply@example.com, to
avoid failing validation on localhost
2017-01-05 06:52:06 +00:00
David Mudrák 7ed6f330c6 MDL-57563 lang: Use the new newsitemsnumber wording in behat 2017-01-04 22:19:32 +01:00
Helen Foster 418d01aaf4 MDL-57563 lang: Merge English strings from the en_fix language pack 2017-01-04 22:18:31 +01:00
AMOS bot 11f9ff55e1 Automatically generated installer lang files 2017-01-05 00:05:20 +08:00
Dan Poltawski 04d4796089 Merge branch 'MDL-57531-32-phpmailer' of git://github.com/mudrd8mz/moodle into MOODLE_32_STABLE 2017-01-04 13:28:39 +00:00
David Mudrák e889aee562 MDL-57531 mail: Validate the sender's email address
The patch adds validation for the noreplyaddress setting variable, for
the explicit $replyto parameter and for the sender's email. In case of
misconfigured noreplyaddress setting, it falls back to the default
noreply address value. In case of invalid email in the user's record,
the email is not sent.

The patch also adds unit test for the value returned by the function
generate_email_processing_address() so that it can be considered as a
valid email, too.

This is supposed to significantly minimise the risk of exploiting the
vulnerability in PHPMailer's Sender field.
2017-01-04 12:37:36 +01:00
David Mudrák 228157ebf5 MDL-57531 mail: Do not let admins set invalid email addresses
The noreply and support emails should always be valid.
2017-01-04 12:37:36 +01:00
Eloy Lafuente (stronk7) c77ae4e017 Merge branch 'MDL-57192-32' of git://github.com/ankitagarwal/moodle into MOODLE_32_STABLE 2017-01-04 11:34:23 +00:00
David Mudrák 1da3022e50 MDL-56225 mod_forum: Fix inability to edit attachments
The 'attachments' is not a real DB field here. It comes from the form's
filepicker and holds the id of the attachments filearea. The function
forum_add_attachment() expects it as a property of the first argument.

There were two possible approaches here. Either to pass the raw $newpost
to forum_add_attachment(), or add the attachments into the list
modifiable fields. The second approach is safer.
2017-01-04 11:34:22 +00:00
David Monllao f6507b8e35 Merge branch 'm32_MDL-49557' of git://github.com/danmarsden/moodle into MOODLE_32_STABLE 2017-01-04 11:34:22 +00:00
David Monllao d52b937932 MDL-57338 templates: Fix modal_cancel template name 2017-01-04 11:34:21 +00:00
Rajesh Taneja ce36e3626f MDL-57536 availability: Fixed css for clean theme 2017-01-04 11:34:21 +00:00
Ankit Agarwal 063f7c198b MDL-56992 core_scss: Don't allow invalid files to be included
We allow only .scss files so allow files to be included only and only if they end in .scss and they exist on server under theme directory.
2017-01-04 11:34:20 +00:00
Andrew Nicols 83dedbcd33 MDL-56225 mod_forum: Remove unnecessary attributes from update 2017-01-04 11:34:20 +00:00
Dan Marsden 0ad466926d MDL-49557 mod_scorm: optionally strip quotes. 2017-01-04 15:45:08 +13:00
Ankit Agarwal ced9a33352 MDL-57192 dml: Temporarily disable query logging during setup 2017-01-03 17:27:08 +05:30
Ankit Agarwal 3b4fba5588 MDL-57192 dml: Support temporarily disabling query logs during setup 2017-01-03 17:27:08 +05:30
Eloy Lafuente (stronk7) 9cc9dabf17 Merge branch 'wip-mdl-57494-m32' of https://github.com/rajeshtaneja/moodle into MOODLE_32_STABLE 2017-01-03 02:35:10 +01:00
Eloy Lafuente (stronk7) cb8be0b6b8 Merge branch 'MDL-57536-32' of git://github.com/jleyva/moodle into MOODLE_32_STABLE 2017-01-02 18:59:55 +01:00
Juan Leyva c6bd4c1a45 MDL-57536 availability: Document required selectors changes
MDL-55839 Introduced some changes in CSS selectors used by the form.js
file.

This caused contributed plugins to not work (javascript stop working)
when editing a module.
2017-01-02 18:52:22 +01:00
Davo Smith 31e4c05002 MDL-47198 filelib: fix curl handling headers with no value 2017-01-02 16:43:52 +01:00
Dan Poltawski c5f11c0f3c Merge branch 'm32_MDL-49557' of git://github.com/danmarsden/moodle into MOODLE_32_STABLE 2017-01-02 12:35:10 +00:00
Dan Poltawski 6158379f75 Merge branch 'MDL-57080-m32' of https://github.com/micaherne/moodle into MOODLE_32_STABLE 2017-01-02 12:15:02 +00:00
Dan Poltawski bc076bf1b8 Merge branch 'wip-MDL-57464-32' of git://github.com/abgreeve/moodle into MOODLE_32_STABLE 2017-01-02 11:16:24 +00:00
Dan Poltawski 27a3a42efd MDL-57532 calendar: tidy up button grouping 2017-01-02 10:45:24 +00:00
Dan Poltawski b0c2ea4640 Merge branch 'MDL-57532_m32v1' of https://github.com/sbourget/moodle into MOODLE_32_STABLE 2017-01-02 10:45:20 +00:00
David Monllao 00ef7b1caa Merge branch 'MDL-56926_32' of git://github.com/dmonllao/moodle into MOODLE_32_STABLE 2016-12-30 10:00:08 +01:00
David Monllao 7914b0035f MDL-56926 theme_boost: Restore filepicker's filename and icons original spacing 2016-12-30 09:57:41 +01:00
Nadav Kavalerchik cb358279b7 MDL-56926 Theme/Boost: Fix filepicker folder tree YUI guides 2016-12-30 09:57:35 +01:00
AMOS bot 339edb47e2 Automatically generated installer lang files 2016-12-30 00:05:21 +08:00
Dan Poltawski bd6bc508df Merge branch 'MDL-57512-32' of git://github.com/crazyserver/moodle into MOODLE_32_STABLE 2016-12-29 11:50:58 +00:00
Dan Poltawski c53194f3f9 Merge branch 'm32_MDL-50643' of git://github.com/danmarsden/moodle into MOODLE_32_STABLE 2016-12-29 11:46:48 +00:00
Pau Ferrer Ocaña c477dc23c0 MDL-57512 categories: Use maxcategorydepth only when getting all cats 2016-12-29 12:05:27 +01:00
David Monllao 8cd421e941 Merge branch 'MDL-57338-32' of git://github.com/danpoltawski/moodle into MOODLE_32_STABLE 2016-12-29 10:52:30 +01:00
Dan Poltawski f18c2a9d15 MDL-57338 templates: fix missing example variables
From Davids review, thanks
2016-12-29 08:05:04 +00:00
David Monllao 403e0d96e5 Merge branch 'MDL-57331-32' of https://github.com/xow/moodle into MOODLE_32_STABLE 2016-12-28 22:32:33 +01:00
Dan Poltawski 5984ffded4 Merge branch 'MDL-57451-32' of https://github.com/lucisgit/moodle into MOODLE_32_STABLE 2016-12-28 21:17:48 +00:00
Dan Poltawski cd9a925e6a Merge branch 'MDL-55955_32' of git://github.com/markn86/moodle into MOODLE_32_STABLE 2016-12-28 21:17:47 +00:00
Dan Poltawski 40471ed54c Merge branch 'wip-MDL-57366-32' of git://github.com/abgreeve/moodle into MOODLE_32_STABLE 2016-12-28 21:17:46 +00:00
David Monllao 000b0949e6 Merge branch 'MDL-57491_m32v3' of https://github.com/sbourget/moodle into MOODLE_32_STABLE 2016-12-28 21:17:46 +00:00
Dan Poltawski 6c7f60dbc0 Merge branch 'MDL-57417-32' of https://github.com/snake/moodle into MOODLE_32_STABLE 2016-12-28 21:17:45 +00:00
David Monllao 3b37e372f2 Merge branch 'MDL-52366-32-mustachethemedir' of git://github.com/mudrd8mz/moodle into MOODLE_32_STABLE 2016-12-28 12:23:49 +01:00
David Monllao 44b94d9324 Merge branch 'MDL-57450-32' of git://github.com/danpoltawski/moodle into MOODLE_32_STABLE 2016-12-28 11:48:05 +01:00
Dan Poltawski e5bc84f84f MDL-57251 upgrade: bump versions
and remove uncessary ->mark_dirty()
2016-12-28 10:28:37 +00:00
Dan Poltawski a38d0650d4 Merge branch 'wip-MDL-57251-32' of git://github.com/abgreeve/moodle into MOODLE_32_STABLE 2016-12-28 10:28:31 +00:00
David Monllao 8d9edc0e7c Merge branch 'MDL-57357-32' of https://github.com/snake/moodle into MOODLE_32_STABLE 2016-12-28 11:17:11 +01:00
David Monllao 4e0357c1e3 Merge branch 'MDL-56488-32' of git://github.com/danpoltawski/moodle into MOODLE_32_STABLE 2016-12-28 10:58:22 +01:00
Dan Poltawski 9efd73abec Merge branch 'wip-MDL-57292-32' of git://github.com/abgreeve/moodle into MOODLE_32_STABLE 2016-12-28 09:13:37 +00:00
Dan Poltawski c31b5bbf9d Merge branch 'MDL-57474-32-messageid' of git://github.com/mudrd8mz/moodle into MOODLE_32_STABLE 2016-12-28 08:56:06 +00:00
Dan Marsden 7606ba2133 MDL-49557 mod_scorm: fix AICC pre-requisite handling. 2016-12-28 10:09:00 +13:00
Stephen Bourget 51b7f8f0a4 MDL-57532 calendar: Add missing bootstrap classes 2016-12-26 11:41:50 -05:00
AMOS bot 40fdf0f84f Automatically generated installer lang files 2016-12-27 00:08:58 +08:00
AMOS bot 3e99f4f642 Automatically generated installer lang files 2016-12-26 00:05:52 +08:00
AMOS bot 324e613b48 Automatically generated installer lang files 2016-12-25 00:04:37 +08:00
Adrian Greeve 502397dcbc MDL-57464 mod_lesson: fix notice with sub-clusters. 2016-12-23 11:12:27 +08:00
Jake Dallimore f1f83c3ba1 MDL-57357 auth: add behat coverage for remember username login feature 2016-12-23 11:04:19 +08:00
Jake Dallimore 2c3f09ccf7 MDL-57357 auth: fix the remember username feature on login page 2016-12-23 10:45:06 +08:00
Adrian Greeve e2f5592b8f MDL-57366 mod_lesson: Zero now acceptable numeric answer.
When creating a numerical question. If the answer to the
question is 0 then the answer will not save.
2016-12-23 10:36:12 +08:00
Mark Nelson 522fcf2ffc MDL-55955 mod_quiz: ensure duplicated override events are removed 2016-12-23 10:02:47 +08:00
Jake Dallimore 96e743ff78 MDL-57417 navigation: fix legacy_activity_onclick_handler callback scope 2016-12-23 08:43:37 +08:00
Dan Marsden e514ae345e MDL-50643 mod_scorm: redirect using current window instead of parent. 2016-12-23 10:18:52 +13:00
Stephen Bourget 2659b808ab MDL-57491 report_log: Improve filtering code by using static entries 2016-12-22 16:12:34 -05:00
AMOS bot 54037cf3e2 Automatically generated installer lang files 2016-12-23 00:04:18 +08:00
Dan Poltawski b0773d70c6 MDL-57338 message: fix template component 2016-12-22 12:57:11 +00:00
Dan Poltawski 4348fffe0c MDL-57338 templates: add missing example context 2016-12-22 12:57:11 +00:00
Dan Poltawski 216c68b834 MDL-57338 chart: add example context
And fix aria roles
2016-12-22 12:57:11 +00:00
Dan Poltawski a3c1bd86ed MDL-57338 mustache: fix admin_setting_tabs
* Add example context
* Fix validation issue (need role="tablist" to contain the tabs)
2016-12-22 12:57:11 +00:00
Michael Aherne e0006399ff MDL-57080 completion: Update completion expected date on reset 2016-12-22 11:43:39 +00:00
Tony Butler 2084c59b82 MDL-57451 theme_boost: Add checkboxgroup class to checkbox input element 2016-12-22 11:30:24 +00:00
Dan Poltawski a09a9879e5 weekly release 3.2+ 2016-12-22 08:15:17 +00:00
Dan Poltawski a3a095b6eb Merge branch 'install_32_STABLE' of https://git.in.moodle.com/amosbot/moodle-install into MOODLE_32_STABLE 2016-12-22 08:15:15 +00:00
Adrian Greeve 0edf724367 MDL-57292 tool_lpimportcsv: Fix for unit tests. 2016-12-22 14:41:32 +08:00
Simey Lameze a953ac5942 MDL-57292 tool_lpimportcsv: display progress bar for large imports 2016-12-22 14:41:17 +08:00
Rajesh Taneja 5627b0b1a1 MDL-57494 behat: Fixed tags and removed reset in after_scenario
1. Added missing switch_window tags
2. Fixed switch_frame tags to use switch_iframe
3. Removed reset from after_scenario.
2016-12-22 12:44:38 +08:00
David Monllao 5d3a7be453 Merge branch 'MDL-55575_B_32' of https://github.com/bostelm/moodle into MOODLE_32_STABLE 2016-12-21 05:50:17 +01:00
David Mudrák 8f27fdf1ab MDL-57474 mailer: Make sure that our exlicit MessageID is trimmed
The new version of phpmailer shipped with Moodle 3.2 has added check
that the explicitly provided MessageID matches /^<.*@.*>$/.

Values coming from our overridden moodle_phpmailer::addCustomHeader()
had a whitespace at the start. So the requested value was not used as
the Message-ID header and the default phpmailer value was used.

As a result, forum posts threading was broken in email clients.
2016-12-21 01:11:32 +01:00
AMOS bot 1d5c2c6560 Automatically generated installer lang files 2016-12-21 00:04:00 +08:00
Simey Lameze 18317c7c1c MDL-57114 filemanager: apply btn-sm class to buttons
This commit also creates a new css rule to fix the file picker icons misalignment.
2016-12-20 10:34:08 +00:00
Dan Poltawski b83fd5b1fe Merge branch 'MDL-54996_m32v1' of https://github.com/sbourget/moodle into MOODLE_32_STABLE 2016-12-20 09:19:27 +00:00
Adrian Greeve 11eeb2e347 MDL-57251 navigation: Correct permission shows site admin
If the user does not have the moodle/site:configview
capability then do not show them the site administration
link.
2016-12-20 14:54:34 +08:00
Adrian Greeve 0aa8b11f5c MDL-57251 administration: Updated coursecreator role.
The coursecreator role now has the moodle/site:configview
capability so that they have access to the required admin
pages.
2016-12-20 14:54:34 +08:00
John Okely 829cafc050 MDL-57331 messaging: Fix sent messages appearing twice. 2016-12-20 10:48:01 +08:00
John Okely 25474b5e84 MDL-57268 auth_db: Unit tests for deletion from a large user set 2016-12-20 02:27:05 +01:00
Rafal Domagalski b7f902b5b3 MDL-52366 themes: check for templates in themedir 2016-12-19 18:08:37 +01:00
Dan Poltawski 11488775eb Merge branch 'MDL-57386-32' of git://github.com/damyon/moodle into MOODLE_32_STABLE 2016-12-19 15:46:59 +00:00
Dan Poltawski 32ec7e3d30 Merge branch 'MDL-55568_m32v2' of https://github.com/sbourget/moodle into MOODLE_32_STABLE 2016-12-19 14:33:06 +00:00
Dan Poltawski 1a1eef4345 Merge branch 'wip-MDL-56912-32' of git://github.com/marinaglancy/moodle into MOODLE_32_STABLE 2016-12-19 12:21:23 +00:00
Eloy Lafuente (stronk7) 4942dfc7cd Merge branch 'MDL-57270_32' of git://github.com/markn86/moodle into MOODLE_32_STABLE 2016-12-19 13:04:25 +01:00
Eloy Lafuente (stronk7) d469fb2181 Merge branch 'MDL-57293-32' of git://github.com/danpoltawski/moodle into MOODLE_32_STABLE 2016-12-19 13:02:16 +01:00
Dan Poltawski 0213ce081c Merge branch 'MDL-52098_32_STABLE' of git://github.com/Chocolate-lightning/moodle into MOODLE_32_STABLE 2016-12-19 11:25:49 +00:00
David Monllao 70b6a6618a Merge branch 'MDL-57402_32' of git://github.com/timhunt/moodle into MOODLE_32_STABLE 2016-12-19 12:23:45 +01:00
Dan Poltawski 089cf944f3 MDL-57450 enviroment: remove tls library check
Unfortunately it has come to light that the version sniffing is just not
reliable at all, operating system vendors backport security patches to
older versions - so in many cases we reporting a problem which is not a
problem. False positives and the solution to self-compile or something
like php will be causing more harm than good.
2016-12-19 10:53:59 +00:00
Dan Poltawski 68d9adcba8 Merge branch 'MDL-53044-m32' of https://github.com/ak4t0sh/moodle into MOODLE_32_STABLE 2016-12-19 08:47:23 +00:00
Dan Poltawski 32636d1757 Merge branch 'MDL-55715_m32v1' of https://github.com/sbourget/moodle into MOODLE_32_STABLE 2016-12-19 08:35:43 +00:00
Stephen Bourget 48ff43d3bd MDL-54996 Calendar: Fix dates for future multi-day events
Thanks to Martin Cunliffe for providing the fix
2016-12-17 10:53:00 -05:00
Mathew May 725863abe4 MDL-52098 enrol: cohort now looks at instance status 2016-12-16 11:22:06 +13:00
Arnaud Trouve 9de4bbf8a8 MDL-53044 auth : force change on expired password 2016-12-15 15:11:30 +01:00
Dan Poltawski cd7ca81fdd MDL-57293 lang/email: Improve emailvia string
* Strip the https? part of url for existing strings
* Switch the string to (via shortname)
2016-12-15 09:54:34 +00:00
Andrew Nicols 1ca30f2503 weekly release 3.2+ 2016-12-15 11:34:25 +08:00
Andrew Nicols c47a9439d3 Merge branch 'install_32_STABLE' of https://git.in.moodle.com/amosbot/moodle-install into MOODLE_32_STABLE 2016-12-15 11:34:21 +08:00
Damyon Wiese 2ce5b1d637 MDL-57386 blocklib: wrong variable in is_block_present
This isn't reachable code in core moodle, but themes/plugins could call is_block_present to trigger it.
2016-12-15 10:51:31 +08:00
Tim Hunt c4ade76ee5 MDL-57402 quiz editing: fix add heading after remove page break 2016-12-14 16:35:17 +00:00
AMOS bot 62fc665ff6 Automatically generated installer lang files 2016-12-15 00:04:14 +08:00
Dan Poltawski 263865899e MDL-56488 boost: validate scss settings for parsable scss
* Parses the scss and fails validation if a parse error is found

* Does not detect the situation when variables are not present - this
  would involve us parsing the entire tree and would be slow. It could
  also change over time, depending on whats defined in the scss
  from themes.

* Introduces a new admin_setting_scsscode to do this
2016-12-14 11:34:25 +00:00
Mark Nelson f927f3e196 MDL-57270 core_message: trim message before it is sent 2016-12-14 12:19:24 +08:00
Stephen Bourget 70f5e9ba61 MDL-55715 calendar: Only update events from the current subscription
The iCal import should only update calendar events from the current
subscription not any subscription that contains the same event.
2016-12-13 22:06:44 -05:00
Andrew Nicols 3b7bf2cee0 Merge branch 'wip-mdl-57380-m32' of https://github.com/rajeshtaneja/moodle into MOODLE_32_STABLE 2016-12-14 09:56:57 +08:00
Mark Nelson a57a9053d7 MDL-55062 tool_uploaduser: prevent defaults when not selected 2016-12-14 09:49:04 +08:00
Rajesh Taneja 0292245755 MDL-57380 behat: Check for list tags and text
after list tag span can be added on few browsers
like chrome 51.0, so test if text starts with
list tag and contains text
2016-12-14 09:38:35 +08:00
Stephen Bourget dd7aa695b2 MDL-55568 chat: chat_refresh_events should only create published events 2016-12-13 18:53:40 -05:00
Eloy Lafuente (stronk7) 2626dce64c Merge branch 'MDL-55809-32' of https://github.com/xow/moodle into MOODLE_32_STABLE 2016-12-13 20:05:23 +01:00
Dan Poltawski 7e2e135943 Merge branch 'MDL-57125-32' of git://github.com/lameze/moodle into MOODLE_32_STABLE 2016-12-13 16:34:58 +00:00
Matt Davidson cc15b9d46f MDL-56810 unoconv: task fails if user removed
If the user is removed from a course after a submission has been made,
the task will crash and never continue.  This removes submissions from
the cron task if the user isn't enrolled in the course.
2016-12-13 14:56:52 +00:00
Eloy Lafuente (stronk7) ce47bacfe9 Merge branch 'MOODLE_32_STABLE' of https://github.com/fwsl/moodle into MOODLE_32_STABLE 2016-12-13 12:00:58 +01:00
ak4t0sh 7c89091995 MDL-55720 course: fix potential undefined variable and cleaning
This commit replace $e usage by $returnfromfunc.
Indeed $returnfromfunc always exists in the scope and take $e value in case of moodle_exception.

This commit also remove useless $modcontext affectation.
2016-12-13 11:49:32 +01:00
Henning Bostelmann 7766ffc618 MDL-55575 mod_glossary: Allow viewing all entries on one page 2016-12-13 11:46:03 +01:00
Mark Nelson 75efa0860c MDL-57250 core: show admin settings when only one category exists 2016-12-13 10:25:19 +00:00
Dan Poltawski d31412392c Merge branch 'MDL-56859-32' of https://github.com/snake/moodle into MOODLE_32_STABLE 2016-12-13 09:45:19 +00:00
Dan Poltawski da694c75ff Merge branch 'MDL-57074-32' of https://github.com/snake/moodle into MOODLE_32_STABLE 2016-12-13 09:26:08 +00:00
Adrian Greeve 76f5d7b9ab MDL-57216 navigation: Updated parent behat test. 2016-12-13 09:04:40 +00:00
Adrian Greeve e7d8926583 MDL-57216 navigation: Added missing grade overview link.
For theme_boost the grade overview link has been added
to the user profile page.
2016-12-13 09:04:36 +00:00
Dan Poltawski c87f1ac4c7 Merge branch 'MDL-57182-32' of https://github.com/snake/moodle into MOODLE_32_STABLE 2016-12-13 08:47:35 +00:00
Dan Poltawski 75c4f5b0ca Merge branch 'wip-MDL-57257-32' of git://github.com/abgreeve/moodle into MOODLE_32_STABLE 2016-12-13 08:46:03 +00:00
Marina Glancy f7b3774380 MDL-56912 feedback: empty multichoice questions do not submit 2016-12-13 15:01:04 +08:00
Andrew Nicols 78293c74bf Merge branch 'MDL-57213-32-2' of git://github.com/junpataleta/moodle into MOODLE_32_STABLE 2016-12-13 13:06:25 +08:00
Simey Lameze 406fc019c1 MDL-57125 comment: prevent js execution if there are no comments 2016-12-13 11:55:05 +08:00
Jun Pataleta 903cd37434 MDL-57213 navigation: Load all my course categories into navigation tree
* Load all of the relevant course categories of the courses that a user
  is enrolled in.
2016-12-13 11:43:22 +08:00
Nadav Kavalerchik 6fd8b0098a MDL-57056 Theme/Boost: Fix "Skip to" link when Tab key pressed 2016-12-13 10:47:50 +08:00
Jan Dageförde 34954a6050 MDL-57257 lesson: Validate type of numerical answer 2016-12-13 10:34:36 +08:00
Mark Nelson 949d8ae04e MDL-57222 mod_assign: show validation message on visible element 2016-12-13 10:30:38 +08:00
Eloy Lafuente (stronk7) 1c7cbed23c Merge branch 'wip-mdl-57328-m32' of https://github.com/rajeshtaneja/moodle into MOODLE_32_STABLE 2016-12-13 02:30:06 +01:00
Eloy Lafuente (stronk7) 9156498826 Merge branch 'mdl32_MDL-57324' of git://github.com/danmarsden/moodle into MOODLE_32_STABLE 2016-12-13 02:02:02 +01:00
Jake Dallimore 71adc9a9a3 MDL-57182 navigation: fix login failures display in page footer.
A bug introduced with MDL-45893 meant that the failure count was being
reset, causing the footer code to be skipped. This patch fixes that
bug and adds behat tests covering the displayloginfailures feature.
2016-12-13 07:20:58 +08:00
Eloy Lafuente (stronk7) 49612b733f Merge branch 'MDL-57319-32' of git://github.com/danpoltawski/moodle into MOODLE_32_STABLE 2016-12-12 16:23:20 +01:00
Arnaud Trouve bc0721c7d9 MDL-56525 forum: remove targeted user enrolment check
By removing the check on the targeted user's enrolment we allow to show his forum posts even if he is unenrol from a course (obviouly we need to have access to this course to view them)
2016-12-12 14:10:21 +00:00
Ryan Wyllie c5452484ee MDL-55782 groups: wrap long group names (theme: boost)
In the groups UI if a group name is very long it now no longer underlaps
the user column on its right hand side.
2016-12-12 13:19:18 +00:00
= 74eecb6078 MDL-55782 groups: wrap long group names
In the groups UI if a group name is very long it now no longer underlaps the user
column on its right hand side.
2016-12-12 13:19:15 +00:00
Dan Poltawski 725be51c11 Merge branch 'wip-mdl-52796-m32' of https://github.com/rajeshtaneja/moodle into MOODLE_32_STABLE 2016-12-12 13:00:56 +00:00
Philipp Hager d0d8a7f984 MDL-57198 course: add css-classes to restrictbygroup-button 2016-12-12 12:46:52 +00:00
Adrian Greeve 4a50811ae3 MDL-57299 Atto: Theme boost fix for manage files.
Theme boost removed a selector that was being used
to remove used files and so the page wasn't loading
properly.
2016-12-12 12:40:09 +00:00
Dan Poltawski b82ddcbcac Merge branch 'wip-mdl-57325-m32' of https://github.com/rajeshtaneja/moodle into MOODLE_32_STABLE 2016-12-12 12:23:25 +00:00
Dan Poltawski 6e4cc6caf4 Merge branch 'wip-mdl-57314-m32' of https://github.com/rajeshtaneja/moodle into MOODLE_32_STABLE 2016-12-12 12:21:31 +00:00
Dan Poltawski fe8e9b1b4e Merge branch 'wip-mdl-57343-m32' of https://github.com/rajeshtaneja/moodle into MOODLE_32_STABLE 2016-12-12 12:21:13 +00:00
Dan Poltawski 72770e9a60 Merge branch 'MDL-57171-32-2' of git://github.com/junpataleta/moodle into MOODLE_32_STABLE 2016-12-12 10:31:13 +00:00
Dan Poltawski a847efc70b Merge branch 'MDL-56566_32' of https://github.com/bostelm/moodle into MOODLE_32_STABLE 2016-12-12 09:20:13 +00:00
Ilya Tregubov 9e99327888 MDL-55906 table: Update user preferences table when reset preferences 2016-12-12 09:07:30 +00:00
Andrew Nicols 9973eebb91 Merge branch 'MDL-46714-32-nadav' of git://github.com/FMCorz/moodle into MOODLE_32_STABLE 2016-12-12 13:26:58 +08:00
Nadav Kavalerchik a162f636d8 MDL-46714 Calendar: Properly order Date & Time fields in RTL mode 2016-12-12 12:38:45 +08:00
Rajesh Taneja 8ff8d598fe MDL-57343 behat: Ensure we wait enough for page to be fully loaded 2016-12-12 10:38:32 +08:00
Ramindu Deshapriya 8704d2e5fc MDL-52796 behat: Behat feature to test reset wiki page, tags & comments 2016-12-12 10:27:44 +08:00
Bram Tassyns f9dd21a17a MDL-56859 SCORM: player shouldn't display TOC while loading 2016-12-12 09:11:50 +08:00
Jake Dallimore eb349bdfc4 MDL-57074 Filepicker: Fix alias and link icons in RTL mode
Fixed alignment of the images in RTL mode. Also fixed a z-index problem
in which the icons were displayed above the open drawer on narrow
screens.
2016-12-12 08:48:15 +08:00
AMOS bot 89d186af72 Automatically generated installer lang files 2016-12-10 00:04:00 +08:00
Dan Poltawski 65de977483 MDL-57319 outputlib: raise timeout for scss/less compilation 2016-12-09 08:47:05 +00:00
Rajesh Taneja e167481759 MDL-57328 core: Remove xdebug extension, so test run faster 2016-12-09 10:24:01 +08:00
Rajesh Taneja 457c913461 MDL-57325 behat: Fixed backup/restore steps to use proper api 2016-12-09 09:31:13 +08:00
Rajesh Taneja 422449dca8 MDL-57328 core: Run tests with php 7.1 2016-12-09 08:49:21 +08:00
Dan Marsden 53c8f0ca3c MDL-57324 scorm: exclude objective raw.score from grade update 2016-12-09 10:13:20 +13:00
Henning Bostelmann b094b88a9a MDL-56566 mod_assign: ignore "doanything" in course overview
Do not count site admin "doanything" capability for determining
what should be shown in the course overview for assignments.
2016-12-08 20:28:10 +00:00
AMOS bot 49e5d04a8d Merge branch 'MOODLE_32_STABLE' into install_32_STABLE 2016-12-09 00:04:15 +08:00
AMOS bot 38e28dfbcd Automatically generated installer lang files 2016-12-08 18:11:21 +08:00
Dan Poltawski 44047dc78d weekly release 3.2+ 2016-12-08 08:43:05 +00:00
Marina Glancy c06b8145b1 MDL-56614 behat: add missing wait for page is ready 2016-12-08 13:51:53 +08:00
Franziska Hübler 79da2c5bfa MDL-55809 glossary: Keep file author and license across import/export 2016-12-08 12:28:22 +08:00
Andrew Nicols a5800adaf0 Merge branch 'MDL-57278-32-5' of https://github.com/xow/moodle into MOODLE_32_STABLE 2016-12-08 10:53:37 +08:00
John Okely c1c3f50965 MDL-57278 signup: Fix double encoding of confirmation links 2016-12-08 10:17:50 +08:00
John Okely cff14cf0d1 MDL-57278 signup: Unit tests covering confirmation link generation 2016-12-08 10:17:50 +08:00
Rajesh Taneja c95ea731bc MDL-57314 behat: Press enter after setting password unmask 2016-12-08 09:24:37 +08:00
Rajesh Taneja b98f14632b MDL-56642 dataformat: Fixed method_exits parameters 2016-12-08 00:37:03 +01:00
Mark Nelson a1e1b45ae7 MDL-57283 core: fixed function call on null 2016-12-07 10:17:36 +00:00
Kenneth Hendricks 2d44bb544b MDL-56674 core: Fix test_get_all_observers 2016-12-07 08:46:04 +00:00
Marina Glancy c60d333578 MDL-56614 behat: corrections to new steps 2016-12-07 14:58:39 +08:00
Andrew Nicols 182690b018 Merge branch 'wip-mdl-56353-m32' of https://github.com/rajeshtaneja/moodle into MOODLE_32_STABLE 2016-12-07 12:03:36 +08:00
Rajesh Taneja b36b54179d MDL-56353 behat: Added test for multi select dependency 2016-12-07 11:19:01 +08:00
Andrew Nicols fc4b768e25 Merge branch 'wip-MDL-56642-32' of git://github.com/marinaglancy/moodle into MOODLE_32_STABLE 2016-12-07 10:00:59 +08:00
Andrew Nicols 7e0f1972f1 Merge branch 'MDL-57266_32' of git://github.com/stronk7/moodle into MOODLE_32_STABLE 2016-12-07 09:54:33 +08:00
Andrew Nicols 93e64c823c Merge branch 'MDL-56240_32' of git://github.com/stronk7/moodle into MOODLE_32_STABLE 2016-12-07 09:51:07 +08:00
Rajesh Taneja 20d598f094 MDL-56614 behat: Fixed steps to use new definition 2016-12-07 09:43:06 +08:00
Marina Glancy e376549179 MDL-56642 dataformat: set temp dir
Thanks to Chien Wen-Chang for proposing a patch
2016-12-07 09:30:25 +08:00
Rajesh Taneja 163a317bcc MDL-57137 behat: Subcategory has black space before name 2016-12-07 09:13:26 +08:00
Dan Poltawski 7ecf13ac1d Merge branch 'MDL-45873_32' of https://github.com/bostelm/moodle into MOODLE_32_STABLE 2016-12-06 15:56:28 +00:00
Ankit Agarwal 2fbe4fca87 MDL-57284 boost: Fix booktool_print icons 2016-12-06 15:50:57 +00:00
Jun Pataleta d07a8ebd7e MDL-57171 admin: Make environment check table look better
* Use Bootstrap label classes for the text under the status column.
* theme_bootstrapbase:
  - Cleanup unnecessary classes and make .error styles consistent
    with .warn styles
* theme_boost:
  - Set font color appropriate for success, warning and error strings.
* Enclose report text in div so that the feedback texts will be
  displayed right below it.
2016-12-06 22:18:55 +08:00
SSRF d4feb70e17 MDL-53677 tool_spamcleaner: CSRF Fix
Resolves minor CSRF within Moodle spamcleaner.
2016-12-06 12:48:31 +00:00
Dan Poltawski f477809e38 Merge branch 'MDL-56836-32' of https://github.com/snake/moodle into MOODLE_32_STABLE 2016-12-06 12:46:19 +00:00
Daniel Thee Roperto 94caed45db MDL-56233 forms library: Fixed form identifier when mocking a form.
If the plugin is using namespaces instead of frankenstyle class name,
get_called_class() will return 'type\name' instead of 'type_name'.

Added code to replace backslashes to underscores and fix that issue.
2016-12-06 12:42:17 +00:00
Dan Poltawski 8c4fdb1073 MDL-56778 enrol: add note about legacy css 2016-12-06 12:32:30 +00:00
Nadav Kavalerchik e5bbe44230 MDL-56778 Enrollment: Fix enroll users dialog in RTL mode (theme:Boost) 2016-12-06 12:32:23 +00:00
Tim Hunt d0a58fe035 MDL-57199 question preview: make HTML ids unique 2016-12-06 12:25:45 +00:00
Michael Aherne 9c68157292 MDL-56971 enrol: Use autoloading in enrol_get_plugin() 2016-12-06 11:08:17 +00:00
Grzegorz Ziółek 44f71599df MDL-56830 config_log: Add block plugin visibility changes to config_log. 2016-12-06 11:51:48 +01:00
Alexander Melihov 1fac7b914b MDL-57137 quiz: Create question category with specified parent category
Fix question category generator bug. Now it is possible to specify parent category of subcategory, supply only name of parent category
2016-12-06 15:34:13 +08:00
Tony Butler cede73411f MDL-56346 assignfeedback_editpdf: Correct typo in property name 2016-12-06 14:38:01 +08:00
Andrew Nicols 47deb83b5c Merge branch 'MDL-56301-32' of https://github.com/snake/moodle into MOODLE_32_STABLE 2016-12-06 14:27:03 +08:00
Andrew Nicols 4ea56c1c80 Merge branch 'wip-MDL-56614-m32-2' of https://github.com/marinaglancy/moodle into MOODLE_32_STABLE 2016-12-06 13:38:08 +08:00
Marina Glancy 311121b16c MDL-56614 behat: add navigation block when required
Most of these hacks have links to corresponding MDL issues
2016-12-06 13:35:40 +08:00
Marina Glancy 5863f1b073 MDL-56614 behat: rename step for navigating in the gradebook 2016-12-06 13:35:40 +08:00
Marina Glancy 2bb195f64f MDL-56614 behat: navigate without navigation and admin blocks 2016-12-06 13:35:40 +08:00
Marina Glancy f6b50d9901 MDL-56614 block_navigation: Add block in behat tests 2016-12-06 13:35:39 +08:00
Marina Glancy a0b0234a18 MDL-56614 behat: new steps for navigation without blocks 2016-12-06 13:35:39 +08:00
Andrew Nicols f8b8a363ae Merge branch 'MDL-57161-32' of git://github.com/lameze/moodle into MOODLE_32_STABLE 2016-12-06 13:10:40 +08:00
Donald Barrett b197272987 MDL-56301 course: Use value for intro field if set in a mods function
Respects a module that has set a value for the db field intro in it's lib function modulename_add_instance.
2016-12-06 10:40:49 +08:00
Juan Leyva e4976aefc5 MDL-57255 gradereport_user: Fix default value for graderaw
graderaw is a PARAM_FLOAT, the default to empty string was incorrect
2016-12-06 10:18:53 +08:00
David Monllao dcd408b81f MDL-57161 search: Set the correct HTTP header
All credit goes to Test Valley School
2016-12-06 10:00:07 +08:00
Simey Lameze 4a564ca40b MDL-56759 themes: fix badge list alignment issues 2016-12-06 09:24:31 +08:00
Eloy Lafuente (stronk7) 5da06d632a MDL-57266 upgrade: add 3.2.0 separation line to all upgrade scripts 2016-12-05 17:17:54 +01:00
Eloy Lafuente (stronk7) d797e57255 MDL-56240 upgrade: delete incorrect lines, manually added
Note that, with MDL-57266, we are changine the comment to be:

// Automatically generated Moodle v3.2.0 release upgrade line

in order to make to make to make it clearer that it's an
automatic (part of the release process) comment and should not
be added manually ever.
2016-12-05 16:52:31 +01:00
Frederic Massart 55d2042f0a MDL-56459 competency: Invalid use of indirect property key
This change ensures that PHP7 and earlier work the same way. Before
the patch PHP < 7 would not expand the property as we expected it.

More information here:
http://php.net/manual/en/migration70.incompatible.php#migration70.incompatible.variable-handling.indirect
2016-12-05 15:48:47 +00:00
David Mudrák 8cd6972966 MDL-57256 course: Fix display of the Legacy course files link
The patch fixes the classical operator precedence bug.
2016-12-05 15:45:38 +00:00
Henning Bostelmann 9cbc0a0cdb MDL-45873 mode_data: Allow "0" entries in menu field 2016-12-05 09:21:07 +00:00
John Okely 931d12b589 MDL-54921 signup: Only clear wanturl when necessary
Thanks to Juho Jaakkola for original patch idea.
2016-12-05 15:35:25 +08:00
Shamim Rezaie 0beeb95a8a MDL-52840 assignsubmission_file: Change default setting file size
The default value of the assignsubmission_file/maxbytes setting is changed to $CFG->maxbytes.
2016-12-05 13:02:20 +08:00
Mark Nelson 617f8bb911 MDL-57084 core_message: prevent duplication of day separator 2016-12-05 12:28:56 +08:00
Michael Spall 75dd21a002 MDL-56893 grades: Fix edit grade item when grade_report_showmin is false
Check to make sure $data['grademin'] exists. When grade_report_showmin
is false $data['grademin'] doesn't exist.
2016-12-05 12:05:19 +08:00
Bram Tassyns a0c13477ab MDL-56836 SCORM: player doesn't remember display mode when not logged in 2016-12-05 09:25:31 +08:00
557 changed files with 4279 additions and 2128 deletions
+7 -9
View File
@@ -13,7 +13,7 @@ language: php
php:
# We only run the highest and lowest supported versions to reduce the load on travis-ci.org.
- 7.0
- 7.1
- 5.6
services:
@@ -23,7 +23,7 @@ env:
# Although we want to run these jobs and see failures as quickly as possible, we also want to get the slowest job to
# start first so that the total run time is not too high.
#
# We only run MySQL on PHP 7.0, so run that first.
# We only run MySQL on PHP 7.1, so run that first.
# CI Tests should be second-highest in priority as these only take <= 60 seconds to run under normal circumstances.
# Postgres is significantly is pretty reasonable in its run-time.
@@ -47,22 +47,22 @@ matrix:
include:
# Run grunt/npm install on lowest supported npm version
- php: 7
- php: 7.1
env: DB=none TASK=GRUNT NVM_VERSION='4'
# Run grunt/npm install on highest version ('node' is an alias for the latest node.js version.)
- php: 7
- php: 7.1
env: DB=none TASK=GRUNT NVM_VERSION='node'
exclude:
# MySQL - it's just too slow.
# Exclude it on all versions except for 7.0
# Exclude it on all versions except for 7.1
- env: DB=mysqli TASK=PHPUNIT
php: 5.6
# Moodle 2.7 is not compatible with PHP 7 for the upgrade test.
- env: DB=pgsql TASK=UPGRADE
php: 7.0
php: 7.1
cache:
directories:
@@ -70,9 +70,6 @@ cache:
- $HOME/.npm
install:
# Disable xdebug. We aren't generating code coverage, and it has a huge impact upon test performance.
- rm /home/travis/.phpenv/versions/$(phpenv version-name)/etc/conf.d/xdebug.ini
- >
if [ "$TASK" = 'PHPUNIT' ];
then
@@ -99,6 +96,7 @@ install:
fi
before_script:
- phpenv config-rm xdebug.ini
- >
if [ "$TASK" = 'PHPUNIT' -o "$TASK" = 'UPGRADE' ];
then
+2
View File
@@ -37,6 +37,7 @@
print_error('blockdoesnotexist', 'error');
}
$DB->set_field('block', 'visible', '0', array('id'=>$block->id)); // Hide block
add_to_config_log('block_visibility', $block->visible, '0', $block->name);
core_plugin_manager::reset_caches();
admin_get_root(true, false); // settings not required - only pages
}
@@ -46,6 +47,7 @@
print_error('blockdoesnotexist', 'error');
}
$DB->set_field('block', 'visible', '1', array('id'=>$block->id)); // Show block
add_to_config_log('block_visibility', $block->visible, '1', $block->name);
core_plugin_manager::reset_caches();
admin_get_root(true, false); // settings not required - only pages
}
-5
View File
@@ -1868,11 +1868,6 @@
<ON_CHECK message="unoconvwarning" />
</FEEDBACK>
</CUSTOM_CHECK>
<CUSTOM_CHECK file="lib/upgradelib.php" function="check_tls_libraries" level="optional">
<FEEDBACK>
<ON_CHECK message="tlswarning" />
</FEEDBACK>
</CUSTOM_CHECK>
<CUSTOM_CHECK file="lib/upgradelib.php" function="check_libcurl_version" level="optional">
<FEEDBACK>
<ON_CHECK message="libcurlwarning" />
+10 -3
View File
@@ -1899,14 +1899,21 @@ class core_admin_renderer extends plugin_renderer_base {
} else {
$report = $this->doc_link(join($linkparts, '/'), get_string($stringtouse, 'admin', $rec));
}
// Enclose report text in div so feedback text will be displayed underneath it.
$report = html_writer::div($report);
// Format error or warning line
if ($errorline || $warningline) {
$messagetype = $errorline? 'error':'warn';
if ($errorline) {
$messagetype = 'error';
$statusclass = 'label-important';
} else if ($warningline) {
$messagetype = 'warn';
$statusclass = 'label-warning';
} else {
$messagetype = 'ok';
$statusclass = 'label-success';
}
$status = '<span class="'.$messagetype.'">'.$status.'</span>';
$status = html_writer::span($status, 'label ' . $statusclass);
// Here we'll store all the feedback found
$feedbacktext = '';
// Append the feedback if there is some
+3 -3
View File
@@ -29,9 +29,9 @@ if ($primaryadmin) {
$primaryadminname = NULL;
}
$temp->add(new admin_setting_configtext('supportname', new lang_string('supportname', 'admin'),
new lang_string('configsupportname', 'admin'), $primaryadminname, PARAM_NOTAGS));
new lang_string('configsupportname', 'admin'), $primaryadminname, PARAM_NOTAGS));
$setting = new admin_setting_configtext('supportemail', new lang_string('supportemail', 'admin'),
new lang_string('configsupportemail', 'admin'), $primaryadminemail, PARAM_NOTAGS);
new lang_string('configsupportemail', 'admin'), $primaryadminemail, PARAM_EMAIL);
$setting->set_force_ltr(true);
$temp->add($setting);
$temp->add(new admin_setting_configtext('supportpage', new lang_string('supportpage', 'admin'), new lang_string('configsupportpage', 'admin'), '', PARAM_URL));
@@ -237,7 +237,7 @@ $temp->add(new admin_setting_configtext('smtpmaxbulk', new lang_string('smtpmaxb
$temp->add(new admin_setting_heading('noreplydomainheading', new lang_string('noreplydomain', 'admin'),
new lang_string('noreplydomaindetail', 'admin')));
$temp->add(new admin_setting_configtext('noreplyaddress', new lang_string('noreplyaddress', 'admin'),
new lang_string('confignoreplyaddress', 'admin'), 'noreply@' . get_host_from_url($CFG->wwwroot), PARAM_NOTAGS));
new lang_string('confignoreplyaddress', 'admin'), 'noreply@' . get_host_from_url($CFG->wwwroot), PARAM_EMAIL));
$temp->add(new admin_setting_configtextarea('allowedemaildomains',
new lang_string('allowedemaildomains', 'admin'),
new lang_string('configallowedemaildomains', 'admin'),
@@ -16,8 +16,7 @@ Feature: Display extended course names
And I should not see "C_shortname Course fullname"
Scenario: Courses list with extended course names
Given I expand "Site administration" node
And I click on "Courses" "link" in the "//div[@id='settingsnav']/descendant::li[contains(concat(' ', normalize-space(@class), ' '), ' type_setting ')][contains(., 'Appearance')]" "xpath_element"
Given I navigate to "Appearance > Courses" in site administration
And I set the field "Display extended course names" to "1"
When I press "Save changes"
And I am on site homepage
+1 -1
View File
@@ -25,7 +25,7 @@ Feature: An administrator can filter user accounts by role, cohort and other pro
And I log in as "admin"
And I add "User Two (two@example.com)" user to "CH1" cohort members
And I add "User Three (three@example.com)" user to "CH1" cohort members
And I follow "Browse list of users"
And I navigate to "Users > Accounts > Browse list of users" in site administration
Scenario: Filter user accounts by role and cohort
When I set the following fields to these values:
@@ -8,6 +8,8 @@ Feature: Manage availability conditions
Scenario: Display list of availability conditions
# Check the report doesn't show when not enabled.
Given I log in as "admin"
And I press "Customise this page"
And I add the "Administration" block if not present
And the following config values are set as admin:
| enableavailability | 0 |
And I expand "Site administration" node
@@ -59,8 +59,7 @@ Feature: Set up contextual data for tests
When I log in as "admin"
And I am on site homepage
And I follow "Course 1"
And I expand "Users" node
And I follow "Groups"
And I navigate to "Users > Groups" in current page administration
Then I should see "Group 1"
And I should see "Group 2"
And I follow "Groupings"
@@ -90,8 +89,7 @@ Feature: Set up contextual data for tests
When I log in as "admin"
And I am on site homepage
And I follow "Course 1"
And I expand "Users" node
And I follow "Permissions"
And I navigate to "Users > Permissions" in current page administration
And I set the field "Advanced role override" to "Student (1)"
Then "mod/forum:editanypost" capability has "Allow" permission
And I press "Cancel"
@@ -134,30 +132,31 @@ Feature: Set up contextual data for tests
And the following "course enrolments" exist:
| user | course | role |
| user4 | C1 | custom1 |
| user2 | C1 | student |
| user3 | C1 | editingteacher |
And the following "role assigns" exist:
| user | role | contextlevel | reference |
| user1 | manager | System | |
| user2 | editingteacher | Category | CAT1 |
| user3 | editingteacher | Course | C1 |
| user5 | custom2 | System | |
When I log in as "user1"
And I am on site homepage
Then I should see "Front page settings"
Then "Edit settings" "link" should exist in current page administration
And I log out
And I log in as "user2"
And I am on site homepage
And I follow "Course 1"
And I should see "Turn editing on"
And "Turn editing on" "link" should exist in current page administration
And I log out
And I log in as "user3"
And I am on site homepage
And I follow "Course 1"
And I should see "Turn editing on"
And "Turn editing on" "link" should exist in current page administration
And I log out
And I log in as "user4"
And I am on site homepage
And I follow "Course 1"
And I should see "Turn editing on"
And "Turn editing on" "link" should exist in current page administration
And I log out
And I log in as "user5"
And I should see "You are logged in as"
@@ -264,8 +263,7 @@ Feature: Set up contextual data for tests
When I log in as "admin"
And I am on site homepage
And I follow "Course 1"
And I expand "Users" node
And I follow "Groups"
And I navigate to "Users > Groups" in current page administration
Then the "groups" select box should contain "Group 1 (1)"
And the "groups" select box should contain "Group 2 (1)"
And I set the field "groups" to "Group 1 (1)"
@@ -302,7 +300,7 @@ Feature: Set up contextual data for tests
| System cohort A | 1 |
| System cohort B | 2 |
And I should not see "Cohort in category"
And I follow "Courses"
And I am on course index
And I follow "Cat 1"
And I follow "Cohorts"
And I should not see "System cohort"
@@ -322,10 +320,9 @@ Feature: Set up contextual data for tests
| fullname | course | gradecategory |
| Grade sub category 2 | C1 | Grade category 1 |
When I log in as "admin"
And I am on site homepage
And I follow "Courses"
And I am on course index
And I follow "Course 1"
And I go to "View > Grader report" in the course gradebook
And I navigate to "View > Grader report" in the course gradebook
Then I should see "Grade category 1"
And I should see "Grade sub category 2"
@@ -349,7 +346,7 @@ Feature: Set up contextual data for tests
When I log in as "admin"
And I am on site homepage
And I follow "Course 1"
And I go to "Setup > Gradebook setup" in the course gradebook
And I navigate to "Setup > Gradebook setup" in the course gradebook
Then I should see "Test Grade Item 1"
And I follow "Edit Test Grade Item 1"
And I expand all fieldsets
@@ -378,7 +375,7 @@ Feature: Set up contextual data for tests
When I log in as "admin"
And I am on site homepage
And I follow "Course 1"
And I go to "Scales" in the course gradebook
And I navigate to "Scales" in the course gradebook
Then I should see "Test Scale 1"
And I should see "Disappointing, Good, Very good, Excellent"
@@ -429,7 +426,7 @@ Feature: Set up contextual data for tests
When I log in as "admin"
And I am on site homepage
And I follow "Course 1"
And I go to "Setup > Gradebook setup" in the course gradebook
And I navigate to "Setup > Gradebook setup" in the course gradebook
Then I should see "Test Outcome Grade Item 1"
And I follow "Edit Test Outcome Grade Item 1"
And the field "Outcome" matches value "Grade outcome 1"
@@ -32,8 +32,7 @@ Feature: Edit capabilities
Scenario: Course capabilities overrides
Given I log in as "teacher1"
And I follow "Course 1"
And I expand "Users" node
And I follow "Permissions"
And I navigate to "Users > Permissions" in current page administration
And I override the system permissions of "Student" role with:
| mod/forum:deleteanypost | Prohibit |
| mod/forum:editanypost | Prevent |
@@ -52,7 +51,7 @@ Feature: Edit capabilities
| Forum name | I'm the name |
| Description | I'm the introduction |
And I follow "I'm the name"
And I navigate to "Permissions" node in "Forum administration"
And I navigate to "Permissions" in current page administration
And I override the system permissions of "Student" role with:
| mod/forum:deleteanypost | Prohibit |
| mod/forum:editanypost | Prevent |
@@ -33,8 +33,6 @@ Feature: Verify that all form fields values can be get and set
| activity | course | idnumber | name | intro | firstpagetitle | wikimode | visible |
| wiki | C1 | wiki1 | Test this one | Test this one | Test this one | collaborative | 0 |
And I log in as "admin"
And I expand "Site administration" node
And I expand "Appearance" node
And I am on site homepage
And I follow "Course 1"
And I navigate to "Reset" node in "Course administration"
@@ -60,9 +58,8 @@ Feature: Verify that all form fields values can be get and set
| HTML format | Student page contents |
And I press "Save"
Then I should see "Student page contents" in the "region-main" "region"
And I click on "Edit" "link" in the "Administration" "block"
# Select (multi-select) - Checking "I set the field".
And I click on "Edit settings" "link" in the "Administration" "block"
And I navigate to "Edit settings" in current page administration
And I expand all fieldsets
# Checkbox - Checking "I set the field".
And I set the field "Display description on course page" to "1"
@@ -75,7 +72,7 @@ Feature: Verify that all form fields values can be get and set
And I press "Save and return to course"
And I should see "Test this one"
And I follow "Test this one"
And I click on "Edit settings" "link" in the "Administration" "block"
And I navigate to "Edit settings" in current page administration
# Checkbox - Checking "the field matches value" and "the following fields match these values".
And the following fields match these values:
| Display description on course page | 1 |
@@ -91,7 +88,7 @@ Feature: Verify that all form fields values can be get and set
# Select (simple) - Checking "I set the field".
And I set the field "Group mode" to "Separate groups"
And I press "Save and display"
And I click on "Edit settings" "link" in the "Administration" "block"
And I navigate to "Edit settings" in current page administration
And the following fields match these values:
| Default format | NWiki |
| Group mode | Separate groups |
@@ -134,8 +131,7 @@ Feature: Verify that all form fields values can be get and set
@javascript
Scenario: with JS enabled all form fields getters and setters works as expected
Then I follow "Course 1"
And I expand "Users" node
And I follow "Groups"
And I navigate to "Users > Groups" in current page administration
# Select (multi-select & AJAX) - Checking "I set the field" and "select box should contain".
And I set the field "groups" to "Group 2"
And the "members" select box should contain "Student 2"
@@ -158,7 +154,7 @@ Feature: Verify that all form fields values can be get and set
And the "available[day]" "field" should be enabled
And the field "deadline[enabled]" matches value "1"
And I press "Save and display"
And I click on "Edit settings" "link" in the "Administration" "block"
And I navigate to "Edit settings" in current page administration
And the field "available[enabled]" matches value "1"
And the "available[day]" "field" should be enabled
And the field "deadline[enabled]" matches value "1"
+3
View File
@@ -41,5 +41,8 @@ function xmldb_tool_customlang_upgrade($oldversion) {
// Moodle v3.1.0 release upgrade line.
// Put any upgrade step following this.
// Automatically generated Moodle v3.2.0 release upgrade line.
// Put any upgrade step following this.
return true;
}
+3
View File
@@ -45,5 +45,8 @@ function xmldb_tool_log_upgrade($oldversion) {
// Moodle v3.1.0 release upgrade line.
// Put any upgrade step following this.
// Automatically generated Moodle v3.2.0 release upgrade line.
// Put any upgrade step following this.
return true;
}
@@ -39,5 +39,8 @@ function xmldb_logstore_database_upgrade($oldversion) {
// Moodle v3.1.0 release upgrade line.
// Put any upgrade step following this.
// Automatically generated Moodle v3.2.0 release upgrade line.
// Put any upgrade step following this.
return true;
}
@@ -56,5 +56,8 @@ function xmldb_logstore_standard_upgrade($oldversion) {
// Moodle v3.1.0 release upgrade line.
// Put any upgrade step following this.
// Automatically generated Moodle v3.2.0 release upgrade line.
// Put any upgrade step following this.
return true;
}
@@ -7,12 +7,9 @@ Feature: Manage competency frameworks
Background:
Given I log in as "admin"
And I am on site homepage
And I expand "Site administration" node
When I expand "Competencies" node
Then I should see "Competency frameworks"
Scenario: Create a new framework
Given I follow "Competency frameworks"
Given I navigate to "Competencies > Competency frameworks" in site administration
And I should see "List of competency frameworks"
And I click on "Add new competency framework" "button"
And I should see "General"
@@ -34,7 +31,7 @@ Feature: Manage competency frameworks
Given the following lp "frameworks" exist:
| shortname | idnumber |
| Science Year-2 | sc-y-2 |
And I follow "Competency frameworks"
And I navigate to "Competencies > Competency frameworks" in site administration
And I should see "Science Year-2"
When I click on "Science Year-2" "link"
Then I should see "Science Year-2"
@@ -43,7 +40,7 @@ Feature: Manage competency frameworks
Given the following lp "frameworks" exist:
| shortname | idnumber |
| Science Year-3 | sc-y-3 |
And I follow "Competency frameworks"
And I navigate to "Competencies > Competency frameworks" in site administration
And I should see "Science Year-3"
And I click on "Edit" of edit menu in the "Science Year-3" row
And the field "Name" matches value "Science Year-3 "
@@ -57,7 +54,7 @@ Feature: Manage competency frameworks
Given the following lp "frameworks" exist:
| shortname | idnumber |
| Science Year-4 | sc-y-4 |
And I follow "Competency frameworks"
And I navigate to "Competencies > Competency frameworks" in site administration
And I should see "Science Year-4"
And I should see "sc-y-4"
And I click on "Delete" of edit menu in the "Science Year-4" row
@@ -90,7 +87,7 @@ Scenario: Edit a framework with competencies in user competency
| user | competency |
| admin | Comp1 |
| admin | Comp2 |
And I follow "Competency frameworks"
And I navigate to "Competencies > Competency frameworks" in site administration
And I should see "Science Year-5"
And I click on "Edit" of edit menu in the "Science Year-5" row
And the field "Name" matches value "Science Year-5 "
@@ -120,7 +117,7 @@ Scenario: Edit a framework with competencies in user competency plan
| user | competency | plan |
| admin | Comp1 | Plan Science-6 |
| admin | Comp2 | Plan Science-6 |
And I follow "Competency frameworks"
And I navigate to "Competencies > Competency frameworks" in site administration
And I should see "Science Year-6"
And I click on "Edit" of edit menu in the "Science Year-6" row
And the field "Name" matches value "Science Year-6 "
+2 -6
View File
@@ -26,9 +26,7 @@ Feature: Manage plearning plan
| shortname | description |
| Science template | science template description |
And I follow "Home"
And I expand "Site administration" node
And I expand "Competencies" node
And I follow "Learning plan templates"
And I navigate to "Competencies > Learning plan templates" in site administration
And I click on ".template-userplans" "css_element" in the "Science template" "table_row"
And I click on ".form-autocomplete-downarrow" "css_element"
And I click on "Admin" item in the autocomplete list
@@ -52,9 +50,7 @@ Feature: Manage plearning plan
| student-plan1 | COHORTPLAN |
| student-plan2 | COHORTPLAN |
And I follow "Home"
And I expand "Site administration" node
And I expand "Competencies" node
And I follow "Learning plan templates"
And I navigate to "Competencies > Learning plan templates" in site administration
And I click on ".template-cohorts" "css_element" in the "Science template cohort" "table_row"
And I click on ".form-autocomplete-downarrow" "css_element"
And I click on "cohort plan" item in the autocomplete list
@@ -145,10 +145,7 @@ Feature: Manage plan workflow
| Test-Plan3 | user1 | Description of plan 3 for user 1 | active | manager1 |
| Test-Plan4 | user1 | Description of plan 4 for user 1 | active | manager1 |
And I log in as "manager1"
And I expand "Site administration" node
And I expand "Users" node
And I expand "Accounts" node
And I follow "Browse list of users"
And I navigate to "Users > Accounts > Browse list of users" in site administration
And I follow "User 1"
And I follow "Learning plans"
And I should see "List of learning plans"
@@ -167,10 +164,7 @@ Feature: Manage plan workflow
| Test-Plan3 | user1 | Description of plan 3 for user 1 | active | manager1 |
| Test-Plan4 | user1 | Description of plan 4 for user 1 | active | manager1 |
And I log in as "manager1"
And I expand "Site administration" node
And I expand "Users" node
And I expand "Accounts" node
And I follow "Browse list of users"
And I navigate to "Users > Accounts > Browse list of users" in site administration
And I follow "User 1"
And I follow "Learning plans"
And I should see "List of learning plans"
@@ -191,10 +185,7 @@ Scenario: Manager reopen a complete learning plan
| Test-Plan3 | user1 | Description of plan 3 for user 1 | complete | manager1 |
| Test-Plan4 | user1 | Description of plan 4 for user 1 | complete | manager1 |
And I log in as "manager1"
And I expand "Site administration" node
And I expand "Users" node
And I expand "Accounts" node
And I follow "Browse list of users"
And I navigate to "Users > Accounts > Browse list of users" in site administration
And I follow "User 1"
And I follow "Learning plans"
And I should see "List of learning plans"
@@ -7,12 +7,9 @@ Feature: Manage plearning plan templates
Background:
Given I log in as "admin"
And I am on site homepage
And I expand "Site administration" node
When I expand "Competencies" node
Then I should see "Learning plan templates"
Scenario: Create a new learning plan template
Given I follow "Learning plan templates"
Given I navigate to "Competencies > Learning plan templates" in site administration
And I should see "List of learning plan templates"
And I click on "Add new learning plan template" "button"
And I should see "Add new learning plan template"
@@ -26,7 +23,7 @@ Feature: Manage plearning plan templates
Given the following lp "templates" exist:
| shortname | description |
| Science template Year-2 | science template description |
And I follow "Learning plan templates"
And I navigate to "Competencies > Learning plan templates" in site administration
And I should see "Science template Year-2"
When I click on "Science template Year-2" "link"
Then I should see "Science template Year-2"
@@ -36,7 +33,7 @@ Feature: Manage plearning plan templates
Given the following lp "templates" exist:
| shortname | description |
| Science template Year-3 | science template description |
And I follow "Learning plan templates"
And I navigate to "Competencies > Learning plan templates" in site administration
And I should see "Science template Year-3"
And I click on "Edit" of edit menu in the "Science template Year-3" row
And the field "Name" matches value "Science template Year-3"
@@ -49,7 +46,7 @@ Feature: Manage plearning plan templates
Given the following lp "templates" exist:
| shortname | description |
| Science template Year-4 | science template description |
And I follow "Learning plan templates"
And I navigate to "Competencies > Learning plan templates" in site administration
And I should see "Science template Year-4"
And I click on "Delete" of edit menu in the "Science template Year-4" row
And "Confirm" "dialogue" should be visible
@@ -53,6 +53,10 @@ class framework_importer {
protected $importer = null;
protected $foundheaders = array();
protected $scalecache = array();
/** @var bool $useprogressbar Control whether importing should use progress bars or not. */
protected $useprogressbar = false;
/** @var \core\progress\display_if_slow|null $progress The progress bar instance. */
protected $progress = null;
/**
* Store an error message for display later
@@ -164,8 +168,11 @@ class framework_importer {
* @param string delimiter The specified delimiter for the file.
* @param string importid The id of the csv import.
* @param array mappingdata The mapping data from the import form.
* @param bool $useprogressbar Whether progress bar should be displayed, to avoid html output on CLI.
*/
public function __construct($text = null, $encoding = null, $delimiter = null, $importid = 0, $mappingdata = null) {
public function __construct($text = null, $encoding = null, $delimiter = null, $importid = 0, $mappingdata = null,
$useprogressbar = false) {
global $CFG;
// The format of our records is:
@@ -204,7 +211,7 @@ class framework_importer {
}
$this->foundheaders = $this->importer->get_columns();
$this->useprogressbar = $useprogressbar;
$domainid = 1;
$flat = array();
@@ -264,8 +271,19 @@ class framework_importer {
$this->fail(get_string('invalidimportfile', 'tool_lpimportcsv'));
return;
} else {
// We are calling from browser, display progress bar.
if ($this->useprogressbar === true) {
$this->progress = new \core\progress\display_if_slow(get_string('processingfile', 'tool_lpimportcsv'));
$this->progress->start_html();
} else {
// Avoid html output on CLI scripts.
$this->progress = new \core\progress\none();
}
$this->progress->start_progress('', count($this->flat));
// Build a tree from this flat list.
raise_memory_limit(MEMORY_EXTRA);
$this->add_children($this->framework, '');
$this->progress->end_progress();
}
}
@@ -278,6 +296,7 @@ class framework_importer {
public function add_children(& $node, $parentidnumber) {
foreach ($this->flat as $competency) {
if ($competency->parentidnumber == $parentidnumber) {
$this->progress->increment_progress();
$node->children[] = $competency;
$this->add_children($competency, $competency->idnumber);
}
@@ -443,17 +462,28 @@ class framework_importer {
$record->contextid = context_system::instance()->id;
$framework = api::create_framework($record);
if ($this->useprogressbar === true) {
$this->progress = new \core\progress\display_if_slow(get_string('importingfile', 'tool_lpimportcsv'));
$this->progress->start_html();
} else {
$this->progress = new \core\progress\none();
}
$this->progress->start_progress('', (count($this->framework->children) * 2));
raise_memory_limit(MEMORY_EXTRA);
// Now all the children.
foreach ($this->framework->children as $comp) {
$this->progress->increment_progress();
$this->create_competency($comp, null, $framework);
}
// Now create the rules.
foreach ($this->framework->children as $record) {
$this->progress->increment_progress();
$this->set_rules($record);
$this->set_related($record);
}
$this->progress->end_progress();
$this->importer->cleanup();
return $framework;
-47
View File
@@ -1,47 +0,0 @@
<?php
// This file is part of Moodle - http://moodle.org/
//
// Moodle is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// Moodle is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
/**
* Page to continue after an action.
*
* @package tool_lpimportcsv
* @copyright 2015 Damyon Wiese
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
require_once(__DIR__ . '/../../../config.php');
require_once($CFG->libdir.'/adminlib.php');
$pagetitle = get_string('pluginname', 'tool_lpimportcsv');
$context = context_system::instance();
$id = required_param('id', PARAM_INT);
$url = new moodle_url("/admin/tool/lpimportcsv/index.php");
$PAGE->set_context($context);
$PAGE->set_url($url);
$PAGE->set_title($pagetitle);
$PAGE->set_pagelayout('admin');
$PAGE->set_heading($pagetitle);
echo $OUTPUT->header();
echo $OUTPUT->heading($pagetitle);
$urlparams = ['competencyframeworkid' => $id, 'pagecontextid' => $context->id];
$frameworksurl = new moodle_url('/admin/tool/lp/competencies.php', $urlparams);
echo $OUTPUT->notification(get_string('competencyframeworkcreated', 'tool_lp'), 'notifysuccess');
echo $OUTPUT->continue_button($frameworksurl);
echo $OUTPUT->footer();
+7 -4
View File
@@ -37,6 +37,7 @@ $PAGE->set_pagelayout('admin');
$PAGE->set_heading($pagetitle);
$form = null;
echo $OUTPUT->header();
if (optional_param('needsconfirm', 0, PARAM_BOOL)) {
$form = new \tool_lpimportcsv\form\import($url->out(false));
} else if (optional_param('confirm', 0, PARAM_BOOL)) {
@@ -53,7 +54,7 @@ if ($form->is_cancelled()) {
if ($data->confirm) {
$importid = $data->importid;
$importer = new \tool_lpimportcsv\framework_importer(null, null, null, $importid, $data);
$importer = new \tool_lpimportcsv\framework_importer(null, null, null, $importid, $data, true);
$error = $importer->get_error();
if ($error) {
@@ -61,21 +62,23 @@ if ($form->is_cancelled()) {
$form->set_import_error($error);
} else {
$framework = $importer->import();
redirect(new moodle_url('continue.php', array('id' => $framework->get_id())));
$urlparams = ['competencyframeworkid' => $framework->get_id(), 'pagecontextid' => $context->id];
$frameworksurl = new moodle_url('/admin/tool/lp/competencies.php', $urlparams);
echo $OUTPUT->notification(get_string('competencyframeworkcreated', 'tool_lp'), 'notifysuccess');
echo $OUTPUT->continue_button($frameworksurl);
die();
}
} else {
$text = $form->get_file_content('importfile');
$encoding = $data->encoding;
$delimiter = $data->delimiter_name;
$importer = new \tool_lpimportcsv\framework_importer($text, $encoding, $delimiter);
$importer = new \tool_lpimportcsv\framework_importer($text, $encoding, $delimiter, 0, null, true);
$confirmform = new \tool_lpimportcsv\form\import_confirm(null, $importer);
$form = $confirmform;
$pagetitle = get_string('confirmcolumnmappings', 'tool_lpimportcsv');
}
}
echo $OUTPUT->header();
echo $OUTPUT->heading($pagetitle);
$form->display();
@@ -38,11 +38,13 @@ $string['importfile'] = 'CSV framework description file';
$string['importfile_help'] = 'A competency framework may be imported via text file. The format of the file can be determined by creating a new competency framework on the site and then exporting it.';
$string['importfile_link'] = 'admin/tool/lpimportcsv';
$string['import'] = 'Import';
$string['importingfile'] = 'Importing file data';
$string['invalidimportfile'] = 'File format is invalid.';
$string['isframework'] = 'Is framework';
$string['noframeworks'] = 'No competency frameworks have been created yet';
$string['parentidnumber'] = 'Parent ID number';
$string['pluginname'] = 'Import competency framework';
$string['processingfile'] = 'Processing file';
$string['relatedidnumbers'] = 'Cross-referenced competency ID numbers';
$string['ruleconfig'] = 'Rule config (optional)';
$string['ruleoutcome'] = 'Rule outcome (optional)';
+3
View File
@@ -77,5 +77,8 @@ function xmldb_tool_monitor_upgrade($oldversion) {
upgrade_plugin_savepoint(true, 2016052305, 'tool', 'monitor');
}
// Automatically generated Moodle v3.2.0 release upgrade line.
// Put any upgrade step following this.
return true;
}
@@ -65,6 +65,6 @@ Feature: Backup user data
And I log out
And I log in as "student1"
And I follow "Course 1"
When I go to "User report" in the course gradebook
When I navigate to "User report" in the course gradebook
Then "Quiz 1" row "Grade" column of "user-grade" table should contain "5"
And "Quiz 1" row "Percentage" column of "user-grade" table should contain "50"
@@ -49,9 +49,10 @@ Feature: Basic recycle bin functionality
And I should see "Deleting C2"
And I should see "C2 has been completely deleted"
And I press "Continue"
And I go to the courses management page
And I should not see "Course 2" in the "#course-listing" "css_element"
When I navigate to "Recycle bin" node in "Category: Miscellaneous"
And I am on course index
And I should see "Course 1"
And I should not see "Course 2"
When I navigate to "Recycle bin" in current page administration
Then I should see "Course 2"
And I should see "Contents will be permanently deleted after 14 days"
And I click on "Restore" "link" in the "region-main" "region"
+1 -1
View File
@@ -75,7 +75,7 @@ if (!empty($delall) && confirm_sesskey()) {
exit;
}
if (!empty($ignore)) {
if (!empty($ignore) && confirm_sesskey()) {
unset($SESSION->users_result[$id]);
echo json_encode(true);
exit;
+30 -28
View File
@@ -358,38 +358,40 @@ if ($formdata = $mform2->is_cancelled()) {
// add default values for remaining fields
$formdefaults = array();
foreach ($STD_FIELDS as $field) {
if (isset($user->$field)) {
continue;
}
// all validation moved to form2
if (isset($formdata->$field)) {
// process templates
$user->$field = uu_process_template($formdata->$field, $user);
$formdefaults[$field] = true;
if (in_array($field, $upt->columns)) {
$upt->track($field, s($user->$field), 'normal');
if ($updatetype != UU_UPDATE_FILEOVERRIDE && $updatetype != UU_UPDATE_NOCHANGES) {
foreach ($STD_FIELDS as $field) {
if (isset($user->$field)) {
continue;
}
// all validation moved to form2
if (isset($formdata->$field)) {
// process templates
$user->$field = uu_process_template($formdata->$field, $user);
$formdefaults[$field] = true;
if (in_array($field, $upt->columns)) {
$upt->track($field, s($user->$field), 'normal');
}
}
}
}
foreach ($PRF_FIELDS as $field) {
if (isset($user->$field)) {
continue;
}
if (isset($formdata->$field)) {
// process templates
$user->$field = uu_process_template($formdata->$field, $user);
// Form contains key and later code expects value.
// Convert key to value for required profile fields.
require_once($CFG->dirroot.'/user/profile/field/'.$proffields[$field]->datatype.'/field.class.php');
$profilefieldclass = 'profile_field_'.$proffields[$field]->datatype;
$profilefield = new $profilefieldclass($proffields[$field]->id);
if (method_exists($profilefield, 'convert_external_data')) {
$user->$field = $profilefield->edit_save_data_preprocess($user->$field, null);
foreach ($PRF_FIELDS as $field) {
if (isset($user->$field)) {
continue;
}
if (isset($formdata->$field)) {
// process templates
$user->$field = uu_process_template($formdata->$field, $user);
$formdefaults[$field] = true;
// Form contains key and later code expects value.
// Convert key to value for required profile fields.
require_once($CFG->dirroot.'/user/profile/field/'.$proffields[$field]->datatype.'/field.class.php');
$profilefieldclass = 'profile_field_'.$proffields[$field]->datatype;
$profilefield = new $profilefieldclass($proffields[$field]->id);
if (method_exists($profilefield, 'convert_external_data')) {
$user->$field = $profilefield->edit_save_data_preprocess($user->$field, null);
}
$formdefaults[$field] = true;
}
}
}
@@ -33,6 +33,7 @@ $string['deleteerrors'] = 'Delete errors';
$string['encoding'] = 'Encoding';
$string['errormnetadd'] = 'Can not add remote users';
$string['errors'] = 'Errors';
$string['invalidupdatetype'] = 'This option cannot be selected with the chosen upload type.';
$string['invaliduserdata'] = 'Invalid data detected for user {$a} and it has been automatically cleaned.';
$string['nochanges'] = 'No changes';
$string['pluginname'] = 'User upload';
@@ -29,14 +29,13 @@ Feature: Upload users
And I should see "Section 1"
And I press "Upload users"
And I press "Continue"
And I follow "Browse list of users"
And I navigate to "Users > Accounts > Browse list of users" in site administration
And I should see "Tom Jones"
And I should see "Trent Reznor"
And I should see "reznor@example.com"
And I am on site homepage
And I follow "Maths"
And I expand "Users" node
And I follow "Groups"
And I navigate to "Users > Groups" in current page administration
And I set the field "groups" to "Section 1 (1)"
And the "members" select box should contain "Tom Jones"
+7
View File
@@ -350,6 +350,7 @@ class admin_uploaduser_form2 extends moodleform {
$errors = parent::validation($data, $files);
$columns = $this->_customdata['columns'];
$optype = $data['uutype'];
$updatetype = $data['uuupdatetype'];
// detect if password column needed in file
if (!in_array('password', $columns)) {
@@ -382,6 +383,12 @@ class admin_uploaduser_form2 extends moodleform {
}
}
// If the 'Existing user details' value is set we need to ensure that the
// 'Upload type' is not set to something invalid.
if (!empty($updatetype) && ($optype == UU_USER_ADDNEW || $optype == UU_USER_ADDINC)) {
$errors['uuupdatetype'] = get_string('invalidupdatetype', 'tool_uploaduser');
}
// look for other required data
if ($optype != UU_USER_UPDATE) {
$requiredusernames = useredit_get_required_name_fields();
+3
View File
@@ -42,5 +42,8 @@ function xmldb_tool_usertours_upgrade($oldversion) {
upgrade_plugin_savepoint(true, 2016120501, 'tool', 'usertours');
}
// Automatically generated Moodle v3.2.0 release upgrade line.
// Put any upgrade step following this.
return true;
}
@@ -146,9 +146,9 @@ $string['tour1_content_navigation'] = 'Major navigation is now through this nav
$string['tour1_title_customisation'] = 'Customisation';
$string['tour1_content_customisation'] = 'To customise the look of your site and the front page, use the settings menu in the corner of this header. Try turning editing on right now.';
$string['tour1_title_blockregion'] = 'Block region';
$string['tour1_content_blockregion'] = 'There is still a block region over here. We recommend removing the Navigation and Settings blocks completely, as all the functionality is elsewhere in the Boost theme.';
$string['tour1_content_blockregion'] = 'There is still a block region over here. We recommend removing the Navigation and Administration blocks completely, as all the functionality is elsewhere in the Boost theme.';
$string['tour1_title_addingblocks'] = 'Adding blocks';
$string['tour1_content_addingblocks'] = 'In fact, think carefully about including any blocks on your pages. Blocks are not shown on the Moodle mobile app, so as a general rule it\'s much better to make sure your site works well without any blocks.';
$string['tour1_content_addingblocks'] = 'In fact, think carefully about including any blocks on your pages. Blocks are not shown on the Moodle Mobile app, so as a general rule it\'s much better to make sure your site works well without any blocks.';
$string['tour1_title_end'] = 'End of tour';
$string['tour1_content_end'] = 'This has been a user tour, a new feature in Moodle 3.2. It won\'t show again unless you reset it using the link in the footer. As an admin you can also create your own tours like this!';
@@ -158,14 +158,14 @@ $string['tour2_content_welcome'] = 'Welcome to the Boost theme for Moodle 3.2. I
$string['tour2_title_customisation'] = 'Customisation';
$string['tour2_content_customisation'] = 'To change any course settings, use the settings menu in the corner of this header. You will find a similar settings menu on the home page of every activity, too. Try turning editing on right now.';
$string['tour2_title_navigation'] = 'Navigation';
$string['tour2_content_navigation'] = 'Major navigation is now though this nav drawer. Use the button at the top to hide or show it. You will see that there are links for major sections of your course.';
$string['tour2_content_navigation'] = 'Navigation is now through this nav drawer. Use the button at the top to hide or show it. You will see that there are links for sections of your course.';
$string['tour2_title_opendrawer'] = 'Open the nav drawer';
$string['tour2_content_opendrawer'] = 'Try opening the nav drawer now.';
$string['tour2_title_participants'] = 'Course participants';
$string['tour2_content_participants'] = 'View participants here. This is also where you go to add or remove students.';
$string['tour2_title_addblock'] = 'Add a block';
$string['tour2_content_addblock'] = 'If you enable editing mode you can add blocks from the nav drawer. However, think carefully about including any blocks on your pages. Blocks are not shown on Moodle mobile app, so for the best student experience it is much better to make sure your course works well without any blocks.';
$string['tour2_content_addblock'] = 'If you turn editing on you can add blocks from the nav drawer. However, think carefully about including any blocks on your pages. Blocks are not shown on the Moodle Mobile app, so for the best user experience it is better to make sure your course works well without any blocks.';
$string['tour2_title_addingblocks'] = 'Adding blocks';
$string['tour2_content_addingblocks'] = 'You can add blocks to this page using this button. However, think carefully about including any blocks on your pages. Blocks are not shown on Moodle mobile app, so for the best student experience it is much better to make sure your course works well without any blocks.';
$string['tour2_content_addingblocks'] = 'You can add blocks to this page using this button. However, think carefully about including any blocks on your pages. Blocks are not shown on the Moodle Mobile app, so for the best user experience it is better to make sure your course works well without any blocks.';
$string['tour2_title_end'] = 'End of tour';
$string['tour2_content_end'] = 'This has been a user tour, a new feature in Moodle 3.2. It won\'t show again unless you reset it using the link in the footer. The site admin can also create further tours for this site if required.';
@@ -25,7 +25,7 @@ Feature: Add a new user tour
And I add steps to the "First tour" tour:
| targettype | targetvalue_selector | Title | Content |
| Selector | .usermenu | User menu | This is your personal user menu. You'll find your personal preferences and your user profile here. |
When I click on "Dashboard" "link" in the "Navigation" "block"
When I am on homepage
Then I should see "Welcome to your personal learning space. We'd like to give you a quick tour to show you some of the areas you may find helpful"
And I press "Next"
And I should see "This area shows you what's happening in some of your courses"
@@ -38,7 +38,7 @@ Feature: Add a new user tour
And I should see "This area shows you what's happening in some of your courses"
And I press "End tour"
And I should not see "This area shows you what's happening in some of your courses"
And I click on "Dashboard" "link" in the "Navigation" "block"
And I am on homepage
And I should not see "Welcome to your personal learning space. We'd like to give you a quick tour to show you some of the areas you may find helpful"
And I should not see "This area shows you what's happening in some of your courses"
And I follow "Reset user tour on this page"
@@ -58,7 +58,7 @@ Feature: Add a new user tour
And I add steps to the "First tour" tour:
| targettype | Title | Content |
| Display in middle of page | Welcome | Welcome to your personal learning space. We'd like to give you a quick tour to show you some of the areas you may find helpful |
When I click on "Dashboard" "link" in the "Navigation" "block"
When I am on homepage
Then I should not see "Welcome to your personal learning space. We'd like to give you a quick tour to show you some of the areas you may find helpful"
@javascript
@@ -77,5 +77,5 @@ Feature: Add a new user tour
| Display in middle of page | Welcome | Welcome to your personal learning space. We'd like to give you a quick tour to show you some of the areas you may find helpful |
And I open the User tour settings page
When I click on "Enable" "link" in the "My first tour" "table_row"
And I click on "Dashboard" "link" in the "Navigation" "block"
And I am on homepage
Then I should see "Welcome to your personal learning space. We'd like to give you a quick tour to show you some of the areas you may find helpful"
@@ -16,7 +16,7 @@ Feature: Apply tour filters to a tour
And I add steps to the "First tour" tour:
| targettype | Title | Content |
| Display in middle of page | Welcome | Welcome to your personal learning space. We'd like to give you a quick tour to show you some of the areas you may find helpful |
When I click on "Dashboard" "link" in the "Navigation" "block"
When I am on homepage
Then I should not see "Welcome to your personal learning space. We'd like to give you a quick tour to show you some of the areas you may find helpful"
@javascript
+3
View File
@@ -55,5 +55,8 @@ function xmldb_auth_cas_upgrade($oldversion) {
// Moodle v3.1.0 release upgrade line.
// Put any upgrade step following this.
// Automatically generated Moodle v3.2.0 release upgrade line.
// Put any upgrade step following this.
return true;
}
+1
View File
@@ -151,6 +151,7 @@ class login implements renderable, templatable {
$data->rememberusername = $this->rememberusername;
$data->passwordautocomplete = $this->passwordautocomplete;
$data->signupurl = $this->signupurl->out(false);
$data->username = $this->username;
return $data;
}
+55
View File
@@ -31,6 +31,9 @@ class auth_db_testcase extends advanced_testcase {
/** @var string Original error log */
protected $oldlog;
/** @var int The amount of users to create for the large user set deletion test */
protected $largedeletionsetsize = 128;
protected function init_auth_database() {
global $DB, $CFG;
require_once("$CFG->dirroot/auth/db/auth.php");
@@ -444,4 +447,56 @@ class auth_db_testcase extends advanced_testcase {
$this->cleanup_auth_database();
}
/**
* Testing the deletion of a user when there are many users in the external DB.
*/
public function test_deleting_with_many_users() {
global $DB;
$this->resetAfterTest(true);
$this->preventResetByRollback();
$this->init_auth_database();
$auth = get_auth_plugin('db');
$auth->db_init();
// Set to delete from moodle when missing from DB.
set_config('removeuser', AUTH_REMOVEUSER_FULLDELETE, 'auth/db');
$auth->config->removeuser = AUTH_REMOVEUSER_FULLDELETE;
// Create users.
$users = [];
for ($i = 0; $i < $this->largedeletionsetsize; $i++) {
$user = (object)array('username' => "u$i", 'name' => "u$i", 'pass' => 'heslo', 'email' => "u$i@example.com");
$user->id = $DB->insert_record('auth_db_users', $user);
$users[] = $user;
}
// Sync to moodle.
$trace = new null_progress_trace();
$auth->sync_users($trace, true);
// Check user is there.
$user = array_shift($users);
$moodleuser = $DB->get_record('user', array('email' => $user->email, 'auth' => 'db'));
$this->assertNotNull($moodleuser);
$this->assertEquals($user->username, $moodleuser->username);
// Delete a user.
$DB->delete_records('auth_db_users', array('id' => $user->id));
// Sync again.
$auth->sync_users($trace, true);
// Check user is no longer there.
$moodleuser = $DB->get_record('user', array('id' => $moodleuser->id));
$this->assertFalse($auth->user_login($user->username, 'heslo'));
$this->assertEquals(1, $moodleuser->deleted);
// Make sure it was the only user deleted.
$numberdeleted = $DB->count_records('user', array('deleted' => 1, 'auth' => 'db'));
$this->assertEquals(1, $numberdeleted);
$this->cleanup_auth_database();
}
}
+3
View File
@@ -55,5 +55,8 @@ function xmldb_auth_ldap_upgrade($oldversion) {
// Moodle v3.1.0 release upgrade line.
// Put any upgrade step following this.
// Automatically generated Moodle v3.2.0 release upgrade line.
// Put any upgrade step following this.
return true;
}
+3
View File
@@ -43,5 +43,8 @@ function xmldb_auth_manual_upgrade($oldversion) {
// Moodle v3.1.0 release upgrade line.
// Put any upgrade step following this.
// Automatically generated Moodle v3.2.0 release upgrade line.
// Put any upgrade step following this.
return true;
}
+3
View File
@@ -43,5 +43,8 @@ function xmldb_auth_mnet_upgrade($oldversion) {
// Moodle v3.1.0 release upgrade line.
// Put any upgrade step following this.
// Automatically generated Moodle v3.2.0 release upgrade line.
// Put any upgrade step following this.
return true;
}
@@ -0,0 +1,55 @@
@core @core_auth
Feature: Test the 'showlogfailures' feature works.
In order to see my recent login failures when logging in
As a user
I need to have at least one failed login attempt and then log in
Background:
Given the following "users" exist:
| username |
| teacher1 |
And the following config values are set as admin:
| displayloginfailures | 1 |
# Given the user has at least one failed login attempt, when they login, then they should see both header and footer notices.
Scenario: Check that 'displayloginfailures' works without javascript for teachers.
# Simulate a log in failure for the teacher.
Given I am on homepage
And I click on "Log in" "link" in the ".logininfo" "css_element"
And I set the field "Username" to "teacher1"
And I set the field "Password" to "wrongpass"
And I press "Log in"
And I should see "Invalid login, please try again"
# Now, log in with the correct credentials.
When I set the field "Username" to "teacher1"
And I set the field "Password" to "teacher1"
And I press "Log in"
# Confirm the notices are displayed.
Then I should see "1 failed logins since your last login" in the "header.navbar" "css_element"
And I should see "1 failed logins since your last login" in the "page-footer" "region"
# Confirm the notices disappear when navigating to another page.
And I am on homepage
And I should not see "1 failed logins since your last login" in the "header.navbar" "css_element"
And I should not see "1 failed logins since your last login" in the "page-footer" "region"
# Given the user has at least one failed login attempt, when they login, then they should see both header and footer notices.
Scenario: Check that 'displayloginfailures' works without javascript for admins.
# Simulate a log in failure for the teacher.
Given I am on homepage
And I click on "Log in" "link" in the ".logininfo" "css_element"
And I set the field "Username" to "admin"
And I set the field "Password" to "wrongpass"
And I press "Log in"
And I should see "Invalid login, please try again"
# Now, log in with the correct credentials.
When I set the field "Username" to "admin"
And I set the field "Password" to "admin"
And I press "Log in"
# Confirm the notices are displayed.
Then I should see "1 failed logins since your last login" in the "header.navbar" "css_element"
And I should see "1 failed logins since your last login (Logs)" in the "page-footer" "region"
# Confirm that the link works and that the notices disappear when navigating to another page.
And I click on "Logs" "link" in the "page-footer" "region"
And I should see "User login failed" in the "table.reportlog" "css_element"
And I should not see "1 failed logins since your last login" in the "header.navbar" "css_element"
And I should not see "1 failed logins since your last login (Logs)" in the "page-footer" "region"
+50
View File
@@ -0,0 +1,50 @@
@core @core_auth
Feature: Test the 'remember username' feature works.
In order to see my saved username on the login form
As a user
I need to have logged in once before and clicked 'Remember username'
Background:
Given the following "users" exist:
| username |
| teacher1 |
# Given the user has logged in and selected 'Remember username', when they log in again, then their username should be remembered.
Scenario: Check that 'remember username' works without javascript for teachers.
# Log in the first time and check the 'remember username' box.
Given I am on homepage
And I click on "Log in" "link" in the ".logininfo" "css_element"
And I set the field "Username" to "teacher1"
And I set the field "Password" to "teacher1"
And I set the field "Remember username" to "1"
And I press "Log in"
And I log out
# Log out and check that the username was remembered.
When I am on homepage
And I click on "Log in" "link" in the ".logininfo" "css_element"
Then the field "username" matches value "teacher1"
And the field "Remember username" matches value "1"
# Given the user has logged in before and selected 'Remember username', when they log in again and unset 'Remember username', then
# their username should be forgotten for future log in attempts.
Scenario: Check that 'remember username' unsetting works without javascript for teachers.
# Log in the first time and check the 'remember username' box.
Given I am on homepage
And I click on "Log in" "link" in the ".logininfo" "css_element"
And I set the field "Username" to "teacher1"
And I set the field "Password" to "teacher1"
And I set the field "Remember username" to "1"
And I press "Log in"
And I log out
# Log in again, unsetting the 'remember username' field.
When I am on homepage
And I click on "Log in" "link" in the ".logininfo" "css_element"
And I set the field "Password" to "teacher1"
And I set the field "Remember username" to "0"
And I press "Log in"
And I log out
# Check username has been forgotten.
Then I am on homepage
And I click on "Log in" "link" in the ".logininfo" "css_element"
Then the field "username" matches value ""
And the field "Remember username" matches value "0"
-3
View File
@@ -1,3 +0,0 @@
#fitem_id_availabilityconditionsjson .availability_grade input[type=text] {
width: 3em;
}
@@ -115,7 +115,7 @@ Feature: availability_grade
# Give the assignment 40%.
And I follow "A1"
And I click on "View all submissions" "link" in the "Administration" "block"
And I navigate to "View all submissions" in current page administration
# Pick the grade link in the row that has s@example.com in it.
And I click on "Grade" "link" in the "s@example.com" "table_row"
And I set the field "Grade out of 100" to "40"
@@ -101,7 +101,7 @@ Feature: availability_profile
# Edit it again and check the setting still works.
When I follow "P1"
And I navigate to "Edit settings" node in "Page module administration"
And I navigate to "Edit settings" in current page administration
And I expand all fieldsets
Then the field "User profile field" matches value "Super field"
And the field "Value to compare against" matches value "Bananaman"
@@ -216,7 +216,7 @@ Feature: edit_availability
# Check the button still works after saving and editing.
And I press "Save and display"
And I navigate to "Edit settings" node in "Forum administration"
And I navigate to "Edit settings" in current page administration
And I expand all fieldsets
And the "Add group/grouping access restriction" "button" should be disabled
And I should see "Grouping" in the "Restrict access" "fieldset"
+5
View File
@@ -2,6 +2,11 @@ This files describes API changes in /availability/*.
The information here is intended only for developers.
=== 3.2 ===
* Condition plugins must replace the CSS selector "#fitem_id_availabilityconditionsjson" with ".availability-field".
This selector is often used in your plugin's yui/src/form/js/form.js file.
=== 2.9 ===
* Condition plugins can now implement a new include_after_restore function to
+56 -104
View File
@@ -43,19 +43,6 @@ use Behat\Gherkin\Node\TableNode as TableNode,
*/
class behat_backup extends behat_base {
/**
* Follow a link like 'Backup' or 'Import', where the link name comes from
* a language string, in the settings nav block of a course.
* @param string $langstring the lang string to look for. E.g. 'backup' or 'import'.
* @param string $component (optional) second argument to {@link get_string}.
*/
protected function navigate_to_course_settings_link($langstring, $component = '') {
$behatnavigation = new behat_navigation();
$behatnavigation->setMink($this->getMink());
$behatnavigation->i_navigate_to_node_in(get_string($langstring, $component),
get_string('courseadministration'));
}
/**
* Backups the specified course using the provided options. If you are interested in restoring this backup would be
* useful to provide a 'Filename' option.
@@ -70,33 +57,31 @@ class behat_backup extends behat_base {
// Go to homepage.
$this->getSession()->visit($this->locate_path('/?redirect=0'));
$this->execute("behat_general::wait_until_the_page_is_ready");
// Click the course link.
$this->find_link($backupcourse)->click();
$this->execute("behat_general::click_link", $backupcourse);
// Click the backup link.
$this->navigate_to_course_settings_link('backup');
$this->wait();
$this->execute("behat_navigation::i_navigate_to_in_current_page_administration", get_string('backup'));
// Initial settings.
$this->fill_backup_restore_form($this->get_step_options($options, "Initial"));
$this->find_button(get_string('backupstage1action', 'backup'))->press();
$this->wait();
$this->execute("behat_forms::press_button", get_string('backupstage1action', 'backup'));
// Schema settings.
$this->fill_backup_restore_form($this->get_step_options($options, "Schema"));
$this->find_button(get_string('backupstage2action', 'backup'))->press();
$this->wait();
$this->execute("behat_forms::press_button", get_string('backupstage2action', 'backup'));
// Confirmation and review, backup filename can also be specified.
$this->fill_backup_restore_form($this->get_step_options($options, "Confirmation"));
$this->find_button(get_string('backupstage4action', 'backup'))->press();
$this->execute("behat_forms::press_button", get_string('backupstage4action', 'backup'));
// Waiting for it to finish.
$this->wait(self::EXTENDED_TIMEOUT);
$this->execute("behat_general::wait_until_the_page_is_ready");
// Last backup continue button.
$this->find_button(get_string('backupstage16action', 'backup'))->press();
$this->execute("behat_general::i_click_on", array(get_string('backupstage16action', 'backup'), 'button'));
}
/**
@@ -116,21 +101,19 @@ class behat_backup extends behat_base {
$this->getSession()->visit($this->locate_path('/?redirect=0'));
// Click the course link.
$this->find_link($backupcourse)->click();
$this->execute("behat_general::click_link", $backupcourse);
// Click the backup link.
$this->find_link(get_string('backup'))->click();
$this->wait();
$this->execute("behat_navigation::i_navigate_to_in_current_page_administration", get_string('backup'));
// Initial settings.
$this->find_button(get_string('jumptofinalstep', 'backup'))->press();
$this->wait();
$this->execute("behat_forms::press_button", get_string('jumptofinalstep', 'backup'));
// Waiting for it to finish.
$this->wait(self::EXTENDED_TIMEOUT);
$this->execute("behat_general::wait_until_the_page_is_ready");
// Last backup continue button.
$this->find_button(get_string('backupstage16action', 'backup'))->press();
$this->execute("behat_general::i_click_on", array(get_string('backupstage16action', 'backup'), 'button'));
}
/**
@@ -152,15 +135,13 @@ class behat_backup extends behat_base {
// Go to homepage.
$this->getSession()->visit($this->locate_path('/?redirect=0'));
$this->wait();
$this->execute("behat_general::wait_until_the_page_is_ready");
// Click the course link.
$this->find_link($tocourse)->click();
$this->wait();
$this->execute("behat_general::click_link", $tocourse);
// Click the import link.
$this->navigate_to_course_settings_link('import');
$this->wait();
$this->execute("behat_navigation::i_navigate_to_in_current_page_administration", get_string('import'));
// Select the course.
$exception = new ExpectationException('"' . $fromcourse . '" course not found in the list of courses to import from',
@@ -175,25 +156,24 @@ class behat_backup extends behat_base {
$radiofield = new behat_form_field($this->getSession(), $radionode);
$radiofield->set_value(1);
$this->find_button(get_string('continue'))->press();
$this->wait();
$this->execute("behat_forms::press_button", get_string('continue'));
// Initial settings.
$this->fill_backup_restore_form($this->get_step_options($options, "Initial"));
$this->find_button(get_string('importbackupstage1action', 'backup'))->press();
$this->wait();
$this->execute("behat_forms::press_button", get_string('importbackupstage1action', 'backup'));
// Schema settings.
$this->fill_backup_restore_form($this->get_step_options($options, "Schema"));
$this->find_button(get_string('importbackupstage2action', 'backup'))->press();
$this->wait();
$this->execute("behat_forms::press_button", get_string('importbackupstage2action', 'backup'));
// Run it.
$this->find_button(get_string('importbackupstage4action', 'backup'))->press();
$this->wait(self::EXTENDED_TIMEOUT);
$this->execute("behat_forms::press_button", get_string('importbackupstage4action', 'backup'));
// Wait to ensure restore is complete.
$this->execute("behat_general::wait_until_the_page_is_ready");
// Continue and redirect to 'to' course.
$this->find_button(get_string('continue'))->press();
$this->execute("behat_general::i_click_on", array(get_string('continue'), 'button'));
}
/**
@@ -215,17 +195,16 @@ class behat_backup extends behat_base {
$existingcourse = behat_context_helper::escape($existingcourse);
// Selecting the specified course (we can not call behat_forms::select_radio here as is in another behat subcontext).
$radionode = $this->find('xpath', "//div[contains(concat(' ', normalize-space(@class), ' '), ' bcs-existing-course ')]" .
$radionodexpath = "//div[contains(concat(' ', normalize-space(@class), ' '), ' bcs-existing-course ')]" .
"/descendant::div[contains(concat(' ', normalize-space(@class), ' '), ' restore-course-search ')]" .
"/descendant::tr[contains(., $existingcourse)]" .
"/descendant::input[@type='radio']");
$radionode->click();
"/descendant::input[@type='radio']";
$this->execute("behat_general::i_click_on", array($radionodexpath, 'xpath_element'));
// Pressing the continue button of the restore into an existing course section.
$continuenode = $this->find('xpath', "//div[contains(concat(' ', normalize-space(@class), ' '), ' bcs-existing-course ')]" .
"/descendant::input[@type='submit'][@value='" . get_string('continue') . "']");
$continuenode->click();
$this->wait();
$continuenodexpath = "//div[contains(concat(' ', normalize-space(@class), ' '), ' bcs-existing-course ')]" .
"/descendant::input[@type='submit'][@value='" . get_string('continue') . "']";
$this->execute("behat_general::i_click_on", array($continuenodexpath, 'xpath_element'));
// Common restore process using provided key/value options.
$this->process_restore($options);
@@ -246,16 +225,15 @@ class behat_backup extends behat_base {
$this->select_backup($backupfilename);
// The first category in the list.
$radionode = $this->find('xpath', "//div[contains(concat(' ', normalize-space(@class), ' '), ' bcs-new-course ')]" .
$radionodexpath = "//div[contains(concat(' ', normalize-space(@class), ' '), ' bcs-new-course ')]" .
"/descendant::div[contains(concat(' ', normalize-space(@class), ' '), ' restore-course-search ')]" .
"/descendant::input[@type='radio']");
$radionode->click();
"/descendant::input[@type='radio']";
$this->execute("behat_general::i_click_on", array($radionodexpath, 'xpath_element'));
// Pressing the continue button of the restore into an existing course section.
$continuenode = $this->find('xpath', "//div[contains(concat(' ', normalize-space(@class), ' '), ' bcs-new-course ')]" .
"/descendant::input[@type='submit'][@value='" . get_string('continue') . "']");
$continuenode->click();
$this->wait();
$continuenodexpath = "//div[contains(concat(' ', normalize-space(@class), ' '), ' bcs-new-course ')]" .
"/descendant::input[@type='submit'][@value='" . get_string('continue') . "']";
$this->execute("behat_general::i_click_on", array($continuenodexpath, 'xpath_element'));
// Common restore process using provided key/value options.
$this->process_restore($options);
@@ -276,15 +254,14 @@ class behat_backup extends behat_base {
$this->select_backup($backupfilename);
// Merge without deleting radio option.
$radionode = $this->find('xpath', "//div[contains(concat(' ', normalize-space(@class), ' '), 'bcs-current-course')]" .
"/descendant::input[@type='radio'][@name='target'][@value='1']");
$radionode->click();
$radionodexpath = "//div[contains(concat(' ', normalize-space(@class), ' '), 'bcs-current-course')]" .
"/descendant::input[@type='radio'][@name='target'][@value='1']";
$this->execute("behat_general::i_click_on", array($radionodexpath, 'xpath_element'));
// Pressing the continue button of the restore merging section.
$continuenode = $this->find('xpath', "//div[contains(concat(' ', normalize-space(@class), ' '), 'bcs-current-course')]" .
"/descendant::input[@type='submit'][@value='" . get_string('continue') . "']");
$continuenode->click();
$this->wait();
$continuenodexpath = "//div[contains(concat(' ', normalize-space(@class), ' '), 'bcs-current-course')]" .
"/descendant::input[@type='submit'][@value='" . get_string('continue') . "']";
$this->execute("behat_general::i_click_on", array($continuenodexpath, 'xpath_element'));
// Common restore process using provided key/value options.
$this->process_restore($options);
@@ -305,15 +282,14 @@ class behat_backup extends behat_base {
$this->select_backup($backupfilename);
// Delete contents radio option.
$radionode = $this->find('xpath', "//div[contains(concat(' ', normalize-space(@class), ' '), 'bcs-current-course')]" .
"/descendant::input[@type='radio'][@name='target'][@value='0']");
$radionode->click();
$radionodexpath = "//div[contains(concat(' ', normalize-space(@class), ' '), 'bcs-current-course')]" .
"/descendant::input[@type='radio'][@name='target'][@value='0']";
$this->execute("behat_general::i_click_on", array($radionodexpath, 'xpath_element'));
// Pressing the continue button of the restore merging section.
$continuenode = $this->find('xpath', "//div[contains(concat(' ', normalize-space(@class), ' '), 'bcs-current-course')]" .
"/descendant::input[@type='submit'][@value='" . get_string('continue') . "']");
$continuenode->click();
$this->wait();
$continuenodexpath = "//div[contains(concat(' ', normalize-space(@class), ' '), 'bcs-current-course')]" .
"/descendant::input[@type='submit'][@value='" . get_string('continue') . "']";
$this->execute("behat_general::i_click_on", array($continuenodexpath, 'xpath_element'));
// Common restore process using provided key/value options.
$this->process_restore($options);
@@ -340,7 +316,7 @@ class behat_backup extends behat_base {
$restorelink->click();
// Confirm the backup contents.
$restore = $this->find_button(get_string('continue'))->press();
$this->find_button(get_string('continue'))->press();
}
/**
@@ -356,23 +332,20 @@ class behat_backup extends behat_base {
// Settings.
$this->fill_backup_restore_form($this->get_step_options($options, "Settings"));
$this->find_button(get_string('restorestage4action', 'backup'))->press();
$this->wait();
$this->execute("behat_forms::press_button", get_string('restorestage4action', 'backup'));
// Schema.
$this->fill_backup_restore_form($this->get_step_options($options, "Schema"));
$this->find_button(get_string('restorestage8action', 'backup'))->press();
$this->wait();
$this->execute("behat_forms::press_button", get_string('restorestage8action', 'backup'));
// Review, no options here.
$this->find_button(get_string('restorestage16action', 'backup'))->press();
$this->wait();
$this->execute("behat_forms::press_button", get_string('restorestage16action', 'backup'));
// Wait till the final button is visible.
$this->execute("behat_general::wait_until_the_page_is_ready");
// Last restore continue button, redirected to restore course after this.
$this->find_button(get_string('restorestage32action', 'backup'))->press();
// Long wait when waiting for the restore to finish.
$this->wait(self::EXTENDED_TIMEOUT);
$this->execute("behat_general::i_click_on", array(get_string('restorestage32action', 'backup'), 'button'));
}
/**
@@ -431,25 +404,4 @@ class behat_backup extends behat_base {
return $pageoptions;
}
/**
* Waits until the DOM and the page Javascript code is ready.
*
* @param int $timeout The number of seconds that we wait.
* @return void
*/
protected function wait($timeout = false) {
if (!$this->running_javascript()) {
return;
}
if (!$timeout) {
$timeout = self::TIMEOUT;
}
$this->getSession()->wait($timeout * 1000, self::PAGE_READY_JS);
}
}
@@ -41,7 +41,7 @@ Feature: Restore Moodle 2 course backups
Then I should see "Course 1 restored in a new course"
And I should see "Community finder" in the "Community finder" "block"
And I should see "Test forum name"
And I click on "Edit settings" "link" in the "Administration" "block"
And I navigate to "Edit settings" node in "Course administration"
And I expand all fieldsets
And the field "id_format" matches value "Topics format"
And the field "Number of sections" matches value "15"
@@ -83,7 +83,7 @@ Feature: Restore Moodle 2 course backups
When I restore "test_backup.mbz" backup into a new course using this options:
Then I should see "Topic 1"
And I should see "Test forum name"
And I click on "Edit settings" "link" in the "Administration" "block"
And I navigate to "Edit settings" node in "Course administration"
And I expand all fieldsets
And the field "id_format" matches value "Topics format"
And I set the following fields to these values:
@@ -95,14 +95,14 @@ Feature: Restore Moodle 2 course backups
And I press "Save and display"
And I should see "1 January - 7 January"
And I should see "Test forum name"
And I click on "Edit settings" "link" in the "Administration" "block"
And I navigate to "Edit settings" node in "Course administration"
And I expand all fieldsets
And the field "id_format" matches value "Weekly format"
And I set the following fields to these values:
| id_format | Social format |
And I press "Save and display"
And I should see "An open forum for chatting about anything you want to"
And I click on "Edit settings" "link" in the "Administration" "block"
And I navigate to "Edit settings" node in "Course administration"
And I expand all fieldsets
And the field "id_format" matches value "Social format"
And I press "Cancel"
@@ -119,7 +119,7 @@ Feature: Restore Moodle 2 course backups
| Confirmation | Filename | test_backup.mbz |
And I restore "test_backup.mbz" backup into "Course 2" course using this options:
| Schema | Overwrite course configuration | Yes |
And I click on "Edit settings" "link" in the "Administration" "block"
And I navigate to "Edit settings" node in "Course administration"
And I expand all fieldsets
Then the field "id_format" matches value "Topics format"
And the field "Number of sections" matches value "15"
+4
View File
@@ -14,12 +14,16 @@ Feature: Add badges to the system
And I set the field "Default badge issuer name" to "Test Badge Site"
And I set the field "Default badge issuer contact details" to "testuser@example.com"
And I press "Save changes"
And I follow "Badges"
When I follow "Add a new badge"
Then the field "issuercontact" matches value "testuser@example.com"
And the field "issuername" matches value "Test Badge Site"
@javascript
Scenario: Accessing the badges
And I press "Customise this page"
# TODO MDL-57120 site "Badges" link not accessible without navigation block.
And I add the "Navigation" block if not present
Given I navigate to "Site badges" node in "Site pages"
Then I should see "There are no badges available."
@@ -109,7 +109,7 @@ Feature: Block activity modules
| workshop | Test workshop name | Test workshop description | C1 | workshop1 |
When I log in as "admin"
And I follow "Courses"
And I am on course index
And I follow "Course 1"
And I turn editing mode on
And I add the "Activities" block
@@ -50,7 +50,7 @@ Feature: The activity results block displays student scores
And I press "Save and return to course"
And I follow "Course 1"
And I should see "Test page name"
And I go to "View > Grader report" in the course gradebook
And I navigate to "View > Grader report" in the course gradebook
And I turn editing mode on
And I give the grade "90.00" to the user "Student 1" for the grade item "Test assignment 1"
And I give the grade "80.00" to the user "Student 2" for the grade item "Test assignment 1"
@@ -33,7 +33,7 @@ Feature: The activity results block displays student scores
| id_config_nameformat | Display full names |
And I press "Save changes"
When I follow "Test assignment"
And I click on "Edit settings" "link" in the "Administration" "block"
And I navigate to "Edit settings" in current page administration
And I set the following fields to these values:
| id_grade_modgrade_type | None |
And I press "Save and return to course"
@@ -32,7 +32,7 @@ Feature: The activity results block displays student scores
| Description | Offline text |
| assignsubmission_file_enabled | 0 |
And I follow "Course 1"
And I go to "View > Grader report" in the course gradebook
And I navigate to "View > Grader report" in the course gradebook
And I turn editing mode on
And I give the grade "90.00" to the user "Student 1" for the grade item "Test assignment"
And I give the grade "80.00" to the user "Student 2" for the grade item "Test assignment"
@@ -26,7 +26,7 @@ Feature: The activity results block displays student scores as scales
| student5 | C1 | student |
And I log in as "teacher1"
And I follow "Course 1"
And I go to "Scales" in the course gradebook
And I navigate to "Scales" in the course gradebook
And I press "Add a new scale"
And I set the following fields to these values:
| Name | My Scale |
@@ -41,7 +41,7 @@ Feature: The activity results block displays student scores as scales
| id_grade_modgrade_type | Scale |
| id_grade_modgrade_scale | My Scale |
And I follow "Course 1"
And I go to "View > Grader report" in the course gradebook
And I navigate to "View > Grader report" in the course gradebook
And I turn editing mode on
And I give the grade "Excellent!" to the user "Student 1" for the grade item "Test assignment"
And I give the grade "Very good" to the user "Student 2" for the grade item "Test assignment"
@@ -43,7 +43,7 @@ Feature: The activity results block displays student scores as scales
| student6 | G3 |
And I log in as "teacher1"
And I follow "Course 1"
And I go to "Scales" in the course gradebook
And I navigate to "Scales" in the course gradebook
And I press "Add a new scale"
And I set the following fields to these values:
| Name | My Scale |
@@ -59,7 +59,7 @@ Feature: The activity results block displays student scores as scales
| id_grade_modgrade_scale | My Scale |
| Group mode | Separate groups |
And I follow "Course 1"
And I go to "View > Grader report" in the course gradebook
And I navigate to "View > Grader report" in the course gradebook
And I turn editing mode on
And I give the grade "Excellent!" to the user "Student 1" for the grade item "Test assignment"
And I give the grade "Very good" to the user "Student 2" for the grade item "Test assignment"
@@ -50,7 +50,7 @@ Feature: The activity results block displays student scores
| assignsubmission_file_enabled | 0 |
| Group mode | Separate groups |
And I follow "Course 1"
And I go to "View > Grader report" in the course gradebook
And I navigate to "View > Grader report" in the course gradebook
And I turn editing mode on
And I give the grade "100.00" to the user "Student 1" for the grade item "Test assignment"
And I give the grade "90.00" to the user "Student 2" for the grade item "Test assignment"
@@ -50,7 +50,7 @@ Feature: The activity results block displays student scores
| assignsubmission_file_enabled | 0 |
| Group mode | Visible groups |
And I follow "Course 1"
And I go to "View > Grader report" in the course gradebook
And I navigate to "View > Grader report" in the course gradebook
And I turn editing mode on
And I give the grade "100.00" to the user "Student 1" for the grade item "Test assignment"
And I give the grade "90.00" to the user "Student 2" for the grade item "Test assignment"
@@ -32,7 +32,7 @@ Feature: The activity results block displays student scores
| Description | Offline text |
| assignsubmission_file_enabled | 0 |
And I follow "Course 1"
And I go to "View > Grader report" in the course gradebook
And I navigate to "View > Grader report" in the course gradebook
And I turn editing mode on
And I give the grade "90.00" to the user "Student 1" for the grade item "Test assignment"
And I give the grade "80.00" to the user "Student 2" for the grade item "Test assignment"
@@ -26,7 +26,7 @@ Feature: The activity results block displays student scores as scales
| student5 | C1 | student |
And I log in as "teacher1"
And I follow "Course 1"
And I go to "Scales" in the course gradebook
And I navigate to "Scales" in the course gradebook
And I press "Add a new scale"
And I set the following fields to these values:
| Name | My Scale |
@@ -41,7 +41,7 @@ Feature: The activity results block displays student scores as scales
| id_grade_modgrade_type | Scale |
| id_grade_modgrade_scale | My Scale |
And I follow "Course 1"
And I go to "View > Grader report" in the course gradebook
And I navigate to "View > Grader report" in the course gradebook
And I turn editing mode on
And I give the grade "Excellent!" to the user "Student 1" for the grade item "Test assignment"
And I give the grade "Very good" to the user "Student 2" for the grade item "Test assignment"
@@ -43,7 +43,7 @@ Feature: The activity results block displays student scores as scales
| student6 | G3 |
And I log in as "teacher1"
And I follow "Course 1"
And I go to "Scales" in the course gradebook
And I navigate to "Scales" in the course gradebook
And I press "Add a new scale"
And I set the following fields to these values:
| Name | My Scale |
@@ -59,7 +59,7 @@ Feature: The activity results block displays student scores as scales
| id_grade_modgrade_scale | My Scale |
| Group mode | Separate groups |
And I follow "Course 1"
And I go to "View > Grader report" in the course gradebook
And I navigate to "View > Grader report" in the course gradebook
And I turn editing mode on
And I give the grade "Excellent!" to the user "Student 1" for the grade item "Test assignment"
And I give the grade "Very good" to the user "Student 2" for the grade item "Test assignment"
@@ -50,7 +50,7 @@ Feature: The activity results block displays student scores
| assignsubmission_file_enabled | 0 |
| Group mode | Separate groups |
And I follow "Course 1"
And I go to "View > Grader report" in the course gradebook
And I navigate to "View > Grader report" in the course gradebook
And I turn editing mode on
And I give the grade "100.00" to the user "Student 1" for the grade item "Test assignment"
And I give the grade "90.00" to the user "Student 2" for the grade item "Test assignment"
@@ -50,7 +50,7 @@ Feature: The activity results block displays student scores
| assignsubmission_file_enabled | 0 |
| Group mode | Visible groups |
And I follow "Course 1"
And I go to "View > Grader report" in the course gradebook
And I navigate to "View > Grader report" in the course gradebook
And I turn editing mode on
And I give the grade "100.00" to the user "Student 1" for the grade item "Test assignment"
And I give the grade "90.00" to the user "Student 2" for the grade item "Test assignment"
+3
View File
@@ -85,5 +85,8 @@ function xmldb_block_badges_upgrade($oldversion, $block) {
// Moodle v3.1.0 release upgrade line.
// Put any upgrade step following this.
// Automatically generated Moodle v3.2.0 release upgrade line.
// Put any upgrade step following this.
return true;
}
@@ -35,5 +35,4 @@ Feature: Enable Block Badges on the dashboard and view awarded badges
And I press "Award badge"
And I log out
When I log in as "teacher1"
And I click on "Dashboard" "link" in the "Navigation" "block"
Then I should see "Badge 1" in the "Latest badges" "block"
@@ -12,6 +12,8 @@ Feature: Feature: Students can use the recent blog entries block to view recent
And I am on site homepage
And I navigate to "Turn editing on" node in "Front page settings"
And I add the "Recent blog entries" block
# TODO MDL-57120 site "Blogs" link not accessible without navigation block.
And I add the "Navigation" block if not present
And I log out
Scenario: Students use the recent blog entries block to view blogs
+6 -2
View File
@@ -24,8 +24,11 @@ Feature: Adding blog tag block
And I follow "Course 1"
And I turn editing mode on
And I add the "Blog tags" block
# TODO MDL-57120 site "Blogs" link not accessible without navigation block.
And I add the "Navigation" block if not present
And I navigate to "Course blogs" node in "My courses > c1 > Participants"
And I navigate to course participants
And I click on "Course blogs" "link" in the "Navigation" "block"
And I follow "Blog about this Course"
And I set the following fields to these values:
| Entry title | Blog post from teacher |
@@ -35,7 +38,8 @@ Feature: Adding blog tag block
And I log out
And I log in as "student1"
And I follow "Course 1"
And I navigate to "Course blogs" node in "My courses > c1 > Participants"
And I navigate to course participants
And I click on "Course blogs" "link" in the "Navigation" "block"
And I follow "Blog about this Course"
And I set the following fields to these values:
| Entry title | Blog post from student |
+3
View File
@@ -85,5 +85,8 @@ function xmldb_block_calendar_month_upgrade($oldversion, $block) {
// Moodle v3.1.0 release upgrade line.
// Put any upgrade step following this.
// Automatically generated Moodle v3.2.0 release upgrade line.
// Put any upgrade step following this.
return true;
}
@@ -86,7 +86,7 @@ Feature: Enable the calendar block in a course and test it's functionality
And I create a calendar event with form data:
| id_eventtype | User |
| id_name | User Event |
When I click on "Dashboard" "link" in the "Navigation" "block"
When I am on homepage
And I follow "Course 1"
And I follow "Hide course events"
And I hover over today in the calendar
@@ -102,7 +102,7 @@ Feature: Enable the calendar block in a course and test it's functionality
And I create a calendar event with form data:
| id_eventtype | User |
| id_name | User Event |
When I click on "Dashboard" "link" in the "Navigation" "block"
When I am on homepage
And I follow "Course 1"
And I hover over today in the calendar
Then I should see "User Event"
@@ -120,7 +120,7 @@ Feature: Enable the calendar block in a course and test it's functionality
And I create a calendar event with form data:
| id_eventtype | User |
| id_name | User Event |
When I click on "Dashboard" "link" in the "Navigation" "block"
When I am on homepage
And I follow "Course 1"
And I follow "Hide user events"
And I hover over today in the calendar
+3
View File
@@ -85,5 +85,8 @@ function xmldb_block_calendar_upcoming_upgrade($oldversion, $block) {
// Moodle v3.1.0 release upgrade line.
// Put any upgrade step following this.
// Automatically generated Moodle v3.2.0 release upgrade line.
// Put any upgrade step following this.
return true;
}
+3
View File
@@ -58,5 +58,8 @@ function xmldb_block_community_upgrade($oldversion) {
// Moodle v3.1.0 release upgrade line.
// Put any upgrade step following this.
// Automatically generated Moodle v3.2.0 release upgrade line.
// Put any upgrade step following this.
return true;
}
+3
View File
@@ -60,5 +60,8 @@ function xmldb_block_completionstatus_upgrade($oldversion, $block) {
// Moodle v3.1.0 release upgrade line.
// Put any upgrade step following this.
// Automatically generated Moodle v3.2.0 release upgrade line.
// Put any upgrade step following this.
return true;
}
@@ -43,7 +43,7 @@ Feature: Enable Block Completion in a course
And I follow "Course 1"
And I turn editing mode on
And I follow "Test page name"
And I navigate to "Edit settings" node in "Page module administration"
And I navigate to "Edit settings" in current page administration
And I set the following fields to these values:
| Completion tracking | Show activity as complete when conditions are met |
| Require view | 1 |
@@ -25,7 +25,7 @@ Feature: Enable Block Completion in a course using activity completion
And I follow "Course 1"
And I turn editing mode on
And I follow "Test page name"
And I navigate to "Edit settings" node in "Page module administration"
And I navigate to "Edit settings" in current page administration
And I set the following fields to these values:
| Completion tracking | Show activity as complete when conditions are met |
| Require view | 1 |
@@ -47,7 +47,7 @@ Feature: Enable Block Completion in a course using activity completion
And I follow "Course 1"
And I turn editing mode on
And I follow "Test page name"
And I navigate to "Edit settings" node in "Page module administration"
And I navigate to "Edit settings" in current page administration
And I set the following fields to these values:
| Completion tracking | Show activity as complete when conditions are met |
| Require view | 1 |
@@ -153,7 +153,6 @@ Feature: View the course overview block on the dashboard and test it's functiona
And I click on "Enable" "link" in the "Course meta link" "table_row"
And I am on site homepage
And I follow "Course 2"
And I navigate to "Enrolment methods" node in "Course administration > Users"
And I add "Course meta link" enrolment method with:
| Link course | C1 |
And I log out
+3
View File
@@ -60,5 +60,8 @@ function xmldb_block_course_summary_upgrade($oldversion, $block) {
// Moodle v3.1.0 release upgrade line.
// Put any upgrade step following this.
// Automatically generated Moodle v3.2.0 release upgrade line.
// Put any upgrade step following this.
return true;
}
@@ -10,7 +10,7 @@ Scenario: Admin can add random glossary block to the frontpage
| glossary | Tips and Tricks | Frontpage glossary description | Acceptance test site | glossary0 |
And I log in as "admin"
And I am on site homepage
And I click on "Turn editing on" "link" in the "Administration" "block"
And I turn editing mode on
And I add the "Random glossary entry" block
And I configure the "block_glossary_random" block
And I set the following fields to these values:
+3
View File
@@ -45,5 +45,8 @@ function xmldb_block_html_upgrade($oldversion) {
// Moodle v3.1.0 release upgrade line.
// Put any upgrade step following this.
// Automatically generated Moodle v3.2.0 release upgrade line.
// Put any upgrade step following this.
return true;
}
@@ -8,7 +8,7 @@ Feature: Adding and configuring HTML blocks
Scenario: Configuring the HTML block with Javascript on
Given I log in as "admin"
And I am on site homepage
When I click on "Turn editing on" "link" in the "Administration" "block"
When I turn editing mode on
And I add the "HTML" block
And I configure the "(new HTML block)" block
And I set the field "Content" to "Static text without a header"
@@ -25,7 +25,7 @@ Feature: Adding and configuring HTML blocks
Scenario: Configuring the HTML block with Javascript off
Given I log in as "admin"
And I am on site homepage
When I click on "Turn editing on" "link" in the "Administration" "block"
When I turn editing mode on
And I add the "HTML" block
And I configure the "(new HTML block)" block
And I set the field "Content" to "Static text without a header"
@@ -7,7 +7,7 @@ Feature: Adding and configuring HTML blocks
Background:
Given I log in as "admin"
And I am on site homepage
When I click on "Turn editing on" "link" in the "Administration" "block"
When I turn editing mode on
And I add the "HTML" block
Scenario: Other users can not see HTML block that has not been configured
+3
View File
@@ -67,5 +67,8 @@ function xmldb_block_navigation_upgrade($oldversion, $block) {
// Moodle v3.1.0 release upgrade line.
// Put any upgrade step following this.
// Automatically generated Moodle v3.2.0 release upgrade line.
// Put any upgrade step following this.
return true;
}
@@ -38,6 +38,13 @@ Feature: Expand the courses nodes within the navigation block
| navshowallcourses | 1 |
And I log in as "admin"
And I am on site homepage
And I turn editing mode on
And I add the "Navigation" block if not present
And I configure the "Navigation" block
And I set the following fields to these values:
| Page contexts | Display throughout the entire site |
And I press "Save changes"
And I turn editing mode off
And I follow "Course 2"
And I navigate to "Enrolment methods" node in "Course administration > Users"
And I click on "Edit" "link" in the "Guest access" "table_row"
@@ -15,13 +15,22 @@ Feature: Displaying the link to the Participants page
And the following "course enrolments" exist:
| user | course | role |
| student1 | C1 | student |
And I log in as "admin"
And I am on site homepage
And I turn editing mode on
And I add the "Navigation" block if not present
And I configure the "Navigation" block
And I set the following fields to these values:
| Page contexts | Display throughout the entire site |
And I press "Save changes"
And I log out
@javascript
Scenario: Course participants link is displayed to enrolled students after expanding the course node
When I log in as "student1"
And I expand "C1" node
Then "Participants" "link" should exist in the "Navigation" "block"
And I navigate to "Participants" node in "My courses > C1"
And I click on "Participants" "link" in the "Navigation" "block"
And I should see "Participants"
And "Student One" "link" should exist
And "Student Two" "link" should not exist
@@ -29,7 +38,7 @@ Feature: Displaying the link to the Participants page
Scenario: Site participants link is displayed to admins
When I log in as "admin"
Then "Participants" "link" should exist in the "Navigation" "block"
And I navigate to "Participants" node in "Site pages"
And I click on "Participants" "link" in the "Navigation" "block"
And I should see "Participants"
And "Student One" "link" should exist
And "Student Two" "link" should exist
@@ -29,6 +29,15 @@ Feature: View my courses in navigation block
| student1 | c1 | student |
| student1 | c31 | student |
| student1 | c331 | student |
And I log in as "admin"
And I am on site homepage
And I turn editing mode on
And I add the "Navigation" block if not present
And I configure the "Navigation" block
And I set the following fields to these values:
| Page contexts | Display throughout the entire site |
And I press "Save changes"
And I log out
@javascript
Scenario: The plain list of enrolled courses is shown
@@ -13,7 +13,7 @@ Feature: Latest announcements block displays the course latest news
And I create a course with:
| Course full name | Course 1 |
| Course short name | C1 |
| News items to show | 5 |
| Number of announcements | 5 |
And I enrol "Teacher 1" user as "Teacher"
And I log out
And I log in as "teacher1"
@@ -34,15 +34,15 @@ Feature: Latest announcements block displays the course latest news
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"
And I click on "Edit settings" "link" in the "Administration" "block"
And I navigate to "Edit settings" in current page administration
And I set the following fields to these values:
| News items to show | 2 |
| Number of announcements | 2 |
And I press "Save and display"
And I should not 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"
And I click on "Edit settings" "link" in the "Administration" "block"
And I navigate to "Edit settings" in current page administration
And I set the following fields to these values:
| News items to show | 0 |
| Number of announcements | 0 |
And I press "Save and display"
And "Latest announcements" "block" should not exist
+3
View File
@@ -110,5 +110,8 @@ function xmldb_block_quiz_results_upgrade($oldversion, $block) {
// Moodle v3.1.0 release upgrade line.
// Put any upgrade step following this.
// Automatically generated Moodle v3.2.0 release upgrade line.
// Put any upgrade step following this.
return true;
}
+3
View File
@@ -59,5 +59,8 @@ function xmldb_block_recent_activity_upgrade($oldversion, $block) {
// Moodle v3.1.0 release upgrade line.
// Put any upgrade step following this.
// Automatically generated Moodle v3.2.0 release upgrade line.
// Put any upgrade step following this.
return true;
}
@@ -165,7 +165,7 @@ Feature: View structural changes in recent activity block
And I log in as "teacher1"
And I follow "Course 1"
And I follow "ForumNew"
And I click on "Edit settings" "link" in the "Administration" "block"
And I navigate to "Edit settings" in current page administration
And I set the following fields to these values:
| name | ForumUpdated |
And I press "Save and return to course"
+3
View File
@@ -56,5 +56,8 @@ function xmldb_block_rss_client_upgrade($oldversion) {
// Moodle v3.1.0 release upgrade line.
// Put any upgrade step following this.
// Automatically generated Moodle v3.2.0 release upgrade line.
// Put any upgrade step following this.
return true;
}
@@ -43,7 +43,7 @@ Feature: The search forums block allows users to search for forum posts
And I follow "Course 1"
And I turn editing mode on
And I follow "Announcements"
And I navigate to "Edit settings" node in "Forum administration"
And I navigate to "Edit settings" in current page administration
And I expand all fieldsets
And I set the field "id_visible" to "0"
And I press "Save and return to course"
+3
View File
@@ -61,5 +61,8 @@ function xmldb_block_section_links_upgrade($oldversion, $block) {
// Moodle v3.1.0 release upgrade line.
// Put any upgrade step following this.
// Automatically generated Moodle v3.2.0 release upgrade line.
// Put any upgrade step following this.
return true;
}
+3
View File
@@ -60,5 +60,8 @@ function xmldb_block_selfcompletion_upgrade($oldversion, $block) {
// Moodle v3.1.0 release upgrade line.
// Put any upgrade step following this.
// Automatically generated Moodle v3.2.0 release upgrade line.
// Put any upgrade step following this.
return true;
}
+3
View File
@@ -67,5 +67,8 @@ function xmldb_block_settings_upgrade($oldversion, $block) {
// Moodle v3.1.0 release upgrade line.
// Put any upgrade step following this.
// Automatically generated Moodle v3.2.0 release upgrade line.
// Put any upgrade step following this.
return true;
}
+16
View File
@@ -25,6 +25,8 @@
// NOTE: no MOODLE_INTERNAL test here, this file may be required by behat before including /config.php.
use Behat\Mink\Exception\ElementNotFoundException as ElementNotFoundException;
require_once(__DIR__ . '/../../../lib/behat/behat_base.php');
/**
@@ -56,6 +58,20 @@ class behat_blocks extends behat_base {
}
}
/**
* Adds the selected block if it is not already present. Editing mode must be previously enabled.
*
* @Given /^I add the "(?P<block_name_string>(?:[^"]|\\")*)" block if not present$/
* @param string $blockname
*/
public function i_add_the_block_if_not_present($blockname) {
try {
$this->get_text_selector_node('block', $blockname);
} catch (ElementNotFoundException $e) {
$this->execute('behat_blocks::i_add_the_block', [$blockname]);
}
}
/**
* Docks a block. Editing mode should be previously enabled.
*
@@ -50,9 +50,8 @@ Feature: Add and configure blocks throughout the site
Scenario: Blocks on the dashboard page can have roles assigned to them
Given I log in as "manager1"
And I click on "Dashboard" "link" in the "Navigation" "block"
When I press "Customise this page"
Then I should see "Assign roles in Navigation block"
Then I should see "Assign roles in Private files block"
Scenario: Blocks on courses can have roles assigned to them
Given I log in as "teacher1"
@@ -64,7 +63,7 @@ Feature: Add and configure blocks throughout the site
@javascript
Scenario: Blocks can safely be customised
Given I log in as "admin"
And I click on "Dashboard" "link" in the "Navigation" "block"
And I am on homepage
And I press "Customise this page"
And I add the "HTML" block
And I configure the "(new HTML block)" block
@@ -30,8 +30,7 @@ Feature: Allowed blocks controls
| block/activity_modules:addinstance | Prohibit |
And I am on site homepage
And I follow "Course 1"
And I expand "Users" node
And I follow "Permissions"
And I navigate to "Users > Permissions" in current page administration
And I override the system permissions of "Teacher" role with:
| block/completionstatus:addinstance | Prohibit |
And I log out
@@ -14,7 +14,7 @@ Feature: The context of a block can always be returned to it's original state.
And I follow "Turn editing on"
And I add the "Tags" block
Then I should see "Tags" in the "Tags" "block"
And I click on "Participants" "link" in the "//li[p/a[contains(normalize-space(string(.)), 'Courses')]]" "xpath_element"
And I navigate to course participants
And I configure the "Tags" block
And I set the following fields to these values:
| Display on page types | Any page |
@@ -31,7 +31,7 @@ Feature: The context of a block can always be returned to it's original state.
And I should see "Tags" in the "Tags" "block"
And I follow "Course 1"
And "Tags" "block" should not exist
And I navigate to "Participants" node in "Courses > C1"
And I navigate to course participants
And "Tags" "block" should not exist
And I follow "Course 1"
And I add a "Assignment" to section "1" and I fill the form with:
@@ -45,5 +45,5 @@ Feature: The context of a block can always be returned to it's original state.
And I press "Save changes"
And I follow "Course 1"
And I should see "Tags" in the "Tags" "block"
And I navigate to "Participants" node in "Courses > C1"
And I navigate to course participants
And I should see "Tags" in the "Tags" "block"
+1 -1
View File
@@ -27,7 +27,7 @@ Feature: Blogs can be set to be only visible by the author.
Scenario: A student can not see another student's blog entries.
Given I log in as "testuser"
And I follow "Course 1"
And I follow "Participants"
And I navigate to course participants
And I follow "Test2 User2"
And I should see "Miscellaneous"
Then I should not see "Blog entries"
+14 -8
View File
@@ -9,9 +9,18 @@ Feature: Comment on a blog entry
| username | firstname | lastname | email |
| testuser | Test | User | moodle@example.com |
| testuser2 | Test2 | User2 | moodle2@example.com |
And I log in as "admin"
And I am on site homepage
And I turn editing mode on
# TODO MDL-57120 "Site blogs" link not accessible without navigation block.
And I add the "Navigation" block if not present
And I configure the "Navigation" block
And I set the following fields to these values:
| Page contexts | Display throughout the entire site |
And I press "Save changes"
And I log out
And I log in as "testuser"
And I expand "Site pages" node
And I follow "Site blogs"
And I navigate to "Site blogs" node in "Site pages"
And I follow "Add a new entry"
And I set the following fields to these values:
| Entry title | Blog post from user 1 |
@@ -23,8 +32,7 @@ Feature: Comment on a blog entry
Scenario: Commenting on my own blog entry
Given I am on site homepage
And I log in as "testuser"
And I expand "Site pages" node
And I follow "Site blogs"
And I navigate to "Site blogs" node in "Site pages"
And I follow "Blog post from user 1"
And I should see "User 1 blog post content"
And I follow "Comments (0)"
@@ -39,8 +47,7 @@ Feature: Comment on a blog entry
Scenario: Deleting my own comment
Given I am on site homepage
And I log in as "testuser"
And I expand "Site pages" node
And I follow "Site blogs"
And I navigate to "Site blogs" node in "Site pages"
And I follow "Blog post from user 1"
And I should see "User 1 blog post content"
And I follow "Comments (0)"
@@ -60,8 +67,7 @@ Feature: Comment on a blog entry
Given I am on site homepage
And I log in as "testuser2"
And I am on site homepage
And I expand "Site pages" node
And I follow "Site blogs"
And I navigate to "Site blogs" node in "Site pages"
And I follow "Blog post from user 1"
When I follow "Comments (0)"
And I set the field "content" to "$My own >nasty< \"string\"!"

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