1624 Commits

Author SHA1 Message Date
ppichet
2a6c5c52ee MDL-24594 qtype_multichoice should allow images in the choices.
This change was massively re-worked by Tim Hunt to update Pierre Pichet's original patch for Moodle 2.0 to work in Moodle 2.1.
2011-06-17 18:41:13 +01:00
Eloy Lafuente (stronk7)
28e23ea737 fix permissions 2011-06-16 19:06:07 +02:00
Eloy Lafuente (stronk7)
a16e137f21 Merge branch 'MDL-27639_wip' of git://github.com/timhunt/moodle 2011-06-15 01:30:59 +02:00
Eloy Lafuente (stronk7)
ee1235e7af Merge branch 'backup-convert' of git://github.com/mudrd8mz/moodle 2011-06-14 22:38:27 +02:00
Tim Hunt
98a3898efc MDL-27849 fix qtype_multianswer attempt data restore (2.1 -> 2.1).
Also, refactor calculatedmulti restore to avoid duplication.
2011-06-14 15:17:50 +01:00
Tim Hunt
18ab06bac5 MDL-27639 restore of attempt data from 2.0 - first attempt.
This is now at the stage where it mostly appears to work, at lease on
one backup file.
2011-06-14 12:11:19 +01:00
Eloy Lafuente (stronk7)
25b4558c40 MDL-27822 rename new methods 2011-06-14 00:33:16 +02:00
Tim Hunt
be7b29eff6 MDL-27822 old module version should be available in restore_activity_structure_step::define_structure() 2011-06-14 00:30:30 +02:00
David Mudrak
b7119f4f3f MDL-22414 Exclude unsupported modules from the course contents 2011-06-10 09:01:41 +02:00
David Mudrak
b61cf3ff8a MDL-22414 Merge branch 'master' into backup-convert
Conflicts:
	theme/base/style/core.css
2011-06-09 13:04:49 +02:00
David Mudrak
fad0f24499 MDL-22414 Removing obj_to_readable helper 2011-06-09 11:38:15 +02:00
David Mudrak
4ece48dc36 MDL-22414 Fixed the order of course modules in the restored course
During the restore, the section's sequence field is ignored and the
order of modules is controlled by the order of the <contents> activity
elements. This patch makes sure that the modules are listed in that
section in the right order.

