102 Commits

Author SHA1 Message Date
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
Eloy Lafuente (stronk7)
14941785d7 Merge branch 'MDL-25492' of git://github.com/jmvedrine/moodle 2012-08-28 20:02:02 +02:00
Jean-Michel Vedrine
7ace84e069 MDL-25492 Blackboard V6+ question import is broken. 2012-08-24 13:27:45 +02:00
Ankit Agarwal
d197ea4300 MDL-34549 libraries: Replace get_context_instance_by_id() by context::instance_by_id() 2012-08-24 11:30:10 +08:00
Jean-Michel Vedrine
17ab0e74f9 MDL-34738 qformat blackboard: blackboard format is broken 2012-08-18 10:36:02 +02:00
Rajesh Taneja
071e68f93e MDL-32945 libraries: Replaced deprecated PARAM_MULTILANG with PARAM_TEXT 2012-07-19 15:44:40 +08:00
Tim Hunt
77c1f1605f MDL-33780 question import: strip UTF8 BOM
Previously, if there was a byte-order mark at the start of the file, the
import would just break, which was silly. Much better to just strip it
off.
2012-06-26 09:59:26 +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
Eloy Lafuente (stronk7)
a1ef8c6d3c MDL-28364 whitespace fixes 2012-03-07 04:00:39 +01:00
Jonathon Fowler
7da7bfa17d MDL-28364 handle question formats that support multiple file types 2012-02-28 09:39:06 +10: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
Tim Hunt
08f5328659 MDL-28639 question import should set timemodified and modified by.
Thanks to Jean-Michel Vedrine for the fix.
2011-08-15 14:55:50 +01:00
Tim Hunt
45bdcf1134 MDL-28438 Aiken question import broken since MDL-24594. 2011-08-15 14:44:57 +01:00
Tim Hunt
55190d7e2c MDL-20538 get rid of badly name-spaced constants from lib/questionlib.php.
Unfortunately, they are used all over the import/export code, so I cannot eliminate them completely. However, I was able to move them out of the core library.
2011-06-09 19:27:36 +01:00
Tim Hunt
e198992b20 MDL-27747 Fix a lot of coding style issues in question/format.php 2011-06-07 14:04:24 +01:00
Tim Hunt
92111e8d2c MDL-27747 questions remove all references to the recently deprecated get_grade_options() 2011-06-07 14:00:07 +01:00
Tim Hunt
e0736817f0 MDL-20636 fix some more coding style issues in the question code. 2011-05-20 18:50:41 +01:00
Tim Hunt
9c197f4445 MDL-20636 Fix some more codechecker issues. 2011-05-14 22:53:25 +01:00
Tim Hunt
7348402f33 MDL-20636 A few more publics. 2011-03-23 16:40:19 +00: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
22cebed503 MDL-20636 Review and fix the format parameter to all calls to format_text. 2011-02-24 20:18:16 +00:00
Tim Hunt
2daffca554 MDL-20636 Fix 30 TODOs 2011-02-24 17:47:51 +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
d3603157bf MDL-20636 Add @package and GPL boiler-plate to files in /question. 2011-02-22 19:59:12 +00:00
Tim Hunt
0ff4bd0877 MDL-20636 Fix new stdClass -> stdClass(), and trailing whitespace. 2011-02-21 18:10:19 +00:00
Tim Hunt
f7c1dfaf79 MDL-20636 Finish off converting question import. 2011-02-21 17:29:18 +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
Tim Hunt
06f1bd03be question XML import/export MDL-18916 Fix import of questions with images exported from Moodle 1.9.
Thanks again to Patrick Pollet
2010-11-19 14:24:18 +00:00
Tim Hunt
4f2900771d question XML import/export MDL-18916 should include question tags. 2010-11-19 12:33:48 +00:00
Tim Hunt
b80d424c50 question export MDL-25324 Better file names for question exports. 2010-11-19 11:02:28 +00:00
Tim Hunt
9dd460390c question import MDL-25200 was ignoring the category specified in the file. 2010-11-15 15:27:24 +00:00
Tim Hunt
13bb604ed5 question export MDL-25088 this is the first part. I think question export is now working for all types.
Import to follow soon.
2010-11-12 12:06:48 +00:00
Tim Hunt
4673212416 xml import/export MDL-25103 was not working due to out-of-memory errors when calling xmltidy, which broke XML wellformedness.
The solution is to not tidy the XML. The XML generated is already quite well laid out, and if we want it better, we should fix that, rather than trying to load the whole file into memory to reformat it.

Also, while investigating this, I found that we were not handling the mime-type of the exported file very elegantly, so I added a new mime_type method (defaults to getting the mime type of the file extension).
2010-11-08 15:51:10 +00:00
Dongsheng Cai
cde2709a88 MDL-15573, question export rewrite 2010-11-05 06:34:00 +00:00
Petr Skoda
7f38934243 MDL-24321 switching to stdClass in /question/ - I am sure Tim will be very happy 2010-09-21 08:20:46 +00:00
Petr Skoda
07ea95609a fixed time limit 2010-09-18 11:41:16 +00:00
Petr Skoda
aab03169d7 MDL-24058 fixing docs 2010-09-02 12:41:58 +00:00
Petr Skoda
bec167f34a MDL-16094 preventing execution of question code that is trying to access dataroot files - we must use new api instead 2010-08-29 10:00:18 +00:00
Dongsheng Cai
fe6ce23489 MDL-16094 File storage conversion Quiz and Questions 2010-08-10 09:56:48 +00:00
Tim Hunt
728d60a1f6 question import/export: MDL-22100 ' / etc. in category names confuse the import/export. 2010-07-02 13:36:49 +00:00
Petr Skoda
aeb15530b8 MDL-20700 coding style cleanup - cvs keywords removed, closign php tag removed, trailing whitespace cleanup 2009-11-04 11:57:52 +00:00
tjhunt
88bc20c30f question types: MDL-20157 export_to_xml and import_from_xml functions for question types using extra_question_fields.
Thanks to Oleg Sychev for the implementation.
2009-09-30 13:38:36 +00:00
nicolasconnault
fef8f84e4b MDL-19822 Upgraded calls to helpbutton, print_simple_box* and notify 2009-08-18 05:19:00 +00:00
nicolasconnault
6dbcaceef1 MDL-19418 Replaced ereg* by preg* 2009-06-22 01:22:37 +00:00
skodak
bb4b6010f3 MDL-18293 removed obsoleted checking of return values from insert and update_record + unused strings cleanup 2009-06-13 17:17:10 +00:00