Compare commits

...

646 Commits

Author SHA1 Message Date
Eloy Lafuente (stronk7) d16cdbd81f Moodle release 2.9.4 2016-01-09 00:49:51 +01:00
Dan Poltawski dccbafa7e9 weekly release 2.9.3+ 2016-01-08 07:45:59 +00:00
Dan Poltawski db0f899c72 Merge branch 'wip-mdl-52685-m29' of https://github.com/rajeshtaneja/moodle into MOODLE_29_STABLE 2016-01-08 07:40:23 +00:00
Rajesh Taneja 505b87d89d MDL-52685 behat: keep doctrine/cache at 1.5.x for PHP 5.4.4 support 2016-01-08 16:41:20 +10:00
Dan Poltawski 8069645f56 weekly release 2.9.3+ 2016-01-07 08:32:41 +00:00
Dan Poltawski e4ddf13091 Merge branch 'install_29_STABLE' of https://git.in.moodle.com/amosbot/moodle-install into MOODLE_29_STABLE 2016-01-07 08:32:39 +00:00
AMOS bot 08aeda7b07 Automatically generated installer lang files 2016-01-07 00:04:43 +08:00
Rajesh Taneja 97ef1d1420 MDL-52614 mod_workshop: right align for dir-rtl only 2016-01-06 13:38:34 +08:00
AMOS bot 9c56531610 Automatically generated installer lang files 2016-01-06 00:04:18 +08:00
Dan Poltawski 0d8bbb774e Merge branch 'MDL-52503_29' of git://github.com/dmonllao/moodle into MOODLE_29_STABLE 2016-01-05 15:30:59 +00:00
Juan Leyva 518f8a7ced MDL-52072 enrol: Fix course visibility checks in external functions 2016-01-05 10:31:36 +00:00
David Monllao ebbb58556a MDL-52503 mod_assign: Removing session cache
Replaced with a global $SESSION var, deferring cleanup to session
destroy.
2016-01-05 17:51:14 +08:00
Andrew Nicols 0f479ba76e Merge branch 'wip-mdl-51881-m29' of https://github.com/rajeshtaneja/moodle into MOODLE_29_STABLE 2016-01-05 14:09:47 +08:00
Rajesh Taneja 3c3ed4c0f8 MDL-51881 behat: updated composer pointing to new tag 2016-01-05 14:06:25 +08:00
Rajesh Taneja 17babdbaf7 MDL-51881 behat: Set navbar to be absolutely positioned
All behat drivers are now replicating human behavior
so when the browser scrolls something into view it doesn't account
for fixed positioned elements that end up obscuring the item thus
leading to errors that could be avoided by scrolling an additional amount.
2016-01-05 14:06:24 +08:00
Andrew Nicols dcc8e34187 Merge branch 'MDL-52078-29' of git://github.com/cameron1729/moodle into MOODLE_29_STABLE 2016-01-05 13:55:54 +08:00
Cameron Ball 39dce68e4a MDL-52078 gradebook: Behat tests for hidden grade items. 2016-01-05 13:49:37 +08:00
Peter Miller 374639d3e6 MDL-52078 gradebook: Stop totals including hidden items.
This patch fixes a problem where the course and user reports, when viewed by
a student, were incorrectly including hidden grade items in the course totals,
making the percentages lower than they should be.
2016-01-05 13:49:36 +08:00
Dan Poltawski 62fe924127 MDL-52552 course management: insufficient cleaning of search output 2016-01-05 10:50:06 +08:00
Nadav Kavalerchik 69e22263ad MDL-52625 Badges: Right align manage badges table content, in RTL mode. 2016-01-05 08:49:55 +08:00
Nadav Kavalerchik d3b1d6a004 MDL-52614 Workshop: Right align user's picture on Assessed submission. 2016-01-04 18:14:03 +00:00
Dan Poltawski a286741d9c Merge branch 'MDL-52645-29-enfix' of git://github.com/mudrd8mz/moodle into MOODLE_29_STABLE 2016-01-04 15:35:22 +00:00
Dan Poltawski d9ddd1d13d Merge branch 'wip-mdl-52605-m29' of https://github.com/rajeshtaneja/moodle into MOODLE_29_STABLE 2016-01-04 13:42:09 +00:00
Dan Poltawski 82470d8ebc Merge branch 'MDL-52638_m29v1' of https://github.com/sbourget/moodle into MOODLE_29_STABLE 2016-01-04 11:36:41 +00:00
Helen Foster 0272a95dc8 MDL-52645 lang: Merge English strings from the en_fix language pack 2016-01-04 11:56:43 +01:00
Andrew Nicols 048f8d9ae7 Merge branch 'MDL-49566_m29' of git://github.com/markn86/moodle into MOODLE_29_STABLE 2016-01-04 13:57:51 +08:00
Stephen Bourget e259354c91 MDL-52638 activity_results: Improve Behat tests 2016-01-03 21:04:32 -05:00
Andrew Nicols 5994edb30b Merge branch 'MDL-51445_m29v1' of https://github.com/sbourget/moodle into MOODLE_29_STABLE 2016-01-04 09:24:44 +08:00
Rajesh Taneja 0d8ad43873 MDL-52605 phpunit: Keep track of initial reset sequence 2016-01-04 07:59:25 +08:00
Rajesh Taneja 91d5491ee2 MDL-52605 phpunit: Check file only if needed 2016-01-04 07:59:25 +08:00
Mark Nielsen 8d94e92599 MDL-52605 phpunit: Prevent querying database metadata 2016-01-04 07:59:24 +08:00
Mark Nielsen 8e00c5c8ed MDL-52605 phpunit: Improve get_message_processors reset 2016-01-04 07:59:24 +08:00
AMOS bot 078babf6d2 Automatically generated installer lang files 2016-01-04 00:04:37 +08:00
Stephen Bourget 9a03fe6ebd MDL-51445 Chat: Fix broken profile links 2015-12-31 11:10:09 -05:00
Dan Poltawski 8a48bf5beb weekly release 2.9.3+ 2015-12-31 08:16:41 +00:00
Dan Poltawski 2780c284c5 Merge branch 'install_29_STABLE' of https://git.in.moodle.com/amosbot/moodle-install into MOODLE_29_STABLE 2015-12-31 08:16:39 +00:00
David Monllao e73d9075e9 MDL-52347 format_social: Replicate wait between new discussions 2015-12-31 13:22:27 +08:00
Dan Poltawski 0cad1c25dc Merge branch 'MDL-50357_29' of git://github.com/markn86/moodle into MOODLE_29_STABLE 2015-12-30 09:19:37 +00:00
AMOS bot 80ea373e2c Automatically generated installer lang files 2015-12-30 00:04:16 +08:00
Michael Aherne 13f89eaf11 MDL-52439 assign: correct get_user_submission() phpdoc 2015-12-29 10:38:32 +00:00
Dan Poltawski c72cac3879 Merge branch 'MDL-52275_m29' of git://github.com/markn86/moodle into MOODLE_29_STABLE 2015-12-29 10:04:52 +00:00
Mark Nelson 7238ffc65d MDL-49566 core: used reflection in unit tests
Also split the tests into multiple functions for each scenario.
2015-12-29 17:49:34 +08:00
Ankit Agarwal 75bc323bf1 MDL-49566 core: Write unittests for MDL-45898 2015-12-29 17:48:53 +08:00
Ankit Agarwal 15d4f7a72a MDL-49566 myprofile: Fix bugs in myprofilelib 2015-12-29 17:43:06 +08:00
Ankit Agarwal e056d8b19d MDL-49566 notes: Notes link should not show up for guests 2015-12-29 17:43:05 +08:00
David Monllao 26ec60a016 Merge branch 'MDL-51889_m29' of git://github.com/markn86/moodle into MOODLE_29_STABLE 2015-12-29 15:35:50 +08:00
Eugene Venter 2de94975a3 MDL-52530 unittest: more robust capability assignments for guest
for core_files_file_storage_testcase and core_repositorylib_testcase
2015-12-29 14:06:44 +08:00
David Monllao ab7493b61c Merge branch 'wip-mdl-52347-m29' of git://github.com/rajeshtaneja/moodle into MOODLE_29_STABLE 2015-12-29 14:03:41 +08:00
Mark Nelson b826a2a180 MDL-51889 enrol_guest: always check password before re-enabling 2015-12-29 13:50:00 +08:00
David Monllao 384711fe8c Merge branch 'MDL-52591-29' of git://github.com/danpoltawski/moodle into MOODLE_29_STABLE 2015-12-29 13:47:31 +08:00
David Monllao 401c7b680d MDL-52597 mod_forum: Remove duplicated query 2015-12-29 10:04:16 +08:00
David Monllao 333097ea67 Merge branch 'MDL-52597-29' of git://github.com/andrewnicols/moodle into MOODLE_29_STABLE 2015-12-29 10:01:43 +08:00
AMOS bot 1d96718214 Automatically generated installer lang files 2015-12-29 00:04:16 +08:00
AMOS bot 012f850733 Automatically generated installer lang files 2015-12-28 00:04:28 +08:00
AMOS bot 690d2c69a3 Automatically generated installer lang files 2015-12-25 00:04:23 +08:00
Marina Glancy a0c5c98dc5 MDL-52347 behat: fix random failures on fast computer 2015-12-24 14:19:33 +08:00
Rajesh Taneja 9e1feec44b MDL-52606 behat: Added time delay to avoid random fails
If attempts are created at same timestamp, then results are
not same, and lesson module finds that attmpt was in progress.
To avoid this problem, attempts should be created at different
timestamp.
2015-12-24 14:02:44 +08:00
Dan Poltawski 2a416b3466 weekly release 2.9.3+ 2015-12-23 11:35:57 +00:00
Dan Poltawski a3fbe80044 Merge branch 'install_29_STABLE' of https://git.in.moodle.com/amosbot/moodle-install into MOODLE_29_STABLE 2015-12-23 11:35:53 +00:00
Mark Nelson 38ac93aace MDL-52275 core: fixed grade-to-pass being overwritten
Thanks goes to W.J. Roes for the patch.
2015-12-23 16:52:51 +08:00
Andrew Nicols 403a814535 MDL-52597 mod_forum: Remove sleep from tests 2015-12-23 14:32:28 +08:00
Andrew Nicols 7dabe1053c Merge branch 'MDL-52355-29' of git://github.com/junpataleta/moodle into MOODLE_29_STABLE 2015-12-23 10:06:14 +08:00
Dan Poltawski e1011a09cf MDL-52591 grunt: make shifter task respect --no-color 2015-12-22 18:37:58 +00:00
Eloy Lafuente (stronk7) 81c8f80dae Merge branch 'MDL-49743-29' of git://github.com/danpoltawski/moodle into MOODLE_29_STABLE 2015-12-22 17:14:33 +01:00
AMOS bot 65d64de0cd Automatically generated installer lang files 2015-12-23 00:04:22 +08:00
Dan Poltawski 94d60b142c Merge branch 'm29_MDL-51916' of https://github.com/danmarsden/moodle into MOODLE_29_STABLE 2015-12-22 13:17:59 +00:00
Eloy Lafuente (stronk7) 561f53a702 Merge branch 'MDL-51719-29' of git://github.com/danpoltawski/moodle into MOODLE_29_STABLE 2015-12-22 13:15:53 +01:00
Dan Poltawski 27527f6c36 MDL-52017 enrol_self: fix incorrect empty statement
Ironically this was detected by causing a syntax error on php54
2015-12-22 09:52:08 +00:00
David Monllao a53db0ab73 Merge branch 'MDL-52017_m29' of git://github.com/markn86/moodle into MOODLE_29_STABLE 2015-12-22 16:37:29 +08:00
Andrew Nicols e493cb7d9c Merge branch 'MDL-52250-29' of git://github.com/danpoltawski/moodle into MOODLE_29_STABLE 2015-12-22 15:05:30 +08:00
Andrew Nicols 0dc39f21c3 Merge branch 'MDL-23128-29' of git://github.com/danpoltawski/moodle into MOODLE_29_STABLE 2015-12-22 13:12:08 +08:00
David Monllao 2d89b5ea52 Merge branch 'wip-mdl-52376-m29' of git://github.com/rajeshtaneja/moodle into MOODLE_29_STABLE 2015-12-22 11:25:12 +08:00
David Monllao 6af476cab2 Merge branch 'MDL-52558-m29' of git://github.com/sammarshallou/moodle into MOODLE_29_STABLE 2015-12-22 11:17:06 +08:00
Rajesh Taneja 785f9f97a8 MDL-52427 behat: Fixed question selectors
As class is changed, we need to convert selector
to check if class is contained, rather then checking
selecting with specific class.
2015-12-22 10:33:07 +08:00
Andrew Nicols 110843c03c Merge branch 'MDL-52334_29' of git://github.com/aolley/moodle into MOODLE_29_STABLE 2015-12-22 09:18:17 +08:00
Dan Poltawski 396e086575 Merge branch 'MDL-52380-29' of git://github.com/junpataleta/moodle into MOODLE_29_STABLE 2015-12-21 16:47:23 +00:00
Dan Poltawski c2ab40848b Merge branch 'MDL-52354-29' of git://github.com/junpataleta/moodle into MOODLE_29_STABLE 2015-12-21 16:41:05 +00:00
Dan Poltawski 7f4cd77843 Merge branch 'MDL-52427_29' of git://github.com/timhunt/moodle into MOODLE_29_STABLE 2015-12-21 13:27:42 +00:00
Dan Poltawski b074e8a1a2 Merge branch 'MDL-52402_29' of git://github.com/mr-russ/moodle into MOODLE_29_STABLE 2015-12-21 12:46:21 +00:00
Dan Poltawski affd686294 Merge branch 'MDL-52455_29' of git://github.com/timhunt/moodle into MOODLE_29_STABLE 2015-12-21 12:43:58 +00:00
Mark Nelson 2d645be2a5 MDL-50357 core_group: tidy up the function groups_delete_group_members 2015-12-21 17:41:18 +08:00
David Monllao fc1c26b8c0 Merge branch 'MDL-51257-29' of git://github.com/cameron1729/moodle into MOODLE_29_STABLE 2015-12-21 17:33:18 +08:00
David Monllao 3891d6d398 Merge branch 'MDL-52429-29' of git://github.com/jleyva/moodle into MOODLE_29_STABLE 2015-12-21 17:17:20 +08:00
David Monllao 33b8447c60 Merge branch 'MDL-49758-29' of git://github.com/StudiUM/moodle into MOODLE_29_STABLE 2015-12-21 17:06:13 +08:00
David Monllao 755f2c3eae MDL-52226 tests: Fix behat phpunit naming conflict 2015-12-21 08:32:35 +00:00
David Monllao 9f5dd71d82 Merge branch 'MDL-52226-m29' of git://github.com/sammarshallou/moodle into MOODLE_29_STABLE 2015-12-21 14:43:04 +08:00
Andrew Nicols c4ad68a8b7 Merge branch 'm29_MDL-50972' of https://github.com/danmarsden/moodle into MOODLE_29_STABLE 2015-12-21 14:04:24 +08:00
David Monllao 5276206f43 Merge branch 'MDL-47106_29' of git://github.com/timhunt/moodle into MOODLE_29_STABLE 2015-12-21 11:33:19 +08:00
AMOS bot 890de8ab6a Automatically generated installer lang files 2015-12-20 00:05:33 +08:00
Dan Poltawski 747f4468fb weekly release 2.9.3+ 2015-12-18 12:26:59 +00:00
Dan Poltawski 86ecd214da Merge branch 'install_29_STABLE' of https://git.in.moodle.com/amosbot/moodle-install into MOODLE_29_STABLE 2015-12-18 12:26:57 +00:00
sam marshall 2fae9db702 MDL-52558 Data generator: enrol_user should allow shortname 2015-12-18 11:01:57 +00:00
Shamim Rezaie 8ec0823dfe MDL-52380 mod_forum: Non-Gregorian dates in forum advance search
Convert the fromdate and todate date parts to Gregorian before passing them to make_timestamp
2015-12-17 18:07:04 -06:00
Shamim Rezaie 0f64a45eaf MDL-52354 select_time: Make select_time respect the set calendar type
The select_time method updated to display form elements in accordance
to the calendar type plugin that is in use.
2015-12-17 18:06:55 -06:00
Shamim Rezaie 38b700180f MDL-52355 mod_data: Make date field respect the calendar type in use
Updated the date subplugin to consider that the input date element
values might be for any calendar type and not just the Gregorian
calendar.
2015-12-17 16:21:26 -06:00
Shamim Rezaie 31f6946c8f MDL-52354 select_time: Make select_time respect the set calendar type
The select_time method updated to display form elements in accordance
to the calendar type plugin that is in use.
2015-12-17 16:21:13 -06:00
Shamim Rezaie 5a03c7b447 MDL-52354 select_time: Make select_time respect the set calendar type
The select_time method updated to display form elements in accordance
to the calendar type plugin that is in use.
2015-12-17 15:49:16 -06:00
Dan Marsden d242d558ae MDL-51916 mod_scorm: allow html5 scorm content fullscreen 2015-12-16 20:29:41 +13:00
AMOS bot 60059b9216 Automatically generated installer lang files 2015-12-15 00:04:21 +08:00
Dan Marsden 14695e5f4c MDL-50972 mod_scorm: set autocommit as boolean
var currently passed as string so not evaluated correctly
2015-12-14 14:27:18 +13:00
Matthew Pruett ae73287803 MDL-47106 quiz 'secure' window: Finish review link did not work 2015-12-13 22:09:05 +00:00
Amanda Doughty 0b8f8f3402 MDL-52455 quiz: doesn't include all user fields required by messaging 2015-12-13 20:48:59 +00:00
Tim Hunt 89db762c0e MDL-52427 questions: all parts of a Q should be clearfix
Otherwise large floated images may overflow.
2015-12-13 20:28:26 +00:00
Jean-Philippe Gaudreau 5d11d337d2 MDL-49758 mod_quiz: Fix require on completionlib.php
Credits: Gordon Bateson
2015-12-11 13:01:28 -05:00
David Monllao e6e3aa975a Merge branch 'MDL-52438-29' of git://github.com/marinaglancy/moodle into MOODLE_29_STABLE 2015-12-10 15:35:17 +08:00
sam marshall e8af997888 MDL-52226 Forms: max_input_vars problems with advanced checkbox 2015-12-09 12:19:53 +00:00
Dan Poltawski 464f907c4c weekly release 2.9.3+ 2015-12-09 12:09:33 +00:00
Dan Poltawski 3f355629ee Merge branch 'install_29_STABLE' of https://git.in.moodle.com/amosbot/moodle-install into MOODLE_29_STABLE 2015-12-09 12:09:32 +00:00
Marina Glancy 5adb27669c MDL-52438 core: allow Moodle 3.0 to be used with PHP7 2015-12-09 18:30:51 +08:00
Eloy Lafuente (stronk7) e794852ff5 Merge branch 'MDL-51483_29' of https://github.com/jinhofer/moodle into MOODLE_29_STABLE 2015-12-09 02:22:58 +01:00
Adam Olley 23c63a1afe MDL-52334 enrol_database: Add missing filter to user_enrolment lookup
Without the user filter, the left join to the user enrolment table
results in a much larger set of data being returned than before
MDL-28420. Which makes login time for users in many busy courses much
worse than before (3x worse on average, observed upto 40x).
2015-12-09 09:27:04 +10:30
Dan Poltawski c44388a7cf Merge branch 'MDL-51097_m29v1' of https://github.com/sbourget/moodle into MOODLE_29_STABLE 2015-12-08 10:07:44 +00:00
Dan Poltawski 61bc523600 Merge branch 'MDL-51411_29' of https://github.com/andrewhancox/moodle into MOODLE_29_STABLE 2015-12-08 09:05:50 +00:00
Dan Poltawski 4ee2ff34b1 Merge branch 'wip-MDL-52193-m29' of https://github.com/marinaglancy/moodle into MOODLE_29_STABLE 2015-12-07 15:37:45 +00:00
jinhofer df1e5786c2 MDL-51483 lib/moodlelib.php: Added conditional checks to shorten_text 2015-12-07 09:19:00 -06:00
Juan Leyva 4818800a69 MDL-52429 mod_scorm: Fix SCORM completion checking in nested SCOs 2015-12-07 11:29:34 +01:00
Dan Poltawski 8b936c2483 Merge branch 'MDL-50258_29' of git://github.com/dmonllao/moodle into MOODLE_29_STABLE 2015-12-07 09:05:37 +00:00
David Monllao 89a1d7cc73 Merge branch 'MDL-52204-29' of git://github.com/danpoltawski/moodle into MOODLE_29_STABLE 2015-12-07 16:35:43 +08:00
Dan Poltawski 2f1de062c6 Merge branch 'MDL-52304_29' of https://github.com/dmonllao/moodle into MOODLE_29_STABLE 2015-12-07 08:21:25 +00:00
Dan Poltawski 500202997b MDL-52271 install: don't allow installer to be indexed
Following guidance from:
https://support.google.com/webmasters/answer/93710?hl=en
2015-12-07 15:44:11 +08:00
Russell Smith a17167118a MDL-52402 backup, quiz: Fix attempt token and add missing rule. 2015-12-05 10:13:18 +11:00
Russell Smith 7361129133 MDL-52402 backup: Improve debugging output on failed log restores 2015-12-05 10:13:18 +11:00
Dan Poltawski f3629d3204 MDL-51582 readme: update less building instructions
I forgot to update this after the changes in 04422a03
2015-12-04 16:42:06 +00:00
Eloy Lafuente (stronk7) 116a88c6bc Merge branch 'MDL-51582-29' of git://github.com/danpoltawski/moodle into MOODLE_29_STABLE 2015-12-04 17:15:32 +01:00
AMOS bot 97898d4faa Automatically generated installer lang files 2015-12-05 00:04:49 +08:00
Dan Poltawski 122214a8db MDL-52250 npm: shrinkwrap to lock down dependencies
We've tried various approaches to lock down our dependencies and they
have been flawed because dependencies in our included packages may not
be locked down and previous attempts to do that have not been correct.

With npm shrinkwrap we lock down versions so that any npm install will
always install the exact same versions for all developers - see:
https://docs.npmjs.com/cli/shrinkwrap

(This is a lot like composer.lock for those more fluent with composer)
2015-12-04 15:39:33 +00:00
Dan Poltawski b957465b35 MDL-52250 npm: remove uglify-js dependency/bump grunt-contrib-uglify
A) Remove direct dependency on uglify-js:

This dependency was added in MDL-50277, but it isn't quite correct, the
way npm installs dependencies means that grunt-contrib-uglify *could* use
'our' version if its satisifed. But does not *always* and especially does
not if the grunt-contrib-uglify requirement is higher than ours.

Long story short, in many cases this means that this is used:
 node_modules/grunt-contrib-uglify/node_modules/uglify-js
But this is not:
  node_modules/uglify-js

In MDL-50277 we thought we were making the version sticky, but in
reality we were just fixing previous problems by updating
grunt-contrib-uglify to a version which fixed a bug:

 https://github.com/gruntjs/grunt-contrib-uglify/issues/313

It seems the better solution will come with using npm shrinkwrap to lock
down depdencies.

B) Bump grunt-contrib-uglify to 0.11.0

This moves us to uglify-js ~2.6.0 - which doens't change any output
files.
2015-12-04 15:36:44 +00:00
Dan Poltawski 59a0253332 MDL-52204 grunt: update to grunt-contrib-jshint v0.11.3
This version of grunt-contrib-jshint itself uses a better fixed
requirement on "~2.8.0" rather than "^2.8.0" which was giving variable
results with some people updating to 2.9-rc1.

See also https://github.com/gruntjs/grunt-contrib-jshint/pull/219
2015-12-04 11:38:40 +00:00
Dan Poltawski 04422a0396 MDL-51582 grunt: task improvements
* Introduce the 'css' task - this will give us flexibility to do things
  in future rather than relying on the inbuilt 'less' task (e.g. sourcemap
  generating task which doesn't run by default)

* Introduce 'amd' task which runs only amd tasks

* Introduce 'js' task which runs all JS (amd/shifter) tasks

* Tweak the ordering so that slow shifter always runs last (useful for
  people like me who forget to specif the task)
2015-12-04 10:58:29 +00:00
Dan Poltawski c3033419cc MDL-51582 css: built with new grunt task 2015-12-04 10:58:29 +00:00
Dan Poltawski a99bf936fb MDL-51582 grunt: add less complilation support
Previously we were using recess to build bootstrap base as it was what
was used by the original project. But recess is no longer maintained.

Now we use grunt for building js, it makes sense to use it for less too.

(If you really don't want to use grunt, you almost certainly can just
use lessc -x as it uses the same less.js on backend).
2015-12-04 10:47:01 +00:00
Michael Aherne 84a77ce35d MDL-52304 media: Allow full screen in Flash player 2015-12-04 10:07:10 +08:00
David Monllao cc3992585a MDL-50258 themes: Fix CSS source maps 2015-12-04 09:02:36 +08:00
Eloy Lafuente (stronk7) 00802d0930 weekly release 2.9.3+ 2015-12-03 19:41:12 +01:00
Eloy Lafuente (stronk7) ff4cc15c72 Merge branch 'install_29_STABLE' of https://git.in.moodle.com/amosbot/moodle-install into MOODLE_29_STABLE 2015-12-03 19:41:06 +01:00
Eloy Lafuente (stronk7) 1caf3fe169 MDL-52141 backup: test restore_log_rule don't modify passed log anymore 2015-12-03 19:03:30 +01:00
David Monllao d69efaf872 Merge branch 'MDL-48004-29' of git://github.com/danpoltawski/moodle into MOODLE_29_STABLE 2015-12-03 19:03:29 +01:00
David Monllao 3e7d409d72 Merge branch 'MDL-50710-29' of git://github.com/marinaglancy/moodle into MOODLE_29_STABLE 2015-12-03 19:03:28 +01:00
AMOS bot b967175480 Automatically generated installer lang files 2015-12-04 00:04:50 +08:00
Mark Nelson 9678041d7d MDL-52017 enrol_self: always check password before re-enabling 2015-12-03 19:27:04 +08:00
David Monllao 1a62cb7567 Merge branch 'MDL-52260-29-2' of git://github.com/xow/moodle into MOODLE_29_STABLE 2015-12-03 11:57:04 +01:00
Eloy Lafuente (stronk7) 3a1a3639aa Merge branch 'MDL-45364-29' of git://github.com/danpoltawski/moodle into MOODLE_29_STABLE 2015-12-03 11:57:03 +01:00
Dan Poltawski 89349cd5a7 MDL-52292 testing: block generator fix
Stop errors when no $options supplied
2015-12-03 11:57:03 +01:00
Dan Poltawski 4211ec36a5 Merge branch 'MDL-52292_29' of git://github.com/timhunt/moodle into MOODLE_29_STABLE 2015-12-03 11:57:02 +01:00
Dan Poltawski 328a9d57ca MDL-26935 behat: add coverage for role renaming in course 2015-12-03 11:57:02 +01:00
Russell Smith 62f2a0d05a MDL-52141 backup: Ensure we don't alter the log record when parsing it. 2015-12-03 11:57:01 +01:00
Dan Poltawski 278eba8cfa Merge branch 'MDL-37308-29' of git://github.com/junpataleta/moodle into MOODLE_29_STABLE 2015-12-03 11:57:00 +01:00
Tony Levi 36f5996a19 MDL-51757 mod_scorm: Remove duplicate function param
convert invalid break calls to exceptions for PHP 7
2015-12-03 11:57:00 +01:00
Rajesh Taneja 54e328d0f6 MDL-52376 behat: Add 1 sec delay to ensure cron works
course completion record should be created at time
which is before the time cron is run. On fast machine
this both might be done at same time. So added 1 sec delay
2015-12-03 13:18:14 +08:00
Cameron Ball 4e07b2cfbd MDL-51257 messages: Improve message form.
- Add sudmit button
- Add formchangechecker
- Update behat tests
2015-12-03 10:23:55 +08:00
Tim Hunt ae5cf0490f MDL-52292 block testing generators: improve the API
* Refactor the block generator base class, to remove the amount
  of duplication required in base classes.

* Change the defaults that are filled in to be a little more natural.

* Make the Behat step 'Given the following "block" exist:' work.
2015-12-01 13:51:28 +00:00
Dan Poltawski 6f08d4ee0b Merge branch 'MDL-52283-29' of git://github.com/marinaglancy/moodle into MOODLE_29_STABLE 2015-11-30 11:27:49 +00:00
Dan Poltawski ad552b3502 Merge branch 'MDL-52332-29' of git://github.com/marinaglancy/moodle into MOODLE_29_STABLE 2015-11-30 10:22:44 +00:00
David Monllao 3de05a67ed Merge branch 'MDL-35982-29' of git://github.com/danpoltawski/moodle into MOODLE_29_STABLE 2015-11-30 15:46:47 +08:00
Marina Glancy 5e3989dfcf MDL-52332 calendar: load settings using API 2015-11-30 11:48:10 +08:00
Rajesh Taneja e634f04355 MDL-52279 core_lib: Remove php4 style constructor
filterobject is called from core and as it's
using php4 style constructor, global USER is
not set properly because of deprecation warning
2015-11-30 11:32:36 +08:00
Jun Pataleta 5eb6f7500a MDL-37308 files: Additional fixes for transparency
Fixed transparency support when resizing and when not resizing.
2015-11-29 20:28:29 -06:00
Jetha Chan 694b4d4274 MDL-37308 files: support transparency when not resizing; new unit test 2015-11-29 20:28:29 -06:00
Adrian Greeve baddb058a9 MDL-37308 files: convert_image() now supports transparency. 2015-11-29 20:28:28 -06:00
Marina Glancy 8d77d104bf MDL-50710 block_glossary_random: more precise sorting 2015-11-30 09:16:57 +08:00
AMOS bot 6a66d9b08d Automatically generated installer lang files 2015-11-28 00:05:02 +08:00
Dan Poltawski f788c16f00 MDL-51719 atto_rtl: RTL/LTR buttons now indicate state
Previously the RTL buttons did not indiciate wether RTL or LTR was
selected. Thanks to Andrew Nicols for guiding how to do this.
2015-11-27 14:10:26 +00:00
John Okely 66620e48b7 MDL-52260 user: Fix error when saving profile with locked field 2015-11-27 11:02:58 +08:00
Tony Levi f3a92d07b6 MDL-52283 core: password_hash() deprecation in PHP7 2015-11-27 09:13:16 +08:00
Andrew Nicols 8dfc18bed3 MDL-45364 atto_rtl: Fix JS lint 2015-11-26 19:50:40 +00:00
Dan Poltawski 1199aab2c1 MDL-48004 question: prevent notices on import screen
If query params were not passed the page would previously display debug
notices as setting the $requirecourseid param to question_edit_setup()
was buggy.
2015-11-26 15:03:51 +00:00
Dan Poltawski 48cf88458c MDL-35982 behat: delete blog entry coverage 2015-11-26 14:13:22 +00:00
Dan Poltawski 45600c4a0b MDL-35982 blog: reorder blog delete confirmation
Improves accessibility to be ordered logically in page
2015-11-26 14:13:22 +00:00
Dan Poltawski 4b0075414e MDL-35982 blog: prevent index throwing errors with 0 courseid
Regression from MDL-49845 where Dave made the page not handle courseid = 0
and so now some urls will send you back to a db error..
2015-11-26 14:13:22 +00:00
David Monllao b9c333f5db weekly release 2.9.3+ 2015-11-26 10:54:41 +08:00
David Monllao ea5431e351 Merge branch 'install_29_STABLE' of https://git.in.moodle.com/amosbot/moodle-install into MOODLE_29_STABLE 2015-11-26 10:54:40 +08:00
Dan Poltawski 4c4295061c MDL-23128 tex: silence dvips output
This was causing spewwing of lots of messages to the error log..

Thanks to Fred Woolard for the suggestion
2015-11-25 17:07:33 +00:00
AMOS bot 33eb190484 Automatically generated installer lang files 2015-11-26 00:04:40 +08:00
Dan Poltawski 1240c086eb MDL-49743 singleview: slightly clarify logic
Make it clearer what the 'unset' behaviour is because previously
we've set the default for 'empty' values twice.
2015-11-25 15:12:11 +00:00
Conn f056d6fb88 MDL-49743 singleview: Prevent errors when no itemid was selected
Signed-off-by: Conn <conn@cmrwarwicker.com>
2015-11-25 15:12:11 +00:00
Andrew Hancox 8fa1397886 MDL-51411 course: Fixed warning when deleting activity with js disabled 2015-11-25 14:41:45 +00:00
Frederic Massart 0baa4c581e MDL-52160 navigation: Mark category and module settings nodes as branch 2015-11-25 13:13:14 +08:00
AMOS bot 998305db0a Automatically generated installer lang files 2015-11-25 00:04:36 +08:00
David Monllao fd9c9c807f Merge branch 'MDL-44330-m29' of git://github.com/NeillM/moodle into MOODLE_29_STABLE 2015-11-24 17:04:09 +08:00
David Monllao 66270fd6e6 Merge branch 'MDL-45934-29' of git://github.com/danpoltawski/moodle into MOODLE_29_STABLE 2015-11-24 16:56:07 +08:00
Neill Magill 07ae362341 MDL-44330 Assign: Assignment grading may not display expected student
Before this patch it was possible for the student displayed on the grading page to
not be the student that the user selected to grade. This would occur if:

1) The user had the table ordered by a value that could be modified,
   for example Last modified (submission), Grade, Last modified (grade)
2) Another user performed an action that was recorded in Moodle in the time
   between the user generating the table and clicking on a grade link.

If a user did not notice a different user had been loaded it could result in them giving
a grade to the incorrect user.

This patch ensures that the state of the table is cached every time it is viewed by a user
who has the capability to grade.
2015-11-24 08:40:09 +00:00
Eloy Lafuente (stronk7) 51ad4489b9 Merge branch 'MDL-52095_29' of git://github.com/dmonllao/moodle into MOODLE_29_STABLE 2015-11-23 19:31:27 +01:00
Eloy Lafuente (stronk7) 3439a8196e Merge branch 'MDL-52185-29' of git://github.com/danpoltawski/moodle into MOODLE_29_STABLE 2015-11-23 19:27:09 +01:00
Dan Poltawski 165d174c7f Merge branch 'wip-mdl-51063-m29' of https://github.com/rajeshtaneja/moodle into MOODLE_29_STABLE 2015-11-23 11:33:52 +00:00
Dan Poltawski 3874af089a Merge branch 'MDL-52166_29' of https://github.com/timhunt/moodle into MOODLE_29_STABLE 2015-11-23 09:43:13 +00:00
David Monllao 28c0272a16 Merge branch 'MDL-52086-29' of git://github.com/bostelm/moodle into MOODLE_29_STABLE 2015-11-23 16:11:06 +08:00
Vadim Dvorovenko 7bf842111f MDL-52029 installer: Unstyled installer if display_errors is on
Error in MDL-43839 solution caused inclusion of unexistent file in
install/css.php.
2015-11-23 15:44:24 +08:00
David Monllao 8cf4568280 Merge branch 'MDL-52160-29' of git://github.com/FMCorz/moodle into MOODLE_29_STABLE 2015-11-23 14:09:47 +08:00
David Monllao 5526ce914b Merge branch 'MDL-49490-29' of git://github.com/danpoltawski/moodle into MOODLE_29_STABLE 2015-11-23 13:54:43 +08:00
David Monllao a5ef15bbb0 Merge branch 'MDL-43069-29' of git://github.com/danpoltawski/moodle into MOODLE_29_STABLE 2015-11-23 13:33:40 +08:00
Dan Poltawski d4e7c98dd6 MDL-37834 assign: avoid newlines in status column of csv
Previously we were generating a CSV file with newlines in it, which
seems to cause problems importing into some versions of MS Excel.

Instead seperate status lines by '-' - this column is only used to
provide context to the teacher in the spreadsheet.
2015-11-20 18:36:59 +00:00
AMOS bot 184ed2b8f9 Automatically generated installer lang files 2015-11-21 00:04:27 +08:00
David Monllao 2fe04a14e2 MDL-52095 themes: Padding to the left on RTL langs 2015-11-20 10:04:12 +08:00
AMOS bot f6dd11e3ff Automatically generated installer lang files 2015-11-20 00:04:29 +08:00
Dan Poltawski 2825fc7249 weekly release 2.9.3+ 2015-11-19 09:20:24 +00:00
Dan Poltawski cfb85df80c Merge branch 'install_29_STABLE' of https://git.in.moodle.com/amosbot/moodle-install into MOODLE_29_STABLE 2015-11-19 09:20:21 +00:00
David Monllao 8229a2b85d MDL-42571 editpdf: Fix search comments
They are also hidden instead of destroyed.
2015-11-19 07:06:40 +00:00
Dan Poltawski fc1a399565 Merge branch 'wip-MDL-52194-m29' of https://github.com/marinaglancy/moodle into MOODLE_29_STABLE 2015-11-19 06:49:53 +00:00
David Monllao f4b608041c MDL-42571 editpdf: Fix comments search and multiple views drawing 2015-11-19 12:56:26 +08:00
Stephen Bourget 0e967898bd MDL-51097 Lesson: allow resume from within a cluster 2015-11-18 23:22:10 -05:00
Henning Bostelmann 6e1654b79b MDL-52086 output renderers: show subtree only when tab is activated 2015-11-18 16:20:36 +00:00
AMOS bot 3c5a929ef2 Automatically generated installer lang files 2015-11-19 00:05:01 +08:00
Pavel Sokolov e45ba0143b MDL-43069 assign: prevent JS error on grading table
Previously submission comments failed to expand if you hid
the file submissions column.
2015-11-18 15:42:48 +00:00
Dan Poltawski 63f070cab1 MDL-45934 backup: do not reset completion enabled flag
The 'completion enabled' flag does not reflect any course data, its a
course setting. Previously when doing a backup deleteting existing
course content this was forced off when it should not have been.
2015-11-18 11:56:40 +00:00
Dan Poltawski b61dfdaf8f MDL-49490 assign: can't export to portfolio on non-submission 2015-11-18 09:14:34 +00:00
Marina Glancy 021f11b6b6 MDL-52194 flowplayer: do not check request
$_REQUEST variable may contain cookies in some php configurations. See also MDL-48085
2015-11-18 15:37:09 +08:00
Marina Glancy 516280b3a0 MDL-52193 questions: add missing require_once 2015-11-18 13:38:36 +08:00
Rajesh Taneja 90c5e7f8d1 MDL-50163 behat: Return subcontext from session
Creating a new context with new mink context
with different session was keeping the session
and was not returning proper session information
2015-11-18 12:17:53 +08:00
rajesh Taneja 2d98e42166 MDL-50163 behat: Restart session after scenario with switch_window
Restart session after a scenario with switch window
is finished. This will close all open browser windows
and open a new browser window
2015-11-18 12:17:46 +08:00
Dan Poltawski a4e43f3d13 MDL-52185 report: remove ugly bullet points 2015-11-17 15:34:17 +00:00
David Monllao 014be0ff8b Merge branch 'MDL-51988-29' of git://github.com/danpoltawski/moodle into MOODLE_29_STABLE 2015-11-17 10:23:42 +08:00
Russell Smith 5afb2e2601 MDL-50700 gradereport_overview: Call $PAGE->set_course
To ensure correct blocks are displayed.
2015-11-17 10:03:11 +08:00
David Monllao f907ed40e6 Merge branch 'MDL-46049-29' of git://github.com/danpoltawski/moodle into MOODLE_29_STABLE 2015-11-17 08:55:54 +08:00
Dan Poltawski be2dd2fd10 Merge branch 'MDL-52021-29-test' of git://github.com/junpataleta/moodle into MOODLE_29_STABLE 2015-11-16 16:21:19 +00:00
AMOS bot 9c56b617f5 Automatically generated installer lang files 2015-11-17 00:05:18 +08:00
Tim Hunt d5956a3f17 MDL-52166 gradebook: overview report fails with separate groups 2015-11-16 14:38:45 +00:00
Frederic Massart 986906d64b MDL-52160 navigation: Really remove module settings empty nodes 2015-11-16 19:46:29 +08:00
David Monllao 2ce6daca4b Merge branch 'MDL-47065-29' of git://github.com/danpoltawski/moodle into MOODLE_29_STABLE 2015-11-16 15:20:12 +08:00
David Monllao 9620e23384 Merge branch 'MDL-50687-29' of git://github.com/danpoltawski/moodle into MOODLE_29_STABLE 2015-11-16 14:27:08 +08:00
David Monllao 502a3b29b6 Merge branch 'MDL-50564-29' of git://github.com/junpataleta/moodle into MOODLE_29_STABLE 2015-11-16 14:21:00 +08:00
Bence Laky 597b71cf55 MDL-42571 assignfeedback_editpdf: Fixed second PDF view 2015-11-16 13:45:53 +08:00
AMOS bot f190723ad5 Automatically generated installer lang files 2015-11-16 00:04:35 +08:00
AMOS bot 83da404228 Automatically generated installer lang files 2015-11-15 00:04:21 +08:00
Frederic Massart 411a25c7eb MDL-50564 atto: Require atto_menu in atto_plugin 2015-11-13 14:39:38 -06:00
Syam Mohan 1e7d81b51d MDL-52021 enrollib: Removed repeated capability
'moodle/role:assign' replicated in the permission checking
2015-11-13 10:15:04 -06:00
AMOS bot 1ef65952ee Automatically generated installer lang files 2015-11-14 00:06:34 +08:00
David Monllao b7075e690c weekly release 2.9.3+ 2015-11-13 15:27:39 +08:00
David Monllao d1d6c611ef Merge branch 'install_29_STABLE' of https://git.in.moodle.com/amosbot/moodle-install into MOODLE_29_STABLE 2015-11-13 15:27:37 +08:00
Dan Poltawski 3e520d2b7c MDL-50687 phpunit: error early if required locale not installed 2015-11-13 07:00:35 +00:00
Dan Poltawski b521ed1eae MDL-51819 theme: style fix for nested dropdowns 2015-11-12 21:55:29 +00:00
Dan Poltawski 9d9a0b070a MDL-47065 notes: prevent empty spaces added as note
(And updated behat test for this test case)
2015-11-12 09:57:40 +00:00
Jun Pataleta 0084e7efd7 MDL-47065 behat: improve verificaton of lack of note 2015-11-12 09:57:40 +00:00
Dan Poltawski 64a5038847 MDL-47065 notes: don't add blank notes
Previously the logic was wrong and was proceeding to add a note
when content was missing.

Also add behat coverage for adding notes to participants (this test
is not perfect, but better than zero coverage we had before).
2015-11-12 09:57:22 +00:00
Dan Poltawski 8dcf53b73e MDL-51819 js: built changes 2015-11-12 08:56:01 +00:00
Dan Poltawski a923ed028d Merge branch 'wip-MDL-51819-29' of git://github.com/abgreeve/moodle into MOODLE_29_STABLE 2015-11-12 08:46:56 +00:00
Simeon Naydenov c4277bcdd0 MDL-51819 themes: Nested navigation dropdowns work on small screens. 2015-11-12 13:58:14 +08:00
Eloy Lafuente (stronk7) c78df8f42b Merge branch 'MDL-51515-29' of git://github.com/junpataleta/moodle into MOODLE_29_STABLE 2015-11-11 23:15:15 +01:00
Damyon Wiese ddf844a904 MDL-51515 assign: Fix typo setting url in nav tree.
Thanks to Nelson Moller and Tyler Bannister.
2015-11-11 11:17:47 -06:00
Dan Poltawski 3e443eb1f3 MDL-36109 accesibility: use proper words for logo alt text 2015-11-11 17:28:40 +01:00
AMOS bot fd673f2b8d Automatically generated installer lang files 2015-11-12 00:04:17 +08:00
Eloy Lafuente (stronk7) 616de3dff9 Merge branch 'MDL-51495-m29' of https://github.com/NeillM/moodle into MOODLE_29_STABLE 2015-11-11 16:58:31 +01:00
Eloy Lafuente (stronk7) b93f4c7570 Merge branch 'MDL-50589-29' of git://github.com/jleyva/moodle into MOODLE_29_STABLE 2015-11-11 16:53:32 +01:00
Neill Magill 1a968ade33 MDL-51495 calendar: E_WARNING in core_calendar_get_calendar_events
If a user does not have the 'moodle/calendar:manageentries' capability then an E_WARNING
can be generated by the core_calendar_external::get_calendar_events() method, that an
expected array is null

This patch creates an array that is missing when a user does not have the capability.
2015-11-11 15:21:50 +00:00
Neill Magill 68d41752c5 MDL-51495 calendar: Unit test to get an individual course event
If is user requests a single event on a course via the web service they should be able to retrieve it.
2015-11-11 15:21:21 +00:00
Dan Poltawski 48c50f4e7f MDL-51988 behat: Add coverage of participation report messaging 2015-11-11 12:40:12 +00:00
Dan Poltawski a15378e431 MDL-51988 behat: select a table by <th> tag 2015-11-11 12:40:11 +00:00
Dan Poltawski e30f11ede6 MDL-51988 report_particiption: do not allow messaging when disabled
Previously the option to send messages when presented regardless of the
site setting.
2015-11-11 12:40:11 +00:00
David Monllao 607d46adc9 Merge branch 'MDL-51913_statistics_dup_1st_column_MDL29' of git://github.com/barrysspace/moodle into MOODLE_29_STABLE 2015-11-11 12:39:11 +08:00
David Monllao f548f950ea Merge branch 'MDL-51935-29' of git://github.com/dpalou/moodle into MOODLE_29_STABLE 2015-11-11 10:01:30 +08:00
Eloy Lafuente (stronk7) 491f57a2b0 Merge branch 'wip-mdl-52077-m29' of https://github.com/rajeshtaneja/moodle into MOODLE_29_STABLE 2015-11-10 23:44:43 +01:00
Eloy Lafuente (stronk7) 9a99818016 Merge branch 'wip-mdl-52066-m29' of https://github.com/rajeshtaneja/moodle into MOODLE_29_STABLE 2015-11-10 23:33:39 +01:00
Eloy Lafuente (stronk7) 0b6cc260c7 Merge branch 'MDL-51686-29' of git://github.com/damyon/moodle into MOODLE_29_STABLE 2015-11-10 20:20:07 +01:00
Eloy Lafuente (stronk7) 4789682191 Merge branch 'MDL-50781-29' of git://github.com/danpoltawski/moodle into MOODLE_29_STABLE 2015-11-10 20:14:25 +01:00
Eloy Lafuente (stronk7) 5ddcdfd743 Merge branch 'MDL-51720-29' of git://github.com/damyon/moodle into MOODLE_29_STABLE 2015-11-10 19:28:55 +01:00
Matt Petro 9873593120 MDL-51482 caching: Fix unnecessary updates to lastinvalidation time 2015-11-10 18:28:34 +01:00
Dan Poltawski 8b94100661 Merge branch 'MDL-51314-groupmembership-v29' of https://github.com/dmitriim/moodle into MOODLE_29_STABLE 2015-11-10 14:44:21 +00:00
Eloy Lafuente (stronk7) 3f0687bcdf weekly release 2.9.3+ 2015-11-10 10:50:11 +01:00
Eloy Lafuente (stronk7) a9bb11731c Merge branch 'install_29_STABLE' of https://git.in.moodle.com/amosbot/moodle-install into MOODLE_29_STABLE 2015-11-10 10:50:03 +01:00
Dan Poltawski c773d10247 MDL-52063 forum: Moved notification is not a problem
The default behaviour of $OUTPUT->notification() is to indiciate a
problem.
2015-11-10 09:39:29 +00:00
Dan Poltawski 7e0516eab3 Merge branch 'MDL-52063-29' of git://github.com/xow/moodle into MOODLE_29_STABLE 2015-11-10 09:28:32 +00:00
Dani Palou 45e37067f6 MDL-51935 wiki: Add missing strings in wiki 2015-11-10 10:11:25 +01:00
Rajesh Taneja 4529cf6c76 MDL-52077 unittest: Fixed string typo 2015-11-10 13:54:18 +08:00
Rajesh Taneja 81ebc2746e MDL-52066 unittest: Use ics file from external repo 2015-11-10 13:29:51 +08:00
John Okely 5821639bb7 MDL-52063 forum: Display message when moving forum 2015-11-10 10:23:40 +08:00
Eloy Lafuente (stronk7) 12c17ffaee Merge branch 'MDL-47979-29-blocks-config' of git://github.com/mudrd8mz/moodle into MOODLE_29_STABLE 2015-11-09 23:44:20 +01:00
AMOS bot 05d6d57101 Automatically generated installer lang files 2015-11-10 00:04:16 +08:00
David Mudrák 663287d08f MDL-47979 blocks: Do not display link to legacy file admin/block.php
The deprecated file admin/block.php was removed in Moodle 2.6. Since
then, all blocks that declare has_config() must provide a settings.php
file.
2015-11-09 13:53:40 +01:00
Dan Poltawski eb7fb32928 Merge branch 'MDL-51837-29' of git://github.com/junpataleta/moodle into MOODLE_29_STABLE 2015-11-09 11:33:02 +00:00
Dan Poltawski 1542f9d5b0 Merge branch 'MDL-51628-29' of git://github.com/damyon/moodle into MOODLE_29_STABLE 2015-11-09 11:01:32 +00:00
Dan Poltawski 7634d30a74 Merge branch 'wip-MDL-52039-m29' of https://github.com/marinaglancy/moodle into MOODLE_29_STABLE 2015-11-09 08:48:52 +00:00
David Monllao 9376718334 Merge branch 'MDL-40245_29' of git://github.com/SWiT/moodle into MOODLE_29_STABLE 2015-11-09 16:13:37 +08:00
David Monllao e265092be4 Merge branch 'MDL-49473-29' of git://github.com/danpoltawski/moodle into MOODLE_29_STABLE 2015-11-09 15:13:08 +08:00
Marina Glancy b7191a5616 MDL-52039 block_tags: hide tagtype element if n/a 2015-11-07 12:44:03 +08:00
Eloy Lafuente (stronk7) 3a325f777f Moodle release 2.9.3 2015-11-06 20:51:47 +01:00
Eloy Lafuente (stronk7) 2496ea3f9a Merge branch 'MDL-50426-29-behat-fixage' of https://github.com/danpoltawski/moodle into MOODLE_29_STABLE 2015-11-06 19:47:19 +01:00
Dan Poltawski c2cc463678 MDL-50426 behat: Update non-contacts feature naming 2015-11-06 18:43:35 +00:00
Dan Poltawski 7ba5567205 MDL-50426 behat: fix compatibility with 29
The test was not working on this branch due to missing MDL-27177
2015-11-06 18:40:56 +00:00
Dan Poltawski 7fd11cca1d weekly release 2.9.2+ 2015-11-06 11:56:42 +00:00
Rajesh Taneja fb4df94831 MDL-51685 unittest: Test functionality individually 2015-11-06 11:20:10 +01:00
Eloy Lafuente (stronk7) c8722df0c0 MDL-51861 enrol: added missing external cleanup for formal compliance 2015-11-06 10:05:39 +00:00
Dan Poltawski 9878e8e170 MDL-51569 mod_choice: Fix use of hardcoded ids
(Previous approach of making up ids longer works now we are validating
them..)
2015-11-06 08:13:09 +00:00
Dani Palou b26b240790 MDL-51861 enrol: Don't get all parts in get_enrolled_users with groups 2015-11-06 15:10:35 +08:00
Eloy Lafuente (stronk7) ee990ba3bb MDL-51861 enrol: new unit test to verify all conditions and filters
This unit test does not verify contents, details, but only
that the returned users for every group mode, for every
filtering (active, groupid and withcapability) together
with permissions are correct.
2015-11-06 15:08:21 +08:00
John Okely 6283c33979 MDL-51569 mod_choice: Prevent users from updating choices with curl 2015-11-06 14:53:06 +08:00
Dmitrii Metelkin 8aa81abdc0 MDL-51314 mod_assign: cache group membership in can_edit_submission 2015-11-06 15:23:38 +11:00
Andrew Nicols 8f75fc3657 MDL-51685-master Fix unit tests following change
These unit tests were modifying the PAGE and other globals in the middle of
tests and were failing as a result.

Broke the tests up into separate tests where the functionality is now
tested individually.
2015-11-06 10:36:51 +08:00
Dan Poltawski bc1d433972 MDL-46049 chat: update calendar times on repeating chat sessions
Previously were using the invalid chat id and the calendar entry was not
updated.

Thanks to Andy McGill who worked this out.
2015-11-05 16:03:03 +00:00
Dan Poltawski 7ba8e5dbd9 MDL-46049 chat: add missing closing parenthesis 2015-11-05 16:03:03 +00:00
Damyon Wiese 09bb6f19e5 MDL-51569 mod_choice: Validate the submitted optionid
Make sure any submitted choice options actually belong to the current choice
module.
2015-11-05 10:48:45 +00:00
Juan Leyva 4b25851bcc MDL-50589 gradereport_user: Force regrade in external function 2015-11-05 09:42:06 +01:00
Ryan Wyllie dfc8d9a23b MDL-50426 message: post_message capability tests
Behat and unit tests to confirm the behaviour of the
messaging lib after the capability checks were added
to the post message function.
2015-11-05 08:27:40 +00:00
Ryan Wyllie f91e143f1d MDL-50426 message: optional permission check on message
Changed the messaging API to allow you to provide a parameter
that will cause the code to check if the sender of the message
has the correct permissions before the message is sent.

The ajax messaging (message button on profile page) has been
updated to perform these permission checks. This brings it
inline with the existing private message page.
2015-11-05 08:27:40 +00:00
Ryan Wyllie 578558f070 MDL-50426 behat: fix behat field manager
Thanks to Raj for the patch.
2015-11-05 08:27:40 +00:00
Damyon Wiese 48125a9408 MDL-51720 assign: Always fallback on userid as a default sort
Even when the table has no userid column (this is normally the edit column).
2015-11-05 15:35:41 +08:00
Andrew Nicols 3f4249d198 Merge branch 'MDL-51395-29' of git://github.com/junpataleta/moodle into MOODLE_29_STABLE 2015-11-05 14:02:51 +08:00
Jun Pataleta ddda4a8827 MDL-51395 blog: Fix output of strings for blog comments 2015-11-04 23:48:03 -06:00
Andrew Nicols 804122a7a0 Merge branch 'MDL-26429-29' of git://github.com/cameron1729/moodle into MOODLE_29_STABLE 2015-11-05 12:15:49 +08:00
Andrew Nicols cd6c041b41 MDL-51899 mod_forum: Add test for allowing 0 grades 2015-11-05 12:07:57 +08:00
Cameron Ball 56add3f0f3 MDL-26429 usability: Add course completion icons.
This patch adds a method to the course completion criteria classes
which allows them to specify an icon for display in the course
completion report table.

There is a default implementation which simply looks for an icon
in pix/i with a name matching the completion criteria type.
2015-11-05 11:41:40 +08:00
Barbara Ramiro a61abb5557 MDL-26429 Course completion icons for self, duration, and role. 2015-11-05 11:41:40 +08:00
Andrew Nicols 08d116cd3d Merge branch 'MDL-51899_29' of git://github.com/jacac/moodle into MOODLE_29_STABLE 2015-11-05 11:26:48 +08:00
Andrew Nicols cf44cfc398 Merge branch 'MDL-51685-29' of git://github.com/dpalou/moodle into MOODLE_29_STABLE 2015-11-05 10:42:09 +08:00
rajesh Taneja 5f65bb2e43 MDL-50837 mod_scorm: include locallib to access function 2015-11-05 10:24:38 +08:00
Matt Switlik 5dda224ef6 MDL-40245 assignment: download all submissions raise time limit 2015-11-04 16:31:37 -05:00
Jakob 19ad96aee3 MDL-51899 mod/assign: Allow 0.00 grades while editing a grade.
The function unformat_float can return 0 and false.
We need to do strict comparison for the return value on line 92 to accept grades 0.00.
2015-11-04 11:10:44 -08:00
David Monllao 7cff64fdbf MDL-51684 badges: Make sure 'moodle/badges:viewbadges' is respected 2015-11-04 13:03:14 +00:00
Yuliya Bozhko 65734f149f MDL-51684 badges: Make sure 'moodle/badges:viewbadges' is respected
Signed-off-by: Yuliya Bozhko <yuliya.bozhko@totaralms.com>
2015-11-04 13:03:14 +00:00
Juan Leyva f1178ebcd9 MDL-50837 mod_scorm: Fix availability checks 2015-11-04 12:55:47 +01:00
Juan Leyva 7ca8c34045 MDL-51569 mod_choice: Check choice availability prior to do any action 2015-11-04 11:08:42 +00:00
Cameron Ball 77e072ebec MDL-51091 core_registration: session key check in registration. 2015-11-04 18:46:28 +08:00
Simey Lameze 12c232df76 MDL-49940 mod_survey: Fix XSS on survey module 2015-11-04 18:46:28 +08:00
Hugh Davenport 48d8989f13 MDL-49940 mod_survey: Escape user comments
This patch fixes a XSS vulnerability with surveys where a student user
    could inject arbitrary HTML in a comment on the survey. The fix is to
    escape the comment before displaying it to the teacher.
2015-11-04 18:46:28 +08:00
David Monllao 17bed94dd7 MDL-51000 editor_atto: No autosave for guests 2015-11-04 18:46:28 +08:00
Simey Lameze 817cae1ac7 MDL-48109 mod_lesson: prevent CSRF on password protected lesson
This commit add a new session key hidden field on the lesson password form
and confirm if the session key is valid on related pages to prevent CSRF on
password protected lessons.
2015-11-04 18:46:28 +08:00
Petr Skoda 3a4d04cdb7 MDL-48085 flowplayer: prevent flash parameters via url 2015-11-04 10:38:43 +00:00
Andrew Nicols 493e0febed Merge branch 'MDL-51983-29' of git://github.com/ryanwyllie/moodle into MOODLE_29_STABLE 2015-11-04 15:25:20 +08:00
Ryan Wyllie 546a71cf7e MDL-51983 actionmenu: behat tests 2015-11-04 06:41:21 +00:00
Ryan Wyllie f14252ba8e MDL-51983 actionmenu: fix hideIfOutside
The hideIfOutside function was being too restrictive with the
selector for checking if the event occurred within a menu child
(anchor tag) rather than the menu itself.
2015-11-04 06:41:17 +00:00
Ryan Wyllie 992c414ee4 MDL-51983 actionmenu: stop event propagation
Stop event propagation on keyboard events that have been
successfully handled by the action menu code.
2015-11-04 06:40:41 +00:00
Andrew Nicols 7823046588 Merge branch 'MDL-45814-29' of git://github.com/danpoltawski/moodle into MOODLE_29_STABLE 2015-11-04 14:04:20 +08:00
Tony Butler ba646064b8 MDL-52012 core_lib: Add namespace to $OUTPUT->notify_message definition 2015-11-04 13:49:35 +08:00
Andrew Nicols c3728be605 Merge branch 'MDL-52004-29' of git://github.com/damyon/moodle into MOODLE_29_STABLE 2015-11-04 13:45:59 +08:00
Andrew Nicols c5a43c1e74 Merge branch 'wip-MDL-51486-29' of git://github.com/abgreeve/moodle into MOODLE_29_STABLE 2015-11-04 11:47:28 +08:00
Andrew Nicols a36700bc41 Merge branch 'MDL-51918-29-navigable' of https://github.com/pauln/moodle into MOODLE_29_STABLE 2015-11-04 11:26:57 +08:00
Adrian Greeve 47f708bec6 MDL-51486 mod_data: Unit test update for item ratings.
Additional checks that access is available for item ratings
on records that have a group id of zero (all participants).
2015-11-04 10:15:10 +08:00
Adrian Greeve 6050de43d8 MDL-51486 mod_data: Can view rating information.
When students are given the appropriate permissions
to view ratings, in the situation where there are
separate groups. The students can view the ratings
of an entry that is in the all participants group.
2015-11-04 10:14:48 +08:00
Paul Nicholls 3b9ba0034c MDL-51918 gradereport: Fix AJAX mode keyboard navigation
Keyboard navigation (ctrl+up/down/left/right) with AJAX enabled ceased
functioning with editing mode enabled after MDL-36606, as it was looking
for cells with a "clickable" class - but was only applying that class when
editing mode is NOT enabled.  This patch uses a new "gbnavigable" class to
control keyboard navigation, whether editing mode is on or not.  It also
addresses some browser compatibility and minor behavioural issues.
2015-11-04 11:09:17 +13:00
Eloy Lafuente (stronk7) 7cb98a969e weekly release 2.9.2+ 2015-11-03 18:46:37 +01:00
Eloy Lafuente (stronk7) b098545057 Merge branch 'install_29_STABLE' of https://git.in.moodle.com/amosbot/moodle-install into MOODLE_29_STABLE 2015-11-03 18:46:21 +01:00
Eloy Lafuente (stronk7) 83aec89c42 Merge branch 'wip-mdl-52007-m29' of https://github.com/rajeshtaneja/moodle into MOODLE_29_STABLE 2015-11-03 17:58:52 +01:00
Eloy Lafuente (stronk7) fad4180820 Merge branch 'wip-mdl-52020-m29' of https://github.com/rajeshtaneja/moodle into MOODLE_29_STABLE 2015-11-03 17:58:51 +01:00
Dan Poltawski dbb540329b Merge branch 'MDL-52018-29-enfix' of git://github.com/mudrd8mz/moodle into MOODLE_29_STABLE 2015-11-03 17:58:51 +01:00
AMOS bot 61cb6bfaf4 Automatically generated installer lang files 2015-11-04 00:04:32 +08:00
Dan Poltawski 864c61ecba MDL-45814 login: don't prompt guest user to change password 2015-11-03 14:49:33 +00:00
Dan Poltawski 4641507d92 MDL-49473 logs: ensure exported logs contain year 2015-11-03 11:38:28 +00:00
Dan Poltawski 9b67f1b9db MDL-50781 user: do not print useless table cell
Thanks to Maurício Severo da Silva for the patch
2015-11-03 10:52:59 +00:00
rajesh Taneja fd42923e67 MDL-52020 behat: Removed text checking to ensure window switch
Comment question window closes after 2 sec.
which crashes win-FF as it's slow to check for
"Changes saved" text. As after switching it is
checked the changes are saved, this step can be
avoided to ensure robustness of the scenario
2015-11-03 16:58:00 +08:00
rajesh Taneja 8c5be66b12 MDL-52007 behat: Use extended timeout for site admin expansion 2015-11-03 16:09:23 +08:00
David Mudrák 2b459a6e97 MDL-52018 lang: Fix behat test to use the new string 2015-11-02 22:42:27 +01:00
Helen Foster 2d8d39406b MDL-52018 lang: Merge English strings from the en_fix language pack 2015-11-02 22:38:44 +01:00
Eloy Lafuente (stronk7) 4c142669dc Merge branch 'MDL-52014-29' of git://github.com/danpoltawski/moodle into MOODLE_29_STABLE 2015-11-02 20:02:25 +01:00
Marina Glancy 691ed15ce2 MDL-51999 user: remove unnecessary continue 2015-11-02 19:59:31 +01:00
Eloy Lafuente (stronk7) 45e41c4fbe Merge branch 'MDL-51829-29' of git://github.com/dpalou/moodle into MOODLE_29_STABLE 2015-11-02 19:40:50 +01:00
Dan Poltawski 7277f5a28e MDL-52014 quiz: do not log preview attempt deletions
This happens automatically by the system.
2015-11-02 16:19:10 +00:00
Marina Glancy fe8900c83e MDL-50633 dml: deprecated var replaced in mysql 5.7
Thanks to Charles Verge for providing a patch
2015-11-02 14:04:58 +00:00
Dan Poltawski c2681c14b7 Merge branch 'MDL-51128-29' of git://github.com/junpataleta/moodle into MOODLE_29_STABLE 2015-11-02 10:54:53 +00:00
Dan Poltawski 0362b18553 Merge branch 'MDL-51854-29' of https://github.com/pauln/moodle into MOODLE_29_STABLE 2015-11-02 09:09:50 +00:00
Damyon Wiese 3ee30709a5 MDL-52004 assign: Set unique urls when grading so autosaves work
The Atto autosave feature uses the $PAGE->url to generate unique hashes for
each page. Assignment uses a MUC cache to persist ordering of lists - the result
is that the urls are not unique (they depend on the cached filter).

The fix is to spoof a unique url that will grade only that student with no
active grading list (no next/prev buttons).
2015-11-02 16:44:56 +08:00
Andrew Nicols 71321b2461 Merge branch 'MDL-51707-m29' of https://github.com/micaherne/moodle into MOODLE_29_STABLE 2015-11-02 14:51:21 +08:00
Jun Pataleta 2efa73d91e MDL-47073 lib: Replace backslashes with slashes in jquery plugin urls
This patch replaces backslash characters in the generated jQuery
plugin URL to forward slashes when slasharguments is disabled and
 the Moodle server is running on IIS.
Thanks to Ryan Panning <Ryan.Panning@district196.org> for
reporting this issue and for suggesting a fix.
2015-10-30 17:06:23 -05:00
Dan Poltawski fb290224b0 weekly release 2.9.2+ 2015-10-30 21:08:44 +00:00
Eloy Lafuente (stronk7) 971602a6c2 Merge branch 'wip-mdl-51981-m29' of https://github.com/rajeshtaneja/moodle into MOODLE_29_STABLE 2015-10-30 10:27:49 +01:00
rajesh Taneja 582460fbb6 MDL-51981 behat: No need for JS tag
This scenario crashes win-chrome and probably
other comninations. Looking at this, it seems
js tag is not needed, so removing js tag to make
it pass on all OS
2015-10-30 14:11:52 +08:00
Andrew Nicols 64c2c2c091 Merge branch 'wip-MDL-51552-29' of git://github.com/abgreeve/moodle into MOODLE_29_STABLE 2015-10-30 11:01:22 +08:00
Dan Poltawski 5566ccf52c Merge branch 'MDL-51939-29' of git://github.com/andrewnicols/moodle into MOODLE_29_STABLE 2015-10-29 13:55:08 +00:00
Eloy Lafuente (stronk7) 942ec23dd1 MDL-51939 mod_forum: all participants discussions are viewed by students
Added scenario to verify that "all participants" discussions, under
separate-groups mode are, by default, visible for students.
2015-10-29 21:08:03 +08:00
Andrew Nicols b320590668 MDL-51939 mod_forum: Fix groupid data on upgrade
This upgrade step addresses issues identified in MDL-51939 where the
groupid was incorrectly set. The issue itself is not present in 2.9, but
this upgrade step is required to correct any incorrect data.
2015-10-29 21:05:40 +08:00
Dan Poltawski 665c1f7105 Merge branch 'MDL-50811-29' of git://github.com/cameron1729/moodle into MOODLE_29_STABLE 2015-10-29 10:53:43 +00:00
Dan Poltawski 68a0906ad7 Merge branch 'MDL-51921-29' of git://github.com/junpataleta/moodle into MOODLE_29_STABLE 2015-10-29 10:35:41 +00:00
Adrian Greeve c0f9d4014a MDL-51552 gradebook: Update to bulk update behat test. 2015-10-29 16:09:25 +08:00
Adrian Greeve a9b82ea745 MDL-51552 gradebook: Single view bulk insert fix.
Single view now doesn't overwrite non-empty grades.

A thank you to Sam Anderson and Robert Russo for providing a patch.
2015-10-29 16:09:25 +08:00
Ryan Wyllie df8b69a470 MDL-51799 javascript: dialogue accessibility
Moved setting the aria visiblity of the dialogues from the show
and hide functions into the visibility change handler to stop
multiple calls.

Also made the visibility checker just continue to buffer the elements
it hides, rather than clearning them, on multiple calls.
2015-10-29 05:57:57 +00:00
Jun Pataleta fb861fd51d MDL-51921 files: Fixes for file manager issues
Fixed the issue where the file path select box goes beyond the
container with very long folder names. Instead of setting to
"width: auto", I set it the select box's "width: 100%" so that it will
just fill up its container's width.
Fixed the issue where markups are being shown on file aliases.
2015-10-28 04:50:10 -05:00
Andrew Nicols fb8af88c5c weekly release 2.9.2+ 2015-10-28 12:57:43 +08:00
Dan Poltawski 010931d695 Merge branch 'MDL-51893_29' of git://github.com/stronk7/moodle into MOODLE_29_STABLE 2015-10-27 14:43:04 +00:00
Eloy Lafuente (stronk7) d51a20234e MDL-51863 packer: ensure empty zip files behavior remains consistent
With PHP bug #70322 fixed, ZipArchive::close() did start returning false
and throwing PHP Warnings with recent PHP versions (5.6.14 and up).
Previously (5.6.13 verified) it was returning true, and false in older
versions (5.4.x verified).

This change does silent the 2 "hacky" calls to close() that we perform
in core leaving the 3rd one (used for files having files) unmodified.

A new unit test has been created to cover the close() behavior, ideally
supporting both old and new PHP versions without harcoding any PHP
version.

Note that we don't use to rely much on results coming from close(), and
that's a good thing given the buggy behavior commented above. This just
keeps empty zips working like they were before.
2015-10-27 11:56:58 +00:00
Eloy Lafuente (stronk7) a65c0dc2f2 MDL-51893 core_date: Stop using Pacific/Norfolk as 11.5 replacement
Norfolk Island's standard time (NFT) was on UTC+11:30 until 4 October
2015, when it was changed to UTC+11:00. So it's not suitable for 11.5
bad mapping replacement anymore.

It seems that there isn't any other location using such 11.5 timezone
so completely getting rid of it for conversions.
2015-10-27 10:17:25 +01:00
Corey Wallis c88bedf4dd MDL-50811 mod_forum: Add completion tracking for emailed replies 2015-10-27 15:55:21 +08:00
Andrew Nicols 8c13b827a9 Merge branch 'MDL-51905-29' of git://github.com/xow/moodle into MOODLE_29_STABLE 2015-10-27 14:51:29 +08:00
John Okely 26fa4746c9 MDL-51905 block_activity_results: Default to the current activity
Due to an incorrect condition, the activity results block would
incorrectly identify some blocks as not being gradeable.
This meant that edit form could not determine what activity the block
was added to. This commit fixes the condition, allowing the current
block to be determined correctly
2015-10-27 13:55:22 +08:00
Andrew Nicols 16bb5d56c5 Merge branch 'MDL-51864-29' of git://github.com/junpataleta/moodle into MOODLE_29_STABLE 2015-10-27 10:58:26 +08:00
Andrew Nicols d37c325ff6 Merge branch 'MDL-51127-M29' of git://github.com/lazydaisy/moodle into MOODLE_29_STABLE 2015-10-27 10:49:02 +08:00
Barry Oosthuizen 0e5b2e1997 MDL-51913 report_stats: Make first column unique 2015-10-26 17:31:24 +00:00
Kevin Wiliarty 3391ec00f0 MDL-51834 auth,profile: locks custom fields based on auth settings 2015-10-26 13:55:00 +00:00
Dan Poltawski 0c15e941dd Merge branch 'MDL-51894-29' of git://github.com/andrewnicols/moodle into MOODLE_29_STABLE 2015-10-26 12:40:30 +00:00
Andrew Nicols bf54c89e8f MDL-51894 inboundmessage: Ensure that all mailboxes exist 2015-10-26 12:31:06 +08:00
Andrew Nicols bd7583c7fa Merge branch 'MDL-51779_29' of https://github.com/Syxton/moodle into MOODLE_29_STABLE 2015-10-26 09:52:42 +08:00
Jun Pataleta befdd07ceb MDL-51864 blocks: Fixed title display for block_course_summary 2015-10-24 00:04:47 -05:00
lazydaisy b007713333 MDL-51127 theme_bootstrapbase: Re-aligned RTL context header button. 2015-10-23 18:19:18 +01:00
Matt Davidson f755308c8c MDL-51779 assign: PDF annotate quality
Fixes the quality of pdf content when annotating.
2015-10-23 09:36:25 -04:00
Dan Poltawski b828920455 weekly release 2.9.2+ 2015-10-23 12:51:53 +01:00
AMOS bot ff1c3e67af Automatically generated installer lang files 2015-10-23 00:04:29 +08:00
Paul Nicholls 4bb31de252 MDL-51854 atto_image: Allow other plugins to handle drop events
The drop handler should only return false if it has actually handled the
drop event (i.e. it was an image) - otherwise, Atto plugins loaded after
this one don't get an opportunity to handle other drop events.
2015-10-22 12:12:22 +13:00
Dan Poltawski 34776dac4f weekly release 2.9.2+ 2015-10-20 09:56:39 +01:00
Dani Palou 89e0f80a84 MDL-51829 admin: Set userquota setting as PARAM_INT 2015-10-20 10:02:57 +02:00
Mark Nelson fdcdcba552 MDL-51782 mod_forum: fixed unit test failing on certain DBs 2015-10-20 14:45:26 +08:00
Andrew Nicols 4ed6a0b3d6 Merge branch 'MDL-51782_m29' of git://github.com/markn86/moodle into MOODLE_29_STABLE 2015-10-20 11:52:22 +08:00
Mark Nelson 936ef246c4 MDL-51782 mod_forum: altered unit tests for the post_deleted event
This was done to ensure we are actually testing the API, and not
just creating and triggering the event manually.
2015-10-19 20:14:00 -07:00
Mark Nelson 9b9c0ebf1a MDL-51782 mod_forum: moved post_deleted event into function 2015-10-19 20:14:00 -07:00
Jun Pataleta b63ab17d52 MDL-51837 user: Check if user email is set on validation
Add a check if the user's email is set before performing validation on
the user's email address. This is to prevent the warning messages to
be shown in the case of a pending email change which causes the user's
email field to be not included in the Edit profile form.
2015-10-19 16:53:03 -05:00
Eloy Lafuente (stronk7) ccd130374b Merge branch 'wip-mdl-48117-m29' of https://github.com/rajeshtaneja/moodle into MOODLE_29_STABLE 2015-10-19 16:59:02 +02:00
Dan Poltawski 5f46076e1e Merge branch 'm29_MDL-51554_Apache_PHP-FPM_Broken_File_Serving' of https://github.com/scara/moodle into MOODLE_29_STABLE 2015-10-19 15:19:39 +01:00
David Monllao 4dfa85c18b Merge branch 'MDL-50483-29' of git://github.com/lameze/moodle into MOODLE_29_STABLE 2015-10-19 17:06:47 +08:00
Eloy Lafuente (stronk7) 5d563e92b0 MDL-48117 behat: Use form field to check checkbox
On Mac-Chrome click checkbox is not generating
proper events and hence failing. Use behat_form_checkbox
to ensure checkbox is checked
2015-10-19 16:59:25 +08:00
David Monllao ca46e95170 Merge branch 'MDL-51771_29' of git://github.com/timhunt/moodle into MOODLE_29_STABLE 2015-10-19 16:28:10 +08:00
David Monllao c31327ceb0 Merge branch 'MDL-51712-29' of git://github.com/xow/moodle into MOODLE_29_STABLE 2015-10-19 15:43:41 +08:00
Andrew Nicols b60cf799e0 Merge branch 'MDL-51673-29' of git://github.com/junpataleta/moodle into MOODLE_29_STABLE 2015-10-19 13:40:51 +08:00
Andrew Nicols 37c98b2b4f Merge branch 'MDL-51772-29' of git://github.com/jleyva/moodle into MOODLE_29_STABLE 2015-10-19 13:34:34 +08:00
David Monllao e566327fa6 Merge branch 'MDL-51759-29-2' of git://github.com/andrewnicols/moodle into MOODLE_29_STABLE 2015-10-19 13:31:01 +08:00
Simey Lameze a0b2d4e707 MDL-50483 gradereport_user: fix overlapping on the error message 2015-10-19 08:59:38 +08:00
Jinu Abraham 1d9eb4709d MDL-50483 gradereport_user: fix the fatal error of no enrolled users 2015-10-19 08:59:37 +08:00
Andrew Nicols cd58862cc8 Merge branch 'MDL-50412-29' of git://github.com/danpoltawski/moodle into MOODLE_29_STABLE 2015-10-19 08:01:29 +08:00
Tim Hunt 716b0ac977 MDL-51771 question engine: fix typo in SQL
Thanks to Pete at learningpool.com for finding thsi bug.
2015-10-18 16:05:37 +01:00
Jun Pataleta 19c7f9d457 MDL-51673 messages: Added codes for the unit tests 2015-10-16 16:07:16 -05:00
Ben Kelada ab029256b3 MDL-51673 messages: remove strict type check of int vs string 2015-10-16 16:07:15 -05:00
Matteo Scaramuccia 19cc1b1839 MDL-51554 Files: Fix broken file serving under Apache + PHP-FPM 2015-10-16 21:57:58 +02:00
Eloy Lafuente (stronk7) 418c59f945 weekly release 2.9.2+ 2015-10-16 12:51:28 +02:00
John Okely 55ae536cb8 MDL-51712 myprofile: Fix capability checks 2015-10-16 14:48:38 +08:00
Andrew Nicols 812a994f6f Merge branch 'MDL-51565-29' of git://github.com/jleyva/moodle into MOODLE_29_STABLE 2015-10-16 09:36:20 +08:00
Andrew Nicols ebd2721708 Merge branch 'MDL-51651-29' of git://github.com/danpoltawski/moodle into MOODLE_29_STABLE 2015-10-16 09:23:34 +08:00
Andrew Nicols ad0f3b0986 Merge branch 'MDL-50182_29' of git://github.com/stronk7/moodle into MOODLE_29_STABLE 2015-10-16 08:13:35 +08:00
Andrew Nicols a6739f12aa MDL-51759 theme: Ensure that non-svg images are cached and returned 2015-10-16 07:53:45 +08:00
Dan Poltawski e0e4779523 Merge branch 'MDL-51703-29' of git://github.com/jleyva/moodle into MOODLE_29_STABLE 2015-10-15 13:58:58 +01:00
Dan Poltawski 81fcf79f04 Merge branch 'MDL-51500-29' of git://github.com/merrill-oakland/moodle into MOODLE_29_STABLE 2015-10-15 13:52:47 +01:00
Dan Poltawski 1542061801 Merge branch 'MDL-51563-29' of git://github.com/jleyva/moodle into MOODLE_29_STABLE 2015-10-15 13:50:12 +01:00
Dan Poltawski c2fbd20021 Merge branch 'MDL-51652-m29' of https://github.com/sammarshallou/moodle into MOODLE_29_STABLE 2015-10-15 13:45:21 +01:00
Dan Poltawski fd3acdf024 Merge branch 'MOODLE_29_STABLE-MDL-51679-groupmode-ajax' of https://github.com/Dagefoerde/moodle into MOODLE_29_STABLE 2015-10-15 11:44:45 +01:00
Dan Poltawski acbdf41d83 MDL-51651 lang: add consitency for application of firstdayofweek
1) Set the site-wide default based on language pack
2) Use the site/user preference for js popups, like we do in /calendar/
2015-10-15 10:17:08 +01:00
Dan Poltawski b340da9420 MDL-51651 lang: the first day of the week is Monday 2015-10-15 10:17:07 +01:00
Andrew Nicols e945bad970 Merge branch 'MDL-51756-29' of git://github.com/damyon/moodle into MOODLE_29_STABLE 2015-10-15 15:24:05 +08:00
Andrew Nicols 3ee3b0276d MDL-51756 tests: Refactor test to use data-provider
The benefit is that this becomes one test per external function instead of one
test testing them all - so more information is shown on failure and we get lots
more dots (we love dots!).
2015-10-15 15:18:44 +08:00
Damyon Wiese 9a2c7d2f03 MDL-51756 externallib: Show debugging when optional params are wrong
Optional params are not allowed as the top level value for external_function_parameters.
This is because stricter protocols (xmlrpc and soap) cannot handle optional parameters, only
optional properties in a structure.
2015-10-15 14:19:46 +08:00
Ryan Wyllie 51e39264eb MDL-49545 backup: Restore does not respect some capabilities
Thanks to Daniel Neis for the original patch that formed the
basis of these changes.
2015-10-15 11:55:39 +08:00
Dan Poltawski f6e0465718 Merge branch 'MDL-51399_29' of https://github.com/andrewhancox/moodle into MOODLE_29_STABLE 2015-10-14 15:02:51 +01:00
Dan Poltawski 8e496bbf97 Merge branch 'MDL-51467-m29' of https://github.com/sammarshallou/moodle into MOODLE_29_STABLE 2015-10-14 13:41:04 +01:00
Jan C. Dageförde 12621418bd MDL-51679 course: Update groupmode CSS class
Changing groupmode of an activity via AJAX did not change the button's CSS class accordingly.
2015-10-14 14:37:27 +02:00
Juan Leyva a56ffba668 MDL-51772 webservice: Export add_user_private_files as Web Service 2015-10-14 14:11:50 +02:00
Dan Poltawski a583fd0f8d weekly release 2.9.2+ 2015-10-14 10:49:09 +01:00
Dan Poltawski 577030b4c2 NOBUG: Fixed SVG browser compatibility 2015-10-14 10:49:08 +01:00
Eloy Lafuente (stronk7) 0a64621644 MDL-51536 webservices: fix invalid param definitions 2015-10-13 20:34:56 +02:00
Dan Poltawski b6b07a3d24 Merge branch 'MDL-40710-29' of git://github.com/barbararamiro/moodle into MOODLE_29_STABLE 2015-10-13 15:44:04 +01:00
Dan Poltawski d711d02fa3 Merge branch 'MDL-51435-m29' of https://github.com/NeillM/moodle into MOODLE_29_STABLE 2015-10-13 11:44:42 +01:00
Dan Poltawski 63ccf4da71 MDL-47494 grade: even more complete copyright fix.
With thanks to Tim!
2015-10-13 09:54:34 +01:00
Dan Poltawski 126fa4b314 MDL-47494 grade: fix incorrect copyright statement
(From copy/paste error, blame Tim :P)
2015-10-13 09:39:19 +01:00
Damyon Wiese 9eec9e3eae MDL-48861 assign: Make the requires grading filter consistent
Consistently include submissions with a null grade (see MDL-47694).
2015-10-13 14:54:18 +08:00
Damyon Wiese 2e707c274a MDL-48861 assign: Fix unit tests and behat tests
The tests were not working with the change to the needs grading filter.
2015-10-13 13:01:26 +08:00
Andrew Nicols 7c399ad875 Merge branch 'MDL-51302-29' of git://github.com/danpoltawski/moodle into MOODLE_29_STABLE 2015-10-13 11:35:14 +08:00
Jun Pataleta 50868598fb MDL-51128 course: Add startdate for generated course
Added course start date for the course generated by the course
generator in order to prevent incorrect date calculations
(i.e. in assignment due dates) when the generated course is reset.
2015-10-12 21:49:12 -05:00
Andrew Nicols 718caae926 Merge branch 'MDL-51427-29' of git://github.com/marinaglancy/moodle into MOODLE_29_STABLE 2015-10-13 10:14:49 +08:00
Andrew Nicols 2f39d695c3 Merge branch 'MDL-40442-29' of git://github.com/danpoltawski/moodle into MOODLE_29_STABLE 2015-10-13 09:48:05 +08:00
Andrew Nicols 8ba76c053c Merge branch 'MDL-50079-29' of git://github.com/danpoltawski/moodle into MOODLE_29_STABLE 2015-10-13 09:25:24 +08:00
Andrew Nicols c7fa026645 Merge branch 'MDL-50788-29' of git://github.com/danpoltawski/moodle into MOODLE_29_STABLE 2015-10-13 08:54:24 +08:00
Eloy Lafuente (stronk7) bb10739913 MDL-50182 core: add 3.0 environmental requirements
Only change from 2.9 is the modification of the slasharguments
admin setting string to recommend always to keep the setting enabled
and fix the problem in the server, warning about the drawbacks
of disabling it.

Also, there is a little phpdoc note added to one custom check
to have clearly specified when we can get rid of it.
2015-10-13 00:34:58 +02:00
sam marshall 1fe476078c MDL-51467 Availability: Course reset should change restrict dates 2015-10-12 17:34:42 +01:00
Dan Poltawski 68b5527fd2 Merge branch 'MDL-51375_29' of git://github.com/timhunt/moodle into MOODLE_29_STABLE 2015-10-12 17:01:43 +01:00
Damyon Wiese 5a92a95e9c MDL-48861 mod_assign: use >= for requires grading filter
If the grade and submission were modified at exactly the same time,
assume that this means the grade was automatically created for the submission
and is not a real grade from a teacher interaction.
2015-10-12 16:55:44 +01:00
Damyon Wiese 7821a81662 MDL-48861 assign: Fix the "needs grading" filter
When auto-creating a new grade record - do not set the timemodified > than the submission timemodified
2015-10-12 16:55:44 +01:00
Juan Leyva 7e99fac4b3 MDL-51563 core_user: Fix invalid passed parameteres in get_user 2015-10-12 13:54:37 +02:00
Dan Poltawski 259db679f0 Merge branch 'MDL-36606-29' of git://github.com/merrill-oakland/moodle into MOODLE_29_STABLE 2015-10-12 12:41:29 +01:00
Juan Leyva caeaef8c16 MDL-51565 webservice: Fix return types definitions 2015-10-12 13:33:16 +02:00
Dan Poltawski c8c806eea9 Merge branch 'MDL-51586-29' of git://github.com/xow/moodle into MOODLE_29_STABLE 2015-10-12 10:47:16 +01:00
sam marshall 9d00644da6 MDL-51652 Availability: OR conditions fail when filtering user lists
When filtering a user list, if there is an OR tree where one of the
conditions does not restrict user lists such as a date condition,
then the overall result should include all users (not be filtered).
This was not working correctly.
2015-10-12 10:25:31 +01:00
David Monllao de7b0a3be0 Merge branch 'MDL-51083-29' of git://github.com/xow/moodle into MOODLE_29_STABLE 2015-10-12 16:57:58 +08:00
Andrew Nicols 27f4084642 MDL-46497 atto: Whitespace/coding style fix 2015-10-12 13:42:15 +08:00
Andrew Nicols b880d690d7 Merge branch 'MDL-46497_M29' of https://github.com/nadavkav/moodle into MOODLE_29_STABLE 2015-10-12 13:39:01 +08:00
Andrew Nicols 7f67cf5102 Merge branch 'MDL-51451-m29' of https://github.com/sammarshallou/moodle into MOODLE_29_STABLE 2015-10-12 10:12:04 +08:00
Lior Gil ee598ac82a MDL-46497 Atto: Fix adding redundant p elements in rtl/ltr actions 2015-10-10 01:35:35 +03:00
Juan Leyva f6057175fb MDL-51703 mod_survey: Trigger response_submitted event in correct place 2015-10-09 16:27:33 +02:00
Dan Poltawski 9b8d2eda4d MDL-50412 admin: prevent fatal errors on reports admin page 2015-10-09 14:47:29 +01:00
Barbara Ramiro ad7c52eb85 MDL-40710 Icon: More identifiable backpack icon 2015-10-09 18:54:14 +08:00
Dan Poltawski 0cd5052f4b MDL-50079 atto_link: respect new window option when creating from repo
Previously users had to go back and edit their link to set the new
window option.
2015-10-09 11:26:10 +01:00
Dani Palou 6fb37f884f MDL-51685 user: Support gravatar images in user_get_user_details 2015-10-09 11:51:26 +02:00
Dan Poltawski 54a669fa52 MDL-50788 classloader: Prevent cryptic errors on unreadable classes dir
Do not attempt to read an unreadable directory because previously the generated
errors were hard to fathom.

Thanks to James McQuillan for the basis of the patch.
2015-10-09 10:37:24 +01:00
Dan Poltawski 63ba497c29 MDL-51302 scorm: do not use invalid course urls
Previous behaviour of setting an empty sectionid was incorrect and we
were doing work which course_get_url() does for us.
2015-10-09 09:09:49 +01:00
Neill Magill 529162a2c3 MDL-51435 Web Services: E_WARNING in core_webservice_get_site_info
$plugin was not being set before the version file was included.
This caused an E_WARNING: Creating default object from empty value

This change creates the plugin object before the version file sets its parameters.
2015-10-09 09:02:04 +01:00
John Okely 656af10fc1 MDL-51586 enrol: Enrolment table displays fullname properly.
When the alternatefullnamedisplay was set to something that
didn't contain 'firstname' then nothing would be displayed
for the user's name.
2015-10-09 15:35:04 +08:00
Damyon Wiese dc325d9891 MDL-51628 assign: invalid hardcoded capability check
Use existing function to do the check instead.
2015-10-09 15:00:45 +08:00
Mifsud Gaël 1ad598584d MDL-51083 admin: Prevent password autofill in authentication settings 2015-10-09 14:33:49 +08:00
Damyon Wiese 59a5dbe18b MDL-51686 assign: Apply admin default for comment inline 2015-10-09 13:40:57 +08:00
Eric Merrill 1f77dcd5b3 MDL-36606 gradereport: Update AJAX grader to understand gradeless cells 2015-10-08 12:47:28 -04:00
Michael Aherne 2c3fec1406 MDL-51707 cron: Prevent finished tasks being returned 2015-10-08 16:40:15 +01:00
Barbara Ramiro 78cdc5327b MDL-40442 Icon: Improved svg download icon and png version 2015-10-08 13:31:34 +01:00
Dan Poltawski e6311ee386 weekly release 2.9.2+ 2015-10-08 11:36:46 +01:00
Dan Poltawski 580ea641f1 Merge branch 'install_29_STABLE' of https://git.in.moodle.com/amosbot/moodle-install into MOODLE_29_STABLE 2015-10-08 11:36:44 +01:00
Adam Olley aa6ad4698a MDL-51285 mod_forum: Posts all need to have different stamps 2015-10-08 12:23:16 +08:00
Eric Merrill 02bb527c56 MDL-51500 navigation: Compute links with destination context
We should calculate the links based on the destination context,
not the current course. Could show links that are not accessible.
2015-10-07 10:02:32 -04:00
Dan Poltawski 5e295f8af5 Merge branch 'MDL-50142_29' of https://github.com/dmonllao/moodle into MOODLE_29_STABLE 2015-10-07 12:32:36 +01:00
sam marshall 5528d4e20f MDL-51451 Moodle dialogues: Lock scroll causes background jump
When you add a module or otherwise cause a Moodle dialogue to appear, this
enables the 'lock scroll' feature (the scrollbar disappears).

On some browsers this causes the width of the viewport to change, which can
cause centered/right-aligned theme elements to move distractingly.

This change temporarily sets body max-width while lock scroll is active.
2015-10-07 10:31:26 +01:00
David Monllao c2df6f969e Merge branch 'wip-mdl-51285-m29' of git://github.com/rajeshtaneja/moodle into MOODLE_29_STABLE 2015-10-07 11:23:11 +08:00
Andrew Nicols 03ab23d34a Merge branch 'MDL-41042-29' of git://github.com/marinaglancy/moodle into MOODLE_29_STABLE 2015-10-07 10:26:42 +08:00
David Monllao 373861c951 Merge branch 'MDL-51525-29' of git://github.com/ryanwyllie/moodle into MOODLE_29_STABLE 2015-10-07 09:22:44 +08:00
Dan Poltawski 6f1eec32e5 Merge branch 'MDL-51588-29' of git://github.com/FMCorz/moodle into MOODLE_29_STABLE 2015-10-06 11:42:56 +01:00
David Monllao 6c5f5bd8ef Merge branch 'MDL-51656_m29' of git://github.com/markn86/moodle into MOODLE_29_STABLE 2015-10-06 15:25:04 +08:00
Andrew Nicols 5f68e420d0 Merge branch 'MDL-51228-m29-master' of https://github.com/dthies/moodle into MOODLE_29_STABLE 2015-10-06 13:48:42 +08:00
Andrew Nicols f3669c2a69 MDL-51461 javascript: Fix whitespace issue 2015-10-06 13:16:56 +08:00
Andrew Nicols 3ad7079217 Merge branch 'MDL-51461_2_9' of https://github.com/andrewhancox/moodle into MOODLE_29_STABLE 2015-10-06 13:04:58 +08:00
Tim Hunt 693f5eff05 MDL-51375 excel output: more work to avoid invalid sheet names 2015-10-06 05:45:14 +01:00
Andrew Nicols 4e435ac25a Merge branch 'MDL-44707-29' of git://github.com/marinaglancy/moodle into MOODLE_29_STABLE 2015-10-06 11:35:57 +08:00
Andrew Nicols e735a8f7d6 Merge branch 'MDL-50805_MOODLE_29_STABLE' of https://github.com/crazyserver/moodle into MOODLE_29_STABLE 2015-10-06 10:33:24 +08:00
David Monllao 8aa7c69eb5 Merge branch 'MOODLE_29_STABLE-MDL-49750' of git://github.com/jojoob/moodle into MOODLE_29_STABLE 2015-10-06 09:29:37 +08:00
Dan Poltawski 82e8cc50eb Merge branch 'wip-MDL-49189-MOODLE_29_STABLE' of https://github.com/kwiliarty/moodle into MOODLE_29_STABLE 2015-10-05 15:03:16 +01:00
Dan Poltawski d44d5d0257 Merge branch 'MDL-51501-29' of git://github.com/merrill-oakland/moodle into MOODLE_29_STABLE 2015-10-05 11:47:53 +01:00
Johannes Burk 208f6dfce0 MDL-49750 mod_data: fix updating file/picture fields breaks references
Use file_save_draft_area_files on file/picture update and
set content to null if file was removed.
2015-10-05 11:44:08 +02:00
David Monllao d4b743890c Merge branch 'MDL-51514_m29' of git://github.com/markn86/moodle into MOODLE_29_STABLE 2015-10-05 16:00:01 +08:00
David Monllao ad81b49f4a Merge branch 'MDL-51408-29' of git://github.com/marinaglancy/moodle into MOODLE_29_STABLE 2015-10-05 13:50:23 +08:00
David Monllao d2d18b2abf MDL-50613 webservices: Upgrade info about riskbitmask 2015-10-05 12:18:45 +08:00
David Monllao f0e56d7197 Merge branch 'MDL-50613-29' of git://github.com/jleyva/moodle into MOODLE_29_STABLE 2015-10-05 12:11:21 +08:00
David Monllao e3e4358287 MDL-50142 editor: Refining editor preference help
All credit goes to Helen Foster.
2015-10-05 09:32:02 +08:00
Ben Tindell 73062f6503 MDL-50142 user: context sensitive help
Added context sensitive help to
Edit Profile > Text Editor
2015-10-05 09:32:02 +08:00
Sam Chaffee cf945e8ffb MDL-51514 gradebook: Optimize set_usedinaggregation query for MySQL 2015-10-04 13:20:41 -07:00
Kevin Wiliarty e494eb4743 MDL-49189 auth: Map data to profile fields with uppercase shortnames 2015-10-03 08:12:50 -04:00
Mark Nelson 284fd4d3ac MDL-51656 auth_radius: fixed colon location 2015-10-02 16:35:33 -07:00
AMOS bot 2ac1086916 Automatically generated installer lang files 2015-10-03 00:04:10 +08:00
Dan Poltawski 6d9b42695a weekly release 2.9.2+ 2015-10-02 10:57:38 +01:00
Dan Poltawski cded277648 Merge branch 'install_29_STABLE' of https://git.in.moodle.com/amosbot/moodle-install into MOODLE_29_STABLE 2015-10-02 10:57:35 +01:00
Eloy Lafuente (stronk7) c84f6fd713 Merge branch 'wip-mdl-50940-m29' of https://github.com/rajeshtaneja/moodle into MOODLE_29_STABLE 2015-10-01 11:26:28 +02:00
Pau Ferrer Ocaña 00a51457f4 MDL-50805 Messages: Add index to message_read to speed up message crons 2015-10-01 10:38:42 +02:00
David Monllao 55f93cb5f0 MDL-46710 mod_lti: Removing duplicated generated events
Event generation and completion should be generated only once.
2015-10-01 12:05:52 +08:00
Eloy Lafuente (stronk7) f3acb82953 Merge branch 'MDL-51227-m29-master' of https://github.com/dthies/moodle into MOODLE_29_STABLE 2015-10-01 00:28:50 +02:00
Andrew Robert Nicols 8db4327324 MDL-36606 gradereport: Correctly handle ungraded assessment ajax grading 2015-09-30 15:03:58 -04:00
Eloy Lafuente (stronk7) 048a0996f1 Merge branch 'wip-mdl-51266-m29' of https://github.com/rajeshtaneja/moodle into MOODLE_29_STABLE 2015-09-30 20:34:45 +02:00
Andrew Hancox 9aed16a38f MDL-51399 report_outline: Hide blog column if blogs are disabled. 2015-09-30 17:01:21 +01:00
Eloy Lafuente (stronk7) 87b01f2599 Merge branch 'MDL-51292-29' of git://github.com/cameron1729/moodle into MOODLE_29_STABLE 2015-09-30 17:33:37 +02:00
Andrew Hancox cd5f5147df MDL-51461 core: Fix issue with client side mustache templates 2015-09-30 10:37:15 +01:00
Juan Leyva d7a5af3f74 MDL-50613 webservice: Remove risk bit masks for Web Service protocols
This will prevent to show a 'Critical' status in security overview
report when mobile services are enabled
2015-09-30 09:56:45 +02:00
David Monllao cfcef5d0e2 Merge branch 'MDL-51415-29' of git://github.com/jleyva/moodle into MOODLE_29_STABLE 2015-09-30 14:15:45 +08:00
David Monllao 9d6ce46e15 Merge branch 'mdl51440-moodle29' of git://github.com/tlock/moodle into MOODLE_29_STABLE 2015-09-30 10:53:07 +08:00
Eloy Lafuente (stronk7) 2523ec4ba9 Merge branch 'MDL-49143-29' of git://github.com/cameron1729/moodle into MOODLE_29_STABLE
Note: Added minor fix to unit test.
2015-09-30 03:22:05 +02:00
Dan Poltawski 1f93fcfe46 Merge branch 'MDL-51402_29' of git://github.com/timhunt/moodle into MOODLE_29_STABLE 2015-09-29 20:54:44 +01:00
Dan Poltawski 845360bec9 Merge branch 'MDL-51424-m29-master' of https://github.com/dthies/moodle into MOODLE_29_STABLE 2015-09-29 20:33:27 +01:00
Dan Poltawski e619162d7d Merge branch 'MDL-42639_29' of git://github.com/dmonllao/moodle into MOODLE_29_STABLE 2015-09-29 10:20:13 +01:00
David Monllao 68ca374e7d MDL-42639 user: user:viewalldetails enough to view some fields
The fields are:
- username
- idnumber
- institution
- department
2015-09-29 16:56:02 +08:00
Ryan Wyllie 54c92105cc MDL-51525 libraries: added graphlib to thirdpartylibs.xml 2015-09-29 08:24:52 +00:00
Frederic Massart 8143c179f2 MDL-51588 webservice: Allow CORS in webservice/pluginfile.php 2015-09-29 14:41:59 +08:00
Andrew Nicols 014eee157d Merge branch 'MDL-43594-29' of git://github.com/junpataleta/moodle into MOODLE_29_STABLE 2015-09-29 13:52:55 +08:00
Jun Pataleta 3cad70efa0 MDL-43594 mod_assign: Fix calendar update on course reset
This patch fixes the updating of calendar events when the course
is reset and its start date is changed.
2015-09-29 13:47:07 +08:00
Andrew Nicols cbd5cc6c97 Merge branch 'MDL-35918-29' of git://github.com/ryanwyllie/moodle into MOODLE_29_STABLE 2015-09-29 13:42:58 +08:00
Eloy Lafuente (stronk7) 8ae030ea26 MDL-49143 LTI: Test resource_link_id in lti_build_request() 2015-09-29 13:42:34 +08:00
Cameron Ball 833042d716 MDL-49143 LTI: Fix missing resource id 2015-09-29 13:42:34 +08:00
Ryan Wyllie 7dd1a2adff MDL-35918 javascript: dialogues screen reader support
The YUI notification dialogues will now set the appropriate
aria attributes when they are shown/hidden to allow screen
readers to navigate them correctly.

When the dialogue is shown all background elements will be marked
as hidden while the dialogue is marked as visible to a screen reader.

When the dialogue is closed the modified elements will be reverted
to their previous state and the dialogue will be marked as hidden to
a screen reader.
2015-09-29 04:56:14 +00:00
Andrew Nicols 0e1967f0ef Merge branch 'wip-MDL-51241-29' of git://github.com/abgreeve/moodle into MOODLE_29_STABLE 2015-09-29 12:45:39 +08:00
Andrew Nicols b3be78703e Merge branch 'MDL-51476_29' of git://github.com/timhunt/moodle into MOODLE_29_STABLE 2015-09-29 11:51:57 +08:00
Tim Lock e81c36413e MDL-51440 gradeimport_direct: fix config require statement 2015-09-29 12:09:48 +09:30
Dan Poltawski 0c9eba6722 Merge branch 'MDL-51305_29_too_many_gradeitem_fetches' of https://github.com/colin-umn/moodle into MOODLE_29_STABLE 2015-09-28 16:25:56 +01:00
Juan Leyva 550445a364 MDL-51415 webservice: Check course access using can_access_course()
This function check both user enrolled and course:view capabilities
2015-09-28 16:55:32 +02:00
Dan Poltawski a6174e039b Merge branch 'mdl46710-moodle29' of https://github.com/tlock/moodle into MOODLE_29_STABLE 2015-09-28 14:56:56 +01:00
Dan Poltawski 86e12fc481 Merge branch 'MDL-51390_29' of https://github.com/totara/openbadges into MOODLE_29_STABLE 2015-09-28 13:27:15 +01:00
Mark Nielsen 3876164bb9 MDL-51498 core_grades: Prevent unnecessary grade record fetching
All of these changes make use of already
fetched grade data.  Without these changes,
the gradebook regrade process does not scale
well with very large courses because it fetches
many grade records, one at a time.
2015-09-28 11:12:55 +01:00
Yuliya Bozhko 9c409941ac MDL-51390 badges: Switch backpack URL to use HTTPS
Signed-off-by: Yuliya Bozhko <yuliya.bozhko@totaralms.com>
2015-09-28 10:34:12 +01:00
Dan Poltawski 3c32d705b4 Merge branch 'MDL-49482-29' of https://github.com/blckct/moodle into MOODLE_29_STABLE 2015-09-28 10:31:49 +01:00
AMOS bot 725b10cbea Automatically generated installer lang files 2015-09-28 00:04:09 +08:00
Daniel Thies 3d7be50b95 MDL-51424 editor_atto: Save selection and editor contents after change 2015-09-25 09:48:44 -05:00
Daniel Thies 4287eb3f85 MDL-51227 editor_atto: Stop Chrome losing selection when formating 2015-09-25 09:34:58 -05:00
Tim Hunt 3a1c91bbe0 MDL-51476 questions: manual grading validation for ungraded Qs
The change in MDL-51090 broke manually commenting on questions for which
no mark is given (max mark == 0). This fixes it, with unit tests.

Thanks to Nick Phillips for the original suggestion of the fix.
2015-09-25 14:02:25 +01:00
Tim Lock 3fb95da969 MDL-46710 mod_lti: fix logging and completion tracking in new windows 2015-09-25 06:27:47 +09:30
Eloy Lafuente (stronk7) bca5897d9d MDL-49482 sqlsrv: Implement support of Offset/Fetch in SQL Server 2012+ 2015-09-24 20:10:41 +02:00
Jakub Kania 0df572a400 MDL-49482 mssql: Implement support of Offset/Fetch in SQL Server 2012+. 2015-09-24 20:10:41 +02:00
Eloy Lafuente (stronk7) ee64a43e1f weekly release 2.9.2+ 2015-09-24 16:07:22 +02:00
rajesh Taneja eaaf824878 MDL-50940 behat: Added support for field matching with xpath 2015-09-24 13:03:17 +08:00
Andrew Hancox e914864d08 MDL-50940 behat: Added ability to check field value by xpath 2015-09-24 13:03:16 +08:00
Cameron Ball fb289cac64 MDL-51292 core_message: Notify when leaving page or closing modal.
- Add reset_dirty_state method to formchangechecker. This is useful when used in combination with a modal.
- Modify hide method of sendmessage to reset formchangechecker dirty state on modal close.
2015-09-24 12:36:43 +08:00
rajesh Taneja 13aa85310e MDL-49973 behat: Fixed string change from Continue to Delete 2015-09-24 10:35:29 +08:00
Eloy Lafuente (stronk7) 3153e64879 Merge branch 'MDL-50207-29' of git://github.com/lameze/moodle into MOODLE_29_STABLE 2015-09-23 20:15:49 +02:00
Eloy Lafuente (stronk7) 43c37c2a6c Merge branch 'wip-MDL-51259-29' of git://github.com/abgreeve/moodle into MOODLE_29_STABLE 2015-09-23 16:25:02 +02:00
rajesh Taneja 74898ce3a9 MDL-51266 unittest: replaced low level phpunit_util calls 2015-09-23 15:44:16 +08:00
David Monllao 5a30263466 MDL-50332 enrol_self: Setting form url for guests
Credit to Andrew Nicols.
2015-09-23 11:52:53 +08:00
Eric Merrill f7265106ef MDL-51501 themes: pix_icon should not include empty alt tags 2015-09-22 17:20:12 -04:00
Dan Poltawski 5230bba5a5 Merge branch 'wip-MDL-51108-29' of git://github.com/abgreeve/moodle into MOODLE_29_STABLE 2015-09-22 11:48:52 +01:00
Dan Poltawski 7d5747f1d1 Merge branch 'MDL-49973-29' of git://github.com/cameron1729/moodle into MOODLE_29_STABLE 2015-09-22 09:44:45 +01:00
Dan Poltawski 392dccf38b MDL-50917 navigation: fix incorrect @since 2015-09-22 09:22:26 +01:00
Dan Poltawski 4addd78dfc Merge branch 'wip-MDL-50917-29' of git://github.com/abgreeve/moodle into MOODLE_29_STABLE 2015-09-22 09:18:16 +01:00
Dan Poltawski 8422607979 Merge branch 'MDL-46157-29' of git://github.com/cameron1729/moodle into MOODLE_29_STABLE 2015-09-22 08:15:01 +01:00
Adrian Greeve 1283e4c1b5 MDL-50917 navigation: Behat tests for viewing user preference page. 2015-09-22 11:29:46 +08:00
Adrian Greeve afd9a1766d MDL-50917 navigation: Unit test for viewing preference page. 2015-09-22 11:29:46 +08:00
Adrian Greeve 679b9927fe MDL-50917 navigation: Allow users with permission to access preferences. 2015-09-22 11:29:45 +08:00
Andrew Nicols bb126a9b18 Merge branch 'MDL-51190-29' of https://github.com/pauln/moodle into MOODLE_29_STABLE 2015-09-22 08:30:28 +08:00
Ferenc Lengyel e5cd1282a1 MDL-51402 quiz: notification emails should respect grouping
In the case where teachers do not have the accessallgroups capability,
we only send "an attempt has been sumbitted "notification to teachers
in the same group as the student who submitted.

At the moment this considers all groups in the course. If this
particular quiz has a grouping set, then the logic should only consider
the groups in that grouping.
2015-09-21 13:31:08 +01:00
Dan Poltawski 33a42e94b4 Merge branch 'MDL-51052_29' of https://github.com/dmonllao/moodle into MOODLE_29_STABLE 2015-09-21 10:53:29 +01:00
Dan Poltawski 49e36faa06 Merge branch 'MDL-48165-29-dimgrades' of git://github.com/mudrd8mz/moodle into MOODLE_29_STABLE 2015-09-21 10:14:48 +01:00
Andrew Nicols 67885c39ae Merge branch 'MDL-50332_29' of git://github.com/dmonllao/moodle into MOODLE_29_STABLE 2015-09-21 15:45:29 +08:00
David Monllao a12ee735fe MDL-50332 enrol_self: Formatting unavailable instances error messages
Many thanks to Andrew Nicols as this patch is based on his
proposal. Thanks Andrew.
2015-09-21 15:42:22 +08:00
Andrew Nicols 71b39748eb Merge branch 'MDL-50790-29' of git://github.com/cameron1729/moodle into MOODLE_29_STABLE 2015-09-21 14:43:50 +08:00
Cameron Ball b17f884ee0 MDL-50790 tests: Fix outlook fixture. 2015-09-21 14:27:51 +08:00
Cameron Ball 8503ae7558 MDL-50790 inbound: Stop incorrect amount of lines getting removed.
Too many lines were being removed for GMail senders. The function was
also removed because it is no longer used, and guessing the client
and cutting accordingly is a poor approach and will probably lead
to issues similar to this one.
2015-09-21 14:27:51 +08:00
Dan Poltawski 50ee86edc8 MDL-50790 messageinbound: fixture for gmail 2015-09-21 14:27:51 +08:00
Andrew Nicols 6d1170ad84 Merge branch 'MDL-51431_2_9' of https://github.com/andrewhancox/moodle into MOODLE_29_STABLE 2015-09-21 08:12:14 +08:00
David Monllao 55ef80065e MDL-51052 dml: More info about mysql and case & accent sensitiveness 2015-09-18 11:46:39 +08:00
Charles Fulton 5cf8645e95 MDL-51052 dml: support for sql_like() under utf8_bin 2015-09-18 11:46:39 +08:00
Adrian Greeve 26385f6e34 MDL-51108 mod_data: Addition to behat test for Lat. and Long. 2015-09-18 07:34:03 +08:00
Adrian Greeve b44fd9143c MDL-51108 mod_data: Add validation for Lat. and Long.
Added a check to see that both the Lat. and Long. values
are entered when filling in database module entries.
2015-09-18 07:34:03 +08:00
Adrian Greeve e9a554e24e MDL-51241 cohorts: Update to cohort query.
This improves the speed of returning a list of
cohorts. Thanks to François Gannaz for providing
this patch.
2015-09-18 07:32:13 +08:00
Adrian Greeve c1a2d364dd MDL-51259 mod_data: ratings of items not activated.
When selecting a rating method, the restrict rating
to items with dates would be automatically enabled if
not checked. This code brings the data module inline
with forum and glossary.
2015-09-18 07:25:06 +08:00
Eloy Lafuente (stronk7) 2dd2288807 weekly release 2.9.2+ 2015-09-17 18:01:30 +02:00
Simey Lameze bc9cfd8e92 MDL-50959 gradebook: fix XML grade export 2015-09-17 10:36:52 +08:00
Andrew Hancox 49abb3dbd1 MDL-51431 enrol_flatfile: Fix for startdate when updating users 2015-09-16 10:59:46 +01:00
Marina Glancy 8c632bed76 MDL-46705 admin: Validate unique shortname for frontpage course 2015-09-16 14:48:10 +08:00
David Monllao 90728c0471 MDL-48881 mod_lesson: A couple of performance improvements
- Improve memory usage on db drivers not able to use recordsets
  properly
- !array_key_exists replaced by empty calls
2015-09-16 13:36:20 +08:00
Marina Glancy e6ad581ef1 MDL-51427 user: correctly use strings for phone1 and phone2
Thanks to Olumuyiwa Taiwo for original patch
2015-09-16 13:36:14 +08:00
David Monllao 5e59d05dcb Merge branch 'MDL-48881_m29v5' of git://github.com/sbourget/moodle into MOODLE_29_STABLE 2015-09-16 13:35:53 +08:00
David Monllao 0be4b0e256 Merge branch 'MDL-49561_m29' of git://github.com/markn86/moodle into MOODLE_29_STABLE
Conflicts:
	lib/bennu/readme_moodle.txt
2015-09-16 09:58:29 +08:00
Daniel Kosinski 68bd2b3132 MDL-46705 admin: Check if course with same shortname already exists 2015-09-16 09:45:50 +08:00
Eloy Lafuente (stronk7) e544b6b02a Merge branch 'MDL-50685_29' of git://github.com/dmonllao/moodle into MOODLE_29_STABLE 2015-09-16 02:16:27 +02:00
Eloy Lafuente (stronk7) 204f6198de Merge branch 'MDL-49032_29' of https://github.com/stronk7/moodle into MOODLE_29_STABLE 2015-09-16 01:01:00 +02:00
Eloy Lafuente (stronk7) 6fc0e628c2 MDL-49032 lib/bennu: update readme to document the change 2015-09-16 00:54:06 +02:00
Joby Harding b5f95a5aec MDL-49032 lib/bennu: use HTAB only when folding lines 2015-09-16 00:40:11 +02:00
Eloy Lafuente (stronk7) e3ba5c0bf7 Merge branch 'MDL-50959-29' of git://github.com/lameze/moodle into MOODLE_29_STABLE 2015-09-15 23:36:25 +02:00
Eloy Lafuente (stronk7) 868fccdfec Merge branch 'MDL-50892-29' of git://github.com/marinaglancy/moodle into MOODLE_29_STABLE 2015-09-15 23:35:13 +02:00
Eloy Lafuente (stronk7) 34ed3b47d1 Merge branch 'MDL-50766_29' of git://github.com/dmonllao/moodle into MOODLE_29_STABLE 2015-09-15 23:03:02 +02:00
David Monllao 49e22cf34c Merge branch 'MDL-50884-29' of git://github.com/lameze/moodle into MOODLE_29_STABLE 2015-09-15 17:16:01 +08:00
Cameron Ball 99e496e085 MDL-49973 behat: Update delete button names 2015-09-15 15:25:36 +08:00
Andrew Davis c4f82182b7 MDL-49973 changed continue to delete on delete confirmations 2015-09-15 15:25:36 +08:00
David Monllao 9b0671bf64 Merge branch 'MDL-50921-29' of git://github.com/ryanwyllie/moodle into MOODLE_29_STABLE 2015-09-15 14:27:23 +08:00
David Monllao 8754df0a60 MDL-51048 backup: Removing unnecessary var 2015-09-15 13:44:18 +08:00
David Monllao 9931445ebb Merge branch 'MDL-51048_29' of git://github.com/timhunt/moodle into MOODLE_29_STABLE 2015-09-15 13:44:10 +08:00
Andrew Nicols 468ed9d2cf Merge branch 'MDL-51290-29' of git://github.com/cameron1729/moodle into MOODLE_29_STABLE 2015-09-15 13:06:10 +08:00
Paul Nicholls b5c0915c78 MDL-51190 javascript: Make "maximised embed" compatible with MS Edge
MS Edge exhibits strange behaviour when M.util.init_maximised_embed hides
the embedded document by setting its width and height to 0px.  Toggling
display:none instead achieves the intended goal without breaking Edge.
2015-09-15 16:32:16 +12:00
David Monllao a9c345ff81 Merge branch 'MDL-51008-29' of git://github.com/marinaglancy/moodle into MOODLE_29_STABLE 2015-09-15 11:21:47 +08:00
Marina Glancy 5c3cf3991a MDL-51408 badges: fix criteria for custom profile fields 2015-09-15 11:17:49 +08:00
David Monllao 3576fc22c1 Merge branch 'MDL-51147_29' of git://github.com/timhunt/moodle into MOODLE_29_STABLE 2015-09-15 10:09:33 +08:00
David Monllao 05fcce2d37 Merge branch 'm29_MDL-51363_Fix_Default_Settings_1x_Restore' of git://github.com/scara/moodle into MOODLE_29_STABLE 2015-09-15 10:01:18 +08:00
Simey Lameze 96a2f1bf90 MDL-50207 block_activity_results: css styling on activity results block
This commit fixes minor styling issues on the activity results block and also add RTL css.
2015-09-15 08:43:58 +08:00
Matteo Scaramuccia c666cd83d5 MDL-51363 SCORM: fixed default settings on restoring 1.x backups 2015-09-14 23:54:46 +02:00
Cameron Ball 3f922fc16b MDL-51290 user: Expand picture section in profile by default 2015-09-14 17:53:56 +08:00
David Monllao d97841bd6a Merge branch 'wip-mdl-51101-m29' of git://github.com/rajeshtaneja/moodle into MOODLE_29_STABLE 2015-09-14 16:18:38 +08:00
David Monllao e198c711d6 Merge branch 'MDL-51170-29' of git://github.com/andrewnicols/moodle into MOODLE_29_STABLE 2015-09-14 14:14:35 +08:00
Damyon Wiese 13cc47d30f MDL-50782 Ajax: No require_login for all ajax webservice calls
Some webservice functions need to be available without a login, e.g.
fetching strings and templates.

External functions must call validate_context if they require a valid login etc.

Added a new parameter to services.php: "loginrequired". Default is true.
2015-09-14 14:07:02 +08:00
David Monllao 3bf7532b3a Merge branch 'MDL-51191-moodle29' of git://github.com/StudiUM/moodle into MOODLE_29_STABLE 2015-09-14 13:59:29 +08:00
David Monllao 94990b79dd Merge branch 'MDL-51253_MOODLE_29' of git://github.com/BenKelada/moodle into MOODLE_29_STABLE 2015-09-14 13:07:52 +08:00
Ben Kelada 1f7c86cd14 MDL-51253 forum: fix urls for exceptions and redirects 2015-09-14 14:19:55 +10:00
Simey Lameze 95950c4696 MDL-50884 auth_shibboleth: fix logout handler url generation
This patch fixes the shibboleth redirect url generation, that can create invalid url
if the shibboleth logout_handler setting has a parameter generating two parameters
with (?) instead of (&).

Thanks to Matteo Boni for the proposed solution.
2015-09-14 09:50:43 +08:00
David Monllao 5830edf9ec Merge branch 'MDL-51232_29' of git://github.com/jinuabraham/moodle into MOODLE_29_STABLE 2015-09-14 09:39:18 +08:00
Daniel Thies beed73ad0f MDL-51228 atto_editor: Add documententation for inlineFormat flag 2015-09-13 14:28:25 -05:00
Colin Campbell f65bf24e5c MDL-51305 grade: Fix slow grade operations by setting grade_item early.
Exports were fetching the grade item for every item-user combination.
Setting the grade_item object on the grade_item early prevents that.
2015-09-11 15:38:32 -05:00
Jean-Philippe Gaudreau e6b37361a1 MDL-51191 assign: Optimizing slow SQL query for MySQL 2015-09-11 11:11:12 -04:00
David Monllao 6e29f12837 MDL-50766 grunt: Check that there are yui modules before running shifter 2015-09-11 15:12:10 +08:00
Jetha Chan ee7300f6e6 MDL-50685 core_form: disable hidden options, don't just hide 2015-09-11 15:09:09 +08:00
Marina Glancy 761e4380ef MDL-50892 mod: allow activity to have name '0' 2015-09-11 10:52:42 +08:00
Rajesh Taneja 146cf59327 MDL-51101 behat: Fixed wrong hover step usage
Hover step was being mis-used for checking activity completion
This is replaced with proper step which check for img element
2015-09-10 14:53:55 +08:00
Rajesh Taneja 8f0336c473 MDL-51101 behat: Removed old behat steps checking feature
This was introduced when there were no features
testing all the steps. Now we have all use-cases
so removing this feature file
2015-09-10 14:53:44 +08:00
Tim Hunt cc895e58d4 MDL-51147 qtype_match: stats should cope even if Q edited badly
The numbers become pretty meaningless, but we need to avoid fatal
errors.
2015-09-09 16:48:37 +01:00
Simey Lameze 85dcae6808 MDL-50959 gradebook: fix XML grade publishing score 2015-09-09 14:03:15 +08:00
Stephen Bourget 1c496f6923 MDL-48881 Lesson: Show all attempts on reports. 2015-09-08 21:21:38 -04:00
Cameron Ball c6b86ab0c0 MDL-46157 drag and drop: Improve item labels
Ignore the edit menu when determining the region to drag.
2015-09-08 11:41:28 +08:00
Marina Glancy ebc0351e54 MDL-51008 grades: show correct default value in overview report 2015-09-08 10:11:56 +08:00
Corey Wallis 5dab1b52ba MDL-51048 IMS-CC: Fix import & export of true/false questions 2015-09-07 16:05:58 +01:00
Marina Glancy 56c0af9224 MDL-50921 message: allow popup messages from noreply user
Thanks Gary Harris for the patch
2015-09-07 08:15:08 +00:00
Mark Nelson 30d813d44e MDL-49561 core_lib: added info to bennu readme
Also did some minor tweaks to existing code.
2015-09-04 19:39:55 -07:00
Lars Anderson b7dffc34f5 MDL-49561 core_calendar: Fix ical export for events with no duration 2015-09-04 19:39:55 -07:00
Marina Glancy 2e3e1ae283 MDL-41042 coursecat: better handle changes in coursecontact 2015-09-04 11:53:58 +08:00
rajesh Taneja 776f291ffd MDL-51285 mod_forum: Discussion post should not have same time stamp
Discussion post are sorted by timemodified
if they have same timemodified then results
will be random
2015-09-03 15:34:07 +08:00
David Mudrák a0c74d2ad9 MDL-48165 workshop: Validate the rubric editing form 2015-09-01 22:57:59 +02:00
David Mudrák 95778c3e51 MDL-48165 workshop: Add support for assessment forms validation 2015-09-01 22:57:04 +02:00
Jinu Abraham 328732592e MDL-51232 mod_book: Filter name header 2015-08-31 12:05:34 +09:30
Marina Glancy cdf0f5c144 MDL-44707 block_html: copy files when copying instance 2015-08-28 16:04:36 +08:00
Daniel Thies 8049148bcf MDL-51228 editor_atto: Apply style in plugins if selection is collapsed 2015-08-27 12:31:27 -05:00
Andrew Nicols fc95ad105d MDL-51170 core: Scheme section of URL should be case insensitive 2015-08-21 12:27:04 +08:00
564 changed files with 12426 additions and 3349 deletions
+122 -21
View File
@@ -24,6 +24,7 @@
module.exports = function(grunt) {
var path = require('path'),
fs = require('fs'),
tasks = {},
cwd = process.env.PWD || process.cwd();
@@ -49,6 +50,17 @@ module.exports = function(grunt) {
}
)
}
},
less: {
bootstrapbase: {
files: {
"theme/bootstrapbase/style/moodle.css": "theme/bootstrapbase/less/moodle.less",
"theme/bootstrapbase/style/editor.css": "theme/bootstrapbase/less/editor.less",
},
options: {
compress: true
}
}
}
});
@@ -102,22 +114,107 @@ module.exports = function(grunt) {
args.push('--lint-stderr');
}
// Actually run shifter.
shifter = exec("node", args, {
cwd: cwd,
stdio: 'inherit',
env: process.env
});
if (grunt.option('no-color')) {
args.push('--color=false');
}
// Tidy up after exec.
shifter.on('exit', function (code) {
if (code) {
grunt.fail.fatal('Shifter failed with code: ' + code);
} else {
grunt.log.ok('Shifter build complete.');
done();
}
});
var execShifter = function() {
shifter = exec("node", args, {
cwd: cwd,
stdio: 'inherit',
env: process.env
});
// Tidy up after exec.
shifter.on('exit', function (code) {
if (code) {
grunt.fail.fatal('Shifter failed with code: ' + code);
} else {
grunt.log.ok('Shifter build complete.');
done();
}
});
};
// Actually run shifter.
if (!options.recursive) {
execShifter();
} else {
// Check that there are yui modules otherwise shifter ends with exit code 1.
var found = false;
var hasYuiModules = function(directory, callback) {
fs.readdir(directory, function(err, files) {
if (err) {
return callback(err, null);
}
// If we already found a match there is no need to continue scanning.
if (found === true) {
return;
}
// We need to track the number of files to know when we return a result.
var pending = files.length;
// We first check files, so if there is a match we don't need further
// async calls and we just return a true.
for (var i = 0; i < files.length; i++) {
if (files[i] === 'yui') {
return callback(null, true);
}
}
// Iterate through subdirs if there were no matches.
files.forEach(function (file) {
var p = path.join(directory, file);
stat = fs.statSync(p);
if (!stat.isDirectory()) {
pending--;
} else {
// We defer the pending-1 until we scan the whole dir and subdirs.
hasYuiModules(p, function(err, result) {
if (err) {
return callback(err);
}
if (result === true) {
// Once we get a true we notify the caller.
found = true;
return callback(null, true);
}
pending--;
if (pending === 0) {
// Notify the caller that the whole dir has been scaned and there are no matches.
return callback(null, false);
}
});
}
// No subdirs here, otherwise the return would be deferred until all subdirs are scanned.
if (pending === 0) {
return callback(null, false);
}
});
});
};
hasYuiModules(cwd, function(err, result) {
if (err) {
grunt.fail.fatal(err.message);
}
if (result === true) {
execShifter();
} else {
grunt.log.ok('No YUI modules to build.');
done();
}
});
}
};
tasks.startup = function() {
@@ -126,13 +223,11 @@ module.exports = function(grunt) {
grunt.task.run('shifter');
// Are we in an AMD directory?
} else if (path.basename(cwd) == 'amd') {
grunt.task.run('jshint');
grunt.task.run('uglify');
grunt.task.run('amd');
} else {
// Run them all!.
grunt.task.run('shifter');
grunt.task.run('jshint');
grunt.task.run('uglify');
grunt.task.run('css');
grunt.task.run('js');
}
};
@@ -140,9 +235,15 @@ module.exports = function(grunt) {
// Register NPM tasks.
grunt.loadNpmTasks('grunt-contrib-uglify');
grunt.loadNpmTasks('grunt-contrib-jshint');
grunt.loadNpmTasks('grunt-contrib-less');
// Register the shifter task.
// Register JS tasks.
grunt.registerTask('shifter', 'Run Shifter against the current directory', tasks.shifter);
grunt.registerTask('amd', ['jshint', 'uglify']);
grunt.registerTask('js', ['amd', 'shifter']);
// Register CSS taks.
grunt.registerTask('css', ['less:bootstrapbase']);
// Register the startup task.
grunt.registerTask('startup', 'Run the correct tasks for the current directory', tasks.startup);
+4 -2
View File
@@ -64,6 +64,8 @@ echo "<form id=\"authmenu\" method=\"post\" action=\"auth_config.php\">\n";
echo "<div>\n";
echo "<input type=\"hidden\" name=\"sesskey\" value=\"".sesskey()."\" />\n";
echo "<input type=\"hidden\" name=\"auth\" value=\"".$auth."\" />\n";
// HACK to prevent browsers from automatically inserting the user's password into the wrong fields.
echo prevent_form_autofill_password();
// auth plugin description
echo $OUTPUT->box_start();
@@ -146,8 +148,8 @@ function print_auth_lock_options($auth, $user_fields, $helptext, $retrieveopts,
// If custom field then pick name from database.
$fieldshortname = str_replace('profile_field_', '', $fieldname);
$fieldname = $customfieldname[$fieldshortname]->name;
} elseif (preg_match('/^(.+?)(\d+)$/', $fieldname, $matches)) {
$fieldname = get_string($matches[1]) . ' ' . $matches[2];
} elseif ($fieldname == 'phone1') {
$fieldname = get_string('phone');
} elseif ($fieldname == 'url') {
$fieldname = get_string('webpage');
} else {
+2 -1
View File
@@ -155,7 +155,8 @@
} else if ($blocksettings instanceof admin_settingpage) {
$settings = '<a href="'.$CFG->wwwroot.'/'.$CFG->admin.'/settings.php?section=blocksetting'.$block->name.'">'.$strsettings.'</a>';
} else {
$settings = '<a href="block.php?block='.$blockid.'">'.$strsettings.'</a>';
debugging('Warning: block_'.$block->name.' returns true in has_config() but does not provide a settings.php file',
DEBUG_DEVELOPER);
}
}
+138
View File
@@ -1420,4 +1420,142 @@
</CUSTOM_CHECK>
</CUSTOM_CHECKS>
</MOODLE>
<MOODLE version="3.0" requires="2.2">
<UNICODE level="required">
<FEEDBACK>
<ON_ERROR message="unicoderequired" />
</FEEDBACK>
</UNICODE>
<DATABASE level="required">
<VENDOR name="mariadb" version="5.5.31" />
<VENDOR name="mysql" version="5.5.31" />
<VENDOR name="postgres" version="9.1" />
<VENDOR name="mssql" version="10.0" />
<VENDOR name="oracle" version="10.2" />
</DATABASE>
<PHP version="5.4.4" level="required">
</PHP>
<PCREUNICODE level="optional">
<FEEDBACK>
<ON_CHECK message="pcreunicodewarning" />
</FEEDBACK>
</PCREUNICODE>
<PHP_EXTENSIONS>
<PHP_EXTENSION name="iconv" level="required">
<FEEDBACK>
<ON_ERROR message="iconvrequired" />
</FEEDBACK>
</PHP_EXTENSION>
<PHP_EXTENSION name="mbstring" level="optional">
<FEEDBACK>
<ON_CHECK message="mbstringrecommended" />
</FEEDBACK>
</PHP_EXTENSION>
<PHP_EXTENSION name="curl" level="required">
<FEEDBACK>
<ON_ERROR message="curlrequired" />
</FEEDBACK>
</PHP_EXTENSION>
<PHP_EXTENSION name="openssl" level="optional">
<FEEDBACK>
<ON_CHECK message="opensslrecommended" />
</FEEDBACK>
</PHP_EXTENSION>
<PHP_EXTENSION name="tokenizer" level="optional">
<FEEDBACK>
<ON_CHECK message="tokenizerrecommended" />
</FEEDBACK>
</PHP_EXTENSION>
<PHP_EXTENSION name="xmlrpc" level="optional">
<FEEDBACK>
<ON_CHECK message="xmlrpcrecommended" />
</FEEDBACK>
</PHP_EXTENSION>
<PHP_EXTENSION name="soap" level="optional">
<FEEDBACK>
<ON_CHECK message="soaprecommended" />
</FEEDBACK>
</PHP_EXTENSION>
<PHP_EXTENSION name="ctype" level="required">
<FEEDBACK>
<ON_ERROR message="ctyperequired" />
</FEEDBACK>
</PHP_EXTENSION>
<PHP_EXTENSION name="zip" level="required">
<FEEDBACK>
<ON_ERROR message="ziprequired" />
</FEEDBACK>
</PHP_EXTENSION>
<PHP_EXTENSION name="zlib" level="required">
</PHP_EXTENSION>
<PHP_EXTENSION name="gd" level="required">
<FEEDBACK>
<ON_ERROR message="gdrequired" />
</FEEDBACK>
</PHP_EXTENSION>
<PHP_EXTENSION name="simplexml" level="required">
<FEEDBACK>
<ON_ERROR message="simplexmlrequired" />
</FEEDBACK>
</PHP_EXTENSION>
<PHP_EXTENSION name="spl" level="required">
<FEEDBACK>
<ON_ERROR message="splrequired" />
</FEEDBACK>
</PHP_EXTENSION>
<PHP_EXTENSION name="pcre" level="required">
</PHP_EXTENSION>
<PHP_EXTENSION name="dom" level="required">
</PHP_EXTENSION>
<PHP_EXTENSION name="xml" level="required">
</PHP_EXTENSION>
<PHP_EXTENSION name="intl" level="optional">
<FEEDBACK>
<ON_CHECK message="intlrecommended" />
</FEEDBACK>
</PHP_EXTENSION>
<PHP_EXTENSION name="json" level="required">
</PHP_EXTENSION>
<PHP_EXTENSION name="hash" level="required"/>
</PHP_EXTENSIONS>
<PHP_SETTINGS>
<PHP_SETTING name="memory_limit" value="96M" level="required">
<FEEDBACK>
<ON_ERROR message="settingmemorylimit" />
</FEEDBACK>
</PHP_SETTING>
<PHP_SETTING name="file_uploads" value="1" level="optional">
<FEEDBACK>
<ON_CHECK message="settingfileuploads" />
</FEEDBACK>
</PHP_SETTING>
<PHP_SETTING name="opcache.enable" value="1" level="optional">
<FEEDBACK>
<ON_CHECK message="opcacherecommended" />
</FEEDBACK>
</PHP_SETTING>
</PHP_SETTINGS>
<CUSTOM_CHECKS>
<CUSTOM_CHECK file="lib/upgradelib.php" function="check_database_storage_engine" level="required">
<FEEDBACK>
<ON_ERROR message="unsupporteddbstorageengine" />
</FEEDBACK>
</CUSTOM_CHECK>
<CUSTOM_CHECK file="question/engine/upgrade/upgradelib.php" function="quiz_attempts_upgraded" level="required">
<FEEDBACK>
<ON_ERROR message="quizattemptsupgradedmessage" />
</FEEDBACK>
</CUSTOM_CHECK>
<CUSTOM_CHECK file="lib/upgradelib.php" function="check_slasharguments" level="optional">
<FEEDBACK>
<ON_CHECK message="slashargumentswarning" />
</FEEDBACK>
</CUSTOM_CHECK>
<CUSTOM_CHECK file="lib/upgradelib.php" function="check_database_tables_row_format" level="optional">
<FEEDBACK>
<ON_CHECK message="unsupporteddbtablerowformat" />
</FEEDBACK>
</CUSTOM_CHECK>
</CUSTOM_CHECKS>
</MOODLE>
</COMPATIBILITY_MATRIX>
+2
View File
@@ -39,6 +39,8 @@ require_once($CFG->dirroot . '/' . $CFG->admin . '/registration/forms.php');
require_once($CFG->dirroot . '/webservice/lib.php');
require_once($CFG->dirroot . '/' . $CFG->admin . '/registration/lib.php');
require_sesskey();
$huburl = required_param('huburl', PARAM_URL);
$huburl = rtrim($huburl, "/");
+6 -2
View File
@@ -50,7 +50,8 @@ $table->set_attribute('class', 'admintable generaltable');
$table->setup();
$plugins = array();
foreach (core_component::get_plugin_list('report') as $plugin => $plugindir) {
$availableplugins = core_component::get_plugin_list('report');
foreach ($availableplugins as $plugin => $plugindir) {
if (get_string_manager()->string_exists('pluginname', 'report_' . $plugin)) {
$strpluginname = get_string('pluginname', 'report_' . $plugin);
} else {
@@ -80,7 +81,10 @@ foreach ($plugins as $plugin => $name) {
$uninstall = html_writer::link($uninstallurl, $struninstall);
}
$stores = $logmanager->get_supported_logstores('report_' . $plugin);
$stores = array();
if (isset($availableplugins[$plugin])) {
$stores = $logmanager->get_supported_logstores('report_' . $plugin);
}
if ($stores === false) {
$supportedstores = get_string('logstorenotrequired', 'admin');
} else if (!empty($stores)) {
+2 -1
View File
@@ -64,7 +64,8 @@ preferences,moodle|/user/preferences.php|preferences',
array('0' => new lang_string('default', 'calendar'),
'%I:%M %p' => new lang_string('timeformat_12', 'calendar'),
'%H:%M' => new lang_string('timeformat_24', 'calendar'))));
$temp->add(new admin_setting_configselect('calendar_startwday', new lang_string('configstartwday', 'admin'), new lang_string('helpstartofweek', 'admin'), 0,
$temp->add(new admin_setting_configselect('calendar_startwday', new lang_string('configstartwday', 'admin'),
new lang_string('helpstartofweek', 'admin'), get_string('firstdayofweek', 'langconfig'),
array(
0 => new lang_string('sunday', 'calendar'),
1 => new lang_string('monday', 'calendar'),
+2 -1
View File
@@ -35,7 +35,8 @@ if ($hassiteconfig) { // speedup for non-admins, add all caps used on this page
$params = new stdClass();
$params->bytes = $defaultuserquota;
$params->displaysize = display_size($defaultuserquota);
$temp->add(new admin_setting_configtext('userquota', new lang_string('userquota', 'admin'), new lang_string('configuserquota', 'admin', $params), $defaultuserquota));
$temp->add(new admin_setting_configtext('userquota', new lang_string('userquota', 'admin'),
new lang_string('configuserquota', 'admin', $params), $defaultuserquota, PARAM_INT, 30));
$temp->add(new admin_setting_configcheckbox('allowobjectembed', new lang_string('allowobjectembed', 'admin'), new lang_string('configallowobjectembed', 'admin'), 0));
$temp->add(new admin_setting_configcheckbox('enabletrusttext', new lang_string('enabletrusttext', 'admin'), new lang_string('configenabletrusttext', 'admin'), 0));
+1 -1
View File
@@ -11,7 +11,7 @@ $hassiteconfig = has_capability('moodle/site:config', $systemcontext);
$ADMIN->add('root', new admin_externalpage('adminnotifications', new lang_string('notifications'), "$CFG->wwwroot/$CFG->admin/index.php"));
$ADMIN->add('root', new admin_externalpage('registrationmoodleorg', new lang_string('registration', 'admin'),
"$CFG->wwwroot/$CFG->admin/registration/register.php?huburl=" . HUB_MOODLEORGHUBURL . "&hubname=Moodle.org"));
"$CFG->wwwroot/$CFG->admin/registration/register.php?huburl=" . HUB_MOODLEORGHUBURL . "&hubname=Moodle.org&sesskey=" . sesskey()));
$ADMIN->add('root', new admin_externalpage('registrationhub', new lang_string('registerwith', 'hub'),
"$CFG->wwwroot/$CFG->admin/registration/register.php", 'moodle/site:config', true));
$ADMIN->add('root', new admin_externalpage('registrationhubs', new lang_string('hubs', 'admin'),
@@ -1,54 +0,0 @@
@tool @tool_behat
Feature: Page contents assertions
In order to write good tests
As a tests writer
I need to check the page contents
@javascript
Scenario: Basic contents assertions
Given I log in as "admin"
And I am on site homepage
And I expand "Users" node
And I follow "Groups"
And I press "Create group"
And I set the following fields to these values:
| Group name | I'm the name |
| Group description | I'm the description |
And I press "Save changes"
When I follow "Overview"
And I wait until the page is ready
And I wait "2" seconds
And I hover "#region-main .generaltable td span" "css_element"
Then I should see "I'm the description"
And "Grouping" "select" in the "region-main" "region" should be visible
And "Group" "select" should be visible
And "Activity report" "link" in the "Administration" "block" should not be visible
And "Event monitoring rules" "link" should not be visible
And I should see "Filter groups by"
And I should not see "Filter groupssss by"
And I should see "Group members" in the "#region-main table th.c1" "css_element"
And I should not see "Group membersssss" in the "#region-main table th.c1" "css_element"
And I follow "Groups"
And the "#groupeditform #showcreateorphangroupform" "css_element" should be enabled
And the "#groupeditform #showeditgroupsettingsform" "css_element" should be disabled
@javascript
Scenario: Locators inside specific DOM nodes using CSS selectors
Given the following "courses" exist:
| fullname | shortname | category |
| Course 1 | C1 | 0 |
And I log in as "admin"
And I am on site homepage
And I follow "Course 1"
When I dock "Administration" block
Then I should not see "Question bank" in the ".block-region" "css_element"
And I click on "//div[@id='dock']/descendant::h2[normalize-space(.)='Administration']" "xpath_element"
@javascript
Scenario: Locators inside specific DOM nodes using XPath
Given the following "courses" exist:
| fullname | shortname | category |
| Course 1 | C1 | 0 |
And I log in as "admin"
When I dock "Administration" block
Then I should not see "Turn editing on" in the ".block-region" "css_element"
@@ -424,9 +424,9 @@ Feature: Set up contextual data for tests
And the following "grade categories" exist:
| fullname | course |
| Grade category 1 | C1 |
And the following "grade items" exist:
| itemname | course | outcome | gradecategory |
| Test Outcome Grade Item 1 | C1 | OT1 | Grade category 1 |
And the following "grade items" exist:
| itemname | course | outcome | gradecategory |
| Test Outcome Grade Item 1 | C1 | OT1 | Grade category 1 |
And the following config values are set as admin:
| enableoutcomes | 1 |
When I log in as "admin"
@@ -441,3 +441,15 @@ Feature: Set up contextual data for tests
And I expand all fieldsets
And "//div[contains(@class, 'fitem')]/div[contains(@class, 'fitemtitle')]/div[contains(@class, fstaticlabel) and contains(., 'Grade category')]/../../div[contains(@class, 'felement') and contains(., 'Grade category 1')]" "xpath_element" should exist
And I press "Cancel"
Scenario: Add a block
Given the following "courses" exist:
| fullname | shortname |
| Course 1 | C1 |
And the following "blocks" exist:
| blockname | contextlevel | reference | pagetypepattern | defaultregion |
| online_users | Course | C1 | course-view-* | site-pre |
When I log in as "admin"
And I am on site homepage
And I follow "Course 1"
Then I should see "Online users"
@@ -137,6 +137,17 @@ Feature: Verify that all form fields values can be get and set
And I press "Save my choice"
And the field "one" matches value "1"
And the field "two" matches value ""
# Check if field xpath set/match works.
And I am on site homepage
And I follow "Course 1"
And I navigate to "Edit settings" node in "Course administration"
And I set the field with xpath "//input[@id='id_idnumber']" to "Course id number"
And the field with xpath "//input[@name='idnumber']" matches value "Course id number"
And the field with xpath "//input[@name='idnumber']" does not match value ""
And I press "Save and display"
And I navigate to "Edit settings" node in "Course administration"
And the field "Course ID number" matches value "Course id number"
Scenario: with JS disabled all form fields getters and setters works as expected
@@ -253,7 +253,8 @@ class tool_generator_course_backend extends tool_generator_backend {
$courserecord = array(
'shortname' => $this->shortname,
'fullname' => $this->fullname,
'numsections' => self::$paramsections[$this->size]
'numsections' => self::$paramsections[$this->size],
'startdate' => usergetmidnight(time())
);
if (strlen($this->summary) > 0) {
$courserecord['summary'] = $this->summary;
@@ -102,6 +102,10 @@ class manager {
try {
$this->client->login();
mtrace("Connection established.");
// Ensure that mailboxes exist.
$this->ensure_mailboxes_exist();
return true;
} catch (\Horde_Imap_Client_Exception $e) {
@@ -741,6 +745,27 @@ class manager {
return in_array($flag, $flags);
}
/**
* Ensure that all mailboxes exist.
*/
private function ensure_mailboxes_exist() {
$requiredmailboxes = array(
self::MAILBOX,
self::CONFIRMATIONFOLDER,
);
$existingmailboxes = $this->client->listMailboxes($requiredmailboxes);
foreach ($requiredmailboxes as $mailbox) {
if (isset($existingmailboxes[$mailbox])) {
// This mailbox was found.
continue;
}
mtrace("Unable to find the '{$mailbox}' mailbox - creating it.");
$this->client->createMailbox($mailbox);
}
}
/**
* Attempt to determine whether this message is a bulk message (e.g. automated reply).
*
+5 -1
View File
@@ -78,8 +78,12 @@
echo $OUTPUT->header();
$fullname = fullname($user, true);
echo $OUTPUT->heading(get_string('deleteuser', 'admin'));
$optionsyes = array('delete'=>$delete, 'confirm'=>md5($delete), 'sesskey'=>sesskey());
echo $OUTPUT->confirm(get_string('deletecheckfull', '', "'$fullname'"), new moodle_url($returnurl, $optionsyes), $returnurl);
$deleteurl = new moodle_url($returnurl, $optionsyes);
$deletebutton = new single_button($deleteurl, get_string('delete'), 'post');
echo $OUTPUT->confirm(get_string('deletecheckfull', '', "'$fullname'"), $deletebutton, $returnurl);
echo $OUTPUT->footer();
die;
} else if (data_submitted() and !$user->deleted) {
+1 -1
View File
@@ -309,7 +309,7 @@ class auth_db_testcase extends advanced_testcase {
require_once($CFG->libdir.'/password_compat/lib/password.php');
set_config('passtype', 'saltedcrypt', 'auth/db');
$auth->config->passtype = 'saltedcrypt';
$user3->pass = password_hash('heslo', PASSWORD_BCRYPT, array('salt' => 'best_salt_ever_moodle_rocks_dont_tell'));
$user3->pass = password_hash('heslo', PASSWORD_BCRYPT);
$DB->update_record('auth_db_users', $user3);
$this->assertTrue($auth->user_login('u3', 'heslo'));
+2 -2
View File
@@ -47,7 +47,7 @@ $string['auth_ldap_expiration_desc'] = 'Select No to disable expired password ch
$string['auth_ldap_expiration_key'] = 'Expiration';
$string['auth_ldap_expiration_warning_desc'] = 'Number of days before password expiration warning is issued.';
$string['auth_ldap_expiration_warning_key'] = 'Expiration warning';
$string['auth_ldap_expireattr_desc'] = 'Optional: overrides ldap-attribute that stores password expiration time';
$string['auth_ldap_expireattr_desc'] = 'Optional: Overrides the LDAP attribute that stores password expiration time.';
$string['auth_ldap_expireattr_key'] = 'Expiration attribute';
$string['auth_ldapextrafields'] = 'These fields are optional. You can choose to pre-fill some Moodle user fields with information from the <b>LDAP fields</b> that you specify here. <p>If you leave these fields blank, then nothing will be transferred from LDAP and Moodle defaults will be used instead.</p><p>In either case, the user will be able to edit all of these fields after they log in.</p>';
$string['auth_ldap_graceattr_desc'] = 'Optional: Overrides gracelogin attribute';
@@ -71,7 +71,7 @@ $string['auth_ldap_noconnect_all'] = 'LDAP-module cannot connect to any servers:
$string['auth_ldap_noextension'] = '<em>The PHP LDAP module does not seem to be present. Please ensure it is installed and enabled if you want to use this authentication plugin.</em>';
$string['auth_ldap_no_mbstring'] = 'You need the mbstring extension to create users in Active Directory.';
$string['auth_ldapnotinstalled'] = 'Cannot use LDAP authentication. The PHP LDAP module is not installed.';
$string['auth_ldap_objectclass'] = 'Optional: Overrides objectClass used to name/search users on ldap_user_type. Usually you dont need to chage this.';
$string['auth_ldap_objectclass'] = 'Optional: Overrides objectClass used to name/search users on ldap_user_type. Usually you don\'t need to change this.';
$string['auth_ldap_objectclass_key'] = 'Object class';
$string['auth_ldap_opt_deref'] = 'Determines how aliases are handled during search. Select one of the following values: "No" (LDAP_DEREF_NEVER) or "Yes" (LDAP_DEREF_ALWAYS)';
$string['auth_ldap_opt_deref_key'] = 'Dereference aliases';
+1 -1
View File
@@ -60,7 +60,7 @@ if (!isset($config->changepasswordurl)) {
</tr>
<tr valign="top" >
<td align="right"><?php echo html_writer::label(get_string('auth_radiustype_key', 'auth_radius'), 'menuradiustype'); ?>: </td>
<td align="right"><?php echo html_writer::label(get_string('auth_radiustype_key', 'auth_radius') . ':', 'menuradiustype'); ?> </td>
<td>
<?php
+2 -1
View File
@@ -210,7 +210,8 @@ class auth_plugin_shibboleth extends auth_plugin_base {
}
// Overwrite redirect in order to send user to Shibboleth logout page and let him return back
$redirect = $this->config->logout_handler.'?return='.urlencode($temp_redirect);
$redirecturl = new moodle_url($this->config->logout_handler, array('return' => $temp_redirect));
$redirect = $redirecturl->out();
}
}
+16 -2
View File
@@ -328,7 +328,14 @@ class tree extends tree_node {
// Loop through all valid children.
foreach ($this->children as $index => $child) {
if (!$child->is_applied_to_user_lists()) {
continue;
if ($andoperator) {
continue;
} else {
// OR condition with one option that doesn't restrict user
// lists = everyone is allowed.
$anyconditions = false;
break;
}
}
$childresult = $child->filter_user_list($users, $innernot, $info, $checker);
if ($andoperator) {
@@ -359,7 +366,14 @@ class tree extends tree_node {
$childresults = array();
foreach ($this->children as $index => $child) {
if (!$child->is_applied_to_user_lists()) {
continue;
if ($andoperator) {
continue;
} else {
// OR condition with one option that doesn't restrict user
// lists = everyone is allowed.
$childresults = array();
break;
}
}
$childresult = $child->get_user_list_sql($innernot, $info, $onlyactive);
if ($childresult[0]) {
@@ -234,4 +234,68 @@ class condition extends \core_availability\condition {
}
return false;
}
/**
* Changes all date restrictions on a course by the specified shift amount.
* Used by the course reset feature.
*
* @param int $courseid Course id
* @param int $timeshift Offset in seconds
*/
public static function update_all_dates($courseid, $timeshift) {
global $DB;
$modinfo = get_fast_modinfo($courseid);
$anychanged = false;
// Adjust dates from all course modules.
foreach ($modinfo->cms as $cm) {
if (!$cm->availability) {
continue;
}
$info = new \core_availability\info_module($cm);
$tree = $info->get_availability_tree();
$dates = $tree->get_all_children('availability_date\condition');
$changed = false;
foreach ($dates as $date) {
$date->time += $timeshift;
$changed = true;
}
// Save the updated course module.
if ($changed) {
$DB->set_field('course_modules', 'availability', json_encode($tree->save()),
array('id' => $cm->id));
$anychanged = true;
}
}
// Adjust dates from all course sections.
foreach ($modinfo->get_section_info_all() as $section) {
if (!$section->availability) {
continue;
}
$info = new \core_availability\info_section($section);
$tree = $info->get_availability_tree();
$dates = $tree->get_all_children('availability_date\condition');
$changed = false;
foreach ($dates as $date) {
$date->time += $timeshift;
$changed = true;
}
// Save the updated course module.
if ($changed) {
$DB->set_field('course_sections', 'availability', json_encode($tree->save()),
array('id' => $section->id));
$anychanged = true;
}
}
// Ensure course cache is cleared if required.
if ($anychanged) {
rebuild_course_cache($courseid, true);
}
}
}
@@ -25,6 +25,7 @@
defined('MOODLE_INTERNAL') || die();
use availability_date\condition;
use core_availability\tree;
/**
* Unit tests for the date condition.
@@ -236,4 +237,53 @@ class availability_date_condition_testcase extends advanced_testcase {
$information = $date->get_standalone_description(true, true, $info);
$this->assertRegExp('~from.*5 March 2014([^0-9]*)$~', $information);
}
/**
* Tests the update_all_dates function.
*/
public function test_update_all_dates() {
global $DB;
$this->resetAfterTest();
// Create a course with 3 pages.
$generator = $this->getDataGenerator();
$course = $generator->create_course();
$rec = array('course' => $course);
$page1 = $generator->get_plugin_generator('mod_page')->create_instance($rec);
$page2 = $generator->get_plugin_generator('mod_page')->create_instance($rec);
$page3 = $generator->get_plugin_generator('mod_page')->create_instance($rec);
// Set the availability page 2 to a simple date condition. You can access
// it from 1337 onwards.
$simplecondition = tree::get_root_json(array(
condition::get_json(condition::DIRECTION_FROM, 1337)));
$DB->set_field('course_modules', 'availability',
json_encode($simplecondition), array('id' => $page2->cmid));
// Set page 3 to a complex set of conditions including a nested date condition.
// You can access it until 1459, *or* after 2810 if you belong to a group.
$complexcondition = tree::get_root_json(array(
condition::get_json(condition::DIRECTION_UNTIL, 1459),
tree::get_nested_json(array(
condition::get_json(condition::DIRECTION_FROM, 2810),
\availability_group\condition::get_json()))),
tree::OP_OR);
$DB->set_field('course_modules', 'availability',
json_encode($complexcondition), array('id' => $page3->cmid));
// Now use the update_all_dates function to move date forward 100000.
condition::update_all_dates($course->id, 100000);
// Get the expected conditions after adjusting time, and compare to database.
$simplecondition->c[0]->t = 101337;
$complexcondition->c[0]->t = 101459;
$complexcondition->c[1]->c[0]->t = 102810;
$this->assertEquals($simplecondition, json_decode(
$DB->get_field('course_modules', 'availability', array('id' => $page2->cmid))));
$this->assertEquals($complexcondition, json_decode(
$DB->get_field('course_modules', 'availability', array('id' => $page3->cmid))));
// The one without availability conditions should still be null.
$this->assertNull($DB->get_field('course_modules', 'availability', array('id' => $page1->cmid)));
}
}
@@ -246,7 +246,12 @@ class condition extends \core_availability\condition {
* @return stdClass Object representing condition
*/
public static function get_json($groupid = 0) {
return (object)array('type' => 'group', 'id' => (int)$groupid);
$result = (object)array('type' => 'group');
// Id is only included if set.
if ($groupid) {
$result->id = (int)$groupid;
}
return $result;
}
public function get_user_list_sql($not, \core_availability\info $info, $onlyactive) {
+5 -5
View File
@@ -35,7 +35,7 @@ use core_availability\info_section;
* @copyright 2014 The Open University
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
class info_testcase extends \advanced_testcase {
class info_testcase extends advanced_testcase {
public function setUp() {
// Load the mock condition so that it can be used.
require_once(__DIR__ . '/fixtures/mock_condition.php');
@@ -87,8 +87,8 @@ class info_testcase extends \advanced_testcase {
// Check invalid one.
$info = new info_module($cm3);
$this->assertFalse($info->is_available($information));
$debugging = phpunit_util::get_debugging_messages();
phpunit_util::reset_debugging();
$debugging = $this->getDebuggingMessages();
$this->resetDebugging();
$this->assertEquals(1, count($debugging));
$this->assertContains('Invalid availability', $debugging[0]->message);
@@ -141,8 +141,8 @@ class info_testcase extends \advanced_testcase {
// Check invalid one.
$info = new info_section($sections[3]);
$this->assertFalse($info->is_available($information));
$debugging = phpunit_util::get_debugging_messages();
phpunit_util::reset_debugging();
$debugging = $this->getDebuggingMessages();
$this->resetDebugging();
$this->assertEquals(1, count($debugging));
$this->assertContains('Invalid availability', $debugging[0]->message);
+19
View File
@@ -600,6 +600,15 @@ class tree_testcase extends \advanced_testcase {
ksort($result);
$this->assertEquals(array(1, 3), array_keys($result));
// Tree with OR condition one of which doesn't filter.
$structure = tree::get_root_json(array(
self::mock(array('filter' => array(3))),
self::mock(array())), tree::OP_OR);
$tree = new tree($structure);
$result = $tree->filter_user_list($users, false, $info, $checker);
ksort($result);
$this->assertEquals(array(1, 2, 3), array_keys($result));
// Tree with two condition that both filter (&).
$structure = tree::get_root_json(array(
self::mock(array('filter' => array(2, 3))),
@@ -718,6 +727,16 @@ class tree_testcase extends \advanced_testcase {
$result = $DB->get_fieldset_sql($sql, $params);
sort($result);
$this->assertEquals(array($userinneither->id), $result);
// Tree with 'OR' of group conditions and a non-filtering condition.
// The non-filtering condition should mean that ALL users are included.
$tree = new tree(tree::get_root_json(array(
\availability_group\condition::get_json($group1->id),
\availability_date\condition::get_json(\availability_date\condition::DIRECTION_UNTIL, 3)
), tree::OP_OR));
list($sql, $params) = $tree->get_user_list_sql(false, $info, false);
$this->assertEquals('', $sql);
$this->assertEquals(array(), $params);
}
/**
+12 -2
View File
@@ -27,8 +27,18 @@ class cc_assesment_question_truefalse extends cc_assesment_question_proc_base {
public function __construct($quiz, $questions, $manifest, $section, $question_node, $rootpath, $contextid, $outdir) {
parent::__construct($quiz, $questions, $manifest, $section, $question_node, $rootpath, $contextid, $outdir);
$this->qtype = cc_qti_profiletype::true_false;
$this->correct_answer_node_id = $this->questions->nodeValue(
'plugin_qtype_truefalse_question/truefalse/trueanswer', $this->question_node);
// Determine the correct answer by finding out which answer has the non zero fraction...
// This is because a true / false question type can have 'false' as the correct answer.
$answers = $this->questions->nodeList('plugin_qtype_truefalse_question/answers/answer', $this->question_node);
foreach ($answers as $answer) {
$fraction = $this->questions->nodeValue('fraction', $answer);
if ($fraction != 0) {
$this->correct_answer_node_id = (int)$this->questions->nodeValue('@id', $answer);
}
}
$maximum_quiz_grade = (int)$this->quiz->nodeValue('/activity/quiz/grade');
$this->total_grade_value = ($maximum_quiz_grade + 1).'.0000000';
}
+17 -14
View File
@@ -885,27 +885,30 @@ class cc_quiz extends entities {
$sheet_question_categories_question = cc2moodle::loadsheet(SHEET_COURSE_QUESTION_CATEGORIES_QUESTION_CATEGORY_QUESTION_TRUE_FALSE);
$max_score = 0;
$true_answer_id = 0;
$false_answer_id = 0;
$trueanswer = null;
$falseanswer = null;
if (!empty($question['answers'])) {
// Identify the true and false answers.
foreach ($question['answers'] as $answer) {
if ($answer['score'] > $max_score) {
$max_score = $answer['score'];
$true_answer_id = $answer['id'];
if ($answer['identifier'] == 'true') {
$trueanswer = $answer;
} else if ($answer['identifier'] == 'false') {
$falseanswer = $answer;
} else {
// Should not happen, but just in case.
throw new coding_exception("Unknown answer identifier detected" .
" in true/false quiz question with id {$question['id']}.");
}
$node_course_question_categories_question_answer .= $this->create_node_course_question_categories_question_category_question_answer($answer);
}
foreach ($question['answers'] as $answer) {
if ($answer['id'] != $true_answer_id) {
$max_score = $answer['score'];
$false_answer_id = $answer['id'];
}
// Make sure the true and false answer was found.
if (is_null($trueanswer) || is_null($falseanswer)) {
throw new coding_exception("Unable to correctly identify the " .
"true and false answers in the question with id {$question['id']}.");
}
}
@@ -914,8 +917,8 @@ class cc_quiz extends entities {
'[#false_answer_id#]');
$replace_values = array($node_course_question_categories_question_answer,
$true_answer_id,
$false_answer_id);
$trueanswer['id'],
$falseanswer['id']);
$node_question_categories_question = str_replace($find_tags, $replace_values, $sheet_question_categories_question);
+17 -14
View File
@@ -908,27 +908,30 @@ class cc11_quiz extends entities11 {
$sheet_question_categories_question = cc112moodle::loadsheet(SHEET_COURSE_QUESTION_CATEGORIES_QUESTION_CATEGORY_QUESTION_TRUE_FALSE);
$max_score = 0;
$true_answer_id = 0;
$false_answer_id = 0;
$trueanswer = null;
$falseanswer = null;
if (!empty($question['answers'])) {
// Identify the true and false answers.
foreach ($question['answers'] as $answer) {
if ($answer['score'] > $max_score) {
$max_score = $answer['score'];
$true_answer_id = $answer['id'];
if ($answer['identifier'] == 'true') {
$trueanswer = $answer;
} else if ($answer['identifier'] == 'false') {
$falseanswer = $answer;
} else {
// Should not happen, but just in case.
throw new coding_exception("Unknown answer identifier detected " .
"in true/false quiz question with id {$question['id']}.");
}
$node_course_question_categories_question_answer .= $this->create_node_course_question_categories_question_category_question_answer($answer);
}
foreach ($question['answers'] as $answer) {
if ($answer['id'] != $true_answer_id) {
$max_score = $answer['score'];
$false_answer_id = $answer['id'];
}
// Make sure the true and false answer was found.
if (is_null($trueanswer) || is_null($falseanswer)) {
throw new coding_exception("Unable to correctly identify the " .
"true and false answers in the question with id {$question['id']}.");
}
}
@@ -937,8 +940,8 @@ class cc11_quiz extends entities11 {
'[#false_answer_id#]');
$replace_values = array($node_course_question_categories_question_answer,
$true_answer_id,
$false_answer_id);
$trueanswer['id'],
$falseanswer['id']);
$node_question_categories_question = str_replace($find_tags, $replace_values, $sheet_question_categories_question);
+33 -7
View File
@@ -169,13 +169,39 @@ abstract class restore_check {
}
}
// Ensure the user has the rolldates capability. If not we want to lock this
// settings so that they cannot change it.
$hasrolldatescap = has_capability('moodle/restore:rolldates', $coursectx, $userid);
if ($type == backup::TYPE_1COURSE && !$hasrolldatescap) {
$datesetting = $restore_controller->get_plan()->get_setting('course_startdate');
if ($datesetting) {
$datesetting->set_status(base_setting::LOCKED_BY_PERMISSION);
if ($type == backup::TYPE_1COURSE) {
// Ensure the user has the rolldates capability. If not we want to lock this
// settings so that they cannot change it.
$hasrolldatescap = has_capability('moodle/restore:rolldates', $coursectx, $userid);
if (!$hasrolldatescap) {
$datesetting = $restore_controller->get_plan()->get_setting('course_startdate');
if ($datesetting) {
$datesetting->set_status(base_setting::LOCKED_BY_PERMISSION);
}
}
// Ensure the user has the changefullname capability. If not we want to lock
// the setting so that they cannot change it.
$haschangefullnamecap = has_capability('moodle/course:changefullname', $coursectx, $userid);
if (!$haschangefullnamecap) {
$fullnamesetting = $restore_controller->get_plan()->get_setting('course_fullname');
$fullnamesetting->set_status(base_setting::LOCKED_BY_PERMISSION);
}
// Ensure the user has the changeshortname capability. If not we want to lock
// the setting so that they cannot change it.
$haschangeshortnamecap = has_capability('moodle/course:changeshortname', $coursectx, $userid);
if (!$haschangeshortnamecap) {
$shortnamesetting = $restore_controller->get_plan()->get_setting('course_shortname');
$shortnamesetting->set_status(base_setting::LOCKED_BY_PERMISSION);
}
// Ensure the user has the update capability. If not we want to lock
// the overwrite setting so that they cannot change it.
$hasupdatecap = has_capability('moodle/course:update', $coursectx, $userid);
if (!$hasupdatecap) {
$overwritesetting = $restore_controller->get_plan()->get_setting('overwrite_conf');
$overwritesetting->set_status(base_setting::LOCKED_BY_PERMISSION);
}
}
@@ -97,7 +97,10 @@ class restore_log_rule implements processable {
return $this->module . '-' . $this->action;
}
public function process($log) {
public function process($inputlog) {
// There might be multiple rules that process this log, we can't alter it in the process of checking it.
$log = clone($inputlog);
// Reset the allpairs array
$this->allpairs = array();
@@ -89,11 +89,12 @@ class restore_logs_processor {
}
// Arrived here log is empty, no rule was able to perform the conversion, log the problem
if (empty($newlog)) {
self::$task->log('Log module-action "' . $keyname . '" process problem. Not restored', backup::LOG_DEBUG);
self::$task->log('Log module-action "' . $keyname . '" process problem. Not restored. ' .
json_encode($log), backup::LOG_DEBUG);
}
} else { // Action not found log the problem
self::$task->log('Log module-action "' . $keyname . '" unknown. Not restored', backup::LOG_DEBUG);
self::$task->log('Log module-action "' . $keyname . '" unknown. Not restored. '.json_encode($log), backup::LOG_DEBUG);
$newlog = false;
}
@@ -0,0 +1,52 @@
<?php
// This file is part of Moodle - http://moodle.org/
//
// Moodle is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// Moodle is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
/**
* @package core_backup
* @category test
* @copyright 2015 onwards Eloy Lafuente (stronk7) {@link http://stronk7.com}
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
defined('MOODLE_INTERNAL') || die();
// Include all the needed stuff
global $CFG;
require_once($CFG->dirroot . '/backup/util/includes/restore_includes.php');
class backup_restore_log_rule_testcase extends basic_testcase {
function test_process_keeps_log_unmodified() {
// Prepare a tiny log entry.
$originallog = new stdClass();
$originallog->url = 'original';
$originallog->info = 'original';
$log = clone($originallog);
// Process it with a tiny log rule, only modifying url and info.
$lr = new restore_log_rule('test', 'test', 'changed', 'changed');
$result = $lr->process($log);
// The log has been processed.
$this->assertEquals('changed', $result->url);
$this->assertEquals('changed', $result->info);
// But the original log has been kept unmodified by the process() call.
$this->assertEquals($originallog, $log);
}
}
+3 -3
View File
@@ -45,7 +45,7 @@ class edit_backpack_form extends moodleform {
$mform->addElement('html', html_writer::tag('span', '', array('class' => 'notconnected', 'id' => 'connection-error')));
$mform->addElement('header', 'backpackheader', get_string('backpackconnection', 'badges'));
$mform->addHelpButton('backpackheader', 'backpackconnection', 'badges');
$mform->addElement('static', 'url', get_string('url'), 'http://' . BADGE_BACKPACKURL);
$mform->addElement('static', 'url', get_string('url'), BADGE_BACKPACKURL);
$status = html_writer::tag('span', get_string('notconnected', 'badges'),
array('class' => 'notconnected', 'id' => 'connection-status'));
$mform->addElement('static', 'status', get_string('status'), $status);
@@ -67,7 +67,7 @@ class edit_backpack_form extends moodleform {
$mform->addElement('hidden', 'userid', $USER->id);
$mform->setType('userid', PARAM_INT);
$mform->addElement('hidden', 'backpackurl', 'http://' . BADGE_BACKPACKURL);
$mform->addElement('hidden', 'backpackurl', BADGE_BACKPACKURL);
$mform->setType('backpackurl', PARAM_URL);
}
@@ -118,7 +118,7 @@ class edit_collections_form extends moodleform {
$mform->addElement('header', 'backpackheader', get_string('backpackconnection', 'badges'));
$mform->addHelpButton('backpackheader', 'backpackconnection', 'badges');
$mform->addElement('static', 'url', get_string('url'), 'http://' . BADGE_BACKPACKURL);
$mform->addElement('static', 'url', get_string('url'), BADGE_BACKPACKURL);
$status = html_writer::tag('span', get_string('connected', 'badges'), array('class' => 'connected'));
$mform->addElement('static', 'status', get_string('status'), $status);
+2 -2
View File
@@ -87,7 +87,7 @@ if (!isset($data->status) || $data->status != 'okay') {
// Make sure email matches a backpack.
$check = new stdClass();
$check->backpackurl = 'http://' . BADGE_BACKPACKURL;
$check->backpackurl = BADGE_BACKPACKURL;
$check->email = $data->email;
$bp = new OpenBadgesBackpackHandler($check);
@@ -106,7 +106,7 @@ if (isset($request->status) && $request->status == 'missing') {
$obj = new stdClass();
$obj->userid = $USER->id;
$obj->email = $data->email;
$obj->backpackurl = 'http://' . BADGE_BACKPACKURL;
$obj->backpackurl = BADGE_BACKPACKURL;
$obj->backpackuid = $backpackuid;
$obj->autosync = 0;
$obj->password = '';
+26 -31
View File
@@ -170,33 +170,31 @@ class award_criteria_profile extends award_criteria {
}
$join = '';
$where = '';
$whereparts = array();
$sqlparams = array();
$rule = ($this->method == BADGE_CRITERIA_AGGREGATION_ANY) ? ' OR ' : ' AND ';
foreach ($this->params as $param) {
if (is_numeric($param['field'])) {
$infodata[] = " uid.fieldid = :fieldid{$param['field']} ";
$sqlparams["fieldid{$param['field']}"] = $param['field'];
// This is a custom field.
$idx = count($whereparts) + 1;
$join .= " LEFT JOIN {user_info_data} uid{$idx} ON uid{$idx}.userid = u.id AND uid{$idx}.fieldid = :fieldid{$idx} ";
$sqlparams["fieldid{$idx}"] = $param['field'];
$whereparts[] = "uid{$idx}.id IS NOT NULL";
} else {
$userdata[] = $DB->sql_isnotempty('u', "u.{$param['field']}", false, true);
// This is a field from {user} table.
$whereparts[] = $DB->sql_isnotempty('u', "u.{$param['field']}", false, true);
}
}
// Add user custom field parameters if there are any.
if (!empty($infodata)) {
$extraon = implode($rule, $infodata);
$join = " LEFT JOIN {user_info_data} uid ON uid.userid = u.id AND ({$extraon})";
}
// Add user table field parameters if there are any.
if (!empty($userdata)) {
$extraon = implode($rule, $userdata);
$where = " AND ({$extraon})";
}
$sqlparams['userid'] = $userid;
$sql = "SELECT u.* FROM {user} u " . $join . " WHERE u.id = :userid " . $where;
if ($whereparts) {
$where = " AND (" . implode($rule, $whereparts) . ")";
} else {
$where = '';
}
$sql = "SELECT 1 FROM {user} u " . $join . " WHERE u.id = :userid $where";
$overall = $DB->record_exists_sql($sql, $sqlparams);
return $overall;
@@ -212,29 +210,26 @@ class award_criteria_profile extends award_criteria {
global $DB;
$join = '';
$where = '';
$whereparts = array();
$params = array();
$rule = ($this->method == BADGE_CRITERIA_AGGREGATION_ANY) ? ' OR ' : ' AND ';
foreach ($this->params as $param) {
if (is_numeric($param['field'])) {
$infodata[] = " uid.fieldid = :fieldid{$param['field']} ";
$params["fieldid{$param['field']}"] = $param['field'];
// This is a custom field.
$idx = count($whereparts);
$join .= " LEFT JOIN {user_info_data} uid{$idx} ON uid{$idx}.userid = u.id AND uid{$idx}.fieldid = :fieldid{$idx} ";
$params["fieldid{$idx}"] = $param['field'];
$whereparts[] = "uid{$idx}.id IS NOT NULL";
} else {
$userdata[] = $DB->sql_isnotempty('u', "u.{$param['field']}", false, true);
$whereparts[] = $DB->sql_isnotempty('u', "u.{$param['field']}", false, true);
}
}
// Add user custom fields if there are any.
if (!empty($infodata)) {
$extraon = implode($rule, $infodata);
$join = " LEFT JOIN {user_info_data} uid ON uid.userid = u.id AND ({$extraon})";
}
// Add user table fields if there are any.
if (!empty($userdata)) {
$extraon = implode($rule, $userdata);
$where = " AND ({$extraon})";
if ($whereparts) {
$where = " AND (" . implode($rule, $whereparts) . ")";
} else {
$where = '';
}
return array($join, $where, $params);
}
+3 -1
View File
@@ -61,6 +61,8 @@ $PAGE->set_heading($badge->name);
$PAGE->set_title($badge->name);
$PAGE->navbar->add($badge->name);
require_capability('moodle/badges:viewbadges', $context);
echo $OUTPUT->header();
echo $OUTPUT->heading(print_badge_image($badge, $context, 'small') . ' ' . $badge->name);
@@ -75,4 +77,4 @@ echo $output->print_badge_status_box($badge);
$output->print_badge_tabs($badgeid, $context, 'overview');
echo $output->print_badge_overview($badge, $context);
echo $OUTPUT->footer();
echo $OUTPUT->footer();
+93 -2
View File
@@ -28,6 +28,7 @@ defined('MOODLE_INTERNAL') || die();
global $CFG;
require_once($CFG->libdir . '/badgeslib.php');
require_once($CFG->dirroot . '/badges/lib.php');
class core_badges_badgeslib_testcase extends advanced_testcase {
protected $badgeid;
@@ -344,6 +345,11 @@ class core_badges_badgeslib_testcase extends advanced_testcase {
$criteria_overall = award_criteria::build(array('criteriatype' => BADGE_CRITERIA_TYPE_ACTIVITY, 'badgeid' => $badge->id));
$criteria_overall->save(array('agg' => BADGE_CRITERIA_AGGREGATION_ANY, 'module_'.$this->module->cmid => $this->module->cmid));
// Assert the badge will not be issued to the user as is.
$badge = new badge($this->coursebadge);
$badge->review_all_criteria();
$this->assertFalse($badge->is_issued($this->user->id));
// Set completion for forum activity.
$c = new completion_info($this->course);
$activities = $c->get_activities();
@@ -379,6 +385,11 @@ class core_badges_badgeslib_testcase extends advanced_testcase {
$ccompletion = new completion_completion(array('course' => $this->course->id, 'userid' => $this->user->id));
// Assert the badge will not be issued to the user as is.
$badge = new badge($this->coursebadge);
$badge->review_all_criteria();
$this->assertFalse($badge->is_issued($this->user->id));
// Mark course as complete.
$sink = $this->redirectEmails();
$ccompletion->mark_complete();
@@ -394,18 +405,33 @@ class core_badges_badgeslib_testcase extends advanced_testcase {
* Test badges observer when user_updated event is fired.
*/
public function test_badges_observer_profile_criteria_review() {
global $CFG, $DB;
require_once($CFG->dirroot.'/user/profile/lib.php');
// Add a custom field of textarea type.
$customprofileid = $DB->insert_record('user_info_field', array(
'shortname' => 'newfield', 'name' => 'Description of new field', 'categoryid' => 1,
'datatype' => 'textarea'));
$this->preventResetByRollback(); // Messaging is not compatible with transactions.
$badge = new badge($this->coursebadge);
$this->assertFalse($badge->is_issued($this->user->id));
$criteria_overall = award_criteria::build(array('criteriatype' => BADGE_CRITERIA_TYPE_OVERALL, 'badgeid' => $badge->id));
$criteria_overall->save(array('agg' => BADGE_CRITERIA_AGGREGATION_ANY));
$criteria_overall1 = award_criteria::build(array('criteriatype' => BADGE_CRITERIA_TYPE_PROFILE, 'badgeid' => $badge->id));
$criteria_overall1->save(array('agg' => BADGE_CRITERIA_AGGREGATION_ALL, 'field_address' => 'address', 'field_aim' => 'aim'));
$criteria_overall1->save(array('agg' => BADGE_CRITERIA_AGGREGATION_ALL, 'field_address' => 'address', 'field_aim' => 'aim',
'field_' . $customprofileid => $customprofileid));
// Assert the badge will not be issued to the user as is.
$badge = new badge($this->coursebadge);
$badge->review_all_criteria();
$this->assertFalse($badge->is_issued($this->user->id));
// Set the required fields and make sure the badge got issued.
$this->user->address = 'Test address';
$this->user->aim = '999999999';
$sink = $this->redirectEmails();
profile_save_data((object)array('id' => $this->user->id, 'profile_field_newfield' => 'X'));
user_update_user($this->user, false);
$this->assertCount(1, $sink->get_messages());
$sink->close();
@@ -447,4 +473,69 @@ class core_badges_badgeslib_testcase extends advanced_testcase {
$this->assertStringMatchesFormat($testassertion->class, json_encode($assertion->get_badge_class()));
$this->assertStringMatchesFormat($testassertion->issuer, json_encode($assertion->get_issuer()));
}
/**
* Tests the core_badges_myprofile_navigation() function.
*/
public function test_core_badges_myprofile_navigation() {
// Set up the test.
$tree = new \core_user\output\myprofile\tree();
$this->setAdminUser();
$badge = new badge($this->badgeid);
$badge->issue($this->user->id, true);
$iscurrentuser = true;
$course = null;
// Enable badges.
set_config('enablebadges', true);
// Check the node tree is correct.
core_badges_myprofile_navigation($tree, $this->user, $iscurrentuser, $course);
$reflector = new ReflectionObject($tree);
$nodes = $reflector->getProperty('nodes');
$nodes->setAccessible(true);
$this->assertArrayHasKey('localbadges', $nodes->getValue($tree));
}
/**
* Tests the core_badges_myprofile_navigation() function with badges disabled..
*/
public function test_core_badges_myprofile_navigation_badges_disabled() {
// Set up the test.
$tree = new \core_user\output\myprofile\tree();
$this->setAdminUser();
$badge = new badge($this->badgeid);
$badge->issue($this->user->id, true);
$iscurrentuser = false;
$course = null;
// Disable badges.
set_config('enablebadges', false);
// Check the node tree is correct.
core_badges_myprofile_navigation($tree, $this->user, $iscurrentuser, $course);
$reflector = new ReflectionObject($tree);
$nodes = $reflector->getProperty('nodes');
$nodes->setAccessible(true);
$this->assertArrayNotHasKey('localbadges', $nodes->getValue($tree));
}
/**
* Tests the core_badges_myprofile_navigation() function with a course badge.
*/
public function test_core_badges_myprofile_navigation_with_course_badge() {
// Set up the test.
$tree = new \core_user\output\myprofile\tree();
$this->setAdminUser();
$badge = new badge($this->coursebadge);
$badge->issue($this->user->id, true);
$iscurrentuser = false;
// Check the node tree is correct.
core_badges_myprofile_navigation($tree, $this->user, $iscurrentuser, $this->course);
$reflector = new ReflectionObject($tree);
$nodes = $reflector->getProperty('nodes');
$nodes->setAccessible(true);
$this->assertArrayHasKey('localbadges', $nodes->getValue($tree));
}
}
+2
View File
@@ -75,6 +75,8 @@ if ($type == BADGE_TYPE_SITE) {
$PAGE->set_heading($coursename);
}
require_capability('moodle/badges:viewbadges', $PAGE->context);
$PAGE->set_title($title);
$output = $PAGE->get_renderer('core', 'badges');
@@ -92,7 +92,7 @@ class block_activity_results extends block_base {
return $result;
}
// See if it is a gradable activity.
if (($rec->gradetype != GRADE_TYPE_VALUE) || ($rec->gradetype != GRADE_TYPE_SCALE)) {
if (($rec->gradetype != GRADE_TYPE_VALUE) && ($rec->gradetype != GRADE_TYPE_SCALE)) {
return $result;
}
return $rec;
+8 -3
View File
@@ -1,6 +1,11 @@
.block_activity_results {text-align: center;}
.block_activity_results h1 {margin: 4px;font-size: 1.1em;}
.block_activity_results table.grades {text-align: left;width: 100%;}
.block_activity_results table.grades .number{text-align: right;width:10%;}
.block_activity_results table.grades {text-align: left; width: 100%;}
.block_activity_results table.grades .number{text-align: left; width:10%;}
.block_activity_results table.grades .name{text-align: left; width:77%;}
.block_activity_results table.grades .grade {text-align: right;}
.block_activity_results table.grades caption {margin: 1em 0px 0px 0px;border-bottom-width: 1px;border-bottom-style: solid;font-weight: bold;}
.block_activity_results table.grades caption {font-weight: bold; font-size: 18px;}
.dir-rtl .block_activity_results table.grades {text-align: right;}
.dir-rtl .block_activity_results table.grades .number{text-align: right;}
.dir-rtl .block_activity_results table.grades .name{text-align: right;}
@@ -28,31 +28,44 @@ Feature: The activity results block displays student scores
And I follow "Course 1"
And I turn editing mode on
And I add a "Assignment" to section "1" and I fill the form with:
| Assignment name | Test assignment |
| Assignment name | Test assignment 1 |
| Description | Offline text |
| assignsubmission_file_enabled | 0 |
And I follow "Course 1"
And I add a "Assignment" to section "1" and I fill the form with:
| Assignment name | Test assignment 2 |
| Description | Offline text |
| assignsubmission_file_enabled | 0 |
And I follow "Course 1"
And I add a "Assignment" to section "1" and I fill the form with:
| Assignment name | Test assignment 3 |
| Description | Offline text |
| assignsubmission_file_enabled | 0 |
And I follow "Course 1"
And I add a "Page" to section "1"
And I set the following fields to these values:
| Name | Test page name |
| Description | Test page description |
| Page content | This is a page |
And I press "Save and return to course"
And I follow "Course 1"
And I should see "Test page name"
And I navigate to "Grades" node in "Course administration"
And I turn editing mode on
And I give the grade "90.00" to the user "Student 1" for the grade item "Test assignment"
And I give the grade "80.00" to the user "Student 2" for the grade item "Test assignment"
And I give the grade "70.00" to the user "Student 3" for the grade item "Test assignment"
And I give the grade "60.00" to the user "Student 4" for the grade item "Test assignment"
And I give the grade "50.00" to the user "Student 5" for the grade item "Test assignment"
And I give the grade "90.00" to the user "Student 1" for the grade item "Test assignment 1"
And I give the grade "80.00" to the user "Student 2" for the grade item "Test assignment 1"
And I give the grade "70.00" to the user "Student 3" for the grade item "Test assignment 1"
And I give the grade "60.00" to the user "Student 4" for the grade item "Test assignment 1"
And I give the grade "50.00" to the user "Student 5" for the grade item "Test assignment 1"
And I press "Save changes"
And I follow "Course 1"
Scenario: Configure the block on a non-graded activity to show 3 high scores
Given I add a "Page" to section "1"
Given I follow "Test page name"
And I add the "Activity results" block
When I configure the "Activity results" block
And I set the following fields to these values:
| Name | Test page name |
| Description | Test page description |
| page | This is a page |
And I press "Save and display"
When I add the "Activity results" block
And I configure the "Activity results" block
And I set the following fields to these values:
| id_config_activitygradeitemid | Test assignment |
| id_config_activitygradeitemid | Test assignment 1 |
| id_config_showbest | 3 |
| id_config_showworst | 0 |
| id_config_gradeformat | Absolute numbers |
@@ -63,4 +76,25 @@ Scenario: Configure the block on a non-graded activity to show 3 high scores
And I should see "Student 2" in the "Activity results" "block"
And I should see "80.00" in the "Activity results" "block"
And I should see "Student 3" in the "Activity results" "block"
And I should see "70.00" in the "Activity results" "block"
And I should see "70.00" in the "Activity results" "block"
Scenario: Block should select current activity by default
Given I follow "Test assignment 1"
When I add the "Activity results" block
And I configure the "Activity results" block
Then the field "id_config_activitygradeitemid" matches value "Test assignment 1"
And I follow "Course 1"
And I follow "Test assignment 2"
And I add the "Activity results" block
And I configure the "Activity results" block
And the field "id_config_activitygradeitemid" matches value "Test assignment 2"
And I follow "Course 1"
And I follow "Test assignment 3"
And I add the "Activity results" block
And I configure the "Activity results" block
And the field "id_config_activitygradeitemid" matches value "Test assignment 3"
And I follow "Course 1"
And I follow "Test page name"
And I add the "Activity results" block
And I configure the "Activity results" block
And the field "id_config_activitygradeitemid" does not match value "Test page name"
@@ -0,0 +1,111 @@
@block @block_activity_results
Feature: The activity results block displays student scores as scales
In order to be display student scores as scales
As a user
I need to see the activity results block
Background:
Given the following "users" exist:
| username | firstname | lastname | email | idnumber |
| teacher1 | Teacher | 1 | teacher1@example.com | T1 |
| student1 | Student | 1 | student1@example.com | S1 |
| student2 | Student | 2 | student2@example.com | S2 |
| student3 | Student | 3 | student3@example.com | S3 |
| student4 | Student | 4 | student4@example.com | S4 |
| student5 | Student | 5 | student5@example.com | S5 |
And the following "courses" exist:
| fullname | shortname | category |
| Course 1 | C1 | 0 |
And the following "course enrolments" exist:
| user | course | role |
| teacher1 | C1 | editingteacher |
| student1 | C1 | student |
| student2 | C1 | student |
| student3 | C1 | student |
| student4 | C1 | student |
| student5 | C1 | student |
And I log in as "teacher1"
And I follow "Course 1"
And I navigate to "Grades" node in "Course administration"
And I navigate to "Scales" node in "Grade administration"
And I press "Add a new scale"
And I set the following fields to these values:
| Name | My Scale |
| Scale | Disappointing, Not good enough, Average, Good, Very good, Excellent! |
And I press "Save changes"
And I follow "Course 1"
And I turn editing mode on
And I add a "Assignment" to section "1" and I fill the form with:
| Assignment name | Test assignment |
| Description | Offline text |
| assignsubmission_file_enabled | 0 |
| id_modgrade_type | Scale |
| id_modgrade_scale | My Scale |
And I follow "Course 1"
And I navigate to "Grades" node in "Course administration"
And I turn editing mode on
And I give the grade "Excellent!" to the user "Student 1" for the grade item "Test assignment"
And I give the grade "Very good" to the user "Student 2" for the grade item "Test assignment"
And I give the grade "Good" to the user "Student 3" for the grade item "Test assignment"
And I give the grade "Average" to the user "Student 4" for the grade item "Test assignment"
And I give the grade "Not good enough" to the user "Student 5" for the grade item "Test assignment"
And I press "Save changes"
And I follow "Course 1"
Scenario: Configure the block on the course page to show 1 high score
Given I add the "Activity results" block
When I configure the "Activity results" block
And I set the following fields to these values:
| id_config_showbest | 1 |
| id_config_showworst | 0 |
| id_config_nameformat | Display full names |
| id_config_decimalpoints | 0 |
And I press "Save changes"
Then I should see "Student 1" in the "Activity results" "block"
And I should see "Excellent!" in the "Activity results" "block"
Scenario: Try to configure the block on the course page to show multiple high scores using full names
Given I add the "Activity results" block
When I configure the "Activity results" block
And I set the following fields to these values:
| id_config_showbest | 3 |
| id_config_showworst | 0 |
| id_config_nameformat | Display full names |
And I press "Save changes"
Then I should see "Student 1" in the "Activity results" "block"
And I should see "Excellent!" in the "Activity results" "block"
And I should see "Student 2" in the "Activity results" "block"
And I should see "Very good" in the "Activity results" "block"
And I should see "Student 3" in the "Activity results" "block"
And I should see "Good" in the "Activity results" "block"
Scenario: Try to configure the block on the course page to show multiple high scores using ID numbers
Given I add the "Activity results" block
When I configure the "Activity results" block
And I set the following fields to these values:
| id_config_showbest | 3 |
| id_config_showworst | 0 |
| id_config_nameformat | Display only ID numbers |
And I press "Save changes"
Then I should see "User S1" in the "Activity results" "block"
And I should see "Excellent!" in the "Activity results" "block"
And I should see "User S2" in the "Activity results" "block"
And I should see "Very good" in the "Activity results" "block"
And I should see "User S3" in the "Activity results" "block"
And I should see "Good" in the "Activity results" "block"
Scenario: Try to configure the block on the course page to show multiple high scores using anonymous names
Given I add the "Activity results" block
When I configure the "Activity results" block
And I set the following fields to these values:
| id_config_showbest | 3 |
| id_config_showworst | 0 |
| id_config_nameformat | Anonymous results |
And I press "Save changes"
Then I should see "User" in the "Activity results" "block"
And I should not see "Student 1" in the "Activity results" "block"
And I should see "Excellent!" in the "Activity results" "block"
And I should not see "Student 2" in the "Activity results" "block"
And I should see "Very good" in the "Activity results" "block"
And I should not see "Student 3" in the "Activity results" "block"
And I should see "Good" in the "Activity results" "block"
@@ -0,0 +1,153 @@
@block @block_activity_results
Feature: The activity results block displays student scores as scales
In order to be display student scores as scales
As a user
I need to see the activity results block
Background:
Given the following "users" exist:
| username | firstname | lastname | email | idnumber |
| teacher1 | Teacher | 1 | teacher1@example.com | T1 |
| student1 | Student | 1 | student1@example.com | S1 |
| student2 | Student | 2 | student2@example.com | S2 |
| student3 | Student | 3 | student3@example.com | S3 |
| student4 | Student | 4 | student4@example.com | S4 |
| student5 | Student | 5 | student5@example.com | S5 |
| student6 | Student | 6 | student6@example.com | S6 |
And the following "courses" exist:
| fullname | shortname | category |
| Course 1 | C1 | 0 |
And the following "groups" exist:
| name | course | idnumber |
| Group 1 | C1 | G1 |
| Group 2 | C1 | G2 |
| Group 3 | C1 | G3 |
| Group 4 | C1 | G4 |
| Group 5 | C1 | G5 |
And the following "course enrolments" exist:
| user | course | role |
| teacher1 | C1 | editingteacher |
| student1 | C1 | student |
| student2 | C1 | student |
| student3 | C1 | student |
| student4 | C1 | student |
| student5 | C1 | student |
| student6 | C1 | student |
And the following "group members" exist:
| user | group |
| student1 | G1 |
| student2 | G1 |
| student3 | G2 |
| student4 | G2 |
| student5 | G3 |
| student6 | G3 |
And I log in as "teacher1"
And I follow "Course 1"
And I navigate to "Grades" node in "Course administration"
And I navigate to "Scales" node in "Grade administration"
And I press "Add a new scale"
And I set the following fields to these values:
| Name | My Scale |
| Scale | Disappointing, Not good enough, Average, Good, Very good, Excellent! |
And I press "Save changes"
And I follow "Course 1"
And I turn editing mode on
And I add a "Assignment" to section "1" and I fill the form with:
| Assignment name | Test assignment |
| Description | Offline text |
| assignsubmission_file_enabled | 0 |
| id_modgrade_type | Scale |
| id_modgrade_scale | My Scale |
| Group mode | Separate groups |
And I follow "Course 1"
And I navigate to "Grades" node in "Course administration"
And I turn editing mode on
And I give the grade "Excellent!" to the user "Student 1" for the grade item "Test assignment"
And I give the grade "Very good" to the user "Student 2" for the grade item "Test assignment"
And I give the grade "Very good" to the user "Student 3" for the grade item "Test assignment"
And I give the grade "Good" to the user "Student 4" for the grade item "Test assignment"
And I give the grade "Good" to the user "Student 5" for the grade item "Test assignment"
And I give the grade "Average" to the user "Student 6" for the grade item "Test assignment"
And I press "Save changes"
And I follow "Course 1"
Scenario: Try to configure the block on the course page to show 1 high score
Given I add the "Activity results" block
When I configure the "Activity results" block
And I set the following fields to these values:
| id_config_showbest | 1 |
| id_config_showworst | 0 |
| id_config_nameformat | Display full names |
| id_config_usegroups | Yes |
And I press "Save changes"
Then I should see "Group 1" in the "Activity results" "block"
And I should see "Excellent!" in the "Activity results" "block"
And I log out
And I log in as "student1"
And I follow "Course 1"
And I should see "Student 1" in the "Activity results" "block"
And I should see "Excellent!" in the "Activity results" "block"
Scenario: Try to configure the block on the course page to show multiple high scores using full names
Given I add the "Activity results" block
When I configure the "Activity results" block
And I set the following fields to these values:
| id_config_showbest | 3 |
| id_config_showworst | 0 |
| id_config_nameformat | Display full names |
| id_config_usegroups | Yes |
And I press "Save changes"
Then I should see "Group 1" in the "Activity results" "block"
And I should see "Excellent!" in the "Activity results" "block"
And I should see "Group 2" in the "Activity results" "block"
And I should see "Very good" in the "Activity results" "block"
And I should see "Group 3" in the "Activity results" "block"
And I should see "Good" in the "Activity results" "block"
And I log out
And I log in as "student3"
And I follow "Course 1"
And I should see "Student 3" in the "Activity results" "block"
And I should see "Very good" in the "Activity results" "block"
And I should see "Student 4" in the "Activity results" "block"
And I should see "Good" in the "Activity results" "block"
Scenario: Try to configure the block on the course page to show multiple high scores using ID numbers
Given I add the "Activity results" block
When I configure the "Activity results" block
And I set the following fields to these values:
| id_config_showbest | 3 |
| id_config_showworst | 0 |
| id_config_nameformat | Display only ID numbers |
| id_config_usegroups | Yes |
And I press "Save changes"
Then I should see "Group" in the "Activity results" "block"
And I should see "Excellent!" in the "Activity results" "block"
And I should see "Very good" in the "Activity results" "block"
And I should see "Good" in the "Activity results" "block"
And I log out
And I log in as "student1"
And I follow "Course 1"
And I should see "User S1" in the "Activity results" "block"
And I should see "Excellent!" in the "Activity results" "block"
And I should see "User S2" in the "Activity results" "block"
And I should see "Very good" in the "Activity results" "block"
Scenario: Try to configure the block on the course page to show multiple high scores using anonymous names
Given I add the "Activity results" block
When I configure the "Activity results" block
And I set the following fields to these values:
| id_config_showbest | 3 |
| id_config_showworst | 0 |
| id_config_nameformat | Anonymous results |
| id_config_usegroups | Yes |
And I press "Save changes"
Then I should see "Group" in the "Activity results" "block"
And I should see "Excellent!" in the "Activity results" "block"
And I should see "Very good" in the "Activity results" "block"
And I should see "Good" in the "Activity results" "block"
And I log out
And I log in as "student1"
And I follow "Course 1"
And I should see "User" in the "Activity results" "block"
And I should see "Excellent!" in the "Activity results" "block"
And I should see "Very good" in the "Activity results" "block"
@@ -33,19 +33,15 @@ Feature: The activity results block displays student scores
| student4 | C1 | student |
| student5 | C1 | student |
| student6 | C1 | student |
@javascript
Scenario: Configure the block on the course page to show 1 high score
Given I log in as "teacher1"
And I follow "Course 1"
And I expand "Users" node
And I follow "Groups"
And I add "Student 1 (student1@example.com)" user to "Group 1" group members
And I add "Student 2 (student2@example.com)" user to "Group 1" group members
And I add "Student 3 (student3@example.com)" user to "Group 2" group members
And I add "Student 4 (student4@example.com)" user to "Group 2" group members
And I add "Student 5 (student5@example.com)" user to "Group 3" group members
And I add "Student 6 (student6@example.com)" user to "Group 3" group members
And the following "group members" exist:
| user | group |
| student1 | G1 |
| student2 | G1 |
| student3 | G2 |
| student4 | G2 |
| student5 | G3 |
| student6 | G3 |
And I log in as "teacher1"
And I follow "Course 1"
And I turn editing mode on
And I add a "Assignment" to section "1" and I fill the form with:
@@ -64,7 +60,9 @@ Feature: The activity results block displays student scores
And I give the grade "70.00" to the user "Student 6" for the grade item "Test assignment"
And I press "Save changes"
And I follow "Course 1"
And I add the "Activity results" block
Scenario: Configure the block on the course page to show 1 high score
Given I add the "Activity results" block
When I configure the "Activity results" block
And I set the following fields to these values:
| id_config_showbest | 1 |
@@ -77,37 +75,8 @@ Feature: The activity results block displays student scores
Then I should see "Group 1" in the "Activity results" "block"
And I should see "95%" in the "Activity results" "block"
@javascript
Scenario: Try to configure the block on the course page to show 1 high score as a fraction
Given I log in as "teacher1"
And I follow "Course 1"
And I expand "Users" node
And I follow "Groups"
And I add "Student 1 (student1@example.com)" user to "Group 1" group members
And I add "Student 2 (student2@example.com)" user to "Group 1" group members
And I add "Student 3 (student3@example.com)" user to "Group 2" group members
And I add "Student 4 (student4@example.com)" user to "Group 2" group members
And I add "Student 5 (student5@example.com)" user to "Group 3" group members
And I add "Student 6 (student6@example.com)" user to "Group 3" group members
And I follow "Course 1"
And I turn editing mode on
And I add a "Assignment" to section "1" and I fill the form with:
| Assignment name | Test assignment |
| Description | Offline text |
| assignsubmission_file_enabled | 0 |
| Group mode | Separate groups |
And I follow "Course 1"
And I navigate to "Grades" node in "Course administration"
And I turn editing mode on
And I give the grade "100.00" to the user "Student 1" for the grade item "Test assignment"
And I give the grade "90.00" to the user "Student 2" for the grade item "Test assignment"
And I give the grade "90.00" to the user "Student 3" for the grade item "Test assignment"
And I give the grade "80.00" to the user "Student 4" for the grade item "Test assignment"
And I give the grade "80.00" to the user "Student 5" for the grade item "Test assignment"
And I give the grade "70.00" to the user "Student 6" for the grade item "Test assignment"
And I press "Save changes"
And I follow "Course 1"
And I add the "Activity results" block
Given I add the "Activity results" block
When I configure the "Activity results" block
And I set the following fields to these values:
| id_config_showbest | 1 |
@@ -124,37 +93,8 @@ Feature: The activity results block displays student scores
And I should see "Student 1" in the "Activity results" "block"
And I should see "100.00/100.00" in the "Activity results" "block"
@javascript
Scenario: Try to configure the block on the course page to show 1 high score as a absolute numbers
Given I log in as "teacher1"
And I follow "Course 1"
And I expand "Users" node
And I follow "Groups"
And I add "Student 1 (student1@example.com)" user to "Group 1" group members
And I add "Student 2 (student2@example.com)" user to "Group 1" group members
And I add "Student 3 (student3@example.com)" user to "Group 2" group members
And I add "Student 4 (student4@example.com)" user to "Group 2" group members
And I add "Student 5 (student5@example.com)" user to "Group 3" group members
And I add "Student 6 (student6@example.com)" user to "Group 3" group members
And I follow "Course 1"
And I turn editing mode on
And I add a "Assignment" to section "1" and I fill the form with:
| Assignment name | Test assignment |
| Description | Offline text |
| assignsubmission_file_enabled | 0 |
| Group mode | Separate groups |
And I follow "Course 1"
And I navigate to "Grades" node in "Course administration"
And I turn editing mode on
And I give the grade "100.00" to the user "Student 1" for the grade item "Test assignment"
And I give the grade "90.00" to the user "Student 2" for the grade item "Test assignment"
And I give the grade "90.00" to the user "Student 3" for the grade item "Test assignment"
And I give the grade "80.00" to the user "Student 4" for the grade item "Test assignment"
And I give the grade "80.00" to the user "Student 5" for the grade item "Test assignment"
And I give the grade "70.00" to the user "Student 6" for the grade item "Test assignment"
And I press "Save changes"
And I follow "Course 1"
And I add the "Activity results" block
Given I add the "Activity results" block
When I configure the "Activity results" block
And I set the following fields to these values:
| id_config_showbest | 1 |
@@ -171,37 +111,8 @@ Feature: The activity results block displays student scores
And I should see "Student 1" in the "Activity results" "block"
And I should see "100.00" in the "Activity results" "block"
@javascript
Scenario: Try to configure the block on the course page to show multiple high scores as percentages
Given I log in as "teacher1"
And I follow "Course 1"
And I expand "Users" node
And I follow "Groups"
And I add "Student 1 (student1@example.com)" user to "Group 1" group members
And I add "Student 2 (student2@example.com)" user to "Group 1" group members
And I add "Student 3 (student3@example.com)" user to "Group 2" group members
And I add "Student 4 (student4@example.com)" user to "Group 2" group members
And I add "Student 5 (student5@example.com)" user to "Group 3" group members
And I add "Student 6 (student6@example.com)" user to "Group 3" group members
And I follow "Course 1"
And I turn editing mode on
And I add a "Assignment" to section "1" and I fill the form with:
| Assignment name | Test assignment |
| Description | Offline text |
| assignsubmission_file_enabled | 0 |
| Group mode | Separate groups |
And I follow "Course 1"
And I navigate to "Grades" node in "Course administration"
And I turn editing mode on
And I give the grade "100.00" to the user "Student 1" for the grade item "Test assignment"
And I give the grade "90.00" to the user "Student 2" for the grade item "Test assignment"
And I give the grade "90.00" to the user "Student 3" for the grade item "Test assignment"
And I give the grade "80.00" to the user "Student 4" for the grade item "Test assignment"
And I give the grade "80.00" to the user "Student 5" for the grade item "Test assignment"
And I give the grade "70.00" to the user "Student 6" for the grade item "Test assignment"
And I press "Save changes"
And I follow "Course 1"
And I add the "Activity results" block
Given I add the "Activity results" block
When I configure the "Activity results" block
And I set the following fields to these values:
| id_config_showbest | 3 |
@@ -225,37 +136,8 @@ Feature: The activity results block displays student scores
And I should see "Student 2" in the "Activity results" "block"
And I should see "90%" in the "Activity results" "block"
@javascript
Scenario: Try to configure the block on the course page to show multiple high scores as fractions
Given I log in as "teacher1"
And I follow "Course 1"
And I expand "Users" node
And I follow "Groups"
And I add "Student 1 (student1@example.com)" user to "Group 1" group members
And I add "Student 2 (student2@example.com)" user to "Group 1" group members
And I add "Student 3 (student3@example.com)" user to "Group 2" group members
And I add "Student 4 (student4@example.com)" user to "Group 2" group members
And I add "Student 5 (student5@example.com)" user to "Group 3" group members
And I add "Student 6 (student6@example.com)" user to "Group 3" group members
And I follow "Course 1"
And I turn editing mode on
And I add a "Assignment" to section "1" and I fill the form with:
| Assignment name | Test assignment |
| Description | Offline text |
| assignsubmission_file_enabled | 0 |
| Group mode | Separate groups |
And I follow "Course 1"
And I navigate to "Grades" node in "Course administration"
And I turn editing mode on
And I give the grade "100.00" to the user "Student 1" for the grade item "Test assignment"
And I give the grade "90.00" to the user "Student 2" for the grade item "Test assignment"
And I give the grade "90.00" to the user "Student 3" for the grade item "Test assignment"
And I give the grade "80.00" to the user "Student 4" for the grade item "Test assignment"
And I give the grade "80.00" to the user "Student 5" for the grade item "Test assignment"
And I give the grade "70.00" to the user "Student 6" for the grade item "Test assignment"
And I press "Save changes"
And I follow "Course 1"
And I add the "Activity results" block
Given I add the "Activity results" block
When I configure the "Activity results" block
And I set the following fields to these values:
| id_config_showbest | 3 |
@@ -278,37 +160,8 @@ Feature: The activity results block displays student scores
And I should see "Student 4" in the "Activity results" "block"
And I should see "80.00/100.00" in the "Activity results" "block"
@javascript
Scenario: Try to configure the block on the course page to show multiple high scores as absolute numbers
Given I log in as "teacher1"
And I follow "Course 1"
And I expand "Users" node
And I follow "Groups"
And I add "Student 1 (student1@example.com)" user to "Group 1" group members
And I add "Student 2 (student2@example.com)" user to "Group 1" group members
And I add "Student 3 (student3@example.com)" user to "Group 2" group members
And I add "Student 4 (student4@example.com)" user to "Group 2" group members
And I add "Student 5 (student5@example.com)" user to "Group 3" group members
And I add "Student 6 (student6@example.com)" user to "Group 3" group members
And I follow "Course 1"
And I turn editing mode on
And I add a "Assignment" to section "1" and I fill the form with:
| Assignment name | Test assignment |
| Description | Offline text |
| assignsubmission_file_enabled | 0 |
| Group mode | Separate groups |
And I follow "Course 1"
And I navigate to "Grades" node in "Course administration"
And I turn editing mode on
And I give the grade "100.00" to the user "Student 1" for the grade item "Test assignment"
And I give the grade "90.00" to the user "Student 2" for the grade item "Test assignment"
And I give the grade "90.00" to the user "Student 3" for the grade item "Test assignment"
And I give the grade "80.00" to the user "Student 4" for the grade item "Test assignment"
And I give the grade "80.00" to the user "Student 5" for the grade item "Test assignment"
And I give the grade "70.00" to the user "Student 6" for the grade item "Test assignment"
And I press "Save changes"
And I follow "Course 1"
And I add the "Activity results" block
Given I add the "Activity results" block
When I configure the "Activity results" block
And I set the following fields to these values:
| id_config_showbest | 3 |
@@ -331,37 +184,8 @@ Feature: The activity results block displays student scores
And I should see "Student 2" in the "Activity results" "block"
And I should see "90.00" in the "Activity results" "block"
@javascript
Scenario: Try to configure the block on the course page to show multiple high scores using ID numbers
Given I log in as "teacher1"
And I follow "Course 1"
And I expand "Users" node
And I follow "Groups"
And I add "Student 1 (student1@example.com)" user to "Group 1" group members
And I add "Student 2 (student2@example.com)" user to "Group 1" group members
And I add "Student 3 (student3@example.com)" user to "Group 2" group members
And I add "Student 4 (student4@example.com)" user to "Group 2" group members
And I add "Student 5 (student5@example.com)" user to "Group 3" group members
And I add "Student 6 (student6@example.com)" user to "Group 3" group members
And I follow "Course 1"
And I turn editing mode on
And I add a "Assignment" to section "1" and I fill the form with:
| Assignment name | Test assignment |
| Description | Offline text |
| assignsubmission_file_enabled | 0 |
| Group mode | Separate groups |
And I follow "Course 1"
And I navigate to "Grades" node in "Course administration"
And I turn editing mode on
And I give the grade "100.00" to the user "Student 1" for the grade item "Test assignment"
And I give the grade "90.00" to the user "Student 2" for the grade item "Test assignment"
And I give the grade "90.00" to the user "Student 3" for the grade item "Test assignment"
And I give the grade "80.00" to the user "Student 4" for the grade item "Test assignment"
And I give the grade "80.00" to the user "Student 5" for the grade item "Test assignment"
And I give the grade "70.00" to the user "Student 6" for the grade item "Test assignment"
And I press "Save changes"
And I follow "Course 1"
And I add the "Activity results" block
Given I add the "Activity results" block
When I configure the "Activity results" block
And I set the following fields to these values:
| id_config_showbest | 3 |
@@ -382,37 +206,8 @@ Feature: The activity results block displays student scores
And I should see "User S2" in the "Activity results" "block"
And I should see "90.00%" in the "Activity results" "block"
@javascript
Scenario: Try to configure the block on the course page to show multiple high scores using anonymous names
Given I log in as "teacher1"
And I follow "Course 1"
And I expand "Users" node
And I follow "Groups"
And I add "Student 1 (student1@example.com)" user to "Group 1" group members
And I add "Student 2 (student2@example.com)" user to "Group 1" group members
And I add "Student 3 (student3@example.com)" user to "Group 2" group members
And I add "Student 4 (student4@example.com)" user to "Group 2" group members
And I add "Student 5 (student5@example.com)" user to "Group 3" group members
And I add "Student 6 (student6@example.com)" user to "Group 3" group members
And I follow "Course 1"
And I turn editing mode on
And I add a "Assignment" to section "1" and I fill the form with:
| Assignment name | Test assignment |
| Description | Offline text |
| assignsubmission_file_enabled | 0 |
| Group mode | Separate groups |
And I follow "Course 1"
And I navigate to "Grades" node in "Course administration"
And I turn editing mode on
And I give the grade "100.00" to the user "Student 1" for the grade item "Test assignment"
And I give the grade "90.00" to the user "Student 2" for the grade item "Test assignment"
And I give the grade "90.00" to the user "Student 3" for the grade item "Test assignment"
And I give the grade "80.00" to the user "Student 4" for the grade item "Test assignment"
And I give the grade "80.00" to the user "Student 5" for the grade item "Test assignment"
And I give the grade "70.00" to the user "Student 6" for the grade item "Test assignment"
And I press "Save changes"
And I follow "Course 1"
And I add the "Activity results" block
Given I add the "Activity results" block
When I configure the "Activity results" block
And I set the following fields to these values:
| id_config_showbest | 3 |
@@ -33,19 +33,15 @@ Feature: The activity results block displays student scores
| student4 | C1 | student |
| student5 | C1 | student |
| student6 | C1 | student |
@javascript
Scenario: Configure the block on the course page to show 1 high score
Given I log in as "teacher1"
And I follow "Course 1"
And I expand "Users" node
And I follow "Groups"
And I add "Student 1 (student1@example.com)" user to "Group 1" group members
And I add "Student 2 (student2@example.com)" user to "Group 1" group members
And I add "Student 3 (student3@example.com)" user to "Group 2" group members
And I add "Student 4 (student4@example.com)" user to "Group 2" group members
And I add "Student 5 (student5@example.com)" user to "Group 3" group members
And I add "Student 6 (student6@example.com)" user to "Group 3" group members
And the following "group members" exist:
| user | group |
| student1 | G1 |
| student2 | G1 |
| student3 | G2 |
| student4 | G2 |
| student5 | G3 |
| student6 | G3 |
And I log in as "teacher1"
And I follow "Course 1"
And I turn editing mode on
And I add a "Assignment" to section "1" and I fill the form with:
@@ -64,7 +60,9 @@ Feature: The activity results block displays student scores
And I give the grade "70.00" to the user "Student 6" for the grade item "Test assignment"
And I press "Save changes"
And I follow "Course 1"
And I add the "Activity results" block
Scenario: Configure the block on the course page to show 1 high score
Given I add the "Activity results" block
When I configure the "Activity results" block
And I set the following fields to these values:
| id_config_showbest | 1 |
@@ -77,37 +75,8 @@ Feature: The activity results block displays student scores
Then I should see "Group 1" in the "Activity results" "block"
And I should see "95%" in the "Activity results" "block"
@javascript
Scenario: Try to configure the block on the course page to show 1 high score as a fraction
Given I log in as "teacher1"
And I follow "Course 1"
And I expand "Users" node
And I follow "Groups"
And I add "Student 1 (student1@example.com)" user to "Group 1" group members
And I add "Student 2 (student2@example.com)" user to "Group 1" group members
And I add "Student 3 (student3@example.com)" user to "Group 2" group members
And I add "Student 4 (student4@example.com)" user to "Group 2" group members
And I add "Student 5 (student5@example.com)" user to "Group 3" group members
And I add "Student 6 (student6@example.com)" user to "Group 3" group members
And I follow "Course 1"
And I turn editing mode on
And I add a "Assignment" to section "1" and I fill the form with:
| Assignment name | Test assignment |
| Description | Offline text |
| assignsubmission_file_enabled | 0 |
| Group mode | Visible groups |
And I follow "Course 1"
And I navigate to "Grades" node in "Course administration"
And I turn editing mode on
And I give the grade "100.00" to the user "Student 1" for the grade item "Test assignment"
And I give the grade "90.00" to the user "Student 2" for the grade item "Test assignment"
And I give the grade "90.00" to the user "Student 3" for the grade item "Test assignment"
And I give the grade "80.00" to the user "Student 4" for the grade item "Test assignment"
And I give the grade "80.00" to the user "Student 5" for the grade item "Test assignment"
And I give the grade "70.00" to the user "Student 6" for the grade item "Test assignment"
And I press "Save changes"
And I follow "Course 1"
And I add the "Activity results" block
Given I add the "Activity results" block
When I configure the "Activity results" block
And I set the following fields to these values:
| id_config_showbest | 1 |
@@ -122,37 +91,8 @@ Feature: The activity results block displays student scores
And I should see "Group 1" in the "Activity results" "block"
And I should see "95.00/100.00" in the "Activity results" "block"
@javascript
Scenario: Try to configure the block on the course page to show 1 high score as a absolute numbers
Given I log in as "teacher1"
And I follow "Course 1"
And I expand "Users" node
And I follow "Groups"
And I add "Student 1 (student1@example.com)" user to "Group 1" group members
And I add "Student 2 (student2@example.com)" user to "Group 1" group members
And I add "Student 3 (student3@example.com)" user to "Group 2" group members
And I add "Student 4 (student4@example.com)" user to "Group 2" group members
And I add "Student 5 (student5@example.com)" user to "Group 3" group members
And I add "Student 6 (student6@example.com)" user to "Group 3" group members
And I follow "Course 1"
And I turn editing mode on
And I add a "Assignment" to section "1" and I fill the form with:
| Assignment name | Test assignment |
| Description | Offline text |
| assignsubmission_file_enabled | 0 |
| Group mode | Visible groups |
And I follow "Course 1"
And I navigate to "Grades" node in "Course administration"
And I turn editing mode on
And I give the grade "100.00" to the user "Student 1" for the grade item "Test assignment"
And I give the grade "90.00" to the user "Student 2" for the grade item "Test assignment"
And I give the grade "90.00" to the user "Student 3" for the grade item "Test assignment"
And I give the grade "80.00" to the user "Student 4" for the grade item "Test assignment"
And I give the grade "80.00" to the user "Student 5" for the grade item "Test assignment"
And I give the grade "70.00" to the user "Student 6" for the grade item "Test assignment"
And I press "Save changes"
And I follow "Course 1"
And I add the "Activity results" block
Given I add the "Activity results" block
When I configure the "Activity results" block
And I set the following fields to these values:
| id_config_showbest | 1 |
@@ -167,37 +107,8 @@ Feature: The activity results block displays student scores
And I should see "Group 1" in the "Activity results" "block"
And I should see "95.00" in the "Activity results" "block"
@javascript
Scenario: Try to configure the block on the course page to show multiple high scores as percentages
Given I log in as "teacher1"
And I follow "Course 1"
And I expand "Users" node
And I follow "Groups"
And I add "Student 1 (student1@example.com)" user to "Group 1" group members
And I add "Student 2 (student2@example.com)" user to "Group 1" group members
And I add "Student 3 (student3@example.com)" user to "Group 2" group members
And I add "Student 4 (student4@example.com)" user to "Group 2" group members
And I add "Student 5 (student5@example.com)" user to "Group 3" group members
And I add "Student 6 (student6@example.com)" user to "Group 3" group members
And I follow "Course 1"
And I turn editing mode on
And I add a "Assignment" to section "1" and I fill the form with:
| Assignment name | Test assignment |
| Description | Offline text |
| assignsubmission_file_enabled | 0 |
| Group mode | Visible groups |
And I follow "Course 1"
And I navigate to "Grades" node in "Course administration"
And I turn editing mode on
And I give the grade "100.00" to the user "Student 1" for the grade item "Test assignment"
And I give the grade "90.00" to the user "Student 2" for the grade item "Test assignment"
And I give the grade "90.00" to the user "Student 3" for the grade item "Test assignment"
And I give the grade "80.00" to the user "Student 4" for the grade item "Test assignment"
And I give the grade "80.00" to the user "Student 5" for the grade item "Test assignment"
And I give the grade "70.00" to the user "Student 6" for the grade item "Test assignment"
And I press "Save changes"
And I follow "Course 1"
And I add the "Activity results" block
Given I add the "Activity results" block
When I configure the "Activity results" block
And I set the following fields to these values:
| id_config_showbest | 3 |
@@ -217,37 +128,8 @@ Feature: The activity results block displays student scores
And I should see "Group 3" in the "Activity results" "block"
And I should see "75%" in the "Activity results" "block"
@javascript
Scenario: Try to configure the block on the course page to show multiple high scores as fractions
Given I log in as "teacher1"
And I follow "Course 1"
And I expand "Users" node
And I follow "Groups"
And I add "Student 1 (student1@example.com)" user to "Group 1" group members
And I add "Student 2 (student2@example.com)" user to "Group 1" group members
And I add "Student 3 (student3@example.com)" user to "Group 2" group members
And I add "Student 4 (student4@example.com)" user to "Group 2" group members
And I add "Student 5 (student5@example.com)" user to "Group 3" group members
And I add "Student 6 (student6@example.com)" user to "Group 3" group members
And I follow "Course 1"
And I turn editing mode on
And I add a "Assignment" to section "1" and I fill the form with:
| Assignment name | Test assignment |
| Description | Offline text |
| assignsubmission_file_enabled | 0 |
| Group mode | Visible groups |
And I follow "Course 1"
And I navigate to "Grades" node in "Course administration"
And I turn editing mode on
And I give the grade "100.00" to the user "Student 1" for the grade item "Test assignment"
And I give the grade "90.00" to the user "Student 2" for the grade item "Test assignment"
And I give the grade "90.00" to the user "Student 3" for the grade item "Test assignment"
And I give the grade "80.00" to the user "Student 4" for the grade item "Test assignment"
And I give the grade "80.00" to the user "Student 5" for the grade item "Test assignment"
And I give the grade "70.00" to the user "Student 6" for the grade item "Test assignment"
And I press "Save changes"
And I follow "Course 1"
And I add the "Activity results" block
Given I add the "Activity results" block
When I configure the "Activity results" block
And I set the following fields to these values:
| id_config_showbest | 3 |
@@ -266,37 +148,8 @@ Feature: The activity results block displays student scores
And I should see "Group 3" in the "Activity results" "block"
And I should see "75.00/100.00" in the "Activity results" "block"
@javascript
Scenario: Try to configure the block on the course page to show multiple high scores as absolute numbers
Given I log in as "teacher1"
And I follow "Course 1"
And I expand "Users" node
And I follow "Groups"
And I add "Student 1 (student1@example.com)" user to "Group 1" group members
And I add "Student 2 (student2@example.com)" user to "Group 1" group members
And I add "Student 3 (student3@example.com)" user to "Group 2" group members
And I add "Student 4 (student4@example.com)" user to "Group 2" group members
And I add "Student 5 (student5@example.com)" user to "Group 3" group members
And I add "Student 6 (student6@example.com)" user to "Group 3" group members
And I follow "Course 1"
And I turn editing mode on
And I add a "Assignment" to section "1" and I fill the form with:
| Assignment name | Test assignment |
| Description | Offline text |
| assignsubmission_file_enabled | 0 |
| Group mode | Visible groups |
And I follow "Course 1"
And I navigate to "Grades" node in "Course administration"
And I turn editing mode on
And I give the grade "100.00" to the user "Student 1" for the grade item "Test assignment"
And I give the grade "90.00" to the user "Student 2" for the grade item "Test assignment"
And I give the grade "90.00" to the user "Student 3" for the grade item "Test assignment"
And I give the grade "80.00" to the user "Student 4" for the grade item "Test assignment"
And I give the grade "80.00" to the user "Student 5" for the grade item "Test assignment"
And I give the grade "70.00" to the user "Student 6" for the grade item "Test assignment"
And I press "Save changes"
And I follow "Course 1"
And I add the "Activity results" block
Given I add the "Activity results" block
When I configure the "Activity results" block
And I set the following fields to these values:
| id_config_showbest | 3 |
@@ -315,37 +168,8 @@ Feature: The activity results block displays student scores
And I should see "Group 3" in the "Activity results" "block"
And I should see "75.00" in the "Activity results" "block"
@javascript
Scenario: Try to configure the block on the course page to show multiple high scores using ID numbers
Given I log in as "teacher1"
And I follow "Course 1"
And I expand "Users" node
And I follow "Groups"
And I add "Student 1 (student1@example.com)" user to "Group 1" group members
And I add "Student 2 (student2@example.com)" user to "Group 1" group members
And I add "Student 3 (student3@example.com)" user to "Group 2" group members
And I add "Student 4 (student4@example.com)" user to "Group 2" group members
And I add "Student 5 (student5@example.com)" user to "Group 3" group members
And I add "Student 6 (student6@example.com)" user to "Group 3" group members
And I follow "Course 1"
And I turn editing mode on
And I add a "Assignment" to section "1" and I fill the form with:
| Assignment name | Test assignment |
| Description | Offline text |
| assignsubmission_file_enabled | 0 |
| Group mode | Visible groups |
And I follow "Course 1"
And I navigate to "Grades" node in "Course administration"
And I turn editing mode on
And I give the grade "100.00" to the user "Student 1" for the grade item "Test assignment"
And I give the grade "90.00" to the user "Student 2" for the grade item "Test assignment"
And I give the grade "90.00" to the user "Student 3" for the grade item "Test assignment"
And I give the grade "80.00" to the user "Student 4" for the grade item "Test assignment"
And I give the grade "80.00" to the user "Student 5" for the grade item "Test assignment"
And I give the grade "70.00" to the user "Student 6" for the grade item "Test assignment"
And I press "Save changes"
And I follow "Course 1"
And I add the "Activity results" block
Given I add the "Activity results" block
When I configure the "Activity results" block
And I set the following fields to these values:
| id_config_showbest | 3 |
@@ -362,37 +186,8 @@ Feature: The activity results block displays student scores
And I should see "85.00%" in the "Activity results" "block"
And I should see "75.00%" in the "Activity results" "block"
@javascript
Scenario: Try to configure the block on the course page to show multiple high scores using anonymous names
Given I log in as "teacher1"
And I follow "Course 1"
And I expand "Users" node
And I follow "Groups"
And I add "Student 1 (student1@example.com)" user to "Group 1" group members
And I add "Student 2 (student2@example.com)" user to "Group 1" group members
And I add "Student 3 (student3@example.com)" user to "Group 2" group members
And I add "Student 4 (student4@example.com)" user to "Group 2" group members
And I add "Student 5 (student5@example.com)" user to "Group 3" group members
And I add "Student 6 (student6@example.com)" user to "Group 3" group members
And I follow "Course 1"
And I turn editing mode on
And I add a "Assignment" to section "1" and I fill the form with:
| Assignment name | Test assignment |
| Description | Offline text |
| assignsubmission_file_enabled | 0 |
| Group mode | Visible groups |
And I follow "Course 1"
And I navigate to "Grades" node in "Course administration"
And I turn editing mode on
And I give the grade "100.00" to the user "Student 1" for the grade item "Test assignment"
And I give the grade "90.00" to the user "Student 2" for the grade item "Test assignment"
And I give the grade "90.00" to the user "Student 3" for the grade item "Test assignment"
And I give the grade "80.00" to the user "Student 4" for the grade item "Test assignment"
And I give the grade "80.00" to the user "Student 5" for the grade item "Test assignment"
And I give the grade "70.00" to the user "Student 6" for the grade item "Test assignment"
And I press "Save changes"
And I follow "Course 1"
And I add the "Activity results" block
Given I add the "Activity results" block
When I configure the "Activity results" block
And I set the following fields to these values:
| id_config_showbest | 3 |
@@ -0,0 +1,112 @@
@block @block_activity_results
Feature: The activity results block displays student scores as scales
In order to be display student scores as scales
As a user
I need to see the activity results block
Background:
Given the following "users" exist:
| username | firstname | lastname | email | idnumber |
| teacher1 | Teacher | 1 | teacher1@example.com | T1 |
| student1 | Student | 1 | student1@example.com | S1 |
| student2 | Student | 2 | student2@example.com | S2 |
| student3 | Student | 3 | student3@example.com | S3 |
| student4 | Student | 4 | student4@example.com | S4 |
| student5 | Student | 5 | student5@example.com | S5 |
And the following "courses" exist:
| fullname | shortname | category |
| Course 1 | C1 | 0 |
And the following "course enrolments" exist:
| user | course | role |
| teacher1 | C1 | editingteacher |
| student1 | C1 | student |
| student2 | C1 | student |
| student3 | C1 | student |
| student4 | C1 | student |
| student5 | C1 | student |
And I log in as "teacher1"
And I follow "Course 1"
And I navigate to "Grades" node in "Course administration"
And I navigate to "Scales" node in "Grade administration"
And I press "Add a new scale"
And I set the following fields to these values:
| Name | My Scale |
| Scale | Disappointing, Not good enough, Average, Good, Very good, Excellent! |
And I press "Save changes"
And I follow "Course 1"
And I turn editing mode on
And I add a "Assignment" to section "1" and I fill the form with:
| Assignment name | Test assignment |
| Description | Offline text |
| assignsubmission_file_enabled | 0 |
| id_modgrade_type | Scale |
| id_modgrade_scale | My Scale |
And I follow "Course 1"
And I navigate to "Grades" node in "Course administration"
And I turn editing mode on
And I give the grade "Excellent!" to the user "Student 1" for the grade item "Test assignment"
And I give the grade "Very good" to the user "Student 2" for the grade item "Test assignment"
And I give the grade "Good" to the user "Student 3" for the grade item "Test assignment"
And I give the grade "Average" to the user "Student 4" for the grade item "Test assignment"
And I give the grade "Not good enough" to the user "Student 5" for the grade item "Test assignment"
And I press "Save changes"
And I follow "Course 1"
Scenario: Configure the block on the course page to show 1 low score
Given I add the "Activity results" block
When I configure the "Activity results" block
And I set the following fields to these values:
| id_config_showbest | 0 |
| id_config_showworst | 1 |
| id_config_gradeformat | Percentages |
| id_config_nameformat | Display full names |
| id_config_decimalpoints | 0 |
And I press "Save changes"
Then I should see "Student 5" in the "Activity results" "block"
And I should see "Not good enough" in the "Activity results" "block"
Scenario: Try to configure the block on the course page to show multiple low scores using full names
Given I add the "Activity results" block
When I configure the "Activity results" block
And I set the following fields to these values:
| id_config_showbest | 0 |
| id_config_showworst | 3 |
| id_config_nameformat | Display full names |
And I press "Save changes"
Then I should see "Student 5" in the "Activity results" "block"
And I should see "Not good enough" in the "Activity results" "block"
And I should see "Student 4" in the "Activity results" "block"
And I should see "Average" in the "Activity results" "block"
And I should see "Student 3" in the "Activity results" "block"
And I should see "Good" in the "Activity results" "block"
Scenario: Try to configure the block on the course page to show multiple low scores using ID numbers
Given I add the "Activity results" block
When I configure the "Activity results" block
And I set the following fields to these values:
| id_config_showbest | 0 |
| id_config_showworst | 3 |
| id_config_nameformat | Display only ID numbers |
And I press "Save changes"
Then I should see "User S5" in the "Activity results" "block"
And I should see "Not good enough" in the "Activity results" "block"
And I should see "User S4" in the "Activity results" "block"
And I should see "Average" in the "Activity results" "block"
And I should see "User S3" in the "Activity results" "block"
And I should see "Good" in the "Activity results" "block"
Scenario: Try to configure the block on the course page to show multiple low scores using anonymous names
Given I add the "Activity results" block
When I configure the "Activity results" block
And I set the following fields to these values:
| id_config_showbest | 0 |
| id_config_showworst | 3 |
| id_config_nameformat | Anonymous results |
And I press "Save changes"
Then I should see "User" in the "Activity results" "block"
And I should not see "Student 5" in the "Activity results" "block"
And I should see "Not good enough" in the "Activity results" "block"
And I should not see "Student 4" in the "Activity results" "block"
And I should see "Average" in the "Activity results" "block"
And I should not see "Student 3" in the "Activity results" "block"
And I should see "Good" in the "Activity results" "block"
@@ -0,0 +1,150 @@
@block @block_activity_results
Feature: The activity results block displays student scores as scales
In order to be display student scores as scales
As a user
I need to see the activity results block
Background:
Given the following "users" exist:
| username | firstname | lastname | email | idnumber |
| teacher1 | Teacher | 1 | teacher1@example.com | T1 |
| student1 | Student | 1 | student1@example.com | S1 |
| student2 | Student | 2 | student2@example.com | S2 |
| student3 | Student | 3 | student3@example.com | S3 |
| student4 | Student | 4 | student4@example.com | S4 |
| student5 | Student | 5 | student5@example.com | S5 |
| student6 | Student | 6 | student6@example.com | S6 |
And the following "courses" exist:
| fullname | shortname | category |
| Course 1 | C1 | 0 |
And the following "groups" exist:
| name | course | idnumber |
| Group 1 | C1 | G1 |
| Group 2 | C1 | G2 |
| Group 3 | C1 | G3 |
| Group 4 | C1 | G4 |
| Group 5 | C1 | G5 |
And the following "course enrolments" exist:
| user | course | role |
| teacher1 | C1 | editingteacher |
| student1 | C1 | student |
| student2 | C1 | student |
| student3 | C1 | student |
| student4 | C1 | student |
| student5 | C1 | student |
| student6 | C1 | student |
And the following "group members" exist:
| user | group |
| student1 | G1 |
| student2 | G1 |
| student3 | G2 |
| student4 | G2 |
| student5 | G3 |
| student6 | G3 |
And I log in as "teacher1"
And I follow "Course 1"
And I navigate to "Grades" node in "Course administration"
And I navigate to "Scales" node in "Grade administration"
And I press "Add a new scale"
And I set the following fields to these values:
| Name | My Scale |
| Scale | Disappointing, Not good enough, Average, Good, Very good, Excellent! |
And I press "Save changes"
And I follow "Course 1"
And I turn editing mode on
And I add a "Assignment" to section "1" and I fill the form with:
| Assignment name | Test assignment |
| Description | Offline text |
| assignsubmission_file_enabled | 0 |
| id_modgrade_type | Scale |
| id_modgrade_scale | My Scale |
| Group mode | Separate groups |
And I follow "Course 1"
And I navigate to "Grades" node in "Course administration"
And I turn editing mode on
And I give the grade "Excellent!" to the user "Student 1" for the grade item "Test assignment"
And I give the grade "Very good" to the user "Student 2" for the grade item "Test assignment"
And I give the grade "Very good" to the user "Student 3" for the grade item "Test assignment"
And I give the grade "Good" to the user "Student 4" for the grade item "Test assignment"
And I give the grade "Good" to the user "Student 5" for the grade item "Test assignment"
And I give the grade "Average" to the user "Student 6" for the grade item "Test assignment"
And I press "Save changes"
And I follow "Course 1"
Scenario: Try to configure the block on the course page to show 1 low score
Given I add the "Activity results" block
When I configure the "Activity results" block
And I set the following fields to these values:
| id_config_showbest | 0 |
| id_config_showworst | 1 |
| id_config_nameformat | Display full names |
| id_config_usegroups | Yes |
And I press "Save changes"
Then I should see "Group 3" in the "Activity results" "block"
And I should see "Good" in the "Activity results" "block"
And I log out
And I log in as "student5"
And I follow "Course 1"
And I should see "Student 6" in the "Activity results" "block"
And I should see "Average" in the "Activity results" "block"
Scenario: Try to configure the block on the course page to show multiple high scores using full names
Given I add the "Activity results" block
When I configure the "Activity results" block
And I set the following fields to these values:
| id_config_showbest | 0 |
| id_config_showworst | 2 |
| id_config_nameformat | Display full names |
| id_config_usegroups | Yes |
And I press "Save changes"
Then I should see "Group 2" in the "Activity results" "block"
And I should see "Very good" in the "Activity results" "block"
And I should see "Group 3" in the "Activity results" "block"
And I should see "Good" in the "Activity results" "block"
And I log out
And I log in as "student3"
And I follow "Course 1"
And I should see "Student 3" in the "Activity results" "block"
And I should see "Very good" in the "Activity results" "block"
And I should see "Student 4" in the "Activity results" "block"
And I should see "Good" in the "Activity results" "block"
Scenario: Try to configure the block on the course page to show multiple high scores using ID numbers
Given I add the "Activity results" block
When I configure the "Activity results" block
And I set the following fields to these values:
| id_config_showbest | 0 |
| id_config_showworst | 2 |
| id_config_nameformat | Display only ID numbers |
| id_config_usegroups | Yes |
And I press "Save changes"
Then I should see "Group" in the "Activity results" "block"
And I should see "Very good" in the "Activity results" "block"
And I should see "Good" in the "Activity results" "block"
And I log out
And I log in as "student5"
And I follow "Course 1"
And I should see "User S5" in the "Activity results" "block"
And I should see "Good" in the "Activity results" "block"
And I should see "User S6" in the "Activity results" "block"
And I should see "Average" in the "Activity results" "block"
Scenario: Try to configure the block on the course page to show multiple high scores using anonymous names
Given I add the "Activity results" block
When I configure the "Activity results" block
And I set the following fields to these values:
| id_config_showbest | 0 |
| id_config_showworst | 2 |
| id_config_nameformat | Anonymous results |
| id_config_usegroups | Yes |
And I press "Save changes"
Then I should see "Group" in the "Activity results" "block"
And I should see "Very good" in the "Activity results" "block"
And I should see "Good" in the "Activity results" "block"
And I log out
And I log in as "student5"
And I follow "Course 1"
And I should see "User" in the "Activity results" "block"
And I should see "Good" in the "Activity results" "block"
And I should see "Average" in the "Activity results" "block"
@@ -33,19 +33,15 @@ Feature: The activity results block displays student scores
| student4 | C1 | student |
| student5 | C1 | student |
| student6 | C1 | student |
@javascript
Scenario: Configure the block on the course page to show 1 low score
Given I log in as "teacher1"
And I follow "Course 1"
And I expand "Users" node
And I follow "Groups"
And I add "Student 1 (student1@example.com)" user to "Group 1" group members
And I add "Student 2 (student2@example.com)" user to "Group 1" group members
And I add "Student 3 (student3@example.com)" user to "Group 2" group members
And I add "Student 4 (student4@example.com)" user to "Group 2" group members
And I add "Student 5 (student5@example.com)" user to "Group 3" group members
And I add "Student 6 (student6@example.com)" user to "Group 3" group members
And the following "group members" exist:
| user | group |
| student1 | G1 |
| student2 | G1 |
| student3 | G2 |
| student4 | G2 |
| student5 | G3 |
| student6 | G3 |
And I log in as "teacher1"
And I follow "Course 1"
And I turn editing mode on
And I add a "Assignment" to section "1" and I fill the form with:
@@ -64,7 +60,9 @@ Feature: The activity results block displays student scores
And I give the grade "70.00" to the user "Student 6" for the grade item "Test assignment"
And I press "Save changes"
And I follow "Course 1"
And I add the "Activity results" block
Scenario: Configure the block on the course page to show 1 low score
Given I add the "Activity results" block
When I configure the "Activity results" block
And I set the following fields to these values:
| id_config_showbest | 0 |
@@ -77,37 +75,8 @@ Feature: The activity results block displays student scores
Then I should see "Group 3" in the "Activity results" "block"
And I should see "75%" in the "Activity results" "block"
@javascript
Scenario: Try to configure the block on the course page to show 1 low score as a fraction
Given I log in as "teacher1"
And I follow "Course 1"
And I expand "Users" node
And I follow "Groups"
And I add "Student 1 (student1@example.com)" user to "Group 1" group members
And I add "Student 2 (student2@example.com)" user to "Group 1" group members
And I add "Student 3 (student3@example.com)" user to "Group 2" group members
And I add "Student 4 (student4@example.com)" user to "Group 2" group members
And I add "Student 5 (student5@example.com)" user to "Group 3" group members
And I add "Student 6 (student6@example.com)" user to "Group 3" group members
And I follow "Course 1"
And I turn editing mode on
And I add a "Assignment" to section "1" and I fill the form with:
| Assignment name | Test assignment |
| Description | Offline text |
| assignsubmission_file_enabled | 0 |
| Group mode | Separate groups |
And I follow "Course 1"
And I navigate to "Grades" node in "Course administration"
And I turn editing mode on
And I give the grade "100.00" to the user "Student 1" for the grade item "Test assignment"
And I give the grade "90.00" to the user "Student 2" for the grade item "Test assignment"
And I give the grade "90.00" to the user "Student 3" for the grade item "Test assignment"
And I give the grade "80.00" to the user "Student 4" for the grade item "Test assignment"
And I give the grade "80.00" to the user "Student 5" for the grade item "Test assignment"
And I give the grade "70.00" to the user "Student 6" for the grade item "Test assignment"
And I press "Save changes"
And I follow "Course 1"
And I add the "Activity results" block
Given I add the "Activity results" block
When I configure the "Activity results" block
And I set the following fields to these values:
| id_config_showbest | 0 |
@@ -124,37 +93,8 @@ Feature: The activity results block displays student scores
And I should see "Student 6" in the "Activity results" "block"
And I should see "70.00/100.00" in the "Activity results" "block"
@javascript
Scenario: Try to configure the block on the course page to show 1 low score as a absolute numbers
Given I log in as "teacher1"
And I follow "Course 1"
And I expand "Users" node
And I follow "Groups"
And I add "Student 1 (student1@example.com)" user to "Group 1" group members
And I add "Student 2 (student2@example.com)" user to "Group 1" group members
And I add "Student 3 (student3@example.com)" user to "Group 2" group members
And I add "Student 4 (student4@example.com)" user to "Group 2" group members
And I add "Student 5 (student5@example.com)" user to "Group 3" group members
And I add "Student 6 (student6@example.com)" user to "Group 3" group members
And I follow "Course 1"
And I turn editing mode on
And I add a "Assignment" to section "1" and I fill the form with:
| Assignment name | Test assignment |
| Description | Offline text |
| assignsubmission_file_enabled | 0 |
| Group mode | Separate groups |
And I follow "Course 1"
And I navigate to "Grades" node in "Course administration"
And I turn editing mode on
And I give the grade "100.00" to the user "Student 1" for the grade item "Test assignment"
And I give the grade "90.00" to the user "Student 2" for the grade item "Test assignment"
And I give the grade "90.00" to the user "Student 3" for the grade item "Test assignment"
And I give the grade "80.00" to the user "Student 4" for the grade item "Test assignment"
And I give the grade "80.00" to the user "Student 5" for the grade item "Test assignment"
And I give the grade "70.00" to the user "Student 6" for the grade item "Test assignment"
And I press "Save changes"
And I follow "Course 1"
And I add the "Activity results" block
Given I add the "Activity results" block
When I configure the "Activity results" block
And I set the following fields to these values:
| id_config_showbest | 0 |
@@ -171,37 +111,8 @@ Feature: The activity results block displays student scores
And I should see "Student 6" in the "Activity results" "block"
And I should see "70.00" in the "Activity results" "block"
@javascript
Scenario: Try to configure the block on the course page to show multiple low scores as percentages
Given I log in as "teacher1"
And I follow "Course 1"
And I expand "Users" node
And I follow "Groups"
And I add "Student 1 (student1@example.com)" user to "Group 1" group members
And I add "Student 2 (student2@example.com)" user to "Group 1" group members
And I add "Student 3 (student3@example.com)" user to "Group 2" group members
And I add "Student 4 (student4@example.com)" user to "Group 2" group members
And I add "Student 5 (student5@example.com)" user to "Group 3" group members
And I add "Student 6 (student6@example.com)" user to "Group 3" group members
And I follow "Course 1"
And I turn editing mode on
And I add a "Assignment" to section "1" and I fill the form with:
| Assignment name | Test assignment |
| Description | Offline text |
| assignsubmission_file_enabled | 0 |
| Group mode | Separate groups |
And I follow "Course 1"
And I navigate to "Grades" node in "Course administration"
And I turn editing mode on
And I give the grade "100.00" to the user "Student 1" for the grade item "Test assignment"
And I give the grade "90.00" to the user "Student 2" for the grade item "Test assignment"
And I give the grade "90.00" to the user "Student 3" for the grade item "Test assignment"
And I give the grade "80.00" to the user "Student 4" for the grade item "Test assignment"
And I give the grade "80.00" to the user "Student 5" for the grade item "Test assignment"
And I give the grade "70.00" to the user "Student 6" for the grade item "Test assignment"
And I press "Save changes"
And I follow "Course 1"
And I add the "Activity results" block
Given I add the "Activity results" block
When I configure the "Activity results" block
And I set the following fields to these values:
| id_config_showbest | 0 |
@@ -223,37 +134,8 @@ Feature: The activity results block displays student scores
And I should see "Student 5" in the "Activity results" "block"
And I should see "80%" in the "Activity results" "block"
@javascript
Scenario: Try to configure the block on the course page to show multiple low scores as fractions
Given I log in as "teacher1"
And I follow "Course 1"
And I expand "Users" node
And I follow "Groups"
And I add "Student 1 (student1@example.com)" user to "Group 1" group members
And I add "Student 2 (student2@example.com)" user to "Group 1" group members
And I add "Student 3 (student3@example.com)" user to "Group 2" group members
And I add "Student 4 (student4@example.com)" user to "Group 2" group members
And I add "Student 5 (student5@example.com)" user to "Group 3" group members
And I add "Student 6 (student6@example.com)" user to "Group 3" group members
And I follow "Course 1"
And I turn editing mode on
And I add a "Assignment" to section "1" and I fill the form with:
| Assignment name | Test assignment |
| Description | Offline text |
| assignsubmission_file_enabled | 0 |
| Group mode | Separate groups |
And I follow "Course 1"
And I navigate to "Grades" node in "Course administration"
And I turn editing mode on
And I give the grade "100.00" to the user "Student 1" for the grade item "Test assignment"
And I give the grade "90.00" to the user "Student 2" for the grade item "Test assignment"
And I give the grade "90.00" to the user "Student 3" for the grade item "Test assignment"
And I give the grade "80.00" to the user "Student 4" for the grade item "Test assignment"
And I give the grade "80.00" to the user "Student 5" for the grade item "Test assignment"
And I give the grade "70.00" to the user "Student 6" for the grade item "Test assignment"
And I press "Save changes"
And I follow "Course 1"
And I add the "Activity results" block
Given I add the "Activity results" block
When I configure the "Activity results" block
And I set the following fields to these values:
| id_config_showbest | 0 |
@@ -274,37 +156,8 @@ Feature: The activity results block displays student scores
And I should see "Student 4" in the "Activity results" "block"
And I should see "80.00/100.00" in the "Activity results" "block"
@javascript
Scenario: Try to configure the block on the course page to show multiple low scores as absolute numbers
Given I log in as "teacher1"
And I follow "Course 1"
And I expand "Users" node
And I follow "Groups"
And I add "Student 1 (student1@example.com)" user to "Group 1" group members
And I add "Student 2 (student2@example.com)" user to "Group 1" group members
And I add "Student 3 (student3@example.com)" user to "Group 2" group members
And I add "Student 4 (student4@example.com)" user to "Group 2" group members
And I add "Student 5 (student5@example.com)" user to "Group 3" group members
And I add "Student 6 (student6@example.com)" user to "Group 3" group members
And I follow "Course 1"
And I turn editing mode on
And I add a "Assignment" to section "1" and I fill the form with:
| Assignment name | Test assignment |
| Description | Offline text |
| assignsubmission_file_enabled | 0 |
| Group mode | Separate groups |
And I follow "Course 1"
And I navigate to "Grades" node in "Course administration"
And I turn editing mode on
And I give the grade "100.00" to the user "Student 1" for the grade item "Test assignment"
And I give the grade "90.00" to the user "Student 2" for the grade item "Test assignment"
And I give the grade "90.00" to the user "Student 3" for the grade item "Test assignment"
And I give the grade "80.00" to the user "Student 4" for the grade item "Test assignment"
And I give the grade "80.00" to the user "Student 5" for the grade item "Test assignment"
And I give the grade "70.00" to the user "Student 6" for the grade item "Test assignment"
And I press "Save changes"
And I follow "Course 1"
And I add the "Activity results" block
Given I add the "Activity results" block
When I configure the "Activity results" block
And I set the following fields to these values:
| id_config_showbest | 0 |
@@ -325,37 +178,8 @@ Feature: The activity results block displays student scores
And I should see "Student 6" in the "Activity results" "block"
And I should see "70.00" in the "Activity results" "block"
@javascript
Scenario: Try to configure the block on the course page to show multiple low scores using ID numbers
Given I log in as "teacher1"
And I follow "Course 1"
And I expand "Users" node
And I follow "Groups"
And I add "Student 1 (student1@example.com)" user to "Group 1" group members
And I add "Student 2 (student2@example.com)" user to "Group 1" group members
And I add "Student 3 (student3@example.com)" user to "Group 2" group members
And I add "Student 4 (student4@example.com)" user to "Group 2" group members
And I add "Student 5 (student5@example.com)" user to "Group 3" group members
And I add "Student 6 (student6@example.com)" user to "Group 3" group members
And I follow "Course 1"
And I turn editing mode on
And I add a "Assignment" to section "1" and I fill the form with:
| Assignment name | Test assignment |
| Description | Offline text |
| assignsubmission_file_enabled | 0 |
| Group mode | Separate groups |
And I follow "Course 1"
And I navigate to "Grades" node in "Course administration"
And I turn editing mode on
And I give the grade "100.00" to the user "Student 1" for the grade item "Test assignment"
And I give the grade "90.00" to the user "Student 2" for the grade item "Test assignment"
And I give the grade "90.00" to the user "Student 3" for the grade item "Test assignment"
And I give the grade "80.00" to the user "Student 4" for the grade item "Test assignment"
And I give the grade "80.00" to the user "Student 5" for the grade item "Test assignment"
And I give the grade "70.00" to the user "Student 6" for the grade item "Test assignment"
And I press "Save changes"
And I follow "Course 1"
And I add the "Activity results" block
Given I add the "Activity results" block
When I configure the "Activity results" block
And I set the following fields to these values:
| id_config_showbest | 0 |
@@ -375,37 +199,8 @@ Feature: The activity results block displays student scores
And I should see "User S2" in the "Activity results" "block"
And I should see "90.00%" in the "Activity results" "block"
@javascript
Scenario: Try to configure the block on the course page to show multiple low scores using anonymous names
Given I log in as "teacher1"
And I follow "Course 1"
And I expand "Users" node
And I follow "Groups"
And I add "Student 1 (student1@example.com)" user to "Group 1" group members
And I add "Student 2 (student2@example.com)" user to "Group 1" group members
And I add "Student 3 (student3@example.com)" user to "Group 2" group members
And I add "Student 4 (student4@example.com)" user to "Group 2" group members
And I add "Student 5 (student5@example.com)" user to "Group 3" group members
And I add "Student 6 (student6@example.com)" user to "Group 3" group members
And I follow "Course 1"
And I turn editing mode on
And I add a "Assignment" to section "1" and I fill the form with:
| Assignment name | Test assignment |
| Description | Offline text |
| assignsubmission_file_enabled | 0 |
| Group mode | Separate groups |
And I follow "Course 1"
And I navigate to "Grades" node in "Course administration"
And I turn editing mode on
And I give the grade "100.00" to the user "Student 1" for the grade item "Test assignment"
And I give the grade "90.00" to the user "Student 2" for the grade item "Test assignment"
And I give the grade "90.00" to the user "Student 3" for the grade item "Test assignment"
And I give the grade "80.00" to the user "Student 4" for the grade item "Test assignment"
And I give the grade "80.00" to the user "Student 5" for the grade item "Test assignment"
And I give the grade "70.00" to the user "Student 6" for the grade item "Test assignment"
And I press "Save changes"
And I follow "Course 1"
And I add the "Activity results" block
Given I add the "Activity results" block
When I configure the "Activity results" block
And I set the following fields to these values:
| id_config_showbest | 0 |
@@ -33,19 +33,15 @@ Feature: The activity results block displays student scores
| student4 | C1 | student |
| student5 | C1 | student |
| student6 | C1 | student |
@javascript
Scenario: Configure the block on the course page to show 1 low score
Given I log in as "teacher1"
And I follow "Course 1"
And I expand "Users" node
And I follow "Groups"
And I add "Student 1 (student1@example.com)" user to "Group 1" group members
And I add "Student 2 (student2@example.com)" user to "Group 1" group members
And I add "Student 3 (student3@example.com)" user to "Group 2" group members
And I add "Student 4 (student4@example.com)" user to "Group 2" group members
And I add "Student 5 (student5@example.com)" user to "Group 3" group members
And I add "Student 6 (student6@example.com)" user to "Group 3" group members
And the following "group members" exist:
| user | group |
| student1 | G1 |
| student2 | G1 |
| student3 | G2 |
| student4 | G2 |
| student5 | G3 |
| student6 | G3 |
And I log in as "teacher1"
And I follow "Course 1"
And I turn editing mode on
And I add a "Assignment" to section "1" and I fill the form with:
@@ -64,7 +60,9 @@ Feature: The activity results block displays student scores
And I give the grade "70.00" to the user "Student 6" for the grade item "Test assignment"
And I press "Save changes"
And I follow "Course 1"
And I add the "Activity results" block
Scenario: Configure the block on the course page to show 1 low score
Given I add the "Activity results" block
When I configure the "Activity results" block
And I set the following fields to these values:
| id_config_showbest | 0 |
@@ -77,37 +75,8 @@ Feature: The activity results block displays student scores
Then I should see "Group 3" in the "Activity results" "block"
And I should see "75%" in the "Activity results" "block"
@javascript
Scenario: Try to configure the block on the course page to show 1 low score as a fraction
Given I log in as "teacher1"
And I follow "Course 1"
And I expand "Users" node
And I follow "Groups"
And I add "Student 1 (student1@example.com)" user to "Group 1" group members
And I add "Student 2 (student2@example.com)" user to "Group 1" group members
And I add "Student 3 (student3@example.com)" user to "Group 2" group members
And I add "Student 4 (student4@example.com)" user to "Group 2" group members
And I add "Student 5 (student5@example.com)" user to "Group 3" group members
And I add "Student 6 (student6@example.com)" user to "Group 3" group members
And I follow "Course 1"
And I turn editing mode on
And I add a "Assignment" to section "1" and I fill the form with:
| Assignment name | Test assignment |
| Description | Offline text |
| assignsubmission_file_enabled | 0 |
| Group mode | Visible groups |
And I follow "Course 1"
And I navigate to "Grades" node in "Course administration"
And I turn editing mode on
And I give the grade "100.00" to the user "Student 1" for the grade item "Test assignment"
And I give the grade "90.00" to the user "Student 2" for the grade item "Test assignment"
And I give the grade "90.00" to the user "Student 3" for the grade item "Test assignment"
And I give the grade "80.00" to the user "Student 4" for the grade item "Test assignment"
And I give the grade "80.00" to the user "Student 5" for the grade item "Test assignment"
And I give the grade "70.00" to the user "Student 6" for the grade item "Test assignment"
And I press "Save changes"
And I follow "Course 1"
And I add the "Activity results" block
Given I add the "Activity results" block
When I configure the "Activity results" block
And I set the following fields to these values:
| id_config_showbest | 0 |
@@ -122,37 +91,8 @@ Feature: The activity results block displays student scores
And I should see "Group 3" in the "Activity results" "block"
And I should see "75.00/100.00" in the "Activity results" "block"
@javascript
Scenario: Try to configure the block on the course page to show 1 low score as a absolute numbers
Given I log in as "teacher1"
And I follow "Course 1"
And I expand "Users" node
And I follow "Groups"
And I add "Student 1 (student1@example.com)" user to "Group 1" group members
And I add "Student 2 (student2@example.com)" user to "Group 1" group members
And I add "Student 3 (student3@example.com)" user to "Group 2" group members
And I add "Student 4 (student4@example.com)" user to "Group 2" group members
And I add "Student 5 (student5@example.com)" user to "Group 3" group members
And I add "Student 6 (student6@example.com)" user to "Group 3" group members
And I follow "Course 1"
And I turn editing mode on
And I add a "Assignment" to section "1" and I fill the form with:
| Assignment name | Test assignment |
| Description | Offline text |
| assignsubmission_file_enabled | 0 |
| Group mode | Visible groups |
And I follow "Course 1"
And I navigate to "Grades" node in "Course administration"
And I turn editing mode on
And I give the grade "100.00" to the user "Student 1" for the grade item "Test assignment"
And I give the grade "90.00" to the user "Student 2" for the grade item "Test assignment"
And I give the grade "90.00" to the user "Student 3" for the grade item "Test assignment"
And I give the grade "80.00" to the user "Student 4" for the grade item "Test assignment"
And I give the grade "80.00" to the user "Student 5" for the grade item "Test assignment"
And I give the grade "70.00" to the user "Student 6" for the grade item "Test assignment"
And I press "Save changes"
And I follow "Course 1"
And I add the "Activity results" block
Given I add the "Activity results" block
When I configure the "Activity results" block
And I set the following fields to these values:
| id_config_showbest | 0 |
@@ -167,37 +107,8 @@ Feature: The activity results block displays student scores
And I should see "Group 3" in the "Activity results" "block"
And I should see "75.00" in the "Activity results" "block"
@javascript
Scenario: Try to configure the block on the course page to show multiple low scores as percentages
Given I log in as "teacher1"
And I follow "Course 1"
And I expand "Users" node
And I follow "Groups"
And I add "Student 1 (student1@example.com)" user to "Group 1" group members
And I add "Student 2 (student2@example.com)" user to "Group 1" group members
And I add "Student 3 (student3@example.com)" user to "Group 2" group members
And I add "Student 4 (student4@example.com)" user to "Group 2" group members
And I add "Student 5 (student5@example.com)" user to "Group 3" group members
And I add "Student 6 (student6@example.com)" user to "Group 3" group members
And I follow "Course 1"
And I turn editing mode on
And I add a "Assignment" to section "1" and I fill the form with:
| Assignment name | Test assignment |
| Description | Offline text |
| assignsubmission_file_enabled | 0 |
| Group mode | Visible groups |
And I follow "Course 1"
And I navigate to "Grades" node in "Course administration"
And I turn editing mode on
And I give the grade "100.00" to the user "Student 1" for the grade item "Test assignment"
And I give the grade "90.00" to the user "Student 2" for the grade item "Test assignment"
And I give the grade "90.00" to the user "Student 3" for the grade item "Test assignment"
And I give the grade "80.00" to the user "Student 4" for the grade item "Test assignment"
And I give the grade "80.00" to the user "Student 5" for the grade item "Test assignment"
And I give the grade "70.00" to the user "Student 6" for the grade item "Test assignment"
And I press "Save changes"
And I follow "Course 1"
And I add the "Activity results" block
Given I add the "Activity results" block
When I configure the "Activity results" block
And I set the following fields to these values:
| id_config_showbest | 0 |
@@ -219,37 +130,8 @@ Feature: The activity results block displays student scores
And I should see "Group 3" in the "Activity results" "block"
And I should see "75%" in the "Activity results" "block"
@javascript
Scenario: Try to configure the block on the course page to show multiple low scores as fractions
Given I log in as "teacher1"
And I follow "Course 1"
And I expand "Users" node
And I follow "Groups"
And I add "Student 1 (student1@example.com)" user to "Group 1" group members
And I add "Student 2 (student2@example.com)" user to "Group 1" group members
And I add "Student 3 (student3@example.com)" user to "Group 2" group members
And I add "Student 4 (student4@example.com)" user to "Group 2" group members
And I add "Student 5 (student5@example.com)" user to "Group 3" group members
And I add "Student 6 (student6@example.com)" user to "Group 3" group members
And I follow "Course 1"
And I turn editing mode on
And I add a "Assignment" to section "1" and I fill the form with:
| Assignment name | Test assignment |
| Description | Offline text |
| assignsubmission_file_enabled | 0 |
| Group mode | Visible groups |
And I follow "Course 1"
And I navigate to "Grades" node in "Course administration"
And I turn editing mode on
And I give the grade "100.00" to the user "Student 1" for the grade item "Test assignment"
And I give the grade "90.00" to the user "Student 2" for the grade item "Test assignment"
And I give the grade "90.00" to the user "Student 3" for the grade item "Test assignment"
And I give the grade "80.00" to the user "Student 4" for the grade item "Test assignment"
And I give the grade "80.00" to the user "Student 5" for the grade item "Test assignment"
And I give the grade "70.00" to the user "Student 6" for the grade item "Test assignment"
And I press "Save changes"
And I follow "Course 1"
And I add the "Activity results" block
Given I add the "Activity results" block
When I configure the "Activity results" block
And I set the following fields to these values:
| id_config_showbest | 0 |
@@ -266,37 +148,8 @@ Feature: The activity results block displays student scores
And I should see "Group 3" in the "Activity results" "block"
And I should see "75.00/100.00" in the "Activity results" "block"
@javascript
Scenario: Try to configure the block on the course page to show multiple low scores as absolute numbers
Given I log in as "teacher1"
And I follow "Course 1"
And I expand "Users" node
And I follow "Groups"
And I add "Student 1 (student1@example.com)" user to "Group 1" group members
And I add "Student 2 (student2@example.com)" user to "Group 1" group members
And I add "Student 3 (student3@example.com)" user to "Group 2" group members
And I add "Student 4 (student4@example.com)" user to "Group 2" group members
And I add "Student 5 (student5@example.com)" user to "Group 3" group members
And I add "Student 6 (student6@example.com)" user to "Group 3" group members
And I follow "Course 1"
And I turn editing mode on
And I add a "Assignment" to section "1" and I fill the form with:
| Assignment name | Test assignment |
| Description | Offline text |
| assignsubmission_file_enabled | 0 |
| Group mode | Visible groups |
And I follow "Course 1"
And I navigate to "Grades" node in "Course administration"
And I turn editing mode on
And I give the grade "100.00" to the user "Student 1" for the grade item "Test assignment"
And I give the grade "90.00" to the user "Student 2" for the grade item "Test assignment"
And I give the grade "90.00" to the user "Student 3" for the grade item "Test assignment"
And I give the grade "80.00" to the user "Student 4" for the grade item "Test assignment"
And I give the grade "80.00" to the user "Student 5" for the grade item "Test assignment"
And I give the grade "70.00" to the user "Student 6" for the grade item "Test assignment"
And I press "Save changes"
And I follow "Course 1"
And I add the "Activity results" block
Given I add the "Activity results" block
When I configure the "Activity results" block
And I set the following fields to these values:
| id_config_showbest | 0 |
@@ -313,37 +166,8 @@ Feature: The activity results block displays student scores
And I should see "Group 3" in the "Activity results" "block"
And I should see "75.00" in the "Activity results" "block"
@javascript
Scenario: Try to configure the block on the course page to show multiple low scores using ID numbers
Given I log in as "teacher1"
And I follow "Course 1"
And I expand "Users" node
And I follow "Groups"
And I add "Student 1 (student1@example.com)" user to "Group 1" group members
And I add "Student 2 (student2@example.com)" user to "Group 1" group members
And I add "Student 3 (student3@example.com)" user to "Group 2" group members
And I add "Student 4 (student4@example.com)" user to "Group 2" group members
And I add "Student 5 (student5@example.com)" user to "Group 3" group members
And I add "Student 6 (student6@example.com)" user to "Group 3" group members
And I follow "Course 1"
And I turn editing mode on
And I add a "Assignment" to section "1" and I fill the form with:
| Assignment name | Test assignment |
| Description | Offline text |
| assignsubmission_file_enabled | 0 |
| Group mode | Visible groups |
And I follow "Course 1"
And I navigate to "Grades" node in "Course administration"
And I turn editing mode on
And I give the grade "100.00" to the user "Student 1" for the grade item "Test assignment"
And I give the grade "90.00" to the user "Student 2" for the grade item "Test assignment"
And I give the grade "90.00" to the user "Student 3" for the grade item "Test assignment"
And I give the grade "80.00" to the user "Student 4" for the grade item "Test assignment"
And I give the grade "80.00" to the user "Student 5" for the grade item "Test assignment"
And I give the grade "70.00" to the user "Student 6" for the grade item "Test assignment"
And I press "Save changes"
And I follow "Course 1"
And I add the "Activity results" block
Given I add the "Activity results" block
When I configure the "Activity results" block
And I set the following fields to these values:
| id_config_showbest | 0 |
@@ -359,37 +183,8 @@ Feature: The activity results block displays student scores
And I should see "85.00%" in the "Activity results" "block"
And I should see "75.00%" in the "Activity results" "block"
@javascript
Scenario: Try to configure the block on the course page to show multiple low scores using anonymous names
Given I log in as "teacher1"
And I follow "Course 1"
And I expand "Users" node
And I follow "Groups"
And I add "Student 1 (student1@example.com)" user to "Group 1" group members
And I add "Student 2 (student2@example.com)" user to "Group 1" group members
And I add "Student 3 (student3@example.com)" user to "Group 2" group members
And I add "Student 4 (student4@example.com)" user to "Group 2" group members
And I add "Student 5 (student5@example.com)" user to "Group 3" group members
And I add "Student 6 (student6@example.com)" user to "Group 3" group members
And I follow "Course 1"
And I turn editing mode on
And I add a "Assignment" to section "1" and I fill the form with:
| Assignment name | Test assignment |
| Description | Offline text |
| assignsubmission_file_enabled | 0 |
| Group mode | Visible groups |
And I follow "Course 1"
And I navigate to "Grades" node in "Course administration"
And I turn editing mode on
And I give the grade "100.00" to the user "Student 1" for the grade item "Test assignment"
And I give the grade "90.00" to the user "Student 2" for the grade item "Test assignment"
And I give the grade "90.00" to the user "Student 3" for the grade item "Test assignment"
And I give the grade "80.00" to the user "Student 4" for the grade item "Test assignment"
And I give the grade "80.00" to the user "Student 5" for the grade item "Test assignment"
And I give the grade "70.00" to the user "Student 6" for the grade item "Test assignment"
And I press "Save changes"
And I follow "Course 1"
And I add the "Activity results" block
Given I add the "Activity results" block
When I configure the "Activity results" block
And I set the following fields to these values:
| id_config_showbest | 0 |
+10 -2
View File
@@ -23,6 +23,12 @@
*/
class block_course_summary extends block_base {
/**
* @var bool Flag to indicate whether the header should be hidden or not.
*/
private $headerhidden = true;
function init() {
$this->title = get_string('pluginname', 'block_course_summary');
}
@@ -32,8 +38,10 @@ class block_course_summary extends block_base {
}
function specialization() {
if($this->page->pagetype == PAGE_COURSE_VIEW && $this->page->course->id != SITEID) {
// Page type starts with 'course-view' and the page's course ID is not equal to the site ID.
if (strpos($this->page->pagetype, PAGE_COURSE_VIEW) === 0 && $this->page->course->id != SITEID) {
$this->title = get_string('coursesummary', 'block_course_summary');
$this->headerhidden = false;
}
}
@@ -71,7 +79,7 @@ class block_course_summary extends block_base {
}
function hide_header() {
return true;
return $this->headerhidden;
}
}
@@ -25,19 +25,22 @@ Feature: Course summary block used in a course
Scenario: Student can view course summary
When I log in as "student1"
And I follow "Course 1"
Then "Course/site summary" "block" should exist
And I should see "Proved the course summary block works!" in the "Course/site summary" "block"
Then "Course summary" "block" should exist
And I should see "Course summary" in the "Course summary" "block"
And I should see "Proved the course summary block works!" in the "Course summary" "block"
Scenario: Teacher can see an edit icon when edit mode is on and follow it to the course edit page
When I log in as "teacher1"
And I follow "Course 1"
And I turn editing mode on
Then I should see "Proved the course summary block works!" in the "Course/site summary" "block"
And I click on "Edit" "link" in the "Course/site summary" "block"
Then I should see "Proved the course summary block works!" in the "Course summary" "block"
And I should see "Course summary" in the "Course summary" "block"
And I click on "Edit" "link" in the "Course summary" "block"
Then I should see "Edit course settings" in the "h2" "css_element"
Scenario: Teacher can not see edit icon when edit mode is off
When I log in as "teacher1"
And I follow "Course 1"
Then I should see "Proved the course summary block works!" in the "Course/site summary" "block"
And "Edit" "link" should not exist in the "Course/site summary" "block"
Then I should see "Proved the course summary block works!" in the "Course summary" "block"
And I should see "Course summary" in the "Course summary" "block"
And "Edit" "link" should not exist in the "Course summary" "block"
@@ -17,6 +17,7 @@ Feature: Course summary block used on the frontpage
Scenario: Guest can view site summary
When I am on site homepage
Then "Course/site summary" "block" should exist
And I should not see "Course summary" in the "Course/site summary" "block"
And I should see "Proved the summary block works!" in the "Course/site summary" "block"
Scenario: Admin can see an edit icon when edit mode is on and follow it to the front page settings
@@ -24,6 +25,7 @@ Feature: Course summary block used on the frontpage
And I am on site homepage
And I follow "Turn editing on"
Then I should see "Proved the summary block works!" in the "Course/site summary" "block"
And I should not see "Course summary" in the "Course/site summary" "block"
And I click on "Edit" "link" in the "Course/site summary" "block"
Then I should see "Front page settings" in the "h2" "css_element"
@@ -31,4 +33,5 @@ Feature: Course summary block used on the frontpage
When I log in as "admin"
And I am on site homepage
Then I should see "Proved the summary block works!" in the "Course/site summary" "block"
And I should not see "Course summary" in the "Course/site summary" "block"
And "Edit" "link" should not exist in the "Course/site summary" "block"
@@ -84,14 +84,13 @@ class block_glossary_random extends block_base {
$limitfrom = 0;
$limitnum = 1;
$BROWSE = 'timemodified';
$orderby = 'timemodified ASC';
switch ($this->config->type) {
case BGR_RANDOMLY:
$i = rand(1,$numberofentries);
$limitfrom = $i-1;
$SORT = 'ASC';
break;
case BGR_NEXTONE:
@@ -104,11 +103,10 @@ class block_glossary_random extends block_base {
$i = 1;
}
$limitfrom = $i-1;
$SORT = 'ASC';
break;
case BGR_NEXTALPHA:
$BROWSE = 'concept';
$orderby = 'concept ASC';
if (isset($this->config->previous)) {
$i = $this->config->previous + 1;
} else {
@@ -118,20 +116,19 @@ class block_glossary_random extends block_base {
$i = 1;
}
$limitfrom = $i-1;
$SORT = 'ASC';
break;
default: // BGR_LASTMODIFIED
$i = $numberofentries;
$limitfrom = 0;
$SORT = 'DESC';
$orderby = 'timemodified DESC, id DESC';
break;
}
if ($entry = $DB->get_records_sql("SELECT id, concept, definition, definitionformat, definitiontrust
FROM {glossary_entries}
WHERE glossaryid = ? AND approved = 1
ORDER BY $BROWSE $SORT", array($this->config->glossary), $limitfrom, $limitnum)) {
ORDER BY $orderby", array($this->config->glossary), $limitfrom, $limitnum)) {
$entry = reset($entry);
+17
View File
@@ -104,6 +104,23 @@ class block_html extends block_base {
return true;
}
/**
* Copy any block-specific data when copying to a new block instance.
* @param int $fromid the id number of the block instance to copy from
* @return boolean
*/
public function instance_copy($fromid) {
$fromcontext = context_block::instance($fromid);
$fs = get_file_storage();
// This extra check if file area is empty adds one query if it is not empty but saves several if it is.
if (!$fs->is_area_empty($fromcontext->id, 'block_html', 'content', 0, false)) {
$draftitemid = 0;
file_prepare_draft_area($draftitemid, $fromcontext->id, 'block_html', 'content', 0, array('subdirs' => true));
file_save_draft_area_files($draftitemid, $this->context->id, 'block_html', 'content', 0, array('subdirs' => true));
}
return true;
}
function content_is_trusted() {
global $SCRIPT;
+1 -1
View File
@@ -133,7 +133,7 @@ class block_myprofile extends block_base {
if(!empty($this->config->display_phone2) && !empty($USER->phone2)) {
$this->content->text .= '<div class="myprofileitem phone2">';
$this->content->text .= get_string('phone').': ' . s($USER->phone2);
$this->content->text .= get_string('phone2').': ' . s($USER->phone2);
$this->content->text .= '</div>';
}
+2 -2
View File
@@ -34,8 +34,8 @@ $string['display_skype'] = 'Display Skype';
$string['display_yahoo'] = 'Display Yahoo';
$string['display_aim'] = 'Display AIM';
$string['display_msn'] = 'Display MSN';
$string['display_phone1'] = 'Display phone number 1';
$string['display_phone2'] = 'Display phone number 2';
$string['display_phone1'] = 'Display phone';
$string['display_phone2'] = 'Display mobile phone';
$string['display_institution'] = 'Display institution';
$string['display_address'] = 'Display address';
$string['display_firstaccess'] = 'Display first access';
@@ -35,29 +35,4 @@ defined('MOODLE_INTERNAL') || die();
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
class block_online_users_generator extends testing_block_generator {
/**
* Create new block instance
* @param array|stdClass $record
* @param array $options
* @return stdClass activity record with extra cmid field
*/
public function create_instance($record = null, array $options = null) {
global $DB, $CFG;
require_once("$CFG->dirroot/mod/page/locallib.php");
$this->instancecount++;
$record = (object)(array)$record;
$options = (array)$options;
$record = $this->prepare_record($record);
$id = $DB->insert_record('block_instances', $record);
context_block::instance($id);
$instance = $DB->get_record('block_instances', array('id'=>$id), '*', MUST_EXIST);
return $instance;
}
}
@@ -23,7 +23,7 @@
*/
$string['anycategory'] = 'Any category';
$string['apierror'] = 'The Youtube API key is not set. Contact your administrator.';
$string['apierror'] = 'The YouTube API key is not set. Contact your administrator.';
$string['apikey'] = 'API key';
$string['apikeyinfo'] = 'Get a <a href="https://developers.google.com/youtube/v3/getting-started">Google API key</a> for your Moodle site.';
$string['autosvehicles'] = 'Autos &amp; Vehicles';
@@ -42,7 +42,7 @@ $string['numberofvideos'] = 'Number of videos';
$string['peopleblogs'] = 'People &amp; Blogs';
$string['petsanimals'] = 'Pets &amp; Animals';
$string['pluginname'] = 'YouTube';
$string['requesterror'] = 'Data could not be obtained from the server. Contact your administrator if the problem persist.';
$string['requesterror'] = 'Data could not be obtained from the server. Contact your administrator if the problem persists.';
$string['scienceandtech'] = 'Science &amp; Tech';
$string['sports'] = 'Sports';
$string['tag_youtube:addinstance'] = 'Add a new YouTube block';
+6 -3
View File
@@ -30,6 +30,7 @@
*/
class block_tags_edit_form extends block_edit_form {
protected function specific_definition($mform) {
global $CFG;
// Fields for editing HTML block title and contents.
$mform->addElement('header', 'configheader', get_string('blocksettings', 'block'));
@@ -44,8 +45,10 @@ class block_tags_edit_form extends block_edit_form {
$mform->addElement('select', 'config_numberoftags', get_string('numberoftags', 'blog'), $numberoftags);
$mform->setDefault('config_numberoftags', 80);
$defaults = array('default'=>'default', 'official'=>'official', ''=>'both');
$mform->addElement('select', 'config_tagtype', get_string('defaultdisplay', 'block_tags'), $defaults);
$mform->setDefault('config_tagtype', '');
if (!empty($CFG->block_tags_showcoursetags)) {
$defaults = array('default'=>'default', 'official'=>'official', ''=>'both');
$mform->addElement('select', 'config_tagtype', get_string('defaultdisplay', 'block_tags'), $defaults);
$mform->setDefault('config_tagtype', '');
}
}
}
+9 -4
View File
@@ -26,6 +26,7 @@
require_once(dirname(dirname(__FILE__)).'/config.php');
require_once('lib.php');
require_once('locallib.php');
require_once($CFG->dirroot .'/comment/lib.php');
$action = required_param('action', PARAM_ALPHA);
$id = optional_param('entryid', 0, PARAM_INT);
@@ -115,6 +116,9 @@ $output = $PAGE->get_renderer('blog');
$strblogs = get_string('blogs', 'blog');
if ($action === 'delete') {
// Init comment JS strings.
comment::init();
if (empty($entry->id)) {
print_error('wrongentryid', 'blog');
}
@@ -134,14 +138,15 @@ if ($action === 'delete') {
$PAGE->set_heading($SITE->fullname);
echo $OUTPUT->header();
echo $OUTPUT->confirm(get_string('blogdeleteconfirm', 'blog'),
new moodle_url('edit.php', $optionsyes),
new moodle_url('index.php', $optionsno));
echo '<br />';
// Output the entry.
$entry->prepare_render();
echo $output->render($entry);
echo '<br />';
echo $OUTPUT->confirm(get_string('blogdeleteconfirm', 'blog'),
new moodle_url('edit.php', $optionsyes),
new moodle_url('index.php', $optionsno));
echo $OUTPUT->footer();
die;
}
+2 -2
View File
@@ -63,9 +63,9 @@ if ($entryid and !isset($userid)) {
$userid = $entry->userid;
}
if (isset($userid) && !isset($courseid)) {
if (isset($userid) && empty($courseid)) {
$context = context_user::instance($userid);
} else if (isset($courseid) && $courseid != SITEID) {
} else if (!empty($courseid) && $courseid != SITEID) {
$context = context_course::instance($courseid);
} else {
$context = context_system::instance();
+43
View File
@@ -0,0 +1,43 @@
@core @core_blog
Feature: Delete a blog entry
In order to manage my blog entries
As a user
I need to be able to delete entries I no longer wish to appear
Background:
Given the following "users" exist:
| username | firstname | lastname | email |
| testuser | Test | User | moodle@example.com |
And I log in as "testuser"
And I expand "Site pages" node
And I follow "Site blogs"
And I follow "Add a new entry"
And I set the following fields to these values:
| Entry title | Blog post one |
| Blog entry body | User 1 blog post content |
And I press "Save changes"
And I follow "Add a new entry"
And I set the following fields to these values:
| Entry title | Blog post two |
| Blog entry body | User 1 blog post content |
And I press "Save changes"
And I am on site homepage
And I expand "Site pages" node
And I follow "Site blogs"
Scenario: Delete blog post results in post deleted
Given I follow "Blog post one"
And I follow "Delete"
And I should see "Delete this blog entry?"
When I press "Continue"
Then I should not see "Blog post one"
And I should see "Blog post two"
Scenario: Delete confirmation screen works and allows cancel
Given I follow "Blog post one"
When I follow "Delete"
Then I should see "Delete this blog entry?"
And I press "Cancel"
And I should see "Blog post one"
And I should see "Blog post two"
@@ -30,7 +30,7 @@ require_once($CFG->dirroot . '/blog/lib.php');
/**
* Test functions that rely on the DB tables
*/
class core_bloglib_testcase extends advanced_testcase {
class core_blog_lib_testcase extends advanced_testcase {
private $courseid;
private $cmid;
@@ -472,5 +472,73 @@ class core_bloglib_testcase extends advanced_testcase {
$this->assertEquals($url, $event->get_url());
$this->assertEventContextNotUsed($event);
}
/**
* Tests the core_blog_myprofile_navigation() function.
*/
public function test_core_blog_myprofile_navigation() {
global $USER;
// Set up the test.
$tree = new \core_user\output\myprofile\tree();
$this->setAdminUser();
$iscurrentuser = true;
$course = null;
// Enable blogs.
set_config('enableblogs', true);
// Check the node tree is correct.
core_blog_myprofile_navigation($tree, $USER, $iscurrentuser, $course);
$reflector = new ReflectionObject($tree);
$nodes = $reflector->getProperty('nodes');
$nodes->setAccessible(true);
$this->assertArrayHasKey('blogs', $nodes->getValue($tree));
}
/**
* Tests the core_blog_myprofile_navigation() function as a guest.
*/
public function test_core_blog_myprofile_navigation_as_guest() {
global $USER;
// Set up the test.
$tree = new \core_user\output\myprofile\tree();
$iscurrentuser = false;
$course = null;
// Set user as guest.
$this->setGuestUser();
// Check the node tree is correct.
core_blog_myprofile_navigation($tree, $USER, $iscurrentuser, $course);
$reflector = new ReflectionObject($tree);
$nodes = $reflector->getProperty('nodes');
$nodes->setAccessible(true);
$this->assertArrayNotHasKey('blogs', $nodes->getValue($tree));
}
/**
* Tests the core_blog_myprofile_navigation() function when blogs are disabled.
*/
public function test_core_blog_myprofile_navigation_blogs_disabled() {
global $USER;
// Set up the test.
$tree = new \core_user\output\myprofile\tree();
$this->setAdminUser();
$iscurrentuser = false;
$course = null;
// Disable blogs.
set_config('enableblogs', false);
// Check the node tree is correct.
core_blog_myprofile_navigation($tree, $USER, $iscurrentuser, $course);
$reflector = new ReflectionObject($tree);
$nodes = $reflector->getProperty('nodes');
$nodes->setAccessible(true);
$this->assertArrayNotHasKey('blogs', $nodes->getValue($tree));
}
}
+6 -2
View File
@@ -1270,7 +1270,9 @@ class cache_application extends cache implements cache_loader_with_locking {
$this->delete_many($todelete);
}
// Set the time of the last invalidation.
$this->set('lastinvalidation', cache::now());
if ($purgeall || !empty($todelete)) {
$this->set('lastinvalidation', cache::now());
}
}
}
@@ -1669,7 +1671,9 @@ class cache_session extends cache {
$this->delete_many($todelete);
}
// Set the time of the last invalidation.
$this->set('lastsessioninvalidation', cache::now());
if ($purgeall || !empty($todelete)) {
$this->set('lastsessioninvalidation', cache::now());
}
}
}
+42
View File
@@ -989,6 +989,48 @@ class core_cache_testcase extends advanced_testcase {
));
$cache = cache::make('phpunit', 'eventinvalidationtest');
$this->assertFalse($cache->get('testkey1'));
// Test 3: Verify that an existing lastinvalidation cache file is updated when needed.
// Make a new cache class. This should should invalidate testkey2.
$cache = cache::make('phpunit', 'eventinvalidationtest');
// Timestamp should have updated to cache::now().
$this->assertEquals(cache::now(), $cache->get('lastinvalidation'));
// Set testkey2 data.
$cache->set('testkey2', 'test data 2');
// Backdate the event invalidation time by 30 seconds.
$invalidationcache = cache::make('core', 'eventinvalidation');
$invalidationcache->set('crazyevent', array('testkey2' => cache::now() - 30));
// Lastinvalidation should already be cache::now().
$this->assertEquals(cache::now(), $cache->get('lastinvalidation'));
// Set it to 15 seconds ago so that we know if it changes.
$cache->set('lastinvalidation', cache::now() - 15);
// Make a new cache class. This should not invalidate anything.
cache_factory::instance()->reset_cache_instances();
$cache = cache::make('phpunit', 'eventinvalidationtest');
// Lastinvalidation shouldn't change since it was already newer than invalidation event.
$this->assertEquals(cache::now() - 15, $cache->get('lastinvalidation'));
// Now set the event invalidation to newer than the lastinvalidation time.
$invalidationcache->set('crazyevent', array('testkey2' => cache::now() - 5));
// Make a new cache class. This should should invalidate testkey2.
cache_factory::instance()->reset_cache_instances();
$cache = cache::make('phpunit', 'eventinvalidationtest');
// Lastinvalidation timestamp should have updated to cache::now().
$this->assertEquals(cache::now(), $cache->get('lastinvalidation'));
// Now simulate a purge_by_event 5 seconds ago.
$invalidationcache = cache::make('core', 'eventinvalidation');
$invalidationcache->set('crazyevent', array('purged' => cache::now() - 5));
// Set our lastinvalidation timestamp to 15 seconds ago.
$cache->set('lastinvalidation', cache::now() - 15);
// Make a new cache class. This should invalidate the cache.
cache_factory::instance()->reset_cache_instances();
$cache = cache::make('phpunit', 'eventinvalidationtest');
// Lastinvalidation timestamp should have updated to cache::now().
$this->assertEquals(cache::now(), $cache->get('lastinvalidation'));
}
/**
+5 -1
View File
@@ -189,10 +189,14 @@ foreach($events as $event) {
$ev->add_property('class', 'PUBLIC'); // PUBLIC / PRIVATE / CONFIDENTIAL
$ev->add_property('last-modified', Bennu::timestamp_to_datetime($event->timemodified));
$ev->add_property('dtstamp', Bennu::timestamp_to_datetime()); // now
$ev->add_property('dtstart', Bennu::timestamp_to_datetime($event->timestart)); // when event starts
if ($event->timeduration > 0) {
//dtend is better than duration, because it works in Microsoft Outlook and works better in Korganizer
$ev->add_property('dtstart', Bennu::timestamp_to_datetime($event->timestart)); // when event starts.
$ev->add_property('dtend', Bennu::timestamp_to_datetime($event->timestart + $event->timeduration));
} else {
// When no duration is present, ie an all day event, VALUE should be date instead of time and dtend = dtstart + 1 day.
$ev->add_property('dtstart', Bennu::timestamp_to_date($event->timestart), array('value' => 'DATE')); // All day event.
$ev->add_property('dtend', Bennu::timestamp_to_date($event->timestart + DAYSECS), array('value' => 'DATE')); // All day event.
}
if ($event->courseid != 0) {
$coursecontext = context_course::instance($event->courseid);
+2 -1
View File
@@ -173,6 +173,8 @@ class core_calendar_external extends external_api {
// Let us findout courses that we can return events from.
if (!$hassystemcap) {
$courses = enrol_get_my_courses('id');
$courses = array_keys($courses);
foreach ($params['events']['courseids'] as $id) {
try {
$context = context_course::instance($id);
@@ -185,7 +187,6 @@ class core_calendar_external extends external_api {
'warningcode' => 'nopermissions',
'message' => 'No access rights in course context '.$e->getMessage().$e->getTraceAsString()
);
continue;
}
}
} else {
+7
View File
@@ -363,6 +363,13 @@ class core_calendar_externallib_testcase extends externallib_advanced_testcase {
$events = external_api::clean_returnvalue(core_calendar_external::get_calendar_events_returns(), $events);
$this->assertEquals(1, count($events['events'])); // site.
$this->assertEquals(0, count($events['warnings']));
// Try getting a course event by its id.
$paramevents = array ('eventids' => array($courseevent->id));
$events = core_calendar_external::get_calendar_events($paramevents, $options);
$events = external_api::clean_returnvalue(core_calendar_external::get_calendar_events_returns(), $events);
$this->assertEquals(1, count($events['events']));
$this->assertEquals(0, count($events['warnings']));
}
/**
+2 -7
View File
@@ -78,13 +78,8 @@ class core_calendar_lib_testcase extends advanced_testcase {
global $CFG;
require_once($CFG->dirroot . '/lib/cronlib.php');
// Moodle ICal URL (moodle.org events).
$presetwhat = 'all';
$presettime = 'recentupcoming';
$userid = 1;
$authtoken = 'a8bcfee2fb868a05357f650bd65dc0699b026524';
$subscriptionurl = 'https://moodle.org/calendar/export_execute.php'
. '?preset_what='.$presetwhat.'&preset_time='.$presettime.'&userid='.$userid.'&authtoken='.$authtoken;
// ICal URL from external test repo.
$subscriptionurl = $this->getExternalTestFileUrl('/ical.ics');
$subscription = new stdClass();
$subscription->eventtype = 'site';
+19 -10
View File
@@ -256,15 +256,17 @@ function cohort_get_available_cohorts($currentcontext, $withmembers = 0, $offset
$groupbysql = '';
$havingsql = '';
if ($withmembers) {
$groupbysql = " GROUP BY $fieldssql";
$fieldssql .= ', s.memberscnt';
$subfields = "c.id, COUNT(DISTINCT cm.userid) AS memberscnt";
$groupbysql = " GROUP BY c.id";
$fromsql = " LEFT JOIN {cohort_members} cm ON cm.cohortid = c.id ";
$fieldssql .= ', COUNT(DISTINCT cm.userid) AS memberscnt';
if (in_array($withmembers,
array(COHORT_COUNT_ENROLLED_MEMBERS, COHORT_WITH_ENROLLED_MEMBERS_ONLY, COHORT_WITH_NOTENROLLED_MEMBERS_ONLY))) {
list($esql, $params2) = get_enrolled_sql($currentcontext);
$fromsql .= " LEFT JOIN ($esql) u ON u.id = cm.userid ";
$params = array_merge($params2, $params);
$fieldssql .= ', COUNT(DISTINCT u.id) AS enrolledcnt';
$fieldssql .= ', s.enrolledcnt';
$subfields .= ', COUNT(DISTINCT u.id) AS enrolledcnt';
}
if ($withmembers == COHORT_WITH_MEMBERS_ONLY) {
$havingsql = " HAVING COUNT(DISTINCT cm.userid) > 0";
@@ -280,13 +282,20 @@ function cohort_get_available_cohorts($currentcontext, $withmembers = 0, $offset
$params = array_merge($params, $searchparams);
}
$sql = "SELECT $fieldssql
FROM {cohort} c
$fromsql
WHERE $wheresql
$groupbysql
$havingsql
ORDER BY c.name, c.idnumber";
if ($withmembers) {
$sql = "SELECT " . str_replace('c.', 'cohort.', $fieldssql) . "
FROM {cohort} cohort
JOIN (SELECT $subfields
FROM {cohort} c $fromsql
WHERE $wheresql $groupbysql $havingsql
) s ON cohort.id = s.id
ORDER BY cohort.name, cohort.idnumber";
} else {
$sql = "SELECT $fieldssql
FROM {cohort} c $fromsql
WHERE $wheresql
ORDER BY c.name, c.idnumber";
}
return $DB->get_records_sql($sql, $params, $offset, $limit);
}
@@ -232,6 +232,20 @@ abstract class completion_criteria extends data_object {
*/
abstract public function get_details($completion);
/**
* Return pix_icon for display in reports.
*
* @param string $alt The alt text to use for the icon
* @param array $attributes html attributes
* @return pix_icon
*/
public function get_icon($alt, array $attributes = null) {
global $COMPLETION_CRITERIA_TYPES;
$criteriatype = $COMPLETION_CRITERIA_TYPES[$this->criteriatype];
return new pix_icon('i/'.$criteriatype, $alt, 'moodle', $attributes);
}
/**
* Return criteria status text for display in reports
*
@@ -288,4 +288,15 @@ class completion_criteria_activity extends completion_criteria {
return $details;
}
/**
* Return pix_icon for display in reports.
*
* @param string $alt The alt text to use for the icon
* @param array $attributes html attributes
* @return pix_icon
*/
public function get_icon($alt, array $attributes = null) {
return new pix_icon('icon', $alt, 'mod_'.$this->module, $attributes);
}
}
@@ -202,4 +202,15 @@ class completion_criteria_date extends completion_criteria {
return $details;
}
/**
* Return pix_icon for display in reports.
*
* @param string $alt The alt text to use for the icon
* @param array $attributes html attributes
* @return pix_icon
*/
public function get_icon($alt, array $attributes = null) {
return new pix_icon('i/calendar', $alt, 'moodle', $attributes);
}
}
@@ -248,4 +248,15 @@ class completion_criteria_grade extends completion_criteria {
return $details;
}
/**
* Return pix_icon for display in reports.
*
* @param string $alt The alt text to use for the icon
* @param array $attributes html attributes
* @return pix_icon
*/
public function get_icon($alt, array $attributes = null) {
return new pix_icon('i/grades', $alt, 'moodle', $attributes);
}
}
@@ -149,4 +149,15 @@ class completion_criteria_self extends completion_criteria {
return $details;
}
/**
* Return pix_icon for display in reports.
*
* @param string $alt The alt text to use for the icon
* @param array $attributes html attributes
* @return pix_icon
*/
public function get_icon($alt, array $attributes = null) {
return new pix_icon('i/completion_self', $alt, 'moodle', $attributes);
}
}
@@ -131,4 +131,15 @@ class completion_criteria_unenrol extends completion_criteria {
$details['status'] = '';
return $details;
}
/**
* Return pix_icon for display in reports.
*
* @param string $alt The alt text to use for the icon
* @param array $attributes html attributes
* @return pix_icon
*/
public function get_icon($alt, array $attributes = null) {
return new pix_icon('i/user', $alt, 'moodle', $attributes);
}
}
@@ -122,4 +122,40 @@ class behat_completion extends behat_base {
new Given('I press "'.get_string('savechangesanddisplay').'"')
);
}
/**
* Checks if the activity with specified name is maked as complete.
*
* @Given /^the "(?P<activityname_string>(?:[^"]|\\")*)" "(?P<activitytype_string>(?:[^"]|\\")*)" activity with "(manual|auto)" completion should be marked as complete$/
* @return array
*/
public function activity_marked_as_complete($activityname, $activitytype, $completiontype) {
if ($completiontype == "manual") {
$imgalttext = get_string("completion-alt-manual-y", 'core_completion', $activityname);
} else {
$imgalttext = get_string("completion-alt-auto-y", 'core_completion', $activityname);
}
$csselementforactivitytype = "li.modtype_".strtolower($activitytype);
return new Given('"//img[contains(@alt, \''.$imgalttext.'\')]" "xpath_element" ' .
'should exist in the "'.$csselementforactivitytype.'" "css_element"');
}
/**
* Checks if the activity with specified name is maked as complete.
*
* @Given /^the "(?P<activityname_string>(?:[^"]|\\")*)" "(?P<activitytype_string>(?:[^"]|\\")*)" activity with "(manual|auto)" completion should be marked as not complete$/
* @return array
*/
public function activity_marked_as_not_complete($activityname, $activitytype, $completiontype) {
if ($completiontype == "manual") {
$imgalttext = get_string("completion-alt-manual-n", 'core_completion', $activityname);
} else {
$imgalttext = get_string("completion-alt-auto-n", 'core_completion', $activityname);
}
$csselementforactivitytype = "li.modtype_".strtolower($activitytype);
return new Given('"//img[contains(@alt, \''.$imgalttext.'\')]" "xpath_element" ' .
'should exist in the "'.$csselementforactivitytype.'" "css_element"');
}
}
@@ -74,10 +74,10 @@ Feature: Restrict sections availability through completion or grade conditions
And I expand all fieldsets
And I click on "Add restriction..." "button"
And I click on "Grade" "button" in the "Add restriction..." "dialogue"
And I click on "min" "checkbox"
And I set the following fields to these values:
| id | Grade assignment |
| minval | 20 |
| id | Grade assignment |
| min | 1 |
| minval | 20 |
And I press "Save changes"
And I log out
When I log in as "student1"
@@ -41,12 +41,9 @@ Feature: Allow teachers to manually mark users as complete when configured
And I follow "View course report"
And I should see "Student First"
And I follow "Click to mark user complete"
# Running cron just after clicking sometimes fail, so navigate back
# and ensure the student completion is updated before running cron.
And I am on site homepage
And I follow "Completion course"
And I follow "View course report"
And "//img[contains(@alt, 'Completed')]" "xpath_element" should exist in the "student1" "table_row"
# Running cron just after clicking sometimes fail, as record
# should be created before the cron runs.
And I wait "1" seconds
And I trigger cron
And I am on site homepage
And I log out
+1 -1
View File
@@ -8,6 +8,6 @@
"require-dev": {
"phpunit/phpunit": "3.7.*",
"phpunit/dbUnit": "1.2.*",
"moodlehq/behat-extension": "1.29.5"
"moodlehq/behat-extension": "1.29.7"
}
}
Generated
+58 -57
View File
@@ -4,7 +4,8 @@
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file",
"This file is @generated automatically"
],
"hash": "e57a3c4f1934098d77de54215b059ba1",
"hash": "fce02b5a02caca2fa2580c06c00a3aae",
"content-hash": "f53746369a68b1323a9a37a6d0737307",
"packages": [],
"packages-dev": [
{
@@ -405,16 +406,16 @@
},
{
"name": "doctrine/annotations",
"version": "v1.2.4",
"version": "v1.2.7",
"source": {
"type": "git",
"url": "https://github.com/doctrine/annotations.git",
"reference": "b5202eb9e83f8db52e0e58867e0a46e63be8332e"
"reference": "f25c8aab83e0c3e976fd7d19875f198ccf2f7535"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/doctrine/annotations/zipball/b5202eb9e83f8db52e0e58867e0a46e63be8332e",
"reference": "b5202eb9e83f8db52e0e58867e0a46e63be8332e",
"url": "https://api.github.com/repos/doctrine/annotations/zipball/f25c8aab83e0c3e976fd7d19875f198ccf2f7535",
"reference": "f25c8aab83e0c3e976fd7d19875f198ccf2f7535",
"shasum": ""
},
"require": {
@@ -469,20 +470,20 @@
"docblock",
"parser"
],
"time": "2014-12-23 22:40:37"
"time": "2015-08-31 12:32:49"
},
{
"name": "doctrine/cache",
"version": "v1.4.1",
"version": "v1.5.4",
"source": {
"type": "git",
"url": "https://github.com/doctrine/cache.git",
"reference": "c9eadeb743ac6199f7eec423cb9426bc518b7b03"
"reference": "47cdc76ceb95cc591d9c79a36dc3794975b5d136"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/doctrine/cache/zipball/c9eadeb743ac6199f7eec423cb9426bc518b7b03",
"reference": "c9eadeb743ac6199f7eec423cb9426bc518b7b03",
"url": "https://api.github.com/repos/doctrine/cache/zipball/47cdc76ceb95cc591d9c79a36dc3794975b5d136",
"reference": "47cdc76ceb95cc591d9c79a36dc3794975b5d136",
"shasum": ""
},
"require": {
@@ -503,8 +504,8 @@
}
},
"autoload": {
"psr-0": {
"Doctrine\\Common\\Cache\\": "lib/"
"psr-4": {
"Doctrine\\Common\\Cache\\": "lib/Doctrine/Common/Cache"
}
},
"notification-url": "https://packagist.org/downloads/",
@@ -539,7 +540,7 @@
"cache",
"caching"
],
"time": "2015-04-15 00:11:59"
"time": "2015-12-19 05:03:47"
},
{
"name": "doctrine/collections",
@@ -682,16 +683,16 @@
},
{
"name": "doctrine/inflector",
"version": "v1.0.1",
"version": "v1.1.0",
"source": {
"type": "git",
"url": "https://github.com/doctrine/inflector.git",
"reference": "0bcb2e79d8571787f18b7eb036ed3d004908e604"
"reference": "90b2128806bfde671b6952ab8bea493942c1fdae"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/doctrine/inflector/zipball/0bcb2e79d8571787f18b7eb036ed3d004908e604",
"reference": "0bcb2e79d8571787f18b7eb036ed3d004908e604",
"url": "https://api.github.com/repos/doctrine/inflector/zipball/90b2128806bfde671b6952ab8bea493942c1fdae",
"reference": "90b2128806bfde671b6952ab8bea493942c1fdae",
"shasum": ""
},
"require": {
@@ -703,7 +704,7 @@
"type": "library",
"extra": {
"branch-alias": {
"dev-master": "1.0.x-dev"
"dev-master": "1.1.x-dev"
}
},
"autoload": {
@@ -745,7 +746,7 @@
"singularize",
"string"
],
"time": "2014-12-20 21:24:13"
"time": "2015-11-06 14:35:42"
},
{
"name": "doctrine/lexer",
@@ -1009,16 +1010,16 @@
},
{
"name": "moodlehq/behat-extension",
"version": "v1.29.5",
"version": "v1.29.7",
"source": {
"type": "git",
"url": "https://github.com/moodlehq/moodle-behat-extension.git",
"reference": "0ea55a59bfbfef4e8dcf47067c56779e5a02cd63"
"reference": "be645f6c345cc71cc0fb20e438a20c25791ccae4"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/moodlehq/moodle-behat-extension/zipball/0ea55a59bfbfef4e8dcf47067c56779e5a02cd63",
"reference": "0ea55a59bfbfef4e8dcf47067c56779e5a02cd63",
"url": "https://api.github.com/repos/moodlehq/moodle-behat-extension/zipball/be645f6c345cc71cc0fb20e438a20c25791ccae4",
"reference": "be645f6c345cc71cc0fb20e438a20c25791ccae4",
"shasum": ""
},
"require": {
@@ -1027,6 +1028,8 @@
"behat/mink-extension": "1.2.0",
"behat/mink-goutte-driver": "1.0.9",
"behat/mink-selenium2-driver": "1.1.1",
"doctrine/cache": "1.5.4",
"doctrine/common": "2.5.0",
"guzzlehttp/guzzle": "~3.1",
"php": ">=5.4.4",
"symfony/symfony": "2.4.10"
@@ -1055,9 +1058,9 @@
"Moodle"
],
"support": {
"source": "https://github.com/moodlehq/moodle-behat-extension/tree/v1.29.5"
"source": "https://github.com/moodlehq/moodle-behat-extension/tree/v1.29.7"
},
"time": "2015-05-15 02:00:06"
"time": "2016-01-08 05:29:02"
},
{
"name": "phpunit/dbunit",
@@ -1180,16 +1183,16 @@
},
{
"name": "phpunit/php-file-iterator",
"version": "1.4.0",
"version": "1.4.1",
"source": {
"type": "git",
"url": "https://github.com/sebastianbergmann/php-file-iterator.git",
"reference": "a923bb15680d0089e2316f7a4af8f437046e96bb"
"reference": "6150bf2c35d3fc379e50c7602b75caceaa39dbf0"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/sebastianbergmann/php-file-iterator/zipball/a923bb15680d0089e2316f7a4af8f437046e96bb",
"reference": "a923bb15680d0089e2316f7a4af8f437046e96bb",
"url": "https://api.github.com/repos/sebastianbergmann/php-file-iterator/zipball/6150bf2c35d3fc379e50c7602b75caceaa39dbf0",
"reference": "6150bf2c35d3fc379e50c7602b75caceaa39dbf0",
"shasum": ""
},
"require": {
@@ -1223,20 +1226,20 @@
"filesystem",
"iterator"
],
"time": "2015-04-02 05:19:05"
"time": "2015-06-21 13:08:43"
},
{
"name": "phpunit/php-text-template",
"version": "1.2.0",
"version": "1.2.1",
"source": {
"type": "git",
"url": "https://github.com/sebastianbergmann/php-text-template.git",
"reference": "206dfefc0ffe9cebf65c413e3d0e809c82fbf00a"
"reference": "31f8b717e51d9a2afca6c9f046f5d69fc27c8686"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/sebastianbergmann/php-text-template/zipball/206dfefc0ffe9cebf65c413e3d0e809c82fbf00a",
"reference": "206dfefc0ffe9cebf65c413e3d0e809c82fbf00a",
"url": "https://api.github.com/repos/sebastianbergmann/php-text-template/zipball/31f8b717e51d9a2afca6c9f046f5d69fc27c8686",
"reference": "31f8b717e51d9a2afca6c9f046f5d69fc27c8686",
"shasum": ""
},
"require": {
@@ -1245,20 +1248,17 @@
"type": "library",
"autoload": {
"classmap": [
"Text/"
"src/"
]
},
"notification-url": "https://packagist.org/downloads/",
"include-path": [
""
],
"license": [
"BSD-3-Clause"
],
"authors": [
{
"name": "Sebastian Bergmann",
"email": "sb@sebastian-bergmann.de",
"email": "sebastian@phpunit.de",
"role": "lead"
}
],
@@ -1267,20 +1267,20 @@
"keywords": [
"template"
],
"time": "2014-01-30 17:20:04"
"time": "2015-06-21 13:50:34"
},
{
"name": "phpunit/php-timer",
"version": "1.0.5",
"version": "1.0.7",
"source": {
"type": "git",
"url": "https://github.com/sebastianbergmann/php-timer.git",
"reference": "19689d4354b295ee3d8c54b4f42c3efb69cbc17c"
"reference": "3e82f4e9fc92665fafd9157568e4dcb01d014e5b"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/sebastianbergmann/php-timer/zipball/19689d4354b295ee3d8c54b4f42c3efb69cbc17c",
"reference": "19689d4354b295ee3d8c54b4f42c3efb69cbc17c",
"url": "https://api.github.com/repos/sebastianbergmann/php-timer/zipball/3e82f4e9fc92665fafd9157568e4dcb01d014e5b",
"reference": "3e82f4e9fc92665fafd9157568e4dcb01d014e5b",
"shasum": ""
},
"require": {
@@ -1289,13 +1289,10 @@
"type": "library",
"autoload": {
"classmap": [
"PHP/"
"src/"
]
},
"notification-url": "https://packagist.org/downloads/",
"include-path": [
""
],
"license": [
"BSD-3-Clause"
],
@@ -1311,7 +1308,7 @@
"keywords": [
"timer"
],
"time": "2013-08-02 07:42:54"
"time": "2015-06-21 08:01:12"
},
{
"name": "phpunit/php-token-stream",
@@ -1529,12 +1526,12 @@
"target-dir": "Symfony/Component/Icu",
"source": {
"type": "git",
"url": "https://github.com/symfony/Icu.git",
"url": "https://github.com/symfony/icu.git",
"reference": "d4d85d6055b87f394d941b45ddd3a9173e1e3d2a"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/symfony/Icu/zipball/d4d85d6055b87f394d941b45ddd3a9173e1e3d2a",
"url": "https://api.github.com/repos/symfony/icu/zipball/d4d85d6055b87f394d941b45ddd3a9173e1e3d2a",
"reference": "d4d85d6055b87f394d941b45ddd3a9173e1e3d2a",
"shasum": ""
},
@@ -1687,25 +1684,29 @@
},
{
"name": "twig/twig",
"version": "v1.18.1",
"version": "v1.23.1",
"source": {
"type": "git",
"url": "https://github.com/twigphp/Twig.git",
"reference": "9f70492f44398e276d1b81c1b43adfe6751c7b7f"
"reference": "d9b6333ae8dd2c8e3fd256e127548def0bc614c6"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/twigphp/Twig/zipball/9f70492f44398e276d1b81c1b43adfe6751c7b7f",
"reference": "9f70492f44398e276d1b81c1b43adfe6751c7b7f",
"url": "https://api.github.com/repos/twigphp/Twig/zipball/d9b6333ae8dd2c8e3fd256e127548def0bc614c6",
"reference": "d9b6333ae8dd2c8e3fd256e127548def0bc614c6",
"shasum": ""
},
"require": {
"php": ">=5.2.7"
},
"require-dev": {
"symfony/debug": "~2.7",
"symfony/phpunit-bridge": "~2.7"
},
"type": "library",
"extra": {
"branch-alias": {
"dev-master": "1.18-dev"
"dev-master": "1.23-dev"
}
},
"autoload": {
@@ -1740,7 +1741,7 @@
"keywords": [
"templating"
],
"time": "2015-04-19 08:30:27"
"time": "2015-11-05 12:49:06"
}
],
"aliases": [],
+1 -1
View File
@@ -1130,7 +1130,7 @@ class core_course_management_renderer extends plugin_renderer_base {
$totalpages = ceil($totalcourses / $perpage);
if ($showtotals) {
if ($totalpages == 0) {
$str = get_string('nocoursesfound', 'moodle', $search);
$str = get_string('nocoursesfound', 'moodle', s($search));
} else if ($totalpages == 1) {
$str = get_string('showingacourses', 'moodle', $totalcourses);
} else {
+3 -2
View File
@@ -76,11 +76,12 @@ $strdeletecoursecheck = get_string("deletecoursecheck");
$message = "{$strdeletecoursecheck}<br /><br />{$coursefullname} ({$courseshortname})";
$continueurl = new moodle_url('/course/delete.php', array('id' => $course->id, 'delete' => md5($course->timemodified)));
$continuebutton = new single_button($continueurl, get_string('delete'), 'post');
$PAGE->navbar->add($strdeletecheck);
$PAGE->set_title("$SITE->shortname: $strdeletecheck");
$PAGE->set_heading($SITE->fullname);
echo $OUTPUT->header();
echo $OUTPUT->confirm($message, $continueurl, $categoryurl);
echo $OUTPUT->confirm($message, $continuebutton, $categoryurl);
echo $OUTPUT->footer();
exit;
exit;
+1 -1
View File
@@ -66,7 +66,7 @@ if ($deletesection) {
echo $OUTPUT->box_start('noticebox');
$optionsyes = array('id' => $id, 'confirm' => 1, 'delete' => 1, 'sesskey' => sesskey());
$deleteurl = new moodle_url('/course/editsection.php', $optionsyes);
$formcontinue = new single_button($deleteurl, get_string('continue'));
$formcontinue = new single_button($deleteurl, get_string('delete'));
$formcancel = new single_button($cancelurl, get_string('cancel'), 'get');
echo $OUTPUT->confirm(get_string('confirmdeletesection', '',
get_section_name($course, $sectioninfo)), $formcontinue, $formcancel);
@@ -23,6 +23,7 @@ Background:
And I press "Post to forum"
And I wait to be redirected
And I follow "Course 1"
And I wait "1" seconds
And I press "Add a new discussion topic"
And I set the following fields to these values:
| Subject | Forum Post 9 |
@@ -30,6 +31,7 @@ Background:
And I press "Post to forum"
And I wait to be redirected
And I follow "Course 1"
And I wait "1" seconds
And I press "Add a new discussion topic"
And I set the following fields to these values:
| Subject | Forum Post 8 |
@@ -37,6 +39,7 @@ Background:
And I press "Post to forum"
And I wait to be redirected
And I follow "Course 1"
And I wait "1" seconds
And I press "Add a new discussion topic"
And I set the following fields to these values:
| Subject | Forum Post 7 |
@@ -44,6 +47,7 @@ Background:
And I press "Post to forum"
And I wait to be redirected
And I follow "Course 1"
And I wait "1" seconds
And I press "Add a new discussion topic"
And I set the following fields to these values:
| Subject | Forum Post 6 |
@@ -51,6 +55,7 @@ Background:
And I press "Post to forum"
And I wait to be redirected
And I follow "Course 1"
And I wait "1" seconds
And I press "Add a new discussion topic"
And I set the following fields to these values:
| Subject | Forum Post 5 |
@@ -58,6 +63,7 @@ Background:
And I press "Post to forum"
And I wait to be redirected
And I follow "Course 1"
And I wait "1" seconds
And I press "Add a new discussion topic"
And I set the following fields to these values:
| Subject | Forum Post 4 |
@@ -65,6 +71,7 @@ Background:
And I press "Post to forum"
And I wait to be redirected
And I follow "Course 1"
And I wait "1" seconds
And I press "Add a new discussion topic"
And I set the following fields to these values:
| Subject | Forum Post 3 |
@@ -72,6 +79,7 @@ Background:
And I press "Post to forum"
And I wait to be redirected
And I follow "Course 1"
And I wait "1" seconds
And I press "Add a new discussion topic"
And I set the following fields to these values:
| Subject | Forum Post 2 |
@@ -79,6 +87,7 @@ Background:
And I press "Post to forum"
And I wait to be redirected
And I follow "Course 1"
And I wait "1" seconds
And I press "Add a new discussion topic"
And I set the following fields to these values:
| Subject | Forum Post 1 |
@@ -43,7 +43,7 @@ Feature: Sections can be edited and deleted in topics format
Scenario: Deleting the last section in topics format
When I click on "Delete topic" "link" in the "li#section-5" "css_element"
Then I should see "Are you absolutely sure you want to completely delete \"Topic 5\" and all the activities it contains?"
And I press "Continue"
And I press "Delete"
And I should not see "Topic 5"
And I navigate to "Edit settings" node in "Course administration"
And I expand all fieldsets
@@ -51,7 +51,7 @@ Feature: Sections can be edited and deleted in topics format
Scenario: Deleting the middle section in topics format
When I click on "Delete topic" "link" in the "li#section-4" "css_element"
And I press "Continue"
And I press "Delete"
Then I should not see "Topic 5"
And I should not see "Test chat name"
And I should see "Test choice name" in the "li#section-4" "css_element"
@@ -63,7 +63,7 @@ Feature: Sections can be edited and deleted in topics format
When I follow "Reduce the number of sections"
Then I should see "Orphaned activities (section 5)" in the "li#section-5" "css_element"
And I click on "Delete topic" "link" in the "li#section-5" "css_element"
And I press "Continue"
And I press "Delete"
And I should not see "Topic 5"
And I should not see "Orphaned activities"
And "li#section-5" "css_element" should not exist
@@ -77,7 +77,7 @@ Feature: Sections can be edited and deleted in topics format
And "li#section-5.orphaned" "css_element" should exist
And "li#section-4.orphaned" "css_element" should not exist
And I click on "Delete topic" "link" in the "li#section-1" "css_element"
And I press "Continue"
And I press "Delete"
And I should not see "Test book name"
And I should see "Orphaned activities (section 4)" in the "li#section-4" "css_element"
And "li#section-5" "css_element" should not exist
@@ -45,7 +45,7 @@ Feature: Sections can be edited and deleted in weeks format
Given I should see "29 May - 4 June" in the "li#section-5" "css_element"
When I click on "Delete week" "link" in the "li#section-5" "css_element"
Then I should see "Are you absolutely sure you want to completely delete \"29 May - 4 June\" and all the activities it contains?"
And I press "Continue"
And I press "Delete"
And I should not see "29 May - 4 June"
And I navigate to "Edit settings" node in "Course administration"
And I expand all fieldsets
@@ -54,7 +54,7 @@ Feature: Sections can be edited and deleted in weeks format
Scenario: Deleting the middle section in weeks format
Given I should see "29 May - 4 June" in the "li#section-5" "css_element"
When I click on "Delete week" "link" in the "li#section-4" "css_element"
And I press "Continue"
And I press "Delete"
Then I should not see "29 May - 4 June"
And I should not see "Test chat name"
And I should see "Test choice name" in the "li#section-4" "css_element"
@@ -66,7 +66,7 @@ Feature: Sections can be edited and deleted in weeks format
When I follow "Reduce the number of sections"
Then I should see "Orphaned activities (section 5)" in the "li#section-5" "css_element"
And I click on "Delete week" "link" in the "li#section-5" "css_element"
And I press "Continue"
And I press "Delete"
And I should not see "29 May - 4 June"
And I should not see "Orphaned activities"
And "li#section-5" "css_element" should not exist
@@ -80,7 +80,7 @@ Feature: Sections can be edited and deleted in weeks format
And "li#section-5.orphaned" "css_element" should exist
And "li#section-4.orphaned" "css_element" should not exist
And I click on "Delete week" "link" in the "li#section-1" "css_element"
And I press "Continue"
And I press "Delete"
And I should not see "Test book name"
And I should see "Orphaned activities (section 4)" in the "li#section-4" "css_element"
And "li#section-5" "css_element" should not exist
+3 -2
View File
@@ -106,7 +106,8 @@ if (!empty($add)) {
$optionsyes = array('confirm'=>1, 'delete'=>$cm->id, 'sesskey'=>sesskey(), 'sr' => $sectionreturn);
$strdeletecheck = get_string('deletecheck', '', $fullmodulename);
$strdeletecheckfull = get_string('deletecheckfull', '', "$fullmodulename '$cm->name'");
$strparams = (object)array('type' => $fullmodulename, 'name' => $cm->name);
$strdeletechecktypename = get_string('deletechecktypename', '', $strparams);
$PAGE->set_pagetype('mod-' . $cm->modname . '-delete');
$PAGE->set_title($strdeletecheck);
@@ -117,7 +118,7 @@ if (!empty($add)) {
echo $OUTPUT->box_start('noticebox');
$formcontinue = new single_button(new moodle_url("$CFG->wwwroot/course/mod.php", $optionsyes), get_string('yes'));
$formcancel = new single_button($return, get_string('no'), 'get');
echo $OUTPUT->confirm($strdeletecheckfull, $formcontinue, $formcancel);
echo $OUTPUT->confirm($strdeletechecktypename, $formcontinue, $formcancel);
echo $OUTPUT->box_end();
echo $OUTPUT->footer();
+4 -5
View File
@@ -187,15 +187,14 @@ if (!empty($add)) {
if ($items = grade_item::fetch_all(array('itemtype'=>'mod', 'itemmodule'=>$data->modulename,
'iteminstance'=>$data->instance, 'courseid'=>$course->id))) {
// add existing outcomes
// Add existing outcomes.
foreach ($items as $item) {
if (!empty($item->gradepass)) {
if (!empty($item->outcomeid)) {
$data->{'outcome_' . $item->outcomeid} = 1;
} else if (!empty($item->gradepass)) {
$decimalpoints = $item->get_decimals();
$data->gradepass = format_float($item->gradepass, $decimalpoints);
}
if (!empty($item->outcomeid)) {
$data->{'outcome_'.$item->outcomeid} = 1;
}
}
// set category if present
+1 -1
View File
@@ -212,7 +212,7 @@ if (!empty($activities)) {
echo $OUTPUT->spacer(array('height'=>30, 'br'=>true)); // should be done with CSS instead
}
echo $OUTPUT->box_start();
if (!empty($activity->name)) {
if (strval($activity->name) !== '') {
echo html_writer::tag('h2', $activity->name);
}
$inbox = true;
+1 -1
View File
@@ -173,7 +173,7 @@ switch($requestmethod) {
$module->name = clean_param($title, PARAM_CLEANHTML);
}
if (!empty($module->name)) {
if (strval($module->name) !== '') {
$DB->update_record($cm->modname, $module);
$cm->name = $module->name;
\core\event\course_module_updated::create_from_cm($cm, $modcontext)->trigger();
@@ -54,7 +54,7 @@ Feature: Test we can both create and delete a course.
# Redirect
And I should see "Delete TCCAC"
And I should see "Test course: create a course (TCCAC)"
And I press "Continue"
And I press "Delete"
# Redirect
And I should see "Deleting TCCAC"
And I should see "TCCAC has been completely deleted"
@@ -93,7 +93,7 @@ Feature: Test we can both create and delete a course.
# Redirect
And I should see "Delete TCCAC"
And I should see "Test course: create a course (TCCAC)"
And I press "Continue"
And I press "Delete"
# Redirect
And I should see "Deleting TCCAC"
And I should see "TCCAC has been completely deleted"
+31
View File
@@ -0,0 +1,31 @@
@core @core_course
Feature: Rename roles in a course
In order to account for course-level differences
As a teacher
I need to be able to rename roles
Background:
Given the following "users" exist:
| username | firstname | lastname | email |
| student1 | Student | 1 | student1@example.com |
| teacher1 | Teacher | 1 | teacher1@example.com |
And the following "courses" exist:
| fullname | shortname |
| Course 1 | C1 |
And the following "course enrolments" exist:
| user | course | role |
| student1 | C1 | student |
| teacher1 | C1 | editingteacher |
Scenario: Teacher can rename roles
Given I log in as "teacher1"
And I follow "Course 1"
And I click on "Edit settings" "link" in the "Administration" "block"
And I should see "Role renaming"
When I set the following fields to these values:
| Your word for 'Teacher' | Lecturer |
| Your word for 'Student' | Learner |
And I press "Save and display"
And I navigate to "Enrolled users" node in "Course administration > Users"
Then I should see "Lecturer" in the "Teacher 1" "table_row"
And I should see "Learner" in the "Student 1" "table_row"
@@ -688,6 +688,8 @@ Y.extend(RESOURCETOOLBOX, TOOLBOX, {
newtitlestr = M.util.get_string('clicktochangeinbrackets', 'moodle', M.util.get_string(newtitle, 'moodle'));
// Change the UI
var oldAction = button.getData('action');
button.replaceClass('editing_' + oldAction, 'editing_' + newtitle);
buttonimg.setAttrs({
'src': iconsrc
});
File diff suppressed because one or more lines are too long
@@ -688,6 +688,8 @@ Y.extend(RESOURCETOOLBOX, TOOLBOX, {
newtitlestr = M.util.get_string('clicktochangeinbrackets', 'moodle', M.util.get_string(newtitle, 'moodle'));
// Change the UI
var oldAction = button.getData('action');
button.replaceClass('editing_' + oldAction, 'editing_' + newtitle);
buttonimg.setAttrs({
'src': iconsrc
});
+2
View File
@@ -484,6 +484,8 @@ Y.extend(RESOURCETOOLBOX, TOOLBOX, {
newtitlestr = M.util.get_string('clicktochangeinbrackets', 'moodle', M.util.get_string(newtitle, 'moodle'));
// Change the UI
var oldAction = button.getData('action');
button.replaceClass('editing_' + oldAction, 'editing_' + newtitle);
buttonimg.setAttrs({
'src': iconsrc
});
+2 -2
View File
@@ -264,9 +264,9 @@ class enrol_database_plugin extends enrol_plugin {
FROM {enrol} e
JOIN {course} c ON c.id = e.courseid
JOIN {role_assignments} ra ON ra.itemid = e.id
LEFT JOIN {user_enrolments} ue ON ue.enrolid = e.id
LEFT JOIN {user_enrolments} ue ON ue.enrolid = e.id AND ue.userid = ra.userid
WHERE ra.userid = :userid AND e.enrol = 'database'";
$rs = $DB->get_recordset_sql($sql, array('userid'=>$user->id));
$rs = $DB->get_recordset_sql($sql, array('userid' => $user->id));
foreach ($rs as $instance) {
if (!$instance->cvisible and $ignorehidden) {
continue;
+38 -9
View File
@@ -378,7 +378,10 @@ class core_enrol_external extends external_api {
)
), 'Option names:
* withcapability (string) return only users with this capability. This option requires \'moodle/role:review\' on the course context.
* groupid (integer) return only users in this group id. This option requires \'moodle/site:accessallgroups\' on the course context.
* groupid (integer) return only users in this group id. If the course has groups enabled and this param
isn\'t defined, returns all the viewable users.
This option requires \'moodle/site:accessallgroups\' on the course context if the
user doesn\'t belong to the group.
* onlyactive (integer) return only users with active enrolments and matching time restrictions. This option requires \'moodle/course:enrolreview\' on the course context.
* userfields (\'string, string, ...\') return only the values of these user fields.
* limitfrom (integer) sql limit from.
@@ -466,7 +469,7 @@ class core_enrol_external extends external_api {
require_capability('moodle/role:review', $coursecontext);
}
// need accessallgroups capability if you want to overwrite this option
if (!empty($groupid) && groups_is_member($groupid)) {
if (!empty($groupid) && !groups_is_member($groupid)) {
require_capability('moodle/site:accessallgroups', $coursecontext);
}
// to overwrite this option, you need course:enrolereview permission
@@ -478,10 +481,29 @@ class core_enrol_external extends external_api {
$ctxselect = ', ' . context_helper::get_preload_record_columns_sql('ctx');
$ctxjoin = "LEFT JOIN {context} ctx ON (ctx.instanceid = u.id AND ctx.contextlevel = :contextlevel)";
$enrolledparams['contextlevel'] = CONTEXT_USER;
$sql = "SELECT u.* $ctxselect
FROM {user} u $ctxjoin
WHERE u.id IN ($enrolledsql)
ORDER BY u.id ASC";
$groupjoin = '';
if (empty($groupid) && groups_get_course_groupmode($course) == SEPARATEGROUPS &&
!has_capability('moodle/site:accessallgroups', $coursecontext)) {
// Filter by groups the user can view.
$usergroups = groups_get_user_groups($course->id);
if (!empty($usergroups['0'])) {
list($groupsql, $groupparams) = $DB->get_in_or_equal($usergroups['0'], SQL_PARAMS_NAMED);
$groupjoin = "JOIN {groups_members} gm ON (u.id = gm.userid AND gm.groupid $groupsql)";
$enrolledparams = array_merge($enrolledparams, $groupparams);
} else {
// User doesn't belong to any group, so he can't see any user. Return an empty array.
return array();
}
}
$sql = "SELECT us.*
FROM {user} us
JOIN (
SELECT DISTINCT u.id $ctxselect
FROM {user} u $ctxjoin $groupjoin
WHERE u.id IN ($enrolledsql)
) q ON q.id = us.id
ORDER BY us.id ASC";
$enrolledusers = $DB->get_recordset_sql($sql, $enrolledparams, $limitfrom, $limitnumber);
$users = array();
foreach ($enrolledusers as $user) {
@@ -596,14 +618,21 @@ class core_enrol_external extends external_api {
*
* @param int $courseid
* @return array of course enrolment methods
* @throws moodle_exception
*/
public static function get_course_enrolment_methods($courseid) {
global $DB;
$params = self::validate_parameters(self::get_course_enrolment_methods_parameters(), array('courseid' => $courseid));
$coursecontext = context_course::instance($params['courseid']);
$categorycontext = $coursecontext->get_parent_context();
self::validate_context($categorycontext);
// Note that we can't use validate_context because the user is not enrolled in the course.
require_login(null, false, null, false, true);
$course = $DB->get_record('course', array('id' => $params['courseid']), '*', MUST_EXIST);
$context = context_course::instance($course->id);
if (!$course->visible and !has_capability('moodle/course:viewhiddencourses', $context)) {
throw new moodle_exception('coursehidden');
}
$result = array();
$enrolinstances = enrol_get_instances($params['courseid'], true);
+1 -1
View File
@@ -446,7 +446,7 @@ class enrol_flatfile_plugin extends enrol_plugin {
$notify = false;
if ($ue = $DB->get_record('user_enrolments', array('enrolid'=>$instance->id, 'userid'=>$user->id))) {
// Update only.
$this->update_user_enrol($instance, $user->id, ENROL_USER_ACTIVE, $roleid, $timestart, $timeend);
$this->update_user_enrol($instance, $user->id, ENROL_USER_ACTIVE, $timestart, $timeend);
if (!$DB->record_exists('role_assignments', array('contextid'=>$context->id, 'roleid'=>$roleid, 'userid'=>$user->id, 'component'=>'enrol_flatfile', 'itemid'=>$instance->id))) {
role_assign($roleid, $user->id, $context->id, 'enrol_flatfile', $instance->id);
}

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