Compare commits

..

743 Commits

Author SHA1 Message Date
Eloy Lafuente (stronk7) aba54964ab Moodle release 2.8.12 2016-05-08 00:23:44 +02:00
Eloy Lafuente (stronk7) 5f84553fab Merge branch 'install_28_STABLE' of https://git.in.moodle.com/amosbot/moodle-install into MOODLE_28_STABLE 2016-05-08 00:23:39 +02:00
Simey Lameze f6b0de1361 MDL-53913 core_user: make parameters consistent across versions 2016-05-06 09:49:14 +08:00
Andrew Nicols 20e9dac8cb MDL-53589 badges: Correct context 2016-05-06 09:49:14 +08:00
Eloy Lafuente (stronk7) 71c7374d5d MDL-54018 timezones: Updated to 2016d 2016-05-06 09:49:13 +08:00
Frederic Massart 897f31a5d0 MDL-51369 course: Adding tests to cover restoring course info 2016-05-06 09:49:13 +08:00
Frederic Massart 12c2857486 MDL-51369 backup: Respect capabilities when restoring course info
In short, when a user is creating a new course they can set
the ID number, shortname, fullname and summary. However, when
they merge a backup into a course they need the permissions to do so.
2016-05-06 09:49:12 +08:00
Frederic Massart fada069133 MDL-53954 user: Prevent locked profile fields from being edited 2016-05-06 09:49:12 +08:00
Andrew Nicols 7873e36f0c MDL-53755 forum: Check session when marking posts 2016-05-06 09:49:11 +08:00
Andrew Nicols 6336c56259 MDL-53696 forum: Check discussion in forum 2016-05-06 09:49:11 +08:00
Dan Marsden aca2ff0ad1 MDL-53546 SCORM: Set window.opener to null 2016-05-06 09:49:11 +08:00
AMOS bot 33a358331f Automatically generated installer lang files 2016-05-05 00:05:01 +08:00
David Monllao 28908d2d6a MDL-54008 tz: Avoid using Caracas tz
Changed in May 2016.
2016-05-02 16:37:29 +08:00
AMOS bot fc8c321aa9 Automatically generated installer lang files 2016-05-02 00:04:46 +08:00
AMOS bot 5b4be737f9 Automatically generated installer lang files 2016-04-30 00:07:20 +08:00
Dan Poltawski 0e38101745 weekly release 2.8.11+ 2016-04-29 15:38:05 +01:00
Dan Poltawski 54196b7acd Merge branch 'install_28_STABLE' of https://git.in.moodle.com/amosbot/moodle-install into MOODLE_28_STABLE 2016-04-29 15:38:03 +01:00
Eloy Lafuente (stronk7) 89724d0c1c MDL-53928 environment: add xmlreader requirement for 3.1 2016-04-24 01:37:37 +02:00
AMOS bot 8bc54c07a2 Automatically generated installer lang files 2016-04-13 00:04:44 +08:00
AMOS bot 7c54533cdc Automatically generated installer lang files 2016-04-07 00:05:29 +08:00
AMOS bot 34e8b2dbd0 Automatically generated installer lang files 2016-04-01 00:05:19 +08:00
Dan Poltawski d4f2c87bca weekly release 2.8.11+ 2016-03-31 14:06:48 +08:00
Dan Poltawski 2a6ff0c2be Merge branch 'install_28_STABLE' of https://git.in.moodle.com/amosbot/moodle-install into MOODLE_28_STABLE 2016-03-31 14:06:45 +08:00
AMOS bot 685a238e8d Automatically generated installer lang files 2016-03-30 00:04:45 +08:00
AMOS bot c9e71927d4 Automatically generated installer lang files 2016-03-29 00:04:45 +08:00
AMOS bot 19eb7b80fa Automatically generated installer lang files 2016-03-25 00:05:00 +08:00
Eloy Lafuente (stronk7) df74d3d557 MDL-53585 timezones: Updated to 2016b 2016-03-23 13:21:50 +01:00
Eloy Lafuente (stronk7) 3ed9d1c176 Moodle release 2.8.11 2016-03-12 00:37:54 +01:00
Eloy Lafuente (stronk7) 488087cb69 Merge branch 'install_28_STABLE' of https://git.in.moodle.com/amosbot/moodle-install into MOODLE_28_STABLE 2016-03-12 00:37:50 +01:00
Eloy Lafuente (stronk7) 4e5732e7fe MDL-51167 tool_monitor: fix too strict condition 2016-03-10 00:14:11 +01:00
Simey Lameze d9d8e9c3fe MDL-50705 auth_db: apply standard cleaning to all fields
Also unit tests were added to cover the new clean_data() method.
2016-03-09 18:29:09 +01:00
Simey Lameze 4ee7394c8b MDL-50705 core_user: introduce new fill_properties_cache()
Also the get_property_definition() was created to get the property without retrieve the whole definition cache and
    unit tests were created to tests those new methods.
2016-03-09 18:29:07 +01:00
Simey Lameze a0cd21cd5c MDL-53031 mod_assign: add session check on assignment plugins management 2016-03-08 19:54:43 +01:00
Jun Pataleta a0034bb017 MDL-52433 user: Remove unnecessary capability check 2016-03-08 12:24:46 +01:00
Simey Lameze 89b97390d0 MDL-51167 tool_monitor: check course visibility and user 2016-03-08 03:09:57 +01:00
Cameron Ball 190757854d MDL-52651 htmlpurifier: Append rel=noreferrer to links.
Thank you to Zachary Durber for originally working on this issue.
2016-03-08 02:10:17 +01:00
Krista Koivisto dc8421575f MDL-52774 ajax: Require authentication when getting nav branch
When getting the navigation branch data through AJAX, require
login if forcelogin is set.
2016-03-08 00:38:52 +01:00
Juan Leyva 0f989a4c70 MDL-52901 mod_assign: Check due dates in external save_submission 2016-03-08 00:14:31 +01:00
David Monllao b74d0f8404 MDL-52378 singleview: Using is_disabled instead of is_locked 2016-03-07 23:01:35 +01:00
Travis Noll 71beedee8c MDL-52378 Singleview: Exclude Grade Attribute Permissions
Singleview users must have Manage Grade permission to modify the
Exclude grade attribute.
2016-03-07 23:01:25 +01:00
Juan Leyva d63ac148b9 MDL-52808 calendar: Do not return events for hidden activities 2016-03-07 22:31:49 +01:00
David Mudrák 8f95eac163 MDL-52727 mod_data: Improve output of the form fields values
This issue mostly affects the search form fields. Submitted values for
these fields are typically obtained via optional_param() with
PARAM_NOTAGS specified as the parameter type - see parse_search_field()
methods. Such values themselves are not safe enough to be printed back
directly into the HTML as they might contain malicious code.

While working on the patch, some other places with weak protection were
detected and fixed.

In case of the itemid parameters, the s() seems to be unnecessary but it
was added anyway as an extra protection (just in case the code flow
changes or the parts of the code are re-used elsewhere).
2016-03-07 22:07:17 +01:00
AMOS bot 8e12ce7e28 Automatically generated installer lang files 2016-03-03 22:24:34 +08:00
AMOS bot 3703791954 Automatically generated installer lang files 2016-03-03 22:24:33 +08:00
AMOS bot a457f23484 Automatically generated installer lang files 2016-03-03 00:04:39 +08:00
AMOS bot 608beccda3 Automatically generated installer lang files 2016-02-28 00:04:35 +08:00
AMOS bot 51eb1032de Automatically generated installer lang files 2016-02-25 00:12:05 +08:00
AMOS bot b7d5dffc77 Automatically generated installer lang files 2016-02-24 00:04:51 +08:00
Dan Poltawski d3142bcdbe weekly release 2.8.10+ 2016-02-22 09:10:51 +00:00
Dan Poltawski 75066aabb0 Merge branch 'install_28_STABLE' of https://git.in.moodle.com/amosbot/moodle-install into MOODLE_28_STABLE 2016-02-22 09:10:48 +00:00
AMOS bot 16fce86c8b Automatically generated installer lang files 2016-02-13 00:04:48 +08:00
Eloy Lafuente (stronk7) 22277cfabf MDL-51580 environment: 3.1 requirements added
Only important change is that Moodle 2.7 installed is
required to be able to upgrade to 3.1. See the issue
for opinions, votes and agreed outcomes.
2016-02-10 18:28:53 +01:00
AMOS bot 02d953d1b2 Automatically generated installer lang files 2016-02-10 00:04:34 +08:00
AMOS bot 03fb8a8769 Automatically generated installer lang files 2016-02-06 00:04:34 +08:00
AMOS bot 962bf40a1e Automatically generated installer lang files 2016-02-04 00:04:41 +08:00
AMOS bot 00c165d8f3 Automatically generated installer lang files 2016-01-28 00:04:47 +08:00
AMOS bot 54ba33e91b Automatically generated installer lang files 2016-01-26 00:04:31 +08:00
AMOS bot e96ea8d846 Automatically generated installer lang files 2016-01-25 00:04:33 +08:00
AMOS bot 3edce27167 Automatically generated installer lang files 2016-01-23 00:04:43 +08:00
AMOS bot ac60c71cb6 Automatically generated installer lang files 2016-01-19 00:05:16 +08:00
AMOS bot 63e9112aec Automatically generated installer lang files 2016-01-13 00:04:26 +08:00
Eloy Lafuente (stronk7) 2e8e92b0f1 Moodle release 2.8.10 2016-01-09 00:49:45 +01:00
Eloy Lafuente (stronk7) cd654c06a7 Merge branch 'install_28_STABLE' of https://git.in.moodle.com/amosbot/moodle-install into MOODLE_28_STABLE 2016-01-09 00:49:41 +01:00
AMOS bot b25f428173 Automatically generated installer lang files 2016-01-06 00:04:28 +08:00
Juan Leyva 535fd9678f MDL-52072 enrol: Fix course visibility checks in external functions 2016-01-05 10:31:39 +00:00
Dan Poltawski 627e723096 MDL-52552 course management: insufficient cleaning of search output 2016-01-05 10:51:43 +08:00
AMOS bot 81f444886a Automatically generated installer lang files 2016-01-04 00:04:48 +08:00
AMOS bot fe3db63c77 Automatically generated installer lang files 2015-12-25 00:04:31 +08:00
AMOS bot 0b08576ea7 Automatically generated installer lang files 2015-12-20 00:05:42 +08:00
Dan Poltawski 71d630fd59 weekly release 2.8.9+ 2015-12-18 12:27:29 +00:00
Dan Poltawski ae9a34b2d4 Merge branch 'install_28_STABLE' of https://git.in.moodle.com/amosbot/moodle-install into MOODLE_28_STABLE 2015-12-18 12:27:27 +00:00
Marina Glancy e0db7da9e2 MDL-52438 core: allow Moodle 3.0 to be used with PHP7 2015-12-10 17:58:01 +08:00
AMOS bot 32ea431a2f Automatically generated installer lang files 2015-12-05 00:04:59 +08:00
Eloy Lafuente (stronk7) 56068f1aeb weekly release 2.8.9+ 2015-12-03 19:41:02 +01:00
Eloy Lafuente (stronk7) bd696650b7 Merge branch 'install_28_STABLE' of https://git.in.moodle.com/amosbot/moodle-install into MOODLE_28_STABLE 2015-12-03 19:40:54 +01:00
AMOS bot 9157b95733 Automatically generated installer lang files 2015-12-04 00:04:59 +08:00
AMOS bot 025ed8a332 Automatically generated installer lang files 2015-11-28 00:05:17 +08:00
John Okely 397f50e376 MDL-52260 user: Fix error when saving profile with locked field 2015-11-27 11:03:12 +08:00
AMOS bot 4a702ed500 Automatically generated installer lang files 2015-11-25 00:04:45 +08:00
Dan Poltawski b6e2489fd3 weekly release 2.8.9+ 2015-11-19 09:20:36 +00:00
Dan Poltawski fc542633e8 Merge branch 'wip-MDL-52194-m28' of https://github.com/marinaglancy/moodle into MOODLE_28_STABLE 2015-11-19 06:49:55 +00:00
Marina Glancy f988f63bc6 MDL-52194 flowplayer: do not check request
$_REQUEST variable may contain cookies in some php configurations. See also MDL-48085
2015-11-18 15:38:04 +08:00
David Monllao f0f739f4be weekly release 2.8.9+ 2015-11-13 15:27:46 +08:00
David Monllao df2527eb4a Merge branch 'install_28_STABLE' of https://git.in.moodle.com/amosbot/moodle-install into MOODLE_28_STABLE 2015-11-13 15:27:44 +08:00
Eloy Lafuente (stronk7) ade73d44bf Merge branch 'MDL-51495-m28' of https://github.com/NeillM/moodle into MOODLE_28_STABLE 2015-11-11 16:17:26 +00:00
David Monllao 0fae5133a0 Merge branch 'MDL-51913_statistics_dup_1st_column_MDL28' of git://github.com/barrysspace/moodle into MOODLE_28_STABLE 2015-11-11 16:17:25 +00:00
David Monllao ff65861526 Merge branch 'MDL-51935-28' of git://github.com/dpalou/moodle into MOODLE_28_STABLE 2015-11-11 16:17:24 +00:00
Eloy Lafuente (stronk7) 7920d1f08b Merge branch 'wip-mdl-52077-m28' of https://github.com/rajeshtaneja/moodle into MOODLE_28_STABLE 2015-11-11 16:17:24 +00:00
Eloy Lafuente (stronk7) 6193543174 Merge branch 'wip-mdl-52066-m28' of https://github.com/rajeshtaneja/moodle into MOODLE_28_STABLE 2015-11-11 16:17:23 +00:00
Eloy Lafuente (stronk7) 097fe73bab Merge branch 'MDL-51686-28' of git://github.com/damyon/moodle into MOODLE_28_STABLE 2015-11-11 16:17:23 +00:00
Eloy Lafuente (stronk7) b4f7f20a74 Merge branch 'MDL-50781-28' of git://github.com/danpoltawski/moodle into MOODLE_28_STABLE 2015-11-11 16:17:22 +00:00
Eloy Lafuente (stronk7) 9856eadb1b Merge branch 'MDL-51720-28' of git://github.com/damyon/moodle into MOODLE_28_STABLE 2015-11-11 16:17:22 +00:00
AMOS bot 027baac82e Automatically generated installer lang files 2015-11-12 00:04:25 +08:00
Neill Magill 8102ded93a MDL-51495 calendar: E_WARNING in core_calendar_get_calendar_events
If a user does not have the 'moodle/calendar:manageentries' capability then an E_WARNING
can be generated by the core_calendar_external::get_calendar_events() method, that an
expected array is null

This patch creates an array that is missing when a user does not have the capability.
2015-11-11 15:23:13 +00:00
Neill Magill 7cd705334e MDL-51495 calendar: Unit test to get an individual course event
If is user requests a single event on a course via the web service they should be able to retrieve it.
2015-11-11 15:22:47 +00:00
Eloy Lafuente (stronk7) 86eaf83174 weekly release 2.8.9+ 2015-11-10 10:49:58 +01:00
Eloy Lafuente (stronk7) e8f0c133eb Merge branch 'install_28_STABLE' of https://git.in.moodle.com/amosbot/moodle-install into MOODLE_28_STABLE 2015-11-10 10:49:50 +01:00
Dan Poltawski 8535cc180e MDL-52063 forum: Moved notification is not a problem
The default behaviour of $OUTPUT->notification() is to indiciate a
problem.
2015-11-10 09:38:23 +00:00
Dan Poltawski e74ff55ff5 Merge branch 'MDL-52063-28' of git://github.com/xow/moodle into MOODLE_28_STABLE 2015-11-10 09:21:33 +00:00
Dani Palou 5d2e3c1b97 MDL-51935 wiki: Add missing strings in wiki 2015-11-10 10:11:19 +01:00
Rajesh Taneja 120b3ad637 MDL-52077 unittest: Fixed string typo 2015-11-10 13:54:46 +08:00
Rajesh Taneja ed611437a6 MDL-52066 unittest: Use ics file from external repo 2015-11-10 13:43:40 +08:00
John Okely c1c1dc7a58 MDL-52063 forum: Display message when moving forum 2015-11-10 10:24:29 +08:00
AMOS bot 7511a99d0b Automatically generated installer lang files 2015-11-10 00:04:28 +08:00
Dan Poltawski 3afbdcb211 Merge branch 'MDL-51837-28' of git://github.com/junpataleta/moodle into MOODLE_28_STABLE 2015-11-09 11:33:03 +00:00
Dan Poltawski 4d47398bdc Merge branch 'MDL-51628-28' of git://github.com/damyon/moodle into MOODLE_28_STABLE 2015-11-09 11:01:43 +00:00
David Monllao f8c0d18110 Merge branch 'MDL-40245_28' of git://github.com/SWiT/moodle into MOODLE_28_STABLE 2015-11-09 16:13:46 +08:00
David Monllao d84ddfda00 Merge branch 'MDL-49473-28' of git://github.com/danpoltawski/moodle into MOODLE_28_STABLE 2015-11-09 15:13:22 +08:00
Eloy Lafuente (stronk7) ae1854f55c Moodle release 2.8.9 2015-11-06 20:51:38 +01:00
Dan Poltawski 394cba177e weekly release 2.8.8+ 2015-11-06 11:56:38 +00:00
Rajesh Taneja 9d9cfb8736 MDL-51685 unittest: Test functionality individually 2015-11-06 11:24:41 +01:00
Eloy Lafuente (stronk7) 8e2cd6b91a MDL-51861 enrol: added missing external cleanup for formal compliance 2015-11-06 10:05:56 +00:00
Dan Poltawski 6b9c205a99 MDL-51569 mod_choice: Fix use of hardcoded ids
(Previous approach of making up ids longer works now we are validating
them..)
2015-11-06 08:12:57 +00:00
Dani Palou 512633461a MDL-51861 enrol: Don't get all parts in get_enrolled_users with groups 2015-11-06 15:12:11 +08:00
Eloy Lafuente (stronk7) 61ecc0d5f0 MDL-51861 enrol: new unit test to verify all conditions and filters
This unit test does not verify contents, details, but only
that the returned users for every group mode, for every
filtering (active, groupid and withcapability) together
with permissions are correct.
2015-11-06 15:12:07 +08:00
John Okely 02d8c8ca39 MDL-51569 mod_choice: Prevent users from updating choices with curl 2015-11-06 14:53:26 +08:00
Andrew Nicols 11d4f442bb MDL-51685-master Fix unit tests following change
These unit tests were modifying the PAGE and other globals in the middle of
tests and were failing as a result.

Broke the tests up into separate tests where the functionality is now
tested individually.
2015-11-06 10:37:04 +08:00
Damyon Wiese 5c16db4fc5 MDL-51569 mod_choice: Validate the submitted optionid
Make sure any submitted choice options actually belong to the current choice
module.
2015-11-05 10:48:51 +00:00
Damyon Wiese c03882584d MDL-51720 assign: Always fallback on userid as a default sort
Even when the table has no userid column (this is normally the edit column).
2015-11-05 15:36:30 +08:00
Andrew Nicols 720d88779e Merge branch 'MDL-51395-28' of git://github.com/junpataleta/moodle into MOODLE_28_STABLE 2015-11-05 14:03:27 +08:00
Jun Pataleta 5dd381d25c MDL-51395 blog: Fix output of strings for blog comments 2015-11-04 23:47:59 -06:00
Andrew Nicols cb2220bfde Merge branch 'MDL-26429-28' of git://github.com/cameron1729/moodle into MOODLE_28_STABLE 2015-11-05 12:17:44 +08:00
Andrew Nicols c9d8b0d29a MDL-51899 mod_forum: Add test for allowing 0 grades 2015-11-05 12:08:54 +08:00
Cameron Ball 29d6115e65 MDL-26429 usability: Add course completion icons.
This patch adds a method to the course completion criteria classes
which allows them to specify an icon for display in the course
completion report table.

There is a default implementation which simply looks for an icon
in pix/i with a name matching the completion criteria type.
2015-11-05 11:41:49 +08:00
Barbara Ramiro 2dffff79c7 MDL-26429 Course completion icons for self, duration, and role. 2015-11-05 11:41:48 +08:00
Andrew Nicols 9be0bf1d10 Merge branch 'MDL-51899_28' of git://github.com/jacac/moodle into MOODLE_28_STABLE 2015-11-05 11:27:37 +08:00
Andrew Nicols 9ba8006955 Merge branch 'MDL-51685-28' of git://github.com/dpalou/moodle into MOODLE_28_STABLE 2015-11-05 10:42:29 +08:00
rajesh Taneja fe9bd2b8bb MDL-50837 mod_scorm: include locallib to access function 2015-11-05 10:25:05 +08:00
Matt Switlik d7b80c7dd4 MDL-40245 assignment: download all submissions raise time limit 2015-11-04 16:29:25 -05:00
Jakob 57d281f554 MDL-51899 mod/assign: Allow 0.00 grades while editing a grade.
The function unformat_float can return 0 and false.
We need to do strict comparison for the return value on line 92 to accept grades 0.00.
2015-11-04 11:08:06 -08:00
David Monllao d41fa94a69 MDL-51684 badges: Make sure 'moodle/badges:viewbadges' is respected
Credit to Yuliya Bozhko.
2015-11-04 13:02:44 +00:00
Juan Leyva d28eedd536 MDL-50837 mod_scorm: Fix availability checks 2015-11-04 12:56:11 +01:00
Juan Leyva 72885a5725 MDL-51569 mod_choice: Check choice availability prior to do any action 2015-11-04 11:08:51 +00:00
Cameron Ball 7bf5c6a542 MDL-51091 core_registration: session key check in registration. 2015-11-04 18:46:26 +08:00
Simey Lameze b4f4232e1c MDL-49940 mod_survey: Fix XSS on survey module 2015-11-04 18:46:26 +08:00
Hugh Davenport f03ec4ce85 MDL-49940 mod_survey: Escape user comments
This patch fixes a XSS vulnerability with surveys where a student user
    could inject arbitrary HTML in a comment on the survey. The fix is to
    escape the comment before displaying it to the teacher.
2015-11-04 18:46:26 +08:00
David Monllao 50632a0681 MDL-51000 editor_atto: No autosave for guests 2015-11-04 18:46:26 +08:00
Simey Lameze dcb42c9ed1 MDL-48109 mod_lesson: prevent CSRF on lesson
This commit add a new session key hidden field on the lesson password form
and confirm if the session key is valid on related pages to prevent CSRF on
password protected lessons.
2015-11-04 18:46:26 +08:00
Petr Skoda 7db05ae3b2 MDL-48085 flowplayer: prevent flash parameters via url 2015-11-04 10:38:34 +00:00
Andrew Nicols 8e093acc9d Merge branch 'MDL-45814-28' of git://github.com/danpoltawski/moodle into MOODLE_28_STABLE 2015-11-04 14:05:19 +08:00
Andrew Nicols 5bd1977645 Merge branch 'MDL-52004-28' of git://github.com/damyon/moodle into MOODLE_28_STABLE 2015-11-04 13:47:10 +08:00
Andrew Nicols 63d70b1eca Merge branch 'wip-MDL-51486-28' of git://github.com/abgreeve/moodle into MOODLE_28_STABLE 2015-11-04 11:50:45 +08:00
Andrew Nicols 2c6d1dd02d Merge branch 'MDL-51918-28-navigable' of https://github.com/pauln/moodle into MOODLE_28_STABLE 2015-11-04 11:30:51 +08:00
Adrian Greeve 5c31064d5e MDL-51486 mod_data: Unit test update for item ratings.
Additional checks that access is available for item ratings
on records that have a group id of zero (all participants).
2015-11-04 10:17:08 +08:00
Adrian Greeve 6dfb7f0eca MDL-51486 mod_data: Can view rating information.
When students are given the appropriate permissions
to view ratings, in the situation where there are
separate groups. The students can view the ratings
of an entry that is in the all participants group.
2015-11-04 10:16:52 +08:00
Paul Nicholls 80ef82e3f3 MDL-51918 gradereport: Fix AJAX mode keyboard navigation
Keyboard navigation (ctrl+up/down/left/right) with AJAX enabled ceased
functioning with editing mode enabled after MDL-36606, as it was looking
for cells with a "clickable" class - but was only applying that class when
editing mode is NOT enabled.  This patch uses a new "gbnavigable" class to
control keyboard navigation, whether editing mode is on or not.  It also
addresses some browser compatibility and minor behavioural issues.

# Conflicts:
#	grade/report/grader/module.js
2015-11-04 11:53:57 +13:00
Eloy Lafuente (stronk7) 336f2e073b weekly release 2.8.8+ 2015-11-03 18:46:14 +01:00
Eloy Lafuente (stronk7) 27f5d818de Merge branch 'install_28_STABLE' of https://git.in.moodle.com/amosbot/moodle-install into MOODLE_28_STABLE 2015-11-03 18:45:55 +01:00
Eloy Lafuente (stronk7) c2da1ffea9 Merge branch 'wip-mdl-52007-m28' of https://github.com/rajeshtaneja/moodle into MOODLE_28_STABLE 2015-11-03 18:00:50 +01:00
Eloy Lafuente (stronk7) 7f50bc1d2f Merge branch 'wip-mdl-52020-m28' of https://github.com/rajeshtaneja/moodle into MOODLE_28_STABLE 2015-11-03 18:00:50 +01:00
Dan Poltawski 12f93caf45 Merge branch 'MDL-52018-28-enfix' of git://github.com/mudrd8mz/moodle into MOODLE_28_STABLE 2015-11-03 18:00:49 +01:00
AMOS bot 170bb2e118 Automatically generated installer lang files 2015-11-04 00:04:42 +08:00
Dan Poltawski 56272bb56d MDL-45814 login: don't prompt guest user to change password 2015-11-03 14:49:43 +00:00
Dan Poltawski 992591e0e1 MDL-49473 logs: ensure exported logs contain year 2015-11-03 11:38:37 +00:00
Dan Poltawski efb26ed011 MDL-50781 user: do not print useless table cell
Thanks to Maurício Severo da Silva for the patch
2015-11-03 10:53:22 +00:00
rajesh Taneja 3c5a90d52d MDL-52020 behat: Removed text checking to ensure window switch
Comment question window closes after 2 sec.
which crashes win-FF as it's slow to check for
"Changes saved" text. As after switching it is
checked the changes are saved, this step can be
avoided to ensure robustness of the scenario
2015-11-03 16:58:23 +08:00
rajesh Taneja fc3ef232d1 MDL-52007 behat: Use extended timeout for site admin expansion 2015-11-03 16:09:45 +08:00
David Mudrák b4ccb13855 MDL-52018 lang: Fix behat test to use the new string 2015-11-02 22:52:20 +01:00
Helen Foster 9e0a879c0a MDL-52018 lang: Merge English strings from the en_fix language pack 2015-11-02 22:48:28 +01:00
Eloy Lafuente (stronk7) ca2d074d95 Merge branch 'MDL-52014-28' of git://github.com/danpoltawski/moodle into MOODLE_28_STABLE 2015-11-02 20:02:32 +01:00
Marina Glancy 5a22246905 MDL-51999 user: remove unnecessary continue 2015-11-02 19:59:45 +01:00
Eloy Lafuente (stronk7) 262289493d Merge branch 'MDL-51829-28' of git://github.com/dpalou/moodle into MOODLE_28_STABLE 2015-11-02 19:40:59 +01:00
Dan Poltawski 1dcf6b339a MDL-52014 quiz: do not log preview attempt deletions
This happens automatically by the system.
2015-11-02 16:19:19 +00:00
Marina Glancy 6dce2f64b8 MDL-50633 dml: deprecated var replaced in mysql 5.7
Thanks to Charles Verge for providing a patch
2015-11-02 14:05:04 +00:00
Dan Poltawski 29f19e7e3e Merge branch 'MDL-51128-28' of git://github.com/junpataleta/moodle into MOODLE_28_STABLE 2015-11-02 10:54:54 +00:00
Damyon Wiese b43abbdccc MDL-52004 assign: Set unique urls when grading so autosaves work
The Atto autosave feature uses the $PAGE->url to generate unique hashes for
each page. Assignment uses a MUC cache to persist ordering of lists - the result
is that the urls are not unique (they depend on the cached filter).

The fix is to spoof a unique url that will grade only that student with no
active grading list (no next/prev buttons).
2015-11-02 16:46:41 +08:00
Andrew Nicols 1af0fa4d1c Merge branch 'MDL-51707-m28' of https://github.com/micaherne/moodle into MOODLE_28_STABLE 2015-11-02 14:51:49 +08:00
Jun Pataleta 1a5b8567c8 MDL-47073 lib: Replace backslashes with slashes in jquery plugin urls
This patch replaces backslash characters in the generated jQuery
plugin URL to forward slashes when slasharguments is disabled and
 the Moodle server is running on IIS.
Thanks to Ryan Panning <Ryan.Panning@district196.org> for
reporting this issue and for suggesting a fix.
2015-10-30 17:06:19 -05:00
Dan Poltawski c12979c7df weekly release 2.8.8+ 2015-10-30 21:08:41 +00:00
Andrew Nicols 1d8090a7a6 Merge branch 'wip-MDL-51552-28' of git://github.com/abgreeve/moodle into MOODLE_28_STABLE 2015-10-30 11:03:42 +08:00
Dan Poltawski 318f7454e0 Merge branch 'MDL-51939-28' of git://github.com/andrewnicols/moodle into MOODLE_28_STABLE 2015-10-29 13:55:06 +00:00
Eloy Lafuente (stronk7) 2d0a9d0255 MDL-51939 mod_forum: all participants discussions are viewed by students
Added scenario to verify that "all participants" discussions, under
separate-groups mode are, by default, visible for students.
2015-10-29 21:07:44 +08:00
Dan Poltawski 15dc45e953 Merge branch 'MDL-50811-28' of git://github.com/cameron1729/moodle into MOODLE_28_STABLE 2015-10-29 10:53:44 +00:00
Dan Poltawski eb1e78be45 Merge branch 'MDL-51921-28' of git://github.com/junpataleta/moodle into MOODLE_28_STABLE 2015-10-29 10:35:41 +00:00
Adrian Greeve 9323277c03 MDL-51552 gradebook: Update to bulk update behat test. 2015-10-29 16:16:00 +08:00
Adrian Greeve 017c71cfcf MDL-51552 gradebook: Single view bulk insert fix.
Single view now doesn't overwrite non-empty grades.

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

Also made the visibility checker just continue to buffer the elements
it hides, rather than clearning them, on multiple calls.
2015-10-29 05:41:59 +00:00
Jun Pataleta 4b573f4d42 MDL-51921 files: Fixes for file manager issues
Fixed the issue where the file path select box goes beyond the
container with very long folder names. Instead of setting to
"width: auto", I set it the select box's "width: 100%" so that it will
just fill up its container's width.
Fixed the issue where markups are being shown on file aliases.
2015-10-28 04:51:12 -05:00
Andrew Nicols ba7fcebb79 MDL-51939 mod_forum: Correct empty groupinfo check 2015-10-28 14:04:44 +08:00
Andrew Nicols 53378d63e2 weekly release 2.8.8+ 2015-10-28 12:57:35 +08:00
Eloy Lafuente (stronk7) 2ff58a3b05 MDL-51863 packer: ensure empty zip files behavior remains consistent
With PHP bug #70322 fixed, ZipArchive::close() did start returning false
and throwing PHP Warnings with recent PHP versions (5.6.14 and up).
Previously (5.6.13 verified) it was returning true, and false in older
versions (5.4.x verified).

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

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

