598 Commits

Author SHA1 Message Date
Mikhail Golenkov
f8d859a685 MDL-47178 question: Retain question authors when restoring backups. 2020-10-06 09:29:18 +11:00
Claude Vervoort
5b8c646e68 MDL-66934 mod_lti: support context history param 2020-09-18 14:11:34 -04:00
Nathan Nguyen
65c847d8fd MDL-68702 core_backup: exclude legacy course files 2020-09-11 10:41:37 +10:00
Dmitrii Metelkin
f52114addb MDL-69418 backup: attach data to grade items 2020-08-28 09:36:12 +10:00
Eloy Lafuente (stronk7)
b7100ae5b1 MDL-69475 backup: Proper handling of backup::RELEASE versions
1) Remove any floatval() casting. They are breaking / killing
   .10 versions (converting them to .1). Since Moodle 2.0 all the
   backup::RELEASE have been 100% numerical values.
2) Use version_compare() always to compare backup::RELEASE values.
   They are always versions and the function is aware of versions
   > .9, able to clean/ignore alpha chars... and everything else.

Note that I've also changed a couple of cases in formats (topics and
weeks) that were correct, but just added the same comment and used
the same version_compare() comparison parameters style, so all uses
in core are consistent (and safe to be copied out there).
2020-08-18 12:48:10 +02:00
Ilya Tregubov
d83bf6e0ff MDL-68203 restore: Decode quiz links when restore into existing course
or duplicating.
2020-05-27 10:38:40 +10:00
Adrian Greeve
5ec37d28a6 Merge branch 'master_MDL-64843_course_copy_ui' of https://github.com/catalyst/moodle 2020-05-18 10:35:44 +08:00
Matt Porritt
01436f7539 MDL-64843 Backup: Course copy user interface
This patch adds better core support for copying courses.
There is now a simplified and dedicated UI for copying
courses. This can be accessed from the course context
menu or course management screens.

All backups are done asynchronously and there can be multiple
copies of a course in flight at once.
2020-05-15 06:02:02 +00:00
Amaia Anabitarte
66489aea0f MDL-68314 core_contentbank: Backup and restore tests 2020-05-13 09:35:58 +02:00
Amaia Anabitarte
3449e22683 MDL-68314 core_contentbank: Course content bank backup and restore 2020-05-13 09:35:58 +02:00
Peter
74d95c7bf9 MDL-65724 core: Force restore to use the settings from the plan
When importing use the import settings.
2020-03-06 13:43:39 +08:00
cescobedo
e24f4a2ecd MDL-66593 core_backup: Replace h5p/embed.php url for H5PEMBED@$ 2019-10-30 06:46:35 +01:00
Tim Hunt
c7a6488fad MDL-66743 backup: reports should be able to backup module-level data 2019-09-23 19:24:33 +01:00
Tim Hunt
e05d99b94f MDL-66709 backup: move question attempt data helpers to a trait
This lets plugins other than activity modules backup and restore
question attempt data.

The old backup_questions_activity_structure_step and
restore_questions_activity_structure_step base classes still exist
and work exactly the same way they did before (because they use the
trait) so this change is completely backwards compatible.

To make this work fully, a few other things in the code had to be tweaked:

* Adding restore path elements had to consider the possibility of grouped
  parents in more places.

* I needed to add protected get_task() to the restore_plugin class.
  I don't think that is a problem.

* In the restore trait, the process_question_... methods needed to be
  changed to public for some reasons to do with PHP traits that I don't
  fully understand. However, I don't think this change is a problem.

* The way question_usage restore got the new contextid had to be changed
  (or it did not work in activity contexts), but the new code looks like
  a better way to do it anyway so that is good.
2019-09-23 19:24:32 +01:00
Tim Hunt
a6a4034b38 MDL-66709 backup: improve some PHPdoc type hints
I hope these are right. They seem to be, and made the autocomplete
better in some backup/restore code I was writing.
2019-09-23 19:21:09 +01:00
Mark Nelson
56e28c3bf1 MDL-35773 core_backup: controller has full responsibility for files 2019-07-26 17:00:40 +08:00
Mark Nelson
7c1a42adb4 MDL-35773 core_backup: only include files when necessary 2019-07-26 11:59:56 +08:00
Matt Porritt
d7e4481e98 MDL-35773 Backup: API should have option to not backup files
Allow both UI and automated backups to be created without
including files.  Instead include only file references.
This is essentially implementing "SAMESITE" to backup files
instead of only for import and export functionality.
A new backup setting to include files (defaults to yes)
has been included.

The restore process will also look for and attempt to
restore files from the trashdir as part of restoring
backups.  Additionally to support this process the
ammount of time files are kept in trashdir before they
are cleaned up via cron is also adjustable via admin
setting.
2019-07-26 11:59:56 +08:00
Dmitrii Metelkin
657cc33be9 MDL-65622 core: add grade_item_created event 2019-06-07 07:38:41 +10:00
Dmitrii Metelkin
2c7636490a MDL-65326 backup: check caps exist before assigning 2019-05-28 11:09:51 +10:00
Sara Arjona
bef6805656 Merge branch 'MDL-64702-master' of git://github.com/damyon/moodle 2019-04-29 08:34:21 +02:00
Damyon Wiese
b3337bd5a4 MDL-64702 badges: Add missing data to backup
Backup and restore of badges is missing data:
* alignments
* endorsement

