146 Commits

Author SHA1 Message Date
danghieu1407
a5af041c40 MDL-78866 question: question_created trigger pre-saving extra fields 2023-08-01 16:01:31 +07:00
Meirza
e4b24bdd79 MDL-77299 question: Added class properties that are not declared.
In PHP 8.2 and later, setting a value to an undeclared class property is
deprecated and emits a deprecation notice.
So we need to add missing class properties that still need to be declared.

Co-authored-by: Tim Hunt <t.j.Hunt@open.ac.uk>
2023-03-01 10:09:09 +07:00
Sujith Haridasan
73d604369d MDL-71062 core: Step 1 deprecation of print_error function 2022-07-13 08:20:54 +05:30
Daniel Ziegenberg
f942a5cedd
MDL-69078 questions: check for UTF-8 encoding of the import file
Signed-off-by: Daniel Ziegenberg <daniel@ziegenberg.at>
2022-03-17 20:53:50 +01:00
Safat Shahin
bf55e5a481 MDL-71696 core_question: class autoload changes
This commit implements some class autoloading
fixes to align with core question structure.
2022-02-03 22:22:50 +11:00
Safat Shahin
3008edd366 MDL-71696 core_question: Implement question status change
This commit implements the status change pop up for a question
in the base view. This feature update will allow the change of
status of a question without creating a new version.
This commit also implements the status as a char rather than
an int value.
2022-02-03 22:22:50 +11:00
Safat Shahin
111951d861 MDL-71696 mod_quiz: quiz updates and behat coverage
The versioning changes will require some major changes
in the backup and restore of question bank and its
elements. This change introduces those changes to make
it compatible with the new world of versioning in question
bank. This commit also removes quiz_slots fields and
quiz_slot_tags table.
This commit will also introduce the versioning db
structure and some major changes to the quiz
and quiz attempts for the question, random
question and the view.
This commit implements the behat changes for versioning
in core question and associated locations.
2022-02-03 22:22:44 +11:00
Guillermo Gomez
c6cfca2a08 MDL-71696 core_question: Changes for versioning
This commit adds the changes in questiontype base
to work with new question tables and the new structure in the
databse. Also needed for versioning.
This implementation will also introduct the question status
which allows a question to be in draft and ready status.
I also introduces changes to the base view where it shows
the latest version of the questions. The view of versions
for a question is not implemented in this commit.
This implementation will also introduce changes in the core
qtype plugins to support versioning and the changed
db schema.
2022-02-03 22:22:44 +11:00
Guillermo Gomez
fb10b36c04 MDL-71585 qbank_managecategories: Add managecategories to core
This implementation will introduce a qbank plugin "managecategories"
which will add the question categories feature in the question bank view
by replacing the core classes. Having this plugin will give users
the flexibility of enabling or disabling the category tab.
2021-09-03 09:41:18 +10:00
Guillermo Gomez
06f192aec9 MDL-71573 qbank_exportquestion: Add plugin to core
This implementation will introduce a qbank plugin "exporquestions"
which will add the export feature in the question bank view
by replacing the core classes. Having this plugin will give users
the flexibility of enabling or disabling the export questions tab.

Co-Authored-By: Guillermo Gomez Arias <guillermogomez@catalyst-au.net>
2021-08-23 12:06:20 +10:00
Tim Hunt
e247068d72 MDL-66801 questions: XML import/export should include category idnumbers 2019-09-30 18:59:23 +01:00
Tim Hunt
b65db96d8c MDL-33884 question export: raise memory limit
Question exports can be quite big, just like imports can. Therefore, we
should raise memory limits in the same way.

(Of course, eventually we should change the API, so that it writes one
questoin at a time, rather than building the whole export file contents
in RAM first, but that would be a much bigger change, and we need a
quick fix now.)
2019-07-31 16:18:16 +01:00
VinhLe
4ca60a5660 MDL-36088 questions: Add new events 2019-04-29 11:16:19 +07:00
Jean-Michel Vedrine
5dd1cf33ab MDL-21904 qformat_aiken: add export feature. 2019-03-19 08:01:56 +01:00
Tim Hunt
3a8cde29a4 MDL-63827 qformat_gift: fix notice when importing categories 2018-10-31 15:14:51 +00:00
Tim Hunt
2d696f8f2b MDL-63752 question import: duplicate key error when idnumbers blank
And extra checks to head off possible idnumber='' issues in two other places.
2018-10-24 11:38:31 +01:00
John Beedell
6189fda47f MDL-62708 question: Add idnumbers to question and question category 2018-09-21 12:26:24 +01:00
John Beedell
1dab8faafd MDL-23545 question: XML import/export add category description 2018-09-14 16:54:25 +01:00
John Beedell
d0a60444a1 MDL-63165 Question: xml import of question categories 2018-08-24 15:20:18 +01:00
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