Also, the patch removes the obsolete stash sectionidslist which was
introduced when the method get_stash_itemids() had not existed yet.
2011-06-09 02:41:27 +02:00
David Mudrak
a5f2b97b7f MDL-22414 Fixed debugging information when a particular exception is thrown 2011-06-08 19:15:40 +02:00
David Mudrak
33560f50fb MDL-22414 Added new inforef manager
This helper class keeps the referenced ids to be dumped into the
inforef.xml files. For now, it uses a in-memory storage structures but
in the future we may refactor it so that it can use some persistent
storage (like converter's stashes).
2011-06-08 10:18:56 +02:00
David Mudrak
e29746c25f MDL-22414 Added scales conversion handler 2011-06-08 10:18:44 +02:00
Tim Hunt
030fba85f1 MDL-20636 qe restor make method protected (Eloy review comment B1). 2011-06-06 17:26:33 +01:00
Tim Hunt
54771d89d1 Merge remote-tracking branch 'moodle/master' into MDL-20636_master_new_question_engine
Conflicts:
	lib/db/upgrade.php
	mod/quiz/lib.php
2011-06-06 17:14:59 +01:00
David Mudrak
fe50f530fd MDL-27379 Backup conversion logging facilities 2011-06-06 13:56:06 +02:00
David Mudrak
fa30779b70 MDL-22414 Fixed the convert_path data handling 2011-06-05 16:17:23 +02:00
David Mudrak
718f781690 MDL-27718 Files embedded into the course summary and section summaries are migrated during the conversion 2011-06-04 23:34:26 +02:00
David Mudrak
85d91b6a1b MDL-27448 Do not stop conversion because of missing course files 2011-06-04 22:11:03 +02:00
David Mudrak
c39226d9b2 MDL-22414 Added a helper method to migrate all files referenced from a hypertext 2011-06-04 21:03:11 +02:00
David Mudrak
aa97e0dd52 MDL-22414 File manager allows to set explicit sortorder and accepts filepaths not ending with a slash
We want to set migrated content file in the File module as a main file.
Main files are files with sortorder set to 1. Therefore the file manager
must provide a way to set the sortorder property of the new file record.

The second change allowing filepaths not ending with slash is a helper
as we can easily use dirname() as a value (see the usage in the next
commits). Not providing the dirname() was a bug as the reference to a
file in the HTML text did not respect the migrated file path.
2011-06-04 20:02:03 +02:00
David Mudrak
9e3e8c8004 MDL-27448 Changed the interface of resource module successors to make it clear they are a special case 2011-06-04 16:11:59 +02:00
David Mudrak
9b5f831803 MDL-27448 Added common base class for all resource module successors 2011-06-04 14:38:41 +02:00
David Mudrak
d61ed0afdc MDL-22414 Added possibility to explicitly reset the list of migrated files by a file manager instance 2011-06-04 14:29:39 +02:00
David Mudrak
c818e2df49 MDL-22414 Added helper methods to migrate files referenced by $@FILEPHP@$ 2011-06-04 13:22:27 +02:00
David Mudrak
d73c82e791 MDL-22414 Getting rid of a relict method copied from restore subsystem 2011-06-04 11:46:31 +02:00
David Mudrak
a78b139ce6 Merge branch 'master' into backup-convert 2011-06-03 23:22:23 +02:00
David Mudrak
c15649fbd2 MDL-27626 random question conversion support 2011-06-03 22:59:13 +02:00
David Mudrak
0e3a69b0e5 MDL-22414 Provided a work around MDL-27713
Currently the underlying backup/restore code does not differentiate null
and empty array data. So we have to explicitly check that we got array,
even though the correct set_stash() was called.
2011-06-03 22:45:46 +02:00
David Mudrak
c0e3796e1b MDL-27626 calculated qtype conversion support
uff...
2011-06-03 21:57:00 +02:00
David Mudrak
aaf88d2cb2 MDL-27626 numerical_options are written only if there are some numerical_units available
This reflects the logic of the backup 2.0. Previously, the new
numerical_options structure was written always, even if there were no
numerical_units.
2011-06-03 21:56:59 +02:00
David Mudrak
23007e5d27 MDL-22414 Fixed wrong usage of static caches
These static caches were bad idea of mine. Multiple conversion jobs
executed from a single PHP script share such variables, of course, which
is wrong. This patch removes one static cache completely and
reimplements the other two static caches as normal member variables.
2011-06-03 21:54:13 +02:00
David Mudrak
38bce21a9e MDL-22414 Fixed the id generation entropy 2011-06-03 18:54:57 +02:00
David Mudrak
cd92d83bf2 MDL-22414 Added new method to get the list of existing stashes 2011-06-03 18:54:57 +02:00
David Mudrak
f75ad8d776 MDL-27626 moodle1_qtype_handler now provides helper methods for numerical_units and numerical_options 2011-06-03 18:54:56 +02:00
David Mudrak
1056c9b914 MDL-22414 Fixed moodle1_xml_handler::write_xml() attributes handling
The attributes did not work for nested elements because of the missing
slash.
2011-06-03 18:54:51 +02:00
David Mudrak
513e2215c6 MDL-27626 The test file with questions now contains numerical units in numerical qtype 2011-06-03 18:06:35 +02:00
David Mudrak
22b8486fe6 MDL-27626 moodle1_qtype_handler now provides a helper method for answers structure conversion 2011-06-03 18:06:27 +02:00
David Mudrak
1ff4b8dec0 MDL-27626 moodle1_qtype_handler::process_question() is not supposed to return anything
Returning the converted array has no benefit here and makes the things
more complicated. From now on, the method is supposed to write what it
needs directly into the opened file, without returning anything.
2011-06-03 18:06:27 +02:00
David Mudrak
e19d0c109c MDL-27626 The initial support for the question bank backups conversion
This patch introduces a framework for the question bank conversion. It
deals with the common question data (that are not qtype-specific) and
the way how to make sure that the qtype plugins have access to the paths
they are interested in.
2011-06-03 18:06:27 +02:00
David Mudrak
78d22af957 Fixed error/required_not_stashed_data when the backup does not contain course_files 2011-06-02 09:05:59 +02:00
David Mudrak
034b0e4a30 Fixed applying convert_path recipes on sub-paths of grouped elements
Grouped elements contain arrays with the sub-paths. This patch makes
sure that the sub-paths are pre-cooked recursively. However because the
recipes do not distinguish the full path to the element, only the
implicit recipe (making the tags lowecase) is applied. To avoid
potential data loss (for example dropfields recipe would delete all
fields from the whole grouped tree, not only the direct descendants of
the path where the recipe is declared), explicit recipes are forbidden
for grouped elements. The developer has to convert the $data manually as
needed.
2011-06-02 03:26:52 +02:00
David Mudrak
93264625f2 The source passed to the migrate_directory() may not exist
In case the source $rootpath passed to the migrate_directory() does not
exist, an empty array is returned by the method. Note that if the
directory exists and is empty, the directory itself is converter so
there would be a new record created. However, the restore process
ignores these records anyway, as the directory records are created
automatically by certain file api methods.
2011-05-29 00:38:23 +02:00
David Mudrak
214c492447 Converter file manager's methods take relative path within the backup instead of the absolute path 2011-05-29 00:18:19 +02:00
David Mudrak
66f79e50a3 Files conversion support improved
The new file manager class is introduced. Once its public properties are
set, one can use it to migrate either a single file or a whole
directory. The course_files conversion reworked so that it uses the new
manager now. The files.xml written at the very end of the conversion,
giving all handlers a chance to migrate the files they need.
2011-05-27 04:13:34 +02:00
David Mudrak
f6f7a7266c Merge branch 'master' into backup-convert
Conflicts:
	backup/util/xml/parser/processors/simplified_parser_processor.class.php
	backup/util/xml/parser/simpletest/testparser.php
2011-05-26 17:30:27 +02:00
David Mudrak
6cfa5a3220 Added support for the on_xxx_start() event handler for MOD and BLOCK sub-paths 2011-05-26 16:59:59 +02:00
David Mudrak
4ddf9ac6b5 Added base class for the activity module subplugins 2011-05-26 16:59:51 +02:00