Compare commits

..

598 Commits

Author SHA1 Message Date
Eloy Lafuente (stronk7) 1f2979d0e5 Moodle release 2.8.7 2015-07-03 13:38:19 +02:00
Eloy Lafuente (stronk7) 385cd9ee23 Merge branch 'MDL-50757-28' of git://github.com/damyon/moodle into MOODLE_28_STABLE 2015-07-03 11:27:58 +02:00
Damyon Wiese 3d517153fa MDL-50757 upgrade: Unset config value that will never be used again 2015-07-03 16:48:37 +08:00
Adrian Greeve 1d19128f68 MDL-50757 gradebook: Update fix for pre 2.8 upgrades.
Moodle installations that updated before the 2.8 grade push
were being flagged for a gradebook freeze. This was resulting in
calculated grades being shown as different to how they were
displayed before the upgrade. This fix retains the original
grade value.
2015-07-03 13:20:06 +08:00
Dan Poltawski c0ba953afc weekly release 2.8.6+ 2015-07-02 14:26:02 +01:00
Dan Poltawski 67d1edca87 Merge branch 'install_28_STABLE' of https://git.in.moodle.com/amosbot/moodle-install into MOODLE_28_STABLE 2015-07-02 14:25:59 +01:00
Marina Glancy b930e2005c MDL-48239 grades: corrected docs url for calculation changes 2015-07-02 15:50:24 +08:00
Marina Glancy 0c89600969 MDL-48239 grades: fix notification class 2015-07-02 15:50:22 +08:00
Adrian Greeve 801964cabb MDL-48239 gradebook: Oracle fix for string compare.
Update to upgradelib.php where string comparisions cause
phpunit failures in Oracle.
2015-07-02 12:30:40 +08:00
Eloy Lafuente (stronk7) 3a4cd8db0f Merge branch 'wip-MDL-48239-28' of git://github.com/abgreeve/moodle into MOODLE_28_STABLE 2015-07-02 05:42:39 +02:00
Adrian Greeve 1a9f295e47 MDL-48239 gradebook: Change to calculated grade item min and max.
Regardless of the setting 'Min and max grades used in calculation'
Calculated grade items will always update the min and max raw grade.
2015-07-02 11:30:49 +08:00
Adrian Greeve 2adc935709 MDL-48239 gradebook: Unit test for upgrade function. 2015-07-02 11:30:49 +08:00
Adrian Greeve 98c04f38cd MDL-48239 gradebook: Behat tests for calculated grade items. 2015-07-02 11:30:48 +08:00
Adrian Greeve 02bc1d3b88 MDL-48239 gradebook: Calculated grades maxgrade now able to be set. 2015-07-02 11:30:48 +08:00
Rajesh Taneja 0996a2966c MDL-50481 behat: SingleSelect can be urlselect and should support id/name 2015-07-01 11:23:39 +08:00
David Monllao c556c5fca5 Merge branch 'MDL-50497-M28' of git://github.com/lazydaisy/moodle into MOODLE_28_STABLE
Conflicts:
	theme/bootstrapbase/style/moodle.css
2015-07-01 08:57:15 +08:00
Juan Leyva 7b15a36320 MDL-50130 users: Filter profile fields data in external functions 2015-06-30 19:51:20 +02:00
AMOS bot c0ce8e7ae5 Automatically generated installer lang files 2015-07-01 00:05:01 +08:00
Dan Poltawski 4f46506fdb Merge branch 'wip-mdl-50481-m28' of https://github.com/rajeshtaneja/moodle into MOODLE_28_STABLE 2015-06-30 12:25:54 +02:00
Dan Poltawski 2f5e10392c Merge branch 'MDL-33765_m28_offset' of git://github.com/markn86/moodle into MOODLE_28_STABLE 2015-06-30 12:20:09 +02:00
Dan Poltawski bc65073a61 Merge branch 'MDL-47787-m28' of https://github.com/tbannister/moodle into MOODLE_28_STABLE 2015-06-30 10:24:49 +02:00
David Monllao 41b330abe1 MDL-50569 backup: Missing get_target call 2015-06-30 10:33:44 +08:00
Dan Marsden d942f0311c MDL-50614 mod_scorm: Improve validation on currentorg 2015-06-30 10:14:33 +08:00
David Monllao 419f4c47e4 Merge branch 'MDL-50569-28' of git://github.com/FMCorz/moodle into MOODLE_28_STABLE 2015-06-30 09:33:20 +08:00
Eloy Lafuente (stronk7) 1777d32cb2 Merge branch 'wip-mdl-50675-m28' of https://github.com/rajeshtaneja/moodle into MOODLE_28_STABLE 2015-06-29 18:33:26 +02:00
Eloy Lafuente (stronk7) a8753fb85a MDL-50688 lib: small cleanup + http/https coverage. 2015-06-29 17:50:04 +02:00
Petr Skoda 980bd08bdc MDL-50688 lib: fix local url validation bug
Change-Id: I350bb8c9ace5cc0403f083f728c100097be7aa7e
Reviewed-on: https://review.totaralms.com/8101
Tested-by: Jenkins Automation <jenkins@totaralms.com>
Reviewed-by: Sam Hemelryk <sam.hemelryk@totaralms.com>
Reviewed-by: Alastair Munro <alastair.munro@totaralms.com>
2015-06-29 17:50:00 +02:00
Nadav Kavalerchik 3a8b5c11d2 MDL-50708 SCORM: Right align menu item folder icon, when in RTL mode. 2015-06-29 15:58:22 +08:00
Frederic Massart 3423321b32 MDL-50569 grades: Restore as merge always ignores minmaxtouse 2015-06-29 14:28:02 +08:00
Frederic Massart 7610449b02 MDL-50569 grades: Handle minmaxtouse in backup/restore 2015-06-29 14:28:02 +08:00
David Monllao 142d17da19 Merge branch 'MDL-50652_28' of git://github.com/reskit/moodle into MOODLE_28_STABLE 2015-06-29 13:02:56 +08:00
Mark Nelson 67e6cefa41 MDL-33765 filter_glossary: fixed jshint warning 2015-06-28 22:01:56 -07:00
Martin Mastny 025e0130c9 MDL-33765 filter_glossary: Stacking JS windows with offset 2015-06-28 21:16:29 -07:00
Martin Mastny 5a0a0a4d7e MDL-33765 mod_glossary: Concept in ajax request not linking to itself 2015-06-28 21:16:19 -07:00
David Monllao 860a35db66 Merge branch 'wip_MDL-50659_m28' of git://github.com/gjb2048/moodle into MOODLE_28_STABLE 2015-06-29 11:48:43 +08:00
Rajesh Taneja 82d0bd3246 MDL-50675 repository_wikimedia: Fixed title varaible 2015-06-29 09:57:36 +08:00
Rajesh Taneja ae7f9ead0e MDL-50675 repository_wikimedia: Wikimedia is using https and not http 2015-06-29 09:57:36 +08:00
Mary Evans 5856c76917 MDL-50497 theme_bootstrapbase: Divider colours look wrong when inverted 2015-06-26 23:10:03 +01:00
Gareth J Barnard 777a4a2d2e MDL-50659 themes: Regression: Drag a link makes icons move. 2015-06-26 11:46:20 +01:00
Tyler Bannister d45b318a5d MDL-47787 course: Added question delete to cm delete. 2015-06-25 16:36:50 -04:00
Marc Català f81f6bbda5 MDL-50652 workshop: Workshop module allows duplicated ID number 2015-06-25 14:26:10 +02:00
Marina Glancy 40c3419184 MDL-49257 grades: apply freeze when restoring with contents deleting 2015-06-25 14:40:06 +08:00
David Monllao 47cbd1b42d weekly release 2.8.6+ 2015-06-25 13:50:06 +08:00
David Monllao 3fc06c5776 Merge branch 'install_28_STABLE' of https://git.in.moodle.com/amosbot/moodle-install into MOODLE_28_STABLE 2015-06-25 13:50:04 +08:00
Rajesh Taneja 6d55d3b4f8 MDL-50481 core_grades: Fixed behat feature and step to work with non-js
xPath used in step is not using proper oring
and fails with goutee driver. Also, feature don't
really need to be executed in js, so setting that
as non-js
2015-06-25 13:15:14 +08:00
Rajesh Taneja c74f4582c2 MDL-50481 behat: Press go button for given single select in non-js
For non-js mode, ensure we press the go button
for the specified single select, as there can be
multiple single selects on the page with go button
2015-06-25 13:15:14 +08:00
Marina Glancy 05fde3409f MDL-49257 grades: strings adjustments 2015-06-25 10:00:23 +08:00
Eloy Lafuente (stronk7) aa79c57c1e MDL-49022 auth_ldap: keep method visibility unmodified. 2015-06-24 03:04:59 +02:00
Eloy Lafuente (stronk7) fb124fc068 Merge branch 'wip-mdl-49022-m28' of https://github.com/rajeshtaneja/moodle into MOODLE_28_STABLE 2015-06-24 03:03:18 +02:00
Eloy Lafuente (stronk7) 17d14ff177 MDL-49497 curl: keep api private and test it using reflection.
While strictly we should not be testing private APIs, in order
to get this backported to stables without changing visibility
we use reflection to access to such private properties and methods.

Also added one exttest to verify user agent is properly sent.

Finally, fix some wrong whitespace and changed the helper class name
to better alternative.
2015-06-23 16:25:59 +01:00
Dan Poltawski 54659b0a06 Merge branch 'MDL-49497-28' of git://github.com/gurgus/moodle into MOODLE_28_STABLE 2015-06-23 16:25:43 +01:00
Dan Poltawski dc129d0b68 Merge branch 'wip-MDL-49257-m28' of git://github.com/marinaglancy/moodle into MOODLE_28_STABLE 2015-06-23 11:20:30 +01:00
Rajesh Taneja 7a26c7b0c3 MDL-49022 auth_ldap: Updated unit test, checking sync_user events 2015-06-23 17:05:38 +08:00
Mark Ward e7199f8944 MDL-49022 auth_ldap: trigger event when required.
When calling update_user_record() for auth_ldap the method
now has option to trigger event core\event\user_updated when
syncing with domain controller.
This means that the event will be triggered by sync_users()
but not by user_signup().
2015-06-23 17:05:38 +08:00
Marina Glancy 567f1c3c4c MDL-49257 grades: behat tests for extra credit 2015-06-23 14:25:27 +08:00
Marina Glancy e48f0ef106 MDL-49257 grades: fix bugs with extra credit weights
When we adjust the weights in natural grading (setup screen), the extra credit items
should not depend on other overrides. If extra credit item's weight was overriden, it stays as it is.
Otherwise it is calculated as itemgrademax / totalgrademax (total excludes extra credit items)
2015-06-23 14:25:27 +08:00
Marina Glancy 4a84177457 MDL-49257 grades: introduce calculation freeze
In order to prevent changes in the existing grades when we fix bugs
we are introducing the gradebook code versioning. Each course may
"freeze" the code version to the older date. Freezing is usually done
during upgrade or restore and can be removed by the teacher by pressing
the button and accepting potential grade changes. There is no visible
setting and not possible to change the version back manually.

See MDL-50432 and MDL-50522
2015-06-23 14:25:24 +08:00
David Monllao cd7544d403 MDL-50611 testing: Extra http status code checking 2015-06-23 10:37:00 +08:00
David Monllao 0691b264e2 Merge branch 'MDL-50611-28' of git://github.com/LukeCarrier/moodle into MOODLE_28_STABLE 2015-06-23 10:30:33 +08:00
Eloy Lafuente (stronk7) 0b2c4cf27d Merge branch 'MDL-50089-28' of git://github.com/merrill-oakland/moodle into MOODLE_28_STABLE 2015-06-22 19:59:24 +02:00
Eloy Lafuente (stronk7) a4f64284aa Merge branch 'MDL-50583_28' of git://github.com/dmonllao/moodle into MOODLE_28_STABLE 2015-06-22 19:22:58 +02:00
Eric Merrill b60e213341 MDL-50089 grades: Use grade item min/max in exports 2015-06-22 12:59:36 -04:00
Luke Carrier 2af7590d98 MDL-50611 test: use cURL extension to download Composer
The curl binary is nowhere near as common in Windows environments as it is
in Linux and Mac ones. In order to encourage more users to adopt Behat and
PHPUnit for their testing, we should avoid introducing unnecessary
hurdles.
2015-06-22 15:53:26 +01:00
Dan Poltawski 8ce0acb5de Merge branch 'MDL-50091_28' of git://github.com/timhunt/moodle into MOODLE_28_STABLE 2015-06-22 12:06:53 +01:00
David Monllao ad02c3adf0 Merge branch 'MDL-50622-28-enfix' of git://github.com/mudrd8mz/moodle into MOODLE_28_STABLE 2015-06-22 17:45:02 +08:00
Helen Foster d1d1d24396 MDL-50622 lang: Merge English strings from the en_fix language pack 2015-06-22 11:42:29 +02:00
David Monllao 8972c8627d Merge branch 'wip-MDL-50568-m28' of git://github.com/marinaglancy/moodle into MOODLE_28_STABLE 2015-06-22 15:33:59 +08:00
Tim Hunt ce4d2810a0 MDL-50648 grader report: columns misaligned with some permissions
If a user can see the grader report and singleview report, but not
the user report ($CFG->grade_profilereport) then the colspans
were wrong and so the columns did not line up under the right headers.
2015-06-19 12:41:31 +01:00
AMOS bot 965fcec3a1 Automatically generated installer lang files 2015-06-19 00:04:14 +08:00
Dan Poltawski 89273142e2 weekly release 2.8.6+ 2015-06-18 14:03:06 +01:00
Dan Poltawski 2e8d88fe22 Merge branch 'install_28_STABLE' of https://git.in.moodle.com/amosbot/moodle-install into MOODLE_28_STABLE 2015-06-18 14:03:04 +01:00
Tim Hunt 8e3f31debe MDL-50091 grade singleview: use standard API to build the link
Acutally the necessary code was already there. There was just some
unnecessary code that was added with the issue number MDL-47746. I have
just stripped out the unused code, which fixes the bug where a missing
activity caused a fatal error.
2015-06-17 13:56:41 +01:00
Eloy Lafuente (stronk7) 23e1349810 Merge branch 'MDL-50004-M28' of git://github.com/lazydaisy/moodle into MOODLE_28_STABLE 2015-06-17 01:01:28 +02:00
Eloy Lafuente (stronk7) abf8b970be Merge branch 'MDL-50107-28' of git://github.com/jleyva/moodle into MOODLE_28_STABLE 2015-06-17 00:16:51 +02:00
AMOS bot b13273c21f Automatically generated installer lang files 2015-06-17 00:04:08 +08:00
AMOS bot 7871b634b2 Automatically generated installer lang files 2015-06-17 00:04:08 +08:00
Dan Poltawski eb98d24713 Merge branch 'MDL-49959_course_dnd_message_MDL28' of https://github.com/barrysspace/moodle into MOODLE_28_STABLE 2015-06-16 13:07:19 +01:00
Martin Mastny 3e8064b84a MDL-49744 JavaScript: Glossary term window is draggable 2015-06-16 10:20:23 +01:00
Andrew Nicols c1b716ed30 Merge branch 'wip-MDL-50216-28' of git://github.com/abgreeve/moodle into MOODLE_28_STABLE 2015-06-16 12:22:59 +08:00
Martin Mastny 3e0a9b33d9 MDL-50216 JavaScript: Default visibility of M.core.info set to false
Conflicts:
	lib/yui/build/moodle-core-notification-dialogue/moodle-core-notification-dialogue-min.js
2015-06-16 11:35:55 +08:00
Andrew Nicols 7c4c64d821 MDL-39353 xmlrpc: Add note to upgrde.txt regarding proxybypass 2015-06-16 11:35:31 +08:00
Andrew Nicols 62a20889ef Merge branch 'MDL-39353-28' of https://github.com/rtcn2/moodle into MOODLE_28_STABLE 2015-06-16 11:34:57 +08:00
Andrew Nicols ca37641c24 Merge branch 'MDL-50380-28' of git://github.com/lameze/moodle into MOODLE_28_STABLE 2015-06-16 07:58:42 +08:00
Dan Poltawski 90e175670a Merge branch 'MDL-49368_28' of git://github.com/timhunt/moodle into MOODLE_28_STABLE 2015-06-15 12:33:31 +01:00
Andrew Nicols 9b7d060c5e Merge branch 'MDL-50459-28' of git://github.com/jleyva/moodle into MOODLE_28_STABLE 2015-06-15 16:04:56 +08:00
Juan Leyva 346cd40859 MDL-50459 messages: Handle deleted users in external functions 2015-06-15 09:57:51 +02:00
Andrew Nicols 81de8dc4c1 Merge branch 'wip-MDL-50222-m28' of git://github.com/marinaglancy/moodle into MOODLE_28_STABLE 2015-06-15 15:17:57 +08:00
GeekSmith d932630feb MDL-50583 upgrade: Optimize upgrade_minmaxgrade
Reverse join order to use existing database keys. Changed query to use the
more easily read NOT IN.
2015-06-15 10:41:37 +08:00
Andrew Nicols c7828a7e89 Merge branch 'MDL-50438-28' of git://github.com/mastnym/moodle into MOODLE_28_STABLE 2015-06-15 10:21:53 +08:00
Andrew Nicols 499c254bd9 Merge branch 'MDL-50509-28-vartypo' of git://github.com/mudrd8mz/moodle into MOODLE_28_STABLE 2015-06-15 09:59:45 +08:00
Andrew Nicols b349a501bf MDL-50554 themes: Rebuild of bootstrapbase 2015-06-15 09:47:12 +08:00
Mary Evans 088528038c MDL-50004 theme: Fixes frontpage coursename and enrolment icons.
Conflicts:

	theme/bootstrapbase/style/moodle.css
2015-06-15 00:27:31 +01:00
Gareth J Barnard 8e78b057a3 MDL-50554 themes: Drag a link move mouse makes icons move in Chrome. 2015-06-14 21:49:11 +01:00
Dan Poltawski 49ec7f8b7a weekly release 2.8.6+ 2015-06-12 10:24:40 +01:00
Dan Poltawski 327132f929 Merge branch 'MDL-48618_28-test-calculated' of git://github.com/dmonllao/moodle into MOODLE_28_STABLE 2015-06-12 10:19:41 +01:00
Eloy Lafuente (stronk7) c69966dc7b MDL-50176 repository_youtube: delay loading google service stuff
Loading Google client services is a little monster, eating around
2MB (opcache enabled) of memory. As far as we instantiate the
repository instances really early, no matter they are not used
later (editor, file picker, admin...).. we are delaying the
load of the service until we know we are going to use it.

Surely applying this very same (sort of lazy load) techinque
to other repositories could lead to a nice memory reduction
in lots of pages.

MDL-50176 repository_youtube: also delay the inclusion of client.

While memory was fixed with previous commit, still some extra included
files where being reported, so go crazy and move all the stuff to
the new init delayed method.
2015-06-12 10:31:50 +02:00
David Monllao 40765660a8 MDL-48618 grades: Testing calculated items with minmaxtouse 2015-06-12 14:31:29 +08:00
Marina Glancy e5871c89f5 MDL-50568 navigation: correct cap check 2015-06-12 10:46:09 +08:00
Frederic Massart 623ecdaddb MDL-48618 grades: Do not run minmax upgrade for fresh installs 2015-06-11 17:16:52 +08:00
Rajesh Taneja 4facd41f67 MDL-49659 theme_clean: Add login info in the nav bar 2015-06-11 10:00:36 +01:00
David Monllao 8dac9b29d4 MDL-48618 upgrade: Matching conditions and upgrade savepoints 2015-06-11 15:04:15 +08:00
David Monllao bf8ebd6d96 Merge branch 'MDL-48618-28' of git://github.com/FMCorz/moodle into MOODLE_28_STABLE 2015-06-11 14:23:22 +08:00
Juan Leyva 13513264fa MDL-50107 webservices: Enable CORS in login/token.php 2015-06-10 11:34:24 +02:00
Rod Norfor 3b6d698f51 MDL-39353 xmlrpc: Add proxy support 2015-06-10 08:20:48 +01:00
Frederic Massart 965271de64 MDL-48618 grades: Test for the minmax upgrade step 2015-06-10 12:53:07 +08:00
Frederic Massart 4c796650e6 MDL-48618 grades: Behat tests to cover min/max grade changes
The values provided as part of this test are similar to values
that can be found in 2.7. This is to ensure that users will not
experience changes in grades.
2015-06-10 12:53:07 +08:00
Frederic Massart eff9e9ddea MDL-48618 grades: Unit tests for grade_grade::get_min/max_grade() 2015-06-10 12:53:07 +08:00
Frederic Massart 7907689825 MDL-48618 grades: Handling of inconsistencies due to min/max grades 2015-06-10 12:52:43 +08:00
Eric Merrill 582d2448b5 MDL-48618 gradebook: Only use individual min/max for aggrigate grades 2015-06-10 12:44:55 +08:00
Eloy Lafuente (stronk7) b0d06e3c2c Merge branch 'MDL-47480-28' of git://github.com/ankitagarwal/moodle into MOODLE_28_STABLE 2015-06-10 00:33:28 +02:00
Eloy Lafuente (stronk7) 6d29831de6 Merge branch 'm28_MDL-50415_Add_PHP_Variables_In_PHPInfo_Admin_Page' of https://github.com/scara/moodle into MOODLE_28_STABLE 2015-06-09 20:37:36 +02:00
Eloy Lafuente (stronk7) bbef2dc030 Merge branch 'MDL-50176_28' of git://github.com/aolley/moodle into MOODLE_28_STABLE 2015-06-09 20:14:16 +02:00
Dan Poltawski aeae977eed Merge branch 'MDL-43731-28_STABLE' of https://github.com/ramdesh/moodle into MOODLE_28_STABLE 2015-06-09 14:57:02 +01:00
Dan Poltawski 5b5635628f Merge branch 'MDL-49659_M28' of git://github.com/lazydaisy/moodle into MOODLE_28_STABLE 2015-06-09 14:42:05 +01:00
Marina Glancy adc2d84d49 MDL-50222 admin: do not use deprecated print_textarea() 2015-06-09 20:59:09 +08:00
Dan Poltawski bbfc652b71 Merge branch 'MDL-49885_course_overview_block2_28' of https://github.com/andyjdavis/moodle into MOODLE_28_STABLE 2015-06-09 13:57:25 +01:00
Martin Mastny d89a43f195 MDL-50186 forms: Removed special characters from id attribute 2015-06-09 13:33:03 +01:00
Adam Olley 9e44b9e55d MDL-50176 repository_youtube: Switch to using YouTube Data API
As of April 20, 2015, the old API used by repository_youtube is no longer
accessible. This change switches over to using the standard Google Data
API v3.

Unfortunately this means that to search YouTube, a developer api key is now
*required*.

