Compare commits

...

517 Commits

Author SHA1 Message Date
Eloy Lafuente (stronk7) 803ddf9af3 Moodle release 2.7.3 2014-11-08 23:30:01 +01:00
AMOS bot 35842d38af Automatically generated installer lang files 2014-11-09 00:05:36 +08:00
Eloy Lafuente (stronk7) e29bdea42e weekly release 2.7.2+ 2014-11-07 16:53:22 +01:00
John Okely a866ad40be MDL-47949 mod_wiki: Validate parameters for page deletion 2014-11-07 15:13:25 +08:00
Damyon Wiese 125cb6df08 Merge branch 'wip-MDL-48091-m27-2' of git://github.com/marinaglancy/moodle into MOODLE_27_STABLE 2014-11-07 09:29:22 +08:00
Eloy Lafuente (stronk7) e88e7ae3ad Merge branch 'MDL-47943-m27-master' of https://github.com/dthies/moodle into MOODLE_27_STABLE 2014-11-06 18:47:38 +01:00
Marina Glancy bacb95612e MDL-48091 users: revert MDL-42875
Rvert of: "Show only profile visible roles on participants list"

This reverts commit ecc8244e62.
2014-11-06 18:41:05 +08:00
Eloy Lafuente (stronk7) 4752706116 Merge branch 'MDL-48035-27-enfix' of git://github.com/mudrd8mz/moodle into MOODLE_27_STABLE 2014-11-06 11:15:13 +01:00
David Mudrák 07ff315180 MDL-48035 Fix Behat tests regressions after merging en_fix strings 2014-11-06 10:55:41 +01:00
John Okely 4800d01e2e MDL-47930 mod_forum: Detect subscription to subscription disabled forums
Return forums with disabled subscription that you are subscribed to in
forum_get_subscribed forums
2014-11-06 08:40:50 +00:00
Damyon Wiese e9d3aad54c MDL-43430 ldap: whitespace fix 2014-11-06 12:06:42 +08:00
Damyon Wiese 8b91ec3dda Merge branch 'wip_27_mdl-43430' of https://github.com/iarenaza/moodle into MOODLE_27_STABLE 2014-11-06 11:59:39 +08:00
Marina Glancy 3925a3e287 Merge branch 'wip_MDL-48083_m27_rollback' of git://github.com/skodak/moodle into MOODLE_27_STABLE 2014-11-06 11:42:23 +08:00
Petr Skoda 489e91282b MDL-48083 dml: Empty buffers on forced rollback 2014-11-06 15:53:29 +13:00
Eloy Lafuente (stronk7) a618d35082 Merge branch 'wip-MDL-47174-m27' of git://github.com/marinaglancy/moodle into MOODLE_27_STABLE 2014-11-06 02:15:54 +01:00
Marina Glancy d8b19527fe MDL-47174 events: new calendar event may have 0 timestart 2014-11-06 08:58:16 +08:00
Eloy Lafuente (stronk7) 7ef5172818 Merge branch 'wip-mdl-45416-m27' of https://github.com/rajeshtaneja/moodle into MOODLE_27_STABLE 2014-11-06 00:58:12 +01:00
Eloy Lafuente (stronk7) 2b46342766 Merge branch 'MDL-47990_27' of git://github.com/timhunt/moodle into MOODLE_27_STABLE 2014-11-06 00:24:15 +01:00
Dan Poltawski a647d27ad7 Merge branch 'MDL-47466-MOODLE_27_STABLE' of https://github.com/tehanuyor/moodle into MOODLE_27_STABLE 2014-11-05 16:26:03 +00:00
Daniel Thies 3c2b67f5d4 MDL-47943 editor_atto: Save selection on mouseleave for Chrome 2014-11-05 09:37:24 -06:00
Andrew Nicols c812956efd MDL-48019 mod_forum: Add sesskey checks when setting tracking prefs
This also removes set_url() and changes require_course_login to
require_login as guests cannot set tracking.
2014-11-05 10:34:56 +00:00
Damyon Wiese 4289728d7c Merge branch 'MDL-46500_27' of https://github.com/dmonllao/moodle into MOODLE_27_STABLE 2014-11-05 16:44:01 +08:00
Iñaki Arenaza ce45e0b188 MDL-43430 enrol_ldap: Enrolment lost if member of group with parenthesis
While testing the fix, it was found that ldap_stripslashes() was broken and
using a deprecated PCRE patter modifier, so it's also been fixed.

Thanks to Damyon Wiese, some units tests have been added to cover
ldap_addslashes() and ldap_stripslashes().
2014-11-05 09:02:56 +01:00
Damyon Wiese f427d8efd6 Merge branch '48025-27' of git://github.com/samhemelryk/moodle into MOODLE_27_STABLE 2014-11-05 15:52:48 +08:00
Damyon Wiese be17a78d5c Merge branch 'wip-MDL-46262-m27' of git://github.com/marinaglancy/moodle into MOODLE_27_STABLE 2014-11-05 14:40:31 +08:00
Damyon Wiese 7ce72e385d MDL-47793 assign: trivial fix for inconsistent use of get_instance() 2014-11-05 14:29:16 +08:00
Damyon Wiese 250b70735b Merge branch 'MDL-47793-m27' of https://github.com/micaherne/moodle into MOODLE_27_STABLE 2014-11-05 14:29:01 +08:00
Damyon Wiese 9aefa9c8d3 Merge branch 'MDL-47930-27' of git://github.com/andrewnicols/moodle into MOODLE_27_STABLE 2014-11-05 14:21:28 +08:00
Damyon Wiese 24422c9028 MDL-27930 lesson: Remove custom styling from timer 2014-11-05 13:58:52 +08:00
Damyon Wiese 845b9de5c6 Merge branch 'MDL-27930_27' of git://github.com/jmvedrine/moodle into MOODLE_27_STABLE 2014-11-05 13:51:52 +08:00
Rajesh Taneja 691bb2a90f MDL-45416 enrol_ldap: Use null_progress_trace while running phpunit 2014-11-05 11:13:10 +08:00
Eloy Lafuente (stronk7) 98d1b938a3 Merge branch 'MDL-48035-27-enfix' of git://github.com/mudrd8mz/moodle into MOODLE_27_STABLE 2014-11-05 01:16:20 +01:00
Helen Foster 13523e51e4 MDL-48035 Merge English strings from the en_fix language pack 2014-11-04 22:05:07 +01:00
Jean-Michel Vedrine 0db87f6d4a MDL-27930 Lesson: the count-down timer does not work 2014-11-04 14:56:51 +01:00
Eloy Lafuente (stronk7) d91b8d1c6f weekly release 2.7.2+ 2014-11-04 11:35:14 +01:00
Eloy Lafuente (stronk7) 1b1634740e Merge branch 'install_27_STABLE' of https://git.in.moodle.com/amosbot/moodle-install into MOODLE_27_STABLE 2014-11-04 11:35:09 +01:00
Damyon Wiese bddb47374d Merge branch 'MDL-45636-course_M27' of https://github.com/eSrem/moodle into MOODLE_27_STABLE 2014-11-04 12:07:07 +08:00
Eloy Lafuente (stronk7) 478ab0f602 Merge branch 'MDL-47883-27-foundlangfile' of git://github.com/mudrd8mz/moodle into MOODLE_27_STABLE 2014-11-04 02:03:24 +01:00
Eloy Lafuente (stronk7) d5fc05e2a0 Merge branch '47969-27' of git://github.com/samhemelryk/moodle into MOODLE_27_STABLE 2014-11-04 01:57:07 +01:00
Eloy Lafuente (stronk7) 17a90193bb Merge branch '47968-27' of git://github.com/samhemelryk/moodle into MOODLE_27_STABLE 2014-11-04 01:55:19 +01:00
Petr Skoda 2f87351d54 MDL-47868 ws: verify upload areas 2014-11-04 01:50:03 +01:00
Petr Skoda e1331607a8 MDL-48013 calendar: force download of user files 2014-11-04 01:41:48 +01:00
Eloy Lafuente (stronk7) cc74fd9ea2 Merge branch '47917-27' of git://github.com/samhemelryk/moodle into MOODLE_27_STABLE 2014-11-04 00:03:58 +01:00
Damyon Wiese 44e712e9b7 MDL-47927 LTI: Use PARAM_TEXT and p() for returned messages and errors 2014-11-04 11:47:06 +13:00
Frederic Massart 932694ca59 MDL-47965 tag: Enforcing security of tag auto completion 2014-11-04 11:27:54 +13:00
David Monllao bac38b11ab MDL-47924 mod_lti: Fixing missing sesskey checkings
Also fixing a missing capability checking.
2014-11-04 11:03:00 +13:00
Yuliya Bozhko ab96babbb4 MDL-47190 Ensure badges cannot be awarded without a role
Signed-off-by: Yuliya Bozhko <yuliya.bozhko@totaralms.com>
2014-11-04 10:16:40 +13:00
Frederic Massart 324b018bbc MDL-47321 iplookup: Prevent guest users from using iplookup 2014-11-04 10:01:34 +13:00
Adrian Greeve 3e312a16f4 MDL-47697 mod_data: Fix group id change when editing.
When a teacher edits an entry in the database module
it would change the group ID to the one that the teacher
currently had selected.

Thanks to Steve Bond for providing a patch.
2014-11-04 09:58:09 +13:00
Juan Leyva 3aa9d93c7a MDL-45303 Web Services: forum_get_discussions ws misses permissions check 2014-11-03 21:53:42 +01:00
Juan Leyva 3b8876f5ef MDL-47766 web services: get_grades exposes hidden grades to students 2014-11-04 09:13:35 +13:00
John Okely 263f78b8b8 MDL-47921 mod_lti: Add access control to mod/lti/launch.php 2014-11-04 09:09:11 +13:00
Dave Cooper 04f2e83ce7 MDL-47050 core_wordlist: Updated wordlist to include only animals. 2014-11-04 09:06:13 +13:00
Damyon Wiese 25612b59ee Merge branch 'MDL-48010_27' of git://github.com/timhunt/moodle into MOODLE_27_STABLE 2014-11-03 17:15:49 +08:00
Petr Skoda 84baa6b141 MDL-47287 prevent web access to phpunit boostrap 2014-11-03 17:10:56 +08:00
Marina Glancy 2cb907d11d Merge branch 'wip-mdl-45204-m27' of git://github.com/rajeshtaneja/moodle into MOODLE_27_STABLE 2014-11-03 17:04:20 +08:00
Damyon Wiese 1dd7fab104 MDL-47275 Grades: Sum of grades bug in max grade with extra credit
Sum of grades is not calculating max grade with extra credit for students
2014-11-03 16:56:48 +08:00
Andreas Grabs 8bf49b7377 MDL-47865 mod_feedback - XSS through $searchstring in mod/feedback/mapcourse.php 2014-11-03 14:56:44 +08:00
Damyon Wiese d3e7b45d27 MDL-45538 Fix version bump. 2014-11-03 14:26:09 +08:00
Damyon Wiese 10b07bf8cc Merge branch 'wip-MDL-45538-m27' of git://github.com/marinaglancy/moodle into MOODLE_27_STABLE 2014-11-03 14:25:45 +08:00
Damyon Wiese 07304c8ee7 Merge branch 'MDL-35008_27' of git://github.com/jmvedrine/moodle into MOODLE_27_STABLE 2014-11-03 14:04:41 +08:00
pau.ferrer-ocana c2b8c7c8c2 MDL-26447 gradebook: Default gradedisplaytype fixed for all locales 2014-11-03 13:56:56 +08:00
Damyon Wiese 2d10a2cebb Merge branch 'wip_MDL-47966_m27_defaultheaders' of https://github.com/skodak/moodle into MOODLE_27_STABLE 2014-11-03 13:08:02 +08:00
Sam Hemelryk aba092e128 MDL-47917 cachestore_memcached: fixed get_many ordering 2014-11-03 14:55:25 +13:00
Sam Hemelryk f8bf49f137 MDL-48025 user: fixed typo in user_search HTML 2014-11-03 10:08:19 +13:00
Sam Hemelryk b6bf71702d MDL-47969 mod_survey: fixed HTML5 validation of index.php 2014-11-03 08:55:09 +13:00
Sam Hemelryk 5d45f54b6c MDL-47968 mod_forum: fixed search form HTML5 validation 2014-11-03 08:54:54 +13:00
AMOS bot b37e3a818b Automatically generated installer lang files 2014-11-02 00:05:38 +08:00
Marina Glancy 6eef37f045 MDL-46262 availability: validation of fields without value
Thanks to Tomasz Pawlik | CKO USl for the patch
2014-11-01 16:58:51 +08:00
Tim Hunt 82bf77561f MDL-48010 grade import from URL: don't corrupt the URL. 2014-10-31 19:53:34 +00:00
Tim Hunt c268bbc9e6 MDL-48008 gradeimport_xml: report errors usefully 2014-10-31 19:53:33 +00:00
Tim Hunt c3d1ced72e MDL-47797 quesion preview: improve the behat script
Tests a few more buttons, and also verify more of the UI.
2014-10-31 15:52:38 +00:00
Tim Hunt 78ac8f6045 MDL-47797 question preview: show more technical info
It is helpful for developers creating question types (at least) to be
able to see this.
2014-10-31 15:52:36 +00:00
David Mudrák 52184908fa MDL-47883 admin: Fix missing string in the plugin validation 2014-10-31 12:59:26 +01:00
Dan Poltawski cdb1de64e4 weekly release 2.7.2+ 2014-10-31 09:08:53 +00:00
Rajesh Taneja abacf844f9 MDL-45204 phpunit: Fixed test_localcachedir test
make_localcache_directory is the first call to make
localcache, which is already created by reset. So deleting
existing localcache directory will pass this test
2014-10-31 16:46:52 +08:00
Petr Skoda ac6e453d11 MDL-47966 Add default content type and encoding 2014-10-31 14:01:46 +13:00
Sam Hemelryk 244be92c8e Merge branch 'MDL-47875_MOODLE_27_STABLE' of https://github.com/crazyserver/moodle into MOODLE_27_STABLE 2014-10-31 11:15:21 +13:00
Iñaki Arenaza f7b5782d5c MDL-43430 enrol_ldap: Enrolment lost if member of group with parenthesis
The group names we get from ldap_find_user_groups() can contain invalid LDAP
filter characters. So we need to escape them for LDAP filter usage.
2014-10-30 22:52:33 +01:00
Iñaki Arenaza 1d17b54861 MDL-43430 enrol_ldap: Enrolment lost if member of group with parenthesis
As part of fixing MDL-43430, a typo has been detected in the
quoted alphanumeric characters (the '=' and '>' were transposed).
2014-10-30 22:52:33 +01:00
pau.ferrer-ocana 3d5e1f113d MDL-47875 choice: chat module strings not required from Choice anymore
AMOS BEGIN
 CPY [chatintro,mod_chat],[description,mod_choice]
AMOS END
2014-10-30 22:51:16 +01:00
pau.ferrer-ocana ecc8244e62 MDL-42875 users: Show only profile visible roles on participants list 2014-10-31 10:36:44 +13:00
Tim Hunt dd22636bef MDL-47990 qtype_multichoice: fix test response import/export 2014-10-30 18:26:00 +00:00
Jean-Michel Vedrine 6a59a3e073 MDL-35008 Lesson: url decode rules not applied to answers and responses 2014-10-30 13:25:29 +01:00
Marina Glancy 7892e8dd6a Merge branch 'MDL-25057-27' of git://github.com/andrewnicols/moodle into MOODLE_27_STABLE 2014-10-30 17:14:42 +08:00
Marina Glancy 6d5a4e733b Merge branch 'MDL-47569_CC_Errors27' of git://github.com/moodlerooms/moodle into MOODLE_27_STABLE 2014-10-30 16:16:32 +08:00
Marina Glancy eccad2d4bc Merge branch '47970-27' of git://github.com/samhemelryk/moodle into MOODLE_27_STABLE 2014-10-30 16:16:23 +08:00
David Monllao 9a08527acf MDL-46500 mod_data: Removing duplicate filemanager initialisations 2014-10-30 16:09:47 +08:00
Marina Glancy 0081072ff1 Merge branch 'MDL-29873_27' of git://github.com/jmvedrine/moodle into MOODLE_27_STABLE 2014-10-30 14:17:55 +08:00
Andrew Nicols 906ecbfd05 MDL-25057 mod_forum: Stop duplicating forum_read posts from cron
This also includes an upgrade script to delete the existing duplicates.
2014-10-30 13:34:42 +08:00
Ben Kelada aa39745d05 MDL-46500 filepicker: prevent error when element does not exist 2014-10-30 13:07:20 +08:00
Marina Glancy 7dcabab098 MDL-45538 files: restore missing records in draft areas 2014-10-30 10:46:59 +08:00
Sam Hemelryk eede7b3efe MDL-47970 mod_scorm: fixed HTML5 validation error 2014-10-30 14:56:04 +13:00
Mark Nielsen 3315c01e0f MDL-47569 backup: Do not close questions tag if never opened
This can happen when restoring quizzes that
do not have any questions.
2014-10-29 14:30:58 -07:00
Mark Nielsen d9e9e79954 MDL-47569 backup: Escape section summary for XML
This was causing the parsing of the XML
to fail because things like & were not
escaped.
2014-10-29 14:30:47 -07:00
Dan Poltawski 5906d379db Merge branch 'wip_MDL-40949_m27_pathsettings' of https://github.com/skodak/moodle into MOODLE_27_STABLE 2014-10-29 14:20:26 +00:00
Michael Aherne f4ec918f9b MDL-47793 assign: Reset reveal identities 2014-10-29 11:20:05 +00:00
Julien Boulen aa4318a823 MDL-47584 database SQL: add debug info on connection error notices 2014-10-29 16:55:30 +08:00
Damyon Wiese 917d5e1caa Merge branch 'wip-MDL-47647-27' of git://github.com/abgreeve/moodle into MOODLE_27_STABLE 2014-10-29 16:18:29 +08:00
Marina Glancy b33d633510 Merge branch 'MDL-47916-27' of git://github.com/jleyva/moodle into MOODLE_27_STABLE 2014-10-29 16:15:32 +08:00
Damyon Wiese f9aab389e6 Merge branch 'MDL-47790-27' of git://github.com/jethac/moodle into MOODLE_27_STABLE 2014-10-29 15:49:57 +08:00
Daniel Kosinski df0a353377 MDL-46219 assignment: delete files when resetting assign activities 2014-10-29 15:39:24 +08:00
Damyon Wiese e92a430405 Merge branch 'MDL-47755_27' of https://github.com/totara/openbadges into MOODLE_27_STABLE 2014-10-29 15:31:45 +08:00
Damyon Wiese cdb3a6b6c1 Merge branch 'wip-MDL-47796-27' of git://github.com/abgreeve/moodle into MOODLE_27_STABLE 2014-10-29 15:16:14 +08:00
Damyon Wiese dad46c5c1f Merge branch 'MDL-47612-27' of git://github.com/andrewnicols/moodle into MOODLE_27_STABLE 2014-10-29 14:49:13 +08:00
Damyon Wiese e1cc83875f Merge branch 'MDL-47227_MOODLE_27_STABLE' of https://github.com/crazyserver/moodle into MOODLE_27_STABLE 2014-10-29 14:43:38 +08:00
Damyon Wiese c40485aeee Merge branch 'MDL-47201-27' of git://github.com/xow/moodle into MOODLE_27_STABLE 2014-10-29 14:27:17 +08:00
Adrian Greeve 99cf374a42 MDL-47796 mod_data: Fix display of group records.
When viewing entries as a teacher in separate group
mode, changing the group would result in random
entries being shown.
2014-10-29 14:09:34 +08:00
Damyon Wiese 203ef3bd3e Merge branch 'MDL-47898-27' of git://github.com/andrewnicols/moodle into MOODLE_27_STABLE 2014-10-29 13:36:40 +08:00
Dan Marsden af4417f0aa MDL-33939 gradingform_guide: use correct max grade for scales. 2014-10-29 13:23:46 +08:00
Damyon Wiese 37e7a3849b Merge branch 'wip-MDL-46517-m27' of git://github.com/marinaglancy/moodle into MOODLE_27_STABLE 2014-10-29 13:13:58 +08:00
David Scotson fc8984234c MDL-40343 forum: indent less when mobile, nested
Changes the indenting of forum replies to be relative to the width of
the parent container, so the indent decreases as threads get nested
deeper. Also reduces the indent size automatically for smaller screen
sizes.
2014-10-29 12:55:37 +08:00
Andrea Bicciolo c00787ae08 MDL-47201 Reports: Read from multiple log stores in outline report 2014-10-29 12:48:43 +08:00
Andrew Nicols 2fe3a171c4 MDL-47930 mod_forum: Display all forum statuses correctly
It is possible for users with the mod/forum:managesubscriptions to
subscribe to forums with subscription disabled. This is handled by
forum_get_subscribe_link() already and should have been handled here all
along.
2014-10-29 11:53:13 +08:00
Marina Glancy 451ea7b118 MDL-46517 calendar: adjust display for DST
Thanks to Jo Matthews for providing a patch
2014-10-29 11:25:32 +08:00
Damyon Wiese a6113f4dd1 Merge branch 'MDL-47835_27' of git://github.com/dmonllao/moodle into MOODLE_27_STABLE 2014-10-29 11:23:51 +08:00
Corey Wallis e8db7737da MDL-46517 calendar: adjust dates for DST
Change-Id: I269382031e4ffa714396f3d9ce2315a5c96d929c
2014-10-29 11:01:33 +08:00
David Monllao 321bfdbedf MDL-47835 block_recent_activity: Same entry keys order
insert_records() is sensitive to the order of the keys
assigned to the inserted objects (inserted as arrays in
this case). Now keys are assigned using the same order.
2014-10-29 10:53:23 +08:00
Damyon Wiese 86594f9a95 Merge branch 'wip-MDL-36987-m27' of git://github.com/marinaglancy/moodle into MOODLE_27_STABLE 2014-10-29 10:38:56 +08:00
Petr Skoda d42ba3d0af MDL-40949 admin: Fix $CFG->preventexecpath hints
This setting restricts all local paths, not just
executables.
2014-10-29 10:47:33 +13:00
Dan Poltawski 3803574711 weekly release 2.7.2+ 2014-10-28 12:32:20 +00:00
Dan Poltawski 25c57e8cc2 Merge branch 'install_27_STABLE' of https://git.in.moodle.com/amosbot/moodle-install into MOODLE_27_STABLE 2014-10-28 12:32:18 +00:00
Juan Leyva d8c1ffd0a0 MDL-47916 web services: Fixed invalid returned value type 2014-10-28 10:28:38 +01:00
Pau Ferrer Ocaña 5776292b94 MDL-47227 admin: Fix user bulk selection over 1000 2014-10-28 08:52:00 +01:00
Kordan 43163295a5 MDL-47790 core_outputcomponents: added one more <tr> around <td clspan="xx"> when $table->data[] = "hr" is provided 2014-10-28 15:49:39 +08:00
Marina Glancy 63f1e3b287 Merge branch '47914-27' of git://github.com/samhemelryk/moodle into MOODLE_27_STABLE 2014-10-28 12:24:01 +08:00
Sam Hemelryk 09d83a4038 MDL-47183 post-integration fixes
* Fixed typo with context_module::instance
* Fixed use of $mod->get_context()
2014-10-28 15:50:17 +13:00
Sam Hemelryk 76b6d2e750 Merge branch 'MDL-47183-27' of git://github.com/andrewnicols/moodle into MOODLE_27_STABLE 2014-10-28 14:02:28 +13:00
Andrew Nicols f3e6ff8a6c MDL-47898 mod_quiz: Correct path when checking content_editable
Addresses a number of issues when using the text editor in a quiz using
secure mode.
2014-10-28 07:32:42 +08:00
Sam Hemelryk 61685bb0df MDL-47914 report_stats: better handling of user and mode 2014-10-28 11:52:51 +13:00
Sam Hemelryk c18c38f3f6 Merge branch 'wip-MDL-47585-m27' of git://github.com/marinaglancy/moodle into MOODLE_27_STABLE 2014-10-28 09:28:17 +13:00
AMOS bot 3e0fd2ed8e Automatically generated installer lang files 2014-10-28 00:05:36 +08:00
Adrian Greeve 1a67124e67 MDL-47647 lib: Fix message unit test failure.
Messaging unit tests on Windows were failing because
of a comparison between two file paths. Part of the
path would have a forward slash instead of a backslash
and so would fail.
2014-10-27 16:42:00 +08:00
Damyon Wiese fc9ff77426 Merge branch 'MDL-47588_27' of git://github.com/timhunt/moodle into MOODLE_27_STABLE 2014-10-27 15:30:20 +08:00
Damyon Wiese ff8b2535d7 Merge branch 'm27_MDL-47210_IIS_PATH_INFO_Ignored_In_Required_Login_Pluginfile_Redirect' of https://github.com/scara/moodle into MOODLE_27_STABLE 2014-10-27 14:00:12 +08:00
Marina Glancy 7047ebb7a3 Merge branch 'MDL-47882_scorm_loadsco_invalid_html_27_STABLE' of git://github.com/MorrisR2/moodle into MOODLE_27_STABLE 2014-10-27 11:49:01 +08:00
Damyon Wiese 3217e572cb MDL-47690 Course: Remove unused variable from unit tests. 2014-10-27 11:27:55 +08:00
Damyon Wiese a4e7898729 Merge branch 'MDL-47690-27' of git://github.com/jleyva/moodle into MOODLE_27_STABLE 2014-10-27 11:27:40 +08:00
Damyon Wiese c187aa03c4 Merge branch 'wip-MDL-30358-m27' of git://github.com/marinaglancy/moodle into MOODLE_27_STABLE 2014-10-27 10:31:11 +08:00
Matteo Scaramuccia 2ebfef8f7b MDL-47210 Files API: IIS, PATH_INFO ignored in required login redirect. 2014-10-26 08:05:23 +01:00
Ray Morris 784b3b9262 MDL-47882 SCORM: invalid HTML in loadSCO.php 2014-10-24 16:54:57 -05:00
Tim Hunt 8f089f100c MDL-47588 question behat tests: don't close the preview window.
If you do. Chrome + Selenium2 gets stuck (on Windows at least). Selenium
must be trying to send commands ot a window that does not exist any
more.
2014-10-24 17:48:39 +01:00
Tim Hunt 2be10633d8 MDL-47588 behat: fix switching back to the main window in Chrome
This fix is mostly based on what Colin Chambers found out. This commit
is a simplification of his work.

The problem is that the Chrome / Selenium 2 integration cannot swich to
a window with a blank name. The work-around applied here is, when we
switch away from an unnamed window, we set a name on it. Then we can use
that name to switch back.
2014-10-24 17:48:38 +01:00
Tim Hunt e6d8ca248d MDL-46088 quiz secure window: further Atto JS fixes. 2014-10-24 17:11:24 +01:00
Damyon Wiese d61b59175c MDL-46088 Quiz: Prevent alert when clicking in editor in secure popup 2014-10-24 17:11:16 +01:00
Dan Poltawski 8afccaf846 Merge branch 'MDL-46712-27' of git://github.com/jethac/moodle into MOODLE_27_STABLE 2014-10-24 15:37:31 +01:00
Dan Poltawski 3d86260c08 Merge branch 'MDL-47780_m27' of https://github.com/markn86/moodle into MOODLE_27_STABLE 2014-10-24 15:19:49 +01:00
Dan Poltawski a0088bb79b Merge branch 'wip-MDL-47760-m27' of git://github.com/marinaglancy/moodle into MOODLE_27_STABLE 2014-10-24 15:18:33 +01:00
Dan Poltawski f393fbb08b Merge branch '46518-27' of git://github.com/samhemelryk/moodle into MOODLE_27_STABLE 2014-10-24 15:16:56 +01:00
Dan Poltawski 73715b3aa8 Merge branch 'MDL-47804_27' of git://github.com/aolley/moodle into MOODLE_27_STABLE 2014-10-24 15:14:38 +01:00
Dan Poltawski 61cd8bb3cd Merge branch '47608-27' of git://github.com/samhemelryk/moodle into MOODLE_27_STABLE 2014-10-24 15:13:16 +01:00
Dan Poltawski 19089bc416 Merge branch 'MDL-47397-27' of git://github.com/FMCorz/moodle into MOODLE_27_STABLE 2014-10-24 15:09:55 +01:00
Dan Poltawski e6035a8b38 weekly release 2.7.2+ 2014-10-24 11:15:12 +01:00
Dan Poltawski edfa06b103 Merge branch 'install_27_STABLE' of https://git.in.moodle.com/amosbot/moodle-install into MOODLE_27_STABLE 2014-10-24 11:15:10 +01:00
Juan Leyva deb9221748 MDL-47690 web services: Fixed invalid return parameter type in mod_url 2014-10-24 10:30:08 +02:00
Adam Olley 09352c5677 MDL-47804 events: calendar_event_updated needs to accept a timestart == 0 2014-10-24 15:35:14 +10:30
Marina Glancy 779d68eb8a Merge branch 'MDL-47340-27' of git://github.com/jethac/moodle into MOODLE_27_STABLE 2014-10-24 11:55:16 +08:00
Damyon Wiese 441a8a209b Merge branch '46499-27' of git://github.com/samhemelryk/moodle into MOODLE_27_STABLE 2014-10-24 11:03:36 +08:00
Damyon Wiese ba639bb069 Merge branch 'MDL-47740_27' of git://github.com/timhunt/moodle into MOODLE_27_STABLE 2014-10-24 09:50:41 +08:00
Sam Hemelryk e68b0e289d NOBUG: fixed whitespace 2014-10-24 14:44:11 +13:00
Sam Hemelryk 6606760811 MDL-46332 fixed whitespace 2014-10-24 14:34:46 +13:00
Sam Hemelryk c43bfca338 Merge branch 'MDL-46332-grouping-remove-button-27' of git://github.com/DanBennettUK/moodle into MOODLE_27_STABLE 2014-10-24 12:02:18 +13:00
Sam Hemelryk 1ecb6d4d1b Merge branch 'MDL-47555_27' of https://github.com/rlorenzo/moodle into MOODLE_27_STABLE 2014-10-24 11:17:04 +13:00
Sam Hemelryk 148a0db4cf Merge branch 'wip_MDL-47795_M27' of git://github.com/gjb2048/moodle into MOODLE_27_STABLE 2014-10-24 09:59:01 +13:00
gdharris cdc2fedcac MDL-46853 calendar: fix import of no duration events 2014-10-24 09:55:50 +13:00
Dan Poltawski 3c795ec9cb Merge branch 'MDL-47815-27' of git://github.com/damyon/moodle into MOODLE_27_STABLE 2014-10-23 17:28:40 +01:00
Dan Poltawski e7b026846b Merge branch '47684-27' of git://github.com/samhemelryk/moodle into MOODLE_27_STABLE 2014-10-23 16:33:27 +01:00
Dan Poltawski db2ba9f335 Merge branch '47752-27' of git://github.com/samhemelryk/moodle into MOODLE_27_STABLE 2014-10-23 16:32:22 +01:00
Frederic Massart c3d5443a43 MDL-47397 assignfeedback_editpdf: Tests use reliable way to annotate PDF
The drag and drop step did not work, so we moved to using the stamps
to annotate the PDF. They do not rely on drag&drop and produce the same
effects.
2014-10-23 17:56:48 +08:00
Frederic Massart cc9e6ebbf7 MDL-47397 assignfeedback_editpdf: Copy stamps to other students in team
During a team submission the stamps were attached to the user that
was graded and not to the other users. This could lead to errors when
generating the PDF for each user.
2014-10-23 17:56:47 +08:00
Frederic Massart 04cc05c0d3 MDL-47397 editor_atto: Properly close confirm dialogue in Behat test 2014-10-23 17:56:47 +08:00
Damyon Wiese eba4b02677 MDL-47499 tasks: Scheduled tasks custom schedule is reset on upgrade.
Add a unit test for reset_scheduled_tasks_for_component and make sure it doesn't clear
customised schedules for existing tasks.
2014-10-23 10:23:12 +01:00
Marina Glancy eefedf7a06 Merge branch 'wip-MDL-47675-27' of git://github.com/abgreeve/moodle into MOODLE_27_STABLE 2014-10-23 16:58:13 +08:00
Damyon Wiese 139c36d5d4 Merge branch '47077-27' of git://github.com/samhemelryk/moodle into MOODLE_27_STABLE 2014-10-23 16:10:11 +08:00
Damyon Wiese d7ee0ce9db Merge branch 'MDL-32616_27' of git://github.com/timhunt/moodle into MOODLE_27_STABLE 2014-10-23 12:03:32 +08:00
Adrian Greeve 9c630abcd7 MDL-47675 phpunit: Update unit tests to pass on MSSQL
Unit tests were failing on MSSQL. gc_collect_cycles() was
removed from the phpunit utils.php file to save time in running
the tests, but MSSQL doesn't clean up open files as well as
other databases.