Also added to "clone" (duplicate a badge).
2019-04-23 11:14:00 +08:00
Simey Lameze
9bec0e7e74 MDL-65207 core: replace typos by actually 2019-04-01 08:49:18 +08:00
David Castro
cc179d9641 MDL-65008 question: Query enhancement.
Adding core_question as an additional filter to the tag backup.
2019-03-08 16:35:41 -05:00
Damyon Wiese
031cf251c1 MDL-64878 grades: Rebuild cache on import
When the course module cache is out of date during a gradebook re-calculcation it throws
throws exceptions because the module cannot be found. This prevents access to gradebook or
any type of grading functions until the cache is rebuilt.

When the cache still has no module record we log an error and return the course context.
2019-02-27 10:37:31 +08:00
Marina Glancy
d1fc4bdc1e MDL-57898 core_customfield: strings and other minor fixes 2019-01-18 14:28:24 +01:00
Daniel Neis Araujo
5af9aa6341 MDL-57898 core_course: backup/restore support for course custom fields
This commit is part of work on Custom fields API,
to minimize commit history in moodle core the work of a team of developers was split
into several commits with different authors but the authorship of individual
lines of code may be different from the commit author.
2019-01-18 14:28:24 +01:00
Tim Hunt
2fbd8e9ec0 MDL-63260 qtype_random: orphaned random questions should be deleted
This fix is based on some original code written by Bo Pierce.
2018-12-11 13:59:13 +00:00
Mark Nelson
80b6fb7a79 MDL-27520 core_grades: make constant names clearer
Also using them in more locations.
2018-10-17 15:57:27 +08:00
Damyon Wiese
dd882ba035 MDL-27520 backup: Backup for feedback files 2018-10-17 13:15:49 +08:00
John Beedell
6189fda47f MDL-62708 question: Add idnumbers to question and question category 2018-09-21 12:26:24 +01:00
Andrew Nicols
3f068cf381 MDL-62950 behat: Disable editing for boost test 2018-07-27 10:05:17 +08:00
Michael Hawkins
ef4e04ee26 MDL-37624 calendar: Added location support 2018-06-29 10:46:54 +08:00
Damyon Wiese
c957707106 MDL-60950 assign: Rename class
testable_assign was renamed to mod_assign_testable_assign
2018-06-19 10:53:51 +08:00
Matteo Scaramuccia
ef844148a9 MDL-60923 backup: Added $CFG->backuptempdir
The new setting will allow to host the temporary backup files
into a specific target directory. Defaults to '$CFG->tempdir/backup'.

Calling make_backup_temp_directory() checks that the required sub-directory
will be properly created under the new target directory.
2018-04-16 23:50:28 +02:00
Eric Merrill
815c44ce07 MDL-61913 restore: Protect against blocks that aren't being created 2018-04-11 00:50:27 +02:00
Claude Vervoort
c02324d96a MDL-60416 mod_lti: Introduced LTI Advantage
A huge thanks goes to 'Diego del Blanco' and
'Chris Lawson' for contributing much of their
code and time to this project, and to Cengage
for sponsoring it.

Much appreciated!
2018-04-09 12:08:35 +08:00
Andrew Nicols
682282de55 Merge branch 'MDL-61464-master' of git://github.com/rezaies/moodle 2018-04-05 09:44:05 +08:00
Ngo Nghia
5a8d683fb2 MDL-25617 backup: backup/restore using extra_question_fields 2018-03-28 18:16:34 +02:00
Shamim Rezaie
70ec79f1ba MDL-61464 Backup: Restore question tags into the correct context 2018-03-23 14:19:19 +11:00
Shamim Rezaie
06d7352a0a MDL-61464 Backup: Include contextid for questuin tags 2018-03-23 14:19:19 +11:00
Shamim Rezaie
6bbb7ed570 MDL-61464 Questions: Improved top level category handling in restore
Use question_get_top_category() instead of directly inserting into DB when
parent category is 0. This is to make sure we are not ending up with having
multiple top level question categories for a single context.
2018-03-23 14:19:19 +11:00
Shamim Rezaie
c1d31e42ba MDL-61526 Questions: phpunit test to test restore from 3.4 and 3.5 2018-03-06 01:43:32 +11:00
Shamim Rezaie
e9897ee6ef MDL-61526 Questions: Add 2 backup fixtures from 3.4 and 3.5 2018-03-06 01:41:45 +11:00
Shamim Rezaie
0f80f793df MDL-61526 Questions: Fix creation of multiple TOP question categories
Backup files that are made from Moodle 3.5 already contain TOP categories.
There is no need to create an additional TOP category for them.
2018-03-05 15:44:29 +11:00
David Monllao
d3e54578ea Merge branch 'MDL-52811_prevent_forcelang' of git://github.com/davosmith/moodle 2018-02-06 08:00:11 +01:00
Davo Smith
4ee8ec310a MDL-52811 course: moodle/course:setforcedlanguage integration fixes 2018-02-05 13:20:42 +00:00
Shamim Rezaie
8df402e401 MDL-61132 Questions: Adapt logic on backup/restore
Modifying backup/restore to adapt with "Top" categories.
2018-02-05 11:58:57 +11:00
Davo Smith
4a9624af21 MDL-52811 course: fix unit tests broken by setforcedlanguage 2018-02-01 17:07:23 +00:00
Davo Smith
1433a07881 MDL-52811 course: prevent setting of 'lang' without permission 2018-02-01 17:07:12 +00:00