Commit Graph

126 Commits

Author SHA1 Message Date
Jean-Michel Vedrine c8fbd8b0c3 MDL-39283 GIFT and XML question export broken for unsupported qtypes
Do no write any data to the export for unsupported qtypes
2013-04-23 09:52:47 +02:00
Jean-Michel Vedrine 50a9a7d498 MDL-38880 Imported Cloze questions lose embedded images or other media 2013-04-11 16:29:34 +02:00
Jean-Michel Vedrine ddc03b10d5 MDL-37967 Improve XML question import format handling of duplicated files 2013-02-18 07:54:30 +01:00
Dan Poltawski d08da96c20 MDL-37313 question: fix trailing whitespace 2013-01-16 09:40:40 +08:00
Dan Poltawski 7a82b70970 Merge branch 'MDL-37313_24' of git://github.com/jmvedrine/moodle into MOODLE_24_STABLE 2013-01-16 09:39:54 +08:00
Jean-Michel Vedrine af8a122872 MDL-37313 Moodle XML import format should use draft file areas, not arrays 2013-01-11 09:37:42 +01:00
Jean-Michel Vedrine a7eec81ec6 MDL-28183 add num parts correct and clear wrong to multianswer 2012-12-21 05:18:02 +01:00
Tim Hunt 7e252acff1 MDL-36942 xml question import: don't add spaces.
They are not necessary anyway, there is a \n character at the end of
each line.

Thanks to Richard Lobb for fining the problem and how to fix it.
2012-11-30 15:59:11 +00:00
Jean-Michel Vedrine bedbfd6dfa MDL-32865 Backwards compatibility, deal with the old image tag 2012-11-17 16:38:03 +01:00
Jean-Michel Vedrine 7c86628de6 MDL-32865 CLOZE Questions imported from another course end up with broken image links 2012-11-17 16:38:02 +01:00
Tim Hunt cacb8fa08a MDL-34841 error importing questions with long names.
The problem was with the non-UTF-8-safe way that a question name
was being constructed from the question text.

I have done a proper fix with methods in the base class to
carefully construct a question name that is reasonable, and
which will fit in the database column. Then I have changed all
importers to use the new methods.

I also remembered not to break the lesson in the process.
2012-09-11 15:04:00 +01:00
Tim Hunt e231a3ffa2 MDL-27799 question bank: remove last traces of qtype constants.
Using consants to refer to plugin names is crazy. The whole point of
plugins is that you can install more, hence the list of constants will
never be complete.
2012-08-30 13:15:52 +01:00
Tim Hunt 4d18892676 MDL-32220 question import: files sometimes stored in the wrong context.
Sadly, this involves a small API change, but I don't believe anyone was
using the argument I had to remove (because we were sometimes passing a
wrong value, and there is not way to compute the right value at that
point in the code.)

Also sadly, the code to compute the context we are importing into is now
rather spaghetti-like, but it works.
2012-03-29 14:13:28 +01:00
Petr Skoda e2bb3c9275 MDL-32094 some more E_STRICT fixes 2012-03-18 20:40:20 +01:00
Sam Hemelryk b64a3e1ac1 MDL-30485 whitespace fix 2011-11-30 11:55:55 +13:00
Tim Hunt 3385a144b8 MDL-30485 XML import from 1.9 does not handle files in subfolders. 2011-11-28 17:26:17 +00:00
Eloy Lafuente (stronk7) 48e74d2c10 Merge branch 'MDL-29060' of git://github.com/timhunt/moodle 2011-11-23 11:47:51 +01:00
Tim Hunt 2ecbad416e MDL-30397 qformat_xml::format() should be public. 2011-11-22 07:21:04 +00:00
Tim Hunt 7e7fdf59c6 MDL-29060 q export: writefiles should be public write_files & belongs to XML format. 2011-11-20 11:49:41 +00:00
Aparup Banerjee 92f6c2eb7f Merge branch 'MDL-30021' of git://github.com/timhunt/moodle 2011-11-09 12:19:20 +08:00
Aparup Banerjee 097ba12ba0 Merge branch 'MDL-29058' of git://github.com/timhunt/moodle 2011-11-09 11:29:45 +08:00
Aparup Banerjee 98901d3ea9 Merge branch 'MDL-29739' of git://github.com/timhunt/moodle 2011-11-08 20:34:41 +08:00
Tim Hunt 4a84c94bec MDL-30135 question formats: trans_format/get_format should be public.
They need to be used by third-party qtype developers.
2011-11-07 11:31:27 +00: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
Tim Hunt 78fc17ebdf MDL-29058 question export: include files from hints & combined feedback. 2011-11-03 11:27:39 +00:00
Tim Hunt fe5f412104 MDL-29739 question import used a bad default for text formats.
The new logic is that the questiontext defaults to HTML if the format is
not specified, then all other fields default to the same format of the
question text.