This patch includes the garbage collection for the unit tests
that require it.
2014-10-23 08:54:35 +08:00
Tim Hunt 191dc626dd MDL-32616 question engine: set_max_mark_in_attempts MySQL perf
The MySQL (& Maria DB) query 'optimizer' was failing to handle this
query, so for that DB only, we give it an equivalent query that it can
get right.

With unit test.
2014-10-22 11:01:20 +01:00
Tim Hunt 4b9d9d281c MDL-32616 question engine: move unit test to better name 2014-10-22 11:01:19 +01:00
Damyon Wiese eceb11d200 MDL-47815 assign: Fix random unit test fails
This test was failing when it was run really slowly (looking at you oracle).
2014-10-22 17:01:53 +08:00
Andrew Nicols 9cc49c2f58 MDL-47706 gradebook: Update pageload time between changes
Since MDL-38732 we reject changes if another change has been made more
recently. As a result, if process_data is called, and then we roll into the
next millisecond period before process_data is called again, the change is
rejected.

Different errors were seen because the millisecond rollover occurred at
different time within the test.

Different error conditions were seen because not all of the tests check for
an error from the call to process_data(), instead just checking that the
value had been updated correctly.
2014-10-22 13:19:23 +08:00
Damyon Wiese 2fe83c2c9b MDL-46527 Grades: Webservice only returns first activity grade. 2014-10-22 11:22:15 +08:00
Damyon Wiese c274f4dd62 Merge branch 'MDL-46527-27' of git://github.com/jleyva/moodle into MOODLE_27_STABLE 2014-10-22 10:24:06 +08:00
AMOS bot 9e6714f148 Automatically generated installer lang files 2014-10-22 00:07:40 +08:00
Gareth J Barnard 87e7e6a130 MDL-47795 SCORM: SCORM report not a report. 2014-10-21 15:42:32 +01:00
Tim Hunt 5151147372 MDL-47740 question engine: let qs update variant later if appropriate
Variant has two purposes. First to determine which version of the
question the student will see. Hence it is used to set up the state
of the quetsion when the question is started. Then the internal state of
the question is saved in the first step.

Once that has been done, the variant number is purely informative, and
just used to break down the statistics.

In some cases (the one I have in mind is qtype_opaque) then there is a
complex randomisation process, which may lead to several inital variant
numbers acutally giving the same version of the question. In this case
it is nice if the question can update the stored variant number, to make
the statistics more meaningful.
2014-10-21 11:44:10 +01:00
Juan Leyva 0fdb3d3fdc MDL-46527 grades: grade_get_grades external function rewritten 2014-10-21 12:33:40 +02:00
Mark Nelson 702e2eb195 MDL-47780 core: corrected docs for get_user_capability_course() 2014-10-21 00:53:19 -07:00
Damyon Wiese 7cdb32a8ea Merge branch 'wip_MDL-41593_m27_preventexecdefault' of https://github.com/skodak/moodle into MOODLE_27_STABLE 2014-10-21 13:23:33 +08:00
Yuliya Bozhko 08574f01cc MDL-47755 badges: Fix internal message output
Signed-off-by: Yuliya Bozhko <yuliya.bozhko@totaralms.com>
2014-10-21 16:28:38 +13:00
Sam Hemelryk b12d387f93 Merge branch 'm27_MDL-36669_UFO_references_in_filelib' of https://github.com/scara/moodle into MOODLE_27_STABLE 2014-10-21 15:17:59 +13:00
Matteo Scaramuccia 8cdcbf3455 MDL-36669 Filters: Remove the last ref to the UFO library. 2014-10-20 23:23:25 +02:00
Dan Poltawski 41ce6946d2 Merge branch 'MDL-38172_27' of git://github.com/jmvedrine/moodle into MOODLE_27_STABLE 2014-10-20 18:28:48 +01:00
Dan Poltawski 0930a859ac Merge branch 'MDL-47651_27' of git://github.com/timhunt/moodle into MOODLE_27_STABLE 2014-10-20 17:44:35 +01:00
Dan Poltawski 2c1a9dcca6 Merge branch 'MDL-47666_27' of git://github.com/timhunt/moodle into MOODLE_27_STABLE 2014-10-20 17:31:58 +01:00
Dan Poltawski 813e70a35a Merge branch 'MDL-47711_27' of git://github.com/timhunt/moodle into MOODLE_27_STABLE 2014-10-20 17:28:54 +01:00
Dan Poltawski 520308af7e Merge branch 'MDL-47726_27' of git://github.com/timhunt/moodle into MOODLE_27_STABLE 2014-10-20 17:26:38 +01:00
Dan Poltawski 7bb3575813 Merge branch 'MDL-47673_27' of git://github.com/timhunt/moodle into MOODLE_27_STABLE 2014-10-20 17:21:43 +01:00
Tim Hunt 362d958e5a MDL-47726 availability: fix tests when there is a text custom field
This unit tests assumed that on a fresh install, there were no custom
user-profile fields. Given some third-party plugins, that assumption is
false.
2014-10-20 16:15:59 +01:00
Tim Hunt d313ad40e6 MDL-47711 behat: make it easier to copy the init.php command. 2014-10-20 12:05:50 +01:00
Tim Hunt bb7030cf98 MDL-47673 quiz generator: default grade 100 & fix review options
The review option defaults need to be like what you get from the editing
form, no what is stored in the database, or they don't work!
2014-10-20 12:05:42 +01:00
Tim Hunt 9812ea0a62 MDL-47666 DB auth & enrol: unit tests fail with custom DB drivers
Changed to used $DB->get_db_family, rather than hard-coding the list of
class names.
2014-10-20 12:05:34 +01:00
Tim Hunt c5b928ce4a MDL-47651 quiz responses: allow for qtypes without responses 2014-10-20 12:05:26 +01:00
Jetha Chan f5beaa7e00 MDL-47340 action_menu: selector, RTL, consistency fixes 2014-10-20 17:10:05 +08:00
Marina Glancy d8a7d44a65 Merge branch 'wip_MDL-47754_m27_installredir' of git://github.com/skodak/moodle into MOODLE_27_STABLE 2014-10-20 17:04:42 +08:00
Dan Bennett bbe7727499 MDL-46332 : Display of 'Remove' button in Add/Remove Groups in Grouping
Fixed styling of Add/Remove Groups in Grouping to now use the same
layout as the Group Members page.
This fixes the issue with buttons being unaligned and introduces
consistency between pages.
2014-10-20 09:47:23 +01:00
Marina Glancy 97f240e7b6 Merge branch 'MDL-38065-fix-27' of git://github.com/jmarthaler/moodle into MOODLE_27_STABLE 2014-10-20 14:08:34 +08:00
Marina Glancy a23348da27 MDL-47760 grades: dim category name if hidden 2014-10-20 14:05:50 +08:00
Petr Skoda 49e057453f MDL-47754 install: fix redirect loop 2014-10-20 12:53:04 +13:00
Sam Hemelryk 8d76895d08 MDL-46518 navigation: site glossaries now expand properly 2014-10-20 11:20:13 +13:00
Sam Hemelryk 19e095a757 MDL-47608 cachestore_mongo: fixed unit test error
If you configured your site to run mongo unit tests and had
the mongo extension and backend installed but did not have the
mongo service running you would get a fatal error when running
the unit tests.
That problem has been fixed by checking the mongo test instance
is ready before returning it.
2014-10-20 11:04:54 +13:00
Sam Hemelryk f7492e8526 MDL-47077 report_participation: fixed pagination in groups 2014-10-20 11:01:31 +13:00
Sam Hemelryk 0cd220c870 MDL-46499 navigation: better enrolled course limit
We now user $CFG->navcourselimit to limit the number of
courses shown in the navigation when browsing another users
full profile. Previously it showed all courses which caused
some slowdown.
2014-10-20 10:58:37 +13:00
Sam Hemelryk 7c23f7f865 MDL-47752 grading: fixed bugs with the modgrade element 2014-10-20 10:34:09 +13:00
Sam Hemelryk fb7c991ed5 MDL-47684 mod: better validation of rating options 2014-10-20 08:44:27 +13:00
Jean-Michel Vedrine fcc5996cda MDL-29873 Lesson: Essays not shown on grade page with SQL server 2014-10-18 19:57:46 +02:00
Jean-Michel Vedrine 458cb3927a MDL-38172 Lesson: Additional Info not displayed at end of lesson 2014-10-17 17:12:40 +02:00
Dan Poltawski 3eeb53655e weekly release 2.7.2+ 2014-10-17 14:31:38 +01:00
Dan Poltawski 5728a1f51c Revert "MDL-47684 mod: better validation of rating options"
This reverts commit c58758d207.
2014-10-17 14:28:19 +01:00
Dan Poltawski c91ddd50e6 Revert "MDL-44548 mod_scorm: force an external sync to check for updated files."
This reverts commit 8af706e33b.
2014-10-17 09:31:29 +01:00
Jon Marthaler 4fab973d4b MDL-38065 gradebook: Fix issue with hidden categories breaking rowspan.
Hidden subcategories break the rowspan in the gradebook; this fix corrects
the calculation of the rowspan.
2014-10-16 22:26:45 -05:00
Dan Poltawski b41bcab492 Merge branch '47631-27' of git://github.com/samhemelryk/moodle into MOODLE_27_STABLE 2014-10-16 15:04:14 +01:00
Dan Poltawski 875f3b001c Merge branch 'm27_MDL-44548' of https://github.com/danmarsden/moodle into MOODLE_27_STABLE 2014-10-16 11:46:34 +01:00
Dan Poltawski bb4245f1a4 Merge branch 'MDL-47710_27' of git://github.com/timhunt/moodle into MOODLE_27_STABLE 2014-10-16 11:35:29 +01:00
Marina Glancy c6458c381a MDL-36987 auth_manual: fix config for field locking
Thanks to Sergey for the patch
2014-10-16 18:17:25 +08:00
Tim Hunt 898f7f9eab MDL-47710 qformat_gift: fix bahat fails due to different ids in exports 2014-10-16 11:04:44 +01:00
Dan Poltawski af236997dd Merge branch '47684-27' of git://github.com/samhemelryk/moodle into MOODLE_27_STABLE 2014-10-16 11:02:37 +01:00
Dan Poltawski 5033b3cf73 Merge branch 'MDL-47657-27' of git://github.com/gurgus/moodle into MOODLE_27_STABLE 2014-10-16 10:52:59 +01:00
Dan Poltawski 7d92cb5719 Merge branch 'MDL-47686-27' of git://github.com/damyon/moodle into MOODLE_27_STABLE 2014-10-16 10:40:03 +01:00
Damyon Wiese 5d82824d6d Merge branch 'MDL-47667_27' of git://github.com/timhunt/moodle into MOODLE_27_STABLE 2014-10-16 13:17:23 +08:00
Sam Hemelryk c58758d207 MDL-47684 mod: better validation of rating options 2014-10-16 16:24:59 +13:00
Dave Cooper 255d191a1d MDL-47657 mod_glossary: Fixed wrong error message on edit timeout. 2014-10-16 09:44:10 +08:00
Sam Hemelryk 85e3c16479 Merge branch 'MDL-47594_M27' of git://github.com/kordan/moodle into MOODLE_27_STABLE 2014-10-16 11:05:02 +13:00
Sam Hemelryk 30cc99cd98 Merge branch 'wip-MDL-47629-MOODLE_27_STABLE' of https://github.com/kwiliarty/moodle into MOODLE_27_STABLE 2014-10-16 10:31:28 +13:00
Yolanda Ordóñez Rufat e1250d89fb MDL-47466 calendar: fixed error ORA-01795 in calendar_get_events 2014-10-15 14:19:23 +02:00
Damyon Wiese a14b534965 Merge branch 'wip-MDL-47613-m27' of git://github.com/marinaglancy/moodle into MOODLE_27_STABLE 2014-10-15 16:58:48 +08:00
Damyon Wiese 6d126348e2 MDL-47686 assign: Fix restoring from a mod_assignment backup.
This was only working for admins.
2014-10-15 15:58:32 +08:00
Dan Poltawski 8b3c12ec5b Merge branch 'MDL-38732-27' of git://github.com/FMCorz/moodle into MOODLE_27_STABLE 2014-10-15 08:41:13 +01:00
Dan Marsden 0b2494f82d MDL-47431 advanced grading: correct use of frankenstyle names for consistency 2014-10-15 14:56:10 +08:00
Damyon Wiese 7364b0fea5 Merge branch 'MDL-47646_27' of git://github.com/timhunt/moodle into MOODLE_27_STABLE 2014-10-15 14:30:05 +08:00
Damyon Wiese b57cfa8462 Merge branch 'wip-MDL-47572-m27' of git://github.com/marinaglancy/moodle into MOODLE_27_STABLE 2014-10-15 14:09:07 +08:00
Damyon Wiese f6b9c0f77b Merge branch 'wip-MDL-47583-m27' of git://github.com/marinaglancy/moodle into MOODLE_27_STABLE 2014-10-15 13:50:38 +08:00
Frederic Massart f1c933f470 MDL-38732 gradereport_grader: Undefined variable in unit tests 2014-10-15 12:23:34 +08:00
Marina Glancy c396f64224 MDL-30358 forms: strict validation is too strict 2014-10-15 11:58:09 +08:00
Kevin Wiliarty 295f32737f MDL-47629 quiz review: display cloze feedback on top of "Check" button 2014-10-14 15:40:05 -04:00
Dan Poltawski 450e3f27c9 Merge branch 'MDL-38732-27' of git://github.com/FMCorz/moodle into MOODLE_27_STABLE 2014-10-14 19:02:11 +01:00
Dan Poltawski 45f4833f90 weekly release 2.7.2+ 2014-10-14 18:03:14 +01:00
Dan Poltawski 05c1422566 Merge branch 'install_27_STABLE' of https://git.in.moodle.com/amosbot/moodle-install into MOODLE_27_STABLE 2014-10-14 18:03:11 +01:00
Dan Poltawski a58d2935dd MDL-46235/MDL-46971 mysql_compress_rows: fix typo 2014-10-14 15:12:01 +01:00
Dan Poltawski 7252078d48 Merge branch 'wip_MDL-46235_m27_innodbtext' of github.com:skodak/moodle into MOODLE_27_STABLE 2014-10-14 12:27:03 +01:00
Tim Hunt fd03bcae29 MDL-47667 profile unit tests: don't assume none by default.
E.g. if an add-on creates a user profile field on install, the test was
failing.
2014-10-14 12:12:05 +01:00
Damyon Wiese 0cda7b5785 Merge branch '46151-27' of git://github.com/samhemelryk/moodle into MOODLE_27_STABLE 2014-10-14 15:33:52 +08:00
Sam Hemelryk d1a370838c MDL-46151 cachestore_memcache: set_many now uses set 2014-10-14 20:04:20 +13:00
Frederic Massart 84dd6d42ce MDL-38732 gradereport_grader: Handle simultaneous graders 2014-10-14 13:50:17 +08:00
Adrian Greeve 2baeeeb9fa MDL-46546 core_grades: Move error checking after csv load. 2014-10-14 10:31:03 +08:00
Damyon Wiese 0914be8afe MDL-46235 Admin: Fix typos in mysql_compressed_rows.php cli script 2014-10-14 10:04:41 +13:00
Sam Hemelryk 4ad4c19b58 MDL-46151 cachestore_memcache: now checks extension version for support 2014-10-14 08:27:33 +13:00
AMOS bot a35e7562d5 Automatically generated installer lang files 2014-10-14 00:05:39 +08:00
Tim Hunt 8c0c30dd66 MDL-47646 CURL redirect unit test: handle broken servers 2014-10-13 15:53:26 +01:00
Andrew Nicols 6e2ae29005 MDL-47612 gradereport_grader: Remove max-width for RTL
For some reason, Safari behaves incorrectly when dealing with RTL
content where the table has a max-width of 100%.
2014-10-13 11:28:54 +08:00
Adrian Greeve cdc1f7f709 MDL-46546 gradebook: Grade import gives error on bad csv upload. 2014-10-13 10:48:40 +08:00
Sam Hemelryk d3046f1761 MDL-47631 report_participation: fixed filtering by letter 2014-10-13 12:28:31 +13:00
Rex Lorenzo 5719e3f0fa MDL-47555 core_availability: Issue with page layout & grade restriction
* Set pagelayout before getting section info, otherwise conditional activity renderers will default to the default 'base' layout.
2014-10-10 14:57:41 -07:00
Dan Poltawski 6a10ec4260 weekly release 2.7.2+ 2014-10-10 12:08:54 +01:00
Dan Poltawski 124da5b9bf Merge branch 'install_27_STABLE' of https://git.in.moodle.com/amosbot/moodle-install into MOODLE_27_STABLE 2014-10-10 12:08:51 +01:00
Marina Glancy 2d022e4c3e MDL-47613 wiki: allow searching several words
Thanks to Sandeep B for suggested solution
2014-10-10 16:34:04 +08:00
Kordan 893ded8a91 MDL-47594 core_accesslib: removed three useless lines of code 2014-10-10 08:44:07 +02:00
Dan Marsden 8af706e33b MDL-44548 mod_scorm: force an external sync to check for updated files. 2014-10-10 15:14:50 +13:00
AMOS bot ddda9e2d5f Automatically generated installer lang files 2014-10-10 00:05:31 +08:00
Dan Poltawski 60f462b19d MDL-47497 qformat_gift: fix bad backported behat test 2014-10-09 13:24:24 +01:00
Marina Glancy b530fdbb36 MDL-47585 stats: fixed incorrect user dropdown 2014-10-09 14:35:15 +08:00
Dan Poltawski 79d84a5c72 Merge branch 'MDL-46647-27' of git://github.com/FMCorz/moodle into MOODLE_27_STABLE 2014-10-09 07:10:19 +01:00
Marina Glancy a8812800e5 MDL-47583 atto_managefiles: correctly decode filename 2014-10-09 10:58:44 +08:00
Marina Glancy 3ef132fe0e MDL-47583 tinymce_managefiles: correctly decode filename 2014-10-09 10:55:37 +08:00
Sam Hemelryk 15dfb316cf Merge branch 'MDL-46984_m27' of https://github.com/markn86/moodle into MOODLE_27_STABLE 2014-10-09 09:16:47 +13:00
Dan Poltawski 92cdd5338b Merge branch 'MDL-47536_27' of git://github.com/stronk7/moodle into MOODLE_27_STABLE 2014-10-08 15:24:39 +01:00
Damyon Wiese d682a9d31d Merge branch 'wip-mdl-46987-m27' of https://github.com/rajeshtaneja/moodle into MOODLE_27_STABLE 2014-10-08 21:35:08 +08:00
Tim Hunt da1e9ff3af MDL-47497 qformats gift and xml: basic test of export.
Really, this is just to test the new behat setps, as much as anything.

Note that the details of what is written to the export files is tested in
the unit tests.
2014-10-08 19:54:07 +08:00
Tim Hunt 74d0792515 MDL-47497 behat: steps for basic download testing.
These steps were created by sam marshall and Jes Ackland-Snow at the Open
University. I just altered them to make them a bit more generic, and
submitted them to Moodle core, at the point when I wanted to reuse them
in another plugin.

This commit introduces two new steps:

Then following "XXX" should download "YY" bytes
Then following "XXX" should download between "YY" and "ZZ" bytes

At the moment, this only works for links with href attributes.
2014-10-08 19:54:07 +08:00
Damyon Wiese 3a77bc290a Merge branch 'wip-MDL-47492-m27' of git://github.com/marinaglancy/moodle into MOODLE_27_STABLE 2014-10-08 16:55:48 +08:00
Marina Glancy 1e10504ff8 MDL-47572 libraries: modify unittest to avoid random timing fail
Thanks to Nigel Cunningham
2014-10-08 10:59:46 +08:00
Sam Hemelryk a4534af8b7 Merge branch 'MDL-47470-27' of git://github.com/danpoltawski/moodle into MOODLE_27_STABLE 2014-10-08 12:21:41 +13:00
Sam Hemelryk 2cfba2cb2e Merge branch 'MDL-47474-27' of https://github.com/bostelm/moodle into MOODLE_27_STABLE 2014-10-08 11:52:23 +13:00
Sam Hemelryk 80165b6ee8 Merge branch 'MDL-47481-m27' of https://github.com/sammarshallou/moodle into MOODLE_27_STABLE 2014-10-08 11:51:38 +13:00
Sam Hemelryk 2e16cac8a2 Merge branch 'MDL-47484_27' of git://github.com/aolley/moodle into MOODLE_27_STABLE 2014-10-08 11:40:53 +13:00
Sam Hemelryk 80802921d4 Merge branch 'MDL-46182_MOODLE_27_STABLE' of https://github.com/NeillM/moodle into MOODLE_27_STABLE 2014-10-08 11:28:32 +13:00
Sam Hemelryk e3eea31d67 Merge branch 'MDL-28075_27' of git://github.com/timhunt/moodle into MOODLE_27_STABLE 2014-10-08 10:57:22 +13:00
Sam Hemelryk dae0eba253 Merge branch 'MDL-46391-27' of https://github.com/DmitryNefedov/moodle into MOODLE_27_STABLE 2014-10-08 10:45:37 +13:00
Sam Hemelryk 94b702b49b Revert "MDL-46978 gradebook: Edit grade item changes visibility of category"
This reverts commit a7566c53e5.
2014-10-08 10:37:29 +13:00
AMOS bot 3281f6b0ad Automatically generated installer lang files 2014-10-08 00:05:28 +08:00
Dan Poltawski c2b4959b36 Merge branch 'MDL-47518_27' of https://github.com/rlorenzo/moodle into MOODLE_27_STABLE 2014-10-07 14:33:07 +01:00
Frederic Massart 256616c5e0 MDL-46647 core_grades: Adding tests for fetch_all_helper() 2014-10-07 15:26:40 +08:00
Eloy Lafuente (stronk7) 1d09472f1f MDL-46647 grades: Fix fetch_all_helper() towards cross-db
That helper, used to fetch information from DB by all the grade_object
chidren classes was not behaving properly handling TEXT/CLOB columns.

Instead of creating a property within every class listing the
existing columns, it seems to be a better solution to instrospect
the database metadata (cached) to ensure the correct SQL is generated
in every case.
2014-10-07 15:26:40 +08:00
Sam Hemelryk 4e6d7fb30b Merge branch 'MDL-36460-27' of git://github.com/andrewnicols/moodle into MOODLE_27_STABLE 2014-10-07 15:16:59 +13:00
Marina Glancy fce57fd26e MDL-31936 workshop: version bump and @since phpdocs 2014-10-07 10:10:12 +08:00
Marina Glancy 58f87868d0 Merge branch 'MDL-31936-27-workshop-reset' of git://github.com/mudrd8mz/moodle into MOODLE_27_STABLE 2014-10-07 10:10:06 +08:00
Petr Skoda e22af76803 MDL-41593 admin: use default setting if preventexecpath active
This resolves problems when installing Moodle
and addons when preventexecpath active.

Please note the admin_setting_configfile is still
incorrectly restricted - this will be resolved by
MDL-40949.
2014-10-07 11:30:32 +13:00
Sam Hemelryk 98844557ae Merge branch 'MDL-46295-27' of git://github.com/damyon/moodle into MOODLE_27_STABLE 2014-10-07 10:36:53 +13:00
David Mudrák abb876c334 MDL-31936 workshop: Improve unit tests for the course reset support 2014-10-06 23:30:18 +02:00
Sam Hemelryk d5eea92499 Merge branch 'MDL-46978-27' of https://github.com/danielneis/moodle into MOODLE_27_STABLE 2014-10-07 10:26:25 +13:00
David Mudrák 5de218bcb3 MDL-31936 workshop: Generator able to create submissions and assessments
This is a basic implementation of the actual content generation in the workshop
generator. Note the we do not generate actual grading form data (which is what
the grading strategy plugins would do), just their results.
2014-10-06 23:13:54 +02:00
David Mudrák fcb3fe7238 MDL-31936 workshop: Add more options to the course reset form
This is built upon original work by Michael Hughes. We now have separate
settings for deleting workshop submissions, assessments and for resetting the
workshop phase.
2014-10-06 23:13:53 +02:00
David Mudrák 5d0c6ae61e MDL-31936 workshop: Delete attachments on record removal
The methods workshop::delete_submission() and workshop::delete_assessment() did
not delete files (embedded and attachments) associated with the given
submission or assessment. This is fixed now.

Additionally, the delete_assessment() method now cleans-up records from the
table workshop_grades, too. This internal workshop API still does not give
workshop subplugins a chance to clean up their data, should they store them in
their own tables instead of the workshop_grades one. This should be improved in
the future yet.
2014-10-06 23:13:53 +02:00
David Mudrák 9d873205b1 MDL-31936 workshop: Fix overall feedback content processing order
This is unrelated to the issue but was spotted while testing it. The order of
format_text() and file_rewrite_pluginfile_urls() was incorrect and threw
debugging message. Fixed now.
2014-10-06 23:13:53 +02:00
Dan Poltawski 647c6bf8a5 Merge branch 'MDL-46054-27' of git://github.com/jleyva/moodle into MOODLE_27_STABLE 2014-10-06 16:01:31 +01:00
Dan Poltawski 8669550962 Merge branch 'MDL-45504_27' of git://github.com/stronk7/moodle into MOODLE_27_STABLE 2014-10-06 15:48:11 +01:00
Dan Poltawski 17bdcc11aa Merge branch 'MDL-47426_27' of git://github.com/timhunt/moodle into MOODLE_27_STABLE 2014-10-06 08:56:26 +01:00
Gregory Faller d2d568a034 MDL-46712: Center EditPDF window on browser resize / zoom 2014-10-06 14:54:45 +08:00
Andrew Nicols ac4f596acd MDL-47183: viewhiddenactivities should use the module context
Thanks to Paulo Matos for the forum part of this change.
2014-10-06 12:22:09 +08:00
Eloy Lafuente (stronk7) 24b4ee9814 MDL-47536 timezones: update to 2014h (2296 rules) 2014-10-06 01:55:15 +02:00
Eloy Lafuente (stronk7) 2e261e4a88 MDL-45504 environment: define 2.8 requirements
No changes from 2.7, so this is a simple copy of them.

The MyISAM case (MDL-46064) will be considered for 2.9.
2014-10-06 01:16:28 +02:00
Sam Hemelryk b2ea054081 Merge branch 'm27_MDL-47316' of git://git.catalyst.net.nz/moodle-r2 into MOODLE_27_STABLE 2014-10-06 11:15:50 +13:00
AMOS bot db94a9a86e Automatically generated installer lang files 2014-10-05 00:05:34 +08:00
Daniel Neis Araujo a7566c53e5 MDL-46978 gradebook: Edit grade item changes visibility of category 2014-10-03 14:08:27 -03:00
Neill Magill 68153616be MDL-46182 Inefficient query during Moodle upgrade on course_section table.
This part of the code is changing an index on the course_sections table to be unique, for this to happen in the upgrade script the index must be deleted and then the new version added.

Before this change the following was being done:

* The index is removed
* A query to delete records that were not unique on this index is performed
* The unique version of the index is added

After this change the following happens:

* A query to delete records that were not unique on this index is performed
* The index is removed
* The unique version of the index is added

When the original index is present the query uses it, which greatly improves the execution plan.

Before the change an upgrade on a site with around 387967 course_section records the upgrade would be stuck on the delete query for many hours, after the change the time can be measured in minutes.
2014-10-03 10:25:54 +01:00
Michael Hughes 079944a878 MDL-31936 workshop: Add unit tests for the workshop reset 2014-10-03 11:06:46 +02:00
Michael Hughes a55a982746 MDL-31936 workshop: Initial implementation of the course reset support 2014-10-03 11:03:47 +02:00
David Mudrák ad3d8dbaa3 MDL-44536 workshop: Fix missing phpDoc for user report callbacks 2014-10-03 10:00:16 +02:00
David Mudrák 78ed559f5f MDL-44536 workshop: Instantiate with the plain course module record
When the workshop class constructor signature was designed, the class
cm_info did not exist yet. Instead, plain course modules records were
used everywhere - including the $mod parameter in the
workshop_user_complete() callback. Even if cm_info is backwards
compatible with the plain data record when it comes to behaviour, it
must not be passed where the workshop API expects the stdClass (coding
error is thrown).

Alternative solution would be to remove the type hinting in the workshop
constructor. That is what the 'assign' class does, for example (the
inline docs describe the expected type to be stdClass, but that is not
forced via the method declaration).

As the problem seems to be pretty sole, I prefer not touching the
workshop internal API for now. So we let the cm_info degrade back into
the stdClass to make the workshop constructor happy without significant
performance lost.
2014-10-03 10:00:16 +02:00
Andrew Nicols fbb6559b82 MDL-36460 mod_forum: Restrict forum subsription list based on availability info 2014-10-03 11:56:43 +08:00
Rex Lorenzo d0b0227d4e MDL-47518 report_log: Logfiles of single users no longer accessible
* Removing join on courseid if it is the SITEID.
2014-10-02 16:35:02 -07:00
Tim Hunt f812f9b6d2 MDL-28075 question editing: tidy code
Remove an unnecessary else (the if, and else if, always end in a redirect)
and unindent that code.
2014-10-02 21:55:05 +01:00
Tim Hunt e680e70098 MDL-28075 question editing: sort out nav bar when editing in a quiz
If you edited a question from the Edit quiz page in a quiz, the navigation
bar was far too long. This was due to some odd code that was trying too
hard to be clever.

Instead, editing a question is now always treated as being logically within
the question bank for the purposes of navigation. That is, even if the
returnurl will end up taking you back to where you where when you have finished.
2014-10-02 21:54:29 +01:00
Tim Hunt 25a487b90a MDL-47426 assign local roles: rewrite query for better performance.
This is an extremely dangerous query, because it includes the user
table twice, along-side two other potentially large tables,
role_assignments and user_enrolments.

The solution is to rewrite the query so that:

1. The subquery is JOINed, not WHERE ... INed. Typically query
   optimisers handle the JOIN case better.

2. Before the join was role-assignments <-> users <-> subquery.
   That is, everything was linked to u.id.

   Now the linking is role-assignments <-> subquery <-> users,
   so the SELECT DISTINT eu1_u.id FROM {enrolled users} is central.
   That seems to send a strong hint to the query optimiser about
   a good order to execute the query.