Note that we don't use to rely much on results coming from close(), and
that's a good thing given the buggy behavior commented above. This just
keeps empty zips working like they were before.
2015-10-27 11:57:00 +00:00
Corey Wallis 7fa0d47cda MDL-50811 mod_forum: Add completion tracking for emailed replies 2015-10-27 15:55:29 +08:00
Andrew Nicols 6f3a4fb5c3 Merge branch 'MDL-51864-28' of git://github.com/junpataleta/moodle into MOODLE_28_STABLE 2015-10-27 10:58:47 +08:00
Barry Oosthuizen 9486c3fe5c MDL-51913 report_stats: Make first column unique 2015-10-26 17:27:52 +00:00
Kevin Wiliarty 5daffb32f3 MDL-51834 auth,profile: locks custom fields based on auth settings 2015-10-26 14:24:06 +00:00
Dan Poltawski 3561600a37 Merge branch 'MDL-51894-28' of git://github.com/andrewnicols/moodle into MOODLE_28_STABLE 2015-10-26 12:40:31 +00:00
Andrew Nicols d784ad13e8 MDL-51894 inboundmessage: Ensure that all mailboxes exist 2015-10-26 12:31:20 +08:00
Andrew Nicols a6cb45542d Merge branch 'MDL-51779_28' of https://github.com/Syxton/moodle into MOODLE_28_STABLE 2015-10-26 09:54:20 +08:00
Jun Pataleta c4350c40f5 MDL-51864 blocks: Fixed title display for block_course_summary 2015-10-24 00:04:42 -05:00
Matt Davidson cbb94a638e MDL-51779 assign: PDF annotate quality
Fixes the quality of pdf content when annotating.
2015-10-23 09:31:20 -04:00
Dan Poltawski 7eb88da0af weekly release 2.8.8+ 2015-10-23 12:51:47 +01:00
Andrew Nicols 5631e50ced Merge branch 'MDL-51822_28' of git://github.com/dmonllao/moodle into MOODLE_28_STABLE 2015-10-22 13:22:24 +08:00
Dan Poltawski 23eb923bcc weekly release 2.8.8+ 2015-10-20 09:56:35 +01:00
Dani Palou 80bea94ffe MDL-51829 admin: Set userquota setting as PARAM_INT 2015-10-20 10:02:52 +02:00
Mark Nelson 1430b4dc8f MDL-51782 mod_forum: fixed unit test failing on certain DBs 2015-10-20 14:46:09 +08:00
Andrew Nicols 388efc9233 Merge branch 'MDL-51782_m28' of git://github.com/markn86/moodle into MOODLE_28_STABLE 2015-10-20 11:53:00 +08:00
Mark Nelson 9383deb075 MDL-51782 mod_forum: altered unit tests for the post_deleted event
This was done to ensure we are actually testing the API, and not
just creating and triggering the event manually.
2015-10-19 20:14:05 -07:00
Mark Nelson 102ffb8e18 MDL-51782 mod_forum: moved post_deleted event into function 2015-10-19 20:14:04 -07:00
Jun Pataleta 37ccc13b0f MDL-51837 user: Check if user email is set on validation
Add a check if the user's email is set before performing validation on
the user's email address. This is to prevent the warning messages to
be shown in the case of a pending email change which causes the user's
email field to be not included in the Edit profile form.
2015-10-19 16:52:57 -05:00
Eloy Lafuente (stronk7) 6cf4677e78 Merge branch 'wip-mdl-48117-m28' of https://github.com/rajeshtaneja/moodle into MOODLE_28_STABLE 2015-10-19 16:58:59 +02:00
Dan Poltawski e5ec55cbdd Merge branch 'm28_MDL-51554_Apache_PHP-FPM_Broken_File_Serving' of https://github.com/scara/moodle into MOODLE_28_STABLE 2015-10-19 15:19:38 +01:00
David Monllao 4ae6340719 Merge branch 'MDL-50483-28' of git://github.com/lameze/moodle into MOODLE_28_STABLE 2015-10-19 17:06:59 +08:00
Eloy Lafuente (stronk7) 140bd7b3ca MDL-48117 behat: Use form field to check checkbox
On Mac-Chrome click checkbox is not generating
proper events and hence failing. Use behat_form_checkbox
to ensure checkbox is checked
2015-10-19 16:59:57 +08:00
David Monllao 1b851d1b1f Merge branch 'MDL-51771_28' of git://github.com/timhunt/moodle into MOODLE_28_STABLE 2015-10-19 16:28:17 +08:00
David Monllao 99482eb0bc MDL-51822 timezones: Update to IANA 2015g 2015-10-19 15:00:25 +08:00
Andrew Nicols 2ed5192a84 Merge branch 'MDL-51673-28' of git://github.com/junpataleta/moodle into MOODLE_28_STABLE 2015-10-19 13:50:31 +08:00
Andrew Nicols e1f8a35f27 Merge branch 'MDL-51772-28' of git://github.com/jleyva/moodle into MOODLE_28_STABLE 2015-10-19 13:35:34 +08:00
David Monllao 03f0dec4a4 Merge branch 'MDL-51759-28-2' of git://github.com/andrewnicols/moodle into MOODLE_28_STABLE 2015-10-19 13:31:17 +08:00
Simey Lameze 2ecb8fdea7 MDL-50483 gradereport_user: fix the fatal error of no enrolled users 2015-10-19 09:16:29 +08:00
Jinu Abraham 200522e7c6 MDL-50483 gradereport_user: fix the fatal error of no enrolled users 2015-10-19 09:15:50 +08:00
Andrew Nicols 131679eddc Merge branch 'MDL-50412-28' of git://github.com/danpoltawski/moodle into MOODLE_28_STABLE 2015-10-19 08:05:21 +08:00
Tim Hunt fb33a080dc MDL-51771 question engine: fix typo in SQL
Thanks to Pete at learningpool.com for finding thsi bug.
2015-10-18 16:05:41 +01:00
Jun Pataleta 61ba945d8d MDL-51673 messages: Added codes for the unit tests 2015-10-16 16:07:11 -05:00
Ben Kelada 0429a76370 MDL-51673 messages: remove strict type check of int vs string 2015-10-16 16:07:10 -05:00
Matteo Scaramuccia 0f0f997e61 MDL-51554 Files: Fix broken file serving under Apache + PHP-FPM 2015-10-16 22:06:51 +02:00
Eloy Lafuente (stronk7) e82ed9333b weekly release 2.8.8+ 2015-10-16 12:51:20 +02:00
Andrew Nicols 52b58e7cea Merge branch 'MDL-51565-28' of git://github.com/jleyva/moodle into MOODLE_28_STABLE 2015-10-16 09:37:15 +08:00
Andrew Nicols dff755c3e2 Merge branch 'MDL-51651-28' of git://github.com/danpoltawski/moodle into MOODLE_28_STABLE 2015-10-16 09:27:16 +08:00
Andrew Nicols 70f315edbc Merge branch 'MDL-50182_28' of git://github.com/stronk7/moodle into MOODLE_28_STABLE 2015-10-16 08:14:46 +08:00
Andrew Nicols d1bffa672f MDL-51759 theme: Ensure that non-svg images are cached and returned 2015-10-16 07:53:59 +08:00
Dan Poltawski 764057b0c3 Merge branch 'MDL-51703-28' of git://github.com/jleyva/moodle into MOODLE_28_STABLE 2015-10-15 13:58:20 +01:00
Dan Poltawski 2aea111faa Merge branch 'MDL-51500-28' of git://github.com/merrill-oakland/moodle into MOODLE_28_STABLE 2015-10-15 13:52:48 +01:00
Dan Poltawski db4c084a63 Merge branch 'MDL-51563-28' of git://github.com/jleyva/moodle into MOODLE_28_STABLE 2015-10-15 13:50:13 +01:00
Dan Poltawski ec7af5aa0e Merge branch 'MDL-51652-m28' of https://github.com/sammarshallou/moodle into MOODLE_28_STABLE 2015-10-15 13:46:14 +01:00
Dan Poltawski 60e3abff94 Merge branch 'MOODLE_28_STABLE-MDL-51679-groupmode-ajax' of https://github.com/Dagefoerde/moodle into MOODLE_28_STABLE 2015-10-15 11:44:50 +01:00
Dan Poltawski 5e90e70643 MDL-51651 lang: add consitency for application of firstdayofweek
1) Set the site-wide default based on language pack
2) Use the site/user preference for js popups, like we do in /calendar/
2015-10-15 10:17:20 +01:00
Dan Poltawski 62897237f7 MDL-51651 lang: the first day of the week is Monday 2015-10-15 10:17:19 +01:00
Dan Poltawski d55e3b1fc5 Merge branch 'wip-mdl-50940-m28' of https://github.com/rajeshtaneja/moodle into MOODLE_28_STABLE 2015-10-15 08:57:52 +01:00
Andrew Nicols a6e1c0afa7 Merge branch 'MDL-51756-28' of git://github.com/damyon/moodle into MOODLE_28_STABLE 2015-10-15 15:25:24 +08:00
Andrew Nicols 9a9bfb41e2 MDL-51756 tests: Refactor test to use data-provider
The benefit is that this becomes one test per external function instead of one
test testing them all - so more information is shown on failure and we get lots
more dots (we love dots!).
2015-10-15 15:19:05 +08:00
Damyon Wiese 19ab1865e3 MDL-51756 externallib: Show debugging when optional params are wrong
Optional params are not allowed as the top level value for external_function_parameters.
This is because stricter protocols (xmlrpc and soap) cannot handle optional parameters, only
optional properties in a structure.
2015-10-15 14:20:25 +08:00
Ryan Wyllie d058095357 MDL-49545 backup: Restore does not respect some capabilities
Thanks to Daniel Neis for the original patch that formed the
basis of these changes.
2015-10-15 11:55:47 +08:00
Dan Poltawski f7393e447c Merge branch 'MDL-51399_28' of https://github.com/andrewhancox/moodle into MOODLE_28_STABLE 2015-10-14 15:02:47 +01:00
Dan Poltawski ae4e4e11ff Merge branch 'MDL-51467-m28' of https://github.com/sammarshallou/moodle into MOODLE_28_STABLE 2015-10-14 13:41:03 +01:00
Jan C. Dageförde 0da8db7426 MDL-51679 course: Update groupmode CSS class
Changing groupmode of an activity via AJAX did not change the button's CSS class accordingly.
2015-10-14 14:35:47 +02:00
Juan Leyva 2b6e9e40dc MDL-51772 webservice: Export add_user_private_files as Web Service 2015-10-14 14:09:14 +02:00
Dan Poltawski 5f21490c11 weekly release 2.8.8+ 2015-10-14 10:49:05 +01:00
Dan Poltawski 2148eb566c NOBUG: Fixed SVG browser compatibility 2015-10-14 10:49:04 +01:00
Dan Poltawski 2b18ca5e3f Merge branch 'MDL-40710-28' of git://github.com/barbararamiro/moodle into MOODLE_28_STABLE 2015-10-13 15:35:28 +01:00
Dan Poltawski 45d6ea0832 Merge branch 'MDL-51435-m28' of https://github.com/NeillM/moodle into MOODLE_28_STABLE 2015-10-13 11:43:52 +01:00
Dan Poltawski a8f9db70c6 MDL-47494 grade: even more complete copyright fix.
With thanks to Tim!
2015-10-13 09:55:18 +01:00
Dan Poltawski a7f765a7a9 MDL-47494 grade: fix incorrect copyright statement
(From copy/paste error, blame Tim :P)
2015-10-13 09:39:17 +01:00
Damyon Wiese 206e677358 MDL-48861 assign: Make the requires grading filter consistent
Consistently include submissions with a null grade (see MDL-47694).
2015-10-13 14:54:47 +08:00
Damyon Wiese 2d4cf584ca MDL-48861 assign: Fix unit tests and behat tests
The tests were not working with the change to the needs grading filter.
2015-10-13 13:06:48 +08:00
Andrew Nicols f58afe07e0 Merge branch 'MDL-51302-28' of git://github.com/danpoltawski/moodle into MOODLE_28_STABLE 2015-10-13 11:35:38 +08:00
Jun Pataleta c07f0799ed MDL-51128 course: Add startdate for generated course
Added course start date for the course generated by the course
generator in order to prevent incorrect date calculations
(i.e. in assignment due dates) when the generated course is reset.
2015-10-12 22:12:13 -05:00
Andrew Nicols 7914b0a2cf Merge branch 'MDL-51427-28' of git://github.com/marinaglancy/moodle into MOODLE_28_STABLE 2015-10-13 10:15:35 +08:00
Andrew Nicols 1cf1b279da Merge branch 'MDL-40442-28' of git://github.com/danpoltawski/moodle into MOODLE_28_STABLE 2015-10-13 09:49:14 +08:00
Andrew Nicols 182a393e06 Merge branch 'MDL-50079-28' of git://github.com/danpoltawski/moodle into MOODLE_28_STABLE 2015-10-13 09:33:38 +08:00
Andrew Nicols ee8072e2a1 Merge branch 'MDL-50788-28' of git://github.com/danpoltawski/moodle into MOODLE_28_STABLE 2015-10-13 08:54:42 +08:00
Eloy Lafuente (stronk7) bf0e51d1a1 MDL-50182 core: add 3.0 environmental requirements
Only change from 2.9 is the modification of the slasharguments
admin setting string to recommend always to keep the setting enabled
and fix the problem in the server, warning about the drawbacks
of disabling it.

Also, there is a little phpdoc note added to one custom check
to have clearly specified when we can get rid of it.
2015-10-13 00:35:55 +02:00
sam marshall 378f34a469 MDL-51467 Availability: Course reset should change restrict dates 2015-10-12 17:36:00 +01:00
Dan Poltawski 2c9c7b1130 Merge branch 'MDL-51375_28' of git://github.com/timhunt/moodle into MOODLE_28_STABLE 2015-10-12 17:01:44 +01:00
Dan Poltawski a78d3fa10b Merge branch 'MDL-48861-28' of git://github.com/damyon/moodle into MOODLE_28_STABLE 2015-10-12 16:53:21 +01:00
Juan Leyva 43654c4872 MDL-51563 core_user: Fix invalid passed parameteres in get_user 2015-10-12 13:54:27 +02:00
Dan Poltawski 989298d309 Merge branch 'MDL-36606-28' of git://github.com/merrill-oakland/moodle into MOODLE_28_STABLE 2015-10-12 12:41:30 +01:00
Juan Leyva 8eb8681b5e MDL-51565 webservice: Fix return types definitions 2015-10-12 13:30:17 +02:00
Dan Poltawski 025b4cb5e9 Merge branch 'MDL-51586-28' of git://github.com/xow/moodle into MOODLE_28_STABLE 2015-10-12 10:47:17 +01:00
sam marshall 0273933079 MDL-51652 Availability: OR conditions fail when filtering user lists
When filtering a user list, if there is an OR tree where one of the
conditions does not restrict user lists such as a date condition,
then the overall result should include all users (not be filtered).
This was not working correctly.
2015-10-12 10:26:48 +01:00
David Monllao 28e4326cf1 Merge branch 'MDL-51083-28' of git://github.com/xow/moodle into MOODLE_28_STABLE 2015-10-12 16:58:13 +08:00
Andrew Nicols fb48641b5f MDL-46497 atto: Whitespace/coding style fix 2015-10-12 13:44:18 +08:00
Andrew Nicols 907093e131 Merge branch 'MDL-46497_M28' of https://github.com/nadavkav/moodle into MOODLE_28_STABLE 2015-10-12 13:43:33 +08:00
Andrew Nicols ce4c237787 Merge branch 'MDL-51451-m28' of https://github.com/sammarshallou/moodle into MOODLE_28_STABLE 2015-10-12 10:15:31 +08:00
Lior Gil 284ef7be8f MDL-46497 Atto: Fix adding redundant p elements in rtl/ltr actions 2015-10-10 01:34:07 +03:00
Juan Leyva cc595febe4 MDL-51703 mod_survey: Trigger response_submitted event in correct place 2015-10-09 16:27:20 +02:00
Dan Poltawski 6ff47714ac MDL-50412 admin: prevent fatal errors on reports admin page 2015-10-09 14:47:39 +01:00
Barbara Ramiro c3ece30f18 MDL-40710 Icon: More identifiable backpack icon 2015-10-09 18:40:19 +08:00
Dan Poltawski 1670fc84a7 MDL-50079 atto_link: respect new window option when creating from repo
Previously users had to go back and edit their link to set the new
window option.
2015-10-09 11:29:27 +01:00
Dani Palou b961b1c142 MDL-51685 user: Support gravatar images in user_get_user_details 2015-10-09 11:51:19 +02:00
Dan Poltawski d6e6b308c5 MDL-50788 classloader: Prevent cryptic errors on unreadable classes dir
Do not attempt to read an unreadable directory because previously the generated
errors were hard to fathom.

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

This change creates the plugin object before the version file sets its parameters.
2015-10-09 09:06:53 +01:00
John Okely 9b132c5b23 MDL-51586 enrol: Enrolment table displays fullname properly.
When the alternatefullnamedisplay was set to something that
didn't contain 'firstname' then nothing would be displayed
for the user's name.
2015-10-09 15:35:23 +08:00
Damyon Wiese 16ef0ac033 MDL-48861 mod_assign: use >= for requires grading filter
If the grade and submission were modified at exactly the same time,
assume that this means the grade was automatically created for the submission
and is not a real grade from a teacher interaction.
2015-10-09 15:10:46 +08:00
Damyon Wiese cce2034d5e MDL-51628 assign: invalid hardcoded capability check
Use existing function to do the check instead.
2015-10-09 15:01:08 +08:00
Mifsud Gaël f1afb82337 MDL-51083 admin: Prevent password autofill in authentication settings 2015-10-09 14:34:02 +08:00
Damyon Wiese 8ffc94ff69 MDL-51686 assign: Apply admin default for comment inline 2015-10-09 13:42:29 +08:00
Michael Aherne 545163440b MDL-51707 cron: Prevent finished tasks being returned 2015-10-08 16:44:08 +01:00
Eric Merrill 5c66e986ee MDL-36606 gradereport: Update AJAX grader to understand gradeless cells 2015-10-08 10:51:04 -04:00
Barbara Ramiro e4f2fb2665 MDL-40442 Icon: Improved svg download icon and png version 2015-10-08 13:31:46 +01:00
Dan Poltawski 6d8dbfee53 weekly release 2.8.8+ 2015-10-08 11:36:41 +01:00
Adam Olley 41c8edf46d MDL-51285 mod_forum: Posts all need to have different stamps 2015-10-08 12:23:31 +08:00
Eric Merrill 287e6a9772 MDL-51500 navigation: Compute links with destination context
We should calculate the links based on the destination context,
not the current course. Could show links that are not accessible.
2015-10-07 10:03:13 -04:00
sam marshall 735ef8ba92 MDL-51451 Moodle dialogues: Lock scroll causes background jump
When you add a module or otherwise cause a Moodle dialogue to appear, this
enables the 'lock scroll' feature (the scrollbar disappears).

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

This change temporarily sets body max-width while lock scroll is active.
2015-10-07 10:32:59 +01:00
David Monllao a112d4ebfb Merge branch 'wip-mdl-51285-m28' of git://github.com/rajeshtaneja/moodle into MOODLE_28_STABLE 2015-10-07 11:23:32 +08:00
Andrew Nicols 797ac16e88 Merge branch 'MDL-41042-28' of git://github.com/marinaglancy/moodle into MOODLE_28_STABLE 2015-10-07 10:27:47 +08:00
David Monllao 1ce643eaad Merge branch 'MDL-51525-28' of git://github.com/ryanwyllie/moodle into MOODLE_28_STABLE 2015-10-07 09:23:24 +08:00
Dan Poltawski 936d11f137 Merge branch 'MDL-51588-28' of git://github.com/FMCorz/moodle into MOODLE_28_STABLE 2015-10-06 11:42:58 +01:00
David Monllao c4dc0748a4 Merge branch 'MDL-51656_m28' of git://github.com/markn86/moodle into MOODLE_28_STABLE 2015-10-06 15:25:15 +08:00
Andrew Nicols cee7167b07 Merge branch 'MDL-51228-m28-master' of https://github.com/dthies/moodle into MOODLE_28_STABLE 2015-10-06 13:49:36 +08:00
Tim Hunt e8da65449a MDL-51375 excel output: more work to avoid invalid sheet names 2015-10-06 05:45:16 +01:00
Andrew Nicols 77712faa11 Merge branch 'MDL-44707-28' of git://github.com/marinaglancy/moodle into MOODLE_28_STABLE 2015-10-06 11:36:30 +08:00
Andrew Nicols 71175baff9 Merge branch 'MDL-50805_MOODLE_28_STABLE' of https://github.com/crazyserver/moodle into MOODLE_28_STABLE 2015-10-06 10:36:32 +08:00
David Monllao 6641b6fb8a Merge branch 'MOODLE_28_STABLE-MDL-49750' of git://github.com/jojoob/moodle into MOODLE_28_STABLE 2015-10-06 09:30:04 +08:00
Dan Poltawski 4fbad85763 Merge branch 'wip-MDL-49189-MOODLE_28_STABLE' of https://github.com/kwiliarty/moodle into MOODLE_28_STABLE 2015-10-05 15:03:18 +01:00
Johannes Burk e33152d912 MDL-49750 mod_data: fix updating file/picture fields breaks references
Use file_save_draft_area_files on file/picture update and
set content to null if file was removed.
2015-10-05 11:45:18 +02:00
David Monllao 758b2d9b29 Merge branch 'MDL-51514_m28' of git://github.com/markn86/moodle into MOODLE_28_STABLE 2015-10-05 16:00:12 +08:00
rajesh Taneja b5b3a37049 MDL-50940 behat: Added support for field matching with xpath 2015-10-05 14:04:02 +08:00
David Monllao 06cb6e421b Merge branch 'MDL-51408-28' of git://github.com/marinaglancy/moodle into MOODLE_28_STABLE 2015-10-05 13:50:34 +08:00
Andrew Hancox 08544e3bdb MDL-50940 behat: Added ability to check field value by xpath 2015-10-05 13:47:04 +08:00
David Monllao 192509762b MDL-50613 webservices: Upgrade info about riskbitmask 2015-10-05 12:19:07 +08:00
David Monllao f2ac95dfdf Merge branch 'MDL-50613-28' of git://github.com/jleyva/moodle into MOODLE_28_STABLE 2015-10-05 12:13:14 +08:00
Sam Chaffee f0d7264769 MDL-51514 gradebook: Optimize set_usedinaggregation query for MySQL 2015-10-04 13:20:47 -07:00
Kevin Wiliarty 36d44b206a MDL-49189 auth: Map data to profile fields with uppercase shortnames 2015-10-03 08:25:06 -04:00
Mark Nelson 2bec647d91 MDL-51656 auth_radius: fixed colon location 2015-10-02 16:35:41 -07:00
Dan Poltawski dc3850fc20 weekly release 2.8.8+ 2015-10-02 10:57:33 +01:00
Dan Poltawski 35f4f19770 Merge branch 'install_28_STABLE' of https://git.in.moodle.com/amosbot/moodle-install into MOODLE_28_STABLE 2015-10-02 10:57:31 +01:00
Pau Ferrer Ocaña 3262330d95 MDL-50805 Messages: Add index to message_read to speed up message crons 2015-10-01 10:37:16 +02:00
David Monllao 00f1a102ca MDL-46710 mod_lti: Removing duplicated generated events
Event generation and completion should be generated only once.
2015-10-01 12:07:07 +08:00
Eloy Lafuente (stronk7) 474b1e0040 Merge branch 'MDL-51227-m28-master' of https://github.com/dthies/moodle into MOODLE_28_STABLE 2015-10-01 00:35:25 +02:00
Andrew Robert Nicols 68dcf2dded MDL-36606 gradereport: Correctly handle ungraded assessment ajax grading 2015-09-30 15:04:12 -04:00
Eloy Lafuente (stronk7) 9194f5911b Merge branch 'wip-mdl-51266-m28' of https://github.com/rajeshtaneja/moodle into MOODLE_28_STABLE 2015-09-30 20:34:59 +02:00
Andrew Hancox 4143c33d27 MDL-51399 report_outline: Hide blog column if blogs are disabled. 2015-09-30 17:04:59 +01:00
Juan Leyva ccefec7360 MDL-50613 webservice: Remove risk bit masks for Web Service protocols
This will prevent to show a 'Critical' status in security overview
report when mobile services are enabled
2015-09-30 11:18:01 +02:00
Tim Lock b68783c870 MDL-51440 gradeimport_direct: fix config require statement 2015-09-30 10:53:51 +08:00
Eloy Lafuente (stronk7) 9c46e281cb Merge branch 'MDL-49143-28' of git://github.com/cameron1729/moodle into MOODLE_28_STABLE
Note: Added small fix to unit test.
2015-09-30 03:21:07 +02:00
Dan Poltawski 773582db11 Merge branch 'MDL-51402_28' of git://github.com/timhunt/moodle into MOODLE_28_STABLE 2015-09-29 20:54:44 +01:00
Dan Poltawski 964c02c3fe Merge branch 'MDL-51424-m28-master' of https://github.com/dthies/moodle into MOODLE_28_STABLE 2015-09-29 20:33:30 +01:00
Dan Poltawski 868fb3adf9 Merge branch 'MDL-42639_28' of git://github.com/dmonllao/moodle into MOODLE_28_STABLE 2015-09-29 10:20:15 +01:00
David Monllao 0b54d6d971 MDL-42639 user: user:viewalldetails enough to view some fields
The fields are:
- username
- idnumber
- institution
- department
2015-09-29 16:56:26 +08:00
Ryan Wyllie a6bd6b3cad MDL-51525 libraries: added graphlib to thirdpartylibs.xml 2015-09-29 07:32:57 +00:00
Frederic Massart 46067fbd30 MDL-51588 webservice: Allow CORS in webservice/pluginfile.php 2015-09-29 14:41:28 +08:00
Andrew Nicols acd86d0cf2 Merge branch 'MDL-43594-28' of git://github.com/junpataleta/moodle into MOODLE_28_STABLE 2015-09-29 14:01:33 +08:00
Jun Pataleta 365644eecf MDL-43594 mod_assign: Fix calendar update on course reset
This patch fixes the updating of calendar events when the course
is reset and its start date is changed.
2015-09-29 13:47:06 +08:00
Andrew Nicols 51d6415ef3 Merge branch 'MDL-35918-28' of git://github.com/ryanwyllie/moodle into MOODLE_28_STABLE 2015-09-29 13:43:32 +08:00
Eloy Lafuente (stronk7) c022a86c38 MDL-49143 LTI: Test resource_link_id in lti_build_request() 2015-09-29 13:42:43 +08:00
Cameron Ball fa3652ef9c MDL-49143 LTI: Fix missing resource id 2015-09-29 13:42:43 +08:00
Ryan Wyllie 08db4b5843 MDL-35918 javascript: dialogues screen reader support
The YUI notification dialogues will now set the appropriate
aria attributes when they are shown/hidden to allow screen
readers to navigate them correctly.

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

When the dialogue is closed the modified elements will be reverted
to their previous state and the dialogue will be marked as hidden to
a screen reader.
2015-09-29 04:53:23 +00:00
Andrew Nicols 3497350e2f Merge branch 'wip-MDL-51241-28' of git://github.com/abgreeve/moodle into MOODLE_28_STABLE 2015-09-29 12:47:20 +08:00
Andrew Nicols 396f954b05 Merge branch 'MDL-51476_28' of git://github.com/timhunt/moodle into MOODLE_28_STABLE 2015-09-29 12:07:25 +08:00
Dan Poltawski 997e7a966b Merge branch 'MDL-51305_28_too_many_gradeitem_fetches' of https://github.com/colin-umn/moodle into MOODLE_28_STABLE 2015-09-28 16:25:57 +01:00
Dan Poltawski 94249aa198 Merge branch 'mdl46710-moodle28' of https://github.com/tlock/moodle into MOODLE_28_STABLE 2015-09-28 14:56:58 +01:00
Dan Poltawski 1916b2863c Merge branch 'MDL-51390_28' of https://github.com/totara/openbadges into MOODLE_28_STABLE 2015-09-28 13:27:17 +01:00
Mark Nielsen 0c2ddb687a MDL-51498 core_grades: Prevent unnecessary grade record fetching
All of these changes make use of already
fetched grade data.  Without these changes,
the gradebook regrade process does not scale
well with very large courses because it fetches
many grade records, one at a time.
2015-09-28 11:12:59 +01:00
Dan Poltawski 8ae33bc947 Merge branch 'MDL-49482-28' of https://github.com/blckct/moodle into MOODLE_28_STABLE 2015-09-28 10:31:50 +01:00
Yuliya Bozhko 8589530727 MDL-51390 badges: Switch backpack URL to use HTTPS
Signed-off-by: Yuliya Bozhko <yuliya.bozhko@totaralms.com>
2015-09-28 10:08:00 +01:00
AMOS bot b9e92d05e1 Automatically generated installer lang files 2015-09-28 00:04:12 +08:00
Daniel Thies 45e591a85a MDL-51424 editor_atto: Save selection and editor contents after change
Conflicts:
	lib/editor/atto/yui/build/moodle-editor_atto-editor/moodle-editor_atto-editor-min.js
2015-09-25 09:50:06 -05:00
Daniel Thies a59f24b904 MDL-51227 editor_atto: Stop Chrome losing selection when formating
Conflicts:
	lib/editor/atto/yui/build/moodle-editor_atto-editor/moodle-editor_atto-editor-min.js
2015-09-25 09:38:48 -05:00
Tim Hunt 58d7de73ac MDL-51476 questions: manual grading validation for ungraded Qs
The change in MDL-51090 broke manually commenting on questions for which
no mark is given (max mark == 0). This fixes it, with unit tests.

Thanks to Nick Phillips for the original suggestion of the fix.
2015-09-25 14:02:32 +01:00
Tim Lock e87c74e9f5 MDL-46710 mod_lti: fix logging and completion tracking in new windows 2015-09-25 06:28:28 +09:30
Eloy Lafuente (stronk7) d8edd556ab MDL-49482 sqlsrv: Implement support of Offset/Fetch in SQL Server 2012+ 2015-09-24 20:13:17 +02:00
Jakub Kania 68629452fa MDL-49482 mssql: Implement support of Offset/Fetch in SQL Server 2012+. 2015-09-24 20:13:17 +02:00
Eloy Lafuente (stronk7) 3377cbc3ba weekly release 2.8.8+ 2015-09-24 16:07:14 +02:00
rajesh Taneja 07f3c02ec7 MDL-49973 behat: Fixed string change from Continue to Delete 2015-09-24 10:35:37 +08:00
Eloy Lafuente (stronk7) 837c4dab86 Merge branch 'wip-MDL-51259-28' of git://github.com/abgreeve/moodle into MOODLE_28_STABLE 2015-09-23 16:29:06 +02:00
rajesh Taneja 551dce86ba MDL-51266 unittest: replaced low level phpunit_util calls 2015-09-23 15:44:57 +08:00
David Monllao f7666835c7 MDL-50332 enrol_self: Setting form url for guests
Credit to Andrew Nicols.
2015-09-23 11:53:12 +08:00
Adrian Greeve f9dfe738aa MDL-51241 cohorts: Update to cohort query.
This improves the speed of returning a list of
cohorts. Thanks to François Gannaz for providing
this patch.
2015-09-23 11:38:46 +08:00
Dan Poltawski 3bf8439e3a Merge branch 'MDL-49973-28' of git://github.com/cameron1729/moodle into MOODLE_28_STABLE 2015-09-22 09:44:46 +01:00
Dan Poltawski c6a6ce7914 Merge branch 'MDL-46157-28' of git://github.com/cameron1729/moodle into MOODLE_28_STABLE 2015-09-22 08:15:02 +01:00
Andrew Nicols 599eeea2a5 Merge branch 'MDL-51190-28' of https://github.com/pauln/moodle into MOODLE_28_STABLE 2015-09-22 08:32:18 +08:00
Ferenc Lengyel bfd6727b42 MDL-51402 quiz: notification emails should respect grouping
In the case where teachers do not have the accessallgroups capability,
we only send "an attempt has been sumbitted "notification to teachers
in the same group as the student who submitted.

At the moment this considers all groups in the course. If this
particular quiz has a grouping set, then the logic should only consider
the groups in that grouping.
2015-09-21 13:31:15 +01:00
Dan Poltawski 606cf274a7 Merge branch 'MDL-51052_28' of https://github.com/dmonllao/moodle into MOODLE_28_STABLE 2015-09-21 10:53:30 +01:00
Dan Poltawski 0dbd2594e8 Merge branch 'MDL-48165-28-dimgrades' of git://github.com/mudrd8mz/moodle into MOODLE_28_STABLE 2015-09-21 10:14:50 +01:00
Andrew Nicols 0c73e5335c Merge branch 'MDL-50332_28' of git://github.com/dmonllao/moodle into MOODLE_28_STABLE 2015-09-21 15:47:07 +08:00
David Monllao 18fd195086 MDL-50332 enrol_self: Formatting unavailable instances error messages
Many thanks to Andrew Nicols as this patch is based on his
proposal. Thanks Andrew.
2015-09-21 15:44:29 +08:00
Andrew Nicols 05c252e9b0 Merge branch 'MDL-51431_2_8' of https://github.com/andrewhancox/moodle into MOODLE_28_STABLE 2015-09-21 08:13:10 +08:00
David Monllao a23c44cddf MDL-51052 dml: More info about mysql and case & accent sensitiveness 2015-09-18 11:49:26 +08:00
Charles Fulton f8e0b4ece1 MDL-51052 dml: support for sql_like() under utf8_bin 2015-09-18 11:49:25 +08:00
Adrian Greeve 76ebf76be1 MDL-51259 mod_data: ratings of items not activated.
When selecting a rating method, the restrict rating
to items with dates would be automatically enabled if
not checked. This code brings the data module inline
with forum and glossary.
2015-09-18 07:28:56 +08:00
Eloy Lafuente (stronk7) a91caeefc7 weekly release 2.8.8+ 2015-09-17 18:01:22 +02:00
Simey Lameze e1efcbd1db MDL-50959 gradebook: fix XML grade export 2015-09-17 10:37:09 +08:00
Andrew Hancox 210349f647 MDL-51431 enrol_flatfile: Fix for startdate when updating users 2015-09-16 10:56:55 +01:00
Marina Glancy 193f5d4029 MDL-46705 admin: Validate unique shortname for frontpage course 2015-09-16 14:48:03 +08:00
Marina Glancy 489db61206 MDL-51427 user: correctly use strings for phone1 and phone2
Thanks to Olumuyiwa Taiwo for original patch
2015-09-16 13:36:54 +08:00
David Monllao 685aa0b7c9 Merge branch 'MDL-49561_m28' of git://github.com/markn86/moodle into MOODLE_28_STABLE
Conflicts:
	lib/bennu/readme_moodle.txt
