104 Commits

Author SHA1 Message Date
Darko Miletic
75c95c8b02 MDL-30777: Properly implemented error message 2011-12-20 11:06:50 -03:00
Darko Miletic
584f92962d Updated text conversion to read and store safe xml strings. 2011-11-14 21:25:08 +01:00
Mark Nielsen
726a770949 MDL-29956: Common Cartridge should handle HTML content more natively (r17188, r17210:17265)
Also implemented support for LTI icon during import.
2011-11-14 21:25:08 +01:00
Mark Nielsen
42dffc6feb MDL-29956: Implement common cartridge export (r16882) 2011-11-14 21:25:08 +01:00
Tim Hunt
de529cd253 MDL-30021 qtype numerical better showunits default when coming from 1.9
This applies to:
1. Upgrade from 1.9,
2. Import of questions exported from 1.9, and
3. Restore of courses backed-up from 1.9.

It also applies to the calculated question type.
2011-11-03 11:27:41 +00:00
Jean-Michel Vedrine
9107daa0f5 MDL-29270 Fixed question bank backup converter (field rename) 2011-09-25 23:33:00 +02:00
Tom Lanyon
7aa06e6ded MDL-28701 Change all uses of $CFG->dataroot/temp to $CFG->tempdir 2011-09-10 10:35:39 +02:00
sam marshall
8c40662e22 MDL-27001 'Show description' feature part 1: infrastructure that allows modules to support feature
The 'Show description' feature is about optionally including module description on the course page. This change include the necessary infrastructure - new database field, new FEATURE constant, changes to forms to display it, new language strings for it, backup and restore, and old course conversion. (I found the places to change by searching for an existing field in course_modules).

Documentation for the field is included in install.xml and in modinfolib.
2011-09-06 11:03:00 +01:00
David Mudrak
3343677e0a MDL-28006 Fixed grades subpath handling
Registering the grades subpath even if we do not process the grades yet.
This is to prevent from incorrect considering the wrapper as an empty tag.
2011-06-30 15:17:03 +02:00
David Mudrak
af66e7fea3 MDL-28006 code cleanup - there is nothing to do for grade_settings 2011-06-29 09:08:25 +02:00
David Mudrak
ddefec8d14 MDL-28006 moodle1 converter supports outcomes 2011-06-29 08:55:43 +02:00
David Mudrak
d98100e407 MDL-28006 moodle1 converter supports grade letters 2011-06-29 01:06:59 +02:00
David Mudrak
cfab209904 MDL-28006 moodle1 converter supports grade categories and non-module grade items 2011-06-29 01:06:10 +02:00
David Mudrak
544e0d5972 MDL-28006 moodle1 converter supports activity module grade items 2011-06-29 00:11:05 +02:00
David Mudrak
acc9a7b9e2 MDL-28006 moodle1 converter provides new get_stash_or_default() method 2011-06-29 00:11:05 +02:00
Eloy Lafuente (stronk7)
28e23ea737 fix permissions 2011-06-16 19:06:07 +02:00
David Mudrak
b7119f4f3f MDL-22414 Exclude unsupported modules from the course contents 2011-06-10 09:01:41 +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
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
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