2014-10-02 17:10:57 +01:00
Dan Poltawski 29507f2816 weekly release 2.7.2+ 2014-10-02 15:19:05 +01:00
Dan Poltawski c9a4dda024 NOBUG: Fixed file access permissions 2014-10-02 15:19:05 +01:00
Dan Poltawski 885b34c751 Merge branch 'install_27_STABLE' of https://git.in.moodle.com/amosbot/moodle-install into MOODLE_27_STABLE 2014-10-02 15:19:01 +01:00
sam marshall 805122a72f MDL-47481 Availability: Profile condition error if no users 2014-10-02 10:47:06 +01:00
Dan Poltawski 23ba64bdc3 Merge branch 'MDL-37707-27-fixup' of https://github.com/FMCorz/moodle into MOODLE_27_STABLE 2014-10-02 09:50:50 +01:00
Marina Glancy b1cdf13013 MDL-47492 core_grades: Behat test for using scales and mingrade in gradebook 2014-10-02 15:59:53 +08:00
Marina Glancy f4df7d7961 MDL-47492 behat: refer to table column indexes instead of names 2014-10-02 15:59:48 +08:00
Sam Hemelryk 670eb0f171 Merge branch 'MDL-47408-27' of https://github.com/DmitryNefedov/moodle into MOODLE_27_STABLE 2014-10-02 17:31:10 +13:00
Dmitry Nefedov 0d7c8bb4b0 MDL-47408 user: Add checking before adding blog's link.
Checking enableblogs  and bloglevel, userid, constant  BLOG_USER_LEVEL.
2014-10-02 12:21:32 +08:00
Willy Lee 1da93e09d0 MDL-46295 course: add search box to all course listings, manage button when appropriate 2014-10-01 22:37:03 +08:00
Henning Bostelmann cdf3cdd608 MDL-47474 Calendar export: Fix user id in authorization check 2014-10-01 15:24:50 +01:00
Dan Poltawski f857cd49d9 Merge branch 'MDL-47214-27' of github.com:andrewnicols/moodle into MOODLE_27_STABLE 2014-10-01 08:38:20 +01:00
Andrew Nicols 9c8f956e9d MDL-47214 core: IPs should be cleaned 2014-10-01 15:29:30 +08:00
Adam Olley 8e0093973f MDL-47484 atto_indent: Prevent loss of rangy markers in some cases 2014-10-01 13:56:53 +09:30
Frederic Massart 6cc503ee87 MDL-37707 mod_assign: Prevent user from changing grouping in team submissions 2014-10-01 11:29:10 +08:00
Sam Hemelryk c00fb90718 Revert "MDL-47033 general: Fix incorrect use of 'course' layout"
This reverts commit 92f89f593c.
2014-10-01 15:49:25 +13:00
Sam Hemelryk f0f3d01025 Merge branch 'm27_MDL-47404' of https://github.com/danmarsden/moodle into MOODLE_27_STABLE 2014-10-01 15:38:07 +13:00
Dan Marsden ac1751b29a MDL-47404 filelib: Prevent flash from treating files as uploads
added to send_stored_file as well.
2014-10-01 15:08:51 +13:00
Sam Hemelryk c90137561b MDL-47428 language: fixed typo 2014-09-30 23:43:35 +02:00
zbdd 5d39d47ab6 MDL-42993 auth: spaces removed from usernames by default only
Functionality by default does not change with this patch.
However spaces are no longer stripped when cleaning usernames IF
$CFG->extendedusernamechars has been set.

Also included 2 trim statements where small issues were found with reading
external usernames in that  were not filtered for trailing whitespaces.
2014-10-01 08:29:28 +13:00
Dan Poltawski 622c15ca7c MDL-47470 behat: fix 'I navigate to' exception
When a child page is not found
2014-09-30 15:30:11 +01:00
Yolanda Ordóñez Rufat 91d693643b MDL-47466 calendar: use get_in_or_equal() in function calendar_get_events to fix problem with ORA-01795 2014-09-30 14:07:26 +02:00
Dan Poltawski 3ddbd23f09 Merge branch 'MDL-47385-27' of https://github.com/DmitryNefedov/moodle into MOODLE_27_STABLE 2014-09-30 11:41:40 +01:00
Dan Poltawski 2e17bba40b Merge branch 'm27_MDL-47097' of https://github.com/totara/moodle into MOODLE_27_STABLE 2014-09-30 08:31:01 +01:00
Dan Poltawski 85cb248688 Merge branch 'MDL-32275-27' of git://github.com/gurgus/moodle into MOODLE_27_STABLE 2014-09-30 08:29:03 +01:00
Julien Boulen 59ae54dffe MDL-46984 core_course: added grouping name for activities with no link 2014-09-29 20:45:14 -07:00
Stephen Bourget c4829d57e2 MDL-46084 Calendar: Fix importing of full day events from Google 2014-09-30 11:28:43 +13:00
Sam Hemelryk ca4bb8441c Merge branch 'm27_MDL-47170' of https://github.com/totara/moodle into MOODLE_27_STABLE 2014-09-30 10:03:17 +13:00
Sam Hemelryk 6657094417 Merge branch 'MDL-47214-ClientIp-wrong-with-multiple-proxies_27_STABLE' of https://github.com/mhughes2k/moodle into MOODLE_27_STABLE 2014-09-30 08:48:28 +13:00
Dan Poltawski 196f94ec09 Merge branch 'MDL-46920-27' of git://github.com/jethac/moodle into MOODLE_27_STABLE 2014-09-29 16:25:48 +01:00
Juan Leyva 495ab49e82 MDL-46054 web_services: Fixed invalid parameter definitions 2014-09-29 16:02:06 +02:00
Marina Glancy 7f6875287f MDL-46054 web_services: wrong key in exception string 2014-09-29 16:02:06 +02:00
Marina Glancy 395c27abcf MDL-46054 web_services: bug fix in core_user_get_users
Thanks to Mikko Rantanen for the patch
2014-09-29 16:01:53 +02:00
Dan Poltawski b79a21df51 Merge branch 'wip-mdl-47154-m27' of https://github.com/rajeshtaneja/moodle into MOODLE_27_STABLE 2014-09-29 12:50:12 +01:00
Dan Poltawski 6fdf8bcc53 Merge branch 'MDL-47069-27-plugin-dependency' of git://github.com/mudrd8mz/moodle into MOODLE_27_STABLE 2014-09-29 12:46:53 +01:00
Dan Poltawski 6b57d95fe3 Merge branch 'MDL-47322-m27' of https://github.com/sammarshallou/moodle into MOODLE_27_STABLE 2014-09-29 10:55:13 +01:00
Dan Poltawski 43bac317f8 Merge branch 'wip_MDL-47333_m27_fonts' of https://github.com/skodak/moodle into MOODLE_27_STABLE 2014-09-29 10:44:27 +01:00
Dmitry Nefedov 3234f4324e MDL-46391 messages: Add search button under contact list.
Add search button to only Message navigation -> Contacts section.
2014-09-29 17:19:30 +08:00
Sam Hemelryk 6e0760db2b Merge branch 'MDL-47033_27' of https://github.com/totara/openbadges into MOODLE_27_STABLE 2014-09-29 15:18:09 +13:00
Sam Hemelryk 1fcb39fbb2 Merge branch 'wip-MDL-47398-m27' of git://github.com/marinaglancy/moodle into MOODLE_27_STABLE 2014-09-29 14:35:15 +13:00
Sam Hemelryk 3d9daae5a9 Merge branch 'MDL-47408-27' of https://github.com/DmitryNefedov/moodle into MOODLE_27_STABLE 2014-09-29 14:32:51 +13:00
Sam Hemelryk 5f78ef781f Merge branch 'm27_MDL-47404' of https://github.com/danmarsden/moodle into MOODLE_27_STABLE 2014-09-29 14:23:31 +13:00
Sam Hemelryk c05e69c836 Merge branch 'MDL-39190_27' of https://github.com/pauln/moodle into MOODLE_27_STABLE 2014-09-29 14:20:08 +13:00
David Mudrák e0acb17830 MDL-47411 admin: Check if the plugin is a git submodule on uninstalling
Credit goes to PJ King. I was trying to add unit tests for this new
behaviour but it turned out there are many hard-coded dependencies and
it's not easy to make the whole machinery support alternative location
of testable (fake) plugins.
2014-09-29 01:43:57 +02:00
Sam Hemelryk dfefc00f56 Merge branch 'MDL-37707-27' of git://github.com/FMCorz/moodle into MOODLE_27_STABLE 2014-09-29 11:35:32 +13:00
Sam Hemelryk 3f6243f4be Merge branch 'MDL-42974-m27' of https://github.com/sammarshallou/moodle into MOODLE_27_STABLE 2014-09-29 11:21:24 +13:00
Sam Hemelryk 015d47f67d Merge branch 'MDL-47378-27' of git://github.com/danpoltawski/moodle into MOODLE_27_STABLE 2014-09-29 11:19:10 +13:00
Sam Hemelryk 37fe4b68ea Merge branch 'MDL-43566-27' of https://github.com/willylee/moodle into MOODLE_27_STABLE 2014-09-29 09:51:45 +13:00
Sam Hemelryk 95944b32fd Merge branch 'MDL-47381_27' of git://github.com/timhunt/moodle into MOODLE_27_STABLE 2014-09-29 09:06:42 +13:00
Sam Hemelryk 7686d4b3b7 Merge branch 'MDL-47380-m27' of https://github.com/sammarshallou/moodle into MOODLE_27_STABLE 2014-09-29 09:02:57 +13:00
Eloy Lafuente (stronk7) ad39e5550e MDL-47242 theme_bootstrapbase: Fixed whitespace (take2)
Seems that previous whitespace fix was not ok.
2014-09-28 18:33:46 +02:00
AMOS bot 3b008d30cb Automatically generated installer lang files 2014-09-28 00:09:30 +08:00
Dmitry Nefedov 6e9aeadd75 MDL-47408 user: Add enableblogs checking before adding blog's link. 2014-09-27 15:20:21 +08:00
sam marshall dea57f0107 MDL-47380 Availability: Editing interface broken in IE8 2014-09-26 15:46:02 +01:00
sam marshall eb2e5d8a83 MDL-42974 UI: Modal dialogs do not work in IE8 2014-09-26 15:45:43 +01:00
sam marshall 0e290bc008 MDL-47322 Availability: empty availability should be saved as null 2014-09-26 15:43:53 +01:00
Tim Hunt df9589e32c MDL-47381 qformat: Behat tests have wrong plugin type. 2014-09-26 11:30:41 +01:00
Dave Cooper 6b4ab27d4f MDL-32275 enrol: Last site access column now shows last course access 2014-09-26 11:29:30 +08:00
Petr Skoda 207f4b22cc MDL-47333 fix support for custom fonts in tcpdf 2014-09-26 13:58:54 +12:00
David Mudrák 4a3dd577a9 MDL-47069 admin: Add option to upload required ZIP at the check page
The plugins check page displays other plugins that the current one
depends on.  Previously, we always displayed the other plugin as a link
to the plugins directory. This did not work well in two scenarios:

* The admin wants/needs to upload the other plugin from the ZIP file
  (e.g. it is not available in the plugins directory),

* the other plugin is actually a standard plugin that is not supposed to
  be registered with the plugins directory.

This patch displays the Install or Upload or Check for updates links
next to the required plugin instead, as appropriate.
2014-09-25 16:49:05 +02:00
Dmitry Nefedov d1ab9d16ac MDL-47385 coursecat: Mistake line in phpdocs deleted. 2014-09-25 21:16:31 +08:00
Willy Lee 387ec15d2d MDL-43566 course: add delete icon to search returns in course management listings 2014-09-25 05:59:32 -07:00
Dan Poltawski 8c85081478 weekly release 2.7.2+ 2014-09-25 11:18:03 +01:00
Dan Poltawski c52defd7c4 Merge branch 'install_27_STABLE' of https://git.in.moodle.com/amosbot/moodle-install into MOODLE_27_STABLE 2014-09-25 11:18:00 +01:00
Marina Glancy 3c3012388d MDL-47398 core_grades: fix grade category generator 2014-09-25 10:32:35 +08:00
Dan Marsden 68406d778c MDL-47404 filelib: Prevent flash from treating files as uploads
Flash treats files as uploads if filename is passed in content-disposition
this causes security to be enforced that causes issues with SCORM packages
2014-09-25 13:22:17 +12:00
Sam Hemelryk d593522699 MDL-47242: Fixed whitespace 2014-09-25 12:19:41 +12:00
Dan Poltawski 5921dfb9c4 MDL-47378 mod_assign: prevent debugging notice
Parameters come out of get_user_preferences as strings.
2014-09-24 15:42:22 +01:00
Pavel Sokolov 155e70008b MDL-37707 mod_assign: Prevent user from switching to and from team submissions 2014-09-24 16:08:13 +08:00
Jetha Chan b4dad816b1 MDL-47242 theme_bootstrapbase: inverted color and RTL fixes 2014-09-24 15:54:57 +08:00
David Mudrák 2795a7cee0 MDL-47248 Use new Moodle logo for RSS feeds generated by Moodle
Themes can override this logo as any other core pix file. The new logo copied
from https://moodle.org/logo/ and resized to match the previous logo size
(140x35px).
2014-09-24 01:38:12 +02:00
Eloy Lafuente (stronk7) 5d6d351f02 Merge branch 'MDL-47224_27' of git://github.com/aolley/moodle into MOODLE_27_STABLE 2014-09-24 01:27:06 +02:00
Eloy Lafuente (stronk7) d9016fd581 MDL-47180 qformat_webct: whitespace cleanup 2014-09-24 00:58:04 +02:00
Eloy Lafuente (stronk7) bacf193e66 Merge branch 'MDL-47180_27' of git://github.com/jmvedrine/moodle into MOODLE_27_STABLE 2014-09-24 00:41:01 +02:00
AMOS bot ea6b6393e4 Automatically generated installer lang files 2014-09-24 00:05:56 +08:00
Jean-Michel Vedrine ba50cd880c MDL-47180 qformat_webct: Import of calculated questions broken 2014-09-23 14:47:36 +02:00
Paul Nicholls 86f2e36939 MDL-39190 Javascript: Pop-up calendar days of week wrong
The YUI2 calendar widget (still used via 2in3) uses midnight as the time
component of its Date objects, which triggers a Safari bug resulting in
11pm Saturday being returned instead of midnight Sunday when subtracting
days to get the last few days of the previous month.  This shows up ONLY
on the month after DST begins, if DST begins on the last Sunday of a given
month (and the Calendar widget is set to Sunday as the first day of the
week).  The fix/workaround of using noon instead of midnight is employed
by YUI3 and others.
2014-09-23 16:38:09 +12:00
Sam Hemelryk d56c53c90e Merge branch 'MDL-46811-27' of git://github.com/danpoltawski/moodle into MOODLE_27_STABLE 2014-09-23 16:36:14 +12:00
Jonathan Harker f5fb4991bd MDL-47316 mod_forum: Fix course overview performance regression
make more efficient use of mod_info cache by processing courses
 sequentially.

Change-Id: I03b808c8a7efc42879ec2689fbd2a9fe7a8f1103
2014-09-23 12:55:08 +12:00
Sam Hemelryk 8bcc9fbff7 Merge branch 'MDL-47242-27' of git://github.com/jethac/moodle into MOODLE_27_STABLE 2014-09-23 12:04:31 +12:00
Eloy Lafuente (stronk7) 1d4b21c07d Merge branch 'MDL-47182-27' of git://github.com/danpoltawski/moodle into MOODLE_27_STABLE 2014-09-23 01:52:21 +02:00
Eloy Lafuente (stronk7) 292f350282 Merge branch 'MDL-47269_M27' of https://github.com/nadavkav/moodle into MOODLE_27_STABLE 2014-09-23 01:29:33 +02:00
Eloy Lafuente (stronk7) 2893aa4904 Merge branch 'MDL-47266_27' of git://github.com/timhunt/moodle into MOODLE_27_STABLE 2014-09-23 01:12:22 +02:00
Tim Hunt a733c2ce43 MDL-37998 quiz settings: disableif rules should account for overrides.
Some form fields are disabled if only one attempt is allowed. However,
there may be an override allowing some students more attempts. We need
to account for that possiblity when setting up the disabled if rules.

Note the disabledIf is good for usability on this complex form, which is
why I don't just want to get rid of them.
2014-09-22 16:24:51 +01:00
Dan Poltawski 7e36f977b1 Merge branch 'MDL-47238_guest_27' of https://github.com/andyjdavis/moodle into MOODLE_27_STABLE 2014-09-22 16:13:42 +01:00
Dan Poltawski 42db1010f0 Merge branch 'MDL-47270-core-component-classmap-ordering_27_STABLE' of https://github.com/mpetrowi/moodle into MOODLE_27_STABLE 2014-09-22 16:03:53 +01:00
Dan Poltawski dec70bc47e Merge branch 'MDL-40006_27' of git://github.com/timhunt/moodle into MOODLE_27_STABLE 2014-09-22 11:55:50 +01:00
Dan Poltawski 300510afc1 Merge branch 'MDL-46991-m27' of https://github.com/sammarshallou/moodle into MOODLE_27_STABLE 2014-09-22 10:57:56 +01:00
Nadav Kavalerchik c3676d6c33 MDL-47269 yui/src/dock: Invert dock reset blocks icon, in RTL mode 2014-09-22 11:42:20 +03:00
Rajesh Taneja 6edd1ef671 MDL-46987 report_participation: Count duplicate logs as 1
Some of the actions generate more then 1 event.
Example: forum post create generate:
- post_created and
- accessible_uploaded
events which  gets logged at the same time.
Count them as 1 action and not 2, as it is
single action and report should show 1 and not 2
2014-09-22 15:22:26 +08:00
Marina Glancy fe38ae10d3 MDL-47154 behat: escape user supplied strings in xpath 2014-09-22 13:24:21 +08:00
Rajesh Taneja 7a7546eb64 MDL-47154 behat: extended table head look up to check if header is link
Header can be a link, this step will now look if
header has a text or header link has the text

Part of MDL-46191
2014-09-22 13:24:13 +08:00
Andrew Davis ac9425c993 MDL-47238 core_user: added an error message if guests access user profiles and they aren't allowed to 2014-09-22 11:37:00 +08:00
AMOS bot 2898461aec Automatically generated installer lang files 2014-09-21 00:08:57 +08:00
Tim Hunt 77c9d6d7e5 MDL-40006 searchableselector does not work in IE or Safari.
This fix is a horrible hack, but one I have used for years in tool_editrolesbycap
https://github.com/moodleou/moodle-tool_editrolesbycap/blob/master/yui/capabilityformfield/capabilityformfield.js
and it seems to be reliable.

As an added bonus, I removed the use of YUI2 here.

Also, I fixed the related button in quiz to be GET not POST.
2014-09-19 21:57:56 +01:00
AMOS bot 9dfb587ff8 Automatically generated installer lang files 2014-09-20 00:05:43 +08:00
Adam Olley d629afa0e2 MDL-47224 qtype_calculated: Calculated qtype comment on datasetitems should follow formatting rules 2014-09-19 09:32:54 +09:30
sam marshall 81c4057908 MDL-46991 Availability: Conditional dates not updated on restore 2014-09-18 16:36:38 +01:00
Dan Poltawski 8152e9fa60 weekly release 2.7.2+ 2014-09-18 07:41:10 +01:00
Jetha Chan 73c01865f6 MDL-46920 theme_bootstrapbase: fix dropdown to use data-target 2014-09-17 15:32:40 +08:00
Matt Petro 8349864b0e MDL-47270 core_component: make cache independent of filesystem ordering 2014-09-16 13:18:39 -04:00
Eloy Lafuente (stronk7) 8da5cf92c9 Merge branch 'MDL-46613-27' of git://github.com/jleyva/moodle into MOODLE_27_STABLE 2014-09-16 19:10:52 +02:00
Dan Poltawski 9efa6cf36d MDL-47182 admin: warn about delayed scheduled tasks
Rather than using module cron, use scheduled tasks to work out
if cron has been running recently.

This is not perfect, the admin could disble all tasks, or reschedule
them - but its not complex to compute.
2014-09-16 17:52:10 +01:00
Eloy Lafuente (stronk7) 074b467000 Merge branch 'wip-MDL-47079-m27' of git://github.com/marinaglancy/moodle into MOODLE_27_STABLE 2014-09-16 18:38:53 +02:00
Tim Hunt 3024caa173 MDL-47266 quiz: fix restore log message. 2014-09-16 14:42:31 +01:00
Juan Leyva 439a1a4d8c MDL-46613 grades ws: Fixed external function declaration
Gradebook items with overridden grades was causing error as Web
Services response

coding style
2014-09-16 10:08:28 +02:00
Damyon Wiese 35fa1656ab MDL-44257 Message: Update phpdocs for email_to_user function 2014-09-16 15:07:48 +08:00
Damyon Wiese 0bdbe84828 Merge branch 'MDL-44257-27' of git://github.com/lameze/moodle into MOODLE_27_STABLE 2014-09-16 15:03:53 +08:00
Simey Lameze 7972603cc4 MDL-44257 lib: fix the attachment code to accept tempdir and dataroot.
Credit goes to Damyon, thanks.
2014-09-16 10:34:05 +08:00
Simey Lameze 1780c99e06 MDL-44257 message: added test to make sure the stored file still exists 2014-09-16 10:23:58 +08:00
Simey Lameze bd2519c596 MDL-44257 message: check if the attachment exists before remove it
Credit goes to Mark Nielsen, thanks.
2014-09-16 10:23:58 +08:00
Marina Glancy df45195a04 MDL-47079 user: behat test for deleting users 2014-09-16 09:54:07 +08:00
Eloy Lafuente (stronk7) a0f94236fa Merge branch 'MDL-46588-27' of git://github.com/jleyva/moodle into MOODLE_27_STABLE 2014-09-16 00:23:00 +02:00
Dan Poltawski b5ecf0dbae Merge branch 'MDL-46195_27' of git://github.com/timhunt/moodle into MOODLE_27_STABLE 2014-09-15 16:07:09 +01:00
Dan Poltawski e7697e57f7 Merge branch 'MDL-46331_27' of git://github.com/timhunt/moodle into MOODLE_27_STABLE 2014-09-15 12:18:56 +01:00
Dan Poltawski 7194a13a33 Merge branch 'wip-MDL-47187-m27' of git://github.com/marinaglancy/moodle into MOODLE_27_STABLE 2014-09-15 11:21:37 +01:00
Jetha Chan aace1408ec MDL-47242 theme_bootstrapbase: fix nested custom_menu responsive display 2014-09-15 17:36:39 +08:00
Damyon Wiese 8693c8f373 Merge branch 'MDL-47143_27' of git://github.com/timhunt/moodle into MOODLE_27_STABLE 2014-09-15 16:14:02 +08:00
Damyon Wiese 86df808aa5 Merge branch 'MDL-47167_27' of git://github.com/timhunt/moodle into MOODLE_27_STABLE 2014-09-15 15:55:21 +08:00
Damyon Wiese d2c77503c5 Merge branch 'MDL-46944-27-lti-iframe' of git://github.com/schmod/moodle into MOODLE_27_STABLE 2014-09-15 15:25:07 +08:00
Brian Barnes e7da6db9ca MDL-47186 calendar: Changed month name to h2 from h1 2014-09-15 14:20:59 +08:00
Damyon Wiese f2211e7c9a Merge branch 'MDL-46747_27' of git://github.com/timhunt/moodle into MOODLE_27_STABLE 2014-09-15 14:05:58 +08:00
Damyon Wiese 9f54825718 Merge branch 'MDL-47209-27' of git://github.com/FMCorz/moodle into MOODLE_27_STABLE 2014-09-15 13:56:32 +08:00
Damyon Wiese 86e09bfb9c Merge branch 'MDL-47208_27' of git://github.com/aolley/moodle into MOODLE_27_STABLE 2014-09-15 12:18:39 +08:00
Damyon Wiese 574b53efde Merge branch 'MDL-46088_27' of git://github.com/timhunt/moodle into MOODLE_27_STABLE 2014-09-15 11:32:29 +08:00
Juan Leyva b189a26f3d MDL-46588 web services: Fixed system context instanceid eq 0 case 2014-09-12 11:26:42 +02:00
Juan Leyva 3c354a42ed MDL-46588 web services: Unit tests added 2014-09-12 11:26:42 +02:00
Juan Leyva 4712967f4c MDL-46588 web services: Fixed invalid check of empty contextid in function get_context_from_params 2014-09-12 11:26:42 +02:00
Adam Olley 2181953d43 MDL-47208 core_availability: Return false when cm isnt in modinfo list
If a cm isn't in modinfo's cm list, then the user shouldn't be able to see that cm.
This fixes an issue where hidden activities would cause users to be unable to use moodle.
2014-09-12 09:15:26 +09:30
Tim Hunt ca01459727 MDL-46747 questions: add More info link to qbehaviour help.
Thanks to Tony Gardner-Medwin for the suggestion.
2014-09-11 16:13:45 +01:00
Dan Poltawski 9a45421093 weekly release 2.7.2+ 2014-09-11 15:44:37 +01:00
Dan Poltawski ee566d2482 Merge branch 'install_27_STABLE' of https://git.in.moodle.com/amosbot/moodle-install into MOODLE_27_STABLE 2014-09-11 15:44:34 +01:00
Michael Hughes ce31bc5d36 MDL-47214 General: Multiple IP addresses in X-Forwarded-For Fixed
Fixed getremoteaddr() function handle multiple IP addresses
2014-09-11 15:01:25 +01:00
Frederic Massart c7dfb90672 MDL-47209 repository_skydrive: Use new oauth URLs 2014-09-11 15:17:41 +08:00
Marina Glancy 871f534785 MDL-46834 dndupload: check course dndupload cap on course level 2014-09-11 12:12:43 +08:00
AMOS bot f374e53b8d Automatically generated installer lang files 2014-09-11 00:05:40 +08:00
Andrew Schmadel 19b0b0bb7f MDL-46844 Embed LTI External Tools with an IFrame
Clears up weird browser issues that occur when embedding content with an
`<object>` tag.
2014-09-10 09:01:07 -04:00
Marina Glancy 6f7320673b MDL-46834 dndupload: check course dndupload cap on course level 2014-09-10 08:08:40 +01:00
Marina Glancy 12a88823f0 MDL-47187 assign: fixed timing unittest failure 2014-09-10 11:57:02 +08:00
Frederic Massart 28dfc4eebc MDL-46818 core_grade: Prevent form checker to catch move fields 2014-09-10 10:44:02 +08:00
Tim Hunt 3bafe8d0c4 MDL-46331 GIFT question import was breaking content inside <pre>.
Also, adding a Behat tests to verify GIFT import works without errors
(but leaving the detailed testing for the unit tests).
2014-09-09 22:59:20 +01:00
Tim Hunt 074aec1846 MDL-47167 XML question format: behat tests 2014-09-09 22:57:00 +01:00
Tim Hunt aef4661635 MDL-46195 WebCT question import: Behat test 2014-09-09 22:54:42 +01:00
AMOS bot e9d4d084e3 Automatically generated installer lang files 2014-09-10 00:05:33 +08:00
Dan Poltawski 5101f9b131 MDL-46811 update download.moodle.org url to https
https is now the prefferd protocol for this site
2014-09-09 16:37:28 +01:00
Marina Glancy 0a70f84dde Merge branch 'MDL-46997-27' of git://github.com/damyon/moodle into MOODLE_27_STABLE 2014-09-09 17:18:53 +08:00
Marina Glancy a8d69de7bd Merge branch 'm27_MDL-47076' of git://github.com/totara/moodle into MOODLE_27_STABLE 2014-09-09 17:13:09 +08:00
Dan Poltawski b30bf418c8 Merge branch 'wip-MDL-47080-m27' of git://github.com/marinaglancy/moodle into MOODLE_27_STABLE 2014-09-09 10:06:03 +01:00
Dan Poltawski 20758f187d Merge branch 'wip-MDL-46834-m27' of git://github.com/marinaglancy/moodle into MOODLE_27_STABLE 2014-09-09 08:11:12 +01:00
Damyon Wiese 589e140d83 MDL-46997 Grades: fix sum of grades with hidden items with differing maxgrades 2014-09-09 14:02:14 +08:00
Damyon Wiese 78c55e13a2 MDL-46997 Grades: Fix aggregation when hiding is excluded and items have nested dependencies
Includes a unit test for the dependency flattening function.
2014-09-09 14:02:13 +08:00
Damyon Wiese b5415ecd9d MDL-46997 Grades: Improve the behat tests for grade aggregation
The tests now cover hidden grades in sub categories for all aggregation types. This change
includes a data generator for grade categories, with unit tests and behat tests for
the generator.

Conflicts:
	admin/tool/behat/tests/behat/data_generators.feature
	grade/tests/behat/grade_aggregation.feature
	lib/tests/behat/behat_data_generators.php
2014-09-09 14:02:06 +08:00
David Curry 3ae804809e MDL-47076 badges: Add checks to user fields during badges restoration
Change-Id: I49d2137666d2d7c1f6abca7ae83c07b326d9b0c4
2014-09-09 16:20:41 +12:00
Brian Barnes 90f7b090b9 MDL-47170 tiny_mce: Fixed display of bullets in rtl languages 2014-09-09 15:56:41 +12:00
Marina Glancy d0965c1dc4 MDL-46834 dndupload: Hide dnd message when user cant upload files 2014-09-09 10:03:25 +08:00
Marina Glancy 7f0bfd592e MDL-46834 filepicker: dnd upload should respect the current context id 2014-09-09 10:03:25 +08:00
Eloy Lafuente (stronk7) 309c82bf0e Merge branch 'm27_MDL-47054' of git://github.com/totara/moodle into MOODLE_27_STABLE 2014-09-09 02:19:42 +02:00
Tim Hunt aec38d6b33 MDL-46195 fix error handling. 2014-09-08 22:26:33 +01:00
Tim Hunt c73d96bc91 MDL-46195 Fix fractionsaddwrong string component in lesson & qformat_webct.
I know. You should not refer to strings from other plugins, but

* qformat_webct is importing multichoice questions in that bit of code.
  I suppose a pedant would say that qformat_webct should declare dependencies
  on all the qtypes it relies on, but that would be silly.