2015-09-16 09:59:04 +08:00
David Monllao 57caaace44 Merge branch 'MDL-46705-28' of git://github.com/dkns/moodle into MOODLE_28_STABLE 2015-09-16 09:46:13 +08:00
Eloy Lafuente (stronk7) 42ba6f011e Merge branch 'MDL-50685_28' of git://github.com/dmonllao/moodle into MOODLE_28_STABLE 2015-09-16 02:16:38 +02:00
Eloy Lafuente (stronk7) 8ada99201a Merge branch 'MDL-49032_28' of https://github.com/stronk7/moodle into MOODLE_28_STABLE 2015-09-16 00:58:56 +02:00
Eloy Lafuente (stronk7) 2fab7166b5 MDL-49032 lib/bennu: update readme to document the change 2015-09-16 00:54:15 +02:00
Joby Harding f27c022e5c MDL-49032 lib/bennu: use HTAB only when folding lines 2015-09-16 00:45:38 +02:00
Eloy Lafuente (stronk7) 16eedce0c6 Merge branch 'MDL-50959-28' of git://github.com/lameze/moodle into MOODLE_28_STABLE 2015-09-15 23:36:31 +02:00
Eloy Lafuente (stronk7) 5d4bccd775 Merge branch 'MDL-50892-28' of git://github.com/marinaglancy/moodle into MOODLE_28_STABLE 2015-09-15 23:35:23 +02:00
David Monllao 2648522e3d Merge branch 'MDL-50884-28' of git://github.com/lameze/moodle into MOODLE_28_STABLE 2015-09-15 17:16:30 +08:00
Cameron Ball e13126f85a MDL-49973 behat: Update delete button names
Conflicts:
	course/format/topics/tests/behat/edit_delete_sections.feature
	course/format/weeks/tests/behat/edit_delete_sections.feature
2015-09-15 15:39:32 +08:00
Andrew Davis 1237ba1962 MDL-49973 changed continue to delete on delete confirmations
Conflicts:
	course/editsection.php
2015-09-15 15:38:08 +08:00
David Monllao 3e08b5c04e Merge branch 'MDL-50921-28' of git://github.com/ryanwyllie/moodle into MOODLE_28_STABLE 2015-09-15 14:27:32 +08:00
David Monllao 978ef29e47 MDL-51048 backup: Removing unnecessary var 2015-09-15 13:44:36 +08:00
David Monllao 5c03acf518 Merge branch 'MDL-51048_28' of git://github.com/timhunt/moodle into MOODLE_28_STABLE 2015-09-15 13:44:32 +08:00
Andrew Nicols 8d5092cd84 Merge branch 'MDL-51290-28' of git://github.com/cameron1729/moodle into MOODLE_28_STABLE 2015-09-15 13:06:54 +08:00
Paul Nicholls add6322e5a MDL-51190 javascript: Make "maximised embed" compatible with MS Edge
MS Edge exhibits strange behaviour when M.util.init_maximised_embed hides
the embedded document by setting its width and height to 0px.  Toggling
display:none instead achieves the intended goal without breaking Edge.
2015-09-15 16:28:42 +12:00
David Monllao c87b932f1c Merge branch 'MDL-51008-28' of git://github.com/marinaglancy/moodle into MOODLE_28_STABLE 2015-09-15 11:22:16 +08:00
Marina Glancy 78eb3ee407 MDL-51408 badges: fix criteria for custom profile fields 2015-09-15 11:17:42 +08:00
David Monllao 38e0d68f0a Merge branch 'MDL-51147_28' of git://github.com/timhunt/moodle into MOODLE_28_STABLE 2015-09-15 10:09:52 +08:00
David Monllao 6c974ef376 MDL-51363 mod_scorm: Removing whitespaces 2015-09-15 10:03:27 +08:00
David Monllao 17c975874f Merge branch 'm28_MDL-51363_Fix_Default_Settings_1x_Restore' of git://github.com/scara/moodle into MOODLE_28_STABLE 2015-09-15 10:02:19 +08:00
Eloy Lafuente (stronk7) 07d52ad818 Merge branch 'MDL-46239-28-2' of git://github.com/xow/moodle into MOODLE_28_STABLE 2015-09-15 01:03:08 +02:00
Matteo Scaramuccia 3f121ac514 MDL-51363 SCORM: fixed default settings on restoring 1.x backups 2015-09-15 00:01:33 +02:00
Cameron Ball eddc63f4e8 MDL-51290 user: Expand picture section in profile by default 2015-09-14 17:54:06 +08:00
David Monllao 3f72e79ee1 Merge branch 'wip-mdl-51101-m28' of git://github.com/rajeshtaneja/moodle into MOODLE_28_STABLE 2015-09-14 16:18:55 +08:00
David Monllao 000be9c016 Merge branch 'MDL-51170-28' of git://github.com/andrewnicols/moodle into MOODLE_28_STABLE 2015-09-14 14:14:48 +08:00
David Monllao 8a6c5244c4 Merge branch 'MDL-51191-moodle28' of git://github.com/StudiUM/moodle into MOODLE_28_STABLE 2015-09-14 13:59:40 +08:00
David Monllao 5319119569 Merge branch 'MDL-51253_MOODLE_28' of git://github.com/BenKelada/moodle into MOODLE_28_STABLE 2015-09-14 13:09:18 +08:00
Ben Kelada 6dd7f1d452 MDL-51253 forum: fix urls for exceptions and redirects 2015-09-14 14:20:43 +10:00
Simey Lameze 59d26c45d9 MDL-50884 auth_shibboleth: fix logout handler url generation
This patch fixes the shibboleth redirect url generation, that can create invalid url
if the shibboleth logout_handler setting has a parameter generating two parameters
with (?) instead of (&).

Thanks to Matteo Boni for the proposed solution.
2015-09-14 09:52:20 +08:00
David Monllao 596950852c Merge branch 'MDL-51232_28' of git://github.com/jinuabraham/moodle into MOODLE_28_STABLE 2015-09-14 09:39:30 +08:00
Simey Lameze 6deeba6bcc MDL-50959 gradebook: fix XML grade publishing score 2015-09-14 09:05:49 +08:00
Daniel Thies 85cf55ebaf MDL-51228 atto_editor: Add documententation for inlineFormat flag 2015-09-13 14:26:56 -05:00
Eloy Lafuente (stronk7) e494078a27 Moodle release 2.8.8 2015-09-12 02:03:02 +02:00
Colin Campbell a03a01f2ad MDL-51305 grade: Fix slow grade operations by setting grade_item early.
Exports were fetching the grade item for every item-user combination.
Setting the grade_item object on the grade_item early prevents that.
2015-09-11 15:23:06 -05:00
Jean-Philippe Gaudreau 80764a301f MDL-51191 assign: Optimizing slow SQL query for MySQL 2015-09-11 11:12:24 -04:00
Jetha Chan 596e4603ae MDL-50685 core_form: disable hidden options, don't just hide 2015-09-11 15:09:29 +08:00
Marina Glancy 355e943c4b MDL-50892 mod: allow activity to have name '0' 2015-09-11 10:52:35 +08:00
Eloy Lafuente (stronk7) 36750a2872 weekly release 2.8.7+ 2015-09-10 11:09:59 +02:00
Eloy Lafuente (stronk7) 6c5f24d74d Merge branch 'install_28_STABLE' of https://git.in.moodle.com/amosbot/moodle-install into MOODLE_28_STABLE 2015-09-10 11:09:53 +02:00
Rajesh Taneja 8102007398 MDL-51101 behat: Fixed wrong hover step usage 2015-09-10 14:56:24 +08:00
rajesh Taneja c67f4ad661 MDL-50516 behat: Back/next button reloads page
When next/back button is pressed in phantomjs/browserkit
it reload page, so adding a bug_phantomjs, so that we can
test the lesson re-attempt scenario
2015-09-10 14:52:40 +08:00
Tim Hunt d881f12cde MDL-51147 qtype_match: stats should cope even if Q edited badly
The numbers become pretty meaningless, but we need to avoid fatal
errors.
2015-09-09 16:48:39 +01:00
Andrew Nicols 447e1a755f Merge branch 'MDL-50852-28' of git://github.com/junpataleta/moodle into MOODLE_28_STABLE 2015-09-09 15:40:11 +08:00
Jun Pataleta c845d8e2e0 MDL-50852 formslib: Fixed client-side form validation problem.
This patch fixes the problem of client validation being broken when
shortforms is not enabled. This issue is caused by moodle-core-event
module not being loaded and the broadcast parameter in the
Y.Global.publish set to 2 instead of true.
2015-09-09 15:36:25 +08:00
Mark Nelson 63c2a82186 MDL-50516 mod_lesson: changes to existing behat tests 2015-09-09 15:31:13 +08:00
Mark Nelson be1f371d0d MDL-50516 mod_lesson: added behat tests 2015-09-09 15:31:13 +08:00
Mark Nelson 3a25aa92e1 MDL-50516 core_behat: added ability to go back, forward and reload the browser 2015-09-09 15:31:13 +08:00
Mark Nelson 39b50f7d3e MDL-50516 mod_lesson: fixed issue with grade not using minquestions
It's possible to reach the end of the lesson, get your result,
click back until you get to the last question, answer it correctly
and then be awarded a result of 100%. This was because the grade
calculation would only include the questions answered, rather than
all of them in the lesson. However, you can not fix this by always
grading by the amount of questions in the lesson as some lessons
bypass certain questions depending on the answer to previous ones.
The minquestion setting can now successfully be used to prevent this
behaviour by rewording the misleading string and adding logic.
2015-09-09 15:31:13 +08:00
Mark Nelson 9d5b339126 MDL-50516 mod_lesson: prevented deletion of previous attempts
The 'startlastseen' flag was removing any previous attempts
the user had from the DB. This meant that the user could
simply re-answer the question, regardless of the number
of attempts allowed.
2015-09-09 15:31:13 +08:00
Mark Nelson 67e3f70bb1 MDL-50516 mod_lesson: prevented user from repeating question
It was possible in the lesson module for a user to
answer a question, get the result, then click back
in the browser and re-answer it, even if they exceeded
the number of attempts allowed per question.
2015-09-09 15:31:12 +08:00
Eloy Lafuente (stronk7) 84cccb56a1 Merge branch 'wip-mdl-51322-m28' of https://github.com/rajeshtaneja/moodle into MOODLE_28_STABLE 2015-09-09 08:25:31 +02:00
Ankit Agarwal 20ff15e22b MDL-50173 ratings: Use proper checks to ensure ratings are viewable.
Mainly to verify groups visibility this new callback has been created.

Note this was originally 2 commits but for amending purposes they have
been squashed.
2015-09-09 04:42:19 +02:00
Andrew Nicols a20bcf6598 Merge branch 'wip-MDL-34938-m28' of git://github.com/marinaglancy/moodle into MOODLE_28_STABLE 2015-09-09 09:48:24 +08:00
John Okely a44fed5c80 MDL-50709 groups: Prevent XSS in grouping description 2015-09-08 12:50:02 +02:00
Dan Poltawski 0394cd902d Merge branch 'wip-MDL-50323-28' of git://github.com/abgreeve/moodle into MOODLE_28_STABLE 2015-09-08 09:14:11 +01:00
Cameron Ball 7b027ea79c MDL-46157 drag and drop: Improve item labels
Ignore the edit menu when determining the region to drag.

Conflicts:
	lib/yui/build/moodle-core-dragdrop/moodle-core-dragdrop-min.js
2015-09-08 11:46:37 +08:00
Marina Glancy b40159e771 MDL-34938 enrol_meta: sync enrolment start/end dates 2015-09-08 10:26:08 +08:00
Andrew Nicols b77fbfbc5d Merge branch 'MDL-51245_28' of git://github.com/stronk7/moodle into MOODLE_28_STABLE 2015-09-08 10:24:43 +08:00
Marina Glancy adb65a80f9 MDL-51008 grades: show correct default value in overview report 2015-09-08 10:11:47 +08:00
Adrian Greeve 5b9d6e3e7a MDL-50323 themes: Course unordered lists correctly styled.
Thank you to Ann Adamcik for providing this patch.
2015-09-08 09:39:07 +08:00
Eloy Lafuente (stronk7) a813129dc5 MDL-51245 sqlsrv: Diagnose missing READ_COMMITTED_SNAPSHOT mode
Without it, transactions are executed in standard READ_COMMITED
mode, without snapshoting/row versioning, leading to update
conflicts under high concurrency.
2015-09-08 02:59:53 +02:00
Eloy Lafuente (stronk7) 0e5bcf0a0b MDL-51245 mssql: Diagnose missing READ_COMMITTED_SNAPSHOT mode
Without it, transactions are executed in standard READ_COMMITED
mode, without snapshoting/row versioning, leading to update conflicts
under high concurrency.
2015-09-08 02:59:50 +02:00
Petr Skoda 5337b22952 MDL-50860 core: improve creation of random strings 2015-09-08 01:09:13 +02:00
Tim Lock 7fb8fcfd9d MDL-42670 mod_assign: Fix recent activity block when blind marking is on 2015-09-07 22:44:38 +02:00
Corey Wallis f558ddcc4f MDL-51048 IMS-CC: Fix import & export of true/false questions 2015-09-07 16:06:00 +01:00
Marina Glancy f7fbc80766 MDL-50744 enrol_meta: fix incorrect role assign 2015-09-07 10:29:08 +01:00
Adrian Greeve 1d70050f33 MDL-48371 editors: Option for removing managefiles
We want to remove the managefiles button from the
editors in the wiki so that students don't delete
each others files.
2015-09-07 09:59:32 +01:00
rajesh Taneja 8b55f35808 MDL-51322 behat: ensure the window is properly closed
This is to ensure we have other window closed
so there is no race-around condition
2015-09-07 16:54:21 +08:00
Marina Glancy f19717481d MDL-50921 message: allow popup messages from noreply user
Thanks Gary Harris for the patch
2015-09-07 08:15:10 +00:00
John Okely 8f4379b3d5 MDL-46239 task: Improve error message when timezone does not exist
Credit to Mark Nielsen for initial patch.
2015-09-07 15:51:27 +08:00
Mark Nelson dbeeebc0f6 MDL-49561 core_lib: added info to bennu readme
Also did some minor tweaks to existing code.
2015-09-04 19:40:02 -07:00
Lars Anderson e4d7edbf4f MDL-49561 core_calendar: Fix ical export for events with no duration 2015-09-04 19:40:01 -07:00
Marina Glancy 0e0c8c0dd7 MDL-41042 coursecat: better handle changes in coursecontact 2015-09-04 11:54:33 +08:00
Damyon Wiese f44ac5d3bf MDL-48861 assign: Fix the "needs grading" filter
When auto-creating a new grade record - do not set the timemodified > than the submission timemodified
2015-09-04 11:07:06 +08:00
rajesh Taneja 9c5a63ef1f MDL-51321 behat: Fixed save button name 2015-09-04 09:10:23 +08:00
AMOS bot 5304b65e2b Automatically generated installer lang files 2015-09-04 00:04:13 +08:00
Dan Poltawski a332c3c4e8 weekly release 2.8.7+ 2015-09-03 12:31:54 +01:00
Dan Poltawski 7dae6eede4 Merge branch 'install_28_STABLE' of https://git.in.moodle.com/amosbot/moodle-install into MOODLE_28_STABLE 2015-09-03 12:31:52 +01:00
rajesh Taneja d0ac61f870 MDL-51090 behat: switch to main window 2015-09-03 10:26:58 +01:00
David Monllao 684e59ea5f Merge branch 'MDL-51179-28' of git://github.com/damyon/moodle into MOODLE_28_STABLE
Conflicts:
	lib/upgrade.txt
2015-09-03 10:38:36 +02:00
Ryan Wyllie 0b9cf14980 MDL-49536 theme_clean: update help text for logo
Updated the help text on the theme settings page to
mention that the theme logo will only be displayed on
the front page and login page.
2015-09-03 10:37:58 +02:00
rajesh Taneja f3661a7ea8 MDL-51285 mod_forum: Discussion post should not have same time stamp
Discussion post are sorted by timemodified
if they have same timemodified then results
will be random
2015-09-03 15:34:33 +08:00
Tim Hunt b099c22b24 MDL-51090 question manual grading: fixing for testing issues 2015-09-02 15:09:55 +08:00
David Monllao 9a7fa2710a Merge branch 'MDL-51090_28' of git://github.com/timhunt/moodle into MOODLE_28_STABLE 2015-09-02 09:50:17 +08:00
David Monllao d772d11aa6 Merge branch 'MDL-50971-m28' of git://github.com/NeillM/moodle into MOODLE_28_STABLE 2015-09-02 09:40:16 +08:00
David Monllao 41f04955f4 Merge branch 'MDL-50920-2.8' of git://github.com/sk-unikent/moodle into MOODLE_28_STABLE 2015-09-02 08:45:14 +08:00
Eloy Lafuente (stronk7) f1b608bb5a Merge branch 'MDL-50641-28' of git://github.com/danpoltawski/moodle into MOODLE_28_STABLE 2015-09-02 01:53:41 +02:00
Tim Hunt 5c97a8dae4 MDL-51090 question: further refinements to validating manual grades 2015-09-01 23:10:18 +01:00
Nelson Moller df0c2e9578 MDL-51090: mod_quiz grading validation of an essay question
An invalid format is casted to 0 (if a string) or to some truncated value in other cases (ex: 10..5).
2015-09-01 23:09:23 +01:00
David Mudrák fa36f1d1ab MDL-48165 workshop: Validate the rubric editing form 2015-09-01 23:39:43 +02:00
David Mudrák 235d8a4196 MDL-48165 workshop: Add support for assessment forms validation 2015-09-01 23:39:41 +02:00
Dan Poltawski 2583cc53e4 MDL-50690 themes: fix commenting coding style
(See also CONTRIB-5891)
2015-09-01 21:12:39 +01:00
Dan Poltawski 6430d84b77 Merge branch 'wip_MDL-50690_m28' of git://github.com/gjb2048/moodle into MOODLE_28_STABLE 2015-09-01 20:59:59 +01:00
AMOS bot da81de59d0 Automatically generated installer lang files 2015-09-02 00:05:35 +08:00
Dan Poltawski da0950d2c5 Merge branch 'MDL-51236-28' of git://github.com/andrewnicols/moodle into MOODLE_28_STABLE 2015-09-01 15:34:03 +01:00
David Monllao 836b029252 Merge branch 'MDL-51234-M28' of git://github.com/lazydaisy/moodle into MOODLE_28_STABLE
Conflicts:
	theme/bootstrapbase/style/moodle.css
2015-09-01 18:35:09 +08:00
David Monllao 486456d66c Merge branch 'MDL-51109-28' of git://github.com/danpoltawski/moodle into MOODLE_28_STABLE 2015-09-01 18:31:58 +08:00
Dan Poltawski 56a1ac4d38 MDL-51109 task: more debug info for failed scheduled tasks 2015-09-01 11:00:46 +01:00
Dan Poltawski 6b6905b69f Merge branch 'MDL-45841_28' of git://github.com/timhunt/moodle into MOODLE_28_STABLE 2015-09-01 10:14:47 +01:00
David Monllao 963b373666 Merge branch 'wip-mdl-50963-m28' of git://github.com/rajeshtaneja/moodle into MOODLE_28_STABLE 2015-09-01 16:06:37 +08:00
rajesh Taneja 12804263f4 MDL-50963 behat: fixed error string in behat 2015-09-01 14:49:10 +08:00
David Monllao 99a146b552 Merge branch 'MDL-50999-28' of git://github.com/andrewnicols/moodle into MOODLE_28_STABLE 2015-09-01 14:35:57 +08:00
Damyon Wiese 42e3e29791 MDL-51179 Atto: Extend autosave fix to cover text changes
Added new functions to editor api - set/get_text so the
original form text can be determined from an editor.

When calling use_editor() you should first call set_text() with
the text that will be inserted in the form element.

There is also a new scheduled task for cleaning Atto autosave drafts.
2015-09-01 13:37:27 +08:00
Damyon Wiese 31b84bd279 MDL-51179 Atto: Add a behat test for autosave 2015-09-01 13:36:30 +08:00
Damyon Wiese 8162eb2133 MDL-51179 Atto: When a resume is aborted - create a fresh draft for future saves. 2015-09-01 13:36:30 +08:00
Damyon Wiese b938b7a76a MDL-51179 Atto: Abort autosave if there are more recent changes to the files
If the files in the draft area have been modified more recently than the timestamp
of the draft - do not restore the files, or you will delete any newer files. We
cannot really guess here - merging the 2 lists of files will be wrong.
2015-09-01 13:36:30 +08:00
Marina Glancy b524b28633 MDL-50791 auth: add heading on signup form page 2015-09-01 02:02:27 +02:00
Marina Glancy b8faa63b7c MDL-50791 forms: make server validation errors accessible 2015-09-01 02:02:21 +02:00
Clement Smith 454882a4fa MDL-50963 lang/en/grades.php: Improve bad grade error message
The error message received when inputting a grade value that is too
low indicates that zero is a valid grade value. This is incorrect as
the lowest valid grade value is 1. This updates the error message to
indicate the minimum acceptable grade value is 1, not 0.
2015-09-01 01:46:05 +02:00
Eloy Lafuente (stronk7) ab5884d16d Merge branch 'MDL-49536-28' of git://github.com/ryanwyllie/moodle into MOODLE_28_STABLE 2015-08-31 20:48:36 +02:00
David Monllao 0448dbe7c1 Merge branch 'MDL-51131-28' of git://github.com/marinaglancy/moodle into MOODLE_28_STABLE 2015-08-31 14:08:10 +08:00
David Monllao 15737f3df5 Merge branch 'MDL-51084-28' of git://github.com/marinaglancy/moodle into MOODLE_28_STABLE 2015-08-31 12:53:59 +08:00
Michael Aherne 4750b1379f MDL-51181 config: Correct documentation of lock_factory 2015-08-31 10:55:44 +08:00
David Monllao 16134e337f Merge branch 'MDL-51215-28' of git://github.com/marinaglancy/moodle into MOODLE_28_STABLE 2015-08-31 10:45:51 +08:00
Jinu Abraham 12259f01ce MDL-51232 mod_book: Filter name header 2015-08-31 12:06:29 +09:30
lazydaisy 7d8bf42081 MDL-51234 theme_bootstrapbase: hover hardly visible on invert/collapse 2015-08-30 20:13:03 +01:00
Kevin Wiliarty 5608e36d11 MDL-51229 theme: display docked block on top of fixed navbar 2015-08-30 09:44:23 -04:00
Neill Magill 70fb7ac4b3 MDL-50971 ActionMenu: Action menus cause page to jump when closing
This patch changes the behavior of open action menus when using a mouse.

Before this patch when clicking on the page with an open action menu the focus would be
returned to the action menu's call button. This could cause the page to jump when a
mouse user did not close an action menu, scrolled and then tried to perform another
action on the page.

After this patch when clicking the focus will not be returned to the action menu's call button.
The behavior of the script will not be changed when using the keyboard.
2015-08-28 12:16:46 +01:00
Marina Glancy e564027dcf MDL-51084 tool_customlang: return to the same page after submit 2015-08-28 16:20:51 +08:00
Marina Glancy 82c123c722 MDL-44707 block_html: copy files when copying instance 2015-08-28 16:04:27 +08:00
Dan Poltawski f66090899d weekly release 2.8.7+ 2015-08-28 07:38:11 +01:00
Andrew Nicols 2ccd546b62 MDL-51236 phpunit: Prevent testsuite name conflicts
The testsuite name is fed straight into a class_exists() in
PHPUnit_Framework_TestSuite. In some cases, e.g. cachestore_static, the
class does exist, it's then fed into a ReflectionClass, and the test fails.

The testsuite needs to not conflict with any classes which could be
autoloaded in Moodle core.
2015-08-28 14:27:04 +08:00
Ryan Wyllie d74ec94722 MDL-49536 theme_clean: logo only on front and login
The logo for the clean and more themes will only be
displayed on the front page and login page as it was
replacing the header information on other pages within
Moodle, causing users to lose information on the page.
2015-08-28 02:43:21 +00:00
Daniel Thies 981379ffc2 MDL-51228 editor_atto: Apply style in plugins if selection is collapsed 2015-08-27 12:33:01 -05:00
Gareth J Barnard 048444fd21 MDL-50690 themes: Theme cache SVG images are not created. 2015-08-27 15:40:03 +01:00
Dan Poltawski e9e81544e3 MDL-49826 grade: hide singleview links when no permissions
Singleview only supports grade editors not viewers at this time.
2015-08-27 13:17:43 +02:00
Eloy Lafuente (stronk7) 09890fcd8e Merge branch 'MDL-51148-28-enfix' of git://github.com/mudrd8mz/moodle into MOODLE_28_STABLE 2015-08-27 13:00:45 +02:00
Marina Glancy c34a1b7b3c MDL-51215 course: redirect to manage appropriate category 2015-08-27 11:14:47 +08:00
Helen Foster b0f17b55f3 MDL-51148 lang: Merge English strings from the en_fix language pack 2015-08-26 17:25:49 +02:00
Dan Poltawski 86867d3248 Merge branch 'MDL-49701-28' of github.com:lameze/moodle into MOODLE_28_STABLE 2015-08-26 08:13:51 +01:00
Dan Poltawski 5c82c8e43c MDL-50641 rss: fix front page rss links
Fallback to guest user token when no user is specified in rss_get_url
rather than generating a junk token which is no use to anyone, this
matches existing logic which has been in place in forum for a while
and avoids custom handling all over the place.
2015-08-26 08:10:17 +01:00
Simey Lameze d49bf95236 MDL-49701 mod_lesson: add missing closebeforeopen string 2015-08-26 10:39:28 +08:00
David Monllao c06e48e541 Merge branch 'wip_MDL-50869_m28' of git://github.com/gjb2048/moodle into MOODLE_28_STABLE 2015-08-26 09:45:29 +08:00
David Monllao fd44933e9c Merge branch 'MDL-50996_28' of git://github.com/timhunt/moodle into MOODLE_28_STABLE 2015-08-25 14:27:14 +08:00
Marina Glancy 66c0fccb9e MDL-51131 tags: remove instances when course is deleted 2015-08-25 13:15:07 +08:00
Marina Glancy 728f41933c MDL-50973 admin: do not throw exception on /admin/ 2015-08-25 10:15:52 +08:00
Clement Smith 3c23486ad2 MDL-50957 grade/report/user: Fix division by zero
When using "sum of grades" and $grademax is zero, a division by zero
error occurs in fill_contributions_column() in
grade/report/user/lib.php.
2015-08-25 10:09:08 +08:00
Eloy Lafuente (stronk7) fe9f648edc Merge branch 'MDL-50714-28' of git://github.com/andrewnicols/moodle into MOODLE_28_STABLE 2015-08-25 00:06:50 +02:00
Tim Hunt 8ebae0d3d6 MDL-45841 forum: show unread posts on blog-style forum front page 2015-08-24 21:45:46 +01:00
Dan Poltawski 9fa2166a7b Merge branch 'MDL-49701_28' of git://github.com/jmvedrine/moodle into MOODLE_28_STABLE 2015-08-24 15:14:16 +01:00
Dan Poltawski abf7126490 Merge branch 'MDL-40179-28' of git://github.com/lameze/moodle into MOODLE_28_STABLE 2015-08-24 13:40:10 +01:00
Davo Smith 8781542c0f MDL-49826 gradereport_singleview: fix permission check
Users with capability 'moodle/grade:edit' should be able to edit grade values
- 'moodle/grade:manage' is not needed, as grade items are not being changed.
2015-08-24 10:39:46 +01:00
Dan Poltawski 549e0ff729 Merge branch 'MDL-47450-28' of git://github.com/FMCorz/moodle into MOODLE_28_STABLE 2015-08-24 10:25:34 +01:00
Tim Hunt 552efbb499 MDL-50996 quiz: fix review error with unusual permissions 2015-08-24 10:02:12 +01:00
David Monllao 596aa615a3 Merge branch 'MDL-50958-28' of git://github.com/lameze/moodle into MOODLE_28_STABLE 2015-08-24 15:41:58 +08:00
Marina Glancy b9228b0272 MDL-51184 themes: correctly check $CFG->svgicons
Thanks to Ralf Wiederhold for pointing out the bug
2015-08-24 11:08:33 +08:00
Andrew Nicols 61662e6896 MDL-51170 core: Scheme section of URL should be case insensitive 2015-08-21 12:27:16 +08:00
Bruce Silver 072ff98b64 MDL-50958 block_messages: declare missing stdClass object 2015-08-21 11:30:39 +08:00
Andrew Nicols 9fe894c779 MDL-50714 mod_forum: Add tests for all groupmodes 2015-08-21 08:22:31 +08:00
Andrew Nicols 7603f1589c MDL-50714 mod_forum: Correct use of movedicussions cap when posting
The ability to view the group dropdown was too closely related to the
movediscussions capability when posting, or editing a forum post.

The movedicussions capability should only be considered for some parts of
this logic. Users should be able to select the group to post to when
writing message, as long as they have access to that group.
2015-08-21 08:22:24 +08:00
Gareth J Barnard 7991c2d105 MDL-50869 themes: Quiz feedback colours are not accessible. 2015-08-20 16:54:50 +01:00
Dan Poltawski ef176837dc weekly release 2.8.7+ 2015-08-20 14:24:32 +01:00
Andrew Nicols 8511869bfd MDL-42634 theme: Increase margin on activity instance to not cover controls
Conflicts:
	theme/bootstrapbase/style/moodle.css
2015-08-20 15:45:21 +08:00
David Monllao 1c23a1c000 Merge branch 'wip-mdl-46387-m28' of git://github.com/rajeshtaneja/moodle into MOODLE_28_STABLE 2015-08-20 11:22:39 +08:00
Rajesh Taneja 4a46739201 MDL-46387 behat: fixed subscript feature scenario 2015-08-20 11:20:10 +08:00
Marina Glancy ae125772a3 MDL-50880 message: correctly compare with empty string
Thanks to David Herney Bernal for providing a fix
2015-08-20 10:32:20 +08:00
David Monllao 6ff144eef4 MDL-50391 mod_lti: Fixing indentation 2015-08-20 09:49:36 +08:00
Eloy Lafuente (stronk7) a5514edf92 Merge branch 'MDL-50801_28' of git://github.com/dmonllao/moodle into MOODLE_28_STABLE 2015-08-19 20:50:13 +02:00
Simey Lameze 24cb5ad791 MDL-40179 auth_cas: change is_proxybypass parameter to use server url 2015-08-19 14:33:44 +08:00
Rajesh Taneja cb8d778e68 MDL-46387 behat: Backport behat user menu step and modified scenario
- editor preference page is not available in 28
- Profile is My profile under user menu
2015-08-19 13:57:07 +08:00
Andrew Nicols e0d9de0f43 MDL-42634 theme: Increase margin on sectionname to not cover controls 2015-08-19 04:49:25 +02:00
Eloy Lafuente (stronk7) 7b52f14f0f Merge branch 'MDL-49085_28' of git://github.com/dmonllao/moodle into MOODLE_28_STABLE 2015-08-19 01:07:13 +02:00
Eloy Lafuente (stronk7) 2fe5bfe2e1 Merge branch 'MDL-46078-28' of git://github.com/damyon/moodle into MOODLE_28_STABLE 2015-08-19 01:00:07 +02:00
Dan Poltawski 5b8994d4aa Merge branch 'wip-MDL-30315-28' of git://github.com/abgreeve/moodle into MOODLE_28_STABLE 2015-08-18 13:19:59 +01:00
Eloy Lafuente (stronk7) d99c11ecec Merge branch 'MDL-47449-28' of git://github.com/andrewnicols/moodle into MOODLE_28_STABLE 2015-08-18 13:35:53 +02:00
Dan Poltawski 81d52cc2df MDL-46387 shifter: missing built changes 2015-08-18 12:32:47 +01:00
Dan Poltawski 59031a90ad Merge branch 'MDL-46387-m28-master' of https://github.com/dthies/moodle into MOODLE_28_STABLE 2015-08-18 12:22:18 +01:00
Dan Poltawski 7709e41cfc Merge branch 'MDL-49841-28' of git://github.com/andrewnicols/moodle into MOODLE_28_STABLE 2015-08-18 11:02:57 +01:00
Adrian Greeve db99a3e09e MDL-30315 grades: Unit test for grade import. 2015-08-18 17:06:04 +08:00
Adrian Greeve 9784aa23e7 MDL-30315 gradebook: Uploading feedback doesn't override grades. 2015-08-18 17:06:04 +08:00
David Monllao 60a103b519 Merge branch 'MDL-50391-MOODLE_28' of git://github.com/aspark21/moodle into MOODLE_28_STABLE 2015-08-18 12:13:47 +08:00
David Monllao 3058d15ff4 MDL-49085 block_tag_youtube: Using Youtube data api v3 2015-08-18 11:16:44 +08:00
David Monllao 69199d4ccc Merge branch 'MDL-51102-28' of git://github.com/andrewnicols/moodle into MOODLE_28_STABLE 2015-08-18 10:41:19 +08:00
Dan Poltawski 869af180a6 Merge branch 'MDL-44828-28' of git://github.com/junpataleta/moodle into MOODLE_28_STABLE 2015-08-17 14:24:59 +01:00
Dan Poltawski eac5dcfe6c Merge branch 'MDL-42634-28' of git://github.com/andrewnicols/moodle into MOODLE_28_STABLE 2015-08-17 11:45:12 +01:00
David Monllao 1213a0e405 Merge branch 'MDL-51016-m28' of git://github.com/micaherne/moodle into MOODLE_28_STABLE 2015-08-17 14:22:38 +08:00
David Monllao 44cc619bbd Merge branch 'MDL-50637-2.8' of git://github.com/sk-unikent/moodle into MOODLE_28_STABLE 2015-08-17 13:56:58 +08:00
David Monllao 6ab5491bbf Merge branch 'wip-MDL-50881-m28' of git://github.com/marinaglancy/moodle into MOODLE_28_STABLE 2015-08-17 12:04:11 +08:00
David Monllao b210b577ec Merge branch 'MDL-50911-moodle28' of git://github.com/StudiUM/moodle into MOODLE_28_STABLE 2015-08-17 11:59:22 +08:00
Marina Glancy 00390e5b14 MDL-50932 cache: fix bug in prescanned file store
Thanks to Mark Nielsen for providing a patch
2015-08-17 11:45:47 +08:00
David Monllao d66f3df82d Merge branch 'MDL-51057-M28' of git://github.com/lazydaisy/moodle into MOODLE_28_STABLE 2015-08-17 09:54:46 +08:00
David Monllao 93f2239726 Merge branch 'MDL-51077-m28' of git://github.com/sammarshallou/moodle into MOODLE_28_STABLE 2015-08-17 09:46:51 +08:00
David Monllao 1ed375f2f5 Merge branch 'MDL-51088-28' of git://github.com/andrewnicols/moodle into MOODLE_28_STABLE 2015-08-17 09:26:31 +08:00
Andrew Nicols 4291ad3e8e MDL-51102 behat: Add a non-JS version of wait 2015-08-17 08:14:02 +08:00
Daniel Thies 9957c7f7fd MDL-46387 editor_atto: Add behat test for sub/sup 2015-08-16 16:02:05 -05:00
sam marshall f69d98df43 MDL-51077 Availability: Date restriction unit test static not cleared 2015-08-14 10:54:00 +01:00
Andrew Nicols 305ee3fc27 MDL-47449 completion: Ignore timemodified when comparing 2015-08-14 10:55:06 +08:00
Andrew Nicols a4dc694d6c MDL-47449 phpunit: Add comparitor for isEqual with exceptions
We often do isEqual tests but where a field, may have a single exception.
Ordinarily we can handle this easily by breaking the test down, but when
dealing with mocked objects we can only pass an instance of a
PHPUnit_Framework_Constraint, or a single value (which is cast to an
instance of PHPUnit_Framework_Constraint_IsEqual).

