David Mudrak
ae80f68f31
Improvements in moodle1_xml_handler external API
...
The methods are protected now as they are supposed to be used by
subclasses only. Added a new method to check if the output writer has
been opened.
2011-05-18 16:32:51 +02:00
David Mudrak
c18f90f22f
Merge remote branch 'github/master' into backup-convert
2011-05-18 16:08:15 +02:00
sam marshall
5e0dae125d
MDL-27532 Add backup support for course report per-course data
2011-05-18 14:56:11 +01:00
David Mudrak
c171d28ebc
The basic wrapper for question categories conversion
...
The QUESTION_CATEGORIES tag is optional in moodle.xml but the file
questions.xml is required by the moodle2 restore process. So here we
make sure that at least an empty file is created.
2011-05-18 14:33:05 +02:00
David Mudrak
ba66847b71
Roles definition conversion
2011-05-18 14:12:52 +02:00
David Mudrak
96f7c7ad72
Implemented new XML transformer for the files being written during the conversion
2011-05-18 14:10:04 +02:00
David Mudrak
71d1751c53
Improved the information display about a non-standard backup file
2011-05-18 12:19:57 +02:00
David Mudrak
f666f14930
The first attempt to include backup conversion in the restore process
...
With this initial implementation, we do not display any information
about the backup contents yet. The non-standard backup file is just
silently converted at the beginning of the settings stage, as soon as
the restore controller is available.
In the future we will probably want to display the information about the
contents of the converted file as if we were restoring from standard
MBZ format. However this includes more work in the restore UI machinery
and I leave it open for now.
2011-05-18 01:55:27 +02:00
David Mudrak
3a0767218a
The core_backup_renderer does not need the full backup information any more
...
In the previous implementation, the renderer needed full backup
information just to see if its type is TYPE_1COURSE or not. For
non-standard backups, we do not have the full backup information
available but we can easily decide if we are restoring the whole course
or just its part.
2011-05-18 01:14:24 +02:00
David Mudrak
d51345c7c6
Fixed the class name in the calling code after a recent change
2011-05-18 00:55:24 +02:00
David Mudrak
179982a400
Added missing description of the moodle1 converter
2011-05-18 00:54:00 +02:00
David Mudrak
4eb2a097c5
The display() method in backup/restore UI returns the HTML rather then echoing it
...
This implementation uses a hacky trick with the output buffer unless
someone finds a time to add support for returning the HTML from
quickforms.
2011-05-18 00:50:26 +02:00
David Mudrak
383f6f63c7
Fixed wrong class name
2011-05-16 19:05:34 +02:00
David Mudrak
99a82518eb
The main moodle_backup.xml file is now being generated by the converter
2011-05-16 19:02:13 +02:00
David Mudrak
17d2e210b7
Renamed converter factory method to more self-descriptive get_converter()
2011-05-13 12:06:10 +02:00
David Mudrak
1cc0e42a86
The current element's data are passed to the on_element_end() event handler
2011-05-13 10:16:25 +02:00
David Mudrak
a5ea28b32d
Removing relics of the previous plan/tasks/steps based implementation
...
Kudos to Mark Nielsen for his initial work on this project. In his code,
Mark described the valuable logic of the conversion using a framework
mirroring plan/tasks/steps based architecture of the backup and restore.
My attempt to simplify it led to the current handlers-based
architecture.
2011-05-13 03:09:26 +02:00
David Mudrak
baa6f6a848
Improved course module info conversion
2011-05-13 02:41:47 +02:00
David Mudrak
d5d02635d7
Refactored get_contextid() and unit tests for it
2011-05-12 18:36:03 +02:00
David Mudrak
9b5f1ad5fb
Improved the moodle1_convert stashing subsystem
2011-05-12 18:18:29 +02:00
David Mudrak
beb7de3736
More backup-converter API improvements
...
Added write_xml() helper that writes the given tree-ish structure into
the current xml writer. Improved get_contextid() so that it can use
indices for searching data. Added set_stash() and get_stash() helper
methods.
2011-05-12 15:36:09 +02:00
Tim Hunt
a2ac234956
MDL-20636 Merge remote-tracking branch 'moodle/master' into upgrade
...
Conflicts:
lib/filestorage/file_storage.php
mod/quiz/attemptlib.php
mod/quiz/lib.php
mod/quiz/mod_form.php
mod/quiz/report/overview/overview_table.php
mod/quiz/report/overview/report.php
mod/quiz/report/responses/report.php
mod/quiz/report/responses/responses_table.php
mod/quiz/report/statistics/db/install.xml
mod/quiz/report/statistics/qstats.php
mod/quiz/report/statistics/report.php
mod/quiz/report/statistics/statistics_question_table.php
mod/quiz/report/statistics/statistics_table.php
mod/quiz/report/statistics/version.php
mod/quiz/review.php
mod/quiz/reviewquestion.php
mod/quiz/startattempt.php
mod/quiz/styles.css
mod/quiz/view.php
question/type/essay/questiontype.php
question/type/match/backup/moodle2/backup_qtype_match_plugin.class.php
question/type/match/backup/moodle2/restore_qtype_match_plugin.class.php
question/type/numerical/display.html
question/type/numerical/questiontype.php
question/type/questiontype.php
question/type/random/questiontype.php
question/type/shortanswer/questiontype.php
theme/base/style/question.css
2011-05-11 20:29:49 +01:00
Eloy Lafuente (stronk7)
8298bedab7
MDL-27475 backup - fix start/end notifications order + tests
2011-05-11 20:01:13 +02:00
David Mudrak
a5fe591280
MDL-27376 MDL-27377 MDL-27378 Backup converters refactoring - still work in progress
...
This patch mainly adds support for dispatching path-start and path-end events,
defines API to access backup_ids_temp table. Some ideas emailed by Mark
after his first review of the code are incorporated already.
2011-05-11 03:28:39 +02:00
David Mudrak
1e2c735111
MDL-27376 MDL-27377 MDL-27378 Backup converters refactoring - work in progress
...
These are David's changes of Mark's code that replace the
plan/tasks/steps infrastructure with a bit simpler one. The changes will
be described in the next commit that will actually finish the
conversion.
TODO: refactor backup/converter/moodle1/stepslib.php into conversion
handlers.
2011-05-10 17:58:00 +02:00
David Mudrak
0164592b8c
MDL-27376 MDL-27377 Backup converters API refactored
...
* Several base_converter methods made protected when there was no obvious
reason why they should be public (subject of eventual change still).
* The conversion chain now constructed in advance before any converter
class is instantiated, using Dijkstra's algorithm.
2011-05-10 17:57:59 +02:00
David Mudrak
e48477d94f
MDL-22414 Fixed standard copyright file headers (R0417)
2011-05-10 17:57:59 +02:00
Eloy Lafuente (stronk7)
5b01180aed
Apply parser processor new methods + observe $CFG->keeptempdirectoriesonbackup
2011-05-10 17:57:58 +02:00
Mark Nielsen
be85390109
Adding moodle_backup.xml generation and updating course structure step
2011-05-10 17:57:58 +02:00
Mark Nielsen
8e2c53665e
Adding basic block instance conversion
2011-05-10 17:57:58 +02:00
Mark Nielsen
5aee1af3f1
Adding plugin abstract class and adding a step to activities to generate their module.xml
2011-05-10 17:57:57 +02:00
Mark Nielsen
7c9d2927b8
Cleanup from last commit, just wanted prototype code to be saved to VCS
2011-05-10 17:57:57 +02:00
Mark Nielsen
72c089f117
Adding in activity support and adding base forum classes as proof of concept
2011-05-10 17:57:57 +02:00
Mark Nielsen
534d4294a4
Section conversion
2011-05-10 17:57:57 +02:00
Mark Nielsen
30a4a49421
Figured out how to get the final task to work properly
2011-05-10 17:57:56 +02:00
Mark Nielsen
7125544864
Adding to moodle1 abstract structured step
2011-05-10 17:57:56 +02:00
Mark Nielsen
d2c32ec8a1
A start at a moodle1 abstract structured step
2011-05-10 17:57:56 +02:00
Mark Nielsen
be145927c5
Creating stepslib.php and taskslib.php
2011-05-10 17:57:55 +02:00
Mark Nielsen
56bd1ab0e1
Added use of get_contextid and fixed some problems
2011-05-10 17:57:55 +02:00
Philip Cali
a656fcb387
Adding the convert_file function to the file manager.
2011-05-10 17:57:55 +02:00
Mark Nielsen
62c5daf122
Adding doc block todos
2011-05-10 17:57:55 +02:00
Mark Nielsen
6c0235b375
Adding doc block
2011-05-10 17:57:54 +02:00
Mark Nielsen
e10e887905
Might make it faster...
2011-05-10 17:57:54 +02:00
Mark Nielsen
eba6af755c
Re-arranging function definition
2011-05-10 17:57:53 +02:00
Philip Cali
142ec51fcd
Added contextid generation... I think.
2011-05-10 17:57:53 +02:00
Mark Nielsen
970bc1f3e0
Adding root and final tasks
2011-05-10 17:57:53 +02:00
Mark Nielsen
bb2e1609c5
Full example implementation of the convert course step
2011-05-10 17:57:53 +02:00
Philip Cali
5c10f37b8a
Adding vanilla 1.9 moodle.xml for unit testing.
2011-05-10 17:57:52 +02:00
Mark Nielsen
dda19810e0
Starting to unit test - fixed bugs, things are... working!?!
2011-05-10 17:57:52 +02:00
Mark Nielsen
653bc98b0e
Fixing several bugs while actually trying to execute some of the code
2011-05-10 17:57:52 +02:00