* Lesson should be using the question engine, rather than doing its own thing.
2014-09-08 21:57:51 +01:00
Dan Poltawski 937ccd60b2 Merge branch 'MDL-40451-m27-random-glossary-block-title' of git://github.com/amandadoughty/moodle into MOODLE_27_STABLE 2014-09-08 17:26:57 +01:00
Dan Poltawski 98cf5b4f0c Merge branch 'wip-MDL-45602-m27' of git://github.com/marinaglancy/moodle into MOODLE_27_STABLE 2014-09-08 16:30:56 +01:00
Dan Poltawski 01afa79fe7 Merge branch 'MDL-46586-27' of git://github.com/jleyva/moodle into MOODLE_27_STABLE 2014-09-08 15:31:12 +01:00
Dan Poltawski 9b31e3bc3f Merge branch 'wip-MDL-43739-m27' of git://github.com/marinaglancy/moodle into MOODLE_27_STABLE 2014-09-08 15:16:39 +01:00
Dan Poltawski ee977370d2 Merge branch 'MDL-46982_m27' of https://github.com/shashirepo/moodle into MOODLE_27_STABLE 2014-09-08 12:22:28 +01:00
Dan Poltawski 5e61e7b667 Merge branch 'MDL-47014-27' of git://github.com/jleyva/moodle into MOODLE_27_STABLE 2014-09-08 12:19:34 +01:00
Dan Poltawski 9ded19fe12 Merge branch 'wip-MDL-46254-m27' of git://github.com/marinaglancy/moodle into MOODLE_27_STABLE 2014-09-08 12:16:12 +01:00
Juan Leyva 95afe143d7 MDL-47014 airnotifier: Missing require of filelib.php 2014-09-08 11:46:50 +02:00
Marina Glancy dc2e48bda7 Merge branch 'MDL-46818_m27' of git://github.com/markn86/moodle into MOODLE_27_STABLE 2014-09-08 14:05:06 +08:00
Marina Glancy 5260b523c3 MDL-43739 block_course_overview: allow resorting of big number of courses
previously an exception was thrown if the user preference exceeds 1333 chars
2014-09-08 14:00:48 +08:00
Marina Glancy 55c051f352 MDL-47080 theme: call format_string on site shortname 2014-09-08 13:57:40 +08:00
Marina Glancy f0dd12dfc1 MDL-46254 theme: apply filters to theme footnote 2014-09-08 13:57:17 +08:00
Marina Glancy 55111d2bf4 MDL-45602 behat: add members to cohorts 2014-09-08 13:56:46 +08:00
Marina Glancy b7b5d98a24 Merge branch 'MDL-46564_27' of https://github.com/totara/openbadges into MOODLE_27_STABLE 2014-09-08 13:49:41 +08:00
Marina Glancy 09deaef4e9 Merge branch 'MDL-46821-27' of git://github.com/ankitagarwal/moodle into MOODLE_27_STABLE 2014-09-08 13:49:28 +08:00
Marina Glancy bd8eae5245 Merge branch 'MDL-46761_27' of git://github.com/timhunt/moodle into MOODLE_27_STABLE 2014-09-08 13:49:16 +08:00
Marina Glancy 7b6eb2a1ac Merge branch 'MDL-46587-27' of git://github.com/jleyva/moodle into MOODLE_27_STABLE 2014-09-08 13:49:01 +08:00
Marina Glancy 36d9887093 Merge branch 'MDL-44304-27' of git://github.com/damyon/moodle into MOODLE_27_STABLE 2014-09-08 12:58:12 +08:00
Tim Hunt 16ebf7a574 MDL-47143 questions: fix default for question_preview/marks setting. 2014-09-07 12:58:30 +01:00
Tim Hunt 1d02898b38 MDL-46761 fix PHPdocs on question_usage_by_activity::get_total_mark
Thanks to Tony Gardner-Medwin for spotting this.
2014-09-07 11:39:28 +01:00
Tim Hunt cb81111118 MDL-46088 Impossible to click on Atto in a Quiz in 'Secure' mode. 2014-09-06 18:18:36 +01:00
Juan Leyva 5bc6887180 MDL-46587 files: Invalid $itemid conversion in core_files_get_files Web Service 2014-09-05 13:45:52 +02:00
Juan Leyva 18aba19678 MDL-46586 files: Invalid return parameters definition in core_files_get_files external function 2014-09-05 13:41:52 +02:00
shashirepo ad2b5cdd9f MDL-46982 core: fixes wrong opening div tag 2014-09-05 10:21:30 +05:30
Yuliya Bozhko 92f89f593c MDL-47033 general: Fix incorrect use of 'course' layout
It should use 'incourse' layout in most cases