To deal with instances of time-based exception, we need to be able to
compare simple objects and classes where one or two values may be
different.
2015-08-14 10:55:06 +08:00
Andrew Nicols 54013a3cd1 MDL-49841 testing: Correct composer incantation 2015-08-14 10:29:17 +08:00
Jun Pataleta 38547b00f5 MDL-44828 filelib: Fix open error for force-downloaded files in mobile
Allow guessing of file's MIME type by default. Fallback to
application/octet-stream if MIME type cannot be determined.
2015-08-14 10:18:51 +08:00
Andrew Nicols c658ddf129 MDL-51088 mod_forum: Improve mod_forum behat performance 2015-08-14 07:58:18 +08:00
Andrew Nicols 89b453d1f6 MDL-51088 completion: Do not require hover to confirm xpath 2015-08-14 07:58:18 +08:00
lazydaisy 6ee4250032 MDL-51057 theme_base: RTL fix adds missing padding to block header h2. 2015-08-14 00:29:19 +01:00
Alistair Spark bb0c37afd4 MDL-50391 format_singleactivity: fix LTI Tool opens in existing window 2015-08-13 14:10:56 +01:00
Marina Glancy 23c18ecdc8 MDL-50391 format_singleactivity: fix activity_has_subtypes() 2015-08-13 14:10:56 +01:00
Dan Poltawski 0571f136e6 MDL-51110 badges: prevent duplicate award of badges
Previously duplicate users could be returned when they had
done duplicate badge criteria - this would lead to a duplicate
constraint being hit as they were attempted to be awarded twice.
2015-08-13 13:28:22 +01:00
Eloy Lafuente (stronk7) 7da2ed7a24 weekly release 2.8.7+ 2015-08-13 12:16:54 +02:00
Eloy Lafuente (stronk7) 0747fe1269 Merge branch 'install_28_STABLE' of https://git.in.moodle.com/amosbot/moodle-install into MOODLE_28_STABLE 2015-08-13 12:16:48 +02:00
AMOS bot 4155a06f8f Automatically generated installer lang files 2015-08-13 00:04:29 +08:00
AMOS bot fbe7024b7f Automatically generated installer lang files 2015-08-13 00:04:28 +08:00
Skylar Kelty 50b2135b2f MDL-50920 enrol: Remove pointless DB update in enrol_meta 2015-08-12 11:56:00 +01:00
Skylar Kelty 8e606dcd69 MDL-50637 calendar: Fix subscription table layout 2015-08-12 11:43:13 +01:00
David Monllao 6bebc4092f Merge branch 'MDL-46860-28' of git://github.com/ryanwyllie/moodle into MOODLE_28_STABLE 2015-08-12 10:46:34 +08:00
David Monllao 782d3e03eb Merge branch 'MDL-51053-m28' of git://github.com/sammarshallou/moodle into MOODLE_28_STABLE 2015-08-12 08:24:29 +08:00
Eloy Lafuente (stronk7) 6d5b932b6f Merge branch 'MDL-50062-28' of git://github.com/FMCorz/moodle into MOODLE_28_STABLE 2015-08-12 01:45:30 +02:00
Eloy Lafuente (stronk7) 9c257bdd4e Merge branch 'MDL-50307-28-3' of git://github.com/xow/moodle into MOODLE_28_STABLE 2015-08-11 23:45:21 +02:00
Andrew Nicols 8e58a58149 MDL-49293 db: Pass sql_concat_join to sql_concat 2015-08-11 23:12:11 +02:00
Andrew Nicols 878a6a938c MDL-49293 db: Test sql_concat_join with more conditions 2015-08-11 23:12:10 +02:00
Eloy Lafuente (stronk7) ffce730e38 Merge branch 'MDL-50642_28' of https://github.com/ecampbell/moodle into MOODLE_28_STABLE 2015-08-11 22:45:50 +02:00
Alain Benoit 3d6d4ec109 MDL-50911 Quiz: edit settings page not responsive 2015-08-11 09:20:20 -04:00
sam marshall 9cb8cd1a21 MDL-51053 Restore: Static cache breaks unit tests 2015-08-11 14:09:19 +01:00
Eloy Lafuente (stronk7) 6001950405 Merge branch 'MDL-50894_28' of https://github.com/gedion/moodle into MOODLE_28_STABLE 2015-08-11 14:18:51 +02:00
Eloy Lafuente (stronk7) 6e6fba961c Merge branch 'm28_MDL-51015' of git://github.com/danmarsden/moodle into MOODLE_28_STABLE 2015-08-11 14:09:59 +02:00
Frederic Massart 7c6925dbc1 MDL-42634 theme: Action menu is displayed correctly with hidden elements 2015-08-11 14:54:55 +08:00
David Monllao b9bdaf698c Merge branch 'MDL-51014-m28' of git://github.com/sammarshallou/moodle into MOODLE_28_STABLE 2015-08-11 13:08:56 +08:00
Marina Glancy 4889c541bd MDL-50881 calendar: do not throw exception without sesskey 2015-08-11 12:52:44 +08:00
John Okely 58dbfc1f37 MDL-50307 auth_db: Stop using AS to prevent error with some drivers 2015-08-11 12:14:17 +08:00
John Okely aa2f2a7dc9 MDL-50307 auth_db: Fix associative fetching in ADODB 2.19 2015-08-11 12:14:17 +08:00
Mark Johnson 78cd07f761 MDL-51014 behat: Wait for filepicker to load repository 2015-08-10 13:38:52 +01:00
David Monllao 48daac6bd8 Merge branch 'wip-MDL-51062-m28' of git://github.com/marinaglancy/moodle into MOODLE_28_STABLE 2015-08-10 14:24:19 +08:00
Marina Glancy 018576944f MDL-51062 behat: permission steps should work without js 2015-08-10 12:01:50 +08:00
David Monllao dfaaeb73c8 Merge branch 'MDL-50992-28' of git://github.com/damyon/moodle into MOODLE_28_STABLE 2015-08-10 11:18:10 +08:00
David Monllao 625d89ffce Merge branch 'MDL-51007-m28' of git://github.com/sammarshallou/moodle into MOODLE_28_STABLE 2015-08-10 11:09:06 +08:00
David Monllao df5be2eeb9 MDL-50801 atto_table: Closing caption tag 2015-08-10 10:56:14 +08:00
Ryan Wyllie c0450b9ab9 MDL-46860 filepicker: change responsive styling
Changed the filepicker's responsive styling to kick in
on screen width less than 768px (which is the bootstrap
standard) rather than 873px. This allows the standard
styling to apply within an iframe.
2015-08-10 02:21:57 +00:00
Ryan Wyllie 3ec071a091 MDL-46860 filepicker: iframe context aware
The filepicker now checks if it's within an iframe when
creating the dialogue, if so it will set the dialogue width
to fit within the iframe and disable dragging.
2015-08-10 02:21:28 +00:00
Andrew Nicols 79a2623413 MDL-50949 cache: Improve cache performance tests 2015-08-10 08:21:20 +08:00
Andrew Nicols 136f69e9bc Merge branch 'MDL-50949-28' of git://github.com/FMCorz/moodle into MOODLE_28_STABLE 2015-08-10 08:20:58 +08:00
AMOS bot 21715a1049 Automatically generated installer lang files 2015-08-08 00:04:24 +08:00
Frederic Massart 1613ce1b04 MDL-47450 blocks: Blocks can be moved on the site profile 2015-08-07 15:10:47 +08:00
AMOS bot bfb1475d57 Automatically generated installer lang files 2015-08-07 00:04:09 +08:00
Eoin Campbell 07d6525594 MDL-50642 qformat_xml: fix import of tags in Cloze questions 2015-08-06 16:48:59 +01:00
Michael Aherne 53eaea5944 MDL-51016 messaging: Fix email attachments on Windows 2015-08-06 13:07:25 +01:00
Dan Marsden a3ca598f14 MDL-51015 mod_scorm: tidy up messy code, remove use of eval() 2015-08-06 22:21:48 +12:00
Andrew Nicols f593be963c weekly release 2.8.7+ 2015-08-06 12:11:28 +08:00
Andrew Nicols 93b713c120 Merge branch 'install_28_STABLE' of https://git.in.moodle.com/amosbot/moodle-install into MOODLE_28_STABLE 2015-08-06 12:11:19 +08:00
Frederic Massart e043a770e5 MDL-50062 behat: Handle category mapping for grade items generator 2015-08-06 12:01:21 +08:00
Frederic Massart 87e339c40e MDL-50062 grades: Behat tests for aggregation changes 2015-08-06 12:01:20 +08:00
Frederic Massart 6cb4558ece MDL-50062 grades: Fix false positives in Behat tests 2015-08-06 12:01:20 +08:00
Frederic Massart a77191fb62 MDL-50062 grades: Tests for item::set_aggregation_fields_for_aggregation 2015-08-06 12:01:19 +08:00
Frederic Massart b127b86fe3 MDL-50062 grades: Carry agg. settings between categories when possible 2015-08-06 12:01:19 +08:00
Dave Cooper 0bd275a9e2 MDL-50062 gradebook: Fixed behaviour when changing aggregation mathods. 2015-08-06 12:01:18 +08:00
Daniel Thies dc7e49f611 MDL-46387 editor-atto: Toggle sub/sup tags using rangy
In order to have a consistant browser behavior and prevent nesting of
subscripts and superscripts, tags are converted to CSS classes and then
the CSS classes in the selection are toggeled using the rangy crossbrowser
selection library already included in Atto without using an execCommand.
2015-08-05 16:04:53 -05:00
Eloy Lafuente (stronk7) 98011f0c2a Merge branch 'MDL-44840-28' of git://github.com/lameze/moodle into MOODLE_28_STABLE 2015-08-05 20:47:51 +02:00
Eloy Lafuente (stronk7) afc52092bc Merge branch 'MDL-50816-28' of git://github.com/jleyva/moodle into MOODLE_28_STABLE 2015-08-05 18:22:17 +02:00
AMOS bot 26a9883a74 Automatically generated installer lang files 2015-08-06 00:04:18 +08:00
AMOS bot 8b6aacac49 Automatically generated installer lang files 2015-08-06 00:04:18 +08:00
Eloy Lafuente (stronk7) a34337ffdb Merge branch 'MDL-48970_2.8' of https://github.com/andrewhancox/moodle into MOODLE_28_STABLE 2015-08-05 16:20:56 +02:00
sam marshall 349ed8c86c MDL-51007 Availability: Unit test fails with extra plugins 2015-08-05 14:31:38 +01:00
Eloy Lafuente (stronk7) 71abb43154 Merge branch 'MDL-38230_28' of git://github.com/jmvedrine/moodle into MOODLE_28_STABLE 2015-08-05 12:40:06 +02:00
Andrew Nicols 3f98ccfbc3 MDL-50999 dock: Stop adding commands to DOM
The commands div should not be added to the DOM. The version shown in the
dock is different to the standard version in the block, and is manually
added to the dock panel when it is displayed.

The docked version contains additional actions (e.g. the undock button).

The original version of the dock should ideally remain untouched.

Note: A duplicate delegation was discovered when fixing this issue. This
was previosuly not triggered because the watched Node was removed
before the delegation took effect.
2015-08-05 10:09:42 +08:00
Andrew Nicols ec5c6bc193 Merge branch 'MDL-48202-M28' of git://github.com/lazydaisy/moodle into MOODLE_28_STABLE 2015-08-05 09:10:55 +08:00
Eloy Lafuente (stronk7) d7cc44a00d MDL-35027 mod_forum: verify forced subscriptions cannot be edited
This commit adds a new scenario to verify that the option
to turn edition of subscribers is not available anymore
for forced-subscription activities.

It also gets rid of the @javascript tag in a just introduced
scenario not needing it.
2015-08-05 02:11:32 +02:00
Eloy Lafuente (stronk7) ae26fc0bb4 Merge branch 'MDL-35027-B-28' of https://github.com/bostelm/moodle into MOODLE_28_STABLE 2015-08-05 02:10:28 +02:00
Eloy Lafuente (stronk7) a06efb59b3 Merge branch 'MDL-50416-28' of git://github.com/lameze/moodle into MOODLE_28_STABLE 2015-08-04 20:00:43 +02:00
Eloy Lafuente (stronk7) fdf6a66c52 MDL-46963 env: adding missing check_database_tables_row_format check 2015-08-04 19:41:10 +02:00
Eloy Lafuente (stronk7) 2dfc646317 MDL-50624 env: adding missing restrict_php_version_7 check 2015-08-04 19:28:46 +02:00
Bruce Silver a8d049c89f MDL-50992 lti: Fix debugging warning when creating a new tool 2015-08-04 22:30:14 +08:00
Andrew Nicols ee18715ebc Merge branch 'MDL-50893_28' of git://github.com/timhunt/moodle into MOODLE_28_STABLE 2015-08-04 16:00:44 +08:00
Andrew Nicols da3fc40642 Merge branch 'MDL-45113-28' of https://github.com/mackensen/moodle into MOODLE_28_STABLE 2015-08-04 15:24:02 +08:00
Andrew Nicols f4c182048f Merge branch 'MDL-43709-28' of https://github.com/pauln/moodle into MOODLE_28_STABLE 2015-08-04 12:45:10 +08:00
Andrew Nicols 933f0b800a Merge branch 'MDL-50532-28' of git://github.com/FMCorz/moodle into MOODLE_28_STABLE 2015-08-04 12:14:52 +08:00
Andrew Nicols 888cee2a2e MDL-50493 mod_forum: Correct style issues 2015-08-04 11:57:08 +08:00
Andrew Nicols e8084e04da Merge branch 'MDL-50493-28' of git://github.com/jleyva/moodle into MOODLE_28_STABLE 2015-08-04 11:56:54 +08:00
Andrew Nicols 7a97deebbc Merge branch 'MDL-50771_28' of git://github.com/stronk7/moodle into MOODLE_28_STABLE 2015-08-04 10:29:29 +08:00
Andrew Nicols 0013bab929 Merge branch 'MDL-42626-28' of git://github.com/jleyva/moodle into MOODLE_28_STABLE 2015-08-04 10:11:12 +08:00
Andrew Nicols adb6051f4c Merge branch 'MDL-45772-28-4' of git://github.com/xow/moodle into MOODLE_28_STABLE 2015-08-04 10:02:25 +08:00
Simey Lameze eb9bf73f21 MDL-50416 environment: add missing slasharguments checks 2015-08-04 09:55:49 +08:00
John Okely 9c336fdbe5 MDL-45772 admin: Stop browsers from autofilling passwords incorrectly 2015-08-04 09:55:07 +08:00
AMOS bot c256b7ba76 Automatically generated installer lang files 2015-08-04 00:04:26 +08:00
Henning Bostelmann 096dc2d33f MDL-35027 mod_forum: Fix subscriber list in hidden forums
If the forum is force-subscribed and hidden, only subscribers that can
view hidden activities will be shown in the subscriber list.
2015-08-03 12:14:41 +01:00
Eloy Lafuente (stronk7) 0494de7a1e MDL-50771 oracle: Bind long (>4000byte) text as CLOB
While we already were detecting @ normalise_value()
both BLOBs and CLOBs properly on insert and update
statements (by introspectind the column specs), when
a long TEXT is being passed as part of an arbitrary
SQL, or within the conditions... it was being bound
as VARCHAR, leading to problems if used in combination
with DBMS_LOB functions.

This patch just ensures that any TEXT > 4000 bytes not
detected by normalise_value() will be, always, bound as CLOB,
unconditionally.

Covered with tests both covering its use with DBMS_LOB (the
reported bug) and also in general raw statements.
2015-08-03 10:52:23 +02:00
Jean-Michel Vedrine ac2aa953ac MDL-38230 mod_quiz: Create UI for removing of quiz access rule addons
Conflicts:
	mod/quiz/version.php
2015-08-03 08:58:45 +02:00
Andrew Nicols b583b40de5 Merge branch 'wip-MDL-22819-m28' of https://github.com/marinaglancy/moodle into MOODLE_28_STABLE 2015-08-03 10:23:35 +08:00
Andrew Nicols aa7ac17386 Merge branch 'MDL-49864-28' of git://github.com/junpataleta/moodle into MOODLE_28_STABLE 2015-08-03 09:44:31 +08:00
Andrew Nicols a989aac8fe Merge branch 'MDL-50624-28' of git://github.com/ryanwyllie/moodle into MOODLE_28_STABLE 2015-08-03 09:21:10 +08:00
Jun Pataleta 54f0ee08d8 MDL-49864 mod_assign: Fix missing annotations when viewing PDF
Added 'draft = 1' criteria for the delete query in
page_editor::set_annotations in order to prevent the deletion of non-draft
annotations while the PDF is being edited.
2015-08-03 09:12:32 +08:00
Ryan Wyllie 713927f915 MDL-50624 environment: add PHP7 as unsupported version
Added PHP7 as an unsupported version for Moodle 2.8 and 2.9 in
the environment checks
2015-08-03 01:04:45 +00:00
lazydaisy f8fa208894 MDL-48202 theme_bootstrapbase: blocks are 6px taller after undocking. 2015-08-02 21:29:42 +01:00
Jean-Michel Vedrine e3bc5a8e27 MDL-49701 mod_lesson: open time should be before close time
Conflicts:
	mod/lesson/mod_form.php
2015-08-02 10:41:01 +02:00
Charles Fulton c90d759569 MDL-45113 auth: add is_configured method and convert auth_db to use it 2015-07-31 15:18:43 +00:00
Simey Lameze 81e3985652 MDL-50416 environment: remove slasharguments warning from install 2015-07-31 11:40:10 +08:00
Andrew Nicols 9f405b6c6d weekly release 2.8.7+ 2015-07-30 14:42:04 +08:00
Andrew Nicols cc7d7fb648 Merge branch 'install_28_STABLE' of https://git.in.moodle.com/amosbot/moodle-install into MOODLE_28_STABLE 2015-07-30 14:41:58 +08:00
Frederic Massart 88158ed58a MDL-50949 cache: Tests for performance debugging of cache usage 2015-07-29 14:47:47 +08:00
Frederic Massart c535e62552 MDL-50532 tasks: Delete obsolete tasks during upgrade 2015-07-29 11:25:41 +08:00
Jean-Michel Vedrine d670ca4dcd MDL-44840 mod_lesson: fix import of truefalse questions 2015-07-29 11:06:06 +08:00
Tim Hunt a36bdaeb82 MDL-50893 questions: cannot create a question with name 0 2015-07-28 18:21:08 +01:00
Barbara Ramiro 3690dd25a1 MDL-50370 Icons: Filetype icon for ePub 2015-07-28 12:43:38 +01:00
Dan Poltawski 33fb1f3d9f Merge branch 'MDL-50833-28' of git://github.com/merrill-oakland/moodle into MOODLE_28_STABLE 2015-07-28 12:38:54 +01:00
Dan Poltawski 417d607c56 Merge branch 'MDL-50868-28' of git://github.com/jethac/moodle into MOODLE_28_STABLE 2015-07-28 12:19:03 +01:00
spvickers a73ee08811 MDL-49629 mod_lti: Add icon fields
Icon fields added to input form when defining an external tool at the
admin level.  The icon for a tool derived from a tool proxy can be
overridden.  Course cache is cleared if current icon value is changed.

Add text boxes to edit form for entering icon URLs.
2015-07-28 12:03:41 +01:00
Andrew Nicols 13613d3bab Merge branch 'wip-MDL-50874-m28' of https://github.com/marinaglancy/moodle into MOODLE_28_STABLE 2015-07-28 15:03:00 +08:00
Andrew Nicols 63199d4418 Merge branch 'MDL-50295-28' of git://github.com/danpoltawski/moodle into MOODLE_28_STABLE 2015-07-28 14:03:46 +08:00
Andrew Nicols 681ef5e858 Merge branch 'MDL-44962_28' of https://github.com/dmonllao/moodle into MOODLE_28_STABLE 2015-07-28 11:38:04 +08:00
Andrew Nicols c47d5153ed Merge branch 'MDL-35148-28' of git://github.com/FMCorz/moodle into MOODLE_28_STABLE 2015-07-28 11:08:35 +08:00
Frederic Massart 8ef5eea2db MDL-35148 themes: Updated checks deciding when mobile themes are used
Now, if a site-theme is set for tablet/phone AND the user is using
a tablet/phone that site-theme will be used, always. In any other
case the normal theme resolution will be used: course, category, ...
2015-07-28 11:01:31 +08:00
Damyon Wiese 05bbda7b40 MDL-46078 Assign: Completion is not using assignment API.
Should not be directly querying the DB to get the submission, use the API!
2015-07-28 10:29:18 +08:00
Juan Leyva e06ea6d9e2 MDL-42626 messages: Hide deleted users in contact/blocked list 2015-07-27 16:37:14 +02:00
Charles Fulton 9314573cf6 MDL-41598 auth_shibboleth: don't override wantsurl 2015-07-27 15:25:11 +01:00
Dan Poltawski 96b529314f Merge branch 'MDL-43785-28' of git://github.com/andrewnicols/moodle into MOODLE_28_STABLE 2015-07-27 14:49:42 +01:00
Dan Poltawski e205936ac9 Merge branch 'MDL-49360-28' of git://github.com/lameze/moodle into MOODLE_28_STABLE 2015-07-27 12:08:47 +01:00
Dan Poltawski 27f5d33ad2 Merge branch 'wip-MDL-50649-m28' of git://github.com/marinaglancy/moodle into MOODLE_28_STABLE 2015-07-27 12:00:03 +01:00
Andrew Nicols 08b7326cc5 Merge branch 'MDL-46232-28' of git://github.com/FMCorz/moodle into MOODLE_28_STABLE 2015-07-27 15:58:39 +08:00
Frederic Massart 74e083713e MDL-46232 user: Handle bulk delete of users without email addresses 2015-07-27 15:48:16 +08:00
Andrew Nicols ea2e3f1c82 MDL-43785 lib: Improve session timeout warnings 2015-07-27 14:30:37 +08:00
Simey Lameze 185f689f77 MDL-49360 core_lib: add new method get_local_referer()
This commit also replace all usages of $_SERVER['HTTP_REFERER'] and get_referer().
2015-07-27 11:58:11 +08:00
AMOS bot 2644190a7b Automatically generated installer lang files 2015-07-26 00:04:07 +08:00
Gedion Woldeselassie ab49be1e54 MDL-50894 lib/conditionlib: Occasional cron error
Inhibit division by zero error warnings when rawgrademax and rawgrademin are
equal. The change does not affect existing functional behavior.
2015-07-24 10:14:45 -05:00
David Monllao f9c2569e00 MDL-44962 mod_wiki: No input filter
Thanks to Tim Lock for the partial fix.
2015-07-24 16:34:40 +02:00
Marina Glancy 88f5b27317 MDL-22819 tags: fix breadcrumb on manage tags page 2015-07-24 21:28:47 +08:00
Marina Glancy c537eb481d MDL-50649 report: query optimisation 2015-07-24 17:39:21 +08:00
Jetha Chan 8e074d1f69 MDL-50868 weblib: add unit test for ruby support 2015-07-24 14:11:53 +09:00
Jetha Chan 1e62e0c76c MDL-50868 weblib: add ruby support to purify_html 2015-07-24 14:11:53 +09:00
AMOS bot c7a40cf84a Automatically generated installer lang files 2015-07-24 00:04:25 +08:00
Dan Poltawski 97c2995445 weekly release 2.8.7+ 2015-07-22 20:42:58 +01:00
Dan Poltawski d03257d941 Merge branch 'install_28_STABLE' of https://git.in.moodle.com/amosbot/moodle-install into MOODLE_28_STABLE 2015-07-22 20:42:57 +01:00
Andrew Nicols 7fa65cdacf Merge branch 'MDL-50563-m28' of https://github.com/NeillM/moodle into MOODLE_28_STABLE 2015-07-22 09:37:47 +08:00
Andrew Nicols 52fccfe799 Merge branch 'MDL-50762-MOODLE28' of https://github.com/luryus/moodle into MOODLE_28_STABLE 2015-07-22 09:13:29 +08:00
Andrew Nicols f4fb074c23 Merge branch 'MDL-50699-28' of https://github.com/pauln/moodle into MOODLE_28_STABLE 2015-07-22 09:08:33 +08:00
Dan Poltawski 35bc4ecd94 Merge branch 'MDL-50293_28' of https://github.com/Syxton/moodle into MOODLE_28_STABLE 2015-07-21 12:51:58 +01:00
Marina Glancy 9df65abc4b MDL-50874 block: basic tests for tag-related blocks 2015-07-21 17:00:58 +08:00
Dan Poltawski e41fcbb337 Merge branch 'MDL-50639_mod_book_fontsize_M28' of https://github.com/barrysspace/moodle into MOODLE_28_STABLE 2015-07-21 09:08:13 +01:00
Andrew Nicols 73f2b4c674 Merge branch 'MDL-49618-m28' of https://github.com/marinaglancy/moodle into MOODLE_28_STABLE 2015-07-21 12:17:43 +08:00
Andrew Nicols e53e48d459 Merge branch 'MDL-47230_M28' of https://github.com/barrysspace/moodle into MOODLE_28_STABLE 2015-07-21 11:23:52 +08:00
Andrew Nicols 06eae40f50 Merge branch 'wip-MDL-41650-m28' of https://github.com/marinaglancy/moodle into MOODLE_28_STABLE 2015-07-21 10:03:12 +08:00
AMOS bot fc6277c149 Automatically generated installer lang files 2015-07-21 00:04:40 +08:00
pau.ferrer-ocana 5e56049641 MDL-49440 lib: Date picker duplicated week day names repaired
Thanks Marc Català for the patch
2015-07-20 14:04:47 +01:00
Dan Poltawski 4fb12f39be Merge branch 'wip-MDL-50678-m28' of git://github.com/marinaglancy/moodle into MOODLE_28_STABLE 2015-07-20 13:54:05 +01:00
AMOS bot e8f903bc82 Automatically generated installer lang files 2015-07-20 00:05:07 +08:00
apsdehal e2c7d95dc4 MDL-41650 Tags: Changed css classes of errors and success notice 2015-07-19 20:23:53 +08:00
AMOS bot dcd6b60217 Automatically generated installer lang files 2015-07-18 00:05:24 +08:00
Lauri Koskela 43f957c3f9 MDL-50762 tool_capability: Do not hide first capability in list 2015-07-17 15:30:56 +03:00
Neill Magill f2d0c4b895 MDL-50563 blocks: A hidden block that is dropped should be dimmed
Before this patch when dragging and dropping a hidden block it would display as though visible when it was dropped.

This is only a display issue, as a page refresh caused it to be dimmed in its new position.
2015-07-17 09:08:18 +01:00
Barry Oosthuizen 4e0cd866c1 MDL-50639 mod_book: Remove 0.8em font sizes 2015-07-17 08:44:05 +01:00
AMOS bot 9a2fd1975f Automatically generated installer lang files 2015-07-17 00:05:11 +08:00
Syxton df0881384f MDL-50293 navigation: File name not wrapping
A long File name doesn't always wrap correctly in the Navigation block.
2015-07-16 10:23:19 -04:00
Michael Aherne a02fc8bb05 MDL-50490 cron: Prevent tasks from leaving uncommitted transactions 2015-07-16 11:41:16 +01:00
Dan Poltawski cecc0eb211 weekly release 2.8.7+ 2015-07-16 08:16:18 +01:00
Juan Leyva 94540f233e MDL-50816 notes: Delete never met condition code 2015-07-15 15:26:02 +02:00
Eric Merrill 2675bdb42d MDL-50833 report: Still make a chart if there are no logs 2015-07-15 09:13:53 -04:00
Barry Oosthuizen 08ed9c2f04 MDL-47230 mod_book: Sub chapter bullet formatting 2015-07-15 09:20:09 +01:00
Marina Glancy 94081247f8 MDL-50678 mod_glossary: removed extra login check 2015-07-15 14:19:09 +08:00
Dan Poltawski 41ac409428 Merge branch 'MDL-37832-M28' of git://github.com/lazydaisy/moodle into MOODLE_28_STABLE 2015-07-14 10:14:15 +01:00
Dan Poltawski 0446d70c4c Merge branch 'MDL-50814-28' of git://github.com/jleyva/moodle into MOODLE_28_STABLE 2015-07-14 08:55:20 +01:00
Mary Evans 24096407cc MDL-37832 theme: Improved "My Moodle" expandable/collapsible caption. 2015-07-14 08:50:29 +01:00
Dan Poltawski 91076c7400 Merge branch 'MDL-50711_M28' of git://github.com/lazydaisy/moodle into MOODLE_28_STABLE 2015-07-14 08:44:56 +01:00
Dan Poltawski a88e331243 Merge branch 'MDL-50799-28' of git://github.com/merrill-oakland/moodle into MOODLE_28_STABLE 2015-07-13 16:08:22 +01:00
Juan Leyva 32d3490d55 MDL-50814 badges: Fix incorrect default ordering 2015-07-13 15:10:57 +02:00
Dan Poltawski 2562ca0bb6 Merge branch 'MDL-50806-28' of git://github.com/merrill-oakland/moodle into MOODLE_28_STABLE 2015-07-13 13:45:59 +01:00
Dan Poltawski f72723f2b6 Merge branch 'MDL-50798-28' of git://github.com/merrill-oakland/moodle into MOODLE_28_STABLE 2015-07-13 13:35:32 +01:00
Dan Poltawski f5e5c91b96 Merge branch 'MDL28-50800' of https://github.com/dkleto/moodle into MOODLE_28_STABLE 2015-07-13 13:27:40 +01:00
Dan Poltawski b27449ce44 Merge branch 'm28_MDL-49647' of https://github.com/danmarsden/moodle into MOODLE_28_STABLE 2015-07-13 10:05:24 +01:00
Paul Nicholls 18bc6d2177 MDL-43709 Forum: Reset forums not working with multiple forum types
The SQL being generated from the selected forum types on the course reset
form was using AND, resulting in never matching anything if more than one
forum type was selected for resetting (as each forum can only have one
type).  This should use $DB->get_in_or_equal() to generate sensible SQL.
2015-07-13 16:12:58 +12:00
Adam Riddell 2e3bc53fb3 MDL-50800 question: Add missing make_answer method
question/type/calculatedmulti/questiontype.php:
        - Add public make_answer method so that apply_attempt_state
          method in qtype_multichoice_base does not cause a fatal
          error when attempting to call make_answer.
