Commit Graph

43 Commits

Author SHA1 Message Date
Russell Smith
1fcf0ca8a5 MDL-35628 performance: Remove dirname() where possible.
dirname() is a slow function compared with __DIR__ and using
'/../'.  Moodle has a large number of legacy files that are included
each time a page loads and is not able to use an autoloader as it is
functional code.  This allows those required includes to perform as
best as possible in this situation.
2016-06-10 08:06:49 +10:00
Ankit Agarwal
c917b53a8d MDL-50269 deprecations: Properly deprecate notify() 2015-12-01 15:29:33 +08:00
Eloy Lafuente (stronk7)
ca09f076f8 MDL-50182 core: add 3.0 environmental requirements
Only change from 2.9 is the modification of the slasharguments
admin setting string to recommend always to keep the setting enabled
and fix the problem in the server, warning about the drawbacks
of disabling it.

Also, there is a little phpdoc note added to one custom check
to have clearly specified when we can get rid of it.
2015-10-13 00:33:41 +02:00
Tim Hunt
ccba5b8805 MDL-43749 normalise quiz database structure.
The sequence of questions that made up a quiz used to be stored as a
comma-separated list in quiz.questions. Now the same information is
stored in the rows in the quiz_slots table. This is not just 'better' in
a database design sense, but it allows for the future changes we will
need as we enhance the quiz in the MDL-40987 epic.

Having changed the database structure, all the rest of the code needs to
be changed to account for it, and that is done here.

Note that there are not many unit tests for the changed bit. That is
because as part of MDL-40987 we will be changing the code further, and
we will add unit tests then.
2014-03-02 10:00:40 +01:00
Tim Hunt
30de48d285 MDL-44118 drop old quiz/question attempt data.
This data should all have been upgraded when moving to Moodle 2.1. It
was only kept as a back-up, and now, after 3 years have past, we can
clean it up.
2014-02-18 11:55:26 +00:00
Tim Hunt
4e8a07d28b MDL-44118 remove the qeupgradehelper tool
and associated code that was only used by it.
2014-02-18 11:55:21 +00:00
Tim Hunt
e4c20157c0 MDL-44118 new environment check are all quiz attempts upgraded.
In Moodle 2.1, there was a major DB upgrade relating to questions, and
it was possible to delay some of that upgrade. Now, those DB tables are
changing again, and the time has come to insist that all the updata has
been upgraded (or deleted).
2014-02-18 11:55:17 +00:00
Tim Hunt
029870ee95 MDL-44053 question restore from 2.0: fix regression from MDL-43670 2014-02-09 17:49:03 +00: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
4e3d829350 MDL-42105 questions: let attempts have a max fraction > 1.
This parallels question_attempt->minfraction, which allows the
fractional mark to go below zere.

This is needed to allow the certainty-base marking behaviours to work
better.
2013-10-04 17:52:19 +01:00
Petr Škoda
2f1e464a88 MDL-40438 migrate all collatorlib:: and textlib:: uses 2013-08-06 21:04:35 +02:00
Tim Hunt
6cdef715df MDL-32375 question unit tests: fix breakage from phpunit coversion.
Three things:

1. Fixes to select expectation.

2. Fixes to match walkthrough tests (No idea how these managed to pass
under Simpletest!)

3. Fix expected values for multianswer upgrade tests.
2012-05-11 14:59:58 +01:00
Petr Skoda
4ca04fb58b MDL-32569 remove remaining references to simpletest and improve events test 2012-04-21 17:08:30 +02:00
Petr Skoda
2338458ac5 MDL-32569 drop all migrated question simpletests 2012-04-21 16:43:34 +02:00
Petr Skoda
a4d53e4b26 MDL-32323 make base test case classes abstract to prevent empty testcase warnings, fix property access 2012-04-10 18:51:34 +02:00
Petr Skoda
603bd00112 MDL-32323 convert question tests
1/ type/match/tests/walkthrough_test.php - tests are failing randomly, looks like some weird randomisation is going on there - see TODOs

2/ type/multianswer/tests/upgradelibnewqe_test.php contains invalid expected value - see TODO
2012-04-10 15:27:11 +02:00
Davo Smith
1892a35625 MDL-32213 Question upgrade now correctly handles non-core manually-graded question types 2012-03-27 13:44:07 +01:00
Michael Aherne
2af7d0d8d0 MDL-31495 Performance improvement in question engine upgrade SQL 2012-02-10 15:24:43 +00:00
Tim Hunt
6401b3c5bb MDL-31392 qeupgradehelper partial upgrade support broken since 2.2 2012-01-26 16:31:44 +00:00
Tim Hunt
c83ed025ef MDL-30760 question engine: question summary can be longer than 64k!
1. So we will truncate the question summary to 65000 chars if necessary.

2. Also, fix one minor error in mutlianswer save_question_options.