Special thanks to UNSW for sponsoring this work.
2015-06-09 09:48:22 +09:30
David Mudrák 1d19a5eb47 MDL-50509 datalib: Fix the typo in the variable name
The line is supposed to sanitize the function parameter.
2015-06-08 11:18:02 +02:00
Dave Cooper 3b6b8abc57 MDL-49497 curl: Add configurable User-Agent unit tests. 2015-06-08 17:03:41 +08:00
Dave Cooper 4193196b8f MDL-49497 curl: Allow configurable User-Agent.
Thanks to Kartik Yadav for assistance with this patch.
2015-06-08 17:02:50 +08:00
Barry Oosthuizen cbb3c3e0b9 MDL-49959 course: Fix hidden drag and drop message 2015-06-08 09:33:51 +01:00
Andrew Davis 933a5e26cc MDL-49885 core_blocks: fixed course_overview block applicable_formats() 2015-06-08 06:40:05 +08:00
Mary Evans b451b66b40 MDL-49659 theme: Removed home link and limited login info in secure.php
Credits: Thanks go to Andreas Hruska [https://github.com/ahruska] for the original patch for this issue.
2015-06-04 17:50:38 +01:00
Eloy Lafuente (stronk7) 570bcd8274 weekly release 2.8.6+ 2015-06-04 12:09:07 +02:00
Eloy Lafuente (stronk7) a777a3f222 Merge branch 'install_28_STABLE' of https://git.in.moodle.com/amosbot/moodle-install into MOODLE_28_STABLE 2015-06-04 12:09:01 +02:00
Rajesh Taneja 5a0a9c8e73 MDL-47995 lib: encode title properly, before additing it to image title 2015-06-04 12:56:30 +08:00
Matteo Scaramuccia fd4ae15898 MDL-50415 Admin: added the PHP Variables section in the PHPinfo page. 2015-06-03 21:23:46 +02:00
Eloy Lafuente (stronk7) c2a0ce47db Merge branch 'MDL-47995-28' of git://github.com/lameze/moodle into MOODLE_28_STABLE 2015-06-03 11:11:35 +02:00
Simey Lameze 29010702b2 MDL-50380 mod_wiki: fix missing parameter on wiki edit files page
Also fixing a typo on the $referer variable.
2015-06-03 16:46:06 +08:00
Dan Poltawski 31aa2496d1 Merge branch 'MDL-49323-28' of git://github.com/nmoller/moodle into MOODLE_28_STABLE 2015-06-02 13:23:31 +01:00
Martin Mastny 029972ac7c MDL-50438 filter_glossary: Added missing exception classes 2015-06-02 16:31:50 +08:00
Dan Poltawski 8c37f8667e Merge branch 'MDL-46927_m28' of git://github.com/markn86/moodle into MOODLE_28_STABLE 2015-06-02 09:03:54 +01:00
Mark Nelson fee1d071bd MDL-46927 core_files: fixed issue with system course restores
When clicking on 'Restore' next to a file in the 'Course
backup area' in the system context the message 'Sorry,
the requested file could not be found' was displayed.
This fix adds missing functionality to the class
'file_info_context_system' so that the file information
is correctly returned.
2015-06-01 23:09:23 -07:00
Ankit Agarwal 6dbe2aaacb MDL-47480 tasks: Define order for getting tasks 2015-06-02 08:18:13 +05:30
AMOS bot 2562ce63d4 Automatically generated installer lang files 2015-06-02 00:04:20 +08:00
Nelson Moller 615d97944e MDL-49323 mod_assign: Fixed numeric validation in grade form.
The behat test for another decimal separator was incorporated.
2015-06-01 11:03:19 -04:00
Dan Poltawski 413288345c Merge branch 'MDL-50341_28' of git://github.com/timhunt/moodle into MOODLE_28_STABLE 2015-06-01 15:03:47 +01:00
Dan Poltawski 6e09b240bf MDL-50322 forum: add basic split post behat coverage
Also bump version for autoloading new class.
2015-06-01 15:00:01 +01:00
Dan Poltawski 2fef7540f1 Merge branch 'MDL-50322-28' of git://github.com/mastnym/moodle into MOODLE_28_STABLE 2015-06-01 14:55:32 +01:00
Dan Poltawski d0be17a749 Merge branch 'MDL-50304_28' of https://github.com/jinhofer/moodle into MOODLE_28_STABLE 2015-06-01 13:21:57 +01:00
Dan Poltawski c71949dc53 MDL-50406 less: built. 2015-06-01 11:56:51 +01:00
Dan Poltawski cd20ea8b95 Merge branch 'MDL-50406_M28' of git://github.com/nadavkav/moodle into MOODLE_28_STABLE 2015-06-01 11:42:25 +01:00
Dan Poltawski bc1a1aaf32 Merge branch 'MDL-49707-28' of git://github.com/ankitagarwal/moodle into MOODLE_28_STABLE 2015-06-01 10:22:03 +01:00
Ankit Agarwal 51208a3c32 MDL-49707 inbound: localpart should be < 15 2015-06-01 10:10:09 +05:30
Tim Hunt 01b3b79a94 MDL-50341 quiz statistics: non-attempted questions broke first-try stats
For behaviours that allow multiple tries, and when the teacher had chosen to
generate statistics for the first tries only, and when a student had not
attempted one question, then an error occurred. It should have been classified
as no response.
2015-05-31 13:54:38 +01:00
Nadav Kavalerchik 50885a5b23 MDL-50406 Messages: Right align messages menu box, in RTL mode. 2015-05-30 12:22:39 +03:00
AMOS bot 9d759a8b9e Automatically generated installer lang files 2015-05-30 00:04:09 +08:00
Martin Mastny 183c8315d9 MDL-50322 mod_forum: Added validation when spliting discussions 2015-05-29 09:15:19 +08:00
AMOS bot 9c9f81b9e7 Automatically generated installer lang files 2015-05-29 00:04:03 +08:00
jinhofer fb06f2a87c MDL-50304 atto/plugins/table: Fixed _addRowAfter function 2015-05-28 07:54:17 -05:00
David Monllao 14d2791057 weekly release 2.8.6+ 2015-05-28 10:55:03 +08:00
David Monllao 66296d8f06 Merge branch 'install_28_STABLE' of https://git.in.moodle.com/amosbot/moodle-install into MOODLE_28_STABLE 2015-05-28 10:55:01 +08:00
Eloy Lafuente (stronk7) 6992979404 Merge branch 'wip-mdl-49806-m28' of https://github.com/rajeshtaneja/moodle into MOODLE_28_STABLE 2015-05-27 12:52:10 +02:00
David Monllao 537361c5e4 Merge branch 'MDL-50340-28' of git://github.com/ankitagarwal/moodle into MOODLE_28_STABLE 2015-05-27 11:59:00 +08:00
Rajesh Taneja f6fa9b4997 MDL-49806 behat: Ensure user is marked complete before runnning cron 2015-05-27 09:27:20 +08:00
David Monllao 330930ae62 MDL-49611 completion: Update dangling err_nocriteria lang strings
Credit to Aaron Barnes.
2015-05-27 08:52:59 +08:00
Eloy Lafuente (stronk7) 02ee1effbd Merge branch 'wip-MDL-50191-m28' of https://github.com/marinaglancy/moodle into MOODLE_28_STABLE 2015-05-26 18:20:00 +02:00
AMOS bot aa0a762aa4 Automatically generated installer lang files 2015-05-27 00:03:54 +08:00
Dan Poltawski b6e389b74a Merge branch 'MDL-50318-28-courseresources' of git://github.com/mudrd8mz/moodle into MOODLE_28_STABLE 2015-05-26 13:05:08 +01:00
Dan Poltawski d4f82690a5 Merge branch 'MDL-49787_email_attachments_symlink_fix_28' of https://github.com/iamandrew/moodle into MOODLE_28_STABLE 2015-05-26 12:56:32 +01:00
Dan Poltawski 744c5a5bb8 Merge branch 'MDL-49776-28' of git://github.com/lameze/moodle into MOODLE_28_STABLE 2015-05-26 11:53:56 +01:00
Dan Poltawski 4ef0f57dbc Merge branch 'MDL-49560-28' of git://github.com/gurgus/moodle into MOODLE_28_STABLE 2015-05-26 11:33:47 +01:00
Dan Poltawski d88c3438c5 Merge branch 'MDL-50271-28' of git://github.com/jleyva/moodle into MOODLE_28_STABLE 2015-05-26 11:31:54 +01:00
David Monllao 8ff5016cef Merge branch 'MDL-50344-28' of git://github.com/ankitagarwal/moodle into MOODLE_28_STABLE 2015-05-26 17:29:56 +08:00
David Monllao 2efaa63376 Merge branch 'MDL-48664-28' of git://github.com/jethac/moodle into MOODLE_28_STABLE 2015-05-26 14:46:24 +08:00
Ankit Agarwal 1a7bdd06d7 MDL-50340 adminstration: Fix restore course links 2015-05-26 12:04:13 +05:30
David Monllao d35759ae7d Merge branch 'MDL-46550-28' of git://github.com/ankitagarwal/moodle into MOODLE_28_STABLE 2015-05-26 12:29:36 +08:00
Ankit Agarwal 4cd93d2596 MDL-50315 behat: I am on site homepage behat step 2015-05-26 12:19:58 +08:00
Jetha Chan f678a6eec0 MDL-48664 output: change paging_bar to not use non-breaking spaces 2015-05-26 12:14:07 +08:00
Dan Poltawski 077eaa11a1 Merge branch 'MDL-50313-28-featureidnumber' of git://github.com/mudrd8mz/moodle into MOODLE_28_STABLE 2015-05-25 13:54:08 +01:00
Dan Poltawski a56d0af3f6 Merge branch 'MDL-40592_M28' of https://github.com/nadavkav/moodle into MOODLE_28_STABLE 2015-05-25 12:28:40 +01:00
Dan Poltawski c237de3747 Merge branch 'MDL-49493-28' of git://github.com/mastnym/moodle into MOODLE_28_STABLE 2015-05-25 12:02:16 +01:00
David Monllao 59c638dc00 Merge branch 'wip-MDL-49572-m28' of git://github.com/marinaglancy/moodle into MOODLE_28_STABLE 2015-05-25 17:54:59 +08:00
Marina Glancy 421f72704e MDL-49560 webservice: avoid recursion in soap
Thanks to El Leonidych for providing a patch
2015-05-25 16:01:25 +08:00
Ankit Agarwal e49a94cd14 MDL-50344 restore: Make restore file required 2015-05-25 12:08:26 +05:30
spvickers 0444eedad7 MDL-49776 mod_lti: Set parameter in privacy check
Moved sending of the lis_result_sourcedid parameter to within the block
which checks that grades are being accepted for the link.
2015-05-25 13:03:08 +08:00
iclearn 127b75e161 MDL-47995 mod_url: add proper title encoding on url mod 2015-05-25 12:55:40 +08:00
iclearn 42a3d7709d MDL-47995 mod_resource: properly encode resource title 2015-05-25 12:55:40 +08:00
Martin Mastny 69a1435d46 MDL-49493 backup: Implemented missing methods for anonymous backup 2015-05-25 10:41:49 +08:00
AMOS bot 892dba30c6 Automatically generated installer lang files 2015-05-23 00:04:08 +08:00
Juan Leyva caf3cb78e5 MDL-50271 webservices: Allow to load multiple themes in WS_SERVER mode 2015-05-22 13:27:06 +02:00
Damien Bezborodov 811f699514 MDL-50285 gradereport_user: Grade categories calculate wrong with suspended users (Student's view) 2015-05-22 17:53:07 +09:30
Nadav Kavalerchik 851bc55bde MDL-40592 assign/grading: Display default user picture, if none is set. 2015-05-22 10:37:23 +03:00
Tim Hunt 6f1b265a2b MDL-49368 qtypes match & multichice: cope with editing after attempt
Teachers should not radically edit a question after it has been
attempted. However, if they do, we should handle it gracefully, rather
than triggering PHP errors.
2015-05-21 18:17:45 +01:00
AMOS bot 1736fc82fa Automatically generated installer lang files 2015-05-22 00:03:54 +08:00
David Mudrák 2daaae15ea MDL-50318 course: Fix the URL of embedded images at resources overview
Not only mod_resource instances are listed here. All modules that
declare their FEATURE_MOD_ARCHETYPE as MOD_ARCHETYPE_RESOURCE (well, all
but those without own view page, such as mod_label) are listed. So we
must use the real plugin name when rendering the intro field.
2015-05-21 17:18:05 +02:00
David Mudrák 5157d7e013 MDL-50313 docs: Fix the documentation for the FEATURE_IDNUMBER constant
The constant is used by course/moodleform_mod.php to decide whether the
field 'ID number' (cmidnumber) should be included in the common module
settings section of the activity settings form. Activity modules that do
not use grades (such as the Label) can explicitly return false when
checking for this feature support. By default, all activity modules are
supposed to support it.
2015-05-21 16:50:15 +02:00
Eloy Lafuente (stronk7) 08d1c32b45 weekly release 2.8.6+ 2015-05-21 12:37:20 +02:00
Marina Glancy a5dcc1b90f MDL-50191 cohorts: check manage cap to display hide icon 2015-05-21 12:19:38 +08:00
Marina Glancy 4b74b4791f MDL-49572 cache: correctly purge cache on event 2015-05-20 14:06:43 +08:00
Rajesh Taneja 5a554e9746 MDL-49061 behat: Fixed input name to use full activity name 2015-05-20 10:19:10 +08:00
Eloy Lafuente (stronk7) 6c05d34bf4 Merge branch 'wip-mdl-50259-m28' of https://github.com/rajeshtaneja/moodle into MOODLE_28_STABLE 2015-05-19 18:02:51 +02:00
Eloy Lafuente (stronk7) f790a5d1e4 Merge branch 'MDL-50275-28' of git://github.com/danpoltawski/moodle into MOODLE_28_STABLE 2015-05-19 17:46:03 +02:00
Dan Poltawski 9cc1cf5808 Merge branch 'MDL-49680_m28' of https://github.com/markn86/moodle into MOODLE_28_STABLE 2015-05-19 16:36:41 +01:00
Dan Poltawski cf14d5d951 MDL-50275 quiz: version bump for MDL-49941
Otherwise the new capability risk does not get loaded
2015-05-19 15:41:25 +01:00
Dan Poltawski 39baf6a0e2 Merge branch 'wip-MDL-49061-m28' of https://github.com/marinaglancy/moodle into MOODLE_28_STABLE 2015-05-19 15:00:53 +01:00
Dan Poltawski ed1b321918 Merge branch 'wip-mdl-50203-m28' of https://github.com/rajeshtaneja/moodle into MOODLE_28_STABLE 2015-05-19 12:39:00 +01:00
Rajesh Taneja 5dcbbcc117 MDL-50259 behat: Use strict activity name checking
contains might select wrong activity
so using strict activity text checking
2015-05-19 14:48:29 +08:00
Mark Nelson 8ee8195650 MDL-49680 core_question: added ability to order questions by dates
Backport of MDL-25721.
2015-05-18 19:06:09 -07:00
Skylar Kelty f8e680ca11 MDL-50169: Fix grade report SQL logic 2015-05-19 02:04:11 +02:00
Eloy Lafuente (stronk7) a942187816 Merge branch 'MDL-50280_28' of https://github.com/sk-unikent/moodle into MOODLE_28_STABLE 2015-05-19 01:43:21 +02:00
Eloy Lafuente (stronk7) fdcf4144dc Merge branch 'MDL-48467-28' of git://github.com/merrill-oakland/moodle into MOODLE_28_STABLE 2015-05-19 01:33:14 +02:00
Eloy Lafuente (stronk7) da8ee816a7 Merge branch 'MDL-50197_28' of git://github.com/timhunt/moodle into MOODLE_28_STABLE 2015-05-19 00:35:47 +02:00
Eloy Lafuente (stronk7) 3c68e824d7 Merge branch 'MDL-50245_28' of git://github.com/timhunt/moodle into MOODLE_28_STABLE 2015-05-19 00:33:25 +02:00
Skylar Kelty 9d472d7319 MDL-50280 WebCT import scripts don't always clean up 2015-05-18 16:49:27 +01:00
Dan Poltawski f53c8c2a02 Merge branch 'MDL-49764_28' of https://github.com/jinhofer/moodle into MOODLE_28_STABLE 2015-05-18 15:29:02 +01:00
Dan Poltawski f324728737 Merge branch 'MDL-50092_28' of git://github.com/dmonllao/moodle into MOODLE_28_STABLE 2015-05-18 13:59:50 +01:00
jinhofer ecf17cfd73 MDL-49764 grade/report/grader: Fixed height issue for IE 2015-05-18 07:48:14 -05:00
Dan Poltawski e8b9d60c27 Merge branch 'MDL-50177_28' of git://github.com/dmonllao/moodle into MOODLE_28_STABLE 2015-05-18 13:01:48 +01:00
Andrew Davidson 4ee8f04bef MDL-49787 email: Updated email attachement path check to use realpath() in order to allow for symlinked temp directories 2015-05-18 12:04:50 +01:00
Ankit Agarwal b3b4c00d5b MDL-46550 logs: Fix incorrect url
Thanks to Nadav Kavalerchik for the suggestion on patch
2015-05-18 12:02:36 +05:30
Adrian Greeve cfa002f6ee MDL-49742 lib: Removed additional names on tables for sorting.
When additional names are disabled, they are no longer shown as
sortable headings in the enrolment and admin user tables.
2015-05-15 15:33:52 +08:00
Tim Hunt e5636f9aa4 MDL-50245 quiz: fix CSS of search options in the qbank dialogue 2015-05-14 14:41:22 +01:00
David Monllao 18202cbed7 weekly release 2.8.6+ 2015-05-14 11:34:27 +08:00
Rajesh Taneja bb4bc850f4 MDL-50203 behat: Click on link in student 1 row 2015-05-13 15:23:40 +08:00
Marina Glancy 5f7d350f72 MDL-49061 reports: call format_string on activities names 2015-05-13 12:18:31 +08:00
David Monllao 7ce3c31e12 Merge branch 'MDL-25138-28' of git://github.com/lameze/moodle into MOODLE_28_STABLE 2015-05-13 10:26:00 +08:00
Damyon Wiese e9f173e2d4 MDL-25138 core_tags: remove duplicated related tags 2015-05-12 13:07:01 +08:00
Simey Lameze 916ac383ef MDL-25138 core_tag: fix correlated tags query unique error 2015-05-12 13:07:00 +08:00
David Monllao d1d546a0c4 MDL-50177 completion: Also accepting cm integer strings 2015-05-12 12:21:55 +08:00
David Monllao b26f0f688f Merge branch 'MDL-34102_28' of git://github.com/jmvedrine/moodle into MOODLE_28_STABLE 2015-05-12 12:12:50 +08:00
Tim Hunt bcda2f3745 MDL-50197 quiz editing: fix dialogue titles at the end of the quiz 2015-05-11 16:22:16 +01:00
David Monllao d11eec562a MDL-50092 enrol_imsenterprise: Fixing wrong field name
Thanks to JD for the fix.
2015-05-11 14:55:15 +08:00
Eloy Lafuente (stronk7) dc7b914677 Moodle release 2.8.6 2015-05-10 11:39:22 +02:00
Eloy Lafuente (stronk7) 8f018d49ac weekly release 2.8.5+ 2015-05-08 12:14:47 +02:00
Eloy Lafuente (stronk7) 5a71a6b7e5 Merge branch 'install_28_STABLE' of https://git.in.moodle.com/amosbot/moodle-install into MOODLE_28_STABLE 2015-05-08 12:14:30 +02:00
Andrew Nicols 0fee379892 MDL-50153 messageinbound: Normalise line endings instead of rtrim 2015-05-08 16:20:44 +08:00
Andrew Nicols 51483fe057 Merge branch 'wip-mdl-50154-m28' of https://github.com/rajeshtaneja/moodle into MOODLE_28_STABLE 2015-05-08 13:42:17 +08:00
Rajesh Taneja cb2cf4a6a7 MDL-50154 behat: Click on Grades link under navigation 2015-05-08 13:08:38 +08:00
Rajesh Taneja b9acc1422a MDL-50154 behat: Resize pdf window so toolbar is always visible 2015-05-08 13:08:13 +08:00
Andrew Nicols 2ca3c8ad0d MDL-50153 messageinbound: Make messageinbound tests dos-safe 2015-05-08 12:17:21 +08:00
Andrew Nicols c1108ed7fc MDL-50153 core: Use directory_separator when autoloading psr0 classes 2015-05-08 12:17:20 +08:00
Ramindu Deshapriya c408fe813c MDL-43731 mod_book: Added Behat test to automate MDLQA-1791 2015-05-08 00:43:42 +05:30
Adrian Greeve b3ec0280ea MDL-50039 tool_monitor: Behat update to fix error.
The teacher does not have the option to select Site
level rules so this section has been removed.
2015-05-07 13:13:21 +08:00
Adrian Greeve ac6f7b18be MDL-50039 tool_monitor: Additional checks for subscription.
Additional capability checks are now in place to stop unauthorised
users from accessing the event monitor subscription page.
2015-05-07 13:13:21 +08:00
Frederic Massart c3bec9f51e MDL-50128 mod_data: String needed escaping before being used in regex 2015-05-07 11:21:09 +08:00
Andrew Nicols d186a97e10 Merge branch 'm28_MDL-50133' of https://github.com/danmarsden/moodle into MOODLE_28_STABLE 2015-05-07 10:25:18 +08:00
Andrew Nicols c1452371db Merge branch 'MDL-49783-28' of git://github.com/mastnym/moodle into MOODLE_28_STABLE 2015-05-07 09:42:51 +08:00
Martin Mastny 835bbc41fd MDL-49783 forms: Collapsed form section is opened on error 2015-05-07 09:14:34 +08:00
Dan Marsden 1a0d12e4a2 MDL-50133 mod_scorm: use correct captypes 2015-05-07 11:46:23 +12:00
Marina Glancy 032f18c4a5 MDL-49788 navigation: Ensure we only check active enrolments 2015-05-06 08:02:45 +01:00
Salih Gedik d7f66ebe07 MDL-49789 mod_book: filter book chapter content 2015-05-06 13:55:07 +08:00
Marina Glancy 7f5bd0da0e MDL-49718 externallib: unittest correction 2015-05-06 13:01:53 +08:00
Marina Glancy 98c38993fd MDL-50090 user: suspended user can login upon conrimation 2015-05-06 11:01:20 +08:00
Juan Leyva 77067fbb3a MDL-49718 webservices: Fix forced format and force external text cleaning 2015-05-06 10:56:17 +08:00
Juan Leyva 8e8ee75304 MDL-49994 files: Prevent to browse private files when are disabled 2015-05-06 10:27:32 +08:00
AMOS bot 9a1dc85511 Automatically generated installer lang files 2015-05-06 00:03:57 +08:00
Marina Glancy e2e7e35da3 MDL-50099 auth: less verbose account confirmed message 2015-05-05 15:33:50 +01:00
Frederic Massart 8c45d46d36 MDL-49179 setuplib: print_error() uses local URLs exclusively 2015-05-05 18:31:14 +08:00
Frederic Massart 17b8efa585 MDL-49179 weblib: Secure the direct usage of $_SERVER['HTTP_REFERER'] 2015-05-05 18:31:14 +08:00
Frederic Massart 71c1cfb143 MDL-49179 mod_forum, mod_quiz: Prevent misuse of get_referer() 2015-05-05 18:31:14 +08:00
Tim Hunt 1ce4f44df7 MDL-49941 quiz: mod/quiz:grade should declare RISK_XSS 2015-05-05 18:31:14 +08:00
Frederic Massart 9bf7fea937 MDL-49401 moodlelib: PARAM_LOCALURL supports loginhttps 2015-05-05 18:31:14 +08:00
Eloy Lafuente (stronk7) f3895b00a5 weekly release 2.8.5+ 2015-05-05 12:28:47 +02:00
David Monllao 1b1d0419a4 Merge branch 'wip-MDL-49778-28' of git://github.com/abgreeve/moodle into MOODLE_28_STABLE 2015-05-05 15:05:50 +08:00
David Monllao a86de7c0d9 Merge branch 'MDL-49227-28' of git://github.com/andrewnicols/moodle into MOODLE_28_STABLE 2015-05-05 14:36:55 +08:00
Adrian Greeve ec2a1ba2fe MDL-49778 lib: Update to upgrade_stale_php_files_present() 2015-05-05 12:45:24 +08:00
Andrew Nicols 9b94fabcb0 MDL-48002 inbound: Tidy up language in unit test 2015-05-05 10:59:49 +08:00
David Monllao 2cd81b11b1 Merge branch 'MDL-50055-28' of git://github.com/andrewnicols/moodle into MOODLE_28_STABLE 2015-05-05 10:52:07 +08:00
David Monllao 6cb5fe8472 Merge branch 'MDL-49848-28' of git://github.com/xow/moodle into MOODLE_28_STABLE 2015-05-05 10:38:45 +08:00
John Okely 33b16dd3cd MDL-49848 message: Make messaging interface responsive 2015-05-05 10:31:52 +08:00
Andrew Nicols d4b4f96e6c MDL-50055 enrol: Stop requiring javascript for behat tests 2015-05-05 10:24:30 +08:00
Andrew Nicols 5e3fca4d3b MDL-50055 tests: Add new step to deal with Single Selects 2015-05-05 10:24:29 +08:00
David Monllao eaa13b3809 Merge branch 'MDL-48002-28' of git://github.com/ankitagarwal/moodle into MOODLE_28_STABLE 2015-05-05 10:21:46 +08:00
Ankit Agarwal a2d176c2ed MDL-48002: inbound: Add outlook fixture 2015-05-04 15:21:51 +05:30
Ankit Agarwal d9e191b89e MDL-48002 inbound: Update regex for token matching 2015-05-04 15:21:51 +05:30
Ankit Agarwal 813c1136bc MDL-48002: inbound: Add ios fixture 2015-05-04 15:21:51 +05:30
Ankit Agarwal 149017a96c MDL-48002 inbound: Update fixtures to add client info 2015-05-04 15:21:51 +05:30
Ankit Agarwal e945517d66 MDL-48002 inbound: add tests for evolution 2015-05-04 15:21:51 +05:30
Andrew Nicols c712250d6b MDL-48002 inbound Unit tests from fixtures for quoted text 2015-05-04 15:21:51 +05:30
Ankit Agarwal e39a1db7b6 MDL-48002 inbound: Remove quoted text from forum emails 2015-05-04 15:21:51 +05:30
David Monllao d63c8ec710 Merge branch 'MDL-49954-28' of git://github.com/jleyva/moodle into MOODLE_28_STABLE 2015-05-04 15:16:19 +08:00
Andrew Nicols 62383073f5 MDL-49227 mod_forum: Improve discussion subscription on post
If the user has posted in the forum before, follow their previous
discussion preference.

If the user has not posted before, but is subscribed to the forum, follow
their forum preference.

Otherwise, follow their user-preference.

This has the result that if a user has unsubscribed from a forum and writes
their first response; the user preference will be followed. This may
override the forum subscription.

This commit also changes from a dropdown to a checkbox in the post form.

This is a backport of MDL-48221
2015-05-04 09:56:05 +08:00
Andrew Nicols 0013192227 Merge branch 'wip-mdl-50103-m28' of https://github.com/rajeshtaneja/moodle into MOODLE_28_STABLE 2015-05-04 09:39:03 +08:00
David Monllao 1be0ead2d4 MDL-50103 mod_assign: Fixing behat test
The participant number is dynamically generated so it is not possible to
match known values.

Match on the submission text instead.
2015-05-04 09:33:05 +08:00
Andrew Nicols 5c8bc25cd1 Merge branch 'wip-MDL-50066-m28' of git://github.com/marinaglancy/moodle into MOODLE_28_STABLE 2015-05-04 09:14:48 +08:00
David Monllao 0706e7ac17 weekly release 2.8.5+ 2015-05-01 16:47:25 +08:00
David Monllao 8069916549 MDL-49232 enrol_self: Adapting unit test to new can_self_enrol() output 2015-05-01 15:49:10 +08:00
Andrew Nicols f293278132 Merge branch 'MDL-49232_m28' of git://github.com/markn86/moodle into MOODLE_28_STABLE 2015-05-01 09:27:41 +08:00
Dan Poltawski e6a09c5359 Merge branch 'MDL-50028_28' of git://github.com/timhunt/moodle into MOODLE_28_STABLE 2015-04-30 16:07:16 +01:00
Jean-Michel Vedrine 06e7de3d96 MDL-34102 mod_lesson: display feedback
Feedback for incorrect answer was not diplayed when
Provide option to try a question again was set to Yes.

Conflicts:
	mod/lesson/locallib.php
2015-04-30 13:14:42 +02:00
Marina Glancy ed402015bb MDL-50066 strings: unable to deprecate string from moodle.php 2015-04-30 16:15:24 +08:00
Andrew Nicols 9495b310e5 Merge branch 'MDL-49583-m28' of https://github.com/NeillM/moodle into MOODLE_28_STABLE 2015-04-30 15:11:42 +08:00
Andrew Nicols e3a371a7a1 Merge branch 'MDL-50038-28' of git://github.com/FMCorz/moodle into MOODLE_28_STABLE 2015-04-30 14:56:30 +08:00
David Monllao a3a4c4f028 Merge branch 'MDL-49281-28' of git://github.com/mastnym/moodle into MOODLE_28_STABLE 2015-04-30 14:54:04 +08:00
Martin Mastny 986ee9fd2a MDL-49281 grades: Calculation settings upgraded 2015-04-30 13:43:45 +08:00
Andrew Nicols 95bfd8108b Merge branch 'MDL-50033-28-enfix' of git://github.com/mudrd8mz/moodle into MOODLE_28_STABLE 2015-04-30 10:51:37 +08:00
Andrew Nicols 23eee911ef MDL-49232 enrol_self: Add behat test for non-guest self-enrolment 2015-04-29 18:02:45 -07:00
Mark Nelson bbaf38b921 MDL-49232 enrol_self: display continue button 2015-04-29 18:02:44 -07:00
David Mudrák a0deded716 MDL-50033 lang: Update Behat scenario to use the new string 2015-04-29 23:35:28 +02:00
Helen Foster cdf4ba9549 MDL-50033 lang: Merge English strings from the en_fix language pack 2015-04-29 23:22:36 +02:00
Frederic Massart 4127b60cb5 MDL-50038 my: Redirect admin users to the notifications page when needed 2015-04-29 19:05:36 +08:00
Neill Magill eaba80f68d MDL-49583 enrol: enrol/index.php page doesn't handle direct access well
Before this patch if a user who is not logged in to Moodle accesses the
enrol/index.php page directly they were redirected to the Moodle front
page after login, rather than back to a page that would allow them to
self enrol, if it is enabled on the course.

This change will cause a user who directly accesses the page to be
redirected back to it after they have logged in, unless the course has guest
access enabled.

Thanks to Marina Glancy for suggesting the use of get_referer()
2015-04-29 09:19:00 +01:00
David Monllao 32f86cd8e9 Merge branch 'MDL-49637-m28' of git://github.com/NeillM/moodle into MOODLE_28_STABLE 2015-04-29 12:05:09 +08:00
Tim Hunt 00d5b5c9a3 MDL-50028 qtype_match: fix correct answer display
Atto's stupid tendency to create HTML like
<p>You don't need a br at the end of a paragraph!</br></p>
was breaking it.
2015-04-28 13:08:24 +01:00
Tim Hunt a81b8267c7 MDL-50028 questions: split into one testcase class per file 2015-04-28 13:08:22 +01:00
Dan Poltawski 9fb9aa7215 weekly release 2.8.5+ 2015-04-28 09:28:06 +01:00
Dan Poltawski 0309e1e39d Merge branch 'install_28_STABLE' of https://git.in.moodle.com/amosbot/moodle-install into MOODLE_28_STABLE 2015-04-28 09:28:04 +01:00
Neill Magill 895d6c75a4 MDL-49637 assign: Workflow & blind marking do not always show feedback
Before this patch if an assignment has workflow and blind marking enabled if a teacher
sets a submission to have its grades released to students before they reveal student
identities the feedback they have given is not displayed to the student.

The patch causes the reveal_identities() method to pass the correct value to the
get_feedback_plugin_by_type() function in the assign class.
2015-04-28 09:09:08 +01:00
Neill Magill 4358b705e5 MDL-49637 assign: Behat test for blind marking with workflow
This test checks that that if reveal student identities is used before or after the submissions grades have
been set released that the teacher's feedback is displayed to students.
2015-04-28 09:08:53 +01:00
David Monllao 39daab950a Merge branch 'MDL-42449-2.8' of git://github.com/andrewhancox/moodle into MOODLE_28_STABLE 2015-04-28 11:08:29 +08:00
Andrew Nicols 3c3c41682c Merge branch 'MDL-49926-28' of git://github.com/mastnym/moodle into MOODLE_28_STABLE 2015-04-28 10:27:12 +08:00
Martin Mastny 93e4b10b8e MDL-49926 gradereport: Cursor changes to pointer on hover 2015-04-28 10:23:03 +08:00
David Monllao f8ef412113 Merge branch 'MDL-49911-28' of git://github.com/FMCorz/moodle into MOODLE_28_STABLE 2015-04-28 09:47:01 +08:00
Juan Leyva 0c19d0828a MDL-49954 forum: Use clean_returnvalue properly in external unit tests 2015-04-27 18:26:06 +02:00
AMOS bot ee0cb8eb8d Automatically generated installer lang files 2015-04-28 00:04:14 +08:00
Dan Poltawski 5ff4e7ad7b Merge branch 'MDL-49993_28' of git://github.com/grabs/moodle into MOODLE_28_STABLE 2015-04-27 14:48:00 +01:00
Dan Poltawski 08c051c00b Merge branch 'MDL-49913_28' of git://github.com/jmvedrine/moodle into MOODLE_28_STABLE 2015-04-27 14:28:28 +01:00
Dan Poltawski 6a2192e887 Merge branch 'MDL-49977_m28' of git://github.com/markn86/moodle into MOODLE_28_STABLE 2015-04-27 10:53:18 +01:00
Andreas Grabs 6a7b2dd0cb MDL-49993 mod_feedback: Question auto numbers have no space between number and question 2015-04-26 19:04:21 +02:00
AMOS bot 796987c5f6 Automatically generated installer lang files 2015-04-25 00:04:08 +08:00
Andrew Hancox 8a5908a9b3 MDL-42449 backup: Fix for activity grade category
Retain grade category when restoring an activity into the course that
it came from
2015-04-24 14:01:31 +01:00
Dan Poltawski ee056895a3 weekly release 2.8.5+ 2015-04-24 12:10:52 +01:00
Dan Poltawski e61f453067 Merge branch 'MDL-49960-28' of git://github.com/FMCorz/moodle into MOODLE_28_STABLE 2015-04-24 09:06:40 +01:00
Frederic Massart 2607a4e671 MDL-49911 admin: Prevent notices when updatenotifications is disabled 2015-04-24 14:49:15 +08:00
Martin Mastny 1ac7e7e5c8 MDL-49926 gradereport: Feedback gets saved when editing grade in ajax mode 2015-04-24 13:17:01 +08:00
Andrew Nicols e5bb411fe4 Merge branch 'MDL-49311-28' of git://github.com/lameze/moodle into MOODLE_28_STABLE 2015-04-24 11:40:37 +08:00
papillon a65ba62f66 MDL-49311 user: fix default sorting problem 2015-04-24 09:13:53 +08:00
Mark Nelson 197824b5f8 MDL-49977 mod_assign: added missing page titles 2015-04-23 17:08:49 -07:00
Dan Poltawski 4a1a78244e Merge branch 'MDL-49946_28' of https://github.com/jmvedrine/moodle into MOODLE_28_STABLE 2015-04-23 13:32:36 +01:00
Frederic Massart 53318d9fce MDL-49960 message: Adding behat test for recent conversations 2015-04-23 14:55:52 +08:00
Jean-Michel Vedrine a1be2ce57d MDL-49913 mod_lesson: studentanswer format should be HTML 2015-04-23 08:28:36 +02:00
Jean-Michel Vedrine 19a6d37b9f MDL-49913 mod_lesson: fix import scores and jumps 2015-04-23 08:28:34 +02:00
Jean-Michel Vedrine 34acf52a3f MDL-49913 mod_lesson: defaultanswer to avoid duplication 2015-04-23 08:28:31 +02:00
Jean-Michel Vedrine 837c7f5696 MDL-49913 mod_lesson: round question grades on import 2015-04-23 08:28:28 +02:00
Andrew Nicols 1498e02eba Merge branch 'MDL-49319_backport_28' of https://github.com/andyjdavis/moodle into MOODLE_28_STABLE 2015-04-23 14:13:51 +08:00
Andrew Nicols 1007677df4 Merge branch 'MDL-49477-28' of git://github.com/FMCorz/moodle into MOODLE_28_STABLE 2015-04-23 13:52:15 +08:00
Andrew Nicols 38bf1824f8 Merge branch 'MDL-34921_28_unwanted-sitehome-redirects' of https://github.com/colin-umn/moodle into MOODLE_28_STABLE 2015-04-23 12:28:21 +08:00
Andrew Nicols e08df28765 Merge branch 'MDL-49613-m28' of https://github.com/NeillM/moodle into MOODLE_28_STABLE 2015-04-23 11:20:50 +08:00
Jean-Michel Vedrine 0de51e6ad1 MDL-49946 mod_lesson: improve qformat_default::defaultquestion 2015-04-22 19:49:59 +02:00
Dan Poltawski 52388b1bb4 Merge branch 'MDL-49921-28' of git://github.com/jleyva/moodle into MOODLE_28_STABLE 2015-04-22 16:41:35 +01:00
Andrew Davis 19a4bdb7f4 MDL-49319 core_registration: altered registration strings 2015-04-22 20:00:05 +08:00
Viduranga Wijesooriya cfd867e7d9 MDL-49477 availability_grade-form: checkbox disable problem fixed
Signed-off-by: Viduranga Wijesooriya <vpowerrc@gmail.com>
2015-04-22 17:35:41 +08:00
Tony Butler e8062e2cfe MDL-49933 mod_assign: Sort marker select lists alphabetically by name 2015-04-22 17:02:39 +08:00
Neill Magill e115db6dce MDL-49613 access: count_role_users gives unexpected results
The count_role_users function in lib/accesslib.php gives the wrong results if a user has the
same role at multiple levels in a context path.

For example a user is a coursecreator on a course and the category that the course is in,
in this case they would be counted twice, rather than being recognised as the same user.

This change will make the function only count unique users.
2015-04-22 09:31:27 +01:00
Neill Magill dd97173944 MDL-49613 access: Unit test for count_role_users 2015-04-22 09:31:26 +01:00
Juan Leyva 5f155af825 MDL-49921 forum: Handle exceptions correctly in get_forums_by_courses 2015-04-22 09:48:31 +02:00
Andrew Nicols c40fbd5e14 Merge branch 'MDL-49753-m28' of https://github.com/alexmitin/moodle into MOODLE_28_STABLE 2015-04-22 11:05:07 +08:00
Dan Poltawski 8fc43b0d64 weekly release 2.8.5+ 2015-04-21 11:16:27 +01:00
Dan Poltawski 8543e7c0d0 Merge branch 'install_28_STABLE' of https://git.in.moodle.com/amosbot/moodle-install into MOODLE_28_STABLE 2015-04-21 11:16:25 +01:00
Andrew Nicols fa35ed9955 MDL-40811 uploaduser: Optimise testuser code 2015-04-21 11:35:48 +08:00
Andrew Nicols b6f2ac8c59 Merge branch 'MDL-40881_M28' of https://github.com/nadavkav/moodle into MOODLE_28_STABLE 2015-04-21 11:34:20 +08:00
Brian Barnes c41e9a3312 MDL-49782 general: removed uses of window.status 2015-04-21 10:46:02 +08:00
AMOS bot 0ccc3820c4 Automatically generated installer lang files 2015-04-21 00:04:20 +08:00
Andrew Nicols 42adb9f74a Merge branch 'wip-mdl-49799-m28' of https://github.com/rajeshtaneja/moodle into MOODLE_28_STABLE 2015-04-20 12:27:41 +08:00
David Monllao 5e67fb9442 Merge branch 'MDL-48187_m28' of git://github.com/markn86/moodle into MOODLE_28_STABLE 2015-04-20 12:20:04 +08:00
David Monllao 4d83fde993 Merge branch 'wip-MDL-49880-28' of git://github.com/abgreeve/moodle into MOODLE_28_STABLE 2015-04-20 12:13:00 +08:00
Mark Nelson fb3a9ecb92 MDL-48187 core_course: use updated '$grade_item' 2015-04-19 20:30:34 -07:00
Rajesh Taneja 768d7fca5f MDL-49799 behat: replaced asd.com with example.com
asd.com is a valid domain, we should use reserved domain names for testing
2015-04-20 11:23:28 +08:00
David Monllao f5095227d3 Merge branch 'm28_MDL-49904' of git://github.com/totara/moodle into MOODLE_28_STABLE 2015-04-20 10:40:57 +08:00
Adrian Greeve 0485403978 MDL-49880 mod_lesson: Fixed notice while importing questions.
Cloze questions (not supported by lesson) threw up a notice saying that
the course wasn't set.
2015-04-20 08:41:09 +08:00
Dan Poltawski 81e0be88e9 weekly release 2.8.5+ 2015-04-17 10:53:53 +01:00
Dave Cooper da1af82875 MDL-49573 gradereport_singleview: Add tests for bulk grade inserts 2015-04-17 12:56:15 +08:00
David Monllao 52c475e082 Merge branch 'MDL-48723_28_forum-plagiarism_errors' of git://github.com/colin-umn/moodle into MOODLE_28_STABLE 2015-04-17 10:41:35 +08:00
Brian Barnes 2f2e2a3cc2 MDL-49904 user: set title when editing another user 2015-04-17 11:57:23 +12:00
Dan Poltawski 4140295c9f Merge branch 'MDL-49894-28' of git://github.com/jleyva/moodle into MOODLE_28_STABLE 2015-04-16 16:10:26 +01:00
Dan Poltawski 9d40bd98be Merge branch 'MDL-49573-28' of git://github.com/gurgus/moodle into MOODLE_28_STABLE 2015-04-16 16:08:24 +01:00
Juan Leyva c58cafbbaa MDL-49894 forum: Add deprecated information for get_forum_discussions 2015-04-16 15:21:58 +02:00
Dan Poltawski d902884587 Merge branch 'MDL-49837-28' of git://github.com/jleyva/moodle into MOODLE_28_STABLE 2015-04-16 12:17:51 +01:00
David Monllao 2a5a747fec Merge branch 'MDL-45131-28' of git://github.com/jleyva/moodle into MOODLE_28_STABLE 2015-04-16 17:04:56 +08:00
Juan Leyva 19ddaeb782 MDL-45131 notes: Add validation for returned parameters in WS tests 2015-04-16 10:35:52 +02:00
Juan Leyva 43d7576332 MDL-45131 course: Add validation for returned parameters in WS tests 2015-04-16 10:34:48 +02:00
Juan Leyva a1b54310e1 MDL-45131 user: Add validation for returned parameters in WS tests 2015-04-16 10:33:40 +02:00
Juan Leyva 728b068e24 MDL-45131 message: Add validation for returned parameters in WS tests 2015-04-16 10:33:40 +02:00
Juan Leyva 772f17a280 MDL-45131 files: Add validation for returned parameters in WS tests 2015-04-16 10:33:39 +02:00
Juan Leyva db4f496b52 MDL-45131 enrol: Add validation for returned parameters in WS tests 2015-04-16 10:33:38 +02:00
Juan Leyva 58611999f3 MDL-45131 cohort: Add validation for returned parameters in WS tests 2015-04-16 10:32:42 +02:00
Juan Leyva 1bfd51f16b MDL-45131 calendar: Add validation for returned parameters in WS tests 2015-04-16 10:32:41 +02:00
Dave Cooper c40624308f MDL-49573 gradereport_singleview: Add tests for bulk grade inserts 2015-04-16 13:26:47 +08:00
Dave Cooper 7fc9e24121 MDL-49573 gradereport_singleview: Fixed bulk insert override logic. 2015-04-16 13:26:46 +08:00
Skylar Kelty 4b55cb7109 MDL-49489 caching: Prevent full coursecontact purge 2015-04-16 07:49:59 +08:00
Dan Poltawski 27b7886b44 Merge branch 'MDL-49763-28' of git://github.com/jleyva/moodle into MOODLE_28_STABLE 2015-04-15 15:53:18 +01:00
Dan Poltawski 5ac077568d Merge branch 'MDL-49803_28' of git://github.com/dmonllao/moodle into MOODLE_28_STABLE 2015-04-15 15:06:18 +01:00
David Monllao 1927f330c4 Revert "MDL-46963 core_upgrade: change the call to guess_antelope_row_size"
This reverts commit 55f4e4c9cf.
2015-04-15 15:52:51 +08:00
David Monllao e9e274d60b MDL-49803 mod_quiz: Fixing overrides restore 2015-04-15 15:30:26 +08:00
Simey Lameze 55f4e4c9cf MDL-46963 core_upgrade: change the call to guess_antelope_row_size 2015-04-15 15:01:34 +08:00
David Monllao e712433e97 Merge branch 'MDL-46963-28' of git://github.com/lameze/moodle into MOODLE_28_STABLE 2015-04-15 13:36:48 +08:00
Nadav Kavalerchik e5e43e747a MDL-40881 uploaduser: Validate profile fields unique values 2015-04-14 19:12:10 +03:00
Dan Poltawski eb5fab4fd9 weekly release 2.8.5+ 2015-04-14 16:49:13 +01:00
Dan Poltawski 10787caae9 Merge branch 'install_28_STABLE' of https://git.in.moodle.com/amosbot/moodle-install into MOODLE_28_STABLE 2015-04-14 16:49:10 +01:00
Rajesh Taneja e2ca0b6e67 MDL-44611 behat: Description is required field and should be set 2015-04-14 12:16:49 +08:00
AMOS bot 36e07617ed Automatically generated installer lang files 2015-04-14 00:04:15 +08:00
Juan Leyva 7dedfc8b79 MDL-49837 assign: Use correct assertions and fix return params cleaning 2015-04-13 17:38:09 +02:00
Juan Leyva 88045d94ae MDL-49837 assign: Fix external functions return declaration
Incorrect use of external_warnings function
2015-04-13 17:38:00 +02:00
Dan Poltawski 1cc2d506aa Merge branch 'MDL-48702_backport_log' of https://github.com/andyjdavis/moodle into MOODLE_28_STABLE 2015-04-13 16:26:46 +01:00
Dan Poltawski 2d21dc38c6 Merge branch 'MDL-49166_site_rego_28' of https://github.com/andyjdavis/moodle into MOODLE_28_STABLE 2015-04-13 15:34:26 +01:00
Dan Poltawski d09ef20526 Merge branch 'MDL-49756-28' of git://github.com/mr-russ/moodle into MOODLE_28_STABLE 2015-04-13 15:05:42 +01:00
Andrew Nicols 351460000d Merge branch 'MDL-49426-28' of git://github.com/jleyva/moodle into MOODLE_28_STABLE 2015-04-13 14:32:35 +08:00
Simey Lameze 742bb09d38 MDL-46963 environment: add check for antelope row format 2015-04-13 14:24:50 +08:00
Andrew Nicols 71d8fb3c66 Merge branch 'MDL-33328_search_enrol_users_MDL28' of https://github.com/barrysspace/moodle into MOODLE_28_STABLE 2015-04-13 13:47:36 +08:00
Andrew Nicols 7955764966 Merge branch 'MDL-49762_M28' of git://github.com/nadavkav/moodle into MOODLE_28_STABLE 2015-04-13 13:39:36 +08:00
Andrew Nicols 7d621c689b Merge branch 'MDL-48836_m28' of https://github.com/markn86/moodle into MOODLE_28_STABLE 2015-04-13 13:28:53 +08:00
Ramindu Deshapriya eced61f6d1 MDL-44611 core_course: Added Behat test to automate MDLQA 5252 2015-04-13 11:12:57 +08:00
AMOS bot 11d14cacb9 Automatically generated installer lang files 2015-04-13 00:04:14 +08:00
Russell Smith 5ff1820a1f MDL-49756 course: Add unit tests for section_options. 2015-04-11 07:44:44 +10:00
Russell Smith 886fc0ba20 MDL-48836 backup: Use a trie for grouped path detection.
Backport of MDL-41674.
2015-04-10 14:11:47 -07:00
Juan Leyva e51a432d0f MDL-49763 webservices: Handle correctly deleted users for forums 2015-04-10 22:28:15 +02:00
Juan Leyva c8d1553d0e MDL-49426 webservices: Allow upload to draft area always 2015-04-10 10:44:47 +02:00
David Monllao 538b837c62 Merge branch 'MDL-49575-28' of git://github.com/FMCorz/moodle into MOODLE_28_STABLE 2015-04-10 15:11:25 +08:00
Barry Oosthuizen b99dcf40fd MDL-33328 enrol_manual: use correct parameter in search function
Searching for user from "Enrol users" panel causes blocks to dock in IE
2015-04-09 19:01:24 +01:00
Nadav Kavalerchik 1ae727b538 MDL-49762 Atto: Set HTML directionality to LTR, in RTL mode. 2015-04-09 16:10:43 +03:00
Dan Poltawski d705b4abb4 weekly release 2.8.5+ 2015-04-09 10:27:07 +01:00
Dan Poltawski c3c06055f0 Merge branch 'install_28_STABLE' of https://git.in.moodle.com/amosbot/moodle-install into MOODLE_28_STABLE 2015-04-09 10:27:05 +01:00
Frederic Massart 6d2a555f8e MDL-49575 gradereport_singleview: Regrade item when (un)overriding 2015-04-09 16:26:19 +08:00
Colin Campbell 08fe5496d1 MDL-48723 mod/forum: Fix cron task error on digest attachments. 2015-04-08 13:06:13 -05:00
Andrew Davis 2721dc593e MDL-49166 registration: now states whether or not site is registered 2015-04-08 20:51:05 +08:00
AMOS bot 8efba305f2 Automatically generated installer lang files 2015-04-08 00:04:15 +08:00
Damyon Wiese 7d33c56890 Merge branch 'MDL-49736_m28' of git://github.com/markn86/moodle into MOODLE_28_STABLE 2015-04-07 21:43:47 +08:00
Eloy Lafuente (stronk7) 6dbfaf2235 Merge branch 'MDL-48205_28' of https://github.com/totara/openbadges into MOODLE_28_STABLE 2015-04-07 14:21:31 +02:00
Brendan Heywood be72c3df67 MDL-49740 Lock: Fixed task lock release bugs 2015-04-07 13:09:36 +01:00
David Monllao 996e83fdd4 MDL-43558 theme_base: We don't need edit toggle if modeditingmenu is disabled 2015-04-07 16:25:31 +08:00
David Monllao 1758e6efc0 Merge branch 'MDL-37984-28' of git://github.com/mastnym/moodle into MOODLE_28_STABLE 2015-04-07 16:08:43 +08:00
Alex Mitin c1e53206d1 MDL-49753 enrolments: preselct status filter if needed 2015-04-07 15:53:45 +08:00
Andrew Nicols 8527d33766 MDL-49395 core: add more unit tests for get_enrolled_sql 2015-04-07 15:29:07 +08:00
Andrew Nicols c7b415e792 Merge branch 'suspended_userids_memory_28' of git://github.com/tlevi/moodle into MOODLE_28_STABLE 2015-04-07 15:29:01 +08:00
Dan Poltawski 2615ec14ad Merge branch 'mdl38210-moodle28' of https://github.com/tlock/moodle into MOODLE_28_STABLE 2015-04-06 12:36:07 +01:00
Colin Campbell cf862db4bc MDL-34921 course/format: Fix unwanted redirects from Site home 2015-04-03 16:00:19 -05:00
AMOS bot 608ab1c385 Automatically generated installer lang files 2015-04-04 00:04:10 +08:00
Eloy Lafuente (stronk7) badfcb70e4 weekly release 2.8.5+ 2015-04-02 11:49:02 +02:00
David Monllao c582672225 MDL-46805 mod_scorm: Re-fix as previous object was removed in 2.8 2015-04-02 09:21:26 +01:00
Rajesh Taneja d406c3893e MDL-46805 scorm: Set user_id if scorm|aiccuserid config is set 2015-04-02 15:43:49 +08:00
Tony Levi 8e602172ff MDL-49395 accesslib: Make get_suspended_userids more efficient 2015-04-02 13:54:50 +10:30
Rajesh Taneja d21f9cc2dd MDL-49513 behat: Updated step name to match new step 2015-04-02 09:47:26 +08:00
Andrew Nicols 240d90b149 Merge branch 'MDL-49686-28' of git://github.com/merrill-oakland/moodle into MOODLE_28_STABLE
Conflicts:
	lib/editor/atto/yui/build/moodle-editor_atto-editor/moodle-editor_atto-editor-min.js
2015-04-01 18:47:53 +08:00
Andrew Nicols 47f8e3e117 Merge branch 'wip-mdl-49513-m28' of https://github.com/rajeshtaneja/moodle into MOODLE_28_STABLE 2015-04-01 18:34:08 +08:00
Rajesh Taneja f57728674e MDL-49513 behat: Set admin config using php api
Added a new set to set config using set_config() api
to make steps faster and more efficient
2015-04-01 14:28:27 +08:00
Mark Nelson 0f2786da69 MDL-49736 core_question: fixed ability to unhide questions 2015-03-31 23:06:07 -07:00
Andrew Nicols cd32489d7a Merge branch 'MDL-49693-28' of git://github.com/merrill-oakland/moodle into MOODLE_28_STABLE
Conflicts:
	lib/editor/atto/yui/build/moodle-editor_atto-editor/moodle-editor_atto-editor-min.js
2015-04-01 12:37:37 +08:00
Tim Lock 0ea62d56c4 MDL-38210 report_participation: implement get view/post actions 2015-04-01 10:28:41 +10:30
Eloy Lafuente (stronk7) 16008dfd92 Merge branch 'wip-mdl-48605-m28' of https://github.com/rajeshtaneja/moodle into MOODLE_28_STABLE 2015-04-01 01:13:20 +02:00
Dan Poltawski 811b80a4c5 Merge branch 'MDL-49564-28' of git://github.com/merrill-oakland/moodle into MOODLE_28_STABLE
Conflicts:
	lib/editor/atto/yui/build/moodle-editor_atto-editor/moodle-editor_atto-editor-min.js
2015-03-31 19:29:23 +01:00
Dan Poltawski bbc9f54a6b Merge branch 'MDL-49666_28' of git://github.com/timhunt/moodle into MOODLE_28_STABLE 2015-03-31 19:18:11 +01:00
Tim Hunt 8d7fa47e0d MDL-49666 qbehaviour_informationitem: respect $options->readonly 2015-03-31 15:19:56 +01:00
Dan Poltawski 32623b4d3c Merge branch 'MDL-49671-28' of git://github.com/merrill-oakland/moodle into MOODLE_28_STABLE 2015-03-31 15:11:06 +01:00
Rajesh Taneja c01741c8cc MDL-48605 unit_test: Only touch real file/dir 2015-03-31 21:46:21 +08:00
Dan Poltawski d128e18674 Merge branch 'MDL-49547_28' of git://github.com/timhunt/moodle into MOODLE_28_STABLE 2015-03-31 14:44:09 +01:00
Dan Poltawski 8794018916 Merge branch 'MDL-49645_m28' of git://github.com/markn86/moodle into MOODLE_28_STABLE 2015-03-31 13:28:20 +01:00
Dan Poltawski 664749aaea Merge branch 'MDL-49641-get_external_files_m28' of https://github.com/jpahullo/moodle into MOODLE_28_STABLE 2015-03-31 13:15:10 +01:00
Dan Poltawski c2ca02e489 Merge branch 'MDL-49674-28-commentformat' of git://github.com/mudrd8mz/moodle into MOODLE_28_STABLE 2015-03-31 12:17:25 +01:00
Dan Poltawski 55d31273e3 Merge branch 'MDL-48880_28' of git://github.com/jmvedrine/moodle into MOODLE_28_STABLE 2015-03-31 11:19:21 +01:00
Dan Poltawski ccd4382245 Merge branch 'm28_MDL-43818_Unable_Download_Package_Via_URL' of https://github.com/scara/moodle into MOODLE_28_STABLE 2015-03-31 09:27:54 +01:00
Andrew Nicols e47d8445b9 Merge branch 'MDL-49695_m28' of git://github.com/markn86/moodle into MOODLE_28_STABLE 2015-03-31 15:15:15 +08:00
Rajesh Taneja f93ff30cde MDL-48605 unit_test: Fixed file_temp_cleanup_task
touch should only work on temp and below
dir's. With path we get temp/.. and temp/.
So we were modfying moodledata dir as well
and it was failing because of permission issues.
2015-03-31 14:58:51 +08:00
Andrew Nicols bc8acaffc1 MDL-49294 logging: Improve cleanup tests 2015-03-31 14:12:54 +08:00
Andrew Nicols eb9845115b Merge branch 'log_cleanup_28' of https://github.com/tlevi/moodle into MOODLE_28_STABLE 2015-03-31 14:01:30 +08:00
Andrew Nicols f2512fddb3 MDL-49669 badges: Add comment to explain CURLOPT_POSTREDIR 2015-03-31 12:24:32 +08:00
Andrew Nicols a3d579f922 Merge branch 'MDL-49669_28' of https://github.com/totara/openbadges into MOODLE_28_STABLE 2015-03-31 12:24:22 +08:00
Yuliya Bozhko d9dbcdf893 MDL-48205 badges: Get rid of ucfirst() and make modnames translatable
Signed-off-by: Yuliya Bozhko <yuliya.bozhko@totaralms.com>
2015-03-31 16:46:01 +13:00
David Monllao ec148b2574 Merge branch 'MDL-49114-28' of git://github.com/lameze/moodle into MOODLE_28_STABLE 2015-03-31 11:29:30 +08:00
David Monllao b7df272247 Merge branch 'MDL-49474_28' of git://github.com/jmvedrine/moodle into MOODLE_28_STABLE 2015-03-31 10:15:03 +08:00
Andrew Nicols 6ba6b23280 Merge branch 'm28_MDL-46805' of https://github.com/danmarsden/moodle into MOODLE_28_STABLE 2015-03-31 08:18:01 +08:00
Dan Marsden d444af3d74 MDL-46805 SCORM: AICC restricts allowed characters in the username 2015-03-31 10:39:26 +13:00
Matteo Scaramuccia a9e99ebd02 MDL-43818 SCORM: unable to download the Package via URL. 2015-03-30 20:38:50 +02:00
Eloy Lafuente (stronk7) b4e4c37e52 Merge branch 'wip-mdl-49708-m28' of https://github.com/rajeshtaneja/moodle into MOODLE_28_STABLE 2015-03-30 13:27:32 +02:00
Dan Poltawski f9212fb311 Merge branch 'wip-MDL-47337-m28' of git://github.com/marinaglancy/moodle into MOODLE_28_STABLE 2015-03-30 11:06:38 +01:00
Rajesh Taneja b070387e03 MDL-49708 behat: Resize window back to default
Leaving window size to large fails in chrome
Reset it to default size works to ensure stamp
is visible by selenium driver
2015-03-30 17:30:08 +08:00
Rajesh Taneja e0d460673a MDL-49708 behat: Fix chromedriver failure
Chromedriver tries to click in center of link
As these links wrap on next line it fails to
click on links on small screen
2015-03-30 12:35:32 +08:00
David Monllao 808836c60b Merge branch 'mdl36506-moodle28' of git://github.com/tlock/moodle into MOODLE_28_STABLE 2015-03-30 10:32:12 +08:00
Simey Lameze e22f5c6d87 MDL-49114 environment: add slasharguments warning message 2015-03-30 10:07:14 +08:00
Jean-Michel Vedrine e807911c99 MDL-48880 mod_lesson: clean lesson_branch on upgrade and restore 2015-03-29 21:37:01 +02:00
Jean-Michel Vedrine 0619c4ecc4 MDL-48880 mod_lesson: clean lesson_branch when a page is deleted 2015-03-29 21:37:01 +02:00
Mark Nelson 8624dcbc4d MDL-49695 tool_behat: fixed URL 2015-03-27 16:54:46 -07:00
Eric Merrill 89a50d82e3 MDL-48467 atto: Clean the textarea during submission when in HTML mode 2015-03-27 15:24:34 -04:00
Eric Merrill 93e80c9b45 MDL-49693 atto: Clean textarea contents before inserting into editor 2015-03-27 12:27:47 -04:00
Eric Merrill 42fb2c1b70 MDL-49686 atto: Process style and class attributes in sub-functions
To ensure we only clean style and classes, first we select the inside
of those attributes and "replace" them with handler functions. Those
functions scan the actual attribute values for class or styles that
we want to exclude.

The first level regex has 3 groups. group1 selects everything in the
tag leading up to the attribute values, group2 has the attributes,
group3 has the trailing quote mark. We work on group2 then return
the combination of group1, group2, and group3.
2015-03-27 11:36:26 -04:00
Eric Merrill fbcc8eba37 MDL-49671 atto: Any pastes that don't have html should clean everything
Browsers may not provide html content in the clipboard object event
though it will really be pasted as such. This includes Firefox on
Windows, Internet Explorer, and some niche cases in Safari.

Because of this, we need to scrub the entire editor anytime we can't
intercept a paste event.

In some magical day in the future when there is better cross browser
support, we can undo this.
2015-03-26 23:59:06 -04:00
Eric Merrill 0f9a1675cd MDL-49564 atto: Improve empty span removal
Paste from MS word, followed by cleaning, may leave many many unused
spans. Try to remove them.
2015-03-26 23:08:22 -04:00
Marina Glancy 7f1b995194 MDL-47337 course: merge section options during restore 2015-03-27 08:50:26 +08:00
Mark Nelson 1d663d1776 MDL-49645 core_backup: fixed 'expirythreshold' setting not being saved 2015-03-26 16:38:59 -07:00
Yuliya Bozhko b9aa500ea9 MDL-49669 badges: Handle curl redirects when posting to backpack
Signed-off-by: Yuliya Bozhko <yuliya.bozhko@totaralms.com>
2015-03-27 09:30:12 +13:00
Tim Hunt 94fa39d226 MDL-49547 question restore: avoid tag-related notices. 2015-03-26 15:30:13 +00:00
David Mudrák 64bef5f9f6 MDL-49674 comment: Use correct format when displaying the comment
The plugin callback executed above can eventually change the format. We
need to use that one to have the formatting of the first AJAX response
consistent with following displays.
2015-03-26 13:00:56 +01:00
Eloy Lafuente (stronk7) 0a4b99f35b weekly release 2.8.5+ 2015-03-26 10:48:15 +01:00
Eloy Lafuente (stronk7) 36843ff28b Merge branch 'install_28_STABLE' of https://git.in.moodle.com/amosbot/moodle-install into MOODLE_28_STABLE 2015-03-26 10:48:09 +01:00
David Monllao 49fad98ab2 MDL-47002 editor_atto: Remove all after html when pasting 2015-03-26 10:07:57 +01:00
David Monllao 5baa2de21e MDL-47002 editor_atto: Clean the comments separately 2015-03-26 14:50:17 +08:00
Tony Levi fd7dd8f237 MDL-49294 logging: Cleanup runs in smaller chunks
Just running a huge log cleanup will probably cause big problems on large sites.
So we break this down into smaller day-by-day chunks until reaching the target.
2015-03-26 12:01:53 +10:30
Eloy Lafuente (stronk7) ea1dba053d Merge branch 'MDL-47002-int-28' of git://github.com/merrill-oakland/moodle into MOODLE_28_STABLE 2015-03-25 18:19:46 +01:00
Eric Merrill 0c2d24e908 MDL-47002 atto: Prevent removal of Rangy spans 2015-03-25 10:02:13 -04:00
David Monllao 751fe02a01 MDL-49558 gradereport_user: Fixing table border 2015-03-25 08:41:38 +00:00
Eric Merrill b8bf3fe36b MDL-47003 atto: Update behat test for copyright symbol 2015-03-25 15:20:39 +08:00
Jordi Pujol Ahulló b94e9188e7 MDL-49641 repository_dropbox: preventing poor performance.
get_external_files placed with second argument as '' to prevent poor performance.
2015-03-25 08:02:24 +01:00
Martin Mastny 08d18b09c1 MDL-37984 portfolio: Google drive using official client library 2015-03-25 12:40:40 +08:00
David Monllao be39358439 MDL-45619 repository: Don't allow repository_recent to be uninstalled
We have tests that depends on it and it
is a simple repo that can just be disabled.
2015-03-25 09:39:59 +08:00
David Monllao c34e3ca994 Merge branch 'MDL-45619_m28' of git://github.com/sbourget/moodle into MOODLE_28_STABLE 2015-03-25 09:39:48 +08:00
Dan Poltawski 12fd2baec7 Merge branch 'MDL-49354-28' of https://github.com/mtavella-netspot/moodle into MOODLE_28_STABLE 2015-03-24 15:14:11 +00:00
Andrew Nicols 16dab5d9c7 MDL-48918 course: Fix keyboard drag/drop after dropped resource 2015-03-24 15:11:24 +00:00
Eloy Lafuente (stronk7) 3209753b78 Merge branch 'MDL-48795_28' of https://github.com/apsdehal/moodle into MOODLE_28_STABLE 2015-03-24 15:44:54 +01:00
Dan Poltawski 54924b24c7 Merge branch 'wip-mdl-49374-m28' of https://github.com/rajeshtaneja/moodle into MOODLE_28_STABLE 2015-03-24 13:36:58 +00:00
Dan Poltawski 05de057c00 Merge branch 'MDL-49070_scheduled_28' of https://github.com/andyjdavis/moodle into MOODLE_28_STABLE 2015-03-24 13:33:53 +00:00
Dan Poltawski f7751d8cd6 Merge branch 'wip_MDL-49631_28_utfregex' of https://github.com/skodak/moodle into MOODLE_28_STABLE 2015-03-24 11:11:37 +00:00
Dan Poltawski 9e84f9063e Merge branch 'MDL-46746-28' of git://github.com/merrill-oakland/moodle into MOODLE_28_STABLE
Conflicts:
	lib/editor/atto/yui/build/moodle-editor_atto-editor/moodle-editor_atto-editor-min.js
2015-03-24 11:04:18 +00:00
Dan Poltawski 932d1d33d1 Merge branch 'MDL-49565-28' of git://github.com/merrill-oakland/moodle into MOODLE_28_STABLE 2015-03-24 09:57:20 +00:00
Dan Poltawski c4862951d8 Merge branch 'wip_MDL-49327_2.8_guide_getinstance' of https://github.com/nixorv/moodle into MOODLE_28_STABLE
Conflicts:
	grade/grading/form/guide/tests/guide_test.php
2015-03-24 09:31:13 +00:00
Nadav Kavalerchik 7204bbf743 MDL-49558 user grades: Fix range & percent grade display in RTL mode 2015-03-24 14:51:47 +08:00
David Monllao d794cb3935 Merge branch 'MDL-49555-28' of git://github.com/FMCorz/moodle into MOODLE_28_STABLE 2015-03-24 11:00:27 +08:00
David Monllao 0a79d25826 Merge branch 'MDL-47003-28' of git://github.com/merrill-oakland/moodle into MOODLE_28_STABLE 2015-03-24 10:17:40 +08:00
Tim Lock 4101e04265 MDL-36506 mod_book: Skip legacy files migration if missing a CM record 2015-03-24 12:47:18 +10:30
Mohamed Alsharaf 99046d557e MDL-35482 lesson: return to previous page after edit and page save 2015-03-24 00:41:17 +01:00
Nikita Kalinin 4ef8b1d07e MDL-49327 marking guide: Added condition on definitionid. 2015-03-24 00:12:17 +03:00
AMOS bot b1660e619b Automatically generated installer lang files 2015-03-24 00:06:32 +08:00
Dan Poltawski a3fcd87495 Merge branch 'wip_MDL-49327_2.8_guide_getinstance' of https://github.com/nixorv/moodle into MOODLE_28_STABLE 2015-03-23 15:49:05 +00:00
Dan Poltawski be8c5c6944 Merge branch 'MDL-48443-28' of git://github.com/jleyva/moodle into MOODLE_28_STABLE 2015-03-23 15:03:59 +00:00
Dan Poltawski c3ae3253d9 Merge branch 'wip-mdl-49432-m28' of https://github.com/rajeshtaneja/moodle into MOODLE_28_STABLE 2015-03-23 12:37:06 +00:00
Dan Poltawski 77d0becd77 Merge branch 'm28_MDL-48419' of https://github.com/danmarsden/moodle into MOODLE_28_STABLE 2015-03-23 11:17:05 +00:00
Dan Poltawski 4bc1c5994d Merge branch 'MDL-21201-28-feedback_anon' of https://github.com/DSI-Universite-Rennes2/moodle into MOODLE_28_STABLE 2015-03-23 11:03:29 +00:00
David Monllao 01f0148c64 MDL-48456 course: Using default max int value 2015-03-23 15:18:06 +08:00
David Monllao 02a9c25040 Merge branch 'MDL-48456-28' of git://github.com/dkns/moodle into MOODLE_28_STABLE 2015-03-23 15:17:56 +08:00
David Monllao c0339626a2 Merge branch 'MDL-47002-28' of git://github.com/merrill-oakland/moodle into MOODLE_28_STABLE 2015-03-23 14:59:23 +08:00
Petr Skoda 4f431ffe43 MDL-49631 fix incorrect whitespace remplacements 2015-03-23 17:40:45 +13:00
AMOS bot 727bbbfa03 Automatically generated installer lang files 2015-03-23 00:04:20 +08:00
Daniel Kosinski 482ad496c7 MDL-48456 course: increase timeout when deleting all courses in category 2015-03-22 16:24:13 +01:00
AMOS bot b1a5caec65 Automatically generated installer lang files 2015-03-21 00:04:08 +08:00
AMOS bot 4c7ec86fcd Automatically generated installer lang files 2015-03-21 00:04:08 +08:00
Julien Boulen b8e75114c9 MDL-21201 Feedback: hide anonymous responses in recent activity reports 2015-03-20 16:27:25 +01:00
Andrew Davis 3a389c1d46 MDL-49070 core_registration: removed now unused config setting 2015-03-20 20:58:57 +08:00
Andrew Davis 592608b287 MDL-49070 core_registration: improved site registration scheduled task 2015-03-20 20:55:06 +08:00
Nikita Kalinin 8060eb6fc7 MDL-49327 marking guide: Added condition on definitionid. 2015-03-20 12:20:46 +03:00
Rajesh Taneja cc8cc5c8b0 MDL-49374 behat: Get install or re-install error code after composer
After composer is installed make sure we just process only
install or re-install
2015-03-20 14:05:28 +08:00
Rajesh Taneja 895661bf74 MDL-49432 behat: guzzle packages has been unified
Current version of goutte is pointing to old guzzle packages
guzzle/common, guzzle/stream, guzzle/parser and guzzle/http.
They have been unified to guzzlehttp/guzzle, so include it to
avoid using old packages
2015-03-20 12:09:55 +08:00
Eloy Lafuente (stronk7) 3ea79917c9 weekly release 2.8.5+ 2015-03-19 12:42:13 +01:00
Eloy Lafuente (stronk7) 87a27b23a1 NOBUG: Fixed file access permissions 2015-03-19 12:42:13 +01:00
Jean-Michel Vedrine 53aad1f086 MDL-49474 mod_lesson: intro and introformat missing from backup/restore
Conflicts:
	mod/lesson/backup/moodle2/backup_lesson_stepslib.php
	mod/lesson/backup/moodle2/restore_lesson_stepslib.php
2015-03-18 23:27:13 +01:00
Marina Glancy 9cdcf8748d MDL-45619 repository: corrections to uninstall, display link 2015-03-18 13:45:09 -04:00
Stephen Bourget fad0019cb2 MDL-45619 Repository: Allow repositories to be uninstalled 2015-03-18 13:45:06 -04:00
Eric Merrill cf539782c0 MDL-49565 atto: Allow html comments in editor code 2015-03-18 12:30:06 -04:00
Eric Merrill d6ee0f6897 MDL-46746 atto: Remove unnecessary filtering of unicode characters 2015-03-18 12:09:51 -04:00
Eric Merrill 016c76ec57 MDL-47003 atto: Make code cleanup more targeted
Apply different, stricter, code cleanup when we receive HTML (WYSIWYG)
paste events, but be more lax the rest of the time.

Also, update the regexes to be more targeted for specific code patterns
pasted from office packages.
2015-03-18 11:47:22 -04:00
Eric Merrill 5cb7093166 MDL-47002 atto: Improve paste behaviour to ensure propper cleanup
Old code failed to clean the editor div which resulted in
undesirable code being being left in the div for editing. To properly
handel incoming code, we should try to intercept and clean before the
paste, or clean the entire editable div.
2015-03-18 09:29:43 -04:00
info@ewallah.net bb04cfe20e MDL-49555 enrol_paypal: Only display icon if method available 2015-03-18 14:23:25 +01:00
Juan Leyva abde87bf41 MDL-48443 webservices: Prevent duplicated user devices 2015-03-18 11:43:56 +01:00
Dan Marsden 5663c1771f MDL-48419 mod_scorm: Check net script too agressive
in some cases high latency and network issues result in longer
than 2 sec responses from a server, increase this to avoid
excessive warnings.
2015-03-18 20:05:36 +13:00
David Monllao 67258145ea Revert "Merge branch 'MDL-49445_28' of git://github.com/timhunt/moodle into MOODLE_28_STABLE"
This reverts commit ea505f1b35, reversing
changes made to bad69e63f5.
2015-03-18 10:51:15 +08:00
Eloy Lafuente (stronk7) 23be970b7f Merge branch 'MDL-49296_m28v3' of https://github.com/sbourget/moodle into MOODLE_28_STABLE 2015-03-17 12:05:25 +01:00
Dan Poltawski 58873bcae3 Merge branch 'MDL-49359_m28' of https://github.com/markn86/moodle into MOODLE_28_STABLE 2015-03-17 08:53:31 +00:00
Mark Nelson 3c2c8a0628 MDL-49359 install: warn against using MyISAM 2015-03-16 20:41:56 -07:00
Stephen Bourget 6ec0c5fba5 MDL-49296 Lesson: Add titles to action links 2015-03-16 20:35:15 -04:00
Eloy Lafuente (stronk7) 39a765703e Merge branch 'MDL-49389_28' of git://github.com/timhunt/moodle into MOODLE_28_STABLE 2015-03-17 00:29:22 +01:00
Mike Grant 87fd4f6b0d MDL-49276 config-dist: Removed legacy config options
Both $CFG->logsql and $CFG->dblogerror had no use in moodle core
since ages ago (just the former had one use for nothing). Good time
to get rid of both as they are 100% misleading.
2015-03-16 23:42:57 +01:00
Dan Poltawski 21acd586a8 Merge branch 'MDL-48965_28' of git://github.com/jmvedrine/moodle into MOODLE_28_STABLE 2015-03-16 21:05:57 +00:00
Dan Poltawski 8d8124fa9f Merge branch 'wip-MDL-49267-m28' of git://github.com/marinaglancy/moodle into MOODLE_28_STABLE 2015-03-16 15:52:38 +00:00
Dan Poltawski b6c5e8f790 Merge branch 'MDL-49104-28' of git://github.com/DanBennettUK/moodle into MOODLE_28_STABLE 2015-03-16 15:05:13 +00:00
Dan Poltawski 8736f9b956 Merge branch 'MDL-49187-28' of https://github.com/spvickers/moodle into MOODLE_28_STABLE 2015-03-16 14:52:05 +00:00
Dan Poltawski d8088471b0 Merge branch 'MDL-49442-28' of git://github.com/jethac/moodle into MOODLE_28_STABLE 2015-03-16 13:31:07 +00:00
David Monllao ea505f1b35 Merge branch 'MDL-49445_28' of git://github.com/timhunt/moodle into MOODLE_28_STABLE 2015-03-16 15:38:13 +08:00
David Monllao bad69e63f5 MDL-47712 question_multianswer: Concat as string 2015-03-16 13:51:17 +08:00
David Monllao 54fbcc3105 Merge branch 'MDL-47712-m28-master' of git://github.com/dthies/moodle into MOODLE_28_STABLE 2015-03-16 10:33:40 +08:00
David Monllao c35f3e97da Merge branch 'm28_MDL-44548' of git://github.com/danmarsden/moodle into MOODLE_28_STABLE 2015-03-16 10:04:34 +08:00
David Monllao 9455b8b96b Merge branch 'wip-MDL-47729-m28' of git://github.com/marinaglancy/moodle into MOODLE_28_STABLE 2015-03-16 09:50:31 +08:00
Dan Marsden 4050f60b55 MDL-44548 mod_scorm: force an external sync to check for updated files. 2015-03-16 09:03:01 +13:00
Daniel Thies 55526a8a53 MDL-47712 qtype_multianswer: Move mathjaxloader spans to outer question 2015-03-13 21:33:16 -05:00
Tim Hunt 44242e1a40 MDL-49446 behat: should_not_be_visible steps were not working
I fixed all similar problems in this class, even ones where it did
actually work becuase the two exceptions were of different types.
This pattern seems to have been copied and pasted a lot in this class,
and I am sure that will happen again, so I did not want to leave any
dangerous potential examples around.
2015-03-13 14:22:52 +00:00
Tim Hunt 6d01dfe627 MDL-49445 behat: selectors should match the most specific tr or li
I also fixed the text rule, which already did this, to use the same
idiom. It is unnecessarily inefficient to count all the things and
compare to 0. Not exists should be faster.

Also, updated all the selectors here to consistently start relative to
the current node (.//, not //).
2015-03-13 14:22:44 +00:00
Tim Hunt d8ace7dd74 MDL-49389 blocklib: avoid notices when moving blocks to the bottom 2015-03-13 14:22:35 +00:00
Marina Glancy 1a17ca8bdd MDL-47729 repository_filesystem: smarter sync of references
It was noticed that if file content was once imported the following
synchronisations do not discover the changes
2015-03-13 11:21:14 +08:00
David Monllao 79dfb73824 weekly release 2.8.5+ 2015-03-13 10:27:41 +08:00
David Monllao 4d82d742c5 Merge branch 'install_28_STABLE' of https://git.in.moodle.com/amosbot/moodle-install into MOODLE_28_STABLE 2015-03-13 10:27:39 +08:00
David Monllao 4bb1c9764e Merge branch 'MDL-48897_28' of git://github.com/jmvedrine/moodle into MOODLE_28_STABLE 2015-03-11 08:51:57 +08:00
David Monllao 135aeaacc4 Merge branch 'MDL-48858-28' of git://github.com/mastnym/moodle into MOODLE_28_STABLE 2015-03-11 08:46:50 +08:00
Tim Hunt 0612ff1f56 MDL-49315 questions: unit tests for each behaviour type class 2015-03-11 08:28:18 +08:00
Eloy Lafuente (stronk7) 807e21f64e Merge branch 'MDL-49159-28' of https://github.com/spvickers/moodle into MOODLE_28_STABLE 2015-03-11 00:18:28 +01:00
AMOS bot 2229917a8f Automatically generated installer lang files 2015-03-11 00:04:06 +08:00
Dan Poltawski 1a72a44f97 Merge branch 'wip_MDL-49074_M28' of git://github.com/gjb2048/moodle into MOODLE_28_STABLE 2015-03-10 11:51:45 +00:00
David Monllao 0d87b1f548 Merge branch 'MDL-49256-28' of git://github.com/andrewnicols/moodle into MOODLE_28_STABLE
Conflicts:
	lib/editor/atto/yui/build/moodle-editor_atto-editor/moodle-editor_atto-editor-min.js
2015-03-10 17:46:01 +08:00
Dan Poltawski f09cb26d51 Merge branch 'wip-mdl-49402-m28' of https://github.com/rajeshtaneja/moodle into MOODLE_28_STABLE 2015-03-10 08:33:35 +00:00
Dan Poltawski dd8b3324ef Merge branch 'MDL-48682_28' of git://github.com/dmonllao/moodle into MOODLE_28_STABLE 2015-03-10 08:25:30 +00:00
David Monllao 3fca7fd7c7 Merge branch 'MDL-49346-28' of git://github.com/jleyva/moodle into MOODLE_28_STABLE 2015-03-10 15:32:05 +08:00
David Monllao 3622940192 Merge branch 'MDL-49351-28' of git://github.com/jleyva/moodle into MOODLE_28_STABLE 2015-03-10 15:21:30 +08:00
David Monllao 655193dc84 Merge branch 'MDL-49366_28' of git://github.com/timhunt/moodle into MOODLE_28_STABLE 2015-03-10 14:41:29 +08:00
Jetha Chan a34b18ad21 MDL-49442 javascript: add handlebars hashtable to support get_string 2015-03-10 13:07:28 +08:00
David Monllao 65b61b07e0 Merge branch 'MDL-49107-28' of git://github.com/FMCorz/moodle into MOODLE_28_STABLE 2015-03-10 11:43:31 +08:00
David Monllao f61d29c317 Merge branch 'MDL-49332-28' of git://github.com/merrill-oakland/moodle into MOODLE_28_STABLE 2015-03-10 10:43:11 +08:00
David Monllao 62d334e985 Merge branch 'MDL-48572_28' of git://github.com/rlorenzo/moodle into MOODLE_28_STABLE 2015-03-10 10:35:37 +08:00
David Monllao 0f9b21a5d7 Merge branch 'MDL-39262_28' of git://github.com/jmvedrine/moodle into MOODLE_28_STABLE 2015-03-10 10:13:00 +08:00
Dan Bennett 116f2c5714 MDL-49104 repository_s3: backport of MDL-43725 2015-03-09 16:03:12 +00:00
Jean-Michel Vedrine a4ff234c80 MDL-39262 mod_lesson: disable shortforms in lesson question display
Conflicts:
	mod/lesson/pagetypes/shortanswer.php
2015-03-08 11:20:22 +01:00
Amanpreet Singh b2959e1323 MDL-48795 lang: Update message for nothingnew
In lang/en/moodle.php file
2015-03-08 10:06:39 +05:30
Jean-Michel Vedrine 10a40946c6 MDL-48897 mod_lesson: behat tests for pages edition
This is a backport of MDL-48675.
2015-03-07 22:52:02 +01:00
Jean-Michel Vedrine 5d911423dc MDL-48897 mod_lesson: Error displayed while editing content page jumps
This change also fix MDL-32343 and MDL-31778 related to problems
when editing cluster pages.

This is a backport of MDL-48675.
2015-03-07 22:52:02 +01:00
Jean-Michel Vedrine fbfa01b847 MDL-48965 mod_lesson: avoid short answer question without any answers 2015-03-07 22:07:00 +01:00
Juan Leyva 4567c1c3a0 MDL-49346 ratings: ratingarea should be a required parameter 2015-03-06 11:45:03 +01:00
Juan Leyva b610727b5b MDL-49351 ratings: Correct check of viewallratings permission 2015-03-06 11:43:05 +01:00
Marina Glancy 1118c28a51 MDL-49267 mod_wiki: always apply filters to the wiki name 2015-03-06 13:54:29 +08:00
Andrew Nicols 1879f64350 MDL-49256 atto: Check form existence before resetAutosave 2015-03-06 12:01:50 +08:00
Rajesh Taneja 8b215b4110 MDL-49402 behat: Fixed feature file with same scenario name
1. We should not have same scanrio name in 1 feature file
   As it doesn't explain what is being tested. So modified.
2. Removed empty line, to keep it consistnet with other features
2015-03-06 11:47:56 +08:00
David Monllao 69023cd3e9 MDL-48682 behat: Changing window size on specific tests 2015-03-06 11:03:17 +08:00
David Monllao f4a201cdf2 MDL-49376 behat: Fixing resize step regex 2015-03-06 10:59:47 +08:00
Rex Lorenzo 086f4b6e4f MDL-48572 gradereport_grader: Average wrong with suspended users 2015-03-05 11:38:09 -08:00
Eric Merrill cf1a558531 MDL-49332 gradebook: Raise time limit if we get into regrade
Because all regrading should (and does) start from this point, it
is safe and best to call it just once, from this point.
2015-03-05 10:10:13 -05:00
Tim Hunt 3338ba48d9 MDL-49366 questions: avoid PHP notices from bad pluginfile URLs 2015-03-05 12:17:43 +00:00
spvickers f9db06b107 MDL-49187 mod_lti: Fix tool config lookup
Changed code to look for a tool ID before then matching on the URL.
2015-03-03 18:56:41 -07:00
Gareth J Barnard f300e1021b MDL-49074 themes: WOFF2 fonts are not supported. Backport of MDL-46728. 2015-03-03 10:45:30 +00:00
Adrian Greeve 49308a3f57 MDL-48858 mod_data: Update to behat tests
A bulk delete of entries has been added to
the behat tests.
2015-03-03 11:34:14 +08:00
Matthew Tavella 0d2a4f8ee9 MDL-49354 YUI: Remove event-autohide module from yui-moodlesimple rollup 2015-03-03 10:29:18 +10:30
spvickers 06085cc6d4 MDL-49159 mod_lti: Incorrect IDs in tools table
The "_tools" suffix for the IDs of tabs in the tools settings table was
being duplicated.
2015-02-27 11:32:34 -07:00
Frederic Massart 7b414d50a8 MDL-49107 atto_link: Insert link even when selection is empty 2015-02-25 16:38:10 +01:00
Andrew Davis 73639b4124 MDL-48702 logs: switched retrieval to get_recordset_select() 2015-01-08 09:08:50 +01:00
622 changed files with 12248 additions and 2608 deletions
@@ -0,0 +1,103 @@
<?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/>.
/**
* This script fixes orphaned question categories.
*
* Orphaned question categories have had their associated context deleted
* but the category itself remains in the database with an invalid context.
*
* @package core
* @subpackage cli
* @copyright 2013 Tyler Bannister (tyler.bannister@remote-learner.net)
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
define('CLI_SCRIPT', true);
require(__DIR__.'/../../config.php');
require_once($CFG->libdir.'/clilib.php');
require_once($CFG->libdir.'/questionlib.php');
$long = array('fix' => false, 'help' => false);
$short = array('f' => 'fix', 'h' => 'help');
// Now get cli options.
list($options, $unrecognized) = cli_get_params($long, $short);
if ($unrecognized) {
$unrecognized = implode("\n ", $unrecognized);
cli_error(get_string('cliunknowoption', 'admin', $unrecognized));
}
if ($options['help']) {
$help =
"Fix orphaned question categories.
This scripts detects question categories that have had their
context deleted, thus severing them from their original purpose.
This script will find the orphaned categories and delete the unused
questions in each category found. Used questions will not be
deleted, instead they will be moved to a rescue question category.
Options:
-h, --help Print out this help
-f, --fix Fix the orphaned question categories in the DB.
If not specified only check and report problems to STDERR.
Example:
\$sudo -u www-data /usr/bin/php admin/cli/fix_orphaned_question_categories.php
\$sudo -u www-data /usr/bin/php admin/cli/fix_orphaned_question_categories.php -f
";
echo $help;
die;
}
cli_heading('Checking for orphaned categories');
$sql = 'SELECT qc.id, qc.contextid, qc.name
FROM {question_categories} qc
LEFT JOIN {context} c ON qc.contextid = c.id
WHERE c.id IS NULL';
$categories = $DB->get_recordset_sql($sql);
$i = 0;
foreach ($categories as $category) {
$i += 1;
echo "Found orphaned category: {$category->name}\n";
if (!empty($options['fix'])) {
echo "Cleaning...";
// One transaction per category.
$transaction = $DB->start_delegated_transaction();
question_category_delete_safe($category);
$transaction->allow_commit();
echo " Done!\n";
}
}
if (($i > 0) && !empty($options['fix'])) {
echo "Found and removed {$i} orphaned question categories\n";
} else if ($i > 0) {
echo "Found {$i} orphaned question categories. To fix, run:\n";
echo "\$sudo -u www-data /usr/bin/php admin/cli/fix_orphaned_question_categories.php --fix\n";
} else {
echo "No orphaned question categories found.\n";
}
$categories->close();
+148
View File
@@ -1257,6 +1257,154 @@
<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>
<MOODLE version="2.9" 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>
+21 -16
View File
@@ -561,31 +561,36 @@ $cronoverdue = ($lastcron < time() - 3600 * 24);
$dbproblems = $DB->diagnose();
$maintenancemode = !empty($CFG->maintenance_enabled);
// Available updates for Moodle core
// Available updates for Moodle core.
$updateschecker = \core\update\checker::instance();
$availableupdates = array();
$availableupdates['core'] = $updateschecker->get_update_info('core',
array('minmaturity' => $CFG->updateminmaturity, 'notifybuilds' => $CFG->updatenotifybuilds));
$availableupdatesfetch = null;
// Available updates for contributed plugins
$pluginman = core_plugin_manager::instance();
foreach ($pluginman->get_plugins() as $plugintype => $plugintypeinstances) {
foreach ($plugintypeinstances as $pluginname => $plugininfo) {
if (!empty($plugininfo->availableupdates)) {
foreach ($plugininfo->availableupdates as $pluginavailableupdate) {
if ($pluginavailableupdate->version > $plugininfo->versiondisk) {
if (!isset($availableupdates[$plugintype.'_'.$pluginname])) {
$availableupdates[$plugintype.'_'.$pluginname] = array();
if (empty($CFG->disableupdatenotifications)) {
// Only compute the update information when it is going to be displayed to the user.
$availableupdates['core'] = $updateschecker->get_update_info('core',
array('minmaturity' => $CFG->updateminmaturity, 'notifybuilds' => $CFG->updatenotifybuilds));
// Available updates for contributed plugins
$pluginman = core_plugin_manager::instance();
foreach ($pluginman->get_plugins() as $plugintype => $plugintypeinstances) {
foreach ($plugintypeinstances as $pluginname => $plugininfo) {
if (!empty($plugininfo->availableupdates)) {
foreach ($plugininfo->availableupdates as $pluginavailableupdate) {
if ($pluginavailableupdate->version > $plugininfo->versiondisk) {
if (!isset($availableupdates[$plugintype.'_'.$pluginname])) {
$availableupdates[$plugintype.'_'.$pluginname] = array();
}
$availableupdates[$plugintype.'_'.$pluginname][] = $pluginavailableupdate;
}
$availableupdates[$plugintype.'_'.$pluginname][] = $pluginavailableupdate;
}
}
}
}
}
// The timestamp of the most recent check for available updates
$availableupdatesfetch = $updateschecker->get_last_timefetched();
// The timestamp of the most recent check for available updates
$availableupdatesfetch = $updateschecker->get_last_timefetched();
}
$buggyiconvnomb = (!function_exists('mb_convert_encoding') and @iconv('UTF-8', 'UTF-8//IGNORE', '100'.chr(130).'€') !== '100€');
//check if the site is registered on Moodle.org
+1 -1
View File
@@ -11,7 +11,7 @@
echo '<div class="phpinfo">';
ob_start();
phpinfo(INFO_GENERAL + INFO_CONFIGURATION + INFO_MODULES);
phpinfo(INFO_GENERAL + INFO_CONFIGURATION + INFO_MODULES + INFO_VARIABLES);
$html = ob_get_contents();
ob_end_clean();
+1 -1
View File
@@ -65,7 +65,7 @@ if (!empty($registeredhub) and $registeredhub->token == $token) {
$registeredhub->hubname = $hubname;
$registrationmanager->update_registeredhub($registeredhub);
//display notficiation message
// Display notification message.
$notificationmessage = $OUTPUT->notification(
get_string('registrationconfirmedon', 'hub', $hublink), 'notifysuccess');
echo $notificationmessage;
+3 -3
View File
@@ -22,9 +22,9 @@
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL
* @copyright (C) 1999 onwards Martin Dougiamas http://dougiamas.com
*
* On this page the administrator selects which hub he wants to register,
* except for MOOCH. Admins can register with MOOCH with the top admin menu "Registration" link.
* On this page the administrator can also unregister from any hubs, including MOOCH.
* On this page the administrator selects which hub he wants to register (except for moodle.net)
* Admins can register with moodle.net via the site admin menu "Registration" link.
* On this page the administrator can also unregister from any hubs including moodle.net.
*/
require('../../config.php');
+22 -23
View File
@@ -53,31 +53,30 @@ class registration_manager {
public function cron() {
global $CFG;
if (extension_loaded('xmlrpc')) {
//check if the last registration cron update was less than a week ago
$lastcron = get_config('registration', 'crontime');
if ($lastcron === false or $lastcron < strtotime("-7 day")) { //set to a week, see MDL-23704
$function = 'hub_update_site_info';
require_once($CFG->dirroot . "/webservice/xmlrpc/lib.php");
$function = 'hub_update_site_info';
require_once($CFG->dirroot . "/webservice/xmlrpc/lib.php");
//update all hub where the site is registered on
$hubs = $this->get_registered_on_hubs();
foreach ($hubs as $hub) {
//update the registration
$siteinfo = $this->get_site_info($hub->huburl);
$params = array('siteinfo' => $siteinfo);
$serverurl = $hub->huburl . "/local/hub/webservice/webservices.php";
$xmlrpcclient = new webservice_xmlrpc_client($serverurl, $hub->token);
try {
$result = $xmlrpcclient->call($function, $params);
mtrace(get_string('siteupdatedcron', 'hub', $hub->hubname));
} catch (Exception $e) {
$errorparam = new stdClass();
$errorparam->errormessage = $e->getMessage();
$errorparam->hubname = $hub->hubname;
mtrace(get_string('errorcron', 'hub', $errorparam));
}
// Update all hubs where the site is registered.
$hubs = $this->get_registered_on_hubs();
if (empty($hubs)) {
mtrace(get_string('registrationwarning', 'admin'));
}
foreach ($hubs as $hub) {
// Update the registration.
$siteinfo = $this->get_site_info($hub->huburl);
$params = array('siteinfo' => $siteinfo);
$serverurl = $hub->huburl . "/local/hub/webservice/webservices.php";
$xmlrpcclient = new webservice_xmlrpc_client($serverurl, $hub->token);
try {
$result = $xmlrpcclient->call($function, $params);
$this->update_registeredhub($hub); // To update timemodified.
mtrace(get_string('siteupdatedcron', 'hub', $hub->hubname));
} catch (Exception $e) {
$errorparam = new stdClass();
$errorparam->errormessage = $e->getMessage();
$errorparam->hubname = $hub->hubname;
mtrace(get_string('errorcron', 'hub', $errorparam));
}
set_config('crontime', time(), 'registration');
}
} else {
mtrace(get_string('errorcronnoxmlrpc', 'hub'));
+7
View File
@@ -177,6 +177,13 @@ if (!empty($error)) {
//some Moodle.org resitration explanation
if ($huburl == HUB_MOODLEORGHUBURL) {
if (!empty($registeredhub->token)) {
$registrationmessage = get_string('pleaserefreshregistration', 'admin');
} else {
$registrationmessage = get_string('registrationwarning', 'admin');
}
echo $OUTPUT->notification($registrationmessage);
echo $OUTPUT->heading(get_string('registerwithmoodleorg', 'admin'));
$renderer = $PAGE->get_renderer('core', 'register');
echo $renderer->moodleorg_registration_message();
+11 -6
View File
@@ -36,13 +36,18 @@ class core_register_renderer extends plugin_renderer_base {
* @return string
*/
public function moodleorg_registration_message() {
$moodleorgurl = html_writer::link('http://moodle.org', 'Moodle.org');
$moodleorgstatsurl = html_writer::link('http://moodle.org/stats', get_string('statsmoodleorg', 'admin'));
$moochurl = html_writer::link(HUB_MOODLEORGHUBURL, get_string('moodleorghubname', 'admin'));
$moodleorgregmsg = get_string('registermoodleorg', 'admin', $moodleorgurl);
$moodleorgstatslink = html_writer::link('http://moodle.net/stats',
get_string('statsmoodleorg', 'admin'),
array('target' => '_blank'));
$hublink = html_writer::link('https://moodle.net/mod/page/view.php?id=1',
get_string('moodleorghubname', 'admin'),
array('target' => '_blank'));
$moodleorgregmsg = get_string('registermoodleorg', 'admin', $hublink);
$items = array(get_string('registermoodleorgli1', 'admin'),
get_string('registermoodleorgli2', 'admin', $moodleorgstatsurl),
get_string('registermoodleorgli3', 'admin', $moochurl));
get_string('registermoodleorgli2', 'admin', $moodleorgstatslink));
$moodleorgregmsg .= html_writer::alist($items);
return $moodleorgregmsg;
}
+14 -4
View File
@@ -264,6 +264,7 @@ if (($action == 'edit') || ($action == 'new')) {
$strshow = get_string('on', 'repository');
$strhide = get_string('off', 'repository');
$strdelete = get_string('disabled', 'repository');
$struninstall = get_string('uninstallplugin', 'core_admin');
$actionchoicesforexisting = array(
'show' => $strshow,
@@ -286,9 +287,9 @@ if (($action == 'edit') || ($action == 'new')) {
// Table to list plug-ins
$table = new html_table();
$table->head = array(get_string('name'), get_string('isactive', 'repository'), get_string('order'), $settingsstr);
$table->head = array(get_string('name'), get_string('isactive', 'repository'), get_string('order'), $settingsstr, $struninstall);
$table->colclasses = array('leftalign', 'centeralign', 'centeralign', 'centeralign', 'centeralign');
$table->colclasses = array('leftalign', 'centeralign', 'centeralign', 'centeralign', 'centeralign', 'centeralign');
$table->id = 'repositoriessetting';
$table->data = array();
$table->attributes['class'] = 'admintable generaltable';
@@ -384,7 +385,12 @@ if (($action == 'edit') || ($action == 'new')) {
$updowncount++;
$table->data[] = array($i->get_readablename(), $OUTPUT->render($select), $updown, $settings);
$uninstall = '';
if ($uninstallurl = core_plugin_manager::instance()->get_uninstall_url('repository_' . $typename, 'manage')) {
$uninstall = html_writer::link($uninstallurl, $struninstall);
}
$table->data[] = array($i->get_readablename(), $OUTPUT->render($select), $updown, $settings, $uninstall);
if (!in_array($typename, $alreadyplugins)) {
$alreadyplugins[] = $typename;
@@ -400,7 +406,11 @@ if (($action == 'edit') || ($action == 'new')) {
if (!in_array($plugin, $alreadyplugins)) {
$select = new single_select(repository_action_url($plugin, 'repos'), 'action', $actionchoicesfornew, 'delete', null, 'applyto' . basename($plugin));
$select->set_label(get_string('action'), array('class' => 'accesshide'));
$table->data[] = array(get_string('pluginname', 'repository_'.$plugin), $OUTPUT->render($select), '', '');
$uninstall = '';
if ($uninstallurl = core_plugin_manager::instance()->get_uninstall_url('repository_' . $plugin, 'manage')) {
$uninstall = html_writer::link($uninstallurl, $struninstall);
}
$table->data[] = array(get_string('pluginname', 'repository_'.$plugin), $OUTPUT->render($select), '', '', $uninstall);
}
}
}
@@ -472,7 +472,9 @@ class core_role_define_role_table_advanced extends core_role_capability_table_wi
}
protected function get_description_field($id) {
return print_textarea(true, 10, 50, 50, 10, 'description', $this->role->description, 0, true);
return '<textarea class="form-textarea" id="'. s($id) .'" name="description" rows="10" cols="50">' .
htmlspecialchars($this->role->description) .
'</textarea>';
}
protected function get_archetype_field($id) {
+1 -1
View File
@@ -46,7 +46,7 @@ if ($hassiteconfig or has_any_capability($capabilities, $systemcontext)) {
$ADMIN->add('courses',
new admin_externalpage('restorecourse', new lang_string('restorecourse', 'admin'),
new moodle_url('/backup/restorefile.php', array('contextid' => context_system::instance()->id)),
array('moodle/course:create')
array('moodle/restore:restorecourse')
)
);
+2
View File
@@ -75,6 +75,8 @@ if (has_capability('moodle/grade:manage', $systemcontext)
$temp->add(new admin_setting_special_gradepointmax());
$temp->add(new admin_setting_special_gradepointdefault());
$temp->add(new admin_setting_special_grademinmaxtouse());
}
$ADMIN->add('grades', $temp);
+24
View File
@@ -114,6 +114,30 @@ class behat_admin extends behat_base {
}
}
/**
* Sets the specified site settings. A table with | config | value | (optional)plugin | is expected.
*
* @Given /^the following config values are set as admin:$/
* @param TableNode $table
*/
public function the_following_config_values_are_set_as_admin(TableNode $table) {
if (!$data = $table->getRowsHash()) {
return;
}
foreach ($data as $config => $value) {
// Default plugin value is null.
$plugin = null;
if (is_array($value)) {
$plugin = $value[1];
$value = $value[0];
}
set_config($config, $value, $plugin);
}
}
/**
* Waits with the provided params if we are running a JS session.
*
+6 -6
View File
@@ -7,10 +7,10 @@ Feature: An administrator can filter user accounts by role, cohort and other pro
Background:
Given the following "users" exist:
| username | firstname | lastname | email | auth | confirmed |
| user1 | User | One | one@asd.com | manual | 0 |
| user2 | User | Two | two@asd.com | ldap | 1 |
| user3 | User | Three | three@asd.com | manual | 1 |
| user4 | User | Four | four@asd.com | ldap | 0 |
| user1 | User | One | one@example.com | manual | 0 |
| user2 | User | Two | two@example.com | ldap | 1 |
| user3 | User | Three | three@example.com | manual | 1 |
| user4 | User | Four | four@example.com | ldap | 0 |
And the following "cohorts" exist:
| name | idnumber |
| Cohort 1 | CH1 |
@@ -23,8 +23,8 @@ Feature: An administrator can filter user accounts by role, cohort and other pro
| user2 | C1 | student |
| user3 | C1 | student |
And I log in as "admin"
And I add "User Two (two@asd.com)" user to "CH1" cohort members
And I add "User Three (three@asd.com)" user to "CH1" cohort members
And I add "User Two (two@example.com)" user to "CH1" cohort members
And I add "User Three (three@example.com)" user to "CH1" cohort members
And I follow "Browse list of users"
@javascript
@@ -13,15 +13,13 @@ Feature: Set admin settings value
And I should not see "C_shortname Course fullname"
Scenario: set admin value with full name
Given I set the following administration settings values:
| Display extended course names | 1 |
When I press "Save changes"
Given the following config values are set as admin:
| courselistshortnames | 1 |
And I am on homepage
Then I should see "C_shortname Course fullname"
Scenario: set admin value with short name
Given I set the following administration settings values:
Given the following config values are set as admin:
| courselistshortnames | 1 |
When I press "Save changes"
And I am on homepage
Then I should see "C_shortname Course fullname"
+2 -2
View File
@@ -21,7 +21,7 @@ Feature: Upload users
And I should see "Tom"
And I should see "Jones"
And I should see "verysecret"
And I should see "jonest@someplace.edu"
And I should see "jonest@example.com"
And I should see "Reznor"
And I should see "course1"
And I should see "math102"
@@ -32,7 +32,7 @@ Feature: Upload users
And I follow "Browse list of users"
And I should see "Tom Jones"
And I should see "Trent Reznor"
And I should see "reznor@someplace.edu"
And I should see "reznor@example.com"
And I am on homepage
And I follow "Maths"
And I expand "Users" node
@@ -13,8 +13,8 @@ Feature: Manage availability conditions
Then I should not see "Availability restrictions"
# Enable it and check I can now see and click on it.
And I set the following administration settings values:
| Enable conditional access | 1 |
And the following config values are set as admin:
| enableavailability | 1 |
And I am on homepage
And I navigate to "Manage restrictions" node in "Site administration > Plugins > Availability restrictions"
@@ -28,9 +28,9 @@ Feature: Manage availability conditions
Given the following "courses" exist:
| fullname | shortname | format |
| Course 1 | C1 | topics |
And the following config values are set as admin:
| enableavailability | 1 |
And I log in as "admin"
And I set the following administration settings values:
| Enable conditional access | 1 |
And I am on homepage
When I navigate to "Manage restrictions" node in "Site administration > Plugins > Availability restrictions"
+8 -16
View File
@@ -44,13 +44,19 @@ require_once(__DIR__ . '/../../../../lib/behat/lib.php');
chdir(__DIR__);
$output = null;
exec("php util.php --diag", $output, $code);
// Ensure we have composer installed, before we install or re-install test site.
if ($code == TESTING_EXITCODE_COMPOSER || $code == BEHAT_EXITCODE_INSTALL || $code == BEHAT_EXITCODE_REINSTALL) {
testing_update_composer_dependencies();
chdir(__DIR__);
exec("php util.php --diag", $output, $code);
}
if ($code == 0) {
echo "Behat test environment already installed\n";
} else if ($code == BEHAT_EXITCODE_INSTALL) {
testing_update_composer_dependencies();
// Behat and dependencies are installed and we need to install the test site.
chdir(__DIR__);
passthru("php util.php --install", $code);
@@ -60,8 +66,6 @@ if ($code == 0) {
} else if ($code == BEHAT_EXITCODE_REINSTALL) {
testing_update_composer_dependencies();
// Test site data is outdated.
chdir(__DIR__);
passthru("php util.php --drop", $code);
@@ -74,18 +78,6 @@ if ($code == 0) {
exit($code);
}
} else if ($code == BEHAT_EXITCODE_COMPOSER) {
// Missing Behat dependencies.
testing_update_composer_dependencies();
// Returning to admin/tool/behat/cli.
chdir(__DIR__);
passthru("php util.php --install", $code);
if ($code != 0) {
exit($code);
}
} else {
// Generic error, we just output it.
echo implode("\n", $output)."\n";
+1 -1
View File
@@ -165,7 +165,7 @@ class tool_behat_renderer extends plugin_renderer_base {
// Info.
$installurl = behat_command::DOCS_URL . '#Installation';
$installlink = html_writer::tag('a', $installurl, array('href' => $installurl, 'target' => '_blank'));
$writetestsurl = behat_command::DOCS_URL . '#Writting_features';
$writetestsurl = behat_command::DOCS_URL . '#Writing_features';
$writetestslink = html_writer::tag('a', $writetestsurl, array('href' => $writetestsurl, 'target' => '_blank'));
$writestepsurl = behat_command::DOCS_URL . '#Adding_steps_definitions';
$writestepslink = html_writer::tag('a', $writestepsurl, array('href' => $writestepsurl, 'target' => '_blank'));
@@ -69,8 +69,8 @@ Feature: Set up contextual data for tests
Scenario: Role overrides
Given the following "users" exist:
| username | firstname | lastname | email |
| teacher1 | Teacher | 1 | teacher1@asd.com |
| student1 | Student | 1 | student1@asd.com |
| teacher1 | Teacher | 1 | teacher1@example.com |
| student1 | Student | 1 | student1@example.com |
And the following "categories" exist:
| name | category | idnumber |
| Cat 1 | 0 | CAT1 |
@@ -99,7 +99,7 @@ Feature: Set up contextual data for tests
Scenario: Add course enrolments
Given the following "users" exist:
| username | firstname | lastname | email |
| student1 | Student | 1 | student1@asd.com |
| student1 | Student | 1 | student1@example.com |
And the following "courses" exist:
| fullname | shortname | format |
| Course 1 | C1 | topics |
@@ -117,11 +117,11 @@ Feature: Set up contextual data for tests
| Custom student | custom2 | | |
And the following "users" exist:
| username | firstname | lastname | email |
| user1 | User | 1 | user1@moodlemoodle.com |
| user2 | User | 2 | user2@moodlemoodle.com |
| user3 | User | 3 | user3@moodlemoodle.com |
| user4 | User | 4 | user4@moodlemoodle.com |
| user5 | User | 5 | user5@moodlemoodle.com |
| user1 | User | 1 | user1@example.com |
| user2 | User | 2 | user2@example.com |
| user3 | User | 3 | user3@example.com |
| user4 | User | 4 | user4@example.com |
| user5 | User | 5 | user5@example.com |
And the following "categories" exist:
| name | category | idnumber |
| Cat 1 | 0 | CAT1 |
@@ -229,8 +229,8 @@ Feature: Set up contextual data for tests
Scenario: Add relations between users and groups
Given the following "users" exist:
| username | firstname | lastname | email |
| student1 | Student | 1 | student1@asd.com |
| student2 | Student | 2 | student2@asd.com |
| student1 | Student | 1 | student1@example.com |
| student2 | Student | 2 | student2@example.com |
And the following "courses" exist:
| fullname | shortname |
| Course 1 | C1 |
@@ -269,8 +269,8 @@ Feature: Set up contextual data for tests
| Cat 1 | 0 | CAT1 |
And the following "users" exist:
| username | firstname | lastname | email |
| student1 | Student | 1 | student1@asd.com |
| student2 | Student | 2 | student2@asd.com |
| student1 | Student | 1 | student1@example.com |
| student2 | Student | 2 | student2@example.com |
And the following "cohorts" exist:
| name | idnumber |
| System cohort A | CHSA |
@@ -385,9 +385,9 @@ Feature: Set up contextual data for tests
And the following "grade outcomes" exist:
| fullname | shortname | course | scale |
| Grade outcome 2 | OT2 | C1 | Test Scale 1 |
And the following config values are set as admin:
| enableoutcomes | 1 |
When I log in as "admin"
And I set the following administration settings values:
| Enable outcomes | 1 |
And I follow "Home"
And I follow "Course 1"
And I follow "Outcomes"
@@ -414,9 +414,9 @@ Feature: Set up contextual data for tests
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"
And I set the following administration settings values:
| Enable outcomes | 1 |
And I follow "Home"
And I follow "Course 1"
And I follow "Grades"
@@ -7,7 +7,7 @@ Feature: Edit capabilities
Background:
Given the following "users" exist:
| username | firstname | lastname | email |
| teacher1 | Teacher | 1 | teacher1@asd.com |
| teacher1 | Teacher | 1 | teacher1@example.com |
And the following "courses" exist:
| fullname | shortname | category |
| Course 1 | C1 | 0 |
@@ -10,9 +10,9 @@ Feature: Verify that all form fields values can be get and set
| Course 1 | C1 | 0 |
And the following "users" exist:
| username | email | firstname | lastname |
| student1 | s1@asd.com | Student | 1 |
| student2 | s2@asd.com | Student | 2 |
| student3 | s3@asd.com | Student | 3 |
| student1 | s1@example.com | Student | 1 |
| student2 | s2@example.com | Student | 2 |
| student3 | s3@example.com | Student | 3 |
And the following "course enrolments" exist:
| user | course | role |
| student1 | C1 | student |
@@ -91,19 +91,24 @@ class store implements \tool_log\log\store, \core\log\sql_select_reader {
// Replace the query with hardcoded mappings required for core.
list($selectwhere, $params, $sort) = self::replace_sql_legacy($selectwhere, $params, $sort);
$events = array();
$records = array();
try {
$records = $DB->get_records_select('log', $selectwhere, $params, $sort, '*', $limitfrom, $limitnum);
// A custom report + on the fly SQL rewriting = a possible exception.
$records = $DB->get_recordset_select('log', $selectwhere, $params, $sort, '*', $limitfrom, $limitnum);
} catch (\moodle_exception $ex) {
debugging("error converting legacy event data " . $ex->getMessage() . $ex->debuginfo, DEBUG_DEVELOPER);
return array();
}
$events = array();
foreach ($records as $data) {
$events[$data->id] = \logstore_legacy\event\legacy_logged::restore_legacy($data);
}
$records->close();
return $events;
}
@@ -44,11 +44,26 @@ class cleanup_task extends \core\task\scheduled_task {
public function execute() {
global $CFG, $DB;
// Delete old logs to save space (this might need a timer to slow it down...).
if (!empty($CFG->loglifetime)) { // Value in days.
$loglifetime = time(0) - ($CFG->loglifetime * 3600 * 24);
$DB->delete_records_select("log", "time < ?", array($loglifetime));
mtrace(" Deleted old legacy log records");
if (empty($CFG->loglifetime)) {
return;
}
$loglifetime = time() - ($CFG->loglifetime * 3600 * 24); // Value in days.
$lifetimep = array($loglifetime);
$start = time();
while ($min = $DB->get_field_select("log", "MIN(time)", "time < ?", $lifetimep)) {
// Break this down into chunks to avoid transaction for too long and generally thrashing database.
// Experiments suggest deleting one day takes up to a few seconds; probably a reasonable chunk size usually.
// If the cleanup has just been enabled, it might take e.g a month to clean the years of logs.
$params = array(min($min + 3600 * 24, $loglifetime));
$DB->delete_records_select("log", "time < ?", $params);
if (time() > $start + 300) {
// Do not churn on log deletion for too long each run.
break;
}
}
mtrace(" Deleted old legacy log records");
}
}
@@ -273,4 +273,33 @@ class logstore_legacy_store_testcase extends advanced_testcase {
$this->assertContains($expectedreport, $reports);
}
}
/**
* Test that the legacy log cleanup works correctly.
*/
public function test_cleanup_task() {
global $DB;
$this->resetAfterTest();
// Create some records spread over various days; test multiple iterations in cleanup.
$record = (object) array('time' => time());
$DB->insert_record('log', $record);
$record->time -= 3600 * 24 * 30;
$DB->insert_record('log', $record);
$record->time -= 3600 * 24 * 30;
$DB->insert_record('log', $record);
$record->time -= 3600 * 24 * 30;
$DB->insert_record('log', $record);
$this->assertEquals(4, $DB->count_records('log'));
// Remove all logs before "today".
set_config('loglifetime', 1);
$this->expectOutputString(" Deleted old legacy log records\n");
$clean = new \logstore_legacy\task\cleanup_task();
$clean->execute();
$this->assertEquals(1, $DB->count_records('log'));
}
}
@@ -72,7 +72,7 @@ class store implements \tool_log\log\writer, \core\log\sql_internal_reader {
$sort = self::tweak_sort_by_id($sort);
$events = array();
$records = $DB->get_records_select('logstore_standard_log', $selectwhere, $params, $sort, '*', $limitfrom, $limitnum);
$records = $DB->get_recordset_select('logstore_standard_log', $selectwhere, $params, $sort, '*', $limitfrom, $limitnum);
foreach ($records as $data) {
$extra = array('origin' => $data->origin, 'ip' => $data->ip, 'realuserid' => $data->realuserid);
@@ -94,6 +94,8 @@ class store implements \tool_log\log\writer, \core\log\sql_internal_reader {
}
}
$records->close();
return $events;
}
@@ -43,12 +43,29 @@ class cleanup_task extends \core\task\scheduled_task {
*/
public function execute() {
global $DB;
$loglifetime = (int)get_config('logstore_standard', 'loglifetime');
if ($loglifetime > 0) {
$loglifetime = time() - ($loglifetime * 3600 * 24); // Value in days.
$DB->delete_records_select("logstore_standard_log", "timecreated < ?", array($loglifetime));
mtrace(" Deleted old log records from standard store.");
if (empty($loglifetime) || $loglifetime < 0) {
return;
}
$loglifetime = time() - ($loglifetime * 3600 * 24); // Value in days.
$lifetimep = array($loglifetime);
$start = time();
while ($min = $DB->get_field_select("logstore_standard_log", "MIN(timecreated)", "timecreated < ?", $lifetimep)) {
// Break this down into chunks to avoid transaction for too long and generally thrashing database.
// Experiments suggest deleting one day takes up to a few seconds; probably a reasonable chunk size usually.
// If the cleanup has just been enabled, it might take e.g a month to clean the years of logs.
$params = array(min($min + 3600 * 24, $loglifetime));
$DB->delete_records_select("logstore_standard_log", "timecreated < ?", $params);
if (time() > $start + 300) {
// Do not churn on log deletion for too long each run.
break;
}
}
mtrace(" Deleted old log records from standard store.");
}
}
@@ -218,4 +218,41 @@ class logstore_standard_store_testcase extends advanced_testcase {
$this->assertContains($expectedreport, $reports);
}
}
/**
* Test that the standard log cleanup works correctly.
*/
public function test_cleanup_task() {
global $DB;
$this->resetAfterTest();
// Create some records spread over various days; test multiple iterations in cleanup.
$ctx = context_course::instance(1);
$record = (object) array(
'edulevel' => 0,
'contextid' => $ctx->id,
'contextlevel' => $ctx->contextlevel,
'contextinstanceid' => $ctx->instanceid,
'userid' => 1,
'timecreated' => time(),
);
$DB->insert_record('logstore_standard_log', $record);
$record->timecreated -= 3600 * 24 * 30;
$DB->insert_record('logstore_standard_log', $record);
$record->timecreated -= 3600 * 24 * 30;
$DB->insert_record('logstore_standard_log', $record);
$record->timecreated -= 3600 * 24 * 30;
$DB->insert_record('logstore_standard_log', $record);
$this->assertEquals(4, $DB->count_records('logstore_standard_log'));
// Remove all logs before "today".
set_config('loglifetime', 1, 'logstore_standard');
$this->expectOutputString(" Deleted old log records from standard store.\n");
$clean = new \logstore_standard\task\cleanup_task();
$clean->execute();
$this->assertEquals(1, $DB->count_records('logstore_standard_log'));
}
}
+2 -2
View File
@@ -41,9 +41,9 @@ if ($hassiteconfig) {
$settings->add(new admin_setting_heading('messageinbound_mailboxconfiguration',
new lang_string('mailboxconfiguration', 'tool_messageinbound'),
new lang_string('messageinboundmailboxconfiguration_desc', 'tool_messageinbound'), ''));
$settings->add(new admin_setting_configtext('messageinbound_mailbox',
$settings->add(new admin_setting_configtext_with_maxlength('messageinbound_mailbox',
new lang_string('mailbox', 'tool_messageinbound'),
null, '', PARAM_RAW));
null, '', PARAM_RAW, null, 15));
$settings->add(new admin_setting_configtext('messageinbound_domain',
new lang_string('domain', 'tool_messageinbound'),
null, '', PARAM_RAW));
@@ -215,7 +215,10 @@ class rules extends \table_sql implements \renderable {
return false;
}
$orderby = 'visible DESC, sortorder ASC';
$options = array(0 => get_string('site'));
$options = array();
if (has_capability('tool/monitor:subscribe', \context_system::instance())) {
$options[0] = get_string('site');
}
if ($courses = get_user_capability_course('tool/monitor:subscribe', null, true, 'fullname', $orderby)) {
foreach ($courses as $course) {
$options[$course->id] = format_string($course->fullname, true,
@@ -223,7 +226,7 @@ class rules extends \table_sql implements \renderable {
}
}
$url = new \moodle_url('/admin/tool/monitor/index.php');
$select = new \single_select($url, 'courseid', $options, $this->courseid);
$select = new \single_select($url, 'courseid', $options, $this->courseid, array());
$select->set_label(get_string('selectacourse', 'tool_monitor'));
return $select;
}
+1
View File
@@ -35,6 +35,7 @@ $confirm = optional_param('confirm', false, PARAM_BOOL);
// Validate course id.
if (empty($courseid)) {
require_login();
require_capability('tool/monitor:subscribe', context_system::instance());
} else {
// They might want to see rules for this course.
$course = get_course($courseid);
+1 -1
View File
@@ -10,7 +10,7 @@ Feature: tool_monitor_rule
| Course 1 | C1 |
And the following "users" exist:
| username | firstname | lastname | email |
| teacher1 | Teacher | 1 | teacher1@asd.com |
| teacher1 | Teacher | 1 | teacher1@example.com |
And the following "course enrolments" exist:
| user | course | role |
| teacher1 | C1 | editingteacher |
@@ -11,8 +11,8 @@ Feature: tool_monitor_subscriptions
| Course 2 | C2 |
And the following "users" exist:
| username | firstname | lastname | email |
| teacher1 | Teacher | 1 | teacher1@asd.com |
| teacher2 | Teacher | 2 | teacher2@asd.com |
| teacher1 | Teacher | 1 | teacher1@example.com |
| teacher2 | Teacher | 2 | teacher2@example.com |
And the following "course enrolments" exist:
| user | course | role |
| teacher1 | C1 | editingteacher |
@@ -150,8 +150,6 @@ Feature: tool_monitor_subscriptions
And I should see "You can subscribe to rules from the Event monitoring page."
And I click on "//a[text()='Event monitoring']" "xpath_element"
And the field "courseid" matches value "Course 1"
And I set the field "courseid" to "Site"
And I should not see "You can manage rules from the Event monitoring rules page."
And I log out
And I log in as "teacher2"
And I follow "Course 1"
+22 -18
View File
@@ -109,25 +109,29 @@ if ($execute = $options['execute']) {
$predbqueries = $DB->perf_get_queries();
$pretime = microtime(true);
mtrace("Scheduled task: " . $task->get_name());
// NOTE: it would be tricky to move this code to \core\task\manager class,
// because we want to do detailed error reporting.
$cronlockfactory = \core\lock\lock_config::get_lock_factory('cron');
if (!$cronlock = $cronlockfactory->get_lock('core_cron', 10)) {
mtrace('Cannot obtain cron lock');
exit(129);
}
if (!$lock = $cronlockfactory->get_lock('\\' . get_class($task), 10)) {
$cronlock->release();
mtrace('Cannot obtain task lock');
exit(130);
}
$task->set_lock($lock);
if (!$task->is_blocking()) {
$cronlock->release();
} else {
$task->set_cron_lock($cronlock);
}
try {
mtrace("Scheduled task: " . $task->get_name());
// NOTE: it would be tricky to move this code to \core\task\manager class,
// because we want to do detailed error reporting.
$cronlockfactory = \core\lock\lock_config::get_lock_factory('cron');
if (!$cronlock = $cronlockfactory->get_lock('core_cron', 10)) {
mtrace('Cannot obtain cron lock');
exit(129);
}
if (!$lock = $cronlockfactory->get_lock('\\' . get_class($task), 10)) {
mtrace('Cannot obtain task lock');
exit(130);
}
$task->set_lock($lock);
if (!$task->is_blocking()) {
$cronlock->release();
} else {
$task->set_cron_lock($cronlock);
}
get_mailer('buffer');
$task->execute();
if (isset($predbqueries)) {
+20 -4
View File
@@ -402,8 +402,13 @@ function uu_pre_process_custom_profile_data($data) {
function uu_check_custom_profile_data(&$data) {
global $CFG, $DB;
$noerror = true;
// find custom profile fields and check if data needs to converted.
$testuserid = null;
if (!empty($data['username'])) {
if (preg_match('/id=(.*)"/i', $data['username'], $result)) {
$testuserid = $result[1];
}
}
// Find custom profile fields and check if data needs to converted.
foreach ($data as $key => $value) {
if (preg_match('/^profile_field_/', $key)) {
$shortname = str_replace('profile_field_', '', $key);
@@ -413,13 +418,24 @@ function uu_check_custom_profile_data(&$data) {
$newfield = 'profile_field_'.$field->datatype;
$formfield = new $newfield($field->id, 0);
if (method_exists($formfield, 'convert_external_data') &&
is_null($formfield->convert_external_data($value))) {
is_null($formfield->convert_external_data($value))) {
$data['status'][] = get_string('invaliduserfield', 'error', $shortname);
$noerror = false;
}
// Check for duplicate value.
if (method_exists($formfield, 'edit_validate_field') ) {
$testuser = new stdClass();
$testuser->{$key} = $value;
$testuser->id = $testuserid;
$err = $formfield->edit_validate_field($testuser);
if (!empty($err[$key])) {
$data['status'][] = $err[$key].' ('.$key.')';
$noerror = false;
}
}
}
}
}
}
return $noerror;
}
}
+7 -2
View File
@@ -190,9 +190,14 @@
// We don't need to check the fullnamedisplay setting here as the fullname function call further down has
// the override parameter set to true.
$fullnamesetting = $CFG->alternativefullnameformat;
// If we are using language or it is empty, then retrieve all of the user's names.
// If we are using language or it is empty, then retrieve the default user names of just 'firstname' and 'lastname'.
if ($fullnamesetting == 'language' || empty($fullnamesetting)) {
$fullnamesetting = implode(' ', $allusernamefields);
// Set $a variables to return 'firstname' and 'lastname'.
$a = new stdClass();
$a->firstname = 'firstname';
$a->lastname = 'lastname';
// Getting the fullname display will ensure that the order in the language file is maintained.
$fullnamesetting = get_string('fullnamedisplay', null, $a);
}
// Order in string will ensure that the name columns are in the correct order.
+4 -4
View File
@@ -139,12 +139,12 @@ class auth_plugin_email extends auth_plugin_base {
$user = get_complete_user_data('username', $username);
if (!empty($user)) {
if ($user->confirmed) {
return AUTH_CONFIRM_ALREADY;
} else if ($user->auth != $this->authtype) {
if ($user->auth != $this->authtype) {
return AUTH_CONFIRM_ERROR;
} else if ($user->secret == $confirmsecret && $user->confirmed) {
return AUTH_CONFIRM_ALREADY;
} else if ($user->secret == $confirmsecret) { // They have provided the secret key to get in
$DB->set_field("user", "confirmed", 1, array("id"=>$user->id));
if ($user->firstaccess == 0) {
+1 -1
View File
@@ -24,7 +24,7 @@
$string['auth_emaildescription'] = '<p>Email-based self-registration enables a user to create their own account via a \'Create new account\' button on the login page. The user then receives an email containing a secure link to a page where they can confirm their account. Future logins just check the username and password against the stored values in the Moodle database.</p><p>Note: In addition to enabling the plugin, email-based self-registration must also be selected from the self registration drop-down menu on the \'Manage authentication\' page.</p>';
$string['auth_emailnoemail'] = 'Tried to send you an email but failed!';
$string['auth_emailrecaptcha'] = 'Adds a visual/audio confirmation form element to the signup page for email self-registering users. This protects your site against spammers and contributes to a worthwhile cause. See http://www.google.com/recaptcha/learnmore for more details. <br /><em>PHP cURL extension is required.</em>';
$string['auth_emailrecaptcha'] = 'Adds a visual/audio confirmation form element to the sign-up page for email self-registering users. This protects your site against spammers and contributes to a worthwhile cause. See http://www.google.com/recaptcha for more details.';
$string['auth_emailrecaptcha_key'] = 'Enable reCAPTCHA element';
$string['auth_emailsettings'] = 'Settings';
$string['pluginname'] = 'Email-based self-registration';
+13 -8
View File
@@ -534,6 +534,7 @@ class auth_plugin_ldap extends auth_plugin_base {
*
* @param object $user new user object
* @param boolean $notify print notice with link and terminate
* @return boolean success
*/
function user_signup($user, $notify=true) {
global $CFG, $DB, $PAGE, $OUTPUT;
@@ -604,12 +605,12 @@ class auth_plugin_ldap extends auth_plugin_base {
$user = get_complete_user_data('username', $username);
if (!empty($user)) {
if ($user->confirmed) {
return AUTH_CONFIRM_ALREADY;
} else if ($user->auth != $this->authtype) {
if ($user->auth != $this->authtype) {
return AUTH_CONFIRM_ERROR;
} else if ($user->secret == $confirmsecret && $user->confirmed) {
return AUTH_CONFIRM_ALREADY;
} else if ($user->secret == $confirmsecret) { // They have provided the secret key to get in
if (!$this->user_activate($username)) {
return AUTH_CONFIRM_FAIL;
@@ -889,7 +890,7 @@ class auth_plugin_ldap extends auth_plugin_base {
foreach ($users as $user) {
echo "\t"; print_string('auth_dbupdatinguser', 'auth_db', array('name'=>$user->username, 'id'=>$user->id));
if (!$this->update_user_record($user->username, $updatekeys)) {
if (!$this->update_user_record($user->username, $updatekeys, true)) {
echo ' - '.get_string('skipped');
}
echo "\n";
@@ -987,8 +988,11 @@ class auth_plugin_ldap extends auth_plugin_base {
*
* @param string $username username
* @param boolean $updatekeys true to update the local record with the external LDAP values.
* @param bool $triggerevent set false if user_updated event should not be triggered.
* This will not affect user_password_updated event triggering.
* @return stdClass|bool updated user record or false if there is no new info to update.
*/
function update_user_record($username, $updatekeys = false) {
function update_user_record($username, $updatekeys = false, $triggerevent = false) {
global $CFG, $DB;
// Just in case check text case
@@ -1030,7 +1034,7 @@ class auth_plugin_ldap extends auth_plugin_base {
}
}
}
user_update_user($newuser, false, false);
user_update_user($newuser, false, $triggerevent);
}
} else {
return false;
@@ -1653,7 +1657,8 @@ class auth_plugin_ldap extends auth_plugin_base {
$_SERVER['HTTP_REFERER'] != $CFG->wwwroot &&
$_SERVER['HTTP_REFERER'] != $CFG->wwwroot.'/' &&
$_SERVER['HTTP_REFERER'] != $CFG->httpswwwroot.'/login/' &&
$_SERVER['HTTP_REFERER'] != $CFG->httpswwwroot.'/login/index.php')
$_SERVER['HTTP_REFERER'] != $CFG->httpswwwroot.'/login/index.php' &&
clean_param($_SERVER['HTTP_REFERER'], PARAM_LOCALURL) != '')
? $_SERVER['HTTP_REFERER'] : NULL;
}
+67 -1
View File
@@ -136,9 +136,25 @@ class auth_ldap_plugin_testcase extends advanced_testcase {
$auth = get_auth_plugin('ldap');
ob_start();
$sink = $this->redirectEvents();
$auth->sync_users(true);
$events = $sink->get_events();
$sink->close();
ob_end_clean();
// Check events, 5 users created with 2 users having roles.
$this->assertCount(7, $events);
foreach ($events as $index => $event) {
$usercreatedindex = array(0, 2, 4, 5, 6);
$roleassignedindex = array (1, 3);
if (in_array($index, $usercreatedindex)) {
$this->assertInstanceOf('\core\event\user_created', $event);
}
if (in_array($index, $roleassignedindex)) {
$this->assertInstanceOf('\core\event\role_assigned', $event);
}
}
$this->assertEquals(5, $DB->count_records('user', array('auth'=>'ldap')));
$this->assertEquals(2, $DB->count_records('role_assignments'));
$this->assertEquals(2, $DB->count_records('role_assignments', array('roleid'=>$creatorrole->id)));
@@ -150,9 +166,15 @@ class auth_ldap_plugin_testcase extends advanced_testcase {
$this->delete_ldap_user($connection, $topdn, 1);
ob_start();
$sink = $this->redirectEvents();
$auth->sync_users(true);
$events = $sink->get_events();
$sink->close();
ob_end_clean();
// Check events, no new event.
$this->assertCount(0, $events);
$this->assertEquals(5, $DB->count_records('user', array('auth'=>'ldap')));
$this->assertEquals(0, $DB->count_records('user', array('suspended'=>1)));
$this->assertEquals(0, $DB->count_records('user', array('deleted'=>1)));
@@ -166,9 +188,17 @@ class auth_ldap_plugin_testcase extends advanced_testcase {
$auth = get_auth_plugin('ldap');
ob_start();
$sink = $this->redirectEvents();
$auth->sync_users(true);
$events = $sink->get_events();
$sink->close();
ob_end_clean();
// Check events, 1 user got updated.
$this->assertCount(1, $events);
$event = reset($events);
$this->assertInstanceOf('\core\event\user_updated', $event);
$this->assertEquals(5, $DB->count_records('user', array('auth'=>'ldap')));
$this->assertEquals(0, $DB->count_records('user', array('auth'=>'nologin', 'username'=>'username1')));
$this->assertEquals(1, $DB->count_records('user', array('auth'=>'ldap', 'suspended'=>'1', 'username'=>'username1')));
@@ -179,9 +209,17 @@ class auth_ldap_plugin_testcase extends advanced_testcase {
$this->create_ldap_user($connection, $topdn, 1);
ob_start();
$sink = $this->redirectEvents();
$auth->sync_users(true);
$events = $sink->get_events();
$sink->close();
ob_end_clean();
// Check events, 1 user got updated.
$this->assertCount(1, $events);
$event = reset($events);
$this->assertInstanceOf('\core\event\user_updated', $event);
$this->assertEquals(5, $DB->count_records('user', array('auth'=>'ldap')));
$this->assertEquals(0, $DB->count_records('user', array('suspended'=>1)));
$this->assertEquals(0, $DB->count_records('user', array('deleted'=>1)));
@@ -191,9 +229,17 @@ class auth_ldap_plugin_testcase extends advanced_testcase {
$DB->set_field('user', 'auth', 'nologin', array('username'=>'username1'));
ob_start();
$sink = $this->redirectEvents();
$auth->sync_users(true);
$events = $sink->get_events();
$sink->close();
ob_end_clean();
// Check events, 1 user got updated.
$this->assertCount(1, $events);
$event = reset($events);
$this->assertInstanceOf('\core\event\user_updated', $event);
$this->assertEquals(5, $DB->count_records('user', array('auth'=>'ldap')));
$this->assertEquals(0, $DB->count_records('user', array('suspended'=>1)));
$this->assertEquals(0, $DB->count_records('user', array('deleted'=>1)));
@@ -208,9 +254,19 @@ class auth_ldap_plugin_testcase extends advanced_testcase {
$this->delete_ldap_user($connection, $topdn, 1);
ob_start();
$sink = $this->redirectEvents();
$auth->sync_users(true);
$events = $sink->get_events();
$sink->close();
ob_end_clean();
// Check events, 2 events role_unassigned and user_deleted.
$this->assertCount(2, $events);
$event = array_pop($events);
$this->assertInstanceOf('\core\event\user_deleted', $event);
$event = array_pop($events);
$this->assertInstanceOf('\core\event\role_unassigned', $event);
$this->assertEquals(5, $DB->count_records('user', array('auth'=>'ldap')));
$this->assertEquals(0, $DB->count_records('user', array('username'=>'username1')));
$this->assertEquals(0, $DB->count_records('user', array('suspended'=>1)));
@@ -221,9 +277,19 @@ class auth_ldap_plugin_testcase extends advanced_testcase {
$this->create_ldap_user($connection, $topdn, 1);
ob_start();
$sink = $this->redirectEvents();
$auth->sync_users(true);
$events = $sink->get_events();
$sink->close();
ob_end_clean();
// Check events, 2 events role_assigned and user_created.
$this->assertCount(2, $events);
$event = array_pop($events);
$this->assertInstanceOf('\core\event\role_assigned', $event);
$event = array_pop($events);
$this->assertInstanceOf('\core\event\user_created', $event);
$this->assertEquals(6, $DB->count_records('user', array('auth'=>'ldap')));
$this->assertEquals(1, $DB->count_records('user', array('username'=>'username1')));
$this->assertEquals(0, $DB->count_records('user', array('suspended'=>1)));
@@ -296,7 +362,7 @@ class auth_ldap_plugin_testcase extends advanced_testcase {
'lastnamephonetic' => '最後のお名前のテスト一号',
'firstnamephonetic' => 'お名前のテスト一号',
'alternatename' => 'Alternate Name User Test 1',
'email' => 'usersignuptest1@email.com',
'email' => 'usersignuptest1@example.com',
'description' => 'This is a description for user 1',
'city' => 'Perth',
'country' => 'au',
+4
View File
@@ -0,0 +1,4 @@
This files describes API changes in the auth_ldap code.
=== 2.8.7 ===
* auth_plugin_ldap::update_user_record() accepts an additional (optional) param
to trigger update event.
+2 -2
View File
@@ -16,7 +16,7 @@ Feature: Authentication
Scenario: Log in as an existing admin user filling the form
Given the following "users" exist:
| username | password | firstname | lastname | email |
| testuser | testuser | Test | User | moodle@moodlemoodle.com |
| testuser | testuser | Test | User | moodle@example.com |
And I am on homepage
When I follow "Log in"
And I set the field "Username" to "testuser"
@@ -27,7 +27,7 @@ Feature: Authentication
Scenario: Log in as an unexisting user filling the form
Given the following "users" exist:
| username | password | firstname | lastname | email |
| testuser | testuser | Test | User | moodle@moodlemoodle.com |
| testuser | testuser | Test | User | moodle@example.com |
And I am on homepage
When I follow "Log in"
And I set the field "Username" to "testuser"
@@ -53,8 +53,8 @@ class condition extends \core_availability\condition {
*/
public function __construct($structure) {
// Get cmid.
if (isset($structure->cm) && is_int($structure->cm)) {
$this->cmid = $structure->cm;
if (isset($structure->cm) && is_number($structure->cm)) {
$this->cmid = (int)$structure->cm;
} else {
throw new \coding_exception('Missing or invalid ->cm for completion condition');
}
@@ -16,11 +16,9 @@ Feature: availability_completion
| user | course | role |
| teacher1 | C1 | editingteacher |
| student1 | C1 | student |
And I log in as "admin"
And I set the following administration settings values:
| Enable conditional access | 1 |
| Enable completion tracking | 1 |
And I log out
And the following config values are set as admin:
| enableavailability | 1 |
| enablecompletion | 1 |
@javascript
Scenario: Test condition
@@ -16,10 +16,8 @@ Feature: availability_date
| user | course | role |
| teacher1 | C1 | editingteacher |
| student1 | C1 | student |
And I log in as "admin"
And I set the following administration settings values:
| Enable conditional access | 1 |
And I log out
And the following config values are set as admin:
| enableavailability | 1 |
@javascript
Scenario: Test condition
@@ -10,16 +10,14 @@ Feature: availability_grade
| Course 1 | C1 | topics | 1 |
And the following "users" exist:
| username | email |
| teacher1 | t@example.org |
| student1 | s@example.org |
| teacher1 | t@example.com |
| student1 | s@example.com |
And the following "course enrolments" exist:
| user | course | role |
| teacher1 | C1 | editingteacher |
| student1 | C1 | student |
And I log in as "admin"
And I set the following administration settings values:
| Enable conditional access | 1 |
And I log out
And the following config values are set as admin:
| enableavailability | 1 |
@javascript
Scenario: Test condition
@@ -60,8 +58,22 @@ Feature: availability_grade
And I set the field "Grade" to "A1"
And I click on "min" "checkbox" in the ".availability-item" "css_element"
And I set the field "Minimum grade percentage (inclusive)" to "50"
And I click on "max" "checkbox" in the ".availability-item" "css_element"
And I set the field "Maximum grade percentage (exclusive)" to "80"
And I press "Save and return to course"
# Check if disabling a part of the restriction is get saved.
And I open "P3" actions menu
And I click on "Edit settings" "link" in the "P3" activity
And I expand all fieldsets
And I click on "max" "checkbox" in the ".availability-item" "css_element"
And I press "Save and return to course"
And I open "P3" actions menu
And I click on "Edit settings" "link" in the "P3" activity
And I expand all fieldsets
And the field "Maximum grade percentage (exclusive)" matches value ""
And I follow "Course 1"
# Add a Page with a grade condition for 10%.
And I add a "Page" to section "4"
And I set the following fields to these values:
@@ -103,8 +115,8 @@ Feature: availability_grade
# Give the assignment 40%.
And I follow "A1"
And I follow "View/grade all submissions"
# Pick the grade link in the row that has s@example.org in it.
And I click on "//a[contains(@href, 'action=grade') and ancestor::tr/td[normalize-space(.) = 's@example.org']]/img" "xpath_element"
# Pick the grade link in the row that has s@example.com in it.
And I click on "//a[contains(@href, 'action=grade') and ancestor::tr/td[normalize-space(.) = 's@example.com']]/img" "xpath_element"
And I set the field "Grade out of 100" to "40"
And I click on "Save changes" "button"
@@ -95,6 +95,7 @@ M.availability_grade.form.getNode = function(json) {
root.delegate('click', function() {
updateCheckbox(this, true);
M.core_availability.form.update();
}, '.availability_grade input[type=checkbox]');
root.delegate('valuechange', function() {
@@ -1 +1 @@
YUI.add("moodle-availability_grade-form",function(e,t){M.availability_grade=M.availability_grade||{},M.availability_grade.form=e.Object(M.core_availability.plugin),M.availability_grade.form.grades=null,M.availability_grade.form.initInner=function(e){this.grades=e,this.nodesSoFar=0},M.availability_grade.form.getNode=function(t){this.nodesSoFar++;var n=M.str.availability_grade,r="<label>"+n.title+' <span class="availability-group">'+'<select name="id"><option value="0">'+M.str.moodle.choosedots+"</option>";for(var i=0;i<this.grades.length;i++){var s=this.grades[i];r+='<option value="'+s.id+'">'+s.name+"</option>"}r+='</select></span></label> <span class="availability-group"><label><input type="checkbox" name="min"/>'+n.option_min+'</label> <label><span class="accesshide">'+n.label_min+'</span><input type="text" name="minval" title="'+n.label_min+'"/></label>%</span>'+'<span class="availability-group">'+'<label><input type="checkbox" name="max"/>'+n.option_max+'</label> <label><span class="accesshide">'+n.label_max+'</span><input type="text" name="maxval" title="'+n.label_max+'"/></label>%</span>';var o=e.Node.create("<span>"+r+"</span>");t.id!==undefined&&o.one("select[name=id] > option[value="+t.id+"]")&&o.one("select[name=id]").set("value",""+t.id),t.min!==undefined&&(o.one("input[name=min]").set("checked",!0),o.one("input[name=minval]").set("value",t.min)),t.max!==undefined&&(o.one("input[name=max]").set("checked",!0),o.one("input[name=maxval]").set("value",t.max));var u=function(e,t){var n=e.ancestor("label").next("label").one("input"),r=e.get("checked");return n.set("disabled",!r),t&&r&&n.focus(),r};o.all("input[type=checkbox]").each(u);if(!M.availability_grade.form.addedEvents){M.availability_grade.form.addedEvents=!0;var a=e.one("#fitem_id_availabilityconditionsjson");a.delegate("change",function(){M.core_availability.form.update()},".availability_grade select[name=id]"),a.delegate("click",function(){u(this,!0)},".availability_grade input[type=checkbox]"),a.delegate("valuechange",function(){M.core_availability.form.update()},".availability_grade input[type=text]")}return o},M.availability_grade.form.fillValue=function(e,t){e.id=parseInt(t.one("select[name=id]").get("value"),10),t.one("input[name=min]").get("checked")&&(e.min=this.getValue("minval",t)),t.one("input[name=max]").get("checked")&&(e.max=this.getValue("maxval",t))},M.availability_grade.form.getValue=function(e,t){var n=t.one("input[name="+e+"]").get("value");if(!/^[0-9]+([.,][0-9]+)?$/.test(n))return n;var r=parseFloat(n.replace(",","."));return r<0||r>100?n:r},M.availability_grade.form.fillErrors=function(e,t){var n={};this.fillValue(n,t),n.id===0&&e.push("availability_grade:error_selectgradeid"),n.min!==undefined&&typeof n.min=="string"||n.max!==undefined&&typeof n.max=="string"?e.push("availability_grade:error_invalidnumber"):n.min!==undefined&&n.max!==undefined&&n.min>=n.max&&e.push("availability_grade:error_backwardrange")}},"@VERSION@",{requires:["base","node","event","moodle-core_availability-form"]});
YUI.add("moodle-availability_grade-form",function(e,t){M.availability_grade=M.availability_grade||{},M.availability_grade.form=e.Object(M.core_availability.plugin),M.availability_grade.form.grades=null,M.availability_grade.form.initInner=function(e){this.grades=e,this.nodesSoFar=0},M.availability_grade.form.getNode=function(t){this.nodesSoFar++;var n=M.str.availability_grade,r="<label>"+n.title+' <span class="availability-group">'+'<select name="id"><option value="0">'+M.str.moodle.choosedots+"</option>";for(var i=0;i<this.grades.length;i++){var s=this.grades[i];r+='<option value="'+s.id+'">'+s.name+"</option>"}r+='</select></span></label> <span class="availability-group"><label><input type="checkbox" name="min"/>'+n.option_min+'</label> <label><span class="accesshide">'+n.label_min+'</span><input type="text" name="minval" title="'+n.label_min+'"/></label>%</span>'+'<span class="availability-group">'+'<label><input type="checkbox" name="max"/>'+n.option_max+'</label> <label><span class="accesshide">'+n.label_max+'</span><input type="text" name="maxval" title="'+n.label_max+'"/></label>%</span>';var o=e.Node.create("<span>"+r+"</span>");t.id!==undefined&&o.one("select[name=id] > option[value="+t.id+"]")&&o.one("select[name=id]").set("value",""+t.id),t.min!==undefined&&(o.one("input[name=min]").set("checked",!0),o.one("input[name=minval]").set("value",t.min)),t.max!==undefined&&(o.one("input[name=max]").set("checked",!0),o.one("input[name=maxval]").set("value",t.max));var u=function(e,t){var n=e.ancestor("label").next("label").one("input"),r=e.get("checked");return n.set("disabled",!r),t&&r&&n.focus(),r};o.all("input[type=checkbox]").each(u);if(!M.availability_grade.form.addedEvents){M.availability_grade.form.addedEvents=!0;var a=e.one("#fitem_id_availabilityconditionsjson");a.delegate("change",function(){M.core_availability.form.update()},".availability_grade select[name=id]"),a.delegate("click",function(){u(this,!0),M.core_availability.form.update()},".availability_grade input[type=checkbox]"),a.delegate("valuechange",function(){M.core_availability.form.update()},".availability_grade input[type=text]")}return o},M.availability_grade.form.fillValue=function(e,t){e.id=parseInt(t.one("select[name=id]").get("value"),10),t.one("input[name=min]").get("checked")&&(e.min=this.getValue("minval",t)),t.one("input[name=max]").get("checked")&&(e.max=this.getValue("maxval",t))},M.availability_grade.form.getValue=function(e,t){var n=t.one("input[name="+e+"]").get("value");if(!/^[0-9]+([.,][0-9]+)?$/.test(n))return n;var r=parseFloat(n.replace(",","."));return r<0||r>100?n:r},M.availability_grade.form.fillErrors=function(e,t){var n={};this.fillValue(n,t),n.id===0&&e.push("availability_grade:error_selectgradeid"),n.min!==undefined&&typeof n.min=="string"||n.max!==undefined&&typeof n.max=="string"?e.push("availability_grade:error_invalidnumber"):n.min!==undefined&&n.max!==undefined&&n.min>=n.max&&e.push("availability_grade:error_backwardrange")}},"@VERSION@",{requires:["base","node","event","moodle-core_availability-form"]});
@@ -95,6 +95,7 @@ M.availability_grade.form.getNode = function(json) {
root.delegate('click', function() {
updateCheckbox(this, true);
M.core_availability.form.update();
}, '.availability_grade input[type=checkbox]');
root.delegate('valuechange', function() {
+1
View File
@@ -93,6 +93,7 @@ M.availability_grade.form.getNode = function(json) {
root.delegate('click', function() {
updateCheckbox(this, true);
M.core_availability.form.update();
}, '.availability_grade input[type=checkbox]');
root.delegate('valuechange', function() {
@@ -16,10 +16,8 @@ Feature: availability_group
| user | course | role |
| teacher1 | C1 | editingteacher |
| student1 | C1 | student |
And I log in as "admin"
And I set the following administration settings values:
| Enable conditional access | 1 |
And I log out
And the following config values are set as admin:
| enableavailability | 1 |
@javascript
Scenario: Test condition
@@ -22,10 +22,8 @@ Feature: availability_grouping
And the following "group members" exist:
| user | group |
| student1 | GI1 |
And I log in as "admin"
And I set the following administration settings values:
| Enable conditional access | 1 |
And I log out
And the following config values are set as admin:
| enableavailability | 1 |
@javascript
Scenario: Test condition
@@ -10,16 +10,14 @@ Feature: availability_profile
| Course 1 | C1 | topics | 1 |
And the following "users" exist:
| username | email |
| teacher1 | t@example.org |
| student1 | s@example.org |
| teacher1 | t@example.com |
| student1 | s@example.com |
And the following "course enrolments" exist:
| user | course | role |
| teacher1 | C1 | editingteacher |
| student1 | C1 | student |
And I log in as "admin"
And I set the following administration settings values:
| Enable conditional access | 1 |
And I log out
And the following config values are set as admin:
| enableavailability | 1 |
@javascript
Scenario: Test condition
@@ -38,7 +36,7 @@ Feature: availability_profile
And I click on "Add restriction..." "button"
And I click on "User profile" "button"
And I set the field "User profile field" to "Email address"
And I set the field "Value to compare against" to "s@example.org"
And I set the field "Value to compare against" to "s@example.com"
And I click on ".availability-item .availability-eye img" "css_element"
And I click on "Save and return to course" "button"
@@ -52,7 +50,7 @@ Feature: availability_profile
And I click on "Add restriction..." "button"
And I click on "User profile" "button"
And I set the field "User profile field" to "Email address"
And I set the field "Value to compare against" to "q@example.org"
And I set the field "Value to compare against" to "q@example.com"
And I click on ".availability-item .availability-eye img" "css_element"
And I click on "Save and return to course" "button"
@@ -78,7 +76,7 @@ Feature: availability_profile
# Set field value for user.
And I navigate to "Browse list of users" node in "Site administration > Users > Accounts"
And I click on "a[title=Edit]" "css_element" in the "s@example.org" "table_row"
And I click on "a[title=Edit]" "css_element" in the "s@example.com" "table_row"
And I expand all fieldsets
And I set the field "Super field" to "Bananaman"
And I click on "Update profile" "button"
@@ -34,10 +34,8 @@ Feature: display_availability
| user | course | role |
| teacher1 | C1 | editingteacher |
| student1 | C1 | student |
And I log in as "admin"
And I set the following administration settings values:
| Enable conditional access | 1 |
And I log out
And the following config values are set as admin:
| enableavailability | 1 |
@javascript
Scenario: Activity availability display
@@ -76,7 +74,7 @@ Feature: display_availability
And I press "Add restriction..."
And I click on "User profile" "button" in the "Add restriction..." "dialogue"
And I set the field "User profile field" to "Email address"
And I set the field "Value to compare against" to "email@example.org"
And I set the field "Value to compare against" to "email@example.com"
And I set the field "Method of comparison" to "is equal to"
And I press "Save and return to course"
@@ -39,15 +39,10 @@ Feature: edit_availability
When I edit the section "1"
Then "Restrict access" "fieldset" should not exist
When I log out
And I log in as "admin"
And I set the following administration settings values:
| Enable conditional access | 1 |
And the following config values are set as admin:
| enableavailability | 1 |
When I log out
And I log in as "teacher1"
And I follow "Course 1"
And I turn editing mode on
And I add a "Page" to section "1"
Then "Restrict access" "fieldset" should exist
@@ -58,10 +53,8 @@ Feature: edit_availability
@javascript
Scenario: Edit availability using settings in activity form
# Set up.
Given I log in as "admin"
And I set the following administration settings values:
| Enable conditional access | 1 |
And I log out
Given the following config values are set as admin:
| enableavailability | 1 |
And I log in as "teacher1"
And I follow "Course 1"
@@ -153,10 +146,8 @@ Feature: edit_availability
@javascript
Scenario: Edit availability using settings in section form
# Set up.
Given I log in as "admin"
And I set the following administration settings values:
| Enable conditional access | 1 |
And I log out
Given the following config values are set as admin:
| enableavailability | 1 |
And I log in as "teacher1"
And I follow "Course 1"
And I turn editing mode on
@@ -172,3 +163,4 @@ Feature: edit_availability
And I should not see "None" in the "Restrict access" "fieldset"
And "Restriction type" "select" should be visible
And I should see "Date" in the "Restrict access" "fieldset"
+3 -3
View File
@@ -299,7 +299,7 @@
<IDNUMBER>891220979</IDNUMBER>
<FIRSTNAME>Admin</FIRSTNAME>
<LASTNAME>User</LASTNAME>
<EMAIL>adamzap@gmail.com</EMAIL>
<EMAIL>adamzap@example.com</EMAIL>
<EMAILSTOP>0</EMAILSTOP>
<ICQ></ICQ>
<SKYPE></SKYPE>
@@ -368,7 +368,7 @@
<IDNUMBER>891111111</IDNUMBER>
<FIRSTNAME>Adam</FIRSTNAME>
<LASTNAME>Zapletal</LASTNAME>
<EMAIL>azaple1@lsu.edu</EMAIL>
<EMAIL>azaple1@example.com</EMAIL>
<EMAILSTOP>0</EMAILSTOP>
<ICQ></ICQ>
<SKYPE></SKYPE>
@@ -481,7 +481,7 @@
<IDNUMBER></IDNUMBER>
<FIRSTNAME>Philip</FIRSTNAME>
<LASTNAME>Cali</LASTNAME>
<EMAIL>pcali1@lsu.edu</EMAIL>
<EMAIL>pcali1@example.com</EMAIL>
<EMAILSTOP>0</EMAILSTOP>
<ICQ></ICQ>
<SKYPE></SKYPE>
+21 -2
View File
@@ -516,7 +516,7 @@ class backup_enrolments_structure_step extends backup_structure_step {
$enrol = new backup_nested_element('enrol', array('id'), array(
'enrol', 'status', 'name', 'enrolperiod', 'enrolstartdate',
'enrolenddate', 'expirynotify', 'expirytreshold', 'notifyall',
'enrolenddate', 'expirynotify', 'expirythreshold', 'notifyall',
'password', 'cost', 'currency', 'roleid',
'customint1', 'customint2', 'customint3', 'customint4', 'customint5', 'customint6', 'customint7', 'customint8',
'customchar1', 'customchar2', 'customchar3',
@@ -926,6 +926,7 @@ class backup_gradebook_structure_step extends backup_structure_step {
}
protected function define_structure() {
global $CFG, $DB;
// are we including user info?
$userinfo = $this->get_setting_value('users');
@@ -986,6 +987,13 @@ class backup_gradebook_structure_step extends backup_structure_step {
$gradebook->add_child($grade_settings);
$grade_settings->add_child($grade_setting);
// Add attribute with gradebook calculation freeze date if needed.
$gradebookcalculationfreeze = get_config('core', 'gradebook_calculations_freeze_' . $this->get_courseid());
if ($gradebookcalculationfreeze) {
$gradebook->add_attributes(array('calculations_freeze'));
$gradebook->get_attribute('calculations_freeze')->set_value($gradebookcalculationfreeze);
}
// Define sources
//Include manual, category and the course grade item
@@ -1010,7 +1018,18 @@ class backup_gradebook_structure_step extends backup_structure_step {
$letter->set_source_table('grade_letters', array('contextid' => backup::VAR_CONTEXTID));
$grade_setting->set_source_table('grade_settings', array('courseid' => backup::VAR_COURSEID));
// Set the grade settings source, forcing the inclusion of minmaxtouse if not present.
$settings = array();
$rs = $DB->get_recordset('grade_settings', array('courseid' => $this->get_courseid()));
foreach ($rs as $record) {
$settings[$record->name] = $record;
}
$rs->close();
if (!isset($settings['minmaxtouse'])) {
$settings['minmaxtouse'] = (object) array('name' => 'minmaxtouse', 'value' => $CFG->grade_minmaxtouse);
}
$grade_setting->set_source_array($settings);
// Annotations (both as final as far as they are going to be exported in next steps)
$grade_item->annotate_ids('scalefinal', 'scaleid'); // Straight as scalefinal because it's > 0
+156 -14
View File
@@ -138,6 +138,18 @@ class restore_gradebook_structure_step extends restore_structure_step {
}
protected function process_gradebook($data) {
// For non-merge restore types:
// Unset 'gradebook_calculations_freeze_' in the course and replace with the one from the backup.
$target = $this->get_task()->get_target();
if ($target == backup::TARGET_CURRENT_DELETING || $target == backup::TARGET_EXISTING_DELETING) {
set_config('gradebook_calculations_freeze_' . $this->get_courseid(), null);
}
if (!empty($data['calculations_freeze'])) {
if ($target == backup::TARGET_NEW_COURSE || $target == backup::TARGET_CURRENT_DELETING ||
$target == backup::TARGET_EXISTING_DELETING) {
set_config('gradebook_calculations_freeze_' . $this->get_courseid(), $data['calculations_freeze']);
}
}
}
protected function process_grade_item($data) {
@@ -319,13 +331,23 @@ class restore_gradebook_structure_step extends restore_structure_step {
$data->courseid = $this->get_courseid();
$target = $this->get_task()->get_target();
if ($data->name == 'minmaxtouse' &&
($target == backup::TARGET_CURRENT_ADDING || $target == backup::TARGET_EXISTING_ADDING)) {
// We never restore minmaxtouse during merge.
return;
}
if (!$DB->record_exists('grade_settings', array('courseid' => $data->courseid, 'name' => $data->name))) {
$newitemid = $DB->insert_record('grade_settings', $data);
} else {
$newitemid = $data->id;
}
$this->set_mapping('grade_setting', $oldid, $newitemid);
if (!empty($oldid)) {
// In rare cases (minmaxtouse), it is possible that there wasn't any ID associated with the setting.
$this->set_mapping('grade_setting', $oldid, $newitemid);
}
}
/**
@@ -447,9 +469,101 @@ class restore_gradebook_structure_step extends restore_structure_step {
}
$rs->close();
// Check what to do with the minmaxtouse setting.
$this->check_minmaxtouse();
// Freeze gradebook calculations if needed.
$this->gradebook_calculation_freeze();
// Restore marks items as needing update. Update everything now.
grade_regrade_final_grades($this->get_courseid());
}
/**
* Freeze gradebook calculation if needed.
*
* This is similar to various upgrade scripts that check if the freeze is needed.
*/
protected function gradebook_calculation_freeze() {
global $CFG;
$gradebookcalculationsfreeze = get_config('core', 'gradebook_calculations_freeze_' . $this->get_courseid());
preg_match('/(\d{8})/', $this->get_task()->get_info()->moodle_release, $matches);
$backupbuild = (int)$matches[1];
// Extra credits need adjustments only for backups made between 2.8 release (20141110) and the fix release (20150619).
if (!$gradebookcalculationsfreeze && $backupbuild >= 20141110 && $backupbuild < 20150619) {
require_once($CFG->libdir . '/db/upgradelib.php');
upgrade_extra_credit_weightoverride($this->get_courseid());
}
// Calculated grade items need recalculating for backups made between 2.8 release (20141110) and the fix release (20150627).
if (!$gradebookcalculationsfreeze && $backupbuild >= 20141110 && $backupbuild < 20150627) {
require_once($CFG->libdir . '/db/upgradelib.php');
upgrade_calculated_grade_items($this->get_courseid());
}
}
/**
* Checks what should happen with the course grade setting minmaxtouse.
*
* This is related to the upgrade step at the time the setting was added.
*
* @see MDL-48618
* @return void
*/
protected function check_minmaxtouse() {
global $CFG, $DB;
require_once($CFG->libdir . '/gradelib.php');
$userinfo = $this->task->get_setting_value('users');
$settingname = 'minmaxtouse';
$courseid = $this->get_courseid();
$minmaxtouse = $DB->get_field('grade_settings', 'value', array('courseid' => $courseid, 'name' => $settingname));
$version28start = 2014111000.00;
$version28last = 2014111006.05;
$target = $this->get_task()->get_target();
if ($minmaxtouse === false &&
($target != backup::TARGET_CURRENT_ADDING && $target != backup::TARGET_EXISTING_ADDING)) {
// The setting was not found because this setting did not exist at the time the backup was made.
// And we are not restoring as merge, in which case we leave the course as it was.
$version = $this->get_task()->get_info()->moodle_version;
if ($version < $version28start) {
// We need to set it to use grade_item, but only if the site-wide setting is different. No need to notice them.
if ($CFG->grade_minmaxtouse != GRADE_MIN_MAX_FROM_GRADE_ITEM) {
grade_set_setting($courseid, $settingname, GRADE_MIN_MAX_FROM_GRADE_ITEM);
}
} else if ($version >= $version28start && $version < $version28last) {
// They should be using grade_grade when the course has inconsistencies.
$sql = "SELECT gi.id
FROM {grade_items} gi
JOIN {grade_grades} gg
ON gg.itemid = gi.id
WHERE gi.courseid = ?
AND (gi.itemtype != ? AND gi.itemtype != ?)
AND (gg.rawgrademax != gi.grademax OR gg.rawgrademin != gi.grademin)";
// The course can only have inconsistencies when we restore the user info,
// we do not need to act on existing grades that were not restored as part of this backup.
if ($userinfo && $DB->record_exists_sql($sql, array($courseid, 'course', 'category'))) {
// Display the notice as we do during upgrade.
set_config('show_min_max_grades_changed_' . $courseid, 1);
if ($CFG->grade_minmaxtouse != GRADE_MIN_MAX_FROM_GRADE_GRADE) {
// We need set the setting as their site-wise setting is not GRADE_MIN_MAX_FROM_GRADE_GRADE.
// If they are using the site-wide grade_grade setting, we only want to notice them.
grade_set_setting($courseid, $settingname, GRADE_MIN_MAX_FROM_GRADE_GRADE);
}
}
} else {
// This should never happen because from now on minmaxtouse is always saved in backups.
}
}
}
}
/**
@@ -1472,13 +1586,31 @@ class restore_section_structure_step extends restore_structure_step {
public function process_course_format_options($data) {
global $DB;
$data = (object)$data;
$oldid = $data->id;
unset($data->id);
$data->sectionid = $this->task->get_sectionid();
$data->courseid = $this->get_courseid();
$newid = $DB->insert_record('course_format_options', $data);
$this->set_mapping('course_format_options', $oldid, $newid);
static $courseformats = array();
$courseid = $this->get_courseid();
if (!array_key_exists($courseid, $courseformats)) {
// It is safe to have a static cache of course formats because format can not be changed after this point.
$courseformats[$courseid] = $DB->get_field('course', 'format', array('id' => $courseid));
}
$data = (array)$data;
if ($courseformats[$courseid] === $data['format']) {
// Import section format options only if both courses (the one that was backed up
// and the one we are restoring into) have same formats.
$params = array(
'courseid' => $this->get_courseid(),
'sectionid' => $this->task->get_sectionid(),
'format' => $data['format'],
'name' => $data['name']
);
if ($record = $DB->get_record('course_format_options', $params, 'id, value')) {
// Do not overwrite existing information.
$newid = $record->id;
} else {
$params['value'] = $data['value'];
$newid = $DB->insert_record('course_format_options', $params);
}
$this->set_mapping('course_format_options', $data['id'], $newid);
}
}
protected function after_execute() {
@@ -2987,11 +3119,6 @@ class restore_activity_grades_structure_step extends restore_structure_step {
$oldparentid = $data->categoryid;
$courseid = $this->get_courseid();
// make sure top course category exists, all grade items will be associated
// to it. Later, if restoring the whole gradebook, categories will be introduced
$coursecat = grade_category::fetch_course_category($courseid);
$coursecatid = $coursecat->id; // Get the categoryid to be used
$idnumber = null;
if (!empty($data->idnumber)) {
// Don't get any idnumber from course module. Keep them as they are in grade_item->idnumber
@@ -3016,8 +3143,18 @@ class restore_activity_grades_structure_step extends restore_structure_step {
}
}
if (!empty($data->categoryid)) {
// If the grade category id of the grade item being restored belongs to this course
// then it is a fair assumption that this is the correct grade category for the activity
// and we should leave it in place, if not then unset it.
// TODO MDL-34790 Gradebook does not import if target course has gradebook categories.
$conditions = array('id' => $data->categoryid, 'courseid' => $courseid);
if (!$this->task->is_samesite() || !$DB->record_exists('grade_categories', $conditions)) {
unset($data->categoryid);
}
}
unset($data->id);
$data->categoryid = $coursecatid;
$data->courseid = $this->get_courseid();
$data->iteminstance = $this->task->get_activityid();
$data->idnumber = $idnumber;
@@ -3836,6 +3973,11 @@ class restore_create_categories_and_questions extends restore_structure_step {
$data = (object)$data;
$newquestion = $this->get_new_parentid('question');
$questioncreated = (bool) $this->get_mappingid('question_created', $this->get_old_parentid('question'));
if (!$questioncreated) {
// This question already exists in the question bank. Nothing for us to do.
return;
}
if (!empty($CFG->usetags)) { // if enabled in server
// TODO: This is highly inefficient. Each time we add one tag
@@ -0,0 +1,237 @@
<?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/>.
/**
* Tests for Moodle 2 format backup operation.
*
* @package core_backup
* @copyright 2014 Russell Smith
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
defined('MOODLE_INTERNAL') || die();
global $CFG;
require_once($CFG->dirroot . '/backup/util/includes/backup_includes.php');
require_once($CFG->dirroot . '/backup/util/includes/restore_includes.php');
require_once($CFG->dirroot . '/course/format/topics/lib.php');
require_once($CFG->libdir . '/completionlib.php');
/**
* Tests for Moodle 2 course format section_options backup operation.
*
* @package core_backup
* @copyright 2014 Russell Smith
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
class core_backup_moodle2_course_format_testcase extends advanced_testcase {
/**
* Tidy up open files that may be left open.
*/
protected function tearDown() {
gc_collect_cycles();
}
/**
* Tests a backup and restore adds the required section option data
* when the same course format is used.
*/
public function test_course_format_options_restore() {
global $DB, $CFG;
$this->resetAfterTest(true);
$this->setAdminUser();
$CFG->enableavailability = true;
$CFG->enablecompletion = true;
// Create a course with some availability data set.
$generator = $this->getDataGenerator();
$course = $generator->create_course(
array('format' => 'test_cs_options', 'numsections' => 3,
'enablecompletion' => COMPLETION_ENABLED),
array('createsections' => true));
$courseobject = format_base::instance($course->id);
$section = $DB->get_record('course_sections',
array('course' => $course->id, 'section' => 1), '*', MUST_EXIST);
$data = array('id' => $section->id,
'numdaystocomplete' => 2);
$courseobject->update_section_format_options($data);
// Backup and restore it.
$this->backup_and_restore($course);
$sectionoptions = $courseobject->get_format_options(1);
$this->assertArrayHasKey('numdaystocomplete', $sectionoptions);
$this->assertEquals(2, $sectionoptions['numdaystocomplete']);
}
/**
* Tests an import into the same subject successfully
* restores the options without error.
*/
public function test_course_format_options_import_myself() {
global $DB, $CFG;
$this->resetAfterTest(true);
$this->setAdminUser();
$CFG->enableavailability = true;
$CFG->enablecompletion = true;
// Create a course with some availability data set.
$generator = $this->getDataGenerator();
$course = $generator->create_course(
array('format' => 'test_cs_options', 'numsections' => 3,
'enablecompletion' => COMPLETION_ENABLED),
array('createsections' => true));
$courseobject = format_base::instance($course->id);
$section = $DB->get_record('course_sections',
array('course' => $course->id, 'section' => 1), '*', MUST_EXIST);
$data = array('id' => $section->id,
'numdaystocomplete' => 2);
$courseobject->update_section_format_options($data);
$this->backup_and_restore($course, $course);
$sectionoptions = $courseobject->get_format_options(1);
$this->assertArrayHasKey('numdaystocomplete', $sectionoptions);
$this->assertArrayNotHasKey('secondparameter', $sectionoptions);
$this->assertEquals(2, $sectionoptions['numdaystocomplete']);
}
/**
* Tests that all section options are copied when the course format is changed.
* None of the data is copied.
*
* It is a future enhancement to copy;
* 1. Only the relevant options.
* 2. Only the data associated with relevant options.
*/
public function test_course_format_options_restore_new_format() {
global $DB, $CFG;
$this->resetAfterTest(true);
$this->setAdminUser();
$CFG->enableavailability = true;
$CFG->enablecompletion = true;
// Create a course with some availability data set.
$generator = $this->getDataGenerator();
$course = $generator->create_course(
array('format' => 'test_cs2_options', 'numsections' => 3,
'enablecompletion' => COMPLETION_ENABLED),
array('createsections' => true));
$newcourse = $generator->create_course(
array('format' => 'test_cs_options', 'numsections' => 3,
'enablecompletion' => COMPLETION_ENABLED),
array('createsections' => true));
$courseobject = format_base::instance($course->id);
$section = $DB->get_record('course_sections',
array('course' => $course->id, 'section' => 1), '*', MUST_EXIST);
$data = array('id' => $section->id,
'numdaystocomplete' => 2,
'secondparameter' => 8);
$courseobject->update_section_format_options($data);
// Backup and restore it.
$this->backup_and_restore($course, $newcourse);
$newcourseobject = format_base::instance($newcourse->id);
$sectionoptions = $newcourseobject->get_format_options(1);
$this->assertArrayHasKey('numdaystocomplete', $sectionoptions);
$this->assertArrayHasKey('secondparameter', $sectionoptions);
$this->assertEquals(0, $sectionoptions['numdaystocomplete']);
$this->assertEquals(0, $sectionoptions['secondparameter']);
}
/**
* Backs a course up and restores it.
*
* @param stdClass $srccourse Course object to backup
* @param stdClass $dstcourse Course object to restore into
* @return int ID of newly restored course
*/
protected function backup_and_restore($srccourse, $dstcourse = null) {
global $USER, $CFG;
// Turn off file logging, otherwise it can't delete the file (Windows).
$CFG->backup_file_logger_level = backup::LOG_NONE;
// Do backup with default settings. MODE_IMPORT means it will just
// create the directory and not zip it.
$bc = new backup_controller(backup::TYPE_1COURSE, $srccourse->id,
backup::FORMAT_MOODLE, backup::INTERACTIVE_NO, backup::MODE_IMPORT,
$USER->id);
$backupid = $bc->get_backupid();
$bc->execute_plan();
$bc->destroy();
// Do restore to new course with default settings.
if ($dstcourse !== null) {
$newcourseid = $dstcourse->id;
} else {
$newcourseid = restore_dbops::create_new_course(
$srccourse->fullname, $srccourse->shortname . '_2', $srccourse->category);
}
$rc = new restore_controller($backupid, $newcourseid,
backup::INTERACTIVE_NO, backup::MODE_GENERAL, $USER->id,
backup::TARGET_NEW_COURSE);
$this->assertTrue($rc->execute_precheck());
$rc->execute_plan();
$rc->destroy();
return $newcourseid;
}
}
/**
* Class format_test_cs_options
*
* Test course format that has 1 option.
*/
class format_test_cs_options extends format_topics {
public function section_format_options($foreditform = false) {
return array(
'numdaystocomplete' => array(
'type' => PARAM_INT,
'label' => 'Test days',
'element_type' => 'text',
'default' => 0,
),
);
}
}
/**
* Class format_test_cs2_options
*
* Test course format that has 2 options, 1 inherited.
*/
class format_test_cs2_options extends format_test_cs_options {
public function section_format_options($foreditform = false) {
return array(
'secondparameter' => array(
'type' => PARAM_INT,
'label' => 'Test Parmater',
'element_type' => 'text',
'default' => 0,
),
) + parent::section_format_options($foreditform);
}
}
+1
View File
@@ -30,6 +30,7 @@ class course_restore_form extends moodleform {
$mform->addElement('hidden', 'contextid', $contextid);
$mform->setType('contextid', PARAM_INT);
$mform->addElement('filepicker', 'backupfile', get_string('files'));
$mform->addRule('backupfile', get_string('required'), 'required');
$submit_string = get_string('restore');
$this->add_action_buttons(false, $submit_string);
}
@@ -167,4 +167,48 @@ class backup_anonymizer_helper {
public static function process_user_imagealt($value) {
return ''; // No user imagealt
}
/**
* Anonymises user's phonetic name field
* @param string $value value of the user field
* @return string anonymised phonetic name
*/
public static function process_user_firstnamephonetic($value) {
static $counter = 0;
$counter++;
return 'anonfirstnamephonetic' . $counter; // Just a counter.
}
/**
* Anonymises user's phonetic last name field
* @param string $value value of the user field
* @return string anonymised last phonetic name
*/
public static function process_user_lastnamephonetic($value) {
static $counter = 0;
$counter++;
return 'anonlastnamephonetic' . $counter; // Just a counter.
}
/**
* Anonymises user's middle name field
* @param string $value value of the user field
* @return string anonymised middle name
*/
public static function process_user_middlename($value) {
static $counter = 0;
$counter++;
return 'anonmiddlename' . $counter; // Just a counter.
}
/**
* Anonymises user's alternate name field
* @param string $value value of the user field
* @return string anonymised alternate name
*/
public static function process_user_alternatename($value) {
static $counter = 0;
$counter++;
return 'anonalternatename' . $counter; // Just a counter.
}
}
@@ -11,7 +11,7 @@ Feature: Duplicate activities
| Course 1 | C1 | 0 |
And the following "users" exist:
| username | firstname | lastname | email |
| teacher1 | Teacher | 1 | teacher1@asd.com |
| teacher1 | Teacher | 1 | teacher1@example.com |
And the following "course enrolments" exist:
| user | course | role |
| teacher1 | C1 | editingteacher |
@@ -12,7 +12,7 @@ Feature: Import course's contents into another course
| Course 2 | C2 | 0 |
And the following "users" exist:
| username | firstname | lastname | email |
| teacher1 | Teacher | 1 | teacher1@asd.com |
| teacher1 | Teacher | 1 | teacher1@example.com |
And the following "course enrolments" exist:
| user | course | role |
| teacher1 | C1 | editingteacher |
@@ -1,5 +1,4 @@
<?php
// This file is part of Moodle - http://moodle.org/
//
// Moodle is free software: you can redistribute it and/or modify
@@ -43,6 +42,22 @@ abstract class grouped_parser_processor extends simplified_parser_processor {
protected $groupedpaths; // Paths we are requesting grouped
protected $currentdata; // Where we'll be acummulating data
// We create a array that stores each of the paths in a tree fashion
// like the filesystem. Each element stores all the child elements that are
// part of a full path that builds the grouped parent path we are storing.
// eg Array keys are stored as follows;
// root => a => b
// => b
// => c => d
// => e => f.
// Grouped paths here are; /a/b, /b, /c/d, /c/e/f.
// There are no nested parent paths, that is an enforced rule so
// we store an empty array to designate that the particular XML path element
// is in fact a grouped path.
// eg; $this->groupedparentprefixtree['a']['b'] = array();
/** @var array Search tree storing the grouped paths. */
protected $groupedparentprefixtree;
/**
* Keep cache of parent directory paths for XML parsing.
* @var array
@@ -78,6 +93,18 @@ abstract class grouped_parser_processor extends simplified_parser_processor {
throw new progressive_parser_exception('xml_grouped_child_found', $a);
}
$this->groupedpaths[$path] = true;
// We check earlier in the function if there is a parent that is above the path
// to be added so we can be sure no parent exists in the tree.
$patharray = explode('/', $path);
$currentpos = &$this->groupedparentprefixtree;
foreach ($patharray as $item) {
if (!isset($currentpos[$item])) {
$currentpos[$item] = array();
}
// Update the current array position using a reference to allow in-place updates to the array.
$currentpos = &$currentpos[$item];
}
}
parent::add_path($path);
}
@@ -162,13 +189,29 @@ abstract class grouped_parser_processor extends simplified_parser_processor {
* false if not
*/
protected function grouped_parent_exists($path) {
$parentpath = $this->get_parent_path($path);
while ($parentpath != '/') {
if ($this->path_is_grouped($parentpath)) {
return $parentpath;
// Search the tree structure to find out if one of the paths
// above the $path is a grouped path.
$patharray = explode('/', $this->get_parent_path($path));
$groupedpath = '';
$currentpos = &$this->groupedparentprefixtree;
foreach ($patharray as $item) {
// When the item isn't set in the array we know
// there is no parent grouped path.
if (!isset($currentpos[$item])) {
return false;
}
$parentpath = $this->get_parent_path($parentpath);
// When we aren't at the start of the path, continue to build
// a string representation of the path that is traversed. We will
// return the grouped path to the caller if we find one.
if ($item != '') {
$groupedpath .= '/'.$item;
}
if ($currentpos[$item] == array()) {
return $groupedpath;
}
$currentpos = &$currentpos[$item];
}
return false;
}
+2 -2
View File
@@ -87,7 +87,7 @@ class award_criteria_activity extends award_criteria {
if (!$mod) {
$str = $OUTPUT->error_text(get_string('error:nosuchmod', 'badges'));
} else {
$str = html_writer::tag('b', '"' . ucfirst($mod->modname) . ' - ' . $mod->name . '"');
$str = html_writer::tag('b', '"' . get_string('modulename', $mod->modname) . ' - ' . $mod->name . '"');
if (isset($p['bydate'])) {
$str .= get_string('criteria_descr_bydate', 'badges', userdate($p['bydate'], get_string('strftimedate', 'core_langconfig')));
}
@@ -142,7 +142,7 @@ class award_criteria_activity extends award_criteria {
}
$param = array('id' => $mod->id,
'checked' => $checked,
'name' => ucfirst($mod->modname) . ' - ' . $mod->name,
'name' => get_string('modulename', $mod->modname) . ' - ' . $mod->name,
'error' => false
);
+1 -1
View File
@@ -164,7 +164,7 @@ class award_criteria_courseset extends award_criteria {
$param = array(
'id' => $course->id,
'checked' => true,
'name' => ucfirst(format_string($course->fullname, true, array('context' => $coursecontext))),
'name' => format_string($course->fullname, true, array('context' => $coursecontext)),
'error' => false
);
+8 -6
View File
@@ -59,13 +59,15 @@ class OpenBadgesBackpackHandler {
break;
}
$curl->setHeader(array('Accept: application/json', 'Expect:'));
$options = array(
'FRESH_CONNECT' => true,
'RETURNTRANSFER' => true,
'FORBID_REUSE' => true,
'HEADER' => 0,
'HTTPHEADER' => array('Expect:'),
'CONNECTTIMEOUT' => 3,
'FRESH_CONNECT' => true,
'RETURNTRANSFER' => true,
'FORBID_REUSE' => true,
'HEADER' => 0,
'CONNECTTIMEOUT' => 3,
// Follow redirects with the same type of request when sent 301, or 302 redirects.
'CURLOPT_POSTREDIR' => 3
);
if ($action == 'user') {
+3 -3
View File
@@ -12,10 +12,10 @@ Feature: Add badges to the system
Scenario: Setting badges settings
Given I navigate to "Badges settings" node in "Site administration > Badges"
And I set the field "Default badge issuer name" to "Test Badge Site"
And I set the field "Default badge issuer contact details" to "testuser@test-badge-site.com"
And I set the field "Default badge issuer contact details" to "testuser@example.com"
And I press "Save changes"
When I follow "Add a new badge"
Then the field "issuercontact" matches value "testuser@test-badge-site.com"
Then the field "issuercontact" matches value "testuser@example.com"
And the field "issuername" matches value "Test Badge Site"
@javascript
@@ -30,7 +30,7 @@ Feature: Add badges to the system
| Name | Test Badge |
| Description | Test badge description |
| issuername | Test Badge Site |
| issuercontact | testuser@test-badge-site.com |
| issuercontact | testuser@example.com |
And I upload "badges/tests/behat/badge.png" file to "Image" filemanager
When I press "Create badge"
Then I should see "Edit details"
+21 -27
View File
@@ -12,7 +12,7 @@ Feature: Award badges
| Name | Profile Badge |
| Description | Test badge description |
| issuername | Test Badge Site |
| issuercontact | testuser@test-badge-site.com |
| issuercontact | testuser@example.com |
And I upload "badges/tests/behat/badge.png" file to "Image" filemanager
And I press "Create badge"
And I set the field "type" to "Profile completion"
@@ -39,8 +39,8 @@ Feature: Award badges
Scenario: Award site badge
Given the following "users" exist:
| username | firstname | lastname | email |
| teacher | teacher | 1 | teacher1@asd.com |
| student | student | 1 | student1@asd.com |
| teacher | teacher | 1 | teacher1@example.com |
| student | student | 1 | student1@example.com |
And I log in as "admin"
And I navigate to "Add a new badge" node in "Site administration > Badges"
And I set the following fields to these values:
@@ -56,9 +56,9 @@ Feature: Award badges
And I press "Continue"
And I follow "Recipients (0)"
And I press "Award badge"
And I set the field "potentialrecipients[]" to "teacher 1 (teacher1@asd.com)"
And I set the field "potentialrecipients[]" to "teacher 1 (teacher1@example.com)"
And I press "Award badge"
And I set the field "potentialrecipients[]" to "student 1 (student1@asd.com)"
And I set the field "potentialrecipients[]" to "student 1 (student1@example.com)"
And I press "Award badge"
When I follow "Site Badge"
Then I should see "Recipients (2)"
@@ -71,9 +71,9 @@ Feature: Award badges
Scenario: Award course badge
Given the following "users" exist:
| username | firstname | lastname | email |
| teacher1 | Teacher | 1 | teacher1@asd.com |
| student1 | Student | 1 | student1@asd.com |
| student2 | Student | 2 | student2@asd.com |
| teacher1 | Teacher | 1 | teacher1@example.com |
| student1 | Student | 1 | student1@example.com |
| student2 | Student | 2 | student2@example.com |
And the following "courses" exist:
| fullname | shortname | category | groupmode |
| Course 1 | C1 | 0 | 1 |
@@ -99,9 +99,9 @@ Feature: Award badges
And I press "Continue"
And I follow "Recipients (0)"
And I press "Award badge"
And I set the field "potentialrecipients[]" to "Student 2 (student2@asd.com)"
And I set the field "potentialrecipients[]" to "Student 2 (student2@example.com)"
And I press "Award badge"
And I set the field "potentialrecipients[]" to "Student 1 (student1@asd.com)"
And I set the field "potentialrecipients[]" to "Student 1 (student1@example.com)"
When I press "Award badge"
And I follow "Course Badge"
Then I should see "Recipients (2)"
@@ -118,16 +118,15 @@ Feature: Award badges
| Course 1 | C1 | 0 |
And the following "users" exist:
| username | firstname | lastname | email |
| teacher1 | Teacher | Frist | teacher1@asd.com |
| student1 | Student | First | student1@asd.com |
| teacher1 | Teacher | Frist | teacher1@example.com |
| student1 | Student | First | student1@example.com |
And the following "course enrolments" exist:
| user | course | role |
| teacher1 | C1 | editingteacher |
| student1 | C1 | student |
And I log in as "admin"
And I set the following administration settings values:
| Enable completion tracking | 1 |
And I follow "Home"
And the following config values are set as admin:
| enablecompletion | 1 |
And I log in as "teacher1"
And I follow "Course 1"
And I follow "Edit settings"
And I set the following fields to these values:
@@ -137,8 +136,6 @@ Feature: Award badges
And I add a "Assignment" to section "1" and I fill the form with:
| Assignment name | Test assignment name |
| Description | Submit your online text |
And I log out
And I log in as "teacher1"
And I follow "Course 1"
And I navigate to "Add a new badge" node in "Course administration > Badges"
And I follow "Add a new badge"
@@ -171,16 +168,15 @@ Feature: Award badges
| Course 1 | C1 | 0 |
And the following "users" exist:
| username | firstname | lastname | email |
| teacher1 | Teacher | Frist | teacher1@asd.com |
| student1 | Student | First | student1@asd.com |
| teacher1 | Teacher | Frist | teacher1@example.com |
| student1 | Student | First | student1@example.com |
And the following "course enrolments" exist:
| user | course | role |
| teacher1 | C1 | editingteacher |
| student1 | C1 | student |
And I log in as "admin"
And I set the following administration settings values:
| Enable completion tracking | 1 |
And I follow "Home"
And the following config values are set as admin:
| enablecompletion | 1 |
And I log in as "teacher1"
And I follow "Course 1"
And I follow "Edit settings"
And I set the following fields to these values:
@@ -194,10 +190,8 @@ Feature: Award badges
And I follow "Course completion"
And I set the field "id_overall_aggregation" to "2"
And I click on "Condition: Activity completion" "link"
And I set the field "Assign - Test assignment name" to "1"
And I set the field "Assignment - Test assignment name" to "1"
And I press "Save changes"
And I log out
And I log in as "teacher1"
And I follow "Course 1"
And I navigate to "Add a new badge" node in "Course administration > Badges"
And I follow "Add a new badge"
@@ -10,8 +10,8 @@ Feature: Add a comment to the comments block
| Course 1 | C1 | 0 |
And the following "users" exist:
| username | firstname | lastname | email |
| teacher1 | Teacher | Frist | teacher1@asd.com |
| student1 | Student | First | student1@asd.com |
| teacher1 | Teacher | Frist | teacher1@example.com |
| student1 | Student | First | student1@example.com |
And the following "course enrolments" exist:
| user | course | role |
| teacher1 | C1 | editingteacher |
@@ -11,8 +11,8 @@ Feature: Delete comment block messages
| Course 1 | C1 | 0 |
And the following "users" exist:
| username | firstname | lastname | email |
| teacher1 | Teacher | First | teacher1@asd.com |
| student1 | Student | First | student1@asd.com |
| teacher1 | Teacher | First | teacher1@example.com |
| student1 | Student | First | student1@example.com |
And the following "course enrolments" exist:
| user | course | role |
| teacher1 | C1 | editingteacher |
+1 -1
View File
@@ -133,7 +133,7 @@ if (empty($completions)) {
echo html_writer::start_tag('tr');
echo html_writer::start_tag('td', array('colspan' => '2'));
echo html_writer::start_tag('br');
echo $OUTPUT->box(get_string('err_nocriteria', 'completion'), 'noticebox');
echo $OUTPUT->box(get_string('nocriteriaset', 'completion'), 'noticebox');
echo html_writer::end_tag('td');
echo html_writer::end_tag('tr');
echo html_writer::end_tag('tbody');
@@ -112,7 +112,7 @@ class block_course_overview extends block_base {
* @return array
*/
public function applicable_formats() {
return array('my-index' => true);
return array('my' => true);
}
/**
@@ -125,4 +125,4 @@ class block_course_overview extends block_base {
$config = get_config('block_course_overview');
return !empty($config->showwelcomearea);
}
}
}
@@ -10,8 +10,8 @@ Feature: Course summary block used in a course
| Course 1 | C101 | Proved the course summary block works! |0 |
And the following "users" exist:
| username | firstname | lastname | email |
| student1 | Sam | Student | student1@asd.com |
| teacher1 | Teacher | One | teacher1@asd.com |
| student1 | Sam | Student | student1@example.com |
| teacher1 | Teacher | One | teacher1@example.com |
And the following "course enrolments" exist:
| user | course | role |
| student1 | C101 | student |
@@ -10,8 +10,8 @@ Feature: Random glossary entry block is used in a course
| Course 1 | C1 |
And the following "users" exist:
| username | firstname | lastname | email |
| student1 | Sam1 | Student1 | student1@test.com |
| teacher1 | Terry1 | Teacher1 | teacher1@test.com |
| student1 | Sam1 | Student1 | student1@example.com |
| teacher1 | Terry1 | Teacher1 | teacher1@example.com |
And the following "course enrolments" exist:
| user | course | role |
| student1 | C1 | student |
+2 -2
View File
@@ -7,8 +7,8 @@ Feature: HTML blocks in a course
Scenario: Adding HTML block in a course
Given the following "users" exist:
| username | firstname | lastname | email |
| teacher1 | Terry1 | Teacher1 | teacher@asd.com |
| student1 | Sam1 | Student1 | student1@asd.com |
| teacher1 | Terry1 | Teacher1 | teacher@example.com |
| student1 | Sam1 | Student1 | student1@example.com |
And the following "courses" exist:
| fullname | shortname |
| Course 1 | C1 |
+1 -1
View File
@@ -7,7 +7,7 @@ Feature: Login from a block
Background:
Given the following "users" exist:
| username | password | firstname | lastname | email |
| testuser | testpass | Test | User | student1@asd.com |
| testuser | testpass | Test | User | student1@example.com |
And I log in as "admin"
And I navigate to "Turn editing on" node in "Front page settings"
And I add the "Login" block
@@ -7,8 +7,8 @@ Feature: Expand the courses nodes within the navigation block
Background:
Given the following "users" exist:
| username | firstname | lastname | email |
| teacher1 | Teacher | 1 | teacher1@local.host |
| student1 | Student | 1 | student1@local.host |
| teacher1 | Teacher | 1 | teacher1@example.com |
| student1 | Student | 1 | student1@example.com |
And the following "categories" exist:
| name | category | idnumber | visible |
| cat1 | 0 | cat1 | 1 |
@@ -34,6 +34,8 @@ Feature: Expand the courses nodes within the navigation block
| student1 | c1 | student |
| student1 | c2 | student |
| student1 | c4 | student |
And the following config values are set as admin:
| navshowallcourses | 1 |
And I log in as "admin"
And I follow "Course 2"
And I turn editing mode on
@@ -187,4 +189,4 @@ Feature: Expand the courses nodes within the navigation block
And navigation node "c1" should not be expandable
And navigation node "c2" should be expandable
And navigation node "c3" should not be expandable
And navigation node "c4" should not be expandable
And navigation node "c4" should not be expandable
@@ -6,7 +6,7 @@ Feature: Test expand my courses navigation setting
Background:
Given the following "users" exist:
| username | firstname | lastname | email |
| student1 | Student | 1 | student1@asd.com |
| student1 | Student | 1 | student1@example.com |
And the following "categories" exist:
| name | category | idnumber |
| cat1 | 0 | cat1 |
@@ -29,10 +29,8 @@ Feature: Test expand my courses navigation setting
@javascript
Scenario: The My Courses branch is collapsed when expand my courses is off
Given I log in as "admin"
And I set the following administration settings values:
| Show My courses expanded on My home | 0 |
And I log out
Given the following config values are set as admin:
| navexpandmycourses | 0 |
When I log in as "student1"
And I click on "My home" "link" in the "Navigation" "block"
Then I should not see "c1" in the "Navigation" "block"
@@ -41,10 +39,8 @@ Feature: Test expand my courses navigation setting
@javascript
Scenario: My Courses can be expanded on the My Moodle page when expand my courses is off
Given I log in as "admin"
And I set the following administration settings values:
| Show My courses expanded on My home | 0 |
And I log out
Given the following config values are set as admin:
| navexpandmycourses | 0 |
When I log in as "student1"
And I click on "My home" "link" in the "Navigation" "block"
And I should not see "c1" in the "Navigation" "block"
@@ -7,7 +7,7 @@ Feature: View my courses in navigation block
Background:
Given the following "users" exist:
| username | firstname | lastname | email |
| student1 | Student | 1 | student1@asd.com |
| student1 | Student | 1 | student1@example.com |
And the following "categories" exist:
| name | category | idnumber |
| cat1 | 0 | cat1 |
@@ -29,13 +29,11 @@ Feature: View my courses in navigation block
| student1 | c1 | student |
| student1 | c31 | student |
| student1 | c331 | student |
And I log in as "admin"
@javascript
Scenario: The plain list of enrolled courses is shown
Given I set the following administration settings values:
| Show my course categories | 0 |
And I log out
Given the following config values are set as admin:
| navshowmycoursecategories | 0 |
And I log in as "student1"
When I click on "My home" "link" in the "Navigation" "block"
Then I should not see "cat1" in the "Navigation" "block"
@@ -49,9 +47,8 @@ Feature: View my courses in navigation block
@javascript
Scenario: The nested list of enrolled courses is shown
Given I set the following administration settings values:
| Show my course categories | 1 |
And I log out
Given the following config values are set as admin:
| navshowmycoursecategories | 1 |
And I log in as "student1"
When I click on "My home" "link" in the "Navigation" "block"
Then I should see "cat1" in the "Navigation" "block"
@@ -69,10 +66,9 @@ Feature: View my courses in navigation block
@javascript
Scenario: I can expand categories and courses as guest
Given I set the following administration settings values:
| Show my course categories | 1 |
| Show all courses | 1 |
And I log out
Given the following config values are set as admin:
| navshowmycoursecategories | 1 |
| navshowallcourses | 1 |
And I expand "Courses" node
And I should see "cat1" in the "Navigation" "block"
And I should see "cat2" in the "Navigation" "block"
@@ -8,7 +8,7 @@ Feature: Latest news block displays the course latest news
Scenario: Latest course news are displayed and can be configured
Given the following "users" exist:
| username | firstname | lastname | email |
| teacher1 | Teacher | 1 | teacher1@asd.com |
| teacher1 | Teacher | 1 | teacher1@example.com |
And I log in as "admin"
And I create a course with:
| Course full name | Course 1 |
@@ -10,7 +10,7 @@ Feature: People Block used in a course
| Course 1 | C101 | 0 |
And the following "users" exist:
| username | firstname | lastname | email |
| student1 | Sam | Student | student1@asd.com |
| student1 | Sam | Student | student1@example.com |
And the following "course enrolments" exist:
| user | course | role |
| student1 | C101 | student |
@@ -7,7 +7,7 @@ Feature: People Block used on frontpage
Background:
Given the following "users" exist:
| username | firstname | lastname | email |
| student1 | Sam | Student | student1@asd.com |
| student1 | Sam | Student | student1@example.com |
And I log in as "admin"
And I navigate to "Turn editing on" node in "Front page settings"
And I add the "People" block
@@ -40,7 +40,7 @@ $string['config_show_best'] = 'How many of the highest grades should be shown (0
$string['config_show_worst'] = 'How many of the lowest grades should be shown (0 to disable)?';
$string['configuredtoshownothing'] = 'This block\'s configuration currently does not allow it to show any results. You may want to either configure it or hide it.';
$string['config_use_groups'] = 'Show groups instead of students (only if the quiz supports groups)?';
$string['error_emptyquizid'] = 'There is an error right now with this block: you need to select which quiz it should display results from.';
$string['error_emptyquizid'] = 'Please configure this block and select which quiz it should display results from.';
$string['error_emptyquizrecord'] = 'There is an error right now with this block: the selected quiz does not seem to exist in the database.';
$string['error_nogroupsexist'] = 'There is an error right now with this block: it is set to display grades in group mode, but the course has no defined groups.';
$string['pluginname'] = 'Quiz results';
@@ -10,11 +10,11 @@ Feature: View structural changes in recent activity block
| Course 1 | C1 | 0 |
And the following "users" exist:
| username | firstname | lastname | email |
| teacher1 | Terry1 | Teacher1 | teacher1@asd.com |
| assistant1 | Terry2 | Teacher2 | teacher2@asd.com |
| student1 | Sam1 | Student1 | student1@asd.com |
| student2 | Sam2 | Student2 | student2@asd.com |
| student3 | Sam3 | Student3 | student3@asd.com |
| teacher1 | Terry1 | Teacher1 | teacher1@example.com |
| assistant1 | Terry2 | Teacher2 | teacher2@example.com |
| student1 | Sam1 | Student1 | student1@example.com |
| student2 | Sam2 | Student2 | student2@example.com |
| student3 | Sam3 | Student3 | student3@example.com |
And the following "course enrolments" exist:
| user | course | role |
| teacher1 | C1 | editingteacher |
@@ -46,10 +46,8 @@ Feature: View structural changes in recent activity block
| GG3 | G2 |
Scenario: Check that Added module information is displayed respecting view capability
Given I log in as "admin"
And I set the following administration settings values:
| Enable conditional access | 1 |
And I log out
Given the following config values are set as admin:
| enableavailability | 1 |
And I log in as "teacher1"
And I follow "Course 1"
And I turn editing mode on
+2 -2
View File
@@ -7,8 +7,8 @@ Feature: Add blocks
Background:
Given the following "users" exist:
| username | firstname | lastname | email |
| student1 | Student | 1 | student1@asd.com |
| student2 | Student | 2 | student2@asd.com |
| student1 | Student | 1 | student1@example.com |
| student2 | Student | 2 | student2@example.com |
And the following "courses" exist:
| fullname | shortname | format |
| Course 1 | C1 | topics |
@@ -10,7 +10,7 @@ Feature: Add and configure blocks throughout the site
| Course 1 | C1 | 0 |
And the following "users" exist:
| username | firstname | lastname | email |
| manager1 | Manager | 1 | manager1@asd.com |
| manager1 | Manager | 1 | manager1@example.com |
And the following "system role assigns" exist:
| user | course | role |
| manager1 | Acceptance test site | manager |
@@ -36,7 +36,7 @@ Feature: Add and configure blocks throughout the site
Scenario: My home does not allow assignation of roles on blocks
Given the following "users" exist:
| username | firstname | lastname | email |
| manager1 | Manager | 1 | manager1@asd.com |
| manager1 | Manager | 1 | manager1@example.com |
And I log in as "manager1"
And I click on "My home" "link" in the "Navigation" "block"
When I press "Customise this page"
+1 -1
View File
@@ -10,7 +10,7 @@ Feature: Block appearances
| Course 1 | C1 | 0 |
And the following "users" exist:
| username | firstname | lastname | email |
| teacher1 | teacher | 1 | teacher1@asd.com |
| teacher1 | teacher | 1 | teacher1@example.com |
And the following "course enrolments" exist:
| user | course | role |
| teacher1 | C1 | editingteacher |
@@ -7,7 +7,7 @@ Feature: Allowed blocks controls
Background:
Given the following "users" exist:
| username | firstname | lastname | email |
| teacher1 | Teacher | 1 | teacher1@asd.com |
| teacher1 | Teacher | 1 | teacher1@example.com |
And the following "courses" exist:
| fullname | shortname | category |
| Course 1 | C1 | 0 |
+2 -2
View File
@@ -7,8 +7,8 @@ Feature: Comment on a blog entry
Background:
Given the following "users" exist:
| username | firstname | lastname | email |
| testuser | Test | User | moodle@moodlemoodle.com |
| testuser2 | Test2 | User2 | moodle2@moodlemoodle.com |
| testuser | Test | User | moodle@example.com |
| testuser2 | Test2 | User2 | moodle2@example.com |
And I log in as "testuser"
And I am on homepage
And I expand "My profile" node
+2
View File
@@ -318,6 +318,8 @@ class cache_helper {
$definitionkey = $definition->get_component().'/'.$definition->get_area();
if (isset($inuse[$definitionkey])) {
$inuse[$definitionkey]->purge();
} else {
cache::make($definition->get_component(), $definition->get_area())->purge();
}
// We should only log events for application and session caches.
+1 -1
View File
@@ -51,7 +51,7 @@ ipaddress:port
servername:port:weight
</pre>
If *Enable clustered servers* is enabled below, there must be only one server listed here. This would usually be a name that always resolves to the local manchine, like 127.0.0.1 or localhost.';
If *Enable clustered servers* is enabled below, there must be only one server listed here. This would usually be a name that always resolves to the local machine, like 127.0.0.1 or localhost.';
$string['serversclusterinvalid'] = 'Exactly one server is required when clustering is enabled.';
$string['setservers'] = 'Set Servers';
$string['setservers_help'] = 'This is the list of servers that will updated when data is modified in the cache. Generally the fully qualified name of each server in the pool.
+1 -1
View File
@@ -65,7 +65,7 @@ ipaddress:port
servername:port:weight
</pre>
If *Enable clustered servers* is enabled below, there must be only one server listed here. This would usually be a name that always resolves to the local manchine, like 127.0.0.1 or localhost.';
If *Enable clustered servers* is enabled below, there must be only one server listed here. This would usually be a name that always resolves to the local machine, like 127.0.0.1 or localhost.';
$string['serversclusterinvalid'] = 'Exactly one server is required when clustering is enabled.';
$string['setservers'] = 'Set Servers';
$string['setservers_help'] = 'This is the list of servers that will updated when data is modified in the cache. Generally the fully qualified name of each server in the pool.
+2 -2
View File
@@ -2944,7 +2944,7 @@ function calendar_add_icalendar_event($event, $courseid, $subscriptionid, $timez
$name = $event->properties['SUMMARY'][0]->value;
$name = str_replace('\n', '<br />', $name);
$name = str_replace('\\', '', $name);
$name = preg_replace('/\s+/', ' ', $name);
$name = preg_replace('/\s+/u', ' ', $name);
$eventrecord = new stdClass;
$eventrecord->name = clean_param($name, PARAM_NOTAGS);
@@ -2956,7 +2956,7 @@ function calendar_add_icalendar_event($event, $courseid, $subscriptionid, $timez
$description = clean_param($description, PARAM_NOTAGS);
$description = str_replace('\n', '<br />', $description);
$description = str_replace('\\', '', $description);
$description = preg_replace('/\s+/', ' ', $description);
$description = preg_replace('/\s+/u', ' ', $description);
}
$eventrecord->description = $description;
+2 -2
View File
@@ -7,8 +7,8 @@ Feature: Perform basic calendar functionality
Background:
Given the following "users" exist:
| username | firstname | lastname | email |
| student1 | Student | 1 | student1@asd.com |
| student2 | Student | 2 | student2@asd.com |
| student1 | Student | 1 | student1@example.com |
| student2 | Student | 2 | student2@example.com |
And the following "courses" exist:
| fullname | shortname | format |
| Course 1 | C1 | topics |
+2
View File
@@ -328,6 +328,7 @@ class core_calendar_externallib_testcase extends externallib_advanced_testcase {
$paramevents = array ('courseids' => array($course->id), 'groupids' => array($group->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(4, count($events['events'])); // site, user, group, one course event.
$this->assertEquals(0, count($events['warnings']));
@@ -390,6 +391,7 @@ class core_calendar_externallib_testcase extends externallib_advanced_testcase {
array('name' => 'user')
);
$eventsret = core_calendar_external::create_calendar_events($events);
$eventsret = external_api::clean_returnvalue(core_calendar_external::create_calendar_events_returns(), $eventsret);
// Check to see if things were created properly.
$aftercount = $DB->count_records('event');
+23 -11
View File
@@ -118,6 +118,7 @@ echo $search;
echo $OUTPUT->paging_bar($cohorts['totalcohorts'], $page, 25, $baseurl);
$data = array();
$editcolumnisempty = true;
foreach($cohorts['cohorts'] as $cohort) {
$line = array();
$cohortcontext = context::instance_by_id($cohort->contextid);
@@ -148,27 +149,29 @@ foreach($cohorts['cohorts'] as $cohort) {
$urlparams = array('id' => $cohort->id, 'returnurl' => $baseurl->out_as_local_url());
$showhideurl = new moodle_url('/cohort/edit.php', $urlparams + array('sesskey' => sesskey()));
if ($cohort->visible) {
$showhideurl->param('hide', 1);
$visibleimg = html_writer::empty_tag('img', array('src' => $OUTPUT->pix_url('t/hide'), 'alt' => get_string('hide'), 'class' => 'iconsmall'));
$buttons[] = html_writer::link($showhideurl, $visibleimg, array('title' => get_string('hide')));
} else {
$showhideurl->param('show', 1);
$visibleimg = html_writer::empty_tag('img', array('src' => $OUTPUT->pix_url('t/show'), 'alt' => get_string('show'), 'class' => 'iconsmall'));
$buttons[] = html_writer::link($showhideurl, $visibleimg, array('title' => get_string('show')));
}
if ($cohortmanager) {
if ($cohort->visible) {
$showhideurl->param('hide', 1);
$visibleimg = html_writer::empty_tag('img', array('src' => $OUTPUT->pix_url('t/hide'), 'alt' => get_string('hide'), 'class' => 'iconsmall'));
$buttons[] = html_writer::link($showhideurl, $visibleimg, array('title' => get_string('hide')));
} else {
$showhideurl->param('show', 1);
$visibleimg = html_writer::empty_tag('img', array('src' => $OUTPUT->pix_url('t/show'), 'alt' => get_string('show'), 'class' => 'iconsmall'));
$buttons[] = html_writer::link($showhideurl, $visibleimg, array('title' => get_string('show')));
}
$buttons[] = html_writer::link(new moodle_url('/cohort/edit.php', $urlparams + array('delete' => 1)),
html_writer::empty_tag('img', array('src' => $OUTPUT->pix_url('t/delete'), 'alt' => get_string('delete'), 'class' => 'iconsmall')),
array('title' => get_string('delete')));
$buttons[] = html_writer::link(new moodle_url('/cohort/edit.php', $urlparams),
html_writer::empty_tag('img', array('src' => $OUTPUT->pix_url('t/edit'), 'alt' => get_string('edit'), 'class' => 'iconsmall')),
array('title' => get_string('edit')));
$editcolumnisempty = false;
}
if ($cohortcanassign) {
$buttons[] = html_writer::link(new moodle_url('/cohort/assign.php', $urlparams),
html_writer::empty_tag('img', array('src' => $OUTPUT->pix_url('i/users'), 'alt' => get_string('assign', 'core_cohort'), 'class' => 'iconsmall')),
array('title' => get_string('assign', 'core_cohort')));
$editcolumnisempty = false;
}
}
$line[] = implode(' ', $buttons);
@@ -180,12 +183,21 @@ foreach($cohorts['cohorts'] as $cohort) {
}
$table = new html_table();
$table->head = array(get_string('name', 'cohort'), get_string('idnumber', 'cohort'), get_string('description', 'cohort'),
get_string('memberscount', 'cohort'), get_string('component', 'cohort'), get_string('edit'));
$table->colclasses = array('leftalign name', 'leftalign id', 'leftalign description', 'leftalign size','centeralign source', 'centeralign action');
get_string('memberscount', 'cohort'), get_string('component', 'cohort'));
$table->colclasses = array('leftalign name', 'leftalign id', 'leftalign description', 'leftalign size','centeralign source');
if ($showall) {
array_unshift($table->head, get_string('category'));
array_unshift($table->colclasses, 'leftalign category');
}
if (!$editcolumnisempty) {
$table->head[] = get_string('edit');
$table->colclasses[] = 'centeralign action';
} else {
// Remove last column from $data.
foreach ($data as $row) {
array_pop($row->cells);
}
}
$table->id = 'cohorts';
$table->attributes['class'] = 'admintable generaltable';
$table->data = $data;
@@ -22,10 +22,10 @@ Feature: Access visible and hidden cohorts
| Cohort empty in category 1 | CVE1 | Category | CAT1 | 1 |
Given the following "users" exist:
| username | firstname | lastname | email |
| user1 | First | User | first@user.com |
| user2 | Second | User | second@user.com |
| student | Sam | User | student@user.com |
| teacher | Terry | User | teacher@user.com |
| user1 | First | User | first@example.com |
| user2 | Second | User | second@example.com |
| student | Sam | User | student@example.com |
| teacher | Terry | User | teacher@example.com |
And the following "cohort members" exist:
| user | cohort |
| student | CV0 |
@@ -60,7 +60,7 @@ Feature: Access visible and hidden cohorts
And I set the field "Cohort" to "System cohort"
And I press "Add method"
And I navigate to "Enrolled users" node in "Course administration > Users"
And I should see "student@user.com"
And I should see "student@example.com"
And I navigate to "Groups" node in "Course administration > Users"
And I press "Auto-create groups"
And the "Select members from cohort" select box should contain "Cohort in category 1"
@@ -87,7 +87,7 @@ Feature: Access visible and hidden cohorts
And I set the field "Cohort" to "System cohort"
And I press "Add method"
And I navigate to "Enrolled users" node in "Course administration > Users"
And I should see "student@user.com"
And I should see "student@example.com"
And I navigate to "Groups" node in "Course administration > Users"
And I press "Auto-create groups"
And the "Select members from cohort" select box should contain "Cohort in category 1"
@@ -114,7 +114,7 @@ Feature: Access visible and hidden cohorts
And I set the field "Cohort" to "System cohort"
And I press "Add method"
And I navigate to "Enrolled users" node in "Course administration > Users"
And I should see "student@user.com"
And I should see "student@example.com"
And I navigate to "Groups" node in "Course administration > Users"
And I press "Auto-create groups"
And the "Select members from cohort" select box should contain "Cohort in category 1"
+12 -12
View File
@@ -7,10 +7,10 @@ Feature: Add cohorts of users
Background:
Given the following "users" exist:
| username | firstname | lastname | email |
| user1 | First | User | first@user.com |
| user2 | Second | User | second@user.com |
| user3 | Third | User | third@user.com |
| user4 | Forth | User | forth@user.com |
| user1 | First | User | first@example.com |
| user2 | Second | User | second@example.com |
| user3 | Third | User | third@example.com |
| user4 | Forth | User | forth@example.com |
And I log in as "admin"
And I navigate to "Cohorts" node in "Site administration > Users > Accounts"
And I follow "Add new cohort"
@@ -31,13 +31,13 @@ Feature: Add cohorts of users
@javascript
Scenario: Add users to a cohort selecting them from the system users list
When I add "First User (first@user.com)" user to "333" cohort members
And I add "Second User (second@user.com)" user to "333" cohort members
When I add "First User (first@example.com)" user to "333" cohort members
And I add "Second User (second@example.com)" user to "333" cohort members
Then I should see "2" in the "#cohorts" "css_element"
And I follow "Assign"
And the "Current users" select box should contain "First User (first@user.com)"
And the "Current users" select box should contain "Second User (second@user.com)"
And the "Current users" select box should not contain "Forth User (forth@user.com)"
And the "Current users" select box should contain "First User (first@example.com)"
And the "Current users" select box should contain "Second User (second@example.com)"
And the "Current users" select box should not contain "Forth User (forth@example.com)"
@javascript
Scenario: Add users to a cohort using a bulk user action
@@ -53,6 +53,6 @@ Feature: Add cohorts of users
And I follow "Cohorts"
Then I should see "2" in the "#cohorts" "css_element"
And I follow "Assign"
And the "Current users" select box should contain "Third User (third@user.com)"
And the "Current users" select box should contain "Forth User (forth@user.com)"
And the "Current users" select box should not contain "First User (first@user.com)"
And the "Current users" select box should contain "Third User (third@example.com)"
And the "Current users" select box should contain "Forth User (forth@example.com)"
And the "Current users" select box should not contain "First User (first@example.com)"

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