However, good practice is that the XML file should specify the format
for each bit of text content.

This code is not 100% backwards-compatible, since some methods have new
arguments, however for question types that have not been updated, it
will just generate a PHP Warning, which is, I think, and OK way to let
qtype developers know that they need to update their question types.
2011-11-03 11:27:37 +00:00
Tim Hunt 77d0f5f07b MDL-29644 qtype multianswer, hints lost doing Moodle XML export.
This commit also includes a lot of useful tidying up of some of the unit
test helper code. I turned out that I could not use all the helper code
in my new tests, but despite that it will be useful in the future, so I
am committing it here.
2011-10-04 22:23:58 +01:00
Tim Hunt 474abf1221 MDL-29366 qtype_essay import/export as Moodle XML loses files from graderinfo 2011-09-14 19:01:18 +01:00
Tim Hunt 1b343d5241 MDL-28564 question type importing, improve Jamie's fix. 2011-08-27 08:16:47 +01:00
Tim Hunt 19f7bb5b7e MDL-28049 conditional include so xml question format can work for both lesson and 3rd party qtypes.
This is a regression caused by MDL-27956.
2011-06-27 13:59:57 +01:00
Rajesh Taneja ba15c346b1 MDL-27956 Lesson - Fixed strings and readquestions scope 2011-06-22 09:11:32 +08:00
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
Tim Hunt 1f1c60c6a7 MDL-27797 supplimental. Fix two minor issues found by Sam H during testing. 2011-06-15 15:38:46 +01:00
Tim Hunt 8a5d05eea8 MDL-27854 qformat_xml fix import/export of essay questions to include the new options. 2011-06-14 17:36:11 +01:00
Tim Hunt 79e25fb456 MDL-27797 fix all the codechecker issues in format_xml
After this change, I can still export my test course with one of each question type, and all the unit tests still pass.
2011-06-14 17:06:55 +01:00
Tim Hunt 67b8b40cfa MDL-27797 fix bugs with Moodle XML export. 2011-06-14 16:34:14 +01:00
Tim Hunt 9c197f4445 MDL-20636 Fix some more codechecker issues. 2011-05-14 22:53:25 +01:00
Tim Hunt c7df5006b9 MDL-20636 Add lots of missing public/protected/private. 2011-03-23 16:22:25 +00:00
Tim Hunt c73c98365b MDL-20636 Question import, support for files in hints.
Also fix some minor bugs and unit tests.
2011-03-23 14:27:22 +00:00
Tim Hunt 56b0df7eac MDL-20636 Kill Left over addslashes in the question engine code. #223 2011-03-11 13:45:38 +00:00
Tim Hunt d649fb0221 MDL-20636 Remove all references to global $QTYPES.
Except in the question types that have not yet been converted to the new question engine.
2011-02-24 15:29:07 +00:00
Tim Hunt 5e8a85aa64 MDL-20636 Massively reduce the number of references to quiz in the question code.
This mostly involves moving lang strings around, but I don't have time to do an AMOS script now.
2011-02-23 18:53:50 +00:00
Tim Hunt f7970e3ca7 MDL-20636 Eliminate integer and boolean in PHPdoc comments. should be int and bool. 2011-02-23 16:25:25 +00:00
Tim Hunt a17b297d60 MDL-20636 Add missing defined('MOODLE_INTERNAL') || die(); 2011-02-23 16:00:20 +00:00
Tim Hunt 7764183a4a MDL-20636 Fix @package names and PHPdoc layout. 2011-02-23 13:38:16 +00:00
Tim Hunt 0ff4bd0877 MDL-20636 Fix new stdClass -> stdClass(), and trailing whitespace. 2011-02-21 18:10:19 +00:00
Tim Hunt f9b0500f7f MDL-20636 Quiz editing now works, as does the random question type.
However, all this needs more testing.

Also, a bit of a purge of training whitespace and global .
2011-02-10 20:50:18 +00:00
Tim Hunt fe0412432f MDL-20636 And fix XML import unit tests too. 2011-01-18 16:06:05 +00:00
Tim Hunt 5f7cfba7fa MDL-20636 Question XML export unit tests now all pass. 2011-01-18 14:36:40 +00:00
Tim Hunt 49e2bba7cc MDL-20636 Merge import/export formats. XML is not finished (unit test failures). 2011-01-17 18:01:49 +00:00