question_bank::MAX_SUMMARY_LENGTH is not the most logical class to add
the constant to, but it needs to be accessible during upgrade, so I was
lazy and put it there.
2011-12-16 15:56:23 +00:00
Henning Bostelmann
987e0e915c MDL-28686 QE2 upgrade: recognize manually graded, deleted questions 2011-08-26 14:38:50 +01:00
Eloy Lafuente (stronk7)
d12d4d59a6 MDL-28684 QE2 upgrade: whitespace fix 2011-08-23 22:52:16 +02:00
Henning Bostelmann
fbf51a480a MDL-28684 QE2 upgrade: recognize empty answer in multichoice questions 2011-08-19 10:33:35 +01:00
Tim Hunt
aa5257ce7e MDL-28103 one more problem. 2011-07-01 21:17:06 +01:00
Tim Hunt
1645ad22d8 MDL-28103 code to deal with missing question_attempts was buggy. 2011-07-01 21:07:49 +01:00
Tim Hunt
dfcbecd487 MDL-28103 when handling questions that have been deleted from the question bank, find the right updater class. 2011-07-01 17:13:47 +01:00
Tim Hunt
ceb4d2ed0b MDL-28128 finish the fix for MDL-28035.
There was one place where I had only fixed the backup code to work-around bad data from Moodle 2.0. I needed to make the equivalent change in the upgrade code.

The bad data is that the seq_number fields can be wrong (not unique). Se already have data ordered by (seq_number, id) and the array keys of the array we are building are not used for anything, so this fix deals with the problem.
2011-06-30 16:00:15 +01:00
Tim Hunt
69384c1939 MDL-28127 incorrect lang string placeholder in question engine upgrade. 2011-06-30 15:20:42 +01:00
Tim Hunt
0366ef262a MDL-28035 problems with upgrade/restore of ataptive quizzes from 2.0
There were two main problems:

1. The unit tests for upgrading adaptive quiz attempts had slighly the
wrong $expectedqa, and so matching that the upgrade was doing the wrong
thing in certain situations. The main issue was that it was setting
-_try = 1 on the first step, which broke the penalty calculation when
the quiz was regraded. There were also some other subtleties with
incrementing -_try that were not right before.

2. It was possible in 2.0 and earlier for two question_states to get the
same seq_number, and restoring 2.0 backups was rashly assuming that that
was unique.
2011-06-27 17:10:02 +01:00
Tim Hunt
08c458d10f MDL-27877 question engine progress bars not working. 2011-06-16 18:55:10 +01:00
Tim Hunt
18ab06bac5 MDL-27639 restore of attempt data from 2.0 - first attempt.
This is now at the stage where it mostly appears to work, at lease on
one backup file.
2011-06-14 12:11:19 +01:00
Tim Hunt
4c5743343f MDL-20636 make qe upgrade tests independent of html2text details.
Based on Eloy's change, but refactored to be slightly nicer.
2011-06-06 17:05:54 +01:00
Tim Hunt
1027301215 MDL-20636 Implement the ability to only upgrade some of the quiz attempts during the main upgrade. 2011-05-27 19:44:53 +01:00
Tim Hunt
1da821bbde MDL-27649 support question variants as a first-class concept in the question engine. 2011-05-26 21:23:56 +01:00
Tim Hunt
667cdde361 MDL-20636 Implement upgrade of calculated* question type attempts. 2011-05-20 18:22:35 +01:00
Tim Hunt
ffe4d23abd MDL-20636 make question upgrade more robust for incompatible question types. 2011-05-19 20:27:09 +01:00
Tim Hunt
9c197f4445 MDL-20636 Fix some more codechecker issues. 2011-05-14 22:53:25 +01:00
Tim Hunt
bee82469d4 MDL-27408 Database upgrade for adaptive mode.
Could really do with more unit tests.
2011-05-13 16:55:14 +01:00
Tim Hunt
39759ac468 MDL-27408 fix a few minor bugs with the upgrade from 2.0.
More testing, and adaptive mode, still to come.
2011-05-12 21:03:24 +01:00
Tim Hunt
bb28e3bc5e MDL-27408 Moved the question engine install/upgrade code into the proper place.
I have tested upgrade from the previous development version, and a clean install. Upgrade from 2.0 still needs more work.
2011-05-12 18:58:50 +01:00
Tim Hunt
38d42fc476 MDL-27408 question engine upgrade, change to update the quiz settings in config_plugins.
Also start creating the unit tests for the upgrade.
2011-05-11 15:32:29 +01:00
Tim Hunt
cd300cf34c MDL-20636 Initial pass at converting this code to Moodle 2.0 style. 2011-05-11 15:32:26 +01:00
Tim Hunt
0859ff6503 MDL-20636 Re-organise all the old upgrade code, before I start work on it for real. 2011-05-11 15:32:14 +01:00