Signed-off-by: Yuliya Bozhko <yuliya.bozhko@totaralms.com>
2014-09-05 09:30:21 +12:00
Brian Barnes 4ce01c9d96 MDL-47097 theme: Fixed issue with dd's sliding up 2014-09-04 14:25:12 +12:00
Brian Barnes 5c779defab MDL-47054 theme: fixed issue with the user rtl table 2014-09-04 09:38:42 +12:00
Amanda Doughty 7740ad458d MDL-40451 block/glossary_random Fixed missing header when adding new block 2014-09-03 14:04:04 +01:00
Yuliya Bozhko 6797273854 MDL-46564 badges: Fix 'All' option in badges block
Signed-off-by: Yuliya Bozhko <yuliya.bozhko@totaralms.com>
2014-09-03 18:45:04 +12:00
Ankit Agarwal d99bb10f68 MDL-46821 gradereport_user: Fix background color of user report 2014-09-03 12:12:18 +05:30
Mark Nelson 9d4861fa75 MDL-46818 core_grades: added YUI form change validation 2014-09-01 23:02:33 -07:00
Virgil Ashruf db765d575b MDL-45636 course_rest: changed modcontext to coursecontext 2014-09-01 11:27:07 +02:00
Petr Skoda 91f1dbd319 MDL-46235 ddl: add support for large number of text fields in one database table 2014-09-01 08:42:52 +12:00
Damyon Wiese a02eefb35e MDL-44304 assignfeedback_editpdf: Fix fatal error when viewing team assignments with editpdf responses. 2014-08-21 12:09:39 +08:00
Damyon Wiese 6a449a9719 MDL-44304 assignfeedback_editpdf: Behat test for group submissions 2014-08-21 12:09:39 +08:00
366 changed files with 8645 additions and 3907 deletions
+202
View File
@@ -0,0 +1,202 @@
<?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/>.
/**
* MySQL table row compression tool tool.
*
* @package core
* @copyright 2014 Totara Learning Solutions Ltd {@link http://www.totaralms.com/}
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
* @author Petr Skoda <petr.skoda@totaralms.com>
*/
define('CLI_SCRIPT', true);
require(dirname(__FILE__).'/../../config.php');
require_once($CFG->libdir . '/clilib.php');
if ($DB->get_dbfamily() !== 'mysql') {
cli_error('This script is used for MySQL databases only.');
}
$engine = strtolower($DB->get_dbengine());
if ($engine !== 'innodb' and $engine !== 'xtradb') {
cli_error('This script is for MySQL servers using InnoDB or XtraDB engines only.');
}
list($options, $unrecognized) = cli_get_params(
array('help' => false, 'info' => false, 'list' => false, 'fix' => false, 'showsql' => false),
array('h' => 'help', 'i' => 'info', 'l' => 'list', 'f' => 'fix', 's' => 'showsql')
);
if ($unrecognized) {
$unrecognized = implode("\n ", $unrecognized);
cli_error(get_string('cliunknowoption', 'admin', $unrecognized));
}
$help =
"Script for detection of row size problems in MySQL InnoDB tables.
By default InnoDB storage table is using legacy Antelope file format
which has major restriction on database row size.
Use this script to detect and fix database tables with potential data
overflow problems.
Options:
-i, --info Show database information
-l, --list List problematic tables
-f, --fix Attempt to fix all tables (requires SUPER privilege)
-s, --showsql Print SQL statements for fixing of tables
-h, --help Print out this help
Example:
\$ sudo -u www-data /usr/bin/php admin/cli/mysql_compressed_rows.php -l
";
/** @var mysql_sql_generator $generator */
$generator = $DB->get_manager()->generator;
$info = $DB->get_server_info();
$filepertable = $DB->get_record_sql("SHOW VARIABLES LIKE 'innodb_file_per_table'");
$filepertable = $filepertable ? $filepertable->value : '';
$fileformat = $DB->get_record_sql("SHOW VARIABLES LIKE 'innodb_file_format'");
$fileformat = $fileformat ? $fileformat->value : '';
$prefix = $DB->get_prefix();
$database = $CFG->dbname;
if (!empty($options['info'])) {
echo "Database version: " . $info['description'] . "\n";
echo "Database name: $database\n";
echo "Database engine: " . $DB->get_dbengine() . "\n";
echo "innodb_file_per_table: $filepertable\n";
echo "innodb_file_format: $fileformat\n";
exit(0);
} else if (!empty($options['list'])) {
$problem = false;
foreach ($DB->get_tables(false) as $table) {
$columns = $DB->get_columns($table, false);
$size = $generator->guess_antolope_row_size($columns);
$format = $DB->get_row_format($table);
if ($size <= $generator::ANTELOPE_MAX_ROW_SIZE) {
continue;
}
echo str_pad($prefix . $table, 32, ' ', STR_PAD_RIGHT);
echo str_pad($format, 11, ' ', STR_PAD_RIGHT);
if ($format === 'Compact' or $format === 'Redundant') {
$problem = true;
echo " (needs fixing)\n";
} else if ($format !== 'Compressed' and $format !== 'Dynamic') {
echo " (unknown)\n";
} else {
echo "\n";
}
}
if ($problem) {
exit(1);
}
exit(0);
} else if (!empty($options['fix'])) {
$fixtables = array();
foreach ($DB->get_tables(false) as $table) {
$columns = $DB->get_columns($table, false);
$size = $generator->guess_antolope_row_size($columns);
$format = $DB->get_row_format($table);
if ($size <= $generator::ANTELOPE_MAX_ROW_SIZE) {
continue;
}
if ($format === 'Compact' or $format === 'Redundant') {
$fixtables[$table] = $table;
}
}
if (!$fixtables) {
echo "No changes necessary\n";
exit(0);
}
if ($filepertable !== 'ON') {
try {
$DB->execute("SET GLOBAL innodb_file_per_table=1");
} catch (dml_exception $e) {
echo "Cannot enable GLOBAL innodb_file_per_table setting, use --showsql option and execute the statements manually.";
throw $e;
}
}
if ($fileformat !== 'Barracuda') {
try {
$DB->execute("SET GLOBAL innodb_file_format=Barracuda");
} catch (dml_exception $e) {
echo "Cannot change GLOBAL innodb_file_format setting, use --showsql option and execute the statements manually.";
throw $e;
}
}
if (!$DB->is_compressed_row_format_supported(false)) {
echo "MySQL server is not compatible with compressed row format.";
exit(1);
}
foreach ($fixtables as $table) {
$DB->change_database_structure("ALTER TABLE {$prefix}$table ROW_FORMAT=Compressed");
echo str_pad($prefix . $table, 32, ' ', STR_PAD_RIGHT) . " ... Compressed\n";
}
exit(0);
} else if (!empty($options['showsql'])) {
$fixtables = array();
foreach ($DB->get_tables(false) as $table) {
$columns = $DB->get_columns($table, false);
$size = $generator->guess_antolope_row_size($columns);
$format = $DB->get_row_format($table);
if ($size <= $generator::ANTELOPE_MAX_ROW_SIZE) {
continue;
}
if ($format === 'Compact' or $format === 'Redundant') {
$fixtables[$table] = $table;
}
}
if (!$fixtables) {
echo "No changes necessary\n";
exit(0);
}
echo "Copy the following SQL statements and execute them using account with SUPER privilege:\n\n";
echo "USE $database;\n";
echo "SET SESSION sql_mode=STRICT_ALL_TABLES;\n";
echo "SET GLOBAL innodb_file_per_table=1;\n";
echo "SET GLOBAL innodb_file_format=Barracuda;\n";
foreach ($fixtables as $table) {
echo "ALTER TABLE {$prefix}$table ROW_FORMAT=Compressed;\n";
}
echo "\n";
exit(0);
} else {
echo $help;
die;
}
+2 -2
View File
@@ -45,7 +45,7 @@ admin_externalpage_setup('environment', '', $extraurlparams);
// Handle the 'updatecomponent' action
if ($action == 'updatecomponent' && confirm_sesskey()) {
// Create component installer and execute it
if ($cd = new component_installer('http://download.moodle.org',
if ($cd = new component_installer('https://download.moodle.org',
'environment',
'environment.zip')) {
$status = $cd->install(); //returns COMPONENT_(ERROR | UPTODATE | INSTALLED)
@@ -53,7 +53,7 @@ if ($action == 'updatecomponent' && confirm_sesskey()) {
case COMPONENT_ERROR:
if ($cd->get_error() == 'remotedownloaderror') {
$a = new stdClass();
$a->url = 'http://download.moodle.org/environment/environment.zip';
$a->url = 'https://download.moodle.org/environment/environment.zip';
$a->dest = $CFG->dataroot . '/';
print_error($cd->get_error(), 'error', $PAGE->url, $a);
die();
+123
View File
@@ -1136,4 +1136,127 @@
</CUSTOM_CHECK>
</CUSTOM_CHECKS>
</MOODLE>
<MOODLE version="2.8" requires="2.2">
<UNICODE level="required">
<FEEDBACK>
<ON_ERROR message="unicoderequired" />
</FEEDBACK>
</UNICODE>
<DATABASE level="required">
<VENDOR name="mariadb" version="5.5.31" />
<VENDOR name="mysql" version="5.5.31" />
<VENDOR name="postgres" version="9.1" />
<VENDOR name="mssql" version="10.0" />
<VENDOR name="oracle" version="10.2" />
</DATABASE>
<PHP version="5.4.4" level="required">
</PHP>
<PCREUNICODE level="optional">
<FEEDBACK>
<ON_CHECK message="pcreunicodewarning" />
</FEEDBACK>
</PCREUNICODE>
<PHP_EXTENSIONS>
<PHP_EXTENSION name="iconv" level="required">
<FEEDBACK>
<ON_ERROR message="iconvrequired" />
</FEEDBACK>
</PHP_EXTENSION>
<PHP_EXTENSION name="mbstring" level="optional">
<FEEDBACK>
<ON_CHECK message="mbstringrecommended" />
</FEEDBACK>
</PHP_EXTENSION>
<PHP_EXTENSION name="curl" level="required">
<FEEDBACK>
<ON_ERROR message="curlrequired" />
</FEEDBACK>
</PHP_EXTENSION>
<PHP_EXTENSION name="openssl" level="optional">
<FEEDBACK>
<ON_CHECK message="opensslrecommended" />
</FEEDBACK>
</PHP_EXTENSION>
<PHP_EXTENSION name="tokenizer" level="optional">
<FEEDBACK>
<ON_CHECK message="tokenizerrecommended" />
</FEEDBACK>
</PHP_EXTENSION>
<PHP_EXTENSION name="xmlrpc" level="optional">
<FEEDBACK>
<ON_CHECK message="xmlrpcrecommended" />
</FEEDBACK>
</PHP_EXTENSION>
<PHP_EXTENSION name="soap" level="optional">
<FEEDBACK>
<ON_CHECK message="soaprecommended" />
</FEEDBACK>
</PHP_EXTENSION>
<PHP_EXTENSION name="ctype" level="required">
<FEEDBACK>
<ON_ERROR message="ctyperequired" />
</FEEDBACK>
</PHP_EXTENSION>
<PHP_EXTENSION name="zip" level="required">
<FEEDBACK>
<ON_ERROR message="ziprequired" />
</FEEDBACK>
</PHP_EXTENSION>
<PHP_EXTENSION name="zlib" level="required">
</PHP_EXTENSION>
<PHP_EXTENSION name="gd" level="required">
<FEEDBACK>
<ON_ERROR message="gdrequired" />
</FEEDBACK>
</PHP_EXTENSION>
<PHP_EXTENSION name="simplexml" level="required">
<FEEDBACK>
<ON_ERROR message="simplexmlrequired" />
</FEEDBACK>
</PHP_EXTENSION>
<PHP_EXTENSION name="spl" level="required">
<FEEDBACK>
<ON_ERROR message="splrequired" />
</FEEDBACK>
</PHP_EXTENSION>
<PHP_EXTENSION name="pcre" level="required">
</PHP_EXTENSION>
<PHP_EXTENSION name="dom" level="required">
</PHP_EXTENSION>
<PHP_EXTENSION name="xml" level="required">
</PHP_EXTENSION>
<PHP_EXTENSION name="intl" level="optional">
<FEEDBACK>
<ON_CHECK message="intlrecommended" />
</FEEDBACK>
</PHP_EXTENSION>
<PHP_EXTENSION name="json" level="required">
</PHP_EXTENSION>
<PHP_EXTENSION name="hash" level="required"/>
</PHP_EXTENSIONS>
<PHP_SETTINGS>
<PHP_SETTING name="memory_limit" value="96M" level="required">
<FEEDBACK>
<ON_ERROR message="settingmemorylimit" />
</FEEDBACK>
</PHP_SETTING>
<PHP_SETTING name="file_uploads" value="1" level="optional">
<FEEDBACK>
<ON_CHECK message="settingfileuploads" />
</FEEDBACK>
</PHP_SETTING>
<PHP_SETTING name="opcache.enable" value="1" level="optional">
<FEEDBACK>
<ON_CHECK message="opcacherecommended" />
</FEEDBACK>
</PHP_SETTING>
</PHP_SETTINGS>
<CUSTOM_CHECKS>
<CUSTOM_CHECK file="question/engine/upgrade/upgradelib.php" function="quiz_attempts_upgraded" level="required">
<FEEDBACK>
<ON_ERROR message="quizattemptsupgradedmessage" />
</FEEDBACK>
</CUSTOM_CHECK>
</CUSTOM_CHECKS>
</MOODLE>
</COMPATIBILITY_MATRIX>
+2 -1
View File
@@ -555,7 +555,8 @@ if (isset($SESSION->pluginuninstallreturn)) {
// Print default admin page with notifications.
$errorsdisplayed = defined('WARN_DISPLAY_ERRORS_ENABLED');
$lastcron = $DB->get_field_sql('SELECT MAX(lastcron) FROM {modules}');
// We make the assumption that at least one schedule task should run once per day.
$lastcron = $DB->get_field_sql('SELECT MAX(lastruntime) FROM {task_scheduled}');
$cronoverdue = ($lastcron < time() - 3600 * 24);
$dbproblems = $DB->diagnose();
$maintenancemode = !empty($CFG->maintenance_enabled);
+21 -12
View File
@@ -1039,19 +1039,28 @@ class core_admin_renderer extends plugin_renderer_base {
}
foreach ($plugin->get_other_required_plugins() as $component => $requiredversion) {
$ok = true;
$otherplugin = $pluginman->get_plugin_info($component);
$actions = array();
if (is_null($otherplugin)) {
$ok = false;
} else if ($requiredversion != ANY_VERSION and $otherplugin->versiondisk < $requiredversion) {
$ok = false;
}
// The required plugin is not installed.
$class = 'requires-failed requires-missing';
$installurl = new moodle_url('https://moodle.org/plugins/view.php', array('plugin' => $component));
$uploadurl = new moodle_url('/admin/tool/installaddon/');
$actions[] = html_writer::link($installurl, get_string('dependencyinstall', 'core_plugin'));
$actions[] = html_writer::link($uploadurl, get_string('dependencyupload', 'core_plugin'));
} else if ($requiredversion != ANY_VERSION and $otherplugin->versiondisk < $requiredversion) {
// The required plugin is installed but needs to be updated.
$class = 'requires-failed requires-outdated';
if (!$otherplugin->is_standard()) {
$updateurl = new moodle_url($this->page->url, array('sesskey' => sesskey(), 'fetchupdates' => 1));
$actions[] = html_writer::link($updateurl, get_string('checkforupdates', 'core_plugin'));
}
if ($ok) {
$class = 'requires-ok';
} else {
$class = 'requires-failed';
// Already installed plugin with sufficient version.
$class = 'requires-ok';
}
if ($requiredversion != ANY_VERSION) {
@@ -1059,11 +1068,11 @@ class core_admin_renderer extends plugin_renderer_base {
} else {
$str = 'otherplugin';
}
$componenturl = new moodle_url('https://moodle.org/plugins/view.php?plugin='.$component);
$componenturl = html_writer::tag('a', $component, array('href' => $componenturl->out()));
$requires[] = html_writer::tag('li',
get_string($str, 'core_plugin',
array('component' => $componenturl, 'version' => $requiredversion)),
html_writer::div(get_string($str, 'core_plugin',
array('component' => $component, 'version' => $requiredversion)), 'component').
html_writer::div(implode(' | ', $actions), 'actions'),
array('class' => $class));
}
@@ -48,11 +48,12 @@ class core_role_potential_assignees_below_course extends core_role_assign_user_s
$fields = 'SELECT ' . $this->required_fields_sql('u');
$countfields = 'SELECT COUNT(u.id)';
$sql = " FROM {user} u
LEFT JOIN {role_assignments} ra ON (ra.userid = u.id AND ra.roleid = :roleid AND ra.contextid = :contextid)
WHERE u.id IN ($enrolsql)
$wherecondition
AND ra.id IS NULL";
$sql = " FROM ($enrolsql) enrolled_users_view
JOIN {user} u ON u.id = enrolled_users_view.id
LEFT JOIN {role_assignments} ra ON (ra.userid = enrolled_users_view.id AND
ra.roleid = :roleid AND ra.contextid = :contextid)
WHERE ra.id IS NULL
$wherecondition";
$params['contextid'] = $this->context->id;
$params['roleid'] = $this->roleid;
+1 -1
View File
@@ -358,7 +358,7 @@ if ($hassiteconfig || has_capability('moodle/question:config', $systemcontext))
2 => get_string('showmarkandmax', 'question'),
);
$settings->add(new admin_setting_configselect('question_preview/marks',
get_string('marks', 'question'), '', 1, $marksoptions));
get_string('marks', 'question'), '', 2, $marksoptions));
$settings->add(new admin_setting_configselect('question_preview/markdp',
get_string('decimalplacesingrades', 'question'), '', 2, array(0, 1, 2, 3, 4, 5, 6, 7)));
@@ -253,24 +253,57 @@ Feature: Set up contextual data for tests
And I set the field "groups" to "Group 2 (1)"
And the "members" select box should contain "Student 2"
Scenario: Add cohorts with data generator
Scenario: Add cohorts and cohort members with data generator
Given the following "categories" exist:
| name | category | idnumber |
| Cat 1 | 0 | CAT1 |
And the following "users" exist:
| username | firstname | lastname | email |
| student1 | Student | 1 | student1@asd.com |
| student2 | Student | 2 | student2@asd.com |
And the following "cohorts" exist:
| name | idnumber |
| System cohort 1 | CH01 |
| System cohort A | CHSA |
And the following "cohorts" exist:
| name | idnumber | contextlevel | reference |
| System cohort 2 | CH02 | System | |
| Cohort in category 1 | CH1 | Category | CAT1 |
| System cohort B | CHSB | System | |
| Cohort in category | CHC | Category | CAT1 |
| Empty cohort | CHE | Category | CAT1 |
And the following "cohort members" exist:
| user | cohort |
| student1 | CHSA |
| student2 | CHSB |
| student1 | CHSB |
| student1 | CHC |
When I log in as "admin"
And I navigate to "Cohorts" node in "Site administration > Users > Accounts"
Then I should see "System cohort 1"
And I should see "System cohort 2"
Then the following should exist in the "cohorts" table:
| Name | Cohort size |
| System cohort A | 1 |
| System cohort B | 2 |
And I should not see "Cohort in category"
And I follow "Courses"
And I follow "Cat 1"
And I follow "Cohorts"
And I should see "Cohort in category 1"
And I should not see "System cohort"
And the following should exist in the "cohorts" table:
| Name | Cohort size |
| Cohort in category | 1 |
| Empty cohort | 0 |
Scenario: Add grade categories with data generator
Given the following "courses" exist:
| fullname | shortname |
| Course 1 | C1 |
And the following "grade categories" exist:
| fullname | course |
| Grade category 1 | C1|
And the following "grade categories" exist:
| fullname | course | gradecategory |
| Grade sub category 2 | C1 | Grade category 1|
When I log in as "admin"
And I follow "Courses"
And I follow "Course 1"
And I navigate to "Grades" node in "Course administration"
Then I should see "Grade category 1"
And I should see "Grade sub category 2"
@@ -66,6 +66,7 @@ $string['validationmsg_filenotexists'] = 'Extracted file not found';
$string['validationmsg_filesnumber'] = 'Not enough files found in the package';
$string['validationmsg_filestatus'] = 'Unable to extract all files';
$string['validationmsg_filestatus_info'] = 'Attempting to extract file {$a->file} resulted in error \'{$a->status}\'.';
$string['validationmsg_foundlangfile'] = 'Found language file';
$string['validationmsg_maturity'] = 'Declared maturity level';
$string['validationmsg_maturity_help'] = 'The plugin can declare its maturity level. If the maintainer considers the plugin stable, the declared maturity level will read MATURITY_STABLE. All other maturity levels (such as alpha or beta) should be considered unstable and a warning is raised.';
$string['validationmsg_missingexpectedlangenfile'] = 'English language file name mismatch';
+1 -1
View File
@@ -17,7 +17,7 @@
/**
* Fetches language packages from download.moodle.org server
*
* Language packages are available at http://download.moodle.org/langpack/
* Language packages are available at https://download.moodle.org/langpack/
* in ZIP format together with a file languages.md5 containing their hashes
* and meta info.
* Locally, language packs are saved into $CFG->dataroot/lang/
@@ -37,7 +37,7 @@ $string['missinglangparent'] = 'Missing parent language <em>{$a->parent}</em> of
$string['nolangupdateneeded'] = 'All your language packs are up to date, no update is needed';
$string['pluginname'] = 'Language packs';
$string['purgestringcaches'] = 'Purge string caches';
$string['remotelangnotavailable'] = 'Because Moodle cannot connect to download.moodle.org, it is not possible for language packs to be installed automatically. Please download the appropriate ZIP file(s) from <a href="http://download.moodle.org/langpack/">download.moodle.org/langpack</a>, copy them to your {$a} directory and unzip them manually.';
$string['remotelangnotavailable'] = 'Because Moodle cannot connect to download.moodle.org, it is not possible for language packs to be installed automatically. Please download the appropriate ZIP file(s) from <a href="https://download.moodle.org/langpack/">download.moodle.org/langpack</a>, copy them to your {$a} directory and unzip them manually.';
$string['uninstall'] = 'Uninstall selected language pack';
$string['uninstallconfirm'] = 'You are about to completely uninstall language pack {$a}, are you sure?';
$string['updatelangs'] = 'Update all installed language packs';
+2 -2
View File
@@ -45,7 +45,7 @@
$message = '<br /><br />';
$message .= $CFG->tempdir.'/olson.txt<br />';
$message .= $CFG->tempdir.'/timezone.txt<br />';
$message .= '<a href="http://download.moodle.org/timezone/">http://download.moodle.org/timezone/</a><br />';
$message .= '<a href="https://download.moodle.org/timezone/">https://download.moodle.org/timezone/</a><br />';
$message .= '<a href="'.$CFG->wwwroot.'/lib/timezone.txt">'.$CFG->dirroot.'/lib/timezone.txt</a><br />';
$message .= '<br />';
@@ -83,7 +83,7 @@
}
/// Otherwise, let's try moodle.org's copy
$source = 'http://download.moodle.org/timezone/';
$source = 'https://download.moodle.org/timezone/';
if (!$importdone && ($content=download_file_content($source))) {
if ($file = fopen($CFG->tempdir.'/timezone.txt', 'w')) { // Make local copy
fwrite($file, $content);
@@ -35,6 +35,13 @@ global $CFG;
*/
class tool_uploadcourse_course_testcase extends advanced_testcase {
/**
* Tidy up open files that may be left open.
*/
protected function tearDown() {
gc_collect_cycles();
}
public function test_proceed_without_prepare() {
$this->resetAfterTest(true);
$mode = tool_uploadcourse_processor::MODE_CREATE_NEW;
@@ -36,6 +36,13 @@ require_once($CFG->libdir . '/csvlib.class.php');
*/
class tool_uploadcourse_processor_testcase extends advanced_testcase {
/**
* Tidy up open files that may be left open.
*/
protected function tearDown() {
gc_collect_cycles();
}
public function test_basic() {
global $DB;
$this->resetAfterTest(true);
-5
View File
@@ -256,17 +256,12 @@
$table->colclasses = array();
$table->head[] = $fullnamedisplay;
$table->attributes['class'] = 'admintable generaltable';
$table->colclasses[] = 'leftalign';
foreach ($extracolumns as $field) {
$table->head[] = ${$field};
$table->colclasses[] = 'leftalign';
}
$table->head[] = $city;
$table->colclasses[] = 'leftalign';
$table->head[] = $country;
$table->colclasses[] = 'leftalign';
$table->head[] = $lastaccess;
$table->colclasses[] = 'leftalign';
$table->head[] = get_string('edit');
$table->colclasses[] = 'centeralign';
$table->head[] = "";
+3 -3
View File
@@ -35,12 +35,12 @@ function get_selection_data($ufiltering) {
if ($scount) {
if ($scount < MAX_BULK_USERS) {
$in = implode(',', $SESSION->bulk_users);
$bulkusers = $SESSION->bulk_users;
} else {
$bulkusers = array_slice($SESSION->bulk_users, 0, MAX_BULK_USERS, true);
$in = implode(',', $bulkusers);
}
$userlist['susers'] = $DB->get_records_select_menu('user', "id IN ($in)", null, 'fullname', 'id,'.$DB->sql_fullname().' AS fullname');
list($in, $inparams) = $DB->get_in_or_equal($bulkusers);
$userlist['susers'] = $DB->get_records_select_menu('user', "id $in", $inparams, 'fullname', 'id,'.$DB->sql_fullname().' AS fullname');
}
return $userlist;
+11 -12
View File
@@ -52,14 +52,9 @@ class auth_db_testcase extends advanced_testcase {
set_config('host', $CFG->dbhost.':'.$CFG->dboptions['dbport'], 'auth/db');
}
switch (get_class($DB)) {
case 'mssql_native_moodle_database':
set_config('type', 'mssql_n', 'auth/db');
set_config('sybasequoting', '1', 'auth/db');
break;
switch ($DB->get_dbfamily()) {
case 'mariadb_native_moodle_database':
case 'mysqli_native_moodle_database':
case 'mysql':
set_config('type', 'mysqli', 'auth/db');
set_config('setupsql', "SET NAMES 'UTF-8'", 'auth/db');
set_config('sybasequoting', '0', 'auth/db');
@@ -72,12 +67,12 @@ class auth_db_testcase extends advanced_testcase {
}
break;
case 'oci_native_moodle_database':
case 'oracle':
set_config('type', 'oci8po', 'auth/db');
set_config('sybasequoting', '1', 'auth/db');
break;
case 'pgsql_native_moodle_database':
case 'postgres':
set_config('type', 'postgres7', 'auth/db');
$setupsql = "SET NAMES 'UTF-8'";
if (!empty($CFG->dboptions['dbschema'])) {
@@ -98,13 +93,17 @@ class auth_db_testcase extends advanced_testcase {
}
break;
case 'sqlsrv_native_moodle_database':
set_config('type', 'mssqlnative', 'auth/db');
case 'mssql':
if (get_class($DB) == 'mssql_native_moodle_database') {
set_config('type', 'mssql_n', 'auth/db');
} else {
set_config('type', 'mssqlnative', 'auth/db');
}
set_config('sybasequoting', '1', 'auth/db');
break;
default:
throw new exception('Unknown database driver '.get_class($DB));
throw new exception('Unknown database family ' . $DB->get_dbfamily());
}
$table = new xmldb_table('auth_db_users');
+1
View File
@@ -737,6 +737,7 @@ class auth_plugin_ldap extends auth_plugin_base {
do {
$value = ldap_get_values_len($ldapconnection, $entry, $this->config->user_attribute);
$value = core_text::convert($value[0], $this->config->ldapencoding, 'utf-8');
$value = trim($value);
$this->ldap_bulk_insert($value);
} while ($entry = ldap_next_entry($ldapconnection, $entry));
}
+1 -1
View File
@@ -79,7 +79,7 @@ $string['auth_ldap_passtype'] = 'Specify the format of new or changed passwords
$string['auth_ldap_passtype_key'] = 'Password format';
$string['auth_ldap_passwdexpire_settings'] = 'LDAP password expiration settings.';
$string['auth_ldap_preventpassindb'] = 'Select yes to prevent passwords from being stored in Moodle\'s DB.';
$string['auth_ldap_preventpassindb_key'] = 'Hide passwords';
$string['auth_ldap_preventpassindb_key'] = 'Cache passwords';
$string['auth_ldap_search_sub'] = 'Search users from subcontexts.';
$string['auth_ldap_search_sub_key'] = 'Search subcontexts';
$string['auth_ldap_server_settings'] = 'LDAP server settings';
+4 -1
View File
@@ -41,13 +41,16 @@ class auth_plugin_manual extends auth_plugin_base {
* The name of the component. Used by the configuration.
*/
const COMPONENT_NAME = 'auth_manual';
const LEGACY_COMPONENT_NAME = 'auth/manual';
/**
* Constructor.
*/
function auth_plugin_manual() {
$this->authtype = 'manual';
$this->config = get_config(self::COMPONENT_NAME);
$config = get_config(self::COMPONENT_NAME);
$legacyconfig = get_config(self::LEGACY_COMPONENT_NAME);
$this->config = (object)array_merge((array)$legacyconfig, (array)$config);
}
/**
+25 -1
View File
@@ -49,6 +49,9 @@ abstract class info {
/** @var tree Availability configuration, decoded from JSON; null if unset */
protected $availabilitytree;
/** @var array|null Array of information about current restore if any */
protected static $restoreinfo = null;
/**
* Constructs with item details.
*
@@ -307,9 +310,12 @@ abstract class info {
* @param string $restoreid Restore identifier
* @param int $courseid Target course id
* @param \base_logger $logger Logger for any warnings
* @param int $dateoffset Date offset to be added to any dates (0 = none)
*/
public function update_after_restore($restoreid, $courseid, \base_logger $logger) {
public function update_after_restore($restoreid, $courseid, \base_logger $logger, $dateoffset) {
$tree = $this->get_availability_tree();
// Set static data for use by get_restore_date_offset function.
self::$restoreinfo = array('restoreid' => $restoreid, 'dateoffset' => $dateoffset);
$changed = $tree->update_after_restore($restoreid, $courseid, $logger,
$this->get_thing_name());
if ($changed) {
@@ -319,6 +325,24 @@ abstract class info {
}
}
/**
* Gets the date offset (amount by which any date values should be
* adjusted) for the current restore.
*
* @param string $restoreid Restore identifier
* @return int Date offset (0 if none)
* @throws coding_exception If not in a restore (or not in that restore)
*/
public static function get_restore_date_offset($restoreid) {
if (!self::$restoreinfo) {
throw new coding_exception('Only valid during restore');
}
if (self::$restoreinfo['restoreid'] !== $restoreid) {
throw new coding_exception('Data not available for that restore id');
}
return self::$restoreinfo['dateoffset'];
}
/**
* Obtains the name of the item (cm_info or section_info, at present) that
* this is controlling availability of. Name should be formatted ready
+8 -1
View File
@@ -187,6 +187,13 @@ class info_module extends info {
// As a result we cannot take short cuts any longer and must get
// standard modinfo.
$modinfo = get_fast_modinfo($cm->course, $userid);
return $modinfo->get_cm($cm->id)->uservisible;
$cms = $modinfo->get_cms();
if (!isset($cms[$cm->id])) {
// In some cases this might get called with a cmid that is no longer
// available, for example when a module is hidden at system level.
debugging('info_module::is_user_visible called with invalid cmid ' . $cm->id, DEBUG_DEVELOPER);
return false;
}
return $cms[$cm->id]->uservisible;
}
}
+15 -4
View File
@@ -560,10 +560,13 @@ class tree extends tree_node {
public function save() {
$result = new \stdClass();
$result->op = $this->op;
if ($this->op === self::OP_AND || $this->op === self::OP_NOT_OR) {
$result->showc = $this->showchildren;
} else {
$result->show = $this->show;
// Only root tree has the 'show' options.
if ($this->root) {
if ($this->op === self::OP_AND || $this->op === self::OP_NOT_OR) {
$result->showc = $this->showchildren;
} else {
$result->show = $this->show;
}
}
$result->c = array();
foreach ($this->children as $child) {
@@ -572,6 +575,14 @@ class tree extends tree_node {
return $result;
}
/**
* Checks whether this tree is empty (contains no children).
* @return boolean True if empty
*/
public function is_empty() {
return count($this->children) === 0;
}
/**
* Recursively gets all children of a particular class (you can use a base
* class to get all conditions, or a specific class).
+3
View File
@@ -87,6 +87,9 @@ abstract class tree_node {
* The default behaviour is simply to return false. If there is a problem
* with the update, $logger can be used to output a warning.
*
* Note: If you need information about the date offset, call
* \core_availability\info::get_restore_date_offset($restoreid).
*
* @param string $restoreid Restore ID
* @param int $courseid ID of target course
* @param \base_logger $logger Logger for any warnings
@@ -209,4 +209,15 @@ class condition extends \core_availability\condition {
protected static function is_midnight($time) {
return usergetmidnight($time) == $time;
}
public function update_after_restore(
$restoreid, $courseid, \base_logger $logger, $name) {
// Update the date, if restoring with changed date.
$dateoffset = \core_availability\info::get_restore_date_offset($restoreid);
if ($dateoffset) {
$this->time += $dateoffset;
return true;
}
return false;
}
}
@@ -176,6 +176,12 @@ class condition extends \core_availability\condition {
public function filter_user_list(array $users, $not, \core_availability\info $info,
\core_availability\capability_checker $checker) {
global $CFG, $DB;
// If the array is empty already, just return it.
if (!$users) {
return $users;
}
require_once($CFG->libdir . '/grouplib.php');
$course = $info->get_course();
@@ -209,6 +209,11 @@ class condition extends \core_availability\condition {
\core_availability\capability_checker $checker) {
global $CFG, $DB;
// If the array is empty already, just return it.
if (!$users) {
return $users;
}
// List users for this course who match the condition.
$groupingusers = $DB->get_records_sql("
SELECT DISTINCT gm.userid
@@ -416,6 +416,11 @@ class condition extends \core_availability\condition {
\core_availability\capability_checker $checker) {
global $CFG, $DB;
// If the array is empty already, just return it.
if (!$users) {
return $users;
}
// Get all users from the list who match the condition.
list ($sql, $params) = $DB->get_in_or_equal(array_keys($users));
@@ -337,7 +337,8 @@ class availability_profile_condition_testcase extends advanced_testcase {
// The list of fields should include the text field added in setUp(),
// but should not include the textarea field added just now.
$fields = condition::get_custom_profile_fields();
$this->assertEquals(array('frogtype'), array_keys($fields));
$this->assertArrayHasKey('frogtype', $fields);
$this->assertArrayNotHasKey('longtext', $fields);
}
/**
@@ -74,6 +74,9 @@ M.availability_profile.form.getNode = function(json) {
if (json.op !== undefined &&
node.one('select[name=op] > option[value=' + json.op + ']')) {
node.one('select[name=op]').set('value', json.op);
if (json.op === 'isempty' || json.op === 'isnotempty') {
node.one('input[name=value]').set('disabled', true);
}
}
if (json.v !== undefined) {
node.one('input').set('value', json.v);
@@ -1 +1 @@
YUI.add("moodle-availability_profile-form",function(e,t){M.availability_profile=M.availability_profile||{},M.availability_profile.form=e.Object(M.core_availability.plugin),M.availability_profile.form.profiles=null,M.availability_profile.form.initInner=function(e,t){this.standardFields=e,this.customFields=t},M.availability_profile.form.getNode=function(t){var n=M.str.availability_profile,r='<span class="availability-group"><label>'+n.conditiontitle+" "+'<select name="field">'+'<option value="choose">'+M.str.moodle.choosedots+"</option>",i;for(var s=0;s<this.standardFields.length;s++)i=this.standardFields[s],r+='<option value="sf_'+i.field+'">'+i.display+"</option>";for(s=0;s<this.customFields.length;s++)i=this.customFields[s],r+='<option value="cf_'+i.field+'">'+i.display+"</option>";r+='</select></label> <label><span class="accesshide">'+n.label_operator+' </span><select name="op" title="'+n.label_operator+'">';var o=["isequalto","contains","doesnotcontain","startswith","endswith","isempty","isnotempty"];for(s=0;s<o.length;s++)r+='<option value="'+o[s]+'">'+n["op_"+o[s]]+"</option>";r+='</select></label> <label><span class="accesshide">'+n.label_value+'</span><input name="value" type="text" style="width: 10em" title="'+n.label_value+'"/></label></span>';var u=e.Node.create("<span>"+r+"</span>");t.sf!==undefined&&u.one("select[name=field] > option[value=sf_"+t.sf+"]")?u.one("select[name=field]").set("value","sf_"+t.sf):t.cf!==undefined&&u.one("select[name=field] > option[value=cf_"+t.cf+"]")&&u.one("select[name=field]").set("value","cf_"+t.cf),t.op!==undefined&&u.one("select[name=op] > option[value="+t.op+"]")&&u.one("select[name=op]").set("value",t.op),t.v!==undefined&&u.one("input").set("value",t.v);if(!M.availability_profile.form.addedEvents){M.availability_profile.form.addedEvents=!0;var a=function(e){var t=e.ancestor("span.availability_profile"),n=t.one("select[name=op]"),r=n.get("value")==="isempty"||n.get("value")==="isnotempty";t.one("input[name=value]").set("disabled",r),M.core_availability.form.update()},f=e.one("#fitem_id_availabilityconditionsjson");f.delegate("change",function(){a(this)},".availability_profile select"),f.delegate("change",function(){a(this)},".availability_profile input[name=value]")}return u},M.availability_profile.form.fillValue=function(e,t){var n=t.one("select[name=field]").get("value");n.substr(0,3)==="sf_"?e.sf=n.substr(3):n.substr(0,3)==="cf_"&&(e.cf=n.substr(3)),e.op=t.one("select[name=op]").get("value");var r=t.one("input[name=value]");r.get("disabled")||(e.v=r.get("value"))},M.availability_profile.form.fillErrors=function(e,t){var n={};this.fillValue(n,t),n.sf===undefined&&n.cf===undefined&&e.push("availability_profile:error_selectfield"),n.v!==undefined&&/^\s*$/.test(n.v)&&e.push("availability_profile:error_setvalue")}},"@VERSION@",{requires:["base","node","event","moodle-core_availability-form"]});
YUI.add("moodle-availability_profile-form",function(e,t){M.availability_profile=M.availability_profile||{},M.availability_profile.form=e.Object(M.core_availability.plugin),M.availability_profile.form.profiles=null,M.availability_profile.form.initInner=function(e,t){this.standardFields=e,this.customFields=t},M.availability_profile.form.getNode=function(t){var n=M.str.availability_profile,r='<span class="availability-group"><label>'+n.conditiontitle+" "+'<select name="field">'+'<option value="choose">'+M.str.moodle.choosedots+"</option>",i;for(var s=0;s<this.standardFields.length;s++)i=this.standardFields[s],r+='<option value="sf_'+i.field+'">'+i.display+"</option>";for(s=0;s<this.customFields.length;s++)i=this.customFields[s],r+='<option value="cf_'+i.field+'">'+i.display+"</option>";r+='</select></label> <label><span class="accesshide">'+n.label_operator+' </span><select name="op" title="'+n.label_operator+'">';var o=["isequalto","contains","doesnotcontain","startswith","endswith","isempty","isnotempty"];for(s=0;s<o.length;s++)r+='<option value="'+o[s]+'">'+n["op_"+o[s]]+"</option>";r+='</select></label> <label><span class="accesshide">'+n.label_value+'</span><input name="value" type="text" style="width: 10em" title="'+n.label_value+'"/></label></span>';var u=e.Node.create("<span>"+r+"</span>");t.sf!==undefined&&u.one("select[name=field] > option[value=sf_"+t.sf+"]")?u.one("select[name=field]").set("value","sf_"+t.sf):t.cf!==undefined&&u.one("select[name=field] > option[value=cf_"+t.cf+"]")&&u.one("select[name=field]").set("value","cf_"+t.cf),t.op!==undefined&&u.one("select[name=op] > option[value="+t.op+"]")&&(u.one("select[name=op]").set("value",t.op),(t.op==="isempty"||t.op==="isnotempty")&&u.one("input[name=value]").set("disabled",!0)),t.v!==undefined&&u.one("input").set("value",t.v);if(!M.availability_profile.form.addedEvents){M.availability_profile.form.addedEvents=!0;var a=function(e){var t=e.ancestor("span.availability_profile"),n=t.one("select[name=op]"),r=n.get("value")==="isempty"||n.get("value")==="isnotempty";t.one("input[name=value]").set("disabled",r),M.core_availability.form.update()},f=e.one("#fitem_id_availabilityconditionsjson");f.delegate("change",function(){a(this)},".availability_profile select"),f.delegate("change",function(){a(this)},".availability_profile input[name=value]")}return u},M.availability_profile.form.fillValue=function(e,t){var n=t.one("select[name=field]").get("value");n.substr(0,3)==="sf_"?e.sf=n.substr(3):n.substr(0,3)==="cf_"&&(e.cf=n.substr(3)),e.op=t.one("select[name=op]").get("value");var r=t.one("input[name=value]");r.get("disabled")||(e.v=r.get("value"))},M.availability_profile.form.fillErrors=function(e,t){var n={};this.fillValue(n,t),n.sf===undefined&&n.cf===undefined&&e.push("availability_profile:error_selectfield"),n.v!==undefined&&/^\s*$/.test(n.v)&&e.push("availability_profile:error_setvalue")}},"@VERSION@",{requires:["base","node","event","moodle-core_availability-form"]});
@@ -74,6 +74,9 @@ M.availability_profile.form.getNode = function(json) {
if (json.op !== undefined &&
node.one('select[name=op] > option[value=' + json.op + ']')) {
node.one('select[name=op]').set('value', json.op);
if (json.op === 'isempty' || json.op === 'isnotempty') {
node.one('input[name=value]').set('disabled', true);
}
}
if (json.v !== undefined) {
node.one('input').set('value', json.v);
@@ -72,6 +72,9 @@ M.availability_profile.form.getNode = function(json) {
if (json.op !== undefined &&
node.one('select[name=op] > option[value=' + json.op + ']')) {
node.one('select[name=op]').set('value', json.op);
if (json.op === 'isempty' || json.op === 'isnotempty') {
node.one('input[name=value]').set('disabled', true);
}
}
if (json.v !== undefined) {
node.one('input').set('value', json.v);
+16
View File
@@ -23,6 +23,7 @@
*/
use core_availability\capability_checker;
use \core_availability\tree;
defined('MOODLE_INTERNAL') || die();
@@ -488,6 +489,21 @@ class tree_testcase extends \advanced_testcase {
$tree->get_full_information($info));
}
/**
* Tests the is_empty() function.
*/
public function test_is_empty() {
// Tree with nothing in should be empty.
$structure = self::tree(array());
$tree = new tree($structure);
$this->assertTrue($tree->is_empty());
// Tree with something in is not empty.
$structure = self::tree(array(self::mock(array('m' => '1'))));
$tree = new tree($structure);
$this->assertFalse($tree->is_empty());
}
/**
* Tests the get_all_children() function.
*/
@@ -928,20 +928,19 @@ M.core_availability.Item.prototype.pluginNode = null;
M.core_availability.EyeIcon = function(individual, shown) {
this.individual = individual;
this.span = Y.Node.create('<a class="availability-eye" href="#" role="button">');
var iconBase = M.cfg.wwwroot + '/theme/image.php/' + M.cfg.theme + '/core/' + M.cfg.themerev;
var icon = Y.Node.create('<img />');
this.span.appendChild(icon);
// Set up button text and icon.
var suffix = individual ? '_individual' : '_all';
var setHidden = function() {
icon.set('src', iconBase + '/i/show');
icon.set('src', M.util.image_url('i/show', 'core'));
icon.set('alt', M.str.availability['hidden' + suffix]);
this.span.set('title', M.str.availability['hidden' + suffix] + ' \u2022 ' +
M.str.availability.show_verb);
};
var setShown = function() {
icon.set('src', iconBase + '/i/hide');
icon.set('src', M.util.image_url('i/hide', 'core'));
icon.set('alt', M.str.availability['shown' + suffix]);
this.span.set('title', M.str.availability['shown' + suffix] + ' \u2022 ' +
M.str.availability.hide_verb);
@@ -1006,9 +1005,8 @@ M.core_availability.EyeIcon.prototype.isHidden = function() {
M.core_availability.DeleteIcon = function(toDelete) {
this.span = Y.Node.create('<a class="availability-delete" href="#" title="' +
M.str.moodle['delete'] + '" role="button">');
var img = Y.Node.create('<img src="' +
M.cfg.wwwroot + '/theme/image.php/' + M.cfg.theme + '/core/' + M.cfg.themerev +
'/t/delete" alt="' + M.str.moodle['delete'] + '" />');
var img = Y.Node.create('<img src="' + M.util.image_url('t/delete', 'core') +
'" alt="' + M.str.moodle['delete'] + '" />');
this.span.appendChild(img);
var click = function(e) {
e.preventDefault();
File diff suppressed because one or more lines are too long
@@ -928,20 +928,19 @@ M.core_availability.Item.prototype.pluginNode = null;
M.core_availability.EyeIcon = function(individual, shown) {
this.individual = individual;
this.span = Y.Node.create('<a class="availability-eye" href="#" role="button">');
var iconBase = M.cfg.wwwroot + '/theme/image.php/' + M.cfg.theme + '/core/' + M.cfg.themerev;
var icon = Y.Node.create('<img />');
this.span.appendChild(icon);
// Set up button text and icon.
var suffix = individual ? '_individual' : '_all';
var setHidden = function() {
icon.set('src', iconBase + '/i/show');
icon.set('src', M.util.image_url('i/show', 'core'));
icon.set('alt', M.str.availability['hidden' + suffix]);
this.span.set('title', M.str.availability['hidden' + suffix] + ' \u2022 ' +
M.str.availability.show_verb);
};
var setShown = function() {
icon.set('src', iconBase + '/i/hide');
icon.set('src', M.util.image_url('i/hide', 'core'));
icon.set('alt', M.str.availability['shown' + suffix]);
this.span.set('title', M.str.availability['shown' + suffix] + ' \u2022 ' +
M.str.availability.hide_verb);
@@ -1006,9 +1005,8 @@ M.core_availability.EyeIcon.prototype.isHidden = function() {
M.core_availability.DeleteIcon = function(toDelete) {
this.span = Y.Node.create('<a class="availability-delete" href="#" title="' +
M.str.moodle['delete'] + '" role="button">');
var img = Y.Node.create('<img src="' +
M.cfg.wwwroot + '/theme/image.php/' + M.cfg.theme + '/core/' + M.cfg.themerev +
'/t/delete" alt="' + M.str.moodle['delete'] + '" />');
var img = Y.Node.create('<img src="' + M.util.image_url('t/delete', 'core') +
'" alt="' + M.str.moodle['delete'] + '" />');
this.span.appendChild(img);
var click = function(e) {
e.preventDefault();
+4 -6
View File
@@ -926,20 +926,19 @@ M.core_availability.Item.prototype.pluginNode = null;
M.core_availability.EyeIcon = function(individual, shown) {
this.individual = individual;
this.span = Y.Node.create('<a class="availability-eye" href="#" role="button">');
var iconBase = M.cfg.wwwroot + '/theme/image.php/' + M.cfg.theme + '/core/' + M.cfg.themerev;
var icon = Y.Node.create('<img />');
this.span.appendChild(icon);
// Set up button text and icon.
var suffix = individual ? '_individual' : '_all';
var setHidden = function() {
icon.set('src', iconBase + '/i/show');
icon.set('src', M.util.image_url('i/show', 'core'));
icon.set('alt', M.str.availability['hidden' + suffix]);
this.span.set('title', M.str.availability['hidden' + suffix] + ' \u2022 ' +
M.str.availability.show_verb);
};
var setShown = function() {
icon.set('src', iconBase + '/i/hide');
icon.set('src', M.util.image_url('i/hide', 'core'));
icon.set('alt', M.str.availability['shown' + suffix]);
this.span.set('title', M.str.availability['shown' + suffix] + ' \u2022 ' +
M.str.availability.hide_verb);
@@ -1004,9 +1003,8 @@ M.core_availability.EyeIcon.prototype.isHidden = function() {
M.core_availability.DeleteIcon = function(toDelete) {
this.span = Y.Node.create('<a class="availability-delete" href="#" title="' +
M.str.moodle['delete'] + '" role="button">');
var img = Y.Node.create('<img src="' +
M.cfg.wwwroot + '/theme/image.php/' + M.cfg.theme + '/core/' + M.cfg.themerev +
'/t/delete" alt="' + M.str.moodle['delete'] + '" />');
var img = Y.Node.create('<img src="' + M.util.image_url('t/delete', 'core') +
'" alt="' + M.str.moodle['delete'] + '" />');
this.span.appendChild(img);
var click = function(e) {
e.preventDefault();
+1 -1
View File
@@ -338,7 +338,7 @@ class cc2moodle {
$replace_values = array($i,
$i - 1,
$topic['title'],
entities::safexml($topic['title']),
$node_node_course_sections_section_mods_mod);
} else {
+3 -1
View File
@@ -1292,7 +1292,9 @@ class moodle1_question_bank_handler extends moodle1_xml_handler {
* Closes the questions wrapper
*/
public function on_questions_end() {
$this->xmlwriter->end_tag('questions');
if ($this->questionswrapperwritten) {
$this->xmlwriter->end_tag('questions');
}
}
/**
+17 -2
View File
@@ -564,6 +564,9 @@ class restore_update_availability extends restore_execution_step {
rebuild_course_cache($this->get_courseid(), true);
$modinfo = get_fast_modinfo($this->get_courseid());
// Get the date offset for this restore.
$dateoffset = $this->apply_date_offset(1) - 1;
// Update all sections that were restored.
$params = array('backupid' => $this->get_restoreid(), 'itemname' => 'course_section');
$rs = $DB->get_recordset('backup_ids_temp', $params, '', 'newitemid');
@@ -586,7 +589,7 @@ class restore_update_availability extends restore_execution_step {
if (!is_null($section->availability)) {
$info = new \core_availability\info_section($section);
$info->update_after_restore($this->get_restoreid(),
$this->get_courseid(), $this->get_logger());
$this->get_courseid(), $this->get_logger(), $dateoffset);
}
}
$rs->close();
@@ -606,7 +609,7 @@ class restore_update_availability extends restore_execution_step {
if (!is_null($cm->availability)) {
$info = new \core_availability\info_module($cm);
$info->update_after_restore($this->get_restoreid(),
$this->get_courseid(), $this->get_logger());
$this->get_courseid(), $this->get_logger(), $dateoffset);
}
}
$rs->close();
@@ -2114,7 +2117,13 @@ class restore_badges_structure_step extends restore_structure_step {
$data = (object)$data;
$data->usercreated = $this->get_mappingid('user', $data->usercreated);
if (empty($data->usercreated)) {
$data->usercreated = $this->task->get_userid();
}
$data->usermodified = $this->get_mappingid('user', $data->usermodified);
if (empty($data->usermodified)) {
$data->usermodified = $this->task->get_userid();
}
// We'll restore the badge image.
$restorefiles = true;
@@ -2211,6 +2220,12 @@ class restore_badges_structure_step extends restore_structure_step {
'issuerrole' => $role,
'datemet' => $this->apply_date_offset($data->datemet)
);
// Skip the manual award if recipient or issuer can not be mapped to.
if (empty($award['recipientid']) || empty($award['issuerid'])) {
return;
}
$DB->insert_record('badge_manual_award', $award);
}
}
+65 -1
View File
@@ -38,6 +38,13 @@ require_once($CFG->libdir . '/completionlib.php');
*/
class core_backup_moodle2_testcase extends advanced_testcase {
/**
* Tidy up open files that may be left open.
*/
protected function tearDown() {
gc_collect_cycles();
}
/**
* Tests the availability field on modules and sections is correctly
* backed up and restored.
@@ -331,13 +338,67 @@ class core_backup_moodle2_testcase extends advanced_testcase {
$this->assertEquals($expected, $actual);
}
/**
* When restoring a course, you can change the start date, which shifts other
* dates. This test checks that certain dates are correctly modified.
*/
public function test_restore_dates() {
global $DB, $CFG;
$this->resetAfterTest(true);
$this->setAdminUser();
$CFG->enableavailability = true;
// Create a course with specific start date.
$generator = $this->getDataGenerator();
$course = $generator->create_course(array(
'startdate' => strtotime('1 Jan 2014 00:00 GMT')));
// Add a forum with conditional availability date restriction, including
// one of them nested inside a tree.
$availability = '{"op":"&","showc":[true,true],"c":[' .
'{"op":"&","c":[{"type":"date","d":">=","t":DATE1}]},' .
'{"type":"date","d":"<","t":DATE2}]}';
$before = str_replace(
array('DATE1', 'DATE2'),
array(strtotime('1 Feb 2014 00:00 GMT'), strtotime('10 Feb 2014 00:00 GMT')),
$availability);
$forum = $generator->create_module('forum', array('course' => $course->id,
'availability' => $before));
// Add an assign with defined start date.
$assign = $generator->create_module('assign', array('course' => $course->id,
'allowsubmissionsfromdate' => strtotime('7 Jan 2014 16:00 GMT')));
// Do backup and restore.
$newcourseid = $this->backup_and_restore($course, strtotime('3 Jan 2015 00:00 GMT'));
$modinfo = get_fast_modinfo($newcourseid);
// Check forum dates are modified by the same amount as the course start.
$newforums = $modinfo->get_instances_of('forum');
$newforum = reset($newforums);
$after = str_replace(
array('DATE1', 'DATE2'),
array(strtotime('3 Feb 2015 00:00 GMT'), strtotime('12 Feb 2015 00:00 GMT')),
$availability);
$this->assertEquals($after, $newforum->availability);
// Check assign date.
$newassigns = $modinfo->get_instances_of('assign');
$newassign = reset($newassigns);
$this->assertEquals(strtotime('9 Jan 2015 16:00 GMT'), $DB->get_field(
'assign', 'allowsubmissionsfromdate', array('id' => $newassign->instance)));
}
/**
* Backs a course up and restores it.
*
* @param stdClass $course Course object to backup
* @param int $newdate If non-zero, specifies custom date for new course
* @return int ID of newly restored course
*/
protected function backup_and_restore($course) {
protected function backup_and_restore($course, $newdate = 0) {
global $USER, $CFG;
// Turn off file logging, otherwise it can't delete the file (Windows).
@@ -358,6 +419,9 @@ class core_backup_moodle2_testcase extends advanced_testcase {
$rc = new restore_controller($backupid, $newcourseid,
backup::INTERACTIVE_NO, backup::MODE_GENERAL, $USER->id,
backup::TARGET_NEW_COURSE);
if ($newdate) {
$rc->get_plan()->get_setting('course_startdate')->set_value($newdate);
}
$this->assertTrue($rc->execute_precheck());
$rc->execute_plan();
$rc->destroy();
+49
View File
@@ -45,6 +45,55 @@ abstract class restore_step extends base_step {
}
return $this->task->get_restoreid();
}
/**
* Apply course startdate offset based in original course startdate and course_offset_startdate setting
* Note we are using one static cache here, but *by restoreid*, so it's ok for concurrence/multiple
* executions in the same request
*
* @param int $value Time value (seconds since epoch), or empty for nothing
* @return int Time value after applying the date offset, or empty for nothing
*/
public function apply_date_offset($value) {
// Empties don't offset - zeros (int and string), false and nulls return original value.
if (empty($value)) {
return $value;
}
static $cache = array();
// Lookup cache.
if (isset($cache[$this->get_restoreid()])) {
return $value + $cache[$this->get_restoreid()];
}
// No cache, let's calculate the offset.
$original = $this->task->get_info()->original_course_startdate;
$setting = 0;
if ($this->setting_exists('course_startdate')) { // Seting may not exist (MDL-25019).
$setting = $this->get_setting_value('course_startdate');
}
if (empty($original) || empty($setting)) {
// Original course has not startdate or setting doesn't exist, offset = 0.
$cache[$this->get_restoreid()] = 0;
} else if (abs($setting - $original) < 24 * 60 * 60) {
// Less than 24h of difference, offset = 0 (this avoids some problems with timezones).
$cache[$this->get_restoreid()] = 0;
} else if (!has_capability('moodle/restore:rolldates',
context_course::instance($this->get_courseid()), $this->task->get_userid())) {
// Re-enforce 'moodle/restore:rolldates' capability for the user in the course, just in case.
$cache[$this->get_restoreid()] = 0;
} else {
// Arrived here, let's calculate the real offset.
$cache[$this->get_restoreid()] = $setting - $original;
}
// Return the passed value with cached offset applied.
return $value + $cache[$this->get_restoreid()];
}
}
/*
@@ -245,53 +245,6 @@ abstract class restore_structure_step extends restore_step {
$this->task->add_result($resultstoadd);
}
/**
* Apply course startdate offset based in original course startdate and course_offset_startdate setting
* Note we are using one static cache here, but *by restoreid*, so it's ok for concurrence/multiple
* executions in the same request
*/
public function apply_date_offset($value) {
// empties don't offset - zeros (int and string), false and nulls return original value
if (empty($value)) {
return $value;
}
static $cache = array();
// Lookup cache
if (isset($cache[$this->get_restoreid()])) {
return $value + $cache[$this->get_restoreid()];
}
// No cache, let's calculate the offset
$original = $this->task->get_info()->original_course_startdate;
$setting = 0;
if ($this->setting_exists('course_startdate')) { // Seting may not exist (MDL-25019)
$setting = $this->get_setting_value('course_startdate');
}
// Original course has not startdate or setting doesn't exist, offset = 0
if (empty($original) || empty($setting)) {
$cache[$this->get_restoreid()] = 0;
// Less than 24h of difference, offset = 0 (this avoids some problems with timezones)
} else if (abs($setting - $original) < 24 * 60 * 60) {
$cache[$this->get_restoreid()] = 0;
// Re-enforce 'moodle/restore:rolldates' capability for the user in the course, just in case
} else if (!has_capability('moodle/restore:rolldates',
context_course::instance($this->get_courseid()),
$this->task->get_userid())) {
$cache[$this->get_restoreid()] = 0;
// Arrived here, let's calculate the real offset
} else {
$cache[$this->get_restoreid()] = $setting - $original;
}
// Return the passed value with cached offset applied
return $value + $cache[$this->get_restoreid()];
}
/**
* As far as restore structure steps are implementing restore_plugin stuff, they need to
* have the parent task available for wrapping purposes (get course/context....)
+8
View File
@@ -81,6 +81,14 @@ $output = $PAGE->get_renderer('core', 'badges');
// Roles that can award this badge.
$acceptedroles = array_keys($badge->criteria[BADGE_CRITERIA_TYPE_MANUAL]->params);
if (empty($acceptedroles)) {
echo $OUTPUT->header();
$return = html_writer::link(new moodle_url('recipients.php', array('id' => $badge->id)), $strrecipients);
echo $OUTPUT->notification(get_string('notacceptedrole', 'badges', $return));
echo $OUTPUT->footer();
die();
}
if (count($acceptedroles) > 1) {
// If there is more than one role that can award a badge, prompt user to make a selection.
// If it is an admin, include all accepted roles, otherwise only the ones that current user has in this context.
@@ -150,6 +150,11 @@ class award_criteria_manual extends award_criteria {
public function review($userid, $filtered = false) {
global $DB;
// Roles should always have a parameter.
if (empty($this->params)) {
return false;
}
// Users were already filtered by criteria completion.
if ($filtered) {
return true;
@@ -55,7 +55,7 @@ Feature: Block activity modules
And I click on "Forums" "link" in the "Activities" "block"
And I should see "Frontpage forum name"
And I am on homepage
And I click on "External Tools" "link" in the "Activities" "block"
And I click on "External tools" "link" in the "Activities" "block"
And I should see "Frontpage lti name"
And I am on homepage
And I click on "Quizzes" "link" in the "Activities" "block"
@@ -134,7 +134,7 @@ Feature: Block activity modules
And I click on "Forums" "link" in the "Activities" "block"
And I should see "Test forum name"
And I follow "Course 1"
And I click on "External Tools" "link" in the "Activities" "block"
And I click on "External tools" "link" in the "Activities" "block"
And I should see "Test lti name"
And I follow "Course 1"
And I click on "Quizzes" "link" in the "Activities" "block"
+1 -1
View File
@@ -78,7 +78,7 @@ class block_badges extends block_base {
}
// Number of badges to display.
if (empty($this->config->numberofbadges)) {
if (!isset($this->config->numberofbadges)) {
$this->config->numberofbadges = 10;
}
+27 -6
View File
@@ -59,10 +59,34 @@ function block_course_overview_update_mynumber($number) {
/**
* Sets user course sorting preference in course_overview block
*
* @param array $sortorder sort order of course
* @param array $sortorder list of course ids
*/
function block_course_overview_update_myorder($sortorder) {
set_user_preference('course_overview_course_order', serialize($sortorder));
$value = implode(',', $sortorder);
if (core_text::strlen($value) > 1333) {
// The value won't fit into the user preference. Remove courses in the end of the list (mostly likely user won't even notice).
$value = preg_replace('/,[\d]*$/', '', core_text::substr($value, 0, 1334));
}
set_user_preference('course_overview_course_sortorder', $value);
}
/**
* Gets user course sorting preference in course_overview block
*
* @return array list of course ids
*/
function block_course_overview_get_myorder() {
if ($value = get_user_preferences('course_overview_course_sortorder')) {
return explode(',', $value);
}
// If preference was not found, look in the old location and convert if found.
$order = array();
if ($value = get_user_preferences('course_overview_course_order')) {
$order = unserialize($value);
block_course_overview_update_myorder($order);
unset_user_preference('course_overview_course_order');
}
return $order;
}
/**
@@ -167,10 +191,7 @@ function block_course_overview_get_sorted_courses($showallcourses = false) {
$courses[$remoteid] = $val;
}
$order = array();
if (!is_null($usersortorder = get_user_preferences('course_overview_course_order'))) {
$order = unserialize($usersortorder);
}
$order = block_course_overview_get_myorder();
$sortedcourses = array();
$counter = 0;
@@ -245,12 +245,5 @@ class block_glossary_random extends block_base {
return $this->content;
}
function hide_header() {
if (empty($this->config->title)) {
return true;
}
return false;
}
}
@@ -294,12 +294,12 @@ class block_recent_activity extends block_base {
if (!isset($modinfo->instances[$modname][$instanceid])) {
continue;
}
$entry['cmid'] = $modinfo->instances[$modname][$instanceid]->id;
if ($log->action == 'add mod') {
$entry['action'] = 0;
} else {
$entry['action'] = 1;
}
$entry['cmid'] = $modinfo->instances[$modname][$instanceid]->id;
}
$entries[] = $entry;
}
@@ -128,7 +128,7 @@ class block_site_main_menu extends block_list {
} else {
$editbuttons = '';
}
if ($mod->visible || has_capability('moodle/course:viewhiddenactivities', $context)) {
if ($mod->visible || has_capability('moodle/course:viewhiddenactivities', $mod->context)) {
if ($ismoving) {
if ($mod->id == $USER->activitycopy) {
continue;
@@ -130,7 +130,7 @@ class block_social_activities extends block_list {
} else {
$editbuttons = '';
}
if ($mod->visible || has_capability('moodle/course:viewhiddenactivities', $context)) {
if ($mod->visible || has_capability('moodle/course:viewhiddenactivities', $mod->context)) {
if ($ismoving) {
if ($mod->id == $USER->activitycopy) {
continue;
@@ -169,5 +169,3 @@ class block_social_activities extends block_list {
return $this->content;
}
}
+38 -2
View File
@@ -87,6 +87,12 @@ class cachestore_memcache extends cache_store implements cache_is_configurable {
*/
protected $definition;
/**
* If true data going in and out will be encoded.
* @var bool
*/
protected $encode = true;
/**
* Default prefix for key names.
* @var string
@@ -150,6 +156,24 @@ class cachestore_memcache extends cache_store implements cache_is_configurable {
}
$this->definition = $definition;
$this->isinitialised = true;
$this->encode = self::require_encoding();
}
/**
* Tests if encoding is going to be required.
*
* Prior to memcache 3.0.3 scalar data types were not preserved.
* For earlier versions of the memcache extension we need to encode and decode scalar types
* to ensure that it is preserved.
*
* @param string $version The version to check, if null it is fetched from PHP.
* @return bool
*/
public static function require_encoding($version = null) {
if (!$version) {
$version = phpversion('memcache');
}
return (version_compare($version, '3.0.3', '<'));
}
/**
@@ -240,7 +264,11 @@ class cachestore_memcache extends cache_store implements cache_is_configurable {
* @return mixed The data that was associated with the key, or false if the key did not exist.
*/
public function get($key) {
return $this->connection->get($this->parse_key($key));
$result = $this->connection->get($this->parse_key($key));
if ($this->encode && $result !== false) {
return @unserialize($result);
}
return $result;
}
/**
@@ -267,6 +295,9 @@ class cachestore_memcache extends cache_store implements cache_is_configurable {
$return[$key] = false;
} else {
$return[$key] = $result[$mkey];
if ($this->encode && $return[$key] !== false) {
$return[$key] = @unserialize($return[$key]);
}
}
}
return $return;
@@ -280,6 +311,11 @@ class cachestore_memcache extends cache_store implements cache_is_configurable {
* @return bool True if the operation was a success false otherwise.
*/
public function set($key, $data) {
if ($this->encode) {
// We must serialise this data.
$data = serialize($data);
}
return $this->connection->set($this->parse_key($key), $data, MEMCACHE_COMPRESSED, $this->definition->get_ttl());
}
@@ -294,7 +330,7 @@ class cachestore_memcache extends cache_store implements cache_is_configurable {
public function set_many(array $keyvaluearray) {
$count = 0;
foreach ($keyvaluearray as $pair) {
if ($this->connection->set($this->parse_key($pair['key']), $pair['value'], MEMCACHE_COMPRESSED, $this->definition->get_ttl())) {
if ($this->set($pair['key'], $pair['value'])) {
$count++;
}
}
+26
View File
@@ -90,4 +90,30 @@ class cachestore_memcache_test extends cachestore_tests {
$this->assertEquals($key, $value);
}
}
/**
* Test our checks for encoding.
*/
public function test_require_encoding() {
$this->assertTrue(cachestore_memcache::require_encoding('dev'));
$this->assertTrue(cachestore_memcache::require_encoding('1.0'));
$this->assertTrue(cachestore_memcache::require_encoding('1.0.0'));
$this->assertTrue(cachestore_memcache::require_encoding('2.0'));
$this->assertTrue(cachestore_memcache::require_encoding('2.0.8'));
$this->assertTrue(cachestore_memcache::require_encoding('2.2.8'));
$this->assertTrue(cachestore_memcache::require_encoding('3.0'));
$this->assertTrue(cachestore_memcache::require_encoding('3.0-dev'));
$this->assertTrue(cachestore_memcache::require_encoding('3.0.0'));
$this->assertTrue(cachestore_memcache::require_encoding('3.0.1'));
$this->assertTrue(cachestore_memcache::require_encoding('3.0.2-dev'));
$this->assertTrue(cachestore_memcache::require_encoding('3.0.2'));
$this->assertTrue(cachestore_memcache::require_encoding('3.0.3-dev'));
$this->assertFalse(cachestore_memcache::require_encoding('3.0.3'));
$this->assertFalse(cachestore_memcache::require_encoding('3.0.4'));
$this->assertFalse(cachestore_memcache::require_encoding('3.0.4-dev'));
$this->assertFalse(cachestore_memcache::require_encoding('3.0.8'));
$this->assertFalse(cachestore_memcache::require_encoding('3.1.0'));
$this->assertFalse(cachestore_memcache::require_encoding('3.1.2'));
}
}
+5 -2
View File
@@ -247,16 +247,19 @@ class cachestore_memcached extends cache_store implements cache_is_configurable
* be set to false.
*/
public function get_many($keys) {
$return = array();
$result = $this->connection->getMulti($keys);
if (!is_array($result)) {
$result = array();
}
foreach ($keys as $key) {
if (!array_key_exists($key, $result)) {
$result[$key] = false;
$return[$key] = false;
} else {
$return[$key] = $result[$key];
}
}
return $result;
return $return;
}
/**
+3
View File
@@ -556,6 +556,9 @@ class cachestore_mongodb extends cache_store implements cache_is_configurable {
}
$store = new cachestore_mongodb('Test mongodb', $configuration);
if (!$store->is_ready()) {
return false;
}
$store->initialise($definition);
return $store;
+31 -11
View File
@@ -86,19 +86,39 @@ abstract class cachestore_tests extends advanced_testcase {
*/
public function run_tests(cache_store $instance) {
// Test set.
// Test set with a string.
$this->assertTrue($instance->set('test1', 'test1'));
$this->assertTrue($instance->set('test2', 'test2'));
$this->assertTrue($instance->set('test3', '3'));
// Test get.
$this->assertEquals('test1', $instance->get('test1'));
$this->assertEquals('test2', $instance->get('test2'));
// Test get with a string.
$this->assertSame('test1', $instance->get('test1'));
$this->assertSame('test2', $instance->get('test2'));
$this->assertSame('3', $instance->get('test3'));
// Test set with an int.
$this->assertTrue($instance->set('test1', 1));
$this->assertTrue($instance->set('test2', 2));
// Test get with an int.
$this->assertSame(1, $instance->get('test1'));
$this->assertInternalType('int', $instance->get('test1'));
$this->assertSame(2, $instance->get('test2'));
$this->assertInternalType('int', $instance->get('test2'));
// Test set with a bool.
$this->assertTrue($instance->set('test1', true));
// Test get with an bool.
$this->assertSame(true, $instance->get('test1'));
$this->assertInternalType('boolean', $instance->get('test1'));
// Test delete.
$this->assertTrue($instance->delete('test1'));
$this->assertTrue($instance->delete('test3'));
$this->assertFalse($instance->delete('test3'));
$this->assertFalse($instance->get('test1'));
$this->assertEquals('test2', $instance->get('test2'));
$this->assertSame(2, $instance->get('test2'));
$this->assertTrue($instance->set('test1', 'test1'));
// Test purge.
@@ -114,16 +134,16 @@ abstract class cachestore_tests extends advanced_testcase {
array('key' => 'many4', 'value' => 'many4'),
array('key' => 'many5', 'value' => 'many5')
));
$this->assertEquals(5, $outcome);
$this->assertEquals('many1', $instance->get('many1'));
$this->assertEquals('many5', $instance->get('many5'));
$this->assertSame(5, $outcome);
$this->assertSame('many1', $instance->get('many1'));
$this->assertSame('many5', $instance->get('many5'));
$this->assertFalse($instance->get('many6'));
// Test get_many.
$result = $instance->get_many(array('many1', 'many3', 'many5', 'many6'));
$this->assertInternalType('array', $result);
$this->assertCount(4, $result);
$this->assertEquals(array(
$this->assertSame(array(
'many1' => 'many1',
'many3' => 'many3',
'many5' => 'many5',
@@ -131,7 +151,7 @@ abstract class cachestore_tests extends advanced_testcase {
), $result);
// Test delete_many.
$this->assertEquals(3, $instance->delete_many(array('many2', 'many3', 'many4')));
$this->assertEquals(2, $instance->delete_many(array('many1', 'many5', 'many6')));
$this->assertSame(3, $instance->delete_many(array('many2', 'many3', 'many4')));
$this->assertSame(2, $instance->delete_many(array('many1', 'many5', 'many6')));
}
}
+1 -1
View File
@@ -175,7 +175,7 @@ $ical->add_property('method', 'PUBLISH');
foreach($events as $event) {
if (!empty($event->modulename)) {
$cm = get_coursemodule_from_instance($event->modulename, $event->instance);
if (!\core_availability\info_module::is_user_visible($cm, 0, false)) {
if (!\core_availability\info_module::is_user_visible($cm, $userid, false)) {
continue;
}
}
+47 -34
View File
@@ -318,9 +318,9 @@ function calendar_get_mini($courses, $groups, $users, $calmonth = false, $calyea
}
// Now display all the calendar
$daytime = $display->tstart - DAYSECS;
$daytime = strtotime('-1 day', $display->tstart);
for($day = 1; $day <= $display->maxdays; ++$day, ++$dayweek) {
$daytime += DAYSECS;
$daytime = strtotime('+1 day', $daytime);
if($dayweek > $display->maxwday) {
// We need to change week (table row)
$content .= '</tr><tr>';
@@ -683,19 +683,18 @@ function calendar_get_events($tstart, $tend, $users, $groups, $courses, $withdur
global $DB;
$whereclause = '';
$params = array();
// Quick test
if(is_bool($users) && is_bool($groups) && is_bool($courses)) {
return array();
}
if(is_array($users) && !empty($users)) {
if ((is_array($users) && !empty($users)) or is_numeric($users)) {
// Events from a number of users
if(!empty($whereclause)) $whereclause .= ' OR';
$whereclause .= ' (userid IN ('.implode(',', $users).') AND courseid = 0 AND groupid = 0)';
} else if(is_numeric($users)) {
// Events from one user
if(!empty($whereclause)) $whereclause .= ' OR';
$whereclause .= ' (userid = '.$users.' AND courseid = 0 AND groupid = 0)';
list($insqlusers, $inparamsusers) = $DB->get_in_or_equal($users, SQL_PARAMS_NAMED);
$whereclause .= " (userid $insqlusers AND courseid = 0 AND groupid = 0)";
$params = array_merge($params, $inparamsusers);
} else if($users === true) {
// Events from ALL users
if(!empty($whereclause)) $whereclause .= ' OR';
@@ -704,14 +703,12 @@ function calendar_get_events($tstart, $tend, $users, $groups, $courses, $withdur
// No user at all, do nothing
}
if(is_array($groups) && !empty($groups)) {
if ((is_array($groups) && !empty($groups)) or is_numeric($groups)) {
// Events from a number of groups
if(!empty($whereclause)) $whereclause .= ' OR';
$whereclause .= ' groupid IN ('.implode(',', $groups).')';
} else if(is_numeric($groups)) {
// Events from one group
if(!empty($whereclause)) $whereclause .= ' OR ';
$whereclause .= ' groupid = '.$groups;
list($insqlgroups, $inparamsgroups) = $DB->get_in_or_equal($groups, SQL_PARAMS_NAMED);
$whereclause .= " groupid $insqlgroups ";
$params = array_merge($params, $inparamsgroups);
} else if($groups === true) {
// Events from ALL groups
if(!empty($whereclause)) $whereclause .= ' OR ';
@@ -719,15 +716,11 @@ function calendar_get_events($tstart, $tend, $users, $groups, $courses, $withdur
}
// boolean false (no groups at all): we don't need to do anything
if(is_array($courses) && !empty($courses)) {
if(!empty($whereclause)) {
$whereclause .= ' OR';
}
$whereclause .= ' (groupid = 0 AND courseid IN ('.implode(',', $courses).'))';
} else if(is_numeric($courses)) {
// One course
if ((is_array($courses) && !empty($courses)) or is_numeric($courses)) {
if(!empty($whereclause)) $whereclause .= ' OR';
$whereclause .= ' (groupid = 0 AND courseid = '.$courses.')';
list($insqlcourses, $inparamscourses) = $DB->get_in_or_equal($courses, SQL_PARAMS_NAMED);
$whereclause .= " (groupid = 0 AND courseid $insqlcourses)";
$params = array_merge($params, $inparamscourses);
} else if ($courses === true) {
// Events from ALL courses
if(!empty($whereclause)) $whereclause .= ' OR';
@@ -761,7 +754,7 @@ function calendar_get_events($tstart, $tend, $users, $groups, $courses, $withdur
$whereclause .= ' AND visible = 1';
}
$events = $DB->get_records_select('event', $whereclause, null, 'timestart');
$events = $DB->get_records_select('event', $whereclause, $params, 'timestart');
if ($events === false) {
$events = array();
}
@@ -795,7 +788,7 @@ function calendar_get_events_by_id($eventids) {
* @return string $content return available control for the calender in html
*/
function calendar_top_controls($type, $data) {
global $PAGE;
global $PAGE, $OUTPUT;
// Get the calendar type we are using.
$calendartype = \core_calendar\type_factory::get_calendar_instance();
@@ -923,7 +916,8 @@ function calendar_top_controls($type, $data) {
}
$content .= html_writer::start_tag('div', array('class'=>'calendar-controls'));
$content .= $left . '<span class="hide"> | </span><h1 class="current">'.userdate($time, get_string('strftimemonthyear'))."</h1>";
$content .= $left . '<span class="hide"> | </span>';
$content .= $OUTPUT->heading(userdate($time, get_string('strftimemonthyear')), 2, 'current');
$content .= '<span class="hide"> | </span>' . $right;
$content .= '<span class="clearer"><!-- --></span>';
$content .= html_writer::end_tag('div')."\n";
@@ -931,8 +925,8 @@ function calendar_top_controls($type, $data) {
case 'day':
$days = calendar_get_days();
$prevtimestamp = $time - DAYSECS;
$nexttimestamp = $time + DAYSECS;
$prevtimestamp = strtotime('-1 day', $time);
$nexttimestamp = strtotime('+1 day', $time);
$prevdate = $calendartype->timestamp_to_date_array($prevtimestamp);
$nextdate = $calendartype->timestamp_to_date_array($nexttimestamp);
@@ -1678,7 +1672,7 @@ function calendar_format_event_time($event, $now, $linkparams = null, $usecommon
$timeend = calendar_time_representation($event->timestart + $event->timeduration);
// Set printable representation.
if ($now >= $usermidnightstart && $now < ($usermidnightstart + DAYSECS)) {
if ($now >= $usermidnightstart && $now < strtotime('+1 day', $usermidnightstart)) {
$url = calendar_get_link_href(new moodle_url(CALENDAR_URL . 'view.php', $linkparams), 0, 0, 0, $endtime);
$eventtime = $timestart . ' <strong>&raquo;</strong> ' . html_writer::link($url, $dayend) . $timeend;
} else {
@@ -2774,7 +2768,7 @@ class calendar_information {
* @return int tomorrow timestamp
*/
public function timestamp_tomorrow() {
return $this->time + DAYSECS;
return strtotime('+1 day', $this->time);
}
/**
* Adds the pretend blocks for the calendar
@@ -2887,10 +2881,11 @@ function calendar_add_subscription($sub) {
* @param stdClass $event The RFC-2445 iCalendar event
* @param int $courseid The course ID
* @param int $subscriptionid The iCalendar subscription ID
* @param string $timezone The X-WR-TIMEZONE iCalendar property if provided
* @throws dml_exception A DML specific exception is thrown for invalid subscriptionids.
* @return int Code: CALENDAR_IMPORT_EVENT_UPDATED = updated, CALENDAR_IMPORT_EVENT_INSERTED = inserted, 0 = error
*/
function calendar_add_icalendar_event($event, $courseid, $subscriptionid) {
function calendar_add_icalendar_event($event, $courseid, $subscriptionid, $timezone='UTC') {
global $DB;
// Probably an unsupported X-MICROSOFT-CDO-BUSYSTATUS event.
@@ -2923,15 +2918,27 @@ function calendar_add_icalendar_event($event, $courseid, $subscriptionid) {
$defaulttz = date_default_timezone_get();
$tz = isset($event->properties['DTSTART'][0]->parameters['TZID']) ? $event->properties['DTSTART'][0]->parameters['TZID'] :
'UTC';
$timezone;
$eventrecord->timestart = strtotime($event->properties['DTSTART'][0]->value . ' ' . $tz);
if (empty($event->properties['DTEND'])) {
$eventrecord->timeduration = 3600; // one hour if no end time specified
$eventrecord->timeduration = 0; // no duration if no end time specified
} else {
$endtz = isset($event->properties['DTEND'][0]->parameters['TZID']) ? $event->properties['DTEND'][0]->parameters['TZID'] :
'UTC';
$timezone;
$eventrecord->timeduration = strtotime($event->properties['DTEND'][0]->value . ' ' . $endtz) - $eventrecord->timestart;
}
// Check to see if it should be treated as an all day event.
if ($eventrecord->timeduration == DAYSECS) {
// Check to see if the event started at Midnight on the imported calendar.
date_default_timezone_set($timezone);
if (date('H:i:s', $eventrecord->timestart) === "00:00:00") {
// This event should be an all day event.
$eventrecord->timeduration = 0;
}
date_default_timezone_set($defaulttz);
}
$eventrecord->uuid = $event->properties['UID'][0]->value;
$eventrecord->timemodified = time();
@@ -3065,8 +3072,14 @@ function calendar_import_icalendar_events($ical, $courseid, $subscriptionid = nu
$sql = "UPDATE {event} SET timemodified = :time WHERE subscriptionid = :id";
$DB->execute($sql, array('time' => 0, 'id' => $subscriptionid));
}
// Grab the timezone from the iCalendar file to be used later.
if (isset($ical->properties['X-WR-TIMEZONE'][0]->value)) {
$timezone = $ical->properties['X-WR-TIMEZONE'][0]->value;
} else {
$timezone = 'UTC';
}
foreach ($ical->components['VEVENT'] as $event) {
$res = calendar_add_icalendar_event($event, $courseid, $subscriptionid);
$res = calendar_add_icalendar_event($event, $courseid, $subscriptionid, $timezone);
switch ($res) {
case CALENDAR_IMPORT_EVENT_UPDATED:
$updatecount++;
+2 -2
View File
@@ -503,9 +503,9 @@ class core_calendar_renderer extends plugin_renderer_base {
$weekend = intval($CFG->calendar_weekend);
}
$daytime = $display->tstart - DAYSECS;
$daytime = strtotime('-1 day', $display->tstart);
for ($day = 1; $day <= $display->maxdays; ++$day, ++$dayweek) {
$daytime = $daytime + DAYSECS;
$daytime = strtotime('+1 day', $daytime);
if($dayweek > $display->maxwday) {
// We need to change week (table row)
$table->data[] = $row;
+4
View File
@@ -139,6 +139,10 @@ $CFG->admin = 'admin';
// any existing key.
// $CFG->mnetkeylifetime = 28;
//
// Not recommended: Set the following to true to allow the use
// off non-Moodle standard characters in usernames.
// $CFG->extendedusernamechars = true;
//
// Allow user passwords to be included in backup files. Very dangerous
// setting as far as it publishes password hashes that can be unencrypted
// if the backup file is publicy available. Use it only if you can guarantee
+9
View File
@@ -1180,6 +1180,15 @@ class core_course_management_renderer extends plugin_renderer_base {
array('class' => 'action-edit')
);
}
// Delete.
if ($course->can_delete()) {
$actions[] = $this->output->action_icon(
new moodle_url('/course/delete.php', array('id' => $course->id)),
new pix_icon('t/delete', get_string('delete')),
null,
array('class' => 'action-delete')
);
}
// Show/Hide.
if ($course->can_change_visibility()) {
$actions[] = $this->output->action_icon(
+9 -2
View File
@@ -101,6 +101,11 @@ class dndupload_handler {
*/
protected $filehandlers = array();
/**
* @var context_course|null
*/
protected $context = null;
/**
* Gather a list of dndupload handlers from the different mods
*
@@ -119,6 +124,8 @@ class dndupload_handler {
$this->register_type('text', array('text', 'text/plain'), get_string('addpagehere', 'moodle'),
get_string('nameforpage', 'moodle'), get_string('whatforpage', 'moodle'), 30);
$this->context = context_course::instance($course->id);
// Loop through all modules to find handlers.
$mods = get_plugin_list_with_function('mod', 'dndupload_register');
foreach ($mods as $component => $funcname) {
@@ -335,7 +342,7 @@ class dndupload_handler {
}
$ret->filehandlers = $this->filehandlers;
$uploadrepo = repository::get_instances(array('type' => 'upload'));
$uploadrepo = repository::get_instances(array('type' => 'upload', 'currentcontext' => $this->context));
if (empty($uploadrepo)) {
$ret->filehandlers = array(); // No upload repo => no file handlers.
}
@@ -481,7 +488,7 @@ class dndupload_ajax_processor {
$draftitemid = file_get_unused_draft_itemid();
$maxbytes = get_max_upload_file_size($CFG->maxbytes, $this->course->maxbytes);
$types = $this->dnduploadhandler->get_handled_file_types($this->module->name);
$repo = repository::get_instances(array('type' => 'upload'));
$repo = repository::get_instances(array('type' => 'upload', 'currentcontext' => $this->context));
if (empty($repo)) {
throw new moodle_exception('errornouploadrepo', 'moodle');
}
+4 -3
View File
@@ -69,8 +69,7 @@ class format_singleactivity extends format_base {
public function extend_course_navigation($navigation, navigation_node $node) {
// Display orphaned activities for the users who can see them.
$context = context_course::instance($this->courseid);
if (has_all_capabilities(array('moodle/course:viewhiddensections',
'moodle/course:viewhiddenactivities'), $context)) {
if (has_capability('moodle/course:viewhiddensections', $context)) {
$modinfo = get_fast_modinfo($this->courseid);
if (!empty($modinfo->sections[1])) {
$section1 = $modinfo->get_section_info(1);
@@ -80,7 +79,9 @@ class format_singleactivity extends format_base {
$orphanednode->nodetype = navigation_node::NODETYPE_BRANCH;
$orphanednode->add_class('orphaned');
foreach ($modinfo->sections[1] as $cmid) {
$this->navigation_add_activity($orphanednode, $modinfo->cms[$cmid]);
if (has_capability('moodle/course:viewhiddenactivities', context_module::instance($cmid))) {
$this->navigation_add_activity($orphanednode, $modinfo->cms[$cmid]);
}
}
}
}
+18
View File
@@ -86,6 +86,15 @@ function add_moduleinfo($moduleinfo, $course, $mform = null) {
} else if (property_exists($moduleinfo, 'availability')) {
$newcm->availability = $moduleinfo->availability;
}
// If there is any availability data, verify it.
if ($newcm->availability) {
$tree = new \core_availability\tree(json_decode($newcm->availability));
// Save time and database space by setting null if the only data
// is an empty tree.
if ($tree->is_empty()) {
$newcm->availability = null;
}
}
}
if (isset($moduleinfo->showdescription)) {
$newcm->showdescription = $moduleinfo->showdescription;
@@ -502,6 +511,15 @@ function update_moduleinfo($cm, $moduleinfo, $course, $mform = null) {
} else if (property_exists($moduleinfo, 'availability')) {
$cm->availability = $moduleinfo->availability;
}
// If there is any availability data, verify it.
if ($cm->availability) {
$tree = new \core_availability\tree(json_decode($cm->availability));
// Save time and database space by setting null if the only data
// is an empty tree.
if ($tree->is_empty()) {
$cm->availability = null;
}
}
}
if (isset($moduleinfo->showdescription)) {
$cm->showdescription = $moduleinfo->showdescription;
+8
View File
@@ -295,6 +295,14 @@ abstract class moodleform_mod extends moodleform {
}
}
// Ratings: Don't let them select an aggregate type without selecting a scale.
// If the user has selected to use ratings but has not chosen a scale or set max points then the form is
// invalid. If ratings have been selected then the user must select either a scale or max points.
// This matches (horrible) logic in data_preprocessing.
if (isset($data['assessed']) && $data['assessed'] > 0 && empty($data['scale'])) {
$errors['assessed'] = get_string('scaleselectionrequired', 'rating');
}
// Completion: Don't let them choose automatic completion without turning
// on some conditions. Ignore this check when completion settings are
// locked, as the options are then disabled.
+18 -17
View File
@@ -768,8 +768,7 @@ class core_course_renderer extends plugin_renderer_base {
if ($mod->uservisible) {
$conditionalhidden = $this->is_cm_conditionally_hidden($mod);
$accessiblebutdim = (!$mod->visible || $conditionalhidden) &&
has_capability('moodle/course:viewhiddenactivities',
context_course::instance($mod->course));
has_capability('moodle/course:viewhiddenactivities', $mod->context);
if ($accessiblebutdim) {
$linkclasses .= ' dimmed';
$textclasses .= ' dimmed_text';
@@ -831,8 +830,7 @@ class core_course_renderer extends plugin_renderer_base {
if ($mod->uservisible) {
$conditionalhidden = $this->is_cm_conditionally_hidden($mod);
$accessiblebutdim = (!$mod->visible || $conditionalhidden) &&
has_capability('moodle/course:viewhiddenactivities',
context_course::instance($mod->course));
has_capability('moodle/course:viewhiddenactivities', $mod->context);
if ($accessiblebutdim) {
$textclasses .= ' dimmed_text';
if ($conditionalhidden) {
@@ -851,8 +849,15 @@ class core_course_renderer extends plugin_renderer_base {
trim('contentafterlink ' . $textclasses)));
}
} else {
$groupinglabel = '';
if (!empty($mod->groupingid) && has_capability('moodle/course:managegroups', context_course::instance($mod->course))) {
$groupings = groups_get_all_groupings($mod->course);
$groupinglabel = html_writer::tag('span', '('.format_string($groupings[$mod->groupingid]->name).')',
array('class' => 'groupinglabel '.$textclasses));
}
// No link, so display only content.
$output = html_writer::tag('div', $accesstext . $content,
$output = html_writer::tag('div', $accesstext . $content . $groupinglabel,
array('class' => 'contentwithoutlink ' . $textclasses));
}
return $output;
@@ -1675,13 +1680,12 @@ class core_course_renderer extends plugin_renderer_base {
$site = get_site();
$output = '';
$this->page->set_button($this->course_search_form('', 'navbar'));
if (can_edit_in_category($category)) {
// 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');
$this->page->set_button($managebutton);
}
if (!$coursecat->id) {
if (can_edit_in_category()) {
// add 'Manage' button instead of course search form
$managebutton = $this->single_button(new moodle_url('/course/management.php'), get_string('managecourses'), 'get');
$this->page->set_button($managebutton);
}
if (coursecat::count_all() == 1) {
// There exists only one category in the system, do not display link to it
$coursecat = coursecat::get_default();
@@ -1745,14 +1749,11 @@ class core_course_renderer extends plugin_renderer_base {
$catdisplayoptions['viewmoreurl'] = new moodle_url($baseurl, array('browse' => 'categories', 'page' => 1));
}
$chelper->set_courses_display_options($coursedisplayoptions)->set_categories_display_options($catdisplayoptions);
// Display course category tree
// Display course category tree.
$output .= $this->coursecat_tree($chelper, $coursecat);
// Add course search form (if we are inside category it was already added to the navbar)
if (!$coursecat->id) {
$output .= $this->course_search_form();
}
// Add course search form.
$output .= $this->course_search_form();
// Add action buttons
$output .= $this->container_start('buttons');
+3 -3
View File
@@ -108,9 +108,9 @@ switch($requestmethod) {
break;
case 'duplicate':
require_capability('moodle/course:manageactivities', $modcontext);
require_capability('moodle/backup:backuptargetimport', $modcontext);
require_capability('moodle/restore:restoretargetimport', $modcontext);
require_capability('moodle/course:manageactivities', $coursecontext);
require_capability('moodle/backup:backuptargetimport', $coursecontext);
require_capability('moodle/restore:restoretargetimport', $coursecontext);
if (!course_allowed_module($course, $cm->modname)) {
throw new moodle_exception('No permission to create that activity');
}
+49 -3
View File
@@ -33,6 +33,13 @@ require_once($CFG->dirroot . '/tag/lib.php');
class core_course_courselib_testcase extends advanced_testcase {
/**
* Tidy up open files that may be left open.
*/
protected function tearDown() {
gc_collect_cycles();
}
/**
* Set forum specific test values for calling create_module().
*
@@ -460,12 +467,12 @@ class core_course_courselib_testcase extends advanced_testcase {
// Conditional activity.
$coursegradeitem = grade_item::fetch_course_item($moduleinfo->course); //the activity will become available only when the user reach some grade into the course itself.
$moduleinfo->availability = '{"op":"&","showc":[true,true],"c":[' .
$moduleinfo->availability = '{"op":"&","showc":[true,true,true,true,true],"c":[' .
'{"type":"date","d":">=","t":' . time() . '},' .
'{"type":"date","d":"<","t":' . (time() + (7 * 24 * 3600)) . '}' .
'{"type":"date","d":"<","t":' . (time() + (7 * 24 * 3600)) . '},' .
'{"type":"grade","id":' . $coursegradeitem->id . ',"min":10,"max":80},' .
'{"type":"profile","sf":"email","op":"contains","v":"@"},'.
'{"type":"completion","id":'. $assigncm->id . ',"e":' . COMPLETION_COMPLETE . '}' .
'{"type":"completion","cm":'. $assigncm->id . ',"e":' . COMPLETION_COMPLETE . '}' .
']}';
// Grading and Advanced grading.
@@ -2497,4 +2504,43 @@ class core_course_courselib_testcase extends advanced_testcase {
$this->assertEventLegacyLogData($expectedlegacydata, $event);
$this->assertEventContextNotUsed($event);
}
/**
* Tests that when creating or updating a module, if the availability settings
* are present but set to an empty tree, availability is set to null in
* database.
*/
public function test_empty_availability_settings() {
global $DB;
$this->setAdminUser();
$this->resetAfterTest();
// Enable availability.
set_config('enableavailability', 1);
// Test add.
$emptyavailability = '{"op":"&","c":[],"showc":[]}';
$course = self::getDataGenerator()->create_course();
$label = self::getDataGenerator()->create_module('label', array(
'course' => $course, 'availability' => $emptyavailability));
$this->assertNull($DB->get_field('course_modules', 'availability',
array('id' => $label->cmid)));
// Test update.
$formdata = $DB->get_record('course_modules', array('id' => $label->cmid));
unset($formdata->availability);
$formdata->availabilityconditionsjson = $emptyavailability;
$formdata->modulename = 'label';
$formdata->coursemodule = $label->cmid;
$draftid = 0;
file_prepare_draft_area($draftid, context_module::instance($label->cmid)->id,
'mod_label', 'intro', 0);
$formdata->introeditor = array(
'itemid' => $draftid,
'text' => '<p>Yo</p>',
'format' => FORMAT_HTML);
update_module($formdata);
$this->assertNull($DB->get_field('course_modules', 'availability',
array('id' => $label->cmid)));
}
}
+9 -1
View File
@@ -47,6 +47,13 @@ class core_course_externallib_testcase extends externallib_advanced_testcase {
require_once($CFG->dirroot . '/course/externallib.php');
}
/**
* Tidy up open files that may be left open.
*/
protected function tearDown() {
gc_collect_cycles();
}
/**
* Test create_categories
*/
@@ -582,7 +589,8 @@ class core_course_externallib_testcase extends externallib_advanced_testcase {
$label = $this->getDataGenerator()->create_module('label', array('course' => $course->id,
'intro' => $labeldescription));
$labelcm = get_coursemodule_from_instance('label', $label->id);
$url = $this->getDataGenerator()->create_module('url', array('course' => $course->id));
$url = $this->getDataGenerator()->create_module('url', array('course' => $course->id,
'name' => 'URL: % & $ ../'));
// Set the required capabilities by the external function.
$context = context_course::instance($course->id);
+3 -1
View File
@@ -94,6 +94,9 @@
require_once($CFG->dirroot.'/calendar/lib.php'); /// This is after login because it needs $USER
// Must set layout before gettting section info. See MDL-47555.
$PAGE->set_pagelayout('course');
if ($section and $section > 0) {
// Get section details and check it exists.
@@ -112,7 +115,6 @@
// Fix course format if it is no longer installed
$course->format = course_get_format($course)->get_format();
$PAGE->set_pagelayout('course');
$PAGE->set_pagetype('course-view-' . $course->format);
$PAGE->set_other_editing_capability('moodle/course:update');
$PAGE->set_other_editing_capability('moodle/course:manageactivities');
+10 -11
View File
@@ -54,14 +54,9 @@ class enrol_database_testcase extends advanced_testcase {
set_config('dbhost', $CFG->dbhost.':'.$CFG->dboptions['dbport'], 'enrol_database');
}
switch (get_class($DB)) {
case 'mssql_native_moodle_database':
set_config('dbtype', 'mssql_n', 'enrol_database');
set_config('dbsybasequoting', '1', 'enrol_database');
break;
switch ($DB->get_dbfamily()) {
case 'mariadb_native_moodle_database':
case 'mysqli_native_moodle_database':
case 'mysql':
set_config('dbtype', 'mysqli', 'enrol_database');
set_config('dbsetupsql', "SET NAMES 'UTF-8'", 'enrol_database');
set_config('dbsybasequoting', '0', 'enrol_database');
@@ -74,12 +69,12 @@ class enrol_database_testcase extends advanced_testcase {
}
break;
case 'oci_native_moodle_database':
case 'oracle':
set_config('dbtype', 'oci8po', 'enrol_database');
set_config('dbsybasequoting', '1', 'enrol_database');
break;
case 'pgsql_native_moodle_database':
case 'postgres':
set_config('dbtype', 'postgres7', 'enrol_database');
$setupsql = "SET NAMES 'UTF-8'";
if (!empty($CFG->dboptions['dbschema'])) {
@@ -100,8 +95,12 @@ class enrol_database_testcase extends advanced_testcase {
}
break;
case 'sqlsrv_native_moodle_database':
set_config('dbtype', 'mssqlnative', 'enrol_database');
case 'mssql':
if (get_class($DB) == 'mssql_native_moodle_database') {
set_config('dbtype', 'mssql_n', 'enrol_database');
} else {
set_config('dbtype', 'mssqlnative', 'enrol_database');
}
set_config('dbsybasequoting', '1', 'enrol_database');
break;
+6 -1
View File
@@ -130,7 +130,11 @@ class enrol_ldap_plugin extends enrol_plugin {
global $DB;
// Do not try to print anything to the output because this method is called during interactive login.
$trace = new error_log_progress_trace($this->errorlogtag);
if (PHPUNIT_TEST) {
$trace = new null_progress_trace();
} else {
$trace = new error_log_progress_trace($this->errorlogtag);
}
if (!$this->ldap_connect($trace)) {
$trace->finished();
@@ -704,6 +708,7 @@ class enrol_ldap_plugin extends enrol_plugin {
$usergroups = $this->ldap_find_user_groups($extmemberuid);
if(count($usergroups) > 0) {
foreach ($usergroups as $group) {
$group = ldap_filter_addslashes($group);
$ldap_search_pattern .= '('.$this->get_config('memberattribute_role'.$role->id).'='.$group.')';
}
}
+12 -5
View File
@@ -1099,19 +1099,26 @@ class course_enrolment_manager {
*/
private function prepare_user_for_display($user, $extrafields, $now) {
$details = array(
'userid' => $user->id,
'courseid' => $this->get_course()->id,
'picture' => new user_picture($user),
'firstname' => fullname($user, has_capability('moodle/site:viewfullnames', $this->get_context())),
'lastseen' => get_string('never'),
'userid' => $user->id,
'courseid' => $this->get_course()->id,
'picture' => new user_picture($user),
'firstname' => fullname($user, has_capability('moodle/site:viewfullnames', $this->get_context())),
'lastseen' => get_string('never'),
'lastcourseaccess' => get_string('never'),
);
foreach ($extrafields as $field) {
$details[$field] = $user->{$field};
}
// Last time user has accessed the site.
if ($user->lastaccess) {
$details['lastseen'] = format_time($now - $user->lastaccess);
}
// Last time user has accessed the course.
if ($user->lastseen) {
$details['lastcourseaccess'] = format_time($now - $user->lastseen);
}
return $details;
}
+2 -2
View File
@@ -186,7 +186,7 @@ foreach ($extrafields as $field) {
$fields = array(
'userdetails' => $userdetails,
'lastseen' => get_string('lastaccess'),
'lastcourseaccess' => get_string('lastcourseaccess'),
'role' => get_string('roles', 'role'),
'group' => get_string('groups', 'group'),
'enrol' => get_string('enrolmentinstances', 'enrol')
@@ -196,7 +196,7 @@ $fields = array(
if (!has_capability('moodle/course:viewhiddenuserfields', $context)) {
$hiddenfields = array_flip(explode(',', $CFG->hiddenuserfields));
if (isset($hiddenfields['lastaccess'])) {
unset($fields['lastseen']);
unset($fields['lastcourseaccess']);
}
if (isset($hiddenfields['groups'])) {
unset($fields['group']);
+2 -5
View File
@@ -52,7 +52,7 @@ class core_files_external extends external_api {
'filearea' => new external_value(PARAM_TEXT, 'file area'),
'itemid' => new external_value(PARAM_INT, 'associated id'),
'filepath' => new external_value(PARAM_PATH, 'file path'),
'filename' => new external_value(PARAM_FILE, 'file name'),
'filename' => new external_value(PARAM_TEXT, 'file name'),
'modified' => new external_value(PARAM_INT, 'timestamp to return files changed after this time.', VALUE_DEFAULT, null),
'contextlevel' => new external_value(PARAM_ALPHA, 'The context level for the file location.', VALUE_DEFAULT, null),
'instanceid' => new external_value(PARAM_INT, 'The instance id for where the file is located.', VALUE_DEFAULT, null)
@@ -112,9 +112,6 @@ class core_files_external extends external_api {
if (empty($fileinfo['filearea'])) {
$fileinfo['filearea'] = null;
}
if (empty($fileinfo['itemid'])) {
$fileinfo['itemid'] = null;
}
if (empty($fileinfo['filename'])) {
$fileinfo['filename'] = null;
}
@@ -209,7 +206,7 @@ class core_files_external extends external_api {
'filearea' => new external_value(PARAM_AREA, ''),
'itemid' => new external_value(PARAM_INT, ''),
'filepath' => new external_value(PARAM_TEXT, ''),
'filename' => new external_value(PARAM_FILE, ''),
'filename' => new external_value(PARAM_TEXT, ''),
'isdir' => new external_value(PARAM_BOOL, ''),
'url' => new external_value(PARAM_TEXT, ''),
'timemodified' => new external_value(PARAM_INT, ''),
+1 -1
View File
@@ -798,7 +798,7 @@ class core_files_renderer extends plugin_renderer_base {
<div class="fp-author">'.get_string('author', 'repository').'<span class="fp-value"></span></div>
<div class="fp-dimensions">'.get_string('dimensions', 'repository').'<span class="fp-value"></span></div>
</div>
<div>
</div>
</div>';
return $rv;
}
+6 -7
View File
@@ -75,15 +75,14 @@ class course_settings_form extends moodleform {
$options = array(-1 => get_string('default', 'grades'),
GRADE_DISPLAY_TYPE_REAL => get_string('real', 'grades'),
GRADE_DISPLAY_TYPE_PERCENTAGE => get_string('percentage', 'grades'),
GRADE_DISPLAY_TYPE_LETTER => get_string('letter', 'grades'),
GRADE_DISPLAY_TYPE_REAL_PERCENTAGE => get_string('realpercentage', 'grades'),
GRADE_DISPLAY_TYPE_REAL_LETTER => get_string('realletter', 'grades'),
GRADE_DISPLAY_TYPE_LETTER_REAL => get_string('letterreal', 'grades'),
GRADE_DISPLAY_TYPE_LETTER_PERCENTAGE => get_string('letterpercentage', 'grades'),
GRADE_DISPLAY_TYPE_PERCENTAGE => get_string('percentage', 'grades'),
GRADE_DISPLAY_TYPE_PERCENTAGE_REAL => get_string('percentagereal', 'grades'),
GRADE_DISPLAY_TYPE_PERCENTAGE_LETTER => get_string('percentageletter', 'grades'),
GRADE_DISPLAY_TYPE_PERCENTAGE_REAL => get_string('percentagereal', 'grades'));
asort($options);
GRADE_DISPLAY_TYPE_LETTER => get_string('letter', 'grades'),
GRADE_DISPLAY_TYPE_LETTER_REAL => get_string('letterreal', 'grades'),
GRADE_DISPLAY_TYPE_LETTER_PERCENTAGE => get_string('letterpercentage', 'grades'));
$default_gradedisplaytype = $CFG->grade_displaytype;
foreach ($options as $key=>$option) {
@@ -94,7 +93,7 @@ class course_settings_form extends moodleform {
}
$mform->addElement('select', 'displaytype', get_string('gradedisplaytype', 'grades'), $options);
$mform->addHelpButton('displaytype', 'gradedisplaytype', 'grades');
$mform->setDefault('displaytype', -1);
$options = array(-1=> get_string('defaultprev', 'grades', $CFG->grade_decimalpoints), 0=>0, 1=>1, 2=>2, 3=>3, 4=>4, 5=>5);
$mform->addElement('select', 'decimalpoints', get_string('decimalpoints', 'grades'), $options);
+9 -1
View File
@@ -335,7 +335,7 @@ if (!$moving) {
if (!$moving && count($grade_edit_tree->categories) > 1) {
echo '<br /><br />';
echo '<input type="hidden" name="bulkmove" value="0" id="bulkmoveinput" />';
$attributes = array('id'=>'menumoveafter');
$attributes = array('id'=>'menumoveafter', 'class' => 'ignoredirty');
echo html_writer::label(get_string('moveselectedto', 'grades'), 'menumoveafter');
echo html_writer::select($grade_edit_tree->categories, 'moveafter', '', array(''=>'choosedots'), $attributes);
$OUTPUT->add_action_handler(new component_action('change', 'submit_bulk_move'), 'menumoveafter');
@@ -368,6 +368,14 @@ if ($moving) {
echo $OUTPUT->container_end();
$PAGE->requires->yui_module('moodle-core-formchangechecker',
'M.core_formchangechecker.init',
array(array(
'formid' => 'gradetreeform'
))
);
$PAGE->requires->string_for_js('changesmadereallygoaway', 'moodle');
echo $OUTPUT->footer();
// Restore original show/hide preference if moving
+3 -2
View File
@@ -180,7 +180,7 @@ class grade_edit_tree {
$item = $category->get_grade_item();
// Add aggregation coef input if not a course item and if parent category has correct aggregation type
$dimmed = ($item->is_hidden()) ? 'dimmed' : '';
$dimmed = ($item->is_hidden()) ? 'dimmed_text' : '';
// Before we print the category's row, we must find out how many rows will appear below it (for the filler cell's rowspan)
$aggregation_position = grade_get_setting($COURSE->id, 'aggregationposition', $CFG->grade_aggregationposition);
@@ -671,6 +671,7 @@ class grade_edit_tree_column_aggregation extends grade_edit_tree_column_category
} else {
$attributes = array();
$attributes['id'] = 'aggregation_'.$category->id;
$attributes['class'] = 'ignoredirty';
$aggregation = html_writer::label(get_string('aggregation', 'grades'), 'aggregation_'.$category->id, false, array('class' => 'accesshide'));
$aggregation .= html_writer::select($options, 'aggregation_'.$category->id, $category->aggregation, null, $attributes);
$action = new component_action('change', 'update_category_aggregation', array('courseid' => $params['id'], 'category' => $category->id, 'sesskey' => sesskey()));
@@ -1198,7 +1199,7 @@ class grade_edit_tree_column_select extends grade_edit_tree_column {
if ($params['itemtype'] != 'course' && $params['itemtype'] != 'category') {
$itemselect = '<label class="accesshide" for="select_'.$params['eid'].'">'.
get_string('select', 'grades', $item->itemname).'</label>
<input class="itemselect" type="checkbox" name="select_'.$params['eid'].'" id="select_'.$params['eid'].
<input class="itemselect ignoredirty" type="checkbox" name="select_'.$params['eid'].'" id="select_'.$params['eid'].
'" onchange="toggleCategorySelector();"/>'; // TODO: convert to YUI handler
}
//html_writer::table() will wrap the item cell contents in a <TD> so don't do it here
+2 -1
View File
@@ -645,7 +645,8 @@ class gradingform_guide_controller extends gradingform_controller {
$returnvalue['maxscore'] = $maxscore;
$returnvalue['minscore'] = 0;
if (!empty($this->moduleinstance->grade)) {
$returnvalue['modulegrade'] = $this->moduleinstance->grade;
$graderange = make_grades_menu($this->moduleinstance->grade);
$returnvalue['modulegrade'] = count($graderange) - 1;
}
return $returnvalue;
}
+5
View File
@@ -97,6 +97,11 @@ if (!$iid) {
$csvimport = new csv_import_reader($iid, 'grade');
$csvimport->load_csv_content($text, $formdata->encoding, $separator);
if ($error = $csvimport->get_error()) {
echo $OUTPUT->notification($error);
echo $OUTPUT->footer();
die();
}
// --- get header (field names) ---
$header = $csvimport->get_columns();
+7 -7
View File
@@ -19,11 +19,11 @@ require_once '../../../config.php';
require_once 'lib.php';
require_once $CFG->libdir.'/filelib.php';
$url = required_param('url', PARAM_URL); // only real urls here
$gradesurl = required_param('url', PARAM_URL); // only real urls here
$id = required_param('id', PARAM_INT); // course id
$feedback = optional_param('feedback', 0, PARAM_BOOL);
$url = new moodle_url('/grade/import/xml/import.php', array('id'=>$id,'url'=>$url));
$url = new moodle_url('/grade/import/xml/import.php', array('id' => $id,'url' => $gradesurl));
if ($feedback !== 0) {
$url->param('feedback', $feedback);
}
@@ -46,9 +46,10 @@ require_capability('gradeimport/xml:view', $context);
core_php_time_limit::raise();
raise_memory_limit(MEMORY_EXTRA);
$text = download_file_content($url);
$text = download_file_content($gradesurl);
if ($text === false) {
print_error('cannotreadfile');
print_error('cannotreadfile', 'error',
$CFG->wwwroot . '/grade/import/xml/index.php?id=' . $id, $gradesurl);
}
$error = '';
@@ -75,7 +76,6 @@ if ($importcode !== false) {
}
} else {
print_error('error', 'gradeimport_xml');
print_error('errorduringimport', 'gradeimport_xml',
$CFG->wwwroot . '/grade/import/xml/index.php?id=' . $id, $error);
}
@@ -30,6 +30,7 @@ $string['errincorrectgradeidnumber'] = 'Error - idnumber \'{$a}\' from the impor
$string['errincorrectidnumber'] = 'Error - incorrect idnumber';
$string['errincorrectuseridnumber'] = 'Error - idnumber \'{$a}\' from the import file does not match any user.';
$string['error'] = 'Errors occur';
$string['errorduringimport'] = 'An error occurred when trying to import: {$a}';
$string['fileurl'] = 'Remote file URL';
$string['pluginname'] = 'XML file';
$string['xml:publish'] = 'Publish import grades from XML';
+1
View File
@@ -89,6 +89,7 @@ function grade_get_course_grades($courseid, $userid_or_ids=null) {
$grade->feedbackformat = $grade_grades[$userid]->feedbackformat;
$grade->usermodified = $grade_grades[$userid]->usermodified;
$grade->dategraded = $grade_grades[$userid]->get_dategraded();
$grade->datesubmitted = $grade_grades[$userid]->get_datesubmitted();
// create text representation of grade
if ($grade_item->needsupdate) {
+1
View File
@@ -184,6 +184,7 @@ if ($USER->gradeediting[$course->id] && ($report->get_pref('showquickfeedback')
echo '<div>';
echo '<input type="hidden" value="'.s($courseid).'" name="id" />';
echo '<input type="hidden" value="'.sesskey().'" name="sesskey" />';
echo '<input type="hidden" value="'.time().'" name="timepageload" />';
echo '<input type="hidden" value="grader" name="report"/>';
echo '<input type="hidden" value="'.$page.'" name="page"/>';
echo $reporthtml;
+15 -2
View File
@@ -177,6 +177,7 @@ class grade_report_grader extends grade_report {
// Were any changes made?
$changedgrades = false;
$timepageload = clean_param($data->timepageload, PARAM_INT);
foreach ($data as $varname => $students) {
@@ -251,8 +252,15 @@ class grade_report_grader extends grade_report {
}
$errorstr = '';
// Warn if the grade is out of bounds.
if (!is_null($finalgrade)) {
$skip = false;
$dategraded = $oldvalue->get_dategraded();
if (!empty($dategraded) && $timepageload < $dategraded) {
// Warn if the grade was updated while we were editing this form.
$errorstr = 'gradewasmodifiedduringediting';
$skip = true;
} else if (!is_null($finalgrade)) {
// Warn if the grade is out of bounds.
$bounded = $gradeitem->bounded_grade($finalgrade);
if ($bounded > $finalgrade) {
$errorstr = 'lessthanmin';
@@ -260,6 +268,7 @@ class grade_report_grader extends grade_report {
$errorstr = 'morethanmax';
}
}
if ($errorstr) {
$userfields = 'id, ' . get_all_user_name_fields(true);
$user = $DB->get_record('user', array('id' => $userid), $userfields);
@@ -267,6 +276,10 @@ class grade_report_grader extends grade_report {
$gradestr->username = fullname($user);
$gradestr->itemname = $gradeitem->get_name();
$warnings[] = get_string($errorstr, 'grades', $gradestr);
if ($skip) {
// Skipping the update of this grade it failed the tests above.
continue;
}
}
} else if ($datatype == 'feedback') {
+43 -23
View File
@@ -215,16 +215,6 @@ class grade_report_user extends grade_report {
// Grab the grade_tree for this course
$this->gtree = new grade_tree($this->courseid, false, $this->switch, null, !$CFG->enableoutcomes);
// Determine the number of rows and indentation
$this->maxdepth = 1;
$this->inject_rowspans($this->gtree->top_element);
$this->maxdepth++; // Need to account for the lead column that spans all children
for ($i = 1; $i <= $this->maxdepth; $i++) {
$this->evenodd[$i] = 0;
}
$this->tabledata = array();
// Get the user (for full name).
$this->user = $DB->get_record('user', array('id' => $userid));
@@ -238,6 +228,16 @@ class grade_report_user extends grade_report {
$this->canviewhidden = has_capability('moodle/grade:viewhidden', $coursecontext);
}
// Determine the number of rows and indentation.
$this->maxdepth = 1;
$this->inject_rowspans($this->gtree->top_element);
$this->maxdepth++; // Need to account for the lead column that spans all children.
for ($i = 1; $i <= $this->maxdepth; $i++) {
$this->evenodd[$i] = 0;
}
$this->tabledata = array();
// base url for sorting by first/last name
$this->baseurl = $CFG->wwwroot.'/grade/report?id='.$courseid.'&amp;userid='.$userid;
$this->pbarurl = $this->baseurl;
@@ -266,7 +266,15 @@ class grade_report_user extends grade_report {
$count = 1;
foreach ($element['children'] as $key=>$child) {
$count += $this->inject_rowspans($element['children'][$key]);
// If category is hidden then do not include it in the rowspan.
if ($child['type'] == 'category' && $child['object']->is_hidden() && !$this->canviewhidden
&& ($this->showhiddenitems == GRADE_REPORT_USER_HIDE_HIDDEN
|| ($this->showhiddenitems == GRADE_REPORT_USER_HIDE_UNTIL && !$child['object']->is_hiddenuntil()))) {
// Just calculate the rowspans for children of this category, don't add them to the count.
$this->inject_rowspans($element['children'][$key]);
} else {
$count += $this->inject_rowspans($element['children'][$key]);
}
}
$element['rowspan'] = $count;
@@ -433,6 +441,18 @@ class grade_report_user extends grade_report {
/// Actual Grade
$gradeval = $grade_grade->finalgrade;
if (!$this->canviewhidden) {
/// Virtual Grade (may be calculated excluding hidden items etc).
$adjustedgrade = $this->blank_hidden_total_and_adjust_bounds($this->courseid,
$grade_grade->grade_item,
$gradeval);
$gradeval = $adjustedgrade['grade'];
// We temporarily adjust the view of this grade item - because the min and
// max are affected by the hidden values in the aggregation.
$grade_grade->grade_item->grademax = $adjustedgrade['grademax'];
$grade_grade->grade_item->grademin = $adjustedgrade['grademin'];
}
if ($this->showfeedback) {
// Copy $class before appending itemcenter as feedback should not be centered
@@ -460,20 +480,17 @@ class grade_report_user extends grade_report {
$data['grade']['class'] = $class;
$data['grade']['content'] = get_string('submittedon', 'grades', userdate($grade_grade->get_datesubmitted(), get_string('strftimedatetimeshort')));
} elseif ($grade_grade->is_hidden()) {
$data['grade']['class'] = $class.' dimmed_text';
$data['grade']['content'] = '-';
} else if ($grade_grade->is_hidden()) {
$data['grade']['class'] = $class.' dimmed_text';
$data['grade']['content'] = '-';
if ($this->canviewhidden) {
$data['grade']['content'] = grade_format_gradevalue($gradeval,
$grade_grade->grade_item,
true);
}
} else {
$data['grade']['class'] = $class;
$adjustedgrade = $this->blank_hidden_total_and_adjust_bounds($this->courseid,
$grade_grade->grade_item,
$gradeval);
// We temporarily adjust the view of this grade item - because the min and
// max are affected by the hidden values in the aggregation.
$grade_grade->grade_item->grademax = $adjustedgrade['grademax'];
$grade_grade->grade_item->grademin = $adjustedgrade['grademin'];
$data['grade']['content'] = grade_format_gradevalue($adjustedgrade['grade'],
$data['grade']['content'] = grade_format_gradevalue($gradeval,
$grade_grade->grade_item,
true);
}
@@ -495,6 +512,9 @@ class grade_report_user extends grade_report {
} else if ($grade_grade->is_hidden()) {
$data['percentage']['class'] = $class.' dimmed_text';
$data['percentage']['content'] = '-';
if ($this->canviewhidden) {
$data['percentage']['content'] = grade_format_gradevalue($gradeval, $grade_grade->grade_item, true, GRADE_DISPLAY_TYPE_PERCENTAGE);
}
} else {
$data['percentage']['class'] = $class;
$data['percentage']['content'] = grade_format_gradevalue($gradeval, $grade_grade->grade_item, true, GRADE_DISPLAY_TYPE_PERCENTAGE);
+15 -14
View File
@@ -10,20 +10,21 @@
.user-grade thead {border-bottom: 3px double black;}
.user-grade thead th {padding: 0.25em 0.75em;}
.user-grade tbody th {text-align:left;}
.user-grade td.oddd1,
.user-grade th.oddd1 {background-color: #f3dfd0;}
.user-grade td.oddd2,
.user-grade th.oddd2 {background-color: #d0dbf3;}
.user-grade td.oddd3,
.user-grade th.oddd3 {background-color: #d0f3d6;}
.user-grade td.oddd4,
.user-grade th.oddd4 {background-color: #f0f0aa;}
.user-grade td.evend2,
.user-grade th.evend2 {background-color: #b0bbd3;}
.user-grade td.evend3,
.user-grade th.evend3 {background-color: #b0dfb6;}
.user-grade td.evend4,
.user-grade th.evend4 {background-color: #cac8be;}
/* These need to be this specific to override the css from .generaltable */
.user-grade tbody > tr:nth-child(n) > td.oddd1,
.user-grade tbody > tr:nth-child(n) > th.oddd1 {background-color: #f3dfd0;}
.user-grade tbody > tr:nth-child(n) > td.oddd2,
.user-grade tbody > tr:nth-child(n) > th.oddd2 {background-color: #d0dbf3;}
.user-grade tbody > tr:nth-child(n) > td.oddd3,
.user-grade tbody > tr:nth-child(n) > th.oddd3 {background-color: #d0f3d6;}
.user-grade tbody > tr:nth-child(n) > td.oddd4,
.user-grade tbody > tr:nth-child(n) > th.oddd4 {background-color: #f0f0aa;}
.user-grade tbody > tr:nth-child(n) > td.evend2,
.user-grade tbody > tr:nth-child(n) > th.evend2 {background-color: #b0bbd3;}
.user-grade tbody > tr:nth-child(n) > td.evend3,
.user-grade tbody > tr:nth-child(n) > th.evend3 {background-color: #b0dfb6;}
.user-grade tbody > tr:nth-child(n) > td.evend4,
.user-grade tbody > tr:nth-child(n) > th.evend4 {background-color: #cac8be;}
.user-grade td.b1t,
.user-grade td.b2t,
.user-grade th.b1t,
+170 -54
View File
@@ -16,11 +16,26 @@ Feature: We can use calculated grade totals
| user | course | role |
| teacher1 | C1 | editingteacher |
| student1 | C1 | student |
And the following "grade categories" exist:
| fullname | course |
| Sub category 1 | C1|
| Sub category 2 | C1|
And the following "activities" exist:
| activity | course | idnumber | name | intro |
| assign | C1 | a1 | Test assignment one | Submit something! |
| assign | C1 | a2 | Test assignment two | Submit something! |
| assign | C1 | a3 | Test assignment three | Submit something! |
| activity | course | idnumber | name | intro | grade |
| assign | C1 | a1 | Test assignment one | Submit something! | 300 |
| assign | C1 | a2 | Test assignment two | Submit something! | 100 |
| assign | C1 | a3 | Test assignment three | Submit something! | 150 |
| assign | C1 | a4 | Test assignment four | Submit nothing! | 150 |
And the following "activities" exist:
| activity | course | idnumber | name | intro | gradecategory | grade |
| assign | C1 | a5 | Test assignment five | Submit something! | Sub category 1 | 200
| assign | C1 | a6 | Test assignment six | Submit something! | Sub category 1 | 100
| assign | C1 | a7 | Test assignment seven | Submit nothing! | Sub category 1 | 150
And the following "activities" exist:
| activity | course | idnumber | name | intro | gradecategory | grade |
| assign | C1 | a8 | Test assignment eight | Submit something! | Sub category 2 | 200
| assign | C1 | a9 | Test assignment nine | Submit something! | Sub category 2 | 100
| assign | C1 | 10 | Test assignment ten | Submit nothing! | Sub category 2 | 150
And I log in as "teacher1"
And I follow "Course 1"
And I follow "Grades"
@@ -28,10 +43,20 @@ Feature: We can use calculated grade totals
And I give the grade "60.00" to the user "Student 1" for the grade item "Test assignment one"
And I give the grade "20.00" to the user "Student 1" for the grade item "Test assignment two"
And I give the grade "40.00" to the user "Student 1" for the grade item "Test assignment three"
And I give the grade "10.00" to the user "Student 1" for the grade item "Test assignment five"
And I give the grade "5.00" to the user "Student 1" for the grade item "Test assignment six"
And I give the grade "10.00" to the user "Student 1" for the grade item "Test assignment eight"
And I give the grade "5.00" to the user "Student 1" for the grade item "Test assignment nine"
And I press "Update"
And I click on "Edit assign Test assignment two" "link"
And I click on "Hidden" "checkbox"
And I press "Save changes"
And I click on "Edit assign Test assignment five" "link"
And I click on "Hidden" "checkbox"
And I press "Save changes"
And I click on "Edit assign Test assignment eight" "link"
And I click on "Hidden" "checkbox"
And I press "Save changes"
And I follow "Course grade settings"
And I set the field "Grade display type" to "Real (percentage)"
And I press "Save changes"
@@ -41,8 +66,16 @@ Feature: We can use calculated grade totals
And I follow "Edit Course 1"
And I set the field "Aggregation" to "Mean of grades"
And I press "Save changes"
And I follow "Edit Sub category 1"
And I set the field "Aggregation" to "Mean of grades"
And I press "Save changes"
And I follow "Edit Sub category 2"
And I set the field "Aggregation" to "Mean of grades"
And I click on "Show more..." "link"
And I click on "Aggregate only non-empty grades" "checkbox"
And I press "Save changes"
And I turn editing mode off
Then I should see "40.00 (40.00 %)" in the ".course" "css_element"
Then I should see "30.00 (30.00 %)" in the ".course" "css_element"
And I follow "Course grade settings"
And I set the field "Hide totals if they contain hidden items" to "Show totals excluding hidden items"
And I press "Save changes"
@@ -51,18 +84,30 @@ Feature: We can use calculated grade totals
And I follow "Course 1"
And I follow "Grades"
And I set the field "Grade report" to "Overview report"
And I should see "50.00 (50.00 %)" in the "overview-grade" "table"
And I should see "30.42 (30.42 %)" in the "overview-grade" "table"
@javascript
Scenario: Weighted mean of grades aggregation
And I follow "Edit Course 1"
And I set the field "Aggregation" to "Weighted mean of grades"
And I press "Save changes"
And I follow "Edit Sub category 1"
And I set the field "Aggregation" to "Weighted mean of grades"
And I expand all fieldsets
And I set the field "Item weight" to "1"
And I press "Save changes"
And I follow "Edit Sub category 2"
And I set the field "Aggregation" to "Weighted mean of grades"
And I expand all fieldsets
And I set the field "Item weight" to "1"
And I click on "Aggregate only non-empty grades" "checkbox"
And I press "Save changes"
And I click on "Edit assign Test assignment one" "link"
And I expand all fieldsets
And I set the field "Item weight" to "3"
And I press "Save changes"
And I turn editing mode off
Then I should see "48.00 (48.00 %)" in the ".course" "css_element"
Then I should see "27.14 (27.14 %)" in the ".course" "css_element"
And I follow "Course grade settings"
And I set the field "Hide totals if they contain hidden items" to "Show totals excluding hidden items"
And I press "Save changes"
@@ -71,15 +116,27 @@ Feature: We can use calculated grade totals
And I follow "Course 1"
And I follow "Grades"
And I set the field "Grade report" to "Overview report"
And I should see "55.00 (55.00 %)" in the "overview-grade" "table"
And I should see "26.94 (26.94 %)" in the "overview-grade" "table"
@javascript
Scenario: Simple weighted mean of grades aggregation
And I follow "Edit Course 1"
And I set the field "Aggregation" to "Simple weighted mean of grades"
And I press "Save changes"
And I follow "Edit Sub category 1"
And I set the field "Aggregation" to "Simple weighted mean of grades"
And I press "Save changes"
And I follow "Edit Sub category 2"
And I set the field "Aggregation" to "Simple weighted mean of grades"
And I click on "Show more..." "link"
And I click on "Aggregate only non-empty grades" "checkbox"
And I press "Save changes"
And I click on "Edit assign Test assignment one" "link"
And I expand all fieldsets
And I click on "Extra credit" "checkbox"
And I press "Save changes"
And I turn editing mode off
Then I should see "40.00 (40.00 %)" in the ".course" "css_element"
Then I should see "45.19 (45.19 %)" in the ".course" "css_element"
And I follow "Course grade settings"
And I set the field "Hide totals if they contain hidden items" to "Show totals excluding hidden items"
And I press "Save changes"
@@ -88,15 +145,27 @@ Feature: We can use calculated grade totals
And I follow "Course 1"
And I follow "Grades"
And I set the field "Grade report" to "Overview report"
And I should see "50.00 (50.00 %)" in the "overview-grade" "table"
And I should see "48.57 (48.57 %)" in the "overview-grade" "table"
@javascript
Scenario: Mean of grades (with extra credits) aggregation
And I follow "Edit Course 1"
And I set the field "Aggregation" to "Mean of grades (with extra credits)"
And I press "Save changes"
And I follow "Edit Sub category 1"
And I set the field "Aggregation" to "Mean of grades (with extra credits)"
And I press "Save changes"
And I follow "Edit Sub category 2"
And I set the field "Aggregation" to "Mean of grades (with extra credits)"
And I click on "Show more..." "link"
And I click on "Aggregate only non-empty grades" "checkbox"
And I press "Save changes"
And I click on "Edit assign Test assignment one" "link"
And I expand all fieldsets
And I set the field "Extra credit weight" to "2"
And I press "Save changes"
And I turn editing mode off
Then I should see "40.00 (40.00 %)" in the ".course" "css_element"
Then I should see "42.50 (42.50 %)" in the ".course" "css_element"
And I follow "Course grade settings"
And I set the field "Hide totals if they contain hidden items" to "Show totals excluding hidden items"
And I press "Save changes"
@@ -105,15 +174,82 @@ Feature: We can use calculated grade totals
And I follow "Course 1"
And I follow "Grades"
And I set the field "Grade report" to "Overview report"
And I should see "50.00 (50.00 %)" in the "overview-grade" "table"
And I should see "47.22 (47.22 %)" in the "overview-grade" "table"
@javascript
Scenario: Median of grades aggregation
And I follow "Edit Course 1"
And I set the field "Aggregation" to "Median of grades"
And I press "Save changes"
And I follow "Edit Sub category 1"
And I set the field "Aggregation" to "Median of grades"
And I press "Save changes"
And I follow "Edit Sub category 2"
And I set the field "Aggregation" to "Median of grades"
And I click on "Show more..." "link"
And I click on "Aggregate only non-empty grades" "checkbox"
And I press "Save changes"
And I turn editing mode off
Then I should see "40.00 (40.00 %)" in the ".course" "css_element"
Then I should see "26.67 (26.67 %)" in the ".course" "css_element"
And I follow "Course grade settings"
And I set the field "Hide totals if they contain hidden items" to "Show totals excluding hidden items"
And I press "Save changes"
And I log out
And I log in as "student1"
And I follow "Course 1"
And I follow "Grades"
And I set the field "Grade report" to "Overview report"
And I should see "25.83 (25.83 %)" in the "overview-grade" "table"
@javascript
Scenario: Lowest grade aggregation
And I follow "Edit Course 1"
And I set the field "Aggregation" to "Lowest grade"
And I press "Save changes"
And I follow "Edit Sub category 1"
And I set the field "Aggregation" to "Lowest grade"
And I press "Save changes"
And I follow "Edit Sub category 2"
And I set the field "Aggregation" to "Lowest grade"
And I click on "Show more..." "link"
And I click on "Aggregate only non-empty grades" "checkbox"
And I press "Save changes"
And I click on "Edit assign Test assignment five" "link"
And I click on "Hidden" "checkbox"
And I press "Save changes"
And I click on "Edit assign Test assignment four" "link"
And I click on "Hidden" "checkbox"
And I press "Save changes"
And I turn editing mode off
Then I should see "0.00 (0.00 %)" in the ".course" "css_element"
And I follow "Course grade settings"
And I set the field "Hide totals if they contain hidden items" to "Show totals excluding hidden items"
And I press "Save changes"
And I log out
And I log in as "student1"
And I follow "Course 1"
And I follow "Grades"
And I set the field "Grade report" to "Overview report"
And I should see "0.00 (0.00 %)" in the "overview-grade" "table"
@javascript
Scenario: Highest grade aggregation
And I follow "Edit Course 1"
And I set the field "Aggregation" to "Highest grade"
And I press "Save changes"
And I follow "Edit Sub category 1"
And I set the field "Aggregation" to "Highest grade"
And I press "Save changes"
And I follow "Edit Sub category 2"
And I set the field "Aggregation" to "Highest grade"
And I click on "Show more..." "link"
And I click on "Aggregate only non-empty grades" "checkbox"
And I press "Save changes"
And I click on "Edit assign Test assignment one" "link"
And I click on "Hidden" "checkbox"
And I press "Save changes"
And I turn editing mode off
Then I should see "50.00 (50.00 %)" in the ".course" "css_element"
And I follow "Course grade settings"
And I set the field "Hide totals if they contain hidden items" to "Show totals excluding hidden items"
And I press "Save changes"
@@ -124,53 +260,24 @@ Feature: We can use calculated grade totals
And I set the field "Grade report" to "Overview report"
And I should see "50.00 (50.00 %)" in the "overview-grade" "table"
@javascript
Scenario: Lowest grade aggregation
And I follow "Edit Course 1"
And I set the field "Aggregation" to "Lowest grade"
And I press "Save changes"
And I turn editing mode off
Then I should see "20.00 (20.00 %)" in the ".course" "css_element"
And I follow "Course grade settings"
And I set the field "Hide totals if they contain hidden items" to "Show totals excluding hidden items"
And I press "Save changes"
And I log out
And I log in as "student1"
And I follow "Course 1"
And I follow "Grades"
And I set the field "Grade report" to "Overview report"
And I should see "40.00 (40.00 %)" in the "overview-grade" "table"
@javascript
Scenario: Highest grade aggregation
And I follow "Edit Course 1"
And I set the field "Aggregation" to "Highest grade"
And I press "Save changes"
And I click on "Edit assign Test assignment one" "link"
And I click on "Hidden" "checkbox"
And I press "Save changes"
And I turn editing mode off
Then I should see "60.00 (60.00 %)" in the ".course" "css_element"
And I follow "Course grade settings"
And I set the field "Hide totals if they contain hidden items" to "Show totals excluding hidden items"
And I press "Save changes"
And I log out
And I log in as "student1"
And I follow "Course 1"
And I follow "Grades"
And I set the field "Grade report" to "Overview report"
And I should see "40.00 (40.00 %)" in the "overview-grade" "table"
@javascript
Scenario: Mode of grades aggregation
And I follow "Edit Course 1"
And I set the field "Aggregation" to "Mode of grades"
And I press "Save changes"
And I follow "Edit Sub category 1"
And I set the field "Aggregation" to "Mode of grades"
And I press "Save changes"
And I follow "Edit Sub category 2"
And I set the field "Aggregation" to "Mode of grades"
And I click on "Show more..." "link"
And I click on "Aggregate only non-empty grades" "checkbox"
And I press "Save changes"
And I click on "Edit assign Test assignment one" "link"
And I click on "Hidden" "checkbox"
And I press "Save changes"
And I turn editing mode off
Then I should see "60.00 (60.00 %)" in the ".course" "css_element"
Then I should see "50.00 (50.00 %)" in the ".course" "css_element"
And I follow "Course grade settings"
And I set the field "Hide totals if they contain hidden items" to "Show totals excluding hidden items"
And I press "Save changes"
@@ -179,15 +286,24 @@ Feature: We can use calculated grade totals
And I follow "Course 1"
And I follow "Grades"
And I set the field "Grade report" to "Overview report"
And I should see "40.00 (40.00 %)" in the "overview-grade" "table"
And I should see "50.00 (50.00 %)" in the "overview-grade" "table"
@javascript
Scenario: Sum of grades aggregation
And I follow "Edit Sub category 1"
And I set the field "Aggregation" to "Sum of grades"
And I press "Save changes"
And I follow "Edit Sub category 2"
And I set the field "Aggregation" to "Sum of grades"
And I press "Save changes"
And I follow "Edit Course 1"
And I set the field "Aggregation" to "Sum of grades"
And I press "Save changes"
And I click on "Edit assign Test assignment nine" "link"
And I set the field "Extra credit" to "1"
And I press "Save changes"
And I turn editing mode off
Then I should see "120.00 (40.00 %)" in the ".course" "css_element"
Then I should see "150.00 (19.23 %)" in the ".course" "css_element"
And I follow "Course grade settings"
And I set the field "Hide totals if they contain hidden items" to "Show totals excluding hidden items"
And I press "Save changes"
@@ -196,4 +312,4 @@ Feature: We can use calculated grade totals
And I follow "Course 1"
And I follow "Grades"
And I set the field "Grade report" to "Overview report"
And I should see "100.00 (50.00 %)" in the "overview-grade" "table"
And I should see "110.00 (17.19 %)" in the "overview-grade" "table"
+169
View File
@@ -0,0 +1,169 @@
@core @core_grades
Feature: View gradebook when scales are used
In order to use scales to grade activities
As an teacher
I need to be able to view gradebook with scales
Background:
Given I log in as "admin"
And I set the following administration settings values:
| grade_report_showranges | 1 |
| grade_aggregations_visible | Mean of grades,Weighted mean of grades,Simple weighted mean of grades,Mean of grades (with extra credits),Median of grades,Lowest grade,Highest grade,Mode of grades,Sum of grades |
And I navigate to "Scales" node in "Site administration > Grades"
And I press "Add a new scale"
And I set the following fields to these values:
| Name | Letterscale |
| Scale | F,D,C,B,A |
And I press "Save changes"
And I log out
And the following "courses" exist:
| fullname | shortname |
| Course 1 | C1 |
And the following "users" exist:
| username | firstname | lastname | email | idnumber |
| teacher1 | Teacher | 1 | teacher1@asd.com | t1 |
| student1 | Student | 1 | student1@asd.com | s1 |
| student2 | Student | 2 | student2@asd.com | s2 |
| student3 | Student | 3 | student3@asd.com | s3 |
| student4 | Student | 4 | student4@asd.com | s4 |
| student5 | Student | 5 | student5@asd.com | s5 |
And the following "course enrolments" exist:
| user | course | role |
| teacher1 | C1 | editingteacher |
| student1 | C1 | student |
| student2 | C1 | student |
| student3 | C1 | student |
| student4 | C1 | student |
| student5 | C1 | student |
And the following "grade categories" exist:
| fullname | course |
| Sub category 1 | C1 |
And the following "activities" exist:
| activity | course | idnumber | name | intro | gradecategory |
| assign | C1 | a1 | Test assignment one | Submit something! | Sub category 1 |
And I log in as "teacher1"
And I follow "Course 1"
And I follow "Test assignment one"
And I follow "Edit settings"
And I expand all fieldsets
And I set the field "grade[modgrade_type]" to "Scale"
And I set the field "grade[modgrade_scale]" to "Letterscale"
And I press "Save and display"
And I follow "View/grade all submissions"
And I click on "Grade Student 1" "link" in the "Student 1" "table_row"
And I set the field "Grade" to "A"
And I press "Save and show next"
And I set the field "Grade" to "B"
And I press "Save and show next"
And I set the field "Grade" to "C"
And I press "Save and show next"
And I set the field "Grade" to "D"
And I press "Save and show next"
And I set the field "Grade" to "F"
And I press "Save changes"
And I follow "Course 1"
And I follow "Grades"
And I turn editing mode on
@javascript
Scenario: Test displaying scales in gradebook in aggregation method Sum of grades
When I follow "Edit Course 1"
And I set the field "Aggregation" to "Sum of grades"
And I press "Save changes"
And I follow "Edit Sub category 1"
And I set the field "Aggregation" to "Sum of grades"
And I press "Save changes"
And I turn editing mode off
Then the following should exist in the "user-grades" table:
| -1- | -4- | -5- | -6- |
| Student 1 | A | 5.00 | 5.00 |
| Student 2 | B | 4.00 | 4.00 |
| Student 3 | C | 3.00 | 3.00 |
| Student 4 | D | 2.00 | 2.00 |
| Student 5 | F | 1.00 | 1.00 |
And the following should exist in the "user-grades" table:
| -1- | -2- | -3- | -4- |
| Range | FA | 0.005.00 | 0.005.00 |
| Overall average | C | 3.00 | 3.00 |
And I follow "User report"
And I set the field "Select all or one user" to "Student 3"
And I click on "Select all or one user" "select"
And the following should exist in the "user-grade" table:
| Grade item | Grade | Range | Percentage |
| Test assignment one | C | FA | 50.00 % |
| Category total | 3.00 | 05 | 60.00 % |
| Course total | 3.00 | 05 | 60.00 % |
And I set the field "jump" to "Simple view"
And the following should exist in the "grade_edit_tree_table" table:
| Name | Max grade |
| Test assignment one | 5.00 |
| Category total | 5.00 |
| Course total | 5.00 |
And I log out
And I log in as "student2"
And I follow "Course 1"
And I follow "Grades"
And the following should exist in the "user-grade" table:
| Grade item | Grade | Range | Percentage |
| Test assignment one | B | FA | 75.00 % |
| Category total | 4.00 | 05 | 80.00 % |
| Course total | 4.00 | 05 | 80.00 % |
@javascript
Scenario Outline: Test displaying scales in gradebook in all other aggregation methods
When I follow "Edit Course 1"
And I set the field "Aggregation" to "<aggregation>"
And I press "Save changes"
And I follow "Edit Sub category 1"
And I expand all fieldsets
And I set the field "Aggregation" to "<aggregation>"
And I set the field "Category name" to "Sub category (<aggregation>)"
And I set the field "Maximum grade" to "5"
And I set the field "Minimum grade" to "1"
And I press "Save changes"
And I turn editing mode off
Then the following should exist in the "user-grades" table:
| -1- | -4- | -5- | -6- |
| Student 1 | A | 5.00 | <coursetotal1> |
| Student 2 | B | 4.00 | <coursetotal2> |
| Student 3 | C | 3.00 | <coursetotal3> |
| Student 4 | D | 2.00 | <coursetotal4> |
| Student 5 | F | 1.00 | <coursetotal5> |
And the following should exist in the "user-grades" table:
| -1- | -2- | -3- | -4- |
| Range | FA | 1.005.00 | 0.00100.00 |
| Overall average | C | 3.00 | <overallavg> |
And I follow "User report"
And I set the field "Select all or one user" to "Student 3"
And I click on "Select all or one user" "select"
And the following should exist in the "user-grade" table:
| Grade item | Grade | Range | Percentage |
| Test assignment one | C | FA | 50.00 % |
| Category total | 3.00 | 15 | 50.00 % |
| Course total | <coursetotal3> | 0100 | <courseperc3> |
And I set the field "jump" to "Simple view"
And the following should exist in the "grade_edit_tree_table" table:
| Name | Max grade |
| Test assignment one | A (5) |
| Category total | |
| Course total | |
And I log out
And I log in as "student2"
And I follow "Course 1"
And I follow "Grades"
And the following should exist in the "user-grade" table:
| Grade item | Grade | Range | Percentage |
| Test assignment one | B | FA | 75.00 % |
| Category total | 4.00 | 15 | 75.00 % |
| Course total | <coursetotal2> | 0100 | <courseperc2> |
Examples:
| aggregation | coursetotal1 | coursetotal2 | coursetotal3 | coursetotal4 | coursetotal5 |overallavg | courseperc2 | courseperc3 |
| Mean of grades | 100.00 | 75.00 | 50.00 | 25.00 | 0.00 | 50.00 | 75.00 % | 50.00 % |
| Weighted mean of grades | - | - | - | - | - | - | - | - |
| Simple weighted mean of grades | 100.00 | 75.00 | 50.00 | 25.00 | 0.00 | 50.00 | 75.00 % | 50.00 % |
| Mean of grades (with extra credits) | 100.00 | 75.00 | 50.00 | 25.00 | 0.00 | 50.00 | 75.00 % | 50.00 % |
| Median of grades | 100.00 | 75.00 | 50.00 | 25.00 | 0.00 | 50.00 | 75.00 % | 50.00 % |
| Lowest grade | 100.00 | 75.00 | 50.00 | 25.00 | 0.00 | 50.00 | 75.00 % | 50.00 % |
| Highest grade | 100.00 | 75.00 | 50.00 | 25.00 | 0.00 | 50.00 | 75.00 % | 50.00 % |
| Mode of grades | 100.00 | 75.00 | 50.00 | 25.00 | 0.00 | 50.00 | 75.00 % | 50.00 % |
+4
View File
@@ -65,6 +65,7 @@ class core_grade_report_graderlib_testcase extends advanced_testcase {
$data = new stdClass();
$data->id = $course->id;
$data->report = 'grader';
$data->timepageload = time();
$data->grade = array();
$data->grade[$student->id] = array();
@@ -79,6 +80,7 @@ class core_grade_report_graderlib_testcase extends advanced_testcase {
// Grade above max. Should be pulled down to max.
$toobig = 200.00;
$data->grade[$student->id][$forum1->id] = $toobig;
$data->timepageload = time();
$warnings = $report->process_data($data);
$this->assertEquals(count($warnings), 1);
@@ -88,6 +90,7 @@ class core_grade_report_graderlib_testcase extends advanced_testcase {
// Grade below min. Should be pulled up to min.
$toosmall = -10.00;
$data->grade[$student->id][$forum1->id] = $toosmall;
$data->timepageload = time();
$warnings = $report->process_data($data);
$this->assertEquals(count($warnings), 1);
@@ -98,6 +101,7 @@ class core_grade_report_graderlib_testcase extends advanced_testcase {
$CFG->unlimitedgrades = 1;
$data->grade[$student->id][$forum1->id] = $toobig;
$data->timepageload = time();
$warnings = $report->process_data($data);
$this->assertEquals(count($warnings), 0);
+15 -15
View File
@@ -136,43 +136,43 @@ echo $OUTPUT->header();
?>
<div id="addmembersform">
<h3 class="main"><?php print_string('addgroupstogroupings', 'group'); echo ": $groupingname"; ?></h3>
<form id="assignform" method="post" action="">
<div>
<input type="hidden" name="sesskey" value="<?php p(sesskey()); ?>" />
<table summary="" cellpadding="5" cellspacing="0">
<table summary="" class="generaltable generalbox groupmanagementtable boxaligncenter">
<tr>
<td valign="top">
<td id="existingcell">
<label for="removeselect"><?php print_string('existingmembers', 'group', $currentmemberscount); ?></label>
<br />
<div class="userselector" id="removeselect_wrapper">
<select name="removeselect[]" size="20" id="removeselect" multiple="multiple"
onfocus="document.getElementById('assignform').add.disabled=true;
document.getElementById('assignform').remove.disabled=false;
document.getElementById('assignform').addselect.selectedIndex=-1;">
<?php echo $currentmembersoptions ?>
</select></td>
<td valign="top">
</select></div></td>
<td id="buttonscell">
<p class="arrow_button">
<input name="add" id="add" type="submit" value="<?php echo '&nbsp;'.$OUTPUT->larrow().' &nbsp; &nbsp; '.get_string('add'); ?>" title="<?php print_string('add'); ?>" />
<br />
<input name="remove" id="remove" type="submit" value="<?php echo '&nbsp; '.$OUTPUT->rarrow().' &nbsp; &nbsp; '.get_string('remove'); ?>" title="<?php print_string('remove'); ?>" />
<input name="add" id="add" type="submit"
value="<?php echo $OUTPUT->larrow().'&nbsp;'.get_string('add'); ?>"
title="<?php print_string('add'); ?>" /><br>
<input name="remove" id="remove" type="submit"
value="<?php echo get_string('remove').'&nbsp;'.$OUTPUT->rarrow(); ?>"
title="<?php print_string('remove'); ?>" />
</p>
</td>
<td valign="top">
<td id="potentialcell">
<label for="addselect"><?php print_string('potentialmembers', 'group', $potentialmemberscount); ?></label>
<br />
<div class="userselector" id="addselect_wrapper">
<select name="addselect[]" size="20" id="addselect" multiple="multiple"
onfocus="document.getElementById('assignform').add.disabled=false;
document.getElementById('assignform').remove.disabled=true;
document.getElementById('assignform').removeselect.selectedIndex=-1;">
<?php echo $potentialmembersoptions ?>
</select>
<br />
</div>
</td>
</tr>
<tr><td>
<tr><td colspan="3" id="backcell">
<input type="submit" name="cancel" value="<?php print_string('backtogroupings', 'group'); ?>" />
</td></tr>
</table>
+33
View File
@@ -0,0 +1,33 @@
<?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/>.
/**
* Automatically generated strings for Moodle installer
*
* Do not edit this file manually! It contains just a subset of strings
* needed during the very first steps of installation. This file was
* generated automatically by export-installer.php (which is part of AMOS
* {@link http://docs.moodle.org/dev/Languages/AMOS}) using the
* list of strings defined in /install/stringnames.txt.
*
* @package installer
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
defined('MOODLE_INTERNAL') || die();
$string['availablelangs'] = 'Beskikbare taal pakkette';
+44
View File
@@ -0,0 +1,44 @@
<?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/>.
/**
* Automatically generated strings for Moodle installer
*
* Do not edit this file manually! It contains just a subset of strings
* needed during the very first steps of installation. This file was
* generated automatically by export-installer.php (which is part of AMOS
* {@link http://docs.moodle.org/dev/Languages/AMOS}) using the
* list of strings defined in /install/stringnames.txt.
*
* @package installer
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
defined('MOODLE_INTERNAL') || die();
$string['clianswerno'] = 'n';
$string['cliansweryes'] = 'y';
$string['cliincorrectvalueerror'] = 'هەڵە، نرخی نادروستی "{$a->value}" بۆ "{$a->option}"';
$string['cliincorrectvalueretry'] = 'نرخەکە نادرووستە، تکایە دووبارەبکەوە';
$string['clitypevalue'] = 'نرخی جۆر';
$string['clitypevaluedefault'] = 'نرخی جۆر، تکایە Enter دابگرە بۆ بەکارهێنانی نرخی بنەڕەتیی ({$a})';
$string['cliunknowoption'] = 'هەلبژاردنە نەناسراوەکان:
{$a}
تکایە بەکاربهینە --هەلبژاردنى یارمەتى.';
$string['cliyesnoprompt'] = 'جۆرى y (واتا بەڵێ) یاخود n (واتا نەخێر)';
$string['environmentrequireinstall'] = 'پیویستى بە دامەزراندن و چالاکە';
$string['environmentrequireversion'] = 'چاپ {$a->پیویست بوو} پیویست دەکات و ئایا بەکار دەخەى {$a->رەوان}';
+1 -1
View File
@@ -48,7 +48,7 @@ $string['environmenthead'] = 'Installationsvoraussetzungen werden geprüft ...';
$string['environmentsub2'] = 'Jede Version hat Mindestvoraussetzungen für der PHP-Version und für verbindliche PHP-Extensions. Vor einer Installation oder einer Aktualisierung wird eine vollständige Prüfung durchgeführt. Bitte fragen Sie den Administrator des Servers, wenn Sie mit der Installation einer neuen Version oder mit der Aktivierung von PHP-Extensions nicht weiterkommen.';
$string['errorsinenvironment'] = 'Fehler bei der Prüfung der Systemvoraussetzungen!';
$string['installation'] = 'Installation';
$string['langdownloaderror'] = 'Leider konnte das Sprachpaket \'{$a}\' nicht heruntergeladen werden. Die Installation wird in englischer Sprache fortgesetzt.';
$string['langdownloaderror'] = 'Das Sprachpaket \'{$a}\' konnte nicht heruntergeladen werden. Die Installation wird in englischer Sprache fortgesetzt.';
$string['memorylimithelp'] = '<p>Die PHP-Einstellung memory_limit Ihres Servers ist zur Zeit auf {$a} eingestellt. </p>
<p>Wenn Sie Moodle mit vielen Aktivitäten oder vielen Nutzer/innen verwenden, wird dies vermutlich zu Problemen führen.</p>
<p>Wir empfehlen die Einstellung wenn möglich zu erhöhen, z.B. auf 40M oder mehr. Dies können Sie auf verschiedene Arten machen:</p>
+1 -1
View File
@@ -33,7 +33,7 @@ defined('MOODLE_INTERNAL') || die();
$string['clianswerno'] = 'n';
$string['cliansweryes'] = 's';
$string['cliincorrectvalueerror'] = 'Error, valor incorrecto "{$a->value}" para "{$a->option}"';
$string['cliincorrectvalueretry'] = 'Valor incorrecto, por favor, inténtelo de nuevo';
$string['cliincorrectvalueretry'] = 'Valor incorrecto, por favor inténtelo de nuevo';
$string['clitypevalue'] = 'valor del tipo';
$string['clitypevaluedefault'] = 'valor del tipo, pulse Enter para utilizar el valor por defecto ({$a})';
$string['cliunknowoption'] = 'Opciones no reconocidas:
+34
View File
@@ -0,0 +1,34 @@
<?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/>.
/**
* Automatically generated strings for Moodle installer
*
* Do not edit this file manually! It contains just a subset of strings
* needed during the very first steps of installation. This file was
* generated automatically by export-installer.php (which is part of AMOS
* {@link http://docs.moodle.org/dev/Languages/AMOS}) using the
* list of strings defined in /install/stringnames.txt.
*
* @package installer
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
defined('MOODLE_INTERNAL') || die();
$string['parentlanguage'] = 'es';
$string['thislanguage'] = 'Español Venezuela';
+2 -2
View File
@@ -35,7 +35,7 @@ $string['availablelangs'] = 'Popis dostupnih jezika';
$string['chooselanguagehead'] = 'Odaberite jezik';
$string['chooselanguagesub'] = 'Molimo odaberite jezik instalacije. Ovaj jezik će biti korišten kao zadani jezik sustava, a kasnije to možete lagano promijeniti.';
$string['clialreadyconfigured'] = 'Datoteka config.php već postoji. Upotrijebite naredbu admin/cli/install_database.php ako želite nastaviti instalaciju.';
$string['clialreadyinstalled'] = 'Datoteka config.php već postoji. Upotrijebite naredbu admin/cli/upgrade.php ako želite nadograditi ovaj sustav.';
$string['clialreadyinstalled'] = 'Datoteka config.php već postoji. Upotrijebite naredbu admin/cli/install_database.php ako želite nadograditi ovaj sustav.';
$string['cliinstallheader'] = 'Moodle {$a} program za instalaciju iz naredbenog retka';
$string['databasehost'] = 'Poslužitelj baze podataka (HOST)';
$string['databasename'] = 'Naziv baze podataka';
@@ -56,7 +56,7 @@ $string['memorylimithelp'] = '<p>PHP ograničenje memorije na poslužitelju je t
<p>Preporučujemo da konfigurirate PHP s većim ograničenjem ako je moguće, recimo 40M. Postoji nekoliko načina na koje to možete napraviti:</p>
<ol>
<li>Ako možete, rekompajlirajte PHP s <i>--enable-memory-limit</i>. Ovo će dozvoliti Moodle sustavu samostalno postavljanje memorijskog ograničenja.</li>
<li>Ako možete, rekompajlirajte PHP s <i>--enable-memory-limit</i>. Ovo će dopustiti Moodle sustavu samostalno postavljanje memorijskog ograničenja.</li>
<li>Ako imate pristup php.ini datoteci, možete promijeniti <b>memory_limit</b> vrijednost na 40M. Ako nemate pristup toj datoteci možete pitati svog administratora da to uradi.</li>
<li>Na nekim PHP poslužiteljima možete napraviti .htaccess datoteku u Moodle mapi koja sadrži red: <p><blockquote>php_value memory_limit 40M</blockquote></p>
<p>Uzmite u obzir da će na nekim poslužiteljima to spriječiti prikazivanje <b>svih</b> PHP stranica (bit će vam prikazana poruka o grešci), pa ćete na takvim poslužiteljima morati ukloniti .htaccess datoteku.</p></li> </ol>';

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