2015-07-13 09:47:31 +10:00
Mary Evans 7b84e17a3a MDL-50711 theme_bootstrapbase: Added inverse horizontal divider colors. 2015-07-12 02:55:51 +01:00
Eloy Lafuente (stronk7) 4c7c7632dd weekly release 2.8.7+ 2015-07-10 18:11:22 +02:00
Eric Merrill a4bb044f62 MDL-50806 questions: Allow more memory when doing a question import 2015-07-09 12:46:47 -04:00
Dan Marsden c1e65f42a5 MDL-49647 mod_scorm: correct escaping of javascript content. 2015-07-09 16:58:03 +12:00
Eric Merrill 4a97af59ef MDL-50799 question: Improve Show all text to be more accurate 2015-07-08 22:03:16 -04:00
Marina Glancy 4a75799c9e MDL-49618 forum: apply format_string 2015-07-09 07:55:35 +08:00
Eric Merrill 92c067f617 MDL-50798 question: Raise time limit when rendering questions
Rendering a large number of questions may be quite slow, so we want to
raise the limit.

We don’t call raise() in the loop because the quiz buffer captures this
function for a AJAX script, and we should only call raise if we expect
a corresponding output to the users browser. This helps to prevent
unexpected load balancer disconnects. See core_php_time_limit::raise()
for more details.
2015-07-08 15:49:54 -04:00
Eloy Lafuente (stronk7) 2b5883adb0 Merge branch 'MDL-50489-28' of git://github.com/jleyva/moodle into MOODLE_28_STABLE 2015-07-07 19:13:21 +02:00
Eloy Lafuente (stronk7) 8f2a74ab57 Merge branch 'MDL-49185-28' of git://github.com/lameze/moodle into MOODLE_28_STABLE 2015-07-07 16:59:13 +02:00
Dan Poltawski ec2342495d MDL-50466 logstore: bump version to load new task definitions 2015-07-07 15:09:01 +01:00
Dan Poltawski 220fbca1aa MDL-50295 output: prevent 'emoji' arrows
We need to append U+FE0E VARIATION SELECTOR-15 to the arrow to ensure
our l/rarrows are displayed as text icons, not 'emoji' icons.

See http://unicode.org/reports/tr51/#Diversity for more details of why
this changed in iOS 8.3+.
2015-07-07 14:27:05 +01:00
Michael Aherne 772dc9df94 MDL-50466 tasks: Specific minute values for log cleanup 2015-07-07 09:39:11 +01:00
Dan Poltawski 118c600ba5 MDL-50749 js: add some TODOs to some small hacks 2015-07-07 08:49:30 +01:00
Dan Poltawski 29f2ac3b81 Merge branch 'MDL-50749-28' of https://github.com/mackensen/moodle into MOODLE_28_STABLE 2015-07-07 08:38:46 +01:00
Charles Fulton 3b994f6ab2 MDL-50749 course: add fake element for behat compatibility 2015-07-03 20:01:40 +00:00
Juan Leyva e2b7ee6662 MDL-50489 forum: Handle qanda forums in get_forum_discussions_paginated
I removed the last qanda checks in forum_user_can_see_discussion because they are not necessary and
they make the external function fail.

A user in a qanda forum can always see a discussion (he needs to see the discussion to be able to reply).
What he cannot see are the other user posts unless he has replied to the discussion once and the edition period
(usually 30 minutes) has ended.

