Commit Graph

127 Commits

Author SHA1 Message Date
Tim Hunt 0b18d0c960 MDL-62820 question import: properly escape output 2018-07-04 15:40:50 +08:00
Andrew Nicols cc98914e85 MDL-61407 question: Allow formatters to ignore caps 2018-05-02 19:13:30 +08:00
Simey Lameze 13e2b19838 MDL-61364 core: remove param from question_has_capability_on calls 2018-03-28 08:53:41 +08:00
Eloy Lafuente (stronk7) f6bafa922c MDL-61410 question: Check we have tags to set to avoid notices 2018-03-21 14:55:39 +01:00
Simey Lameze bbd655b4a8 MDL-61410 question: merge course and question tags 2018-03-19 11:45:55 +08:00
Simey Lameze 13596866e7 MDL-61410 question: support course tags on import 2018-03-19 11:45:55 +08:00
Shamim Rezaie f86f8c85c1 MDL-61132 Questions: Adapt logic on export/import
Modified import/export to adapt with "Top" categories.
2018-02-05 11:58:58 +11:00
Marina Glancy d47af580bd MDL-55826 question: fix PHP7.1 strict warnings 2016-09-02 10:52:02 +08:00
Marina Glancy 3e9437f412 MDL-54715 core_question: fixed bug when importing questions with tags
Thanks to WangYang for original patch
2016-05-24 14:37:53 +08:00
Marina Glancy b355a1c97c MDL-50851 core_question: use new tag API 2016-01-10 15:25:47 +08:00
Eric Merrill cef7621e30 MDL-50806 questions: Allow more memory when doing a question import 2015-07-09 12:27:32 -04:00
Jean-Michel Vedrine 762ee1393b MDL-48342 Question: qformat_default::readquestion is broken 2014-11-28 15:47:39 +01:00
Tim Hunt 57944b7a54 MDL-46195 fix error handling. 2014-09-08 22:27:36 +01:00
Mohamed Alsharaf 6d0361ff25 MDL-46791 question: fixed incorrect 5th param for tag_set() 2014-08-13 13:57:12 +12:00
Damyon Wiese 539a25ff03 MDL-46148 questions: Added missing allow_commit for transaction 2014-07-10 11:35:47 +08:00
Tim Hunt 66de66fe6a MDL-46148 qtype_calculated: fix validation when importing.
In order to do this in a sane way, I cleaned up a lot of old mess,
inclduing:

1. Previously, qtype_calcuated used ->answeres when importing, and
->answer when saving the form. This was crazy, so I fixed it, and
stripped out the code that made the alternative variable name work.

2. Similarly, it could handle ->answer being either an array, such as
you would get form the HTML editor, or a simple string, which is what
you get form the form. I simplified that too.

3. Finally, I made import use a transaction around saving each
question, so we don't get half questions in the database when an error
occurs.
2014-07-09 13:35:09 +01:00
Tim Hunt f4fe3968a2 MDL-46212 questions: add {} whenver vars are put into "" strings
Having had one subtle bug cased be this, I decided to do a search and
fix all of these.
2014-07-03 14:02:39 +01:00
Mark Nelson cc033d48b5 MDL-44316 core_tag: changed the API to accept a contextid and component 2014-03-22 13:50:08 -07:00
Jean-Michel Vedrine 624ff5ba57 MDL-42033 Files in subdirs not exported correctly by question XML format 2014-02-16 19:37:09 +01:00
sam marshall 3ef7279f26 MDL-42084 Core: Change set_time_limit to core_php_time_limit::raise everywhere
Exceptions (places where set_time_limit is still left) are:

Third-party libraries:
  ADODB
  PHPMailer

Moodle core:
  PHPUnit - not relevant (CLI mode)
2013-11-06 16:40:01 +00:00
Tim Hunt e2b388c1a4 MDL-39507 questions: fix pluginfile URLs before format_text.
This commit build's on Jean-Michel's work, tidying up a few lose ends.
2013-08-12 10:32:02 +01:00
Jean-Michel Vedrine 6c23d0d403 MDL-39507 questions: fix pluginfile URLs before format_text. 2013-08-08 10:05:48 +01:00
Petr Škoda 2f1e464a88 MDL-40438 migrate all collatorlib:: and textlib:: uses 2013-08-06 21:04:35 +02:00
Tim Hunt b5d09003bb MDL-37599 question import: add missing string.
AMOS BEGIN
 MOV [matcherror,question],[invalidgrade,question]
AMOS END
2013-01-21 12:07:47 +00:00
Jean-Michel Vedrine 7980a381cc MDL-36243 question->questiontext and question->generalfeedback should always be strings 2012-12-08 14:09:26 +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
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