Note also that forum_user_can_see_discussion was originally only used when displaying forums in blog format
in order to display the button show more or not, this is the reason this wasn't detected before.
2015-07-02 10:41:00 +02:00
Andrew Hancox 0f8a6256d5 MDL-48970 groups: Fix hover description on groups overview page
If a course exists within multiple groupings then the description
should display when you mouseover any instance of it on the overview
page.
2015-07-01 21:28:20 +01:00
Paul Nicholls f97240de8a MDL-50699 Lesson: "Link to next activity" empty until Lesson saved
Due to a logic bug, the "Link to next activity" dropdown was empty (only
contains the "None" option) until the Lesson had been saved.  This minor
change allows a "next activity" to be specified when initially creating
the Lesson whilst still preventing the user from choosing the Lesson as its
own next activity.
2015-06-26 14:44:43 +12:00
spvickers e0cefc24ab MDL-49185 mod_lti: Check for all capabilities
Added check for explicit and implicit enabled capabilities when parsing
a custom parameter.
2015-06-23 10:26:42 +08:00
Juan Leyva a4f93d57ac MDL-50493 forum: Handle correctly qanda forums in get_discussion_posts 2015-06-06 00:01:25 +02:00
Daniel Kosinski 5d9bc0acc3 MDL-46705 admin: Check if course with same shortname already exists 2015-03-24 23:36:28 +01:00
640 changed files with 15137 additions and 4895 deletions
+4 -2
View File
@@ -64,6 +64,8 @@ echo "<form id=\"authmenu\" method=\"post\" action=\"auth_config.php\">\n";
echo "<div>\n";
echo "<input type=\"hidden\" name=\"sesskey\" value=\"".sesskey()."\" />\n";
echo "<input type=\"hidden\" name=\"auth\" value=\"".$auth."\" />\n";
// HACK to prevent browsers from automatically inserting the user's password into the wrong fields.
echo prevent_form_autofill_password();
// auth plugin description
echo $OUTPUT->box_start();
@@ -146,8 +148,8 @@ function print_auth_lock_options($auth, $user_fields, $helptext, $retrieveopts,
// If custom field then pick name from database.
$fieldshortname = str_replace('profile_field_', '', $fieldname);
$fieldname = $customfieldname[$fieldshortname]->name;
} elseif (preg_match('/^(.+?)(\d+)$/', $fieldname, $matches)) {
$fieldname = get_string($matches[1]) . ' ' . $matches[2];
} elseif ($fieldname == 'phone1') {
$fieldname = get_string('phone');
} elseif ($fieldname == 'url') {
$fieldname = get_string('webpage');
} else {
+291
View File
@@ -1027,6 +1027,7 @@
<VENDOR name="oracle" version="10.2" />
</DATABASE>
<PHP version="5.4.4" level="required">
<RESTRICT function="restrict_php_version_7" message="unsupportedphpversion7" />
</PHP>
<PCREUNICODE level="optional">
<FEEDBACK>
@@ -1134,6 +1135,16 @@
<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.8" requires="2.2">
@@ -1150,6 +1161,7 @@
<VENDOR name="oracle" version="10.2" />
</DATABASE>
<PHP version="5.4.4" level="required">
<RESTRICT function="restrict_php_version_7" message="unsupportedphpversion7" />
</PHP>
<PCREUNICODE level="optional">
<FEEDBACK>
@@ -1270,6 +1282,145 @@
</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">
<RESTRICT function="restrict_php_version_7" message="unsupportedphpversion7" />
</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>
<MOODLE version="3.0" requires="2.2">
<UNICODE level="required">
<FEEDBACK>
<ON_ERROR message="unicoderequired" />
@@ -1407,4 +1558,144 @@
</CUSTOM_CHECK>
</CUSTOM_CHECKS>
</MOODLE>
<MOODLE version="3.1" requires="2.7">
<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="xmlreader" 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>
+9 -1
View File
@@ -514,7 +514,15 @@ if (isguestuser()) {
redirect(get_login_url());
}
$context = context_system::instance();
require_capability('moodle/site:config', $context);
if (!has_capability('moodle/site:config', $context)) {
// Do not throw exception display an empty page with administration menu if visible for current user.
$PAGE->set_title($SITE->fullname);
$PAGE->set_heading($SITE->fullname);
echo $OUTPUT->header();
echo $OUTPUT->footer();
exit;
}
// check that site is properly customized
$site = get_site();
+2
View File
@@ -39,6 +39,8 @@ require_once($CFG->dirroot . '/' . $CFG->admin . '/registration/forms.php');
require_once($CFG->dirroot . '/webservice/lib.php');
require_once($CFG->dirroot . '/' . $CFG->admin . '/registration/lib.php');
require_sesskey();
$huburl = required_param('huburl', PARAM_URL);
$huburl = rtrim($huburl, "/");
+6 -2
View File
@@ -50,7 +50,8 @@ $table->set_attribute('class', 'admintable generaltable');
$table->setup();
$plugins = array();
foreach (core_component::get_plugin_list('report') as $plugin => $plugindir) {
$availableplugins = core_component::get_plugin_list('report');
foreach ($availableplugins as $plugin => $plugindir) {
if (get_string_manager()->string_exists('pluginname', 'report_' . $plugin)) {
$strpluginname = get_string('pluginname', 'report_' . $plugin);
} else {
@@ -80,7 +81,10 @@ foreach ($plugins as $plugin => $name) {
$uninstall = html_writer::link($uninstallurl, $struninstall);
}
$stores = $logmanager->get_supported_logstores('report_' . $plugin);
$stores = array();
if (isset($availableplugins[$plugin])) {
$stores = $logmanager->get_supported_logstores('report_' . $plugin);
}
if ($stores === false) {
$supportedstores = get_string('logstorenotrequired', 'admin');
} else if (!empty($stores)) {
+2
View File
@@ -46,6 +46,8 @@ $resultshtml = admin_search_settings_html($query); // case insensitive search on
echo '<form action="' . $PAGE->url->out(true) . '" method="post" id="adminsettings">';
echo '<div>';
echo '<input type="hidden" name="sesskey" value="'.sesskey().'" />';
// HACK to prevent browsers from automatically inserting the user's password into the wrong fields.
echo prevent_form_autofill_password();
echo '</div>';
echo '<fieldset>';
echo '<div class="clearer"><!-- --></div>';
+4
View File
@@ -77,6 +77,8 @@ if (empty($SITE->fullname)) {
echo html_writer::input_hidden_params($PAGE->url);
echo '<input type="hidden" name="sesskey" value="'.sesskey().'" />';
echo '<input type="hidden" name="return" value="'.$return.'" />';
// HACK to prevent browsers from automatically inserting the user's password into the wrong fields.
echo prevent_form_autofill_password();
echo $settingspage->output_html();
@@ -119,6 +121,8 @@ if (empty($SITE->fullname)) {
echo html_writer::input_hidden_params($PAGE->url);
echo '<input type="hidden" name="sesskey" value="'.sesskey().'" />';
echo '<input type="hidden" name="return" value="'.$return.'" />';
// HACK to prevent browsers from automatically inserting the user's password into the wrong fields.
echo prevent_form_autofill_password();
echo $OUTPUT->heading($settingspage->visiblename);
echo $settingspage->output_html();
+2 -1
View File
@@ -64,7 +64,8 @@ mybadges,badges|/badges/mybadges.php|award',
array('0' => new lang_string('default', 'calendar'),
'%I:%M %p' => new lang_string('timeformat_12', 'calendar'),
'%H:%M' => new lang_string('timeformat_24', 'calendar'))));
$temp->add(new admin_setting_configselect('calendar_startwday', new lang_string('configstartwday', 'admin'), new lang_string('helpstartofweek', 'admin'), 0,
$temp->add(new admin_setting_configselect('calendar_startwday', new lang_string('configstartwday', 'admin'),
new lang_string('helpstartofweek', 'admin'), get_string('firstdayofweek', 'langconfig'),
array(
0 => new lang_string('sunday', 'calendar'),
1 => new lang_string('monday', 'calendar'),
+2 -1
View File
@@ -35,7 +35,8 @@ if ($hassiteconfig) { // speedup for non-admins, add all caps used on this page
$params = new stdClass();
$params->bytes = $defaultuserquota;
$params->displaysize = display_size($defaultuserquota);
$temp->add(new admin_setting_configtext('userquota', new lang_string('userquota', 'admin'), new lang_string('configuserquota', 'admin', $params), $defaultuserquota));
$temp->add(new admin_setting_configtext('userquota', new lang_string('userquota', 'admin'),
new lang_string('configuserquota', 'admin', $params), $defaultuserquota, PARAM_INT, 30));
$temp->add(new admin_setting_configcheckbox('allowobjectembed', new lang_string('allowobjectembed', 'admin'), new lang_string('configallowobjectembed', 'admin'), 0));
$temp->add(new admin_setting_configcheckbox('enabletrusttext', new lang_string('enabletrusttext', 'admin'), new lang_string('configenabletrusttext', 'admin'), 0));
+1 -1
View File
@@ -11,7 +11,7 @@ $hassiteconfig = has_capability('moodle/site:config', $systemcontext);
$ADMIN->add('root', new admin_externalpage('adminnotifications', new lang_string('notifications'), "$CFG->wwwroot/$CFG->admin/index.php"));
$ADMIN->add('root', new admin_externalpage('registrationmoodleorg', new lang_string('registration', 'admin'),
"$CFG->wwwroot/$CFG->admin/registration/register.php?huburl=" . HUB_MOODLEORGHUBURL . "&hubname=Moodle.org"));
"$CFG->wwwroot/$CFG->admin/registration/register.php?huburl=" . HUB_MOODLEORGHUBURL . "&hubname=Moodle.org&sesskey=" . sesskey()));
$ADMIN->add('root', new admin_externalpage('registrationhub', new lang_string('registerwith', 'hub'),
"$CFG->wwwroot/$CFG->admin/registration/register.php", 'moodle/site:config', true));
$ADMIN->add('root', new admin_externalpage('registrationhubs', new lang_string('hubs', 'admin'),
@@ -15,7 +15,6 @@ Feature: Edit capabilities
| user | course | role |
| teacher1 | C1 | editingteacher |
@javascript
Scenario: Default system capabilities modification
Given I log in as "admin"
And I set the following system permissions of "Teacher" role:
@@ -30,7 +29,6 @@ Feature: Edit capabilities
And "moodle/grade:managesharedforms" capability has "Prevent" permission
And "moodle/course:request" capability has "Prohibit" permission
@javascript
Scenario: Course capabilities overrides
Given I log in as "teacher1"
And I follow "Course 1"
@@ -41,11 +39,11 @@ Feature: Edit capabilities
| mod/forum:editanypost | Prevent |
| mod/forum:addquestion | Allow |
When I set the field "Advanced role override" to "Student (3)"
And I press "Go"
Then "mod/forum:deleteanypost" capability has "Prohibit" permission
And "mod/forum:editanypost" capability has "Prevent" permission
And "mod/forum:addquestion" capability has "Allow" permission
@javascript
Scenario: Module capabilities overrides
Given I log in as "teacher1"
And I follow "Course 1"
@@ -60,6 +58,7 @@ Feature: Edit capabilities
| mod/forum:editanypost | Prevent |
| mod/forum:addquestion | Allow |
When I set the field "Advanced role override" to "Student (3)"
And I press "Go"
Then "mod/forum:deleteanypost" capability has "Prohibit" permission
And "mod/forum:editanypost" capability has "Prevent" permission
And "mod/forum:addquestion" capability has "Allow" permission
@@ -137,6 +137,17 @@ Feature: Verify that all form fields values can be get and set
And I press "Save my choice"
And the field "one" matches value "1"
And the field "two" matches value ""
# Check if field xpath set/match works.
And I am on site homepage
And I follow "Course 1"
And I navigate to "Edit settings" node in "Course administration"
And I set the field with xpath "//input[@id='id_idnumber']" to "Course id number"
And the field with xpath "//input[@name='idnumber']" matches value "Course id number"
And the field with xpath "//input[@name='idnumber']" does not match value ""
And I press "Save changes"
And I navigate to "Edit settings" node in "Course administration"
And the field "Course ID number" matches value "Course id number"
Scenario: with JS disabled all form fields getters and setters works as expected
@@ -83,7 +83,6 @@ SEARCH.prototype = {
div.append(label).append(this.input);
this.select.insert(div, 'before');
this.select.one('option').setStyle('display', 'none');
this.input.on('keyup', this.typed, this);
this.select.on('change', this.validate, this);
@@ -1 +1 @@
YUI.add("moodle-tool_capability-search",function(e,t){var n=function(){n.superclass.constructor.apply(this,arguments)};n.prototype={form:null,select:null,selectoptions:{},input:null,button:null,lastsearch:null,initializer:function(){this.form=e.one("#capability-overview-form"),this.select=this.form.one("select[data-search=capability]"),this.select.setStyle("minWidth",this.select.get("offsetWidth")),this.select.get("options").each(function(e){var t=e.get("value");this.selectoptions[t]=e},this),this.button=this.form.all("input[type=submit]"),this.lastsearch=this.form.one("input[name=search]");var t=e.Node.create('<div id="capabilitysearchui"></div>'),n=e.Node.create('<label for="capabilitysearch">'+this.get("strsearch")+"</label>");this.input=e.Node.create('<input type="text" id="capabilitysearch" />'),t.append(n).append(this.input),this.select.insert(t,"before"),this.select.one("option").setStyle("display","none"),this.input.on("keyup",this.typed,this),this.select.on("change",this.validate,this),this.lastsearch&&(this.input.set("value",this.lastsearch.get("value")),this.typed(),this.select.one("option[selected]")&&this.select.set("scrollTop",this.select.one("option[selected]").get("getX"))),this.validate()},validate:function(){this.button.set("disabled",this.select.get("value")==="")},typed:function(){var e=this.input.get("value"),t=0,n=null,r;this.lastsearch&&this.lastsearch.set("value",e),this.select.all("option").remove();for(r in this.selectoptions)r.indexOf(e)>=0&&(t++,n=this.selectoptions[r],this.select.append(this.selectoptions[r]));t===0?this.input.addClass("error"):(this.input.removeClass("error"),t===1&&n.set("selected",!0)),this.validate()}},e.extend(n,e.Base,n.prototype,{NAME:"tool_capability-search",ATTRS:{strsearch:{}}}),M.tool_capability=M.tool_capability||{},M.tool_capability.init_capability_search=function(e){new n(e)}},"@VERSION@",{requires:["base","node"]});
YUI.add("moodle-tool_capability-search",function(e,t){var n=function(){n.superclass.constructor.apply(this,arguments)};n.prototype={form:null,select:null,selectoptions:{},input:null,button:null,lastsearch:null,initializer:function(){this.form=e.one("#capability-overview-form"),this.select=this.form.one("select[data-search=capability]"),this.select.setStyle("minWidth",this.select.get("offsetWidth")),this.select.get("options").each(function(e){var t=e.get("value");this.selectoptions[t]=e},this),this.button=this.form.all("input[type=submit]"),this.lastsearch=this.form.one("input[name=search]");var t=e.Node.create('<div id="capabilitysearchui"></div>'),n=e.Node.create('<label for="capabilitysearch">'+this.get("strsearch")+"</label>");this.input=e.Node.create('<input type="text" id="capabilitysearch" />'),t.append(n).append(this.input),this.select.insert(t,"before"),this.input.on("keyup",this.typed,this),this.select.on("change",this.validate,this),this.lastsearch&&(this.input.set("value",this.lastsearch.get("value")),this.typed(),this.select.one("option[selected]")&&this.select.set("scrollTop",this.select.one("option[selected]").get("getX"))),this.validate()},validate:function(){this.button.set("disabled",this.select.get("value")==="")},typed:function(){var e=this.input.get("value"),t=0,n=null,r;this.lastsearch&&this.lastsearch.set("value",e),this.select.all("option").remove();for(r in this.selectoptions)r.indexOf(e)>=0&&(t++,n=this.selectoptions[r],this.select.append(this.selectoptions[r]));t===0?this.input.addClass("error"):(this.input.removeClass("error"),t===1&&n.set("selected",!0)),this.validate()}},e.extend(n,e.Base,n.prototype,{NAME:"tool_capability-search",ATTRS:{strsearch:{}}}),M.tool_capability=M.tool_capability||{},M.tool_capability.init_capability_search=function(e){new n(e)}},"@VERSION@",{requires:["base","node"]});
@@ -83,7 +83,6 @@ SEARCH.prototype = {
div.append(label).append(this.input);
this.select.insert(div, 'before');
this.select.one('option').setStyle('display', 'none');
this.input.on('keyup', this.typed, this);
this.select.on('change', this.validate, this);
-1
View File
@@ -81,7 +81,6 @@ SEARCH.prototype = {
div.append(label).append(this.input);
this.select.insert(div, 'before');
this.select.one('option').setStyle('display', 'none');
this.input.on('keyup', this.typed, this);
this.select.on('change', this.validate, this);
+1 -1
View File
@@ -63,7 +63,7 @@ if ($translatorsubmitted) {
$checkin = optional_param('savecheckin', false, PARAM_RAW);
if ($checkin === false) {
$nexturl = $PAGE->url;
$nexturl = new moodle_url($PAGE->url, array('p' => $currentpage));
} else {
$nexturl = new moodle_url('/admin/tool/customlang/index.php', array('action'=>'checkin', 'lng' => $lng, 'sesskey'=>sesskey()));
}
+1
View File
@@ -133,6 +133,7 @@ class tool_customlang_renderer extends plugin_renderer_base {
$output .= html_writer::start_tag('div');
$output .= html_writer::empty_tag('input', array('type'=>'hidden', 'name'=>'translatorsubmitted', 'value'=>1));
$output .= html_writer::empty_tag('input', array('type'=>'hidden', 'name'=>'sesskey', 'value'=>sesskey()));
$output .= html_writer::empty_tag('input', array('type'=>'hidden', 'name'=>'p', 'value'=>$translator->currentpage));
$save1 = html_writer::empty_tag('input', array('type'=>'submit', 'name'=>'savecontinue', 'value'=>get_string('savecontinue', 'tool_customlang')));
$save2 = html_writer::empty_tag('input', array('type'=>'submit', 'name'=>'savecheckin', 'value'=>get_string('savecheckin', 'tool_customlang')));
$output .= html_writer::tag('fieldset', $save1.$save2, array('class'=>'buttonsbar'));
@@ -208,10 +208,13 @@ class tool_generator_course_backend extends tool_generator_backend {
*/
private function create_course() {
$this->log('createcourse', $this->shortname);
$courserecord = array('shortname' => $this->shortname,
'fullname' => get_string('fullname', 'tool_generator',
array('size' => get_string('shortsize_' . $this->size, 'tool_generator'))),
'numsections' => self::$paramsections[$this->size]);
$courserecord = array(
'shortname' => $this->shortname,
'fullname' => get_string('fullname', 'tool_generator',
array('size' => get_string('shortsize_' . $this->size, 'tool_generator'))),
'numsections' => self::$paramsections[$this->size],
'startdate' => usergetmidnight(time())
);
return $this->generator->create_course($courserecord, array('createsections' => true));
}
+1 -1
View File
@@ -23,7 +23,7 @@
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
$string['healthnoproblemsfound'] = 'There is no health problem found!';
$string['healthnoproblemsfound'] = 'No health problems were found!';
$string['healthproblemsdetected'] = 'Health problems detected!';
$string['healthproblemsolution'] = 'Health problem solution';
$string['healthreturntomain'] = 'Continue';
+1 -1
View File
@@ -28,7 +28,7 @@ $tasks = array(
array(
'classname' => '\logstore_legacy\task\cleanup_task',
'blocking' => 0,
'minute' => '*',
'minute' => 'R',
'hour' => '5',
'day' => '*',
'dayofweek' => '*',
+1 -1
View File
@@ -24,6 +24,6 @@
defined('MOODLE_INTERNAL') || die();
$plugin->version = 2014111000; // The current plugin version (Date: YYYYMMDDXX).
$plugin->version = 2014111001; // The current plugin version (Date: YYYYMMDDXX).
$plugin->requires = 2014110400; // Requires this Moodle version.
$plugin->component = 'logstore_legacy'; // Full name of the plugin (used for diagnostics).
+1 -1
View File
@@ -28,7 +28,7 @@ $tasks = array(
array(
'classname' => '\logstore_standard\task\cleanup_task',
'blocking' => 0,
'minute' => '*',
'minute' => 'R',
'hour' => '4',
'day' => '*',
'dayofweek' => '*',
+1 -1
View File
@@ -24,6 +24,6 @@
defined('MOODLE_INTERNAL') || die();
$plugin->version = 2014111000; // The current plugin version (Date: YYYYMMDDXX).
$plugin->version = 2014111001; // The current plugin version (Date: YYYYMMDDXX).
$plugin->requires = 2014110400; // Requires this Moodle version.
$plugin->component = 'logstore_standard'; // Full name of the plugin (used for diagnostics).
@@ -102,6 +102,10 @@ class manager {
try {
$this->client->login();
mtrace("Connection established.");
// Ensure that mailboxes exist.
$this->ensure_mailboxes_exist();
return true;
} catch (\Horde_Imap_Client_Exception $e) {
@@ -735,6 +739,27 @@ class manager {
return in_array($flag, $flags);
}
/**
* Ensure that all mailboxes exist.
*/
private function ensure_mailboxes_exist() {
$requiredmailboxes = array(
self::MAILBOX,
self::CONFIRMATIONFOLDER,
);
$existingmailboxes = $this->client->listMailboxes($requiredmailboxes);
foreach ($requiredmailboxes as $mailbox) {
if (isset($existingmailboxes[$mailbox])) {
// This mailbox was found.
continue;
}
mtrace("Unable to find the '{$mailbox}' mailbox - creating it.");
$this->client->createMailbox($mailbox);
}
}
/**
* Attempt to determine whether this message is a bulk message (e.g. automated reply).
*
@@ -219,10 +219,12 @@ class rules extends \table_sql implements \renderable {
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)) {
if ($courses = get_user_capability_course('tool/monitor:subscribe', null, true, 'fullname, visible', $orderby)) {
foreach ($courses as $course) {
$options[$course->id] = format_string($course->fullname, true,
array('context' => \context_course::instance($course->id)));
$coursecontext = \context_course::instance($course->id);
if ($course->visible || has_capability('moodle/course:viewhiddencourses', $coursecontext)) {
$options[$course->id] = format_string($course->fullname, true, array('context' => $coursecontext));
}
}
}
$url = new \moodle_url('/admin/tool/monitor/index.php');
+8
View File
@@ -149,6 +149,14 @@ if ($execute = $options['execute']) {
mtrace("... used " . ($DB->perf_get_queries() - $predbqueries) . " dbqueries");
mtrace("... used " . (microtime(true) - $pretime) . " seconds");
mtrace("Task failed: " . $e->getMessage());
if ($CFG->debugdeveloper) {
if (!empty($e->debuginfo)) {
mtrace("Debug info:");
mtrace($e->debuginfo);
}
mtrace("Backtrace:");
mtrace(format_backtrace($e->getTrace(), true));
}
\core\task\manager::scheduled_task_failed($task);
get_mailer('close');
exit(1);
+2
View File
@@ -63,6 +63,8 @@ echo '<form action="upgradesettings.php" method="post" id="adminsettings">';
echo '<div>';
echo '<input type="hidden" name="sesskey" value="'.sesskey().'" />';
echo '<input type="hidden" name="return" value="'.$return.'" />';
// HACK to prevent browsers from automatically inserting the user's password into the wrong fields.
echo prevent_form_autofill_password();
echo '<fieldset>';
echo '<div class="clearer"><!-- --></div>';
echo $newsettingshtml;
+5 -1
View File
@@ -78,8 +78,12 @@
echo $OUTPUT->header();
$fullname = fullname($user, true);
echo $OUTPUT->heading(get_string('deleteuser', 'admin'));
$optionsyes = array('delete'=>$delete, 'confirm'=>md5($delete), 'sesskey'=>sesskey());
echo $OUTPUT->confirm(get_string('deletecheckfull', '', "'$fullname'"), new moodle_url($returnurl, $optionsyes), $returnurl);
$deleteurl = new moodle_url($returnurl, $optionsyes);
$deletebutton = new single_button($deleteurl, get_string('delete'), 'post');
echo $OUTPUT->confirm(get_string('deletecheckfull', '', "'$fullname'"), $deletebutton, $returnurl);
echo $OUTPUT->footer();
die;
} else if (data_submitted() and !$user->deleted) {
+1 -1
View File
@@ -187,7 +187,7 @@ class auth_plugin_cas extends auth_plugin_ldap {
}
// If Moodle is configured to use a proxy, phpCAS needs some curl options set.
if (!empty($CFG->proxyhost) && !is_proxybypass($this->config->hostname)) {
if (!empty($CFG->proxyhost) && !is_proxybypass(phpCAS::getServerLoginURL())) {
phpCAS::setExtraCurlOption(CURLOPT_PROXY, $CFG->proxyhost);
if (!empty($CFG->proxyport)) {
phpCAS::setExtraCurlOption(CURLOPT_PROXYPORT, $CFG->proxyport);
+61 -8
View File
@@ -58,6 +58,11 @@ class auth_plugin_db extends auth_plugin_base {
function user_login($username, $password) {
global $CFG, $DB;
if ($this->is_configured() === false) {
debugging(get_string('auth_notconfigured', 'auth', $this->authtype));
return false;
}
$extusername = core_text::convert($username, 'utf-8', $this->config->extencoding);
$extpassword = core_text::convert($password, 'utf-8', $this->config->extencoding);
@@ -138,8 +143,13 @@ class auth_plugin_db extends auth_plugin_base {
* Connect to external database.
*
* @return ADOConnection
* @throws moodle_exception
*/
function db_init() {
if ($this->is_configured() === false) {
throw new moodle_exception('auth_dbcantconnect', 'auth_db');
}
// Connect to the external database (forcing new connection).
$authdb = ADONewConnection($this->config->type);
if (!empty($this->config->debugauthdb)) {
@@ -193,18 +203,21 @@ class auth_plugin_db extends auth_plugin_base {
if ($selectfields) {
$select = array();
foreach ($selectfields as $localname=>$externalname) {
$select[] = "$externalname AS $localname";
$select[] = "$externalname";
}
$select = implode(', ', $select);
$sql = "SELECT $select
FROM {$this->config->table}
WHERE {$this->config->fielduser} = '".$this->ext_addslashes($extusername)."'";
if ($rs = $authdb->Execute($sql)) {
if (!$rs->EOF) {
$fields_obj = $rs->FetchObj();
$fields_obj = (object)array_change_key_case((array)$fields_obj , CASE_LOWER);
foreach ($selectfields as $localname=>$externalname) {
$result[$localname] = core_text::convert($fields_obj->{$localname}, $this->config->extencoding, 'utf-8');
$fields = $rs->FetchRow();
// Convert the associative array to an array of its values so we don't have to worry about the case of its keys.
$fields = array_values($fields);
foreach (array_keys($selectfields) as $index => $localname) {
$value = $fields[$index];
$result[$localname] = core_text::convert($value, $this->config->extencoding, 'utf-8');
}
}
$rs->Close();
@@ -301,6 +314,7 @@ class auth_plugin_db extends auth_plugin_base {
$updateuser = new stdClass();
$updateuser->id = $user->id;
$updateuser->suspended = 1;
$updateuser = $this->clean_data($updateuser);
user_update_user($updateuser, false);
$trace->output(get_string('auth_dbsuspenduser', 'auth_db', array('name'=>$user->username, 'id'=>$user->id)), 1);
}
@@ -387,6 +401,7 @@ class auth_plugin_db extends auth_plugin_base {
$updateuser = new stdClass();
$updateuser->id = $olduser->id;
$updateuser->suspended = 0;
$updateuser = $this->clean_data($updateuser);
user_update_user($updateuser);
$trace->output(get_string('auth_dbreviveduser', 'auth_db', array('name' => $username,
'id' => $olduser->id)), 1);
@@ -409,6 +424,7 @@ class auth_plugin_db extends auth_plugin_base {
$trace->output(get_string('auth_dbinsertuserduplicate', 'auth_db', array('username'=>$user->username, 'auth'=>$collision->auth)), 1);
continue;
}
$user = $this->clean_data($user);
try {
$id = user_create_user($user, false); // It is truly a new user.
$trace->output(get_string('auth_dbinsertuser', 'auth_db', array('name'=>$user->username, 'id'=>$id)), 1);
@@ -463,15 +479,15 @@ class auth_plugin_db extends auth_plugin_base {
$authdb = $this->db_init();
// Fetch userlist.
$rs = $authdb->Execute("SELECT {$this->config->fielduser} AS username
$rs = $authdb->Execute("SELECT {$this->config->fielduser}
FROM {$this->config->table} ");
if (!$rs) {
print_error('auth_dbcantconnect','auth_db');
} else if (!$rs->EOF) {
while ($rec = $rs->FetchRow()) {
$rec = (object)array_change_key_case((array)$rec , CASE_LOWER);
array_push($result, $rec->username);
$rec = array_change_key_case((array)$rec, CASE_LOWER);
array_push($result, $rec[strtolower($this->config->fielduser)]);
}
}
@@ -550,6 +566,7 @@ class auth_plugin_db extends auth_plugin_base {
}
if ($needsupdate) {
require_once($CFG->dirroot . '/user/lib.php');
$updateuser = $this->clean_data($updateuser);
user_update_user($updateuser);
}
return $DB->get_record('user', array('id'=>$userid, 'deleted'=>0));
@@ -643,6 +660,18 @@ class auth_plugin_db extends auth_plugin_base {
return ($this->config->passtype === 'internal');
}
/**
* Returns false if this plugin is enabled but not configured.
*
* @return bool
*/
public function is_configured() {
if (!empty($this->config->type)) {
return true;
}
return false;
}
/**
* Indicates if moodle should automatically update internal user
* records with data from external sources using the information
@@ -863,6 +892,30 @@ class auth_plugin_db extends auth_plugin_base {
error_reporting($CFG->debug);
ob_end_flush();
}
/**
* Clean the user data that comes from an external database.
*
* @param array $user the user data to be validated against properties definition.
* @return stdClass $user the cleaned user data.
*/
public function clean_data($user) {
if (empty($user)) {
return $user;
}
foreach ($user as $field => $value) {
// Get the property parameter type and do the cleaning.
try {
$property = core_user::get_property_definition($field);
$user->$field = clean_param($value, $property['type']);
} catch (coding_exception $e) {
debugging("The property '$field' could not be cleaned.", DEBUG_DEVELOPER);
}
}
return $user;
}
}
+73
View File
@@ -374,4 +374,77 @@ class auth_db_testcase extends advanced_testcase {
$this->cleanup_auth_database();
}
/**
* Testing the clean_data() method.
*/
public function test_clean_data() {
global $DB;
$this->resetAfterTest(false);
$this->preventResetByRollback();
$this->init_auth_database();
$auth = get_auth_plugin('db');
$auth->db_init();
// Create users on external table.
$extdbuser1 = (object)array('name'=>'u1', 'pass'=>'heslo', 'email'=>'u1@example.com');
$extdbuser1->id = $DB->insert_record('auth_db_users', $extdbuser1);
// User with malicious data on the name.
$extdbuser2 = (object)array('name'=>'user<script>alert(1);</script>xss', 'pass'=>'heslo', 'email'=>'xssuser@example.com');
$extdbuser2->id = $DB->insert_record('auth_db_users', $extdbuser2);
$trace = new null_progress_trace();
// Let's test user sync make sure still works as expected..
$auth->sync_users($trace, true);
// Get the user on moodle user table.
$user2 = $DB->get_record('user', array('email'=> $extdbuser2->email, 'auth'=>'db'));
// The malicious code should be sanitized.
$this->assertEquals($user2->username, 'userscriptalert1scriptxss');
$this->assertNotEquals($user2->username, $extdbuser2->name);
// User with correct data, should be equal to external db.
$user1 = $DB->get_record('user', array('email'=> $extdbuser1->email, 'auth'=>'db'));
$this->assertEquals($extdbuser1->name, $user1->username);
$this->assertEquals($extdbuser1->email, $user1->email);
// Now, let's update the name.
$extdbuser2->name = 'user no xss anymore';
$DB->update_record('auth_db_users', $extdbuser2);
// Run sync again to update the user data.
$auth->sync_users($trace, true);
// The user information should be updated.
$user2 = $DB->get_record('user', array('username' => 'usernoxssanymore', 'auth' => 'db'));
// The spaces should be removed, as it's the username.
$this->assertEquals($user2->username, 'usernoxssanymore');
// Now let's test just the clean_data() method isolated.
// Testing PARAM_USERNAME, PARAM_NOTAGS, PARAM_RAW_TRIMMED and others.
$user3 = new stdClass();
$user3->firstname = 'John <script>alert(1)</script> Doe';
$user3->username = 'john%#&~%*_doe';
$user3->email = ' john@testing.com ';
$user3->deleted = 'no';
$user3->description = '<b>A description about myself.</b>';
$user3cleaned = $auth->clean_data($user3);
// Expected results.
$this->assertEquals($user3cleaned->firstname, 'John alert(1) Doe');
$this->assertEquals($user3cleaned->email, 'john@testing.com');
$this->assertEquals($user3cleaned->deleted, 0);
$this->assertEquals($user3->description, '<b>A description about myself.</b>');
$this->assertEquals($user3->username, 'john_doe');
// Try to clean an invalid property (fullname).
$user3->fullname = 'John Doe';
$auth->clean_data($user3);
$this->assertDebuggingCalled("The property 'fullname' could not be cleaned.");
$this->cleanup_auth_database();
}
}
+11 -9
View File
@@ -1642,7 +1642,7 @@ class auth_plugin_ldap extends auth_plugin_base {
if (($_SERVER['REQUEST_METHOD'] === 'GET' // Only on initial GET of loginpage
|| ($_SERVER['REQUEST_METHOD'] === 'POST'
&& (get_referer() != strip_querystring(qualified_me()))))
&& (get_local_referer() != strip_querystring(qualified_me()))))
// Or when POSTed from another place
// See MDL-14071
&& !empty($this->config->ntlmsso_enabled) // SSO enabled
@@ -1653,13 +1653,15 @@ class auth_plugin_ldap extends auth_plugin_base {
// First, let's remember where we were trying to get to before we got here
if (empty($SESSION->wantsurl)) {
$SESSION->wantsurl = (array_key_exists('HTTP_REFERER', $_SERVER) &&
$_SERVER['HTTP_REFERER'] != $CFG->wwwroot &&
$_SERVER['HTTP_REFERER'] != $CFG->wwwroot.'/' &&
$_SERVER['HTTP_REFERER'] != $CFG->httpswwwroot.'/login/' &&
$_SERVER['HTTP_REFERER'] != $CFG->httpswwwroot.'/login/index.php' &&
clean_param($_SERVER['HTTP_REFERER'], PARAM_LOCALURL) != '')
? $_SERVER['HTTP_REFERER'] : NULL;
$SESSION->wantsurl = null;
$referer = get_local_referer(false);
if ($referer &&
$referer != $CFG->wwwroot &&
$referer != $CFG->wwwroot . '/' &&
$referer != $CFG->httpswwwroot . '/login/' &&
$referer != $CFG->httpswwwroot . '/login/index.php') {
$SESSION->wantsurl = $referer;
}
}
// Now start the whole NTLM machinery.
@@ -1684,7 +1686,7 @@ class auth_plugin_ldap extends auth_plugin_base {
// we don't want to use at all. As we can't get rid of it, just point
// $SESSION->wantsurl to $CFG->wwwroot (after all, we came from there).
if (empty($SESSION->wantsurl)
&& (get_referer() == $CFG->httpswwwroot.'/auth/ldap/ntlmsso_finish.php')) {
&& (get_local_referer() == $CFG->httpswwwroot.'/auth/ldap/ntlmsso_finish.php')) {
$SESSION->wantsurl = $CFG->wwwroot;
}
+2 -2
View File
@@ -47,7 +47,7 @@ $string['auth_ldap_expiration_desc'] = 'Select No to disable expired password ch
$string['auth_ldap_expiration_key'] = 'Expiration';
$string['auth_ldap_expiration_warning_desc'] = 'Number of days before password expiration warning is issued.';
$string['auth_ldap_expiration_warning_key'] = 'Expiration warning';
$string['auth_ldap_expireattr_desc'] = 'Optional: overrides ldap-attribute that stores password expiration time';
$string['auth_ldap_expireattr_desc'] = 'Optional: Overrides the LDAP attribute that stores password expiration time.';
$string['auth_ldap_expireattr_key'] = 'Expiration attribute';
$string['auth_ldapextrafields'] = 'These fields are optional. You can choose to pre-fill some Moodle user fields with information from the <b>LDAP fields</b> that you specify here. <p>If you leave these fields blank, then nothing will be transferred from LDAP and Moodle defaults will be used instead.</p><p>In either case, the user will be able to edit all of these fields after they log in.</p>';
$string['auth_ldap_graceattr_desc'] = 'Optional: Overrides gracelogin attribute';
@@ -71,7 +71,7 @@ $string['auth_ldap_noconnect_all'] = 'LDAP-module cannot connect to any servers:
$string['auth_ldap_noextension'] = '<em>The PHP LDAP module does not seem to be present. Please ensure it is installed and enabled if you want to use this authentication plugin.</em>';
$string['auth_ldap_no_mbstring'] = 'You need the mbstring extension to create users in Active Directory.';
$string['auth_ldapnotinstalled'] = 'Cannot use LDAP authentication. The PHP LDAP module is not installed.';
$string['auth_ldap_objectclass'] = 'Optional: Overrides objectClass used to name/search users on ldap_user_type. Usually you dont need to chage this.';
$string['auth_ldap_objectclass'] = 'Optional: Overrides objectClass used to name/search users on ldap_user_type. Usually you don\'t need to change this.';
$string['auth_ldap_objectclass_key'] = 'Object class';
$string['auth_ldap_opt_deref'] = 'Determines how aliases are handled during search. Select one of the following values: "No" (LDAP_DEREF_NEVER) or "Yes" (LDAP_DEREF_ALWAYS)';
$string['auth_ldap_opt_deref_key'] = 'Dereference aliases';
+1 -1
View File
@@ -60,7 +60,7 @@ if (!isset($config->changepasswordurl)) {
</tr>
<tr valign="top" >
<td align="right"><?php echo html_writer::label(get_string('auth_radiustype_key', 'auth_radius'), 'menuradiustype'); ?>: </td>
<td align="right"><?php echo html_writer::label(get_string('auth_radiustype_key', 'auth_radius') . ':', 'menuradiustype'); ?> </td>
<td>
<?php
+2 -1
View File
@@ -210,7 +210,8 @@ class auth_plugin_shibboleth extends auth_plugin_base {
}
// Overwrite redirect in order to send user to Shibboleth logout page and let him return back
$redirect = $this->config->logout_handler.'?return='.urlencode($temp_redirect);
$redirecturl = new moodle_url($this->config->logout_handler, array('return' => $temp_redirect));
$redirect = $redirecturl->out();
}
}
+1 -1
View File
@@ -10,7 +10,7 @@
// Support for WAYFless URLs.
$target = optional_param('target', '', PARAM_LOCALURL);
if (!empty($target)) {
if (!empty($target) && empty($SESSION->wantsurl)) {
$SESSION->wantsurl = $target;
}
+16 -2
View File
@@ -328,7 +328,14 @@ class tree extends tree_node {
// Loop through all valid children.
foreach ($this->children as $index => $child) {
if (!$child->is_applied_to_user_lists()) {
continue;
if ($andoperator) {
continue;
} else {
// OR condition with one option that doesn't restrict user
// lists = everyone is allowed.
$anyconditions = false;
break;
}
}
$childresult = $child->filter_user_list($users, $innernot, $info, $checker);
if ($andoperator) {
@@ -359,7 +366,14 @@ class tree extends tree_node {
$childresults = array();
foreach ($this->children as $index => $child) {
if (!$child->is_applied_to_user_lists()) {
continue;
if ($andoperator) {
continue;
} else {
// OR condition with one option that doesn't restrict user
// lists = everyone is allowed.
$childresults = array();
break;
}
}
$childresult = $child->get_user_list_sql($innernot, $info, $onlyactive);
if ($childresult[0]) {
@@ -234,4 +234,68 @@ class condition extends \core_availability\condition {
}
return false;
}
/**
* Changes all date restrictions on a course by the specified shift amount.
* Used by the course reset feature.
*
* @param int $courseid Course id
* @param int $timeshift Offset in seconds
*/
public static function update_all_dates($courseid, $timeshift) {
global $DB;
$modinfo = get_fast_modinfo($courseid);
$anychanged = false;
// Adjust dates from all course modules.
foreach ($modinfo->cms as $cm) {
if (!$cm->availability) {
continue;
}
$info = new \core_availability\info_module($cm);
$tree = $info->get_availability_tree();
$dates = $tree->get_all_children('availability_date\condition');
$changed = false;
foreach ($dates as $date) {
$date->time += $timeshift;
$changed = true;
}
// Save the updated course module.
if ($changed) {
$DB->set_field('course_modules', 'availability', json_encode($tree->save()),
array('id' => $cm->id));
$anychanged = true;
}
}
// Adjust dates from all course sections.
foreach ($modinfo->get_section_info_all() as $section) {
if (!$section->availability) {
continue;
}
$info = new \core_availability\info_section($section);
$tree = $info->get_availability_tree();
$dates = $tree->get_all_children('availability_date\condition');
$changed = false;
foreach ($dates as $date) {
$date->time += $timeshift;
$changed = true;
}
// Save the updated course module.
if ($changed) {
$DB->set_field('course_sections', 'availability', json_encode($tree->save()),
array('id' => $section->id));
$anychanged = true;
}
}
// Ensure course cache is cleared if required.
if ($anychanged) {
rebuild_course_cache($courseid, true);
}
}
}
@@ -25,6 +25,7 @@
defined('MOODLE_INTERNAL') || die();
use availability_date\condition;
use core_availability\tree;
/**
* Unit tests for the date condition.
@@ -233,4 +234,53 @@ class availability_date_condition_testcase extends advanced_testcase {
$information = $date->get_standalone_description(true, true, $info);
$this->assertRegExp('~from.*5 March 2014([^0-9]*)$~', $information);
}
/**
* Tests the update_all_dates function.
*/
public function test_update_all_dates() {
global $DB;
$this->resetAfterTest();
// Create a course with 3 pages.
$generator = $this->getDataGenerator();
$course = $generator->create_course();
$rec = array('course' => $course);
$page1 = $generator->get_plugin_generator('mod_page')->create_instance($rec);
$page2 = $generator->get_plugin_generator('mod_page')->create_instance($rec);
$page3 = $generator->get_plugin_generator('mod_page')->create_instance($rec);
// Set the availability page 2 to a simple date condition. You can access
// it from 1337 onwards.
$simplecondition = tree::get_root_json(array(
condition::get_json(condition::DIRECTION_FROM, 1337)));
$DB->set_field('course_modules', 'availability',
json_encode($simplecondition), array('id' => $page2->cmid));
// Set page 3 to a complex set of conditions including a nested date condition.
// You can access it until 1459, *or* after 2810 if you belong to a group.
$complexcondition = tree::get_root_json(array(
condition::get_json(condition::DIRECTION_UNTIL, 1459),
tree::get_nested_json(array(
condition::get_json(condition::DIRECTION_FROM, 2810),
\availability_group\condition::get_json()))),
tree::OP_OR);
$DB->set_field('course_modules', 'availability',
json_encode($complexcondition), array('id' => $page3->cmid));
// Now use the update_all_dates function to move date forward 100000.
condition::update_all_dates($course->id, 100000);
// Get the expected conditions after adjusting time, and compare to database.
$simplecondition->c[0]->t = 101337;
$complexcondition->c[0]->t = 101459;
$complexcondition->c[1]->c[0]->t = 102810;
$this->assertEquals($simplecondition, json_decode(
$DB->get_field('course_modules', 'availability', array('id' => $page2->cmid))));
$this->assertEquals($complexcondition, json_decode(
$DB->get_field('course_modules', 'availability', array('id' => $page3->cmid))));
// The one without availability conditions should still be null.
$this->assertNull($DB->get_field('course_modules', 'availability', array('id' => $page1->cmid)));
}
}
@@ -228,7 +228,9 @@ class condition extends \core_availability\condition {
WHERE
gi.courseid = ?', array($userid, $courseid));
foreach ($rs as $record) {
if (is_null($record->finalgrade)) {
// This function produces division by zero error warnings when rawgrademax and rawgrademin
// are equal. Below change does not affect function behavior, just avoids the warning.
if (is_null($record->finalgrade) || $record->rawgrademax == $record->rawgrademin) {
// No grade = false.
$cachedgrades[$record->id] = false;
} else {
@@ -249,7 +251,9 @@ class condition extends \core_availability\condition {
// Just get current grade.
$record = $DB->get_record('grade_grades', array(
'userid' => $userid, 'itemid' => $gradeitemid));
if ($record && !is_null($record->finalgrade)) {
// This function produces division by zero error warnings when rawgrademax and rawgrademin
// are equal. Below change does not affect function behavior, just avoids the warning.
if ($record && !is_null($record->finalgrade) && $record->rawgrademax != $record->rawgrademin) {
$score = (($record->finalgrade - $record->rawgrademin) * 100) /
($record->rawgrademax - $record->rawgrademin);
} else {
@@ -229,7 +229,12 @@ class condition extends \core_availability\condition {
* @return stdClass Object representing condition
*/
public static function get_json($groupid = 0) {
return (object)array('type' => 'group', 'id' => (int)$groupid);
$result = (object)array('type' => 'group');
// Id is only included if set.
if ($groupid) {
$result->id = (int)$groupid;
}
return $result;
}
public function get_user_list_sql($not, \core_availability\info $info, $onlyactive) {
+6 -2
View File
@@ -49,7 +49,11 @@ class core_availability_component_testcase extends advanced_testcase {
// fail, but it's obvious when running test at least.
$pluginmanager = core_plugin_manager::instance();
$list = $pluginmanager->get_enabled_plugins('availability');
$this->assertEquals(array('completion', 'date', 'grade', 'group', 'grouping', 'profile'),
array_keys($list));
$this->assertArrayHasKey('completion', $list);
$this->assertArrayHasKey('date', $list);
$this->assertArrayHasKey('grade', $list);
$this->assertArrayHasKey('group', $list);
$this->assertArrayHasKey('grouping', $list);
$this->assertArrayHasKey('profile', $list);
}
}
+5 -5
View File
@@ -35,7 +35,7 @@ use core_availability\info_section;
* @copyright 2014 The Open University
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
class info_testcase extends \advanced_testcase {
class info_testcase extends advanced_testcase {
public function setUp() {
// Load the mock condition so that it can be used.
require_once(__DIR__ . '/fixtures/mock_condition.php');
@@ -87,8 +87,8 @@ class info_testcase extends \advanced_testcase {
// Check invalid one.
$info = new info_module($cm3);
$this->assertFalse($info->is_available($information));
$debugging = phpunit_util::get_debugging_messages();
phpunit_util::reset_debugging();
$debugging = $this->getDebuggingMessages();
$this->resetDebugging();
$this->assertEquals(1, count($debugging));
$this->assertContains('Invalid availability', $debugging[0]->message);
@@ -141,8 +141,8 @@ class info_testcase extends \advanced_testcase {
// Check invalid one.
$info = new info_section($sections[3]);
$this->assertFalse($info->is_available($information));
$debugging = phpunit_util::get_debugging_messages();
phpunit_util::reset_debugging();
$debugging = $this->getDebuggingMessages();
$this->resetDebugging();
$this->assertEquals(1, count($debugging));
$this->assertContains('Invalid availability', $debugging[0]->message);
+19
View File
@@ -600,6 +600,15 @@ class tree_testcase extends \advanced_testcase {
ksort($result);
$this->assertEquals(array(1, 3), array_keys($result));
// Tree with OR condition one of which doesn't filter.
$structure = tree::get_root_json(array(
self::mock(array('filter' => array(3))),
self::mock(array())), tree::OP_OR);
$tree = new tree($structure);
$result = $tree->filter_user_list($users, false, $info, $checker);
ksort($result);
$this->assertEquals(array(1, 2, 3), array_keys($result));
// Tree with two condition that both filter (&).
$structure = tree::get_root_json(array(
self::mock(array('filter' => array(2, 3))),
@@ -718,6 +727,16 @@ class tree_testcase extends \advanced_testcase {
$result = $DB->get_fieldset_sql($sql, $params);
sort($result);
$this->assertEquals(array($userinneither->id), $result);
// Tree with 'OR' of group conditions and a non-filtering condition.
// The non-filtering condition should mean that ALL users are included.
$tree = new tree(tree::get_root_json(array(
\availability_group\condition::get_json($group1->id),
\availability_date\condition::get_json(\availability_date\condition::DIRECTION_UNTIL, 3)
), tree::OP_OR));
list($sql, $params) = $tree->get_user_list_sql(false, $info, false);
$this->assertEquals('', $sql);
$this->assertEquals(array(), $params);
}
/**
+12 -2
View File
@@ -27,8 +27,18 @@ class cc_assesment_question_truefalse extends cc_assesment_question_proc_base {
public function __construct($quiz, $questions, $manifest, $section, $question_node, $rootpath, $contextid, $outdir) {
parent::__construct($quiz, $questions, $manifest, $section, $question_node, $rootpath, $contextid, $outdir);
$this->qtype = cc_qti_profiletype::true_false;
$this->correct_answer_node_id = $this->questions->nodeValue(
'plugin_qtype_truefalse_question/truefalse/trueanswer', $this->question_node);
// Determine the correct answer by finding out which answer has the non zero fraction...
// This is because a true / false question type can have 'false' as the correct answer.
$answers = $this->questions->nodeList('plugin_qtype_truefalse_question/answers/answer', $this->question_node);
foreach ($answers as $answer) {
$fraction = $this->questions->nodeValue('fraction', $answer);
if ($fraction != 0) {
$this->correct_answer_node_id = (int)$this->questions->nodeValue('@id', $answer);
}
}
$maximum_quiz_grade = (int)$this->quiz->nodeValue('/activity/quiz/grade');
$this->total_grade_value = ($maximum_quiz_grade + 1).'.0000000';
}
+17 -14
View File
@@ -885,27 +885,30 @@ class cc_quiz extends entities {
$sheet_question_categories_question = cc2moodle::loadsheet(SHEET_COURSE_QUESTION_CATEGORIES_QUESTION_CATEGORY_QUESTION_TRUE_FALSE);
$max_score = 0;
$true_answer_id = 0;
$false_answer_id = 0;
$trueanswer = null;
$falseanswer = null;
if (!empty($question['answers'])) {
// Identify the true and false answers.
foreach ($question['answers'] as $answer) {
if ($answer['score'] > $max_score) {
$max_score = $answer['score'];
$true_answer_id = $answer['id'];
if ($answer['identifier'] == 'true') {
$trueanswer = $answer;
} else if ($answer['identifier'] == 'false') {
$falseanswer = $answer;
} else {
// Should not happen, but just in case.
throw new coding_exception("Unknown answer identifier detected" .
" in true/false quiz question with id {$question['id']}.");
}
$node_course_question_categories_question_answer .= $this->create_node_course_question_categories_question_category_question_answer($answer);
}
foreach ($question['answers'] as $answer) {
if ($answer['id'] != $true_answer_id) {
$max_score = $answer['score'];
$false_answer_id = $answer['id'];
}
// Make sure the true and false answer was found.
if (is_null($trueanswer) || is_null($falseanswer)) {
throw new coding_exception("Unable to correctly identify the " .
"true and false answers in the question with id {$question['id']}.");
}
}
@@ -914,8 +917,8 @@ class cc_quiz extends entities {
'[#false_answer_id#]');
$replace_values = array($node_course_question_categories_question_answer,
$true_answer_id,
$false_answer_id);
$trueanswer['id'],
$falseanswer['id']);
$node_question_categories_question = str_replace($find_tags, $replace_values, $sheet_question_categories_question);
+17 -14
View File
@@ -908,27 +908,30 @@ class cc11_quiz extends entities11 {
$sheet_question_categories_question = cc112moodle::loadsheet(SHEET_COURSE_QUESTION_CATEGORIES_QUESTION_CATEGORY_QUESTION_TRUE_FALSE);
$max_score = 0;
$true_answer_id = 0;
$false_answer_id = 0;
$trueanswer = null;
$falseanswer = null;
if (!empty($question['answers'])) {
// Identify the true and false answers.
foreach ($question['answers'] as $answer) {
if ($answer['score'] > $max_score) {
$max_score = $answer['score'];
$true_answer_id = $answer['id'];
if ($answer['identifier'] == 'true') {
$trueanswer = $answer;
} else if ($answer['identifier'] == 'false') {
$falseanswer = $answer;
} else {
// Should not happen, but just in case.
throw new coding_exception("Unknown answer identifier detected " .
"in true/false quiz question with id {$question['id']}.");
}
$node_course_question_categories_question_answer .= $this->create_node_course_question_categories_question_category_question_answer($answer);
}
foreach ($question['answers'] as $answer) {
if ($answer['id'] != $true_answer_id) {
$max_score = $answer['score'];
$false_answer_id = $answer['id'];
}
// Make sure the true and false answer was found.
if (is_null($trueanswer) || is_null($falseanswer)) {
throw new coding_exception("Unable to correctly identify the " .
"true and false answers in the question with id {$question['id']}.");
}
}
@@ -937,8 +940,8 @@ class cc11_quiz extends entities11 {
'[#false_answer_id#]');
$replace_values = array($node_course_question_categories_question_answer,
$true_answer_id,
$false_answer_id);
$trueanswer['id'],
$falseanswer['id']);
$node_question_categories_question = str_replace($find_tags, $replace_values, $sheet_question_categories_question);
+47 -12
View File
@@ -1414,6 +1414,15 @@ class restore_process_categories_and_questions extends restore_execution_step {
* as needed, rebuilding course cache and other friends
*/
class restore_section_structure_step extends restore_structure_step {
/** @var array Cache: Array of id => course format */
private static $courseformats = array();
/**
* Resets a static cache of course formats. Required for unit testing.
*/
public static function reset_caches() {
self::$courseformats = array();
}
protected function define_structure() {
global $CFG;
@@ -1586,14 +1595,13 @@ class restore_section_structure_step extends restore_structure_step {
public function process_course_format_options($data) {
global $DB;
static $courseformats = array();
$courseid = $this->get_courseid();
if (!array_key_exists($courseid, $courseformats)) {
if (!array_key_exists($courseid, self::$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));
self::$courseformats[$courseid] = $DB->get_field('course', 'format', array('id' => $courseid));
}
$data = (array)$data;
if ($courseformats[$courseid] === $data['format']) {
if (self::$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(
@@ -1678,27 +1686,54 @@ class restore_course_structure_step extends restore_structure_step {
*/
public function process_course($data) {
global $CFG, $DB;
$context = context::instance_by_id($this->task->get_contextid());
$userid = $this->task->get_userid();
$target = $this->get_task()->get_target();
$isnewcourse = $target != backup::TARGET_CURRENT_ADDING && $target != backup::TARGET_EXISTING_ADDING;
// When restoring to a new course we can set all the things except for the ID number.
$canchangeidnumber = $isnewcourse || has_capability('moodle/course:changeidnumber', $context, $userid);
$canchangeshortname = $isnewcourse || has_capability('moodle/course:changeshortname', $context, $userid);
$canchangefullname = $isnewcourse || has_capability('moodle/course:changefullname', $context, $userid);
$canchangesummary = $isnewcourse || has_capability('moodle/course:changesummary', $context, $userid);
$data = (object)$data;
$data->id = $this->get_courseid();
$fullname = $this->get_setting_value('course_fullname');
$shortname = $this->get_setting_value('course_shortname');
$startdate = $this->get_setting_value('course_startdate');
// Calculate final course names, to avoid dupes
// Calculate final course names, to avoid dupes.
list($fullname, $shortname) = restore_dbops::calculate_course_names($this->get_courseid(), $fullname, $shortname);
// Need to change some fields before updating the course record
$data->id = $this->get_courseid();
$data->fullname = $fullname;
$data->shortname= $shortname;
if ($canchangefullname) {
$data->fullname = $fullname;
} else {
unset($data->fullname);
}
if ($canchangeshortname) {
$data->shortname = $shortname;
} else {
unset($data->shortname);
}
if (!$canchangesummary) {
unset($data->summary);
unset($data->summaryformat);
}
// Only allow the idnumber to be set if the user has permission and the idnumber is not already in use by
// another course on this site.
$context = context::instance_by_id($this->task->get_contextid());
if (!empty($data->idnumber) && has_capability('moodle/course:changeidnumber', $context, $this->task->get_userid()) &&
$this->task->is_samesite() && !$DB->record_exists('course', array('idnumber' => $data->idnumber))) {
if (!empty($data->idnumber) && $canchangeidnumber && $this->task->is_samesite()
&& !$DB->record_exists('course', array('idnumber' => $data->idnumber))) {
// Do not reset idnumber.
} else if (!$isnewcourse) {
// Prevent override when restoring as merge.
unset($data->idnumber);
} else {
$data->idnumber = '';
}
@@ -105,7 +105,7 @@ class core_backup_moodle2_course_format_testcase extends advanced_testcase {
'numdaystocomplete' => 2);
$courseobject->update_section_format_options($data);
$this->backup_and_restore($course, $course);
$this->backup_and_restore($course, $course, backup::TARGET_EXISTING_ADDING);
$sectionoptions = $courseobject->get_format_options(1);
$this->assertArrayHasKey('numdaystocomplete', $sectionoptions);
@@ -126,37 +126,49 @@ class core_backup_moodle2_course_format_testcase extends advanced_testcase {
$this->resetAfterTest(true);
$this->setAdminUser();
$CFG->enableavailability = true;
$CFG->enablecompletion = true;
// Create a course with some availability data set.
// Create a source course using the test_cs2_options format.
$generator = $this->getDataGenerator();
$course = $generator->create_course(
array('format' => 'test_cs2_options', 'numsections' => 3,
'enablecompletion' => COMPLETION_ENABLED),
array('createsections' => true));
// Create a target course using test_cs_options format.
$newcourse = $generator->create_course(
array('format' => 'test_cs_options', 'numsections' => 3,
'enablecompletion' => COMPLETION_ENABLED),
array('createsections' => true));
// Set section 2 to have both options, and a name.
$courseobject = format_base::instance($course->id);
$section = $DB->get_record('course_sections',
array('course' => $course->id, 'section' => 1), '*', MUST_EXIST);
array('course' => $course->id, 'section' => 2), '*', MUST_EXIST);
$data = array('id' => $section->id,
'numdaystocomplete' => 2,
'secondparameter' => 8);
'secondparameter' => 8
);
$courseobject->update_section_format_options($data);
// Backup and restore it.
$this->backup_and_restore($course, $newcourse);
$DB->set_field('course_sections', 'name', 'Frogs', array('id' => $section->id));
// Backup and restore to the new course using 'add to existing' so it
// keeps the current (test_cs_options) format.
$this->backup_and_restore($course, $newcourse, backup::TARGET_EXISTING_ADDING);
// Check that the section contains the options suitable for the new
// format and that even the one with the same name as from the old format
// has NOT been set.
$newcourseobject = format_base::instance($newcourse->id);
$sectionoptions = $newcourseobject->get_format_options(1);
$sectionoptions = $newcourseobject->get_format_options(2);
$this->assertArrayHasKey('numdaystocomplete', $sectionoptions);
$this->assertArrayHasKey('secondparameter', $sectionoptions);
$this->assertArrayNotHasKey('secondparameter', $sectionoptions);
$this->assertEquals(0, $sectionoptions['numdaystocomplete']);
$this->assertEquals(0, $sectionoptions['secondparameter']);
// However, the name should have been changed, as this does not depend
// on the format.
$modinfo = get_fast_modinfo($newcourse->id);
$section = $modinfo->get_section_info(2);
$this->assertEquals('Frogs', $section->name);
}
/**
@@ -164,9 +176,11 @@ class core_backup_moodle2_course_format_testcase extends advanced_testcase {
*
* @param stdClass $srccourse Course object to backup
* @param stdClass $dstcourse Course object to restore into
* @param int $target Target course mode (backup::TARGET_xx)
* @return int ID of newly restored course
*/
protected function backup_and_restore($srccourse, $dstcourse = null) {
protected function backup_and_restore($srccourse, $dstcourse = null,
$target = backup::TARGET_NEW_COURSE) {
global $USER, $CFG;
// Turn off file logging, otherwise it can't delete the file (Windows).
@@ -190,7 +204,7 @@ class core_backup_moodle2_course_format_testcase extends advanced_testcase {
}
$rc = new restore_controller($backupid, $newcourseid,
backup::INTERACTIVE_NO, backup::MODE_GENERAL, $USER->id,
backup::TARGET_NEW_COURSE);
$target);
$this->assertTrue($rc->execute_precheck());
$rc->execute_plan();
@@ -226,6 +240,12 @@ class format_test_cs_options extends format_topics {
class format_test_cs2_options extends format_test_cs_options {
public function section_format_options($foreditform = false) {
return array(
'numdaystocomplete' => array(
'type' => PARAM_INT,
'label' => 'Test days',
'element_type' => 'text',
'default' => 0,
),
'secondparameter' => array(
'type' => PARAM_INT,
'label' => 'Test Parmater',
+33 -7
View File
@@ -169,13 +169,39 @@ abstract class restore_check {
}
}
// Ensure the user has the rolldates capability. If not we want to lock this
// settings so that they cannot change it.
$hasrolldatescap = has_capability('moodle/restore:rolldates', $coursectx, $userid);
if ($type == backup::TYPE_1COURSE && !$hasrolldatescap) {
$datesetting = $restore_controller->get_plan()->get_setting('course_startdate');
if ($datesetting) {
$datesetting->set_status(base_setting::LOCKED_BY_PERMISSION);
if ($type == backup::TYPE_1COURSE) {
// Ensure the user has the rolldates capability. If not we want to lock this
// settings so that they cannot change it.
$hasrolldatescap = has_capability('moodle/restore:rolldates', $coursectx, $userid);
if (!$hasrolldatescap) {
$datesetting = $restore_controller->get_plan()->get_setting('course_startdate');
if ($datesetting) {
$datesetting->set_status(base_setting::LOCKED_BY_PERMISSION);
}
}
// Ensure the user has the changefullname capability. If not we want to lock
// the setting so that they cannot change it.
$haschangefullnamecap = has_capability('moodle/course:changefullname', $coursectx, $userid);
if (!$haschangefullnamecap) {
$fullnamesetting = $restore_controller->get_plan()->get_setting('course_fullname');
$fullnamesetting->set_status(base_setting::LOCKED_BY_PERMISSION);
}
// Ensure the user has the changeshortname capability. If not we want to lock
// the setting so that they cannot change it.
$haschangeshortnamecap = has_capability('moodle/course:changeshortname', $coursectx, $userid);
if (!$haschangeshortnamecap) {
$shortnamesetting = $restore_controller->get_plan()->get_setting('course_shortname');
$shortnamesetting->set_status(base_setting::LOCKED_BY_PERMISSION);
}
// Ensure the user has the update capability. If not we want to lock
// the overwrite setting so that they cannot change it.
$hasupdatecap = has_capability('moodle/course:update', $coursectx, $userid);
if (!$hasupdatecap) {
$overwritesetting = $restore_controller->get_plan()->get_setting('overwrite_conf');
$overwritesetting->set_status(base_setting::LOCKED_BY_PERMISSION);
}
}
+3 -3
View File
@@ -45,7 +45,7 @@ class edit_backpack_form extends moodleform {
$mform->addElement('html', html_writer::tag('span', '', array('class' => 'notconnected', 'id' => 'connection-error')));
$mform->addElement('header', 'backpackheader', get_string('backpackconnection', 'badges'));
$mform->addHelpButton('backpackheader', 'backpackconnection', 'badges');
$mform->addElement('static', 'url', get_string('url'), 'http://' . BADGE_BACKPACKURL);
$mform->addElement('static', 'url', get_string('url'), BADGE_BACKPACKURL);
$status = html_writer::tag('span', get_string('notconnected', 'badges'),
array('class' => 'notconnected', 'id' => 'connection-status'));
$mform->addElement('static', 'status', get_string('status'), $status);
@@ -67,7 +67,7 @@ class edit_backpack_form extends moodleform {
$mform->addElement('hidden', 'userid', $USER->id);
$mform->setType('userid', PARAM_INT);
$mform->addElement('hidden', 'backpackurl', 'http://' . BADGE_BACKPACKURL);
$mform->addElement('hidden', 'backpackurl', BADGE_BACKPACKURL);
$mform->setType('backpackurl', PARAM_URL);
}
@@ -118,7 +118,7 @@ class edit_collections_form extends moodleform {
$mform->addElement('header', 'backpackheader', get_string('backpackconnection', 'badges'));
$mform->addHelpButton('backpackheader', 'backpackconnection', 'badges');
$mform->addElement('static', 'url', get_string('url'), 'http://' . BADGE_BACKPACKURL);
$mform->addElement('static', 'url', get_string('url'), BADGE_BACKPACKURL);
$status = html_writer::tag('span', get_string('connected', 'badges'), array('class' => 'connected'));
$mform->addElement('static', 'status', get_string('status'), $status);
+2 -2
View File
@@ -87,7 +87,7 @@ if (!isset($data->status) || $data->status != 'okay') {
// Make sure email matches a backpack.
$check = new stdClass();
$check->backpackurl = 'http://' . BADGE_BACKPACKURL;
$check->backpackurl = BADGE_BACKPACKURL;
$check->email = $data->email;
$bp = new OpenBadgesBackpackHandler($check);
@@ -106,7 +106,7 @@ if (isset($request->status) && $request->status == 'missing') {
$obj = new stdClass();
$obj->userid = $USER->id;
$obj->email = $data->email;
$obj->backpackurl = 'http://' . BADGE_BACKPACKURL;
$obj->backpackurl = BADGE_BACKPACKURL;
$obj->backpackuid = $backpackuid;
$obj->autosync = 0;
$obj->password = '';
+26 -31
View File
@@ -170,33 +170,31 @@ class award_criteria_profile extends award_criteria {
}
$join = '';
$where = '';
$whereparts = array();
$sqlparams = array();
$rule = ($this->method == BADGE_CRITERIA_AGGREGATION_ANY) ? ' OR ' : ' AND ';
foreach ($this->params as $param) {
if (is_numeric($param['field'])) {
$infodata[] = " uid.fieldid = :fieldid{$param['field']} ";
$sqlparams["fieldid{$param['field']}"] = $param['field'];
// This is a custom field.
$idx = count($whereparts) + 1;
$join .= " LEFT JOIN {user_info_data} uid{$idx} ON uid{$idx}.userid = u.id AND uid{$idx}.fieldid = :fieldid{$idx} ";
$sqlparams["fieldid{$idx}"] = $param['field'];
$whereparts[] = "uid{$idx}.id IS NOT NULL";
} else {
$userdata[] = $DB->sql_isnotempty('u', "u.{$param['field']}", false, true);
// This is a field from {user} table.
$whereparts[] = $DB->sql_isnotempty('u', "u.{$param['field']}", false, true);
}
}
// Add user custom field parameters if there are any.
if (!empty($infodata)) {
$extraon = implode($rule, $infodata);
$join = " LEFT JOIN {user_info_data} uid ON uid.userid = u.id AND ({$extraon})";
}
// Add user table field parameters if there are any.
if (!empty($userdata)) {
$extraon = implode($rule, $userdata);
$where = " AND ({$extraon})";
}
$sqlparams['userid'] = $userid;
$sql = "SELECT u.* FROM {user} u " . $join . " WHERE u.id = :userid " . $where;
if ($whereparts) {
$where = " AND (" . implode($rule, $whereparts) . ")";
} else {
$where = '';
}
$sql = "SELECT 1 FROM {user} u " . $join . " WHERE u.id = :userid $where";
$overall = $DB->record_exists_sql($sql, $sqlparams);
return $overall;
@@ -212,29 +210,26 @@ class award_criteria_profile extends award_criteria {
global $DB;
$join = '';
$where = '';
$whereparts = array();
$params = array();
$rule = ($this->method == BADGE_CRITERIA_AGGREGATION_ANY) ? ' OR ' : ' AND ';
foreach ($this->params as $param) {
if (is_numeric($param['field'])) {
$infodata[] = " uid.fieldid = :fieldid{$param['field']} ";
$params["fieldid{$param['field']}"] = $param['field'];
// This is a custom field.
$idx = count($whereparts);
$join .= " LEFT JOIN {user_info_data} uid{$idx} ON uid{$idx}.userid = u.id AND uid{$idx}.fieldid = :fieldid{$idx} ";
$params["fieldid{$idx}"] = $param['field'];
$whereparts[] = "uid{$idx}.id IS NOT NULL";
} else {
$userdata[] = $DB->sql_isnotempty('u', "u.{$param['field']}", false, true);
$whereparts[] = $DB->sql_isnotempty('u', "u.{$param['field']}", false, true);
}
}
// Add user custom fields if there are any.
if (!empty($infodata)) {
$extraon = implode($rule, $infodata);
$join = " LEFT JOIN {user_info_data} uid ON uid.userid = u.id AND ({$extraon})";
}
// Add user table fields if there are any.
if (!empty($userdata)) {
$extraon = implode($rule, $userdata);
$where = " AND ({$extraon})";
if ($whereparts) {
$where = " AND (" . implode($rule, $whereparts) . ")";
} else {
$where = '';
}
return array($join, $where, $params);
}
+3 -1
View File
@@ -61,6 +61,8 @@ $PAGE->set_heading($badge->name);
$PAGE->set_title($badge->name);
$PAGE->navbar->add($badge->name);
require_capability('moodle/badges:viewbadges', $context);
echo $OUTPUT->header();
echo $OUTPUT->heading(print_badge_image($badge, $context, 'small') . ' ' . $badge->name);
@@ -75,4 +77,4 @@ echo $output->print_badge_status_box($badge);
$output->print_badge_tabs($badgeid, $context, 'overview');
echo $output->print_badge_overview($badge, $context);
echo $OUTPUT->footer();
echo $OUTPUT->footer();
+27 -2
View File
@@ -324,6 +324,11 @@ class core_badges_badgeslib_testcase extends advanced_testcase {
$criteria_overall = award_criteria::build(array('criteriatype' => BADGE_CRITERIA_TYPE_ACTIVITY, 'badgeid' => $badge->id));
$criteria_overall->save(array('agg' => BADGE_CRITERIA_AGGREGATION_ANY, 'module_'.$this->module->cmid => $this->module->cmid));
// Assert the badge will not be issued to the user as is.
$badge = new badge($this->coursebadge);
$badge->review_all_criteria();
$this->assertFalse($badge->is_issued($this->user->id));
// Set completion for forum activity.
$c = new completion_info($this->course);
$activities = $c->get_activities();
@@ -359,6 +364,11 @@ class core_badges_badgeslib_testcase extends advanced_testcase {
$ccompletion = new completion_completion(array('course' => $this->course->id, 'userid' => $this->user->id));
// Assert the badge will not be issued to the user as is.
$badge = new badge($this->coursebadge);
$badge->review_all_criteria();
$this->assertFalse($badge->is_issued($this->user->id));
// Mark course as complete.
$sink = $this->redirectEmails();
$ccompletion->mark_complete();
@@ -374,18 +384,33 @@ class core_badges_badgeslib_testcase extends advanced_testcase {
* Test badges observer when user_updated event is fired.
*/
public function test_badges_observer_profile_criteria_review() {
global $CFG, $DB;
require_once($CFG->dirroot.'/user/profile/lib.php');
// Add a custom field of textarea type.
$customprofileid = $DB->insert_record('user_info_field', array(
'shortname' => 'newfield', 'name' => 'Description of new field', 'categoryid' => 1,
'datatype' => 'textarea'));
$this->preventResetByRollback(); // Messaging is not compatible with transactions.
$badge = new badge($this->coursebadge);
$this->assertFalse($badge->is_issued($this->user->id));
$criteria_overall = award_criteria::build(array('criteriatype' => BADGE_CRITERIA_TYPE_OVERALL, 'badgeid' => $badge->id));
$criteria_overall->save(array('agg' => BADGE_CRITERIA_AGGREGATION_ANY));
$criteria_overall1 = award_criteria::build(array('criteriatype' => BADGE_CRITERIA_TYPE_PROFILE, 'badgeid' => $badge->id));
$criteria_overall1->save(array('agg' => BADGE_CRITERIA_AGGREGATION_ALL, 'field_address' => 'address', 'field_aim' => 'aim'));
$criteria_overall1->save(array('agg' => BADGE_CRITERIA_AGGREGATION_ALL, 'field_address' => 'address', 'field_aim' => 'aim',
'field_' . $customprofileid => $customprofileid));
// Assert the badge will not be issued to the user as is.
$badge = new badge($this->coursebadge);
$badge->review_all_criteria();
$this->assertFalse($badge->is_issued($this->user->id));
// Set the required fields and make sure the badge got issued.
$this->user->address = 'Test address';
$this->user->aim = '999999999';
$sink = $this->redirectEmails();
profile_save_data((object)array('id' => $this->user->id, 'profile_field_newfield' => 'X'));
user_update_user($this->user, false);
$this->assertCount(1, $sink->get_messages());
$sink->close();
+4 -2
View File
@@ -48,7 +48,7 @@ if (!in_array($sortby, array('name', 'dateissued'))) {
}
if ($sorthow != 'ASC' && $sorthow != 'DESC') {
$sorthow = 'ACS';
$sorthow = 'ASC';
}
if ($page < 0) {
@@ -75,6 +75,8 @@ if ($type == BADGE_TYPE_SITE) {
$PAGE->set_heading($title);
}
require_capability('moodle/badges:viewbadges', $PAGE->context);
$PAGE->set_title($title);
$output = $PAGE->get_renderer('core', 'badges');
@@ -103,4 +105,4 @@ if ($totalcount) {
echo $output->notification(get_string('nobadges', 'badges'));
}
echo $output->footer();
echo $output->footer();
@@ -0,0 +1,51 @@
@block @block_blog_tag @core_blog @core_tag
Feature: Adding blog tag block
In order to search blog post by tag
As a user
I need to be able to use block blog tag
Scenario: Adding block blog tag to the course
Given the following "users" exist:
| username | firstname | lastname | email |
| teacher1 | Teacher | 1 | teacher1@example.com |
| student1 | Student | 1 | student1@example.com |
And the following "courses" exist:
| fullname | shortname |
| Course 1 | c1 |
And the following "tags" exist:
| name | tagtype |
| Neverusedtag | official |
And the following "course enrolments" exist:
| user | course | role |
| teacher1 | c1 | editingteacher |
| student1 | c1 | student |
When I log in as "teacher1"
And I follow "Course 1"
And I turn editing mode on
And I add the "Blog tags" block
And I navigate to "Course blogs" node in "Current course > c1 > Participants"
And I follow "Blog about this Course"
And I set the following fields to these values:
| Entry title | Blog post from teacher |
| Blog entry body | Teacher blog post content |
| Other tags (enter tags separated by commas) | Cats, dogs |
And I press "Save changes"
And I log out
And I log in as "student1"
And I follow "Course 1"
And I navigate to "Course blogs" node in "Current course > c1 > Participants"
And I follow "Blog about this Course"
And I set the following fields to these values:
| Entry title | Blog post from student |
| Blog entry body | Student blog post content |
| Other tags (enter tags separated by commas) | DOGS, mice |
And I press "Save changes"
And I follow "c1"
Then I should see "Cats" in the "Blog tags" "block"
And I should see "dogs" in the "Blog tags" "block"
And I should see "mice" in the "Blog tags" "block"
And I click on "Cats" "link" in the "Blog tags" "block"
And I should see "Blog post from teacher"
And I should see "Teacher blog post content"
And I log out
+10 -2
View File
@@ -23,6 +23,12 @@
*/
class block_course_summary extends block_base {
/**
* @var bool Flag to indicate whether the header should be hidden or not.
*/
private $headerhidden = true;
function init() {
$this->title = get_string('pluginname', 'block_course_summary');
}
@@ -32,8 +38,10 @@ class block_course_summary extends block_base {
}
function specialization() {
if($this->page->pagetype == PAGE_COURSE_VIEW && $this->page->course->id != SITEID) {
// Page type starts with 'course-view' and the page's course ID is not equal to the site ID.
if (strpos($this->page->pagetype, PAGE_COURSE_VIEW) === 0 && $this->page->course->id != SITEID) {
$this->title = get_string('coursesummary', 'block_course_summary');
$this->headerhidden = false;
}
}
@@ -71,7 +79,7 @@ class block_course_summary extends block_base {
}
function hide_header() {
return true;
return $this->headerhidden;
}
function preferred_width() {
@@ -25,19 +25,22 @@ Feature: Course summary block used in a course
Scenario: Student can view course summary
When I log in as "student1"
And I follow "Course 1"
Then "Course/site summary" "block" should exist
And I should see "Proved the course summary block works!" in the "Course/site summary" "block"
Then "Course summary" "block" should exist
And I should see "Course summary" in the "Course summary" "block"
And I should see "Proved the course summary block works!" in the "Course summary" "block"
Scenario: Teacher can see an edit icon when edit mode is on and follow it to the course edit page
When I log in as "teacher1"
And I follow "Course 1"
And I turn editing mode on
Then I should see "Proved the course summary block works!" in the "Course/site summary" "block"
And I click on "Edit" "link" in the "Course/site summary" "block"
Then I should see "Proved the course summary block works!" in the "Course summary" "block"
And I should see "Course summary" in the "Course summary" "block"
And I click on "Edit" "link" in the "Course summary" "block"
Then I should see "Edit course settings" in the "h2" "css_element"
Scenario: Teacher can not see edit icon when edit mode is off
When I log in as "teacher1"
And I follow "Course 1"
Then I should see "Proved the course summary block works!" in the "Course/site summary" "block"
And "Edit" "link" should not exist in the "Course/site summary" "block"
Then I should see "Proved the course summary block works!" in the "Course summary" "block"
And I should see "Course summary" in the "Course summary" "block"
And "Edit" "link" should not exist in the "Course summary" "block"
@@ -16,6 +16,7 @@ Feature: Course summary block used on the frontpage
Scenario: Guest can view site summary
When I am on homepage
Then "Course/site summary" "block" should exist
And I should not see "Course summary" in the "Course/site summary" "block"
And I should see "Proved the summary block works!" in the "Course/site summary" "block"
Scenario: Admin can see an edit icon when edit mode is on and follow it to the front page settings
@@ -23,6 +24,7 @@ Feature: Course summary block used on the frontpage
And I am on homepage
And I follow "Turn editing on"
Then I should see "Proved the summary block works!" in the "Course/site summary" "block"
And I should not see "Course summary" in the "Course/site summary" "block"
And I click on "Edit" "link" in the "Course/site summary" "block"
Then I should see "Front page settings" in the "h2" "css_element"
@@ -30,4 +32,5 @@ Feature: Course summary block used on the frontpage
When I log in as "admin"
And I am on homepage
Then I should see "Proved the summary block works!" in the "Course/site summary" "block"
And I should not see "Course summary" in the "Course/site summary" "block"
And "Edit" "link" should not exist in the "Course/site summary" "block"
+17
View File
@@ -104,6 +104,23 @@ class block_html extends block_base {
return true;
}
/**
* Copy any block-specific data when copying to a new block instance.
* @param int $fromid the id number of the block instance to copy from
* @return boolean
*/
public function instance_copy($fromid) {
$fromcontext = context_block::instance($fromid);
$fs = get_file_storage();
// This extra check if file area is empty adds one query if it is not empty but saves several if it is.
if (!$fs->is_area_empty($fromcontext->id, 'block_html', 'content', 0, false)) {
$draftitemid = 0;
file_prepare_draft_area($draftitemid, $fromcontext->id, 'block_html', 'content', 0, array('subdirs' => true));
file_save_draft_area_files($draftitemid, $this->context->id, 'block_html', 'content', 0, array('subdirs' => true));
}
return true;
}
function content_is_trusted() {
global $SCRIPT;
+2
View File
@@ -31,7 +31,9 @@ class block_messages extends block_base {
global $USER, $CFG, $DB, $OUTPUT;
if (!$CFG->messaging) {
$this->content = new stdClass;
$this->content->text = '';
$this->content->footer = '';
if ($this->page->user_is_editing()) {
$this->content->text = get_string('disabled', 'message');
}
+1 -1
View File
@@ -133,7 +133,7 @@ class block_myprofile extends block_base {
if(!empty($this->config->display_phone2) && !empty($USER->phone2)) {
$this->content->text .= '<div class="myprofileitem phone2">';
$this->content->text .= get_string('phone').': ' . s($USER->phone2);
$this->content->text .= get_string('phone2').': ' . s($USER->phone2);
$this->content->text .= '</div>';
}
+2 -2
View File
@@ -34,8 +34,8 @@ $string['display_skype'] = 'Display Skype';
$string['display_yahoo'] = 'Display Yahoo';
$string['display_aim'] = 'Display AIM';
$string['display_msn'] = 'Display MSN';
$string['display_phone1'] = 'Display phone number 1';
$string['display_phone2'] = 'Display phone number 2';
$string['display_phone1'] = 'Display phone';
$string['display_phone2'] = 'Display mobile phone';
$string['display_institution'] = 'Display institution';
$string['display_address'] = 'Display address';
$string['display_firstaccess'] = 'Display first access';
+1 -1
View File
@@ -113,7 +113,7 @@ class block_navigation_renderer extends plugin_renderer_base {
} else if ($item->action instanceof action_link) {
//TODO: to be replaced with something else
$link = $item->action;
$link->text = $icon.$link->text;
$link->text = $icon.html_writer::span($link->text, 'item-content-wrap');
$link->attributes = array_merge($link->attributes, $attributes);
$content = $this->output->render($link);
$linkrendered = true;
+187 -46
View File
@@ -26,14 +26,29 @@ define('DEFAULT_NUMBER_OF_VIDEOS', 5);
class block_tag_youtube extends block_base {
/**
* @var Google_Service_Youtube
*/
protected $service = null;
function init() {
$this->title = get_string('pluginname','block_tag_youtube');
$this->config = new stdClass();
}
function applicable_formats() {
return array('tag' => true);
}
/**
* It can be configured.
*
* @return bool
*/
public function has_config() {
return true;
}
function specialization() {
$this->title = !empty($this->config->title) ? $this->config->title : get_string('pluginname', 'block_tag_youtube');
// Convert numeric categories (old YouTube API) to
@@ -60,6 +75,14 @@ class block_tag_youtube extends block_base {
return $this->content;
}
$this->content = new stdClass();
$this->content->footer = '';
if (!$this->get_service()) {
$this->content->text = $this->get_error_message();
return $this->content;
}
$text = '';
if(!empty($this->config->playlist)){
//videos from a playlist
@@ -76,31 +99,41 @@ class block_tag_youtube extends block_base {
}
}
$this->content = new stdClass;
$this->content->text = $text;
$this->content->footer = '';
return $this->content;
}
function get_videos_by_playlist(){
if (!$service = $this->get_service()) {
return $this->get_error_message();
}
$numberofvideos = DEFAULT_NUMBER_OF_VIDEOS;
if( !empty($this->config->numberofvideos)) {
$numberofvideos = $this->config->numberofvideos;
}
$request = 'http://gdata.youtube.com/feeds/api/playlists/' .
$this->config->playlist .
'?start-index=1&max-results=' .
$numberofvideos .
'&format=5';
try {
$response = $service->playlistItems->listPlaylistItems('id,snippet', array(
'playlistId' => $this->config->playlist,
'maxResults' => $numberofvideos
));
} catch (Google_Service_Exception $e) {
debugging('Google service exception: ' . $e->getMessage(), DEBUG_DEVELOPER);
return $this->get_error_message(get_string('requesterror', 'block_tag_youtube'));
}
return $this->fetch_request($request);
return $this->render_items($response);
}
function get_videos_by_tag(){
if (!$service = $this->get_service()) {
return $this->get_error_message();
}
$tagid = optional_param('id', 0, PARAM_INT); // tag id - for backware compatibility
$tag = optional_param('tag', '', PARAM_TAG); // tag
@@ -121,17 +154,26 @@ class block_tag_youtube extends block_base {
$numberofvideos = $this->config->numberofvideos;
}
$request = 'http://gdata.youtube.com/feeds/api/videos?vq=' .
$querytag .
'&start-index=1&max-results=' .
$numberofvideos .
'&format=5';
try {
$response = $service->search->listSearch('id,snippet', array(
'q' => $querytag,
'type' => 'video',
'maxResults' => $numberofvideos
));
} catch (Google_Service_Exception $e) {
debugging('Google service exception: ' . $e->getMessage(), DEBUG_DEVELOPER);
return $this->get_error_message(get_string('requesterror', 'block_tag_youtube'));
}
return $this->fetch_request($request);
return $this->render_items($response);
}
function get_videos_by_tag_and_category(){
if (!$service = $this->get_service()) {
return $this->get_error_message();
}
$tagid = optional_param('id', 0, PARAM_INT); // tag id - for backware compatibility
$tag = optional_param('tag', '', PARAM_TAG); // tag
@@ -152,19 +194,32 @@ class block_tag_youtube extends block_base {
$numberofvideos = $this->config->numberofvideos;
}
$request = 'http://gdata.youtube.com/feeds/api/videos?category=' .
$this->config->category .
'&vq=' .
$querytag .
'&start-index=1&max-results=' .
$numberofvideos .
'&format=5';
try {
$response = $service->search->listSearch('id,snippet', array(
'q' => $querytag,
'type' => 'video',
'maxResults' => $numberofvideos,
'videoCategoryId' => $this->config->category
));
} catch (Google_Service_Exception $e) {
debugging('Google service exception: ' . $e->getMessage(), DEBUG_DEVELOPER);
return $this->get_error_message(get_string('requesterror', 'block_tag_youtube'));
}
return $this->fetch_request($request);
return $this->render_items($response);
}
function fetch_request($request){
/**
* Sends a request to fetch data.
*
* @see block_tag_youtube::service
* @deprecated since Moodle 2.8.8, 2.9.2 and 3.0 MDL-49085 - please do not use this function any more.
* @param string $request
* @throws coding_exception
*/
public function fetch_request($request) {
throw new coding_exception('Sorry, this function has been deprecated in Moodle 2.8.8, 2.9.2 and 3.0. Use block_tag_youtube::get_service instead.');
$c = new curl(array('cache' => true, 'module_cache'=>'tag_youtube'));
$c->setopt(array('CURLOPT_TIMEOUT' => 3, 'CURLOPT_CONNECTTIMEOUT' => 3));
@@ -174,32 +229,118 @@ class block_tag_youtube extends block_base {
return $this->render_video_list($xml);
}
/**
* Renders the video list.
*
* @see block_tag_youtube::render_items
* @deprecated since Moodle 2.8.8, 2.9.2 and 3.0 MDL-49085 - please do not use this function any more.
* @param SimpleXMLElement $xml
* @throws coding_exception
*/
function render_video_list(SimpleXMLElement $xml){
throw new coding_exception('Sorry, this function has been deprecated in Moodle 2.8.8, 2.9.2 and 3.0. Use block_tag_youtube::render_items instead.');
}
$text = '';
$text .= '<ul class="yt-video-entry unlist img-text">';
/**
* Returns an error message.
*
* Useful when the block is not properly set or something goes wrong.
*
* @param string $message The message to display.
* @return string HTML
*/
protected function get_error_message($message = null) {
global $OUTPUT;
foreach($xml->entry as $entry){
$media = $entry->children('http://search.yahoo.com/mrss/');
$playerattrs = $media->group->player->attributes();
$url = s($playerattrs['url']);
$thumbattrs = $media->group->thumbnail[0]->attributes();
$thumbnail = s($thumbattrs['url']);
$title = s($media->group->title);
$yt = $media->children('http://gdata.youtube.com/schemas/2007');
$secattrs = $yt->duration->attributes();
$seconds = $secattrs['seconds'];
$text .= '<li>';
$text .= '<div class="clearfix">';
$text .= '<a href="'. $url . '">';
$text .= '<img alt="" class="youtube-thumb" src="'. $thumbnail .'" /></a>';
$text .= '</div><span><a href="'. $url . '">'. $title .'</a></span>';
$text .= '<div>';
$text .= format_time($seconds);
$text .= "</div></li>\n";
if (empty($message)) {
$message = get_string('apierror', 'block_tag_youtube');
}
$text .= "</ul><div class=\"clearer\"></div>\n";
return $OUTPUT->notification($message);
}
/**
* Gets the youtube service object.
*
* @return Google_Service_YouTube
*/
protected function get_service() {
global $CFG;
if (!$apikey = get_config('block_tag_youtube', 'apikey')) {
return false;
}
// Wrapped in an if in case we call different get_videos_* multiple times.
if (!isset($this->service)) {
require_once($CFG->libdir . '/google/lib.php');
$client = get_google_client();
$client->setDeveloperKey($apikey);
$client->setScopes(array(Google_Service_YouTube::YOUTUBE_READONLY));
$this->service = new Google_Service_YouTube($client);
}
return $this->service;
}
/**
* Renders the list of items.
*
* @param array $videosdata
* @return string HTML
*/
protected function render_items($videosdata) {
if (!$videosdata || empty($videosdata->items)) {
if (!empty($videosdata->error)) {
debugging('Error fetching data from youtube: ' . $videosdata->error->message, DEBUG_DEVELOPER);
}
return '';
}
// If we reach that point we already know that the API key is set.
$service = $this->get_service();
$text = html_writer::start_tag('ul', array('class' => 'yt-video-entry unlist img-text'));
foreach ($videosdata->items as $video) {
// Link to the video included in the playlist if listing a playlist.
if (!empty($video->snippet->resourceId)) {
$id = $video->snippet->resourceId->videoId;
$playlist = '&list=' . $video->snippet->playlistId;
} else {
$id = $video->id->videoId;
$playlist = '';
}
$thumbnail = $video->snippet->getThumbnails()->getDefault();
$url = 'http://www.youtube.com/watch?v=' . $id . $playlist;
$videodetails = $service->videos->listVideos('id,contentDetails', array('id' => $id));
if ($videodetails && !empty($videodetails->items)) {
// We fetch by id so we just use the first one.
$details = $videodetails->items[0];
$start = new DateTime('@0');
$start->add(new DateInterval($details->contentDetails->duration));
$seconds = $start->format('U');
}
$text .= html_writer::start_tag('li');
$imgattrs = array('class' => 'youtube-thumb', 'src' => $thumbnail->url, 'alt' => $video->snippet->title);
$thumbhtml = html_writer::empty_tag('img', $imgattrs);
$link = html_writer::tag('a', $thumbhtml, array('href' => $url));
$text .= html_writer::tag('div', $link, array('class' => 'clearfix'));
$text .= html_writer::tag('span', html_writer::tag('a', $video->snippet->title, array('href' => $url)));
if (!empty($seconds)) {
$text .= html_writer::tag('div', format_time($seconds));
}
$text .= html_writer::end_tag('li');
}
$text .= html_writer::end_tag('ul');
return $text;
}
@@ -23,6 +23,9 @@
*/
$string['anycategory'] = 'Any category';
$string['apierror'] = 'The YouTube API key is not set. Contact your administrator.';
$string['apikey'] = 'API key';
$string['apikeyinfo'] = 'Get a <a href="https://developers.google.com/youtube/v3/getting-started">Google API key</a> for your Moodle site.';
$string['autosvehicles'] = 'Autos &amp; Vehicles';
$string['category'] = 'Category';
$string['comedy'] = 'Comedy';
@@ -38,8 +41,9 @@ $string['newspolitics'] = 'News &amp; Politics';
$string['numberofvideos'] = 'Number of videos';
$string['peopleblogs'] = 'People &amp; Blogs';
$string['petsanimals'] = 'Pets &amp; Animals';
$string['pluginname'] = 'Youtube';
$string['pluginname'] = 'YouTube';
$string['requesterror'] = 'Data could not be obtained from the server. Contact your administrator if the problem persists.';
$string['scienceandtech'] = 'Science &amp; Tech';
$string['sports'] = 'Sports';
$string['tag_youtube:addinstance'] = 'Add a new youtube block';
$string['tag_youtube:addinstance'] = 'Add a new YouTube block';
$string['travel'] = 'Travel &amp; Places';
+30
View File
@@ -0,0 +1,30 @@
<?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/>.
/**
* Settings for the RSS client block.
*
* @package block_tag_youtube
* @copyright 2015 David Monllao
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
defined('MOODLE_INTERNAL') || die;
if ($ADMIN->fulltree) {
$settings->add(new admin_setting_configtext('block_tag_youtube/apikey', get_string('apikey', 'block_tag_youtube'),
get_string('apikeyinfo', 'block_tag_youtube'), '', PARAM_RAW_TRIMMED, 40));
}
+8
View File
@@ -0,0 +1,8 @@
This files describes API changes in the block tag_youtube code.
=== 2.8.8 ===
* Due to the final YouTube API v2.0 deprecation we needed to adapt the current
code to YouTube Data API v3. block_tag_youtube::fetch_request and
block_tag_youtube::render_video_list have been deprecated as they can not be
used any more.
+1 -1
View File
@@ -24,6 +24,6 @@
defined('MOODLE_INTERNAL') || die();
$plugin->version = 2014111000; // The current plugin version (Date: YYYYMMDDXX)
$plugin->version = 2014111001; // The current plugin version (Date: YYYYMMDDXX)
$plugin->requires = 2014110400; // Requires this Moodle version
$plugin->component = 'block_tag_youtube'; // Full name of the plugin (used for diagnostics)
@@ -0,0 +1,64 @@
@block @block_tags @core_tag
Feature: Block tags displaying course tags
In order to tag courses
As a user
I need to be able to use the block tags
Background:
Given the following "users" exist:
| username | firstname | lastname | email |
| 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 |
| Course 1 | c1 |
And the following "tags" exist:
| name | tagtype |
| Neverusedtag | official |
And the following "course enrolments" exist:
| user | course | role |
| teacher1 | c1 | editingteacher |
| student1 | c1 | student |
| student2 | c1 | student |
And I log in as "admin"
And I set the following administration settings values:
| Show course tags | 1 |
And I log out
Scenario: Add Tags block to tag courses in a course
When I log in as "teacher1"
And I follow "Course 1"
And I turn editing mode on
And I add the "Tags" block
And I log out
And I log in as "student1"
And I follow "Course 1"
And I should not see "Neverusedtag" in the "Tags" "block"
And I click on "more..." "link" in the "Tags" "block"
And I should not see "Neverusedtag"
And I follow "c1"
And I set the field "coursetag_new_tag" to "Dogs, Mice"
And I press "Add"
And I should see "Dogs" in the "Tags" "block"
And I should see "Mice" in the "Tags" "block"
And I log out
And I log in as "student2"
And I follow "Course 1"
And I should see "Dogs" in the "Tags" "block"
And I set the field "coursetag_new_tag" to "Cats, Dogs"
And I press "Add"
And I should see "Dogs" in the "Tags" "block"
And I should see "Cats" in the "Tags" "block"
And I click on "more..." "link" in the "Tags" "block"
And "Cats" "link" should appear before "Dogs" "link"
And "Dogs" "link" should appear before "Mice" "link"
And I follow "My tags"
And I should see "Dogs"
And I should see "Cats"
And I should not see "Mice"
And I follow "All tags"
And I follow "Popularity"
And "Mice" "link" should appear before "Dogs" "link"
And I should not see "Neverusedtag"
And I log out
+56
View File
@@ -0,0 +1,56 @@
@block @block_tags @core_tag
Feature: Block tags displaying tag cloud
In order to view system tags
As a user
I need to be able to use the block tags
Background:
Given the following "users" exist:
| username | firstname | lastname | email |
| teacher1 | Teacher | 1 | teacher1@example.com |
| student1 | Student | 1 | student1@example.com |
And the following "courses" exist:
| fullname | shortname |
| Course 1 | c1 |
And the following "tags" exist:
| name | tagtype |
| Neverusedtag | official |
And the following "course enrolments" exist:
| user | course | role |
| teacher1 | c1 | editingteacher |
| student1 | c1 | student |
And I log in as "teacher1"
And I navigate to "Edit profile" node in "My profile settings"
And I expand all fieldsets
And I set the field "Enter tags separated by commas" to "Dogs, Cats"
And I press "Update profile"
And I log out
Scenario: Add Tags block on a front page
When I log in as "admin"
And I am on site homepage
And I follow "Turn editing on"
And I add the "Tags" block
And I log out
And I am on site homepage
Then I should see "Dogs" in the "Tags" "block"
And I should see "Cats" in the "Tags" "block"
And I should not see "Neverusedtag" in the "Tags" "block"
And I click on "Dogs" "link" in the "Tags" "block"
And I should see "Log in to the site" in the ".breadcrumb" "css_element"
Scenario: Add Tags block in a course
When I log in as "teacher1"
And I follow "Course 1"
And I turn editing mode on
And I add the "Tags" block
And I log out
And I log in as "student1"
And I follow "Course 1"
Then I should see "Dogs" in the "Tags" "block"
And I should see "Cats" in the "Tags" "block"
And I should not see "Neverusedtag" in the "Tags" "block"
And I click on "Dogs" "link" in the "Tags" "block"
And I should see "Users tagged with \"Dogs\": 1"
And I should see "Teacher 1"
And I log out
@@ -24,7 +24,6 @@ Feature: Allowed blocks controls
Then I should see "Activities" in the "Activities" "block"
And I should see "Course completion status" in the "Course completion status" "block"
@javascript
Scenario: Blocks can not be added when the admin restricts the permissions
Given I log in as "admin"
And I set the following system permissions of "Teacher" role:
+4
View File
@@ -26,6 +26,7 @@
require_once(dirname(dirname(__FILE__)).'/config.php');
require_once('lib.php');
require_once('locallib.php');
require_once($CFG->dirroot .'/comment/lib.php');
$action = required_param('action', PARAM_ALPHA);
$id = optional_param('entryid', 0, PARAM_INT);
@@ -110,6 +111,9 @@ $output = $PAGE->get_renderer('blog');
$strblogs = get_string('blogs', 'blog');
if ($action === 'delete') {
// Init comment JS strings.
comment::init();
if (empty($entry->id)) {
print_error('wrongentryid', 'blog');
}
+2 -2
View File
@@ -341,8 +341,8 @@ class cachestore_file extends cache_store implements cache_is_key_aware, cache_i
$maxtime = cache::now() - $ttl;
}
$readfile = false;
if ($this->prescan && array_key_exists($key, $this->keys)) {
if (!$ttl || $this->keys[$filename] >= $maxtime && file_exists($file)) {
if ($this->prescan && array_key_exists($filename, $this->keys)) {
if ((!$ttl || $this->keys[$filename] >= $maxtime) && file_exists($file)) {
$readfile = true;
} else {
$this->delete($key);
+30
View File
@@ -44,4 +44,34 @@ class cachestore_file_test extends cachestore_tests {
protected function get_class_name() {
return 'cachestore_file';
}
/**
* Testing cachestore_file::get with prescan enabled and with
* deleting the cache between the prescan and the call to get.
*
* The deleting of cache simulates some other process purging
* the cache.
*/
public function test_cache_get_with_prescan_and_purge() {
global $CFG;
$definition = cache_definition::load_adhoc(cache_store::MODE_REQUEST, 'cachestore_file', 'phpunit_test');
$name = 'File test';
$path = make_cache_directory('cachestore_file_test');
$cache = new cachestore_file($name, array('path' => $path, 'prescan' => true));
$cache->initialise($definition);
$cache->set('testing', 'value');
$path = make_cache_directory('cachestore_file_test');
$cache = new cachestore_file($name, array('path' => $path, 'prescan' => true));
$cache->initialise($definition);
// Let's pretend that some other process purged caches.
remove_dir($CFG->cachedir.'/cachestore_file_test', true);
make_cache_directory('cachestore_file_test');
$cache->get('testing');
}
}
+151
View File
@@ -1840,4 +1840,155 @@ class core_cache_testcase extends advanced_testcase {
$this->assertEquals('A', $cache->phpunit_static_acceleration_get('a'));
$this->assertEquals('A', $cache->get('a'));
}
public function test_performance_debug() {
global $CFG;
$this->resetAfterTest(true);
$CFG->perfdebug = 15;
$instance = cache_config_testing::instance();
$applicationid = 'phpunit/applicationperf';
$instance->phpunit_add_definition($applicationid, array(
'mode' => cache_store::MODE_APPLICATION,
'component' => 'phpunit',
'area' => 'applicationperf'
));
$sessionid = 'phpunit/sessionperf';
$instance->phpunit_add_definition($sessionid, array(
'mode' => cache_store::MODE_SESSION,
'component' => 'phpunit',
'area' => 'sessionperf'
));
$requestid = 'phpunit/requestperf';
$instance->phpunit_add_definition($requestid, array(
'mode' => cache_store::MODE_REQUEST,
'component' => 'phpunit',
'area' => 'requestperf'
));
$application = cache::make('phpunit', 'applicationperf');
$session = cache::make('phpunit', 'sessionperf');
$request = cache::make('phpunit', 'requestperf');
// Check that no stats are recorded for these definitions yet.
$stats = cache_helper::get_stats();
$this->assertArrayNotHasKey($applicationid, $stats);
$this->assertArrayHasKey($sessionid, $stats); // Session cache sets a key on construct.
$this->assertArrayNotHasKey($requestid, $stats);
// Check that stores register misses.
$this->assertFalse($application->get('missMe'));
$this->assertFalse($application->get('missMe'));
$this->assertFalse($session->get('missMe'));
$this->assertFalse($session->get('missMe'));
$this->assertFalse($session->get('missMe'));
$this->assertFalse($request->get('missMe'));
$this->assertFalse($request->get('missMe'));
$this->assertFalse($request->get('missMe'));
$this->assertFalse($request->get('missMe'));
$endstats = cache_helper::get_stats();
$this->assertEquals(2, $endstats[$applicationid]['cachestore_file']['misses']);
$this->assertEquals(0, $endstats[$applicationid]['cachestore_file']['hits']);
$this->assertEquals(0, $endstats[$applicationid]['cachestore_file']['sets']);
$this->assertEquals(3, $endstats[$sessionid]['cachestore_session']['misses']);
$this->assertEquals(0, $endstats[$sessionid]['cachestore_session']['hits']);
$this->assertEquals(1, $endstats[$sessionid]['cachestore_session']['sets']);
$this->assertEquals(4, $endstats[$requestid]['cachestore_static']['misses']);
$this->assertEquals(0, $endstats[$requestid]['cachestore_static']['hits']);
$this->assertEquals(0, $endstats[$requestid]['cachestore_static']['sets']);
$startstats = cache_helper::get_stats();
// Check that stores register sets.
$this->assertTrue($application->set('setMe1', 1));
$this->assertTrue($application->set('setMe2', 2));
$this->assertTrue($session->set('setMe1', 1));
$this->assertTrue($session->set('setMe2', 2));
$this->assertTrue($session->set('setMe3', 3));
$this->assertTrue($request->set('setMe1', 1));
$this->assertTrue($request->set('setMe2', 2));
$this->assertTrue($request->set('setMe3', 3));
$this->assertTrue($request->set('setMe4', 4));
$endstats = cache_helper::get_stats();
$this->assertEquals(0, $endstats[$applicationid]['cachestore_file']['misses'] -
$startstats[$applicationid]['cachestore_file']['misses']);
$this->assertEquals(0, $endstats[$applicationid]['cachestore_file']['hits'] -
$startstats[$applicationid]['cachestore_file']['hits']);
$this->assertEquals(2, $endstats[$applicationid]['cachestore_file']['sets'] -
$startstats[$applicationid]['cachestore_file']['sets']);
$this->assertEquals(0, $endstats[$sessionid]['cachestore_session']['misses'] -
$startstats[$sessionid]['cachestore_session']['misses']);
$this->assertEquals(0, $endstats[$sessionid]['cachestore_session']['hits'] -
$startstats[$sessionid]['cachestore_session']['hits']);
$this->assertEquals(3, $endstats[$sessionid]['cachestore_session']['sets'] -
$startstats[$sessionid]['cachestore_session']['sets']);
$this->assertEquals(0, $endstats[$requestid]['cachestore_static']['misses'] -
$startstats[$requestid]['cachestore_static']['misses']);
$this->assertEquals(0, $endstats[$requestid]['cachestore_static']['hits'] -
$startstats[$requestid]['cachestore_static']['hits']);
$this->assertEquals(4, $endstats[$requestid]['cachestore_static']['sets'] -
$startstats[$requestid]['cachestore_static']['sets']);
$startstats = cache_helper::get_stats();
// Check that stores register hits.
$this->assertEquals($application->get('setMe1'), 1);
$this->assertEquals($application->get('setMe2'), 2);
$this->assertEquals($session->get('setMe1'), 1);
$this->assertEquals($session->get('setMe2'), 2);
$this->assertEquals($session->get('setMe3'), 3);
$this->assertEquals($request->get('setMe1'), 1);
$this->assertEquals($request->get('setMe2'), 2);
$this->assertEquals($request->get('setMe3'), 3);
$this->assertEquals($request->get('setMe4'), 4);
$endstats = cache_helper::get_stats();
$this->assertEquals(0, $endstats[$applicationid]['cachestore_file']['misses'] -
$startstats[$applicationid]['cachestore_file']['misses']);
$this->assertEquals(2, $endstats[$applicationid]['cachestore_file']['hits'] -
$startstats[$applicationid]['cachestore_file']['hits']);
$this->assertEquals(0, $endstats[$applicationid]['cachestore_file']['sets'] -
$startstats[$applicationid]['cachestore_file']['sets']);
$this->assertEquals(0, $endstats[$sessionid]['cachestore_session']['misses'] -
$startstats[$sessionid]['cachestore_session']['misses']);
$this->assertEquals(3, $endstats[$sessionid]['cachestore_session']['hits'] -
$startstats[$sessionid]['cachestore_session']['hits']);
$this->assertEquals(0, $endstats[$sessionid]['cachestore_session']['sets'] -
$startstats[$sessionid]['cachestore_session']['sets']);
$this->assertEquals(0, $endstats[$requestid]['cachestore_static']['misses'] -
$startstats[$requestid]['cachestore_static']['misses']);
$this->assertEquals(4, $endstats[$requestid]['cachestore_static']['hits'] -
$startstats[$requestid]['cachestore_static']['hits']);
$this->assertEquals(0, $endstats[$requestid]['cachestore_static']['sets'] -
$startstats[$requestid]['cachestore_static']['sets']);
$startstats = cache_helper::get_stats();
// Check that stores register through get_many.
$application->get_many(array('setMe1', 'setMe2'));
$session->get_many(array('setMe1', 'setMe2', 'setMe3'));
$request->get_many(array('setMe1', 'setMe2', 'setMe3', 'setMe4'));
$endstats = cache_helper::get_stats();
$this->assertEquals(0, $endstats[$applicationid]['cachestore_file']['misses'] -
$startstats[$applicationid]['cachestore_file']['misses']);
$this->assertEquals(2, $endstats[$applicationid]['cachestore_file']['hits'] -
$startstats[$applicationid]['cachestore_file']['hits']);
$this->assertEquals(0, $endstats[$applicationid]['cachestore_file']['sets'] -
$startstats[$applicationid]['cachestore_file']['sets']);
$this->assertEquals(0, $endstats[$sessionid]['cachestore_session']['misses'] -
$startstats[$sessionid]['cachestore_session']['misses']);
$this->assertEquals(3, $endstats[$sessionid]['cachestore_session']['hits'] -
$startstats[$sessionid]['cachestore_session']['hits']);
$this->assertEquals(0, $endstats[$sessionid]['cachestore_session']['sets'] -
$startstats[$sessionid]['cachestore_session']['sets']);
$this->assertEquals(0, $endstats[$requestid]['cachestore_static']['misses'] -
$startstats[$requestid]['cachestore_static']['misses']);
$this->assertEquals(4, $endstats[$requestid]['cachestore_static']['hits'] -
$startstats[$requestid]['cachestore_static']['hits']);
$this->assertEquals(0, $endstats[$requestid]['cachestore_static']['sets'] -
$startstats[$requestid]['cachestore_static']['sets']);
}
}
+5 -1
View File
@@ -189,10 +189,14 @@ foreach($events as $event) {
$ev->add_property('class', 'PUBLIC'); // PUBLIC / PRIVATE / CONFIDENTIAL
$ev->add_property('last-modified', Bennu::timestamp_to_datetime($event->timemodified));
$ev->add_property('dtstamp', Bennu::timestamp_to_datetime()); // now
$ev->add_property('dtstart', Bennu::timestamp_to_datetime($event->timestart)); // when event starts
if ($event->timeduration > 0) {
//dtend is better than duration, because it works in Microsoft Outlook and works better in Korganizer
$ev->add_property('dtstart', Bennu::timestamp_to_datetime($event->timestart)); // when event starts.
$ev->add_property('dtend', Bennu::timestamp_to_datetime($event->timestart + $event->timeduration));
} else {
// When no duration is present, ie an all day event, VALUE should be date instead of time and dtend = dtstart + 1 day.
$ev->add_property('dtstart', Bennu::timestamp_to_date($event->timestart), array('value' => 'DATE')); // All day event.
$ev->add_property('dtend', Bennu::timestamp_to_date($event->timestart + DAYSECS), array('value' => 'DATE')); // All day event.
}
if ($event->courseid != 0) {
$coursecontext = context_course::instance($event->courseid);
+10 -9
View File
@@ -173,6 +173,8 @@ class core_calendar_external extends external_api {
// Let us findout courses that we can return events from.
if (!$hassystemcap) {
$courses = enrol_get_my_courses('id');
$courses = array_keys($courses);
foreach ($params['events']['courseids'] as $id) {
try {
$context = context_course::instance($id);
@@ -185,7 +187,6 @@ class core_calendar_external extends external_api {
'warningcode' => 'nopermissions',
'message' => 'No access rights in course context '.$e->getMessage().$e->getTraceAsString()
);
continue;
}
}
} else {
@@ -221,21 +222,21 @@ class core_calendar_external extends external_api {
$funcparam['courses'][] = $SITE->id;
}
// Event list does not check visibility and permissions, we'll check that later.
$eventlist = calendar_get_events($params['options']['timestart'], $params['options']['timeend'], $funcparam['users'], $funcparam['groups'],
$funcparam['courses'], true, $params['options']['ignorehidden']);
// WS expects arrays.
$events = array();
foreach ($eventlist as $id => $event) {
$events[$id] = (array) $event;
}
// We need to get events asked for eventids.
$eventsbyid = calendar_get_events_by_id($params['events']['eventids']);
foreach ($eventsbyid as $eventid => $eventobj) {
if ($eventsbyid = calendar_get_events_by_id($params['events']['eventids'])) {
$eventlist += $eventsbyid;
}
foreach ($eventlist as $eventid => $eventobj) {
$event = (array) $eventobj;
if (isset($events[$eventid])) {
continue;
}
if ($hassystemcap) {
// User can see everything, no further check is needed.
$events[$eventid] = $event;
+1 -1
View File
@@ -701,7 +701,7 @@ class core_calendar_renderer extends plugin_renderer_base {
if (empty($subscriptions)) {
$cell = new html_table_cell(get_string('nocalendarsubscriptions', 'calendar'));
$cell->colspan = 4;
$cell->colspan = 5;
$table->data[] = new html_table_row(array($cell));
}
$strnever = new lang_string('never', 'calendar');
+6 -2
View File
@@ -41,8 +41,6 @@
require_once('../config.php');
require_once($CFG->dirroot.'/calendar/lib.php');
require_sesskey();
$var = required_param('var', PARAM_ALPHA);
$return = clean_param(base64_decode(required_param('return', PARAM_RAW)), PARAM_LOCALURL);
$courseid = optional_param('id', -1, PARAM_INT);
@@ -51,6 +49,12 @@ if ($courseid != -1) {
} else {
$return = new moodle_url($return);
}
if (!confirm_sesskey()) {
// Do not call require_sesskey() since this page may be accessed without session (for example by bots).
redirect($return);
}
$url = new moodle_url('/calendar/set.php', array('return'=>base64_encode($return->out_as_local_url(false)), 'course' => $courseid, 'var'=>$var, 'sesskey'=>sesskey()));
$PAGE->set_url($url);
$PAGE->set_context(context_system::instance());
+31
View File
@@ -363,6 +363,37 @@ class core_calendar_externallib_testcase extends externallib_advanced_testcase {
$events = external_api::clean_returnvalue(core_calendar_external::get_calendar_events_returns(), $events);
$this->assertEquals(1, count($events['events'])); // site.
$this->assertEquals(0, count($events['warnings']));
// Try getting a course event by its id.
$paramevents = array ('eventids' => array($courseevent->id));
$events = core_calendar_external::get_calendar_events($paramevents, $options);
$events = external_api::clean_returnvalue(core_calendar_external::get_calendar_events_returns(), $events);
$this->assertEquals(1, count($events['events']));
$this->assertEquals(0, count($events['warnings']));
// Now, create an activity event.
$this->setAdminUser();
$nexttime = time() + DAYSECS;
$assign = $this->getDataGenerator()->create_module('assign', array('course' => $course->id, 'duedate' => $nexttime));
$this->setUser($user);
$paramevents = array ('courseids' => array($course->id));
$options = array ('siteevents' => true, 'userevents' => true, 'timeend' => time() + WEEKSECS);
$events = core_calendar_external::get_calendar_events($paramevents, $options);
$events = external_api::clean_returnvalue(core_calendar_external::get_calendar_events_returns(), $events);
$this->assertCount(5, $events['events']);
// Hide the assignment.
set_coursemodule_visible($assign->cmid, 0);
// Empty all the caches that may be affected by this change.
accesslib_clear_all_caches_for_unit_testing();
course_modinfo::clear_instance_cache();
$events = core_calendar_external::get_calendar_events($paramevents, $options);
$events = external_api::clean_returnvalue(core_calendar_external::get_calendar_events_returns(), $events);
// Expect one less.
$this->assertCount(4, $events['events']);
}
/**
+2 -7
View File
@@ -78,13 +78,8 @@ class core_calendar_lib_testcase extends advanced_testcase {
global $CFG;
require_once($CFG->dirroot . '/lib/cronlib.php');
// Moodle ICal URL (moodle.org events).
$presetwhat = 'all';
$presettime = 'recentupcoming';
$userid = 1;
$authtoken = 'a8bcfee2fb868a05357f650bd65dc0699b026524';
$subscriptionurl = 'https://moodle.org/calendar/export_execute.php'
. '?preset_what='.$presetwhat.'&preset_time='.$presettime.'&userid='.$userid.'&authtoken='.$authtoken;
// ICal URL from external test repo.
$subscriptionurl = $this->getExternalTestFileUrl('/ical.ics');
$subscription = new stdClass();
$subscription->eventtype = 'site';
+19 -10
View File
@@ -256,15 +256,17 @@ function cohort_get_available_cohorts($currentcontext, $withmembers = 0, $offset
$groupbysql = '';
$havingsql = '';
if ($withmembers) {
$groupbysql = " GROUP BY $fieldssql";
$fieldssql .= ', s.memberscnt';
$subfields = "c.id, COUNT(DISTINCT cm.userid) AS memberscnt";
$groupbysql = " GROUP BY c.id";
$fromsql = " LEFT JOIN {cohort_members} cm ON cm.cohortid = c.id ";
$fieldssql .= ', COUNT(DISTINCT cm.userid) AS memberscnt';
if (in_array($withmembers,
array(COHORT_COUNT_ENROLLED_MEMBERS, COHORT_WITH_ENROLLED_MEMBERS_ONLY, COHORT_WITH_NOTENROLLED_MEMBERS_ONLY))) {
list($esql, $params2) = get_enrolled_sql($currentcontext);
$fromsql .= " LEFT JOIN ($esql) u ON u.id = cm.userid ";
$params = array_merge($params2, $params);
$fieldssql .= ', COUNT(DISTINCT u.id) AS enrolledcnt';
$fieldssql .= ', s.enrolledcnt';
$subfields .= ', COUNT(DISTINCT u.id) AS enrolledcnt';
}
if ($withmembers == COHORT_WITH_MEMBERS_ONLY) {
$havingsql = " HAVING COUNT(DISTINCT cm.userid) > 0";
@@ -280,13 +282,20 @@ function cohort_get_available_cohorts($currentcontext, $withmembers = 0, $offset
$params = array_merge($params, $searchparams);
}
$sql = "SELECT $fieldssql
FROM {cohort} c
$fromsql
WHERE $wheresql
$groupbysql
$havingsql
ORDER BY c.name, c.idnumber";
if ($withmembers) {
$sql = "SELECT " . str_replace('c.', 'cohort.', $fieldssql) . "
FROM {cohort} cohort
JOIN (SELECT $subfields
FROM {cohort} c $fromsql
WHERE $wheresql $groupbysql $havingsql
) s ON cohort.id = s.id
ORDER BY cohort.name, cohort.idnumber";
} else {
$sql = "SELECT $fieldssql
FROM {cohort} c $fromsql
WHERE $wheresql
ORDER BY c.name, c.idnumber";
}
return $DB->get_records_sql($sql, $params, $offset, $limit);
}
@@ -232,6 +232,20 @@ abstract class completion_criteria extends data_object {
*/
abstract public function get_details($completion);
/**
* Return pix_icon for display in reports.
*
* @param string $alt The alt text to use for the icon
* @param array $attributes html attributes
* @return pix_icon
*/
public function get_icon($alt, array $attributes = null) {
global $COMPLETION_CRITERIA_TYPES;
$criteriatype = $COMPLETION_CRITERIA_TYPES[$this->criteriatype];
return new pix_icon('i/'.$criteriatype, $alt, 'moodle', $attributes);
}
/**
* Return criteria status text for display in reports
*
@@ -287,4 +287,15 @@ class completion_criteria_activity extends completion_criteria {
return $details;
}
/**
* Return pix_icon for display in reports.
*
* @param string $alt The alt text to use for the icon
* @param array $attributes html attributes
* @return pix_icon
*/
public function get_icon($alt, array $attributes = null) {
return new pix_icon('icon', $alt, 'mod_'.$this->module, $attributes);
}
}
@@ -202,4 +202,15 @@ class completion_criteria_date extends completion_criteria {
return $details;
}
/**
* Return pix_icon for display in reports.
*
* @param string $alt The alt text to use for the icon
* @param array $attributes html attributes
* @return pix_icon
*/
public function get_icon($alt, array $attributes = null) {
return new pix_icon('i/calendar', $alt, 'moodle', $attributes);
}
}
@@ -248,4 +248,15 @@ class completion_criteria_grade extends completion_criteria {
return $details;
}
/**
* Return pix_icon for display in reports.
*
* @param string $alt The alt text to use for the icon
* @param array $attributes html attributes
* @return pix_icon
*/
public function get_icon($alt, array $attributes = null) {
return new pix_icon('i/grades', $alt, 'moodle', $attributes);
}
}
@@ -149,4 +149,15 @@ class completion_criteria_self extends completion_criteria {
return $details;
}
/**
* Return pix_icon for display in reports.
*
* @param string $alt The alt text to use for the icon
* @param array $attributes html attributes
* @return pix_icon
*/
public function get_icon($alt, array $attributes = null) {
return new pix_icon('i/completion_self', $alt, 'moodle', $attributes);
}
}
@@ -131,4 +131,15 @@ class completion_criteria_unenrol extends completion_criteria {
$details['status'] = '';
return $details;
}
/**
* Return pix_icon for display in reports.
*
* @param string $alt The alt text to use for the icon
* @param array $attributes html attributes
* @return pix_icon
*/
public function get_icon($alt, array $attributes = null) {
return new pix_icon('i/user', $alt, 'moodle', $attributes);
}
}
+40 -3
View File
@@ -27,7 +27,8 @@
require_once(__DIR__ . '/../../../lib/behat/behat_base.php');
use Behat\Behat\Context\Step\Given as Given,
use Behat\Behat\Context\Step\Given,
Behat\Behat\Context\Step\Then,
Behat\Mink\Exception\ElementNotFoundException as ElementNotFoundException;
/**
@@ -56,7 +57,7 @@ class behat_completion extends behat_base {
return array(
new Given('I go to the current course activity completion report'),
new Given('I hover "' . $this->escape($xpath) . '" "xpath_element"')
new Then('"' . $this->escape($xpath) . '" "xpath_element" should exist')
);
}
@@ -75,7 +76,7 @@ class behat_completion extends behat_base {
"/descendant::img[contains(@title, $titleliteral)]";
return array(
new Given('I go to the current course activity completion report'),
new Given('I hover "' . $this->escape($xpath) . '" "xpath_element"')
new Then('"' . $this->escape($xpath) . '" "xpath_element" should exist')
);
return $steps;
@@ -121,4 +122,40 @@ class behat_completion extends behat_base {
new Given('I press "'.get_string('savechanges').'"')
);
}
/**
* Checks if the activity with specified name is maked as complete.
*
* @Given /^the "(?P<activityname_string>(?:[^"]|\\")*)" "(?P<activitytype_string>(?:[^"]|\\")*)" activity with "(manual|auto)" completion should be marked as complete$/
* @return array
*/
public function activity_marked_as_complete($activityname, $activitytype, $completiontype) {
if ($completiontype == "manual") {
$imgalttext = get_string("completion-alt-manual-y", 'core_completion', $activityname);
} else {
$imgalttext = get_string("completion-alt-auto-y", 'core_completion', $activityname);
}
$csselementforactivitytype = "li.modtype_".strtolower($activitytype);
return new Given('"//img[contains(@alt, \''.$imgalttext.'\')]" "xpath_element" ' .
'should exist in the "'.$csselementforactivitytype.'" "css_element"');
}
/**
* Checks if the activity with specified name is maked as complete.
*
* @Given /^the "(?P<activityname_string>(?:[^"]|\\")*)" "(?P<activitytype_string>(?:[^"]|\\")*)" activity with "(manual|auto)" completion should be marked as not complete$/
* @return array
*/
public function activity_marked_as_not_complete($activityname, $activitytype, $completiontype) {
if ($completiontype == "manual") {
$imgalttext = get_string("completion-alt-manual-n", 'core_completion', $activityname);
} else {
$imgalttext = get_string("completion-alt-auto-n", 'core_completion', $activityname);
}
$csselementforactivitytype = "li.modtype_".strtolower($activitytype);
return new Given('"//img[contains(@alt, \''.$imgalttext.'\')]" "xpath_element" ' .
'should exist in the "'.$csselementforactivitytype.'" "css_element"');
}
}
@@ -71,10 +71,10 @@ Feature: Restrict sections availability through completion or grade conditions
And I expand all fieldsets
And I click on "Add restriction..." "button"
And I click on "Grade" "button" in the "Add restriction..." "dialogue"
And I click on "min" "checkbox"
And I set the following fields to these values:
| id | Grade assignment |
| minval | 20 |
| id | Grade assignment |
| min | 1 |
| minval | 20 |
And I press "Save changes"
And I log out
When I log in as "student1"
+2 -2
View File
@@ -484,8 +484,8 @@ $CFG->admin = 'admin';
// $CFG->supportuserid = -20;
//
// Moodle 2.7 introduces a locking api for critical tasks (e.g. cron).
// The default locking system to use is DB locking for MySQL and Postgres, and File
// locking for Oracle and SQLServer. If $CFG->preventfilelocking is set, then the default
// The default locking system to use is DB locking for Postgres, and file locking for
// MySQL, Oracle and SQLServer. If $CFG->preventfilelocking is set, then the default
// will always be DB locking. It can be manually set to one of the lock
// factory classes listed below, or one of your own custom classes implementing the
// \core\lock\lock_factory interface.
+1 -1
View File
@@ -1130,7 +1130,7 @@ class core_course_management_renderer extends plugin_renderer_base {
$totalpages = ceil($totalcourses / $perpage);
if ($showtotals) {
if ($totalpages == 0) {
$str = get_string('nocoursesfound', 'moodle', $search);
$str = get_string('nocoursesfound', 'moodle', s($search));
} else if ($totalpages == 1) {
$str = get_string('showingacourses', 'moodle', $totalcourses);
} else {
+3 -2
View File
@@ -76,11 +76,12 @@ $strdeletecoursecheck = get_string("deletecoursecheck");
$message = "{$strdeletecoursecheck}<br /><br />{$coursefullname} ({$courseshortname})";
$continueurl = new moodle_url('/course/delete.php', array('id' => $course->id, 'delete' => md5($course->timemodified)));
$continuebutton = new single_button($continueurl, get_string('delete'), 'post');
$PAGE->navbar->add($strdeletecheck);
$PAGE->set_title("$SITE->shortname: $strdeletecheck");
$PAGE->set_heading($SITE->fullname);
echo $OUTPUT->header();
echo $OUTPUT->confirm($message, $continueurl, $categoryurl);
echo $OUTPUT->confirm($message, $continuebutton, $categoryurl);
echo $OUTPUT->footer();
exit;
exit;
+1 -7
View File
@@ -338,16 +338,10 @@ class format_singleactivity extends format_base {
* @return bool|null (null if the check is not possible)
*/
public function activity_has_subtypes() {
global $CFG;
if (!($modname = $this->get_activitytype())) {
return null;
}
$libfile = "$CFG->dirroot/mod/$modname/lib.php";
if (!file_exists($libfile)) {
return null;
}
include_once($libfile);
return function_exists($modname. '_get_types');
return component_callback('mod_' . $modname, 'get_types', array(), MOD_SUBTYPE_NO_CHILDREN) !== MOD_SUBTYPE_NO_CHILDREN;
}
/**
-22
View File
@@ -224,17 +224,6 @@ function edit_module_post_actions($moduleinfo, $course) {
// Use updated grade_item.
$grade_item = $items[$itemid];
}
$gradecategory = $grade_item->get_parent_category();
if (!empty($moduleinfo->add)) {
if (grade_category::aggregation_uses_aggregationcoef($gradecategory->aggregation)) {
if ($gradecategory->aggregation == GRADE_AGGREGATE_WEIGHTED_MEAN) {
$grade_item->aggregationcoef = 1;
} else {
$grade_item->aggregationcoef = 0;
}
$grade_item->update();
}
}
}
}
@@ -293,17 +282,6 @@ function edit_module_post_actions($moduleinfo, $course) {
} else if (isset($moduleinfo->gradecat)) {
$outcome_item->set_parent($moduleinfo->gradecat);
}
$gradecategory = $outcome_item->get_parent_category();
if ($outcomeexists == false) {
if (grade_category::aggregation_uses_aggregationcoef($gradecategory->aggregation)) {
if ($gradecategory->aggregation == GRADE_AGGREGATE_WEIGHTED_MEAN) {
$outcome_item->aggregationcoef = 1;
} else {
$outcome_item->aggregationcoef = 0;
}
$outcome_item->update();
}
}
}
}
}
+1 -1
View File
@@ -212,7 +212,7 @@ if (!empty($activities)) {
echo $OUTPUT->spacer(array('height'=>30, 'br'=>true)); // should be done with CSS instead
}
echo $OUTPUT->box_start();
if (!empty($activity->name)) {
if (strval($activity->name) !== '') {
echo html_writer::tag('h2', $activity->name);
}
$inbox = true;
+3 -2
View File
@@ -1671,9 +1671,10 @@ class core_course_renderer extends plugin_renderer_base {
$site = get_site();
$output = '';
if (can_edit_in_category($category)) {
if (can_edit_in_category($coursecat->id)) {
// Add 'Manage' button if user has permissions to edit this category.
$managebutton = $this->single_button(new moodle_url('/course/management.php'), get_string('managecourses'), 'get');
$managebutton = $this->single_button(new moodle_url('/course/management.php',
array('categoryid' => $coursecat->id)), get_string('managecourses'), 'get');
$this->page->set_button($managebutton);
}
if (!$coursecat->id) {

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