127 Commits

Author SHA1 Message Date
Tim Hunt
3159bf92e0 MDL-31065 qtype shortanswer: refactor the unit tests to use a proper helper. 2012-01-20 17:27:55 +00:00
Petr Skoda
927010240f MDL-31006 some more PHP54 notices
PHP54 compatibility - PhpStorm IDE is the best tool for this kind of work!!
2012-01-18 01:17:25 +01:00
Dan Poltawski
a530d4a93b MDL-29091 quiz - switch to use moodle_url::out_as_local_url 2012-01-13 10:16:52 +00:00
Eloy Lafuente (stronk7)
63637e9dd8 MDL-30760 question engine: reduce summary max size
MySQL only accepts 65536 (aprox) bytes in default TEXT
columns. So we define the max allowed as 32000 to allow
99.9% of utf-8 contents to fit. If some day MDL-19603 is
implemented and all current TEXTs are moved (MySQL) to
the BIG counterparts, this restriction can be out (MDL-19603).
2011-12-23 01:16:25 +01:00
Sam Hemelryk
f67911b6ac Merge branch 'MDL-30760' of git://github.com/timhunt/moodle 2011-12-20 13:39:54 +13: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
Tim Hunt
ad73a2cb4e MDL-30734 question engine: sum_usage_marks_subquery edge-case.
When all qas in a useage are 'gaveup' state, it gives NULL, not 0.0, for the total.
2011-12-14 14:29:00 +00:00
Tim Hunt
94c0ec2159 MDL-30185 question engine reporting: add redundant where to query for perf.
Without this, MySQL fails to cope.
2011-11-15 11:19:15 +00:00
Tim Hunt
75a31c9039 MDL-29808 qbehaviours: update to use ->dependencies in version.php 2011-11-10 19:12:25 +00:00
Eloy Lafuente (stronk7)
10dd4995da Merge branch 'MDL-29474' of git://github.com/timhunt/moodle 2011-10-26 10:33:37 +02:00
Eloy Lafuente (stronk7)
35454bd55d Merge branch 'MDL-29815' of git://github.com/timhunt/moodle 2011-10-25 17:43:51 +02:00
Tim Hunt
deef04a44e MDL-29339 Manually cast objects to string before calling dmllib. 2011-10-24 11:08:10 +01:00
Tim Hunt
304f0d850f MDL-29815 question engine DB: bad group-by clause detected by Oracle.
Thanks to Yanfei Lu for finding this and suggesting the fix.
2011-10-20 11:14:14 +01:00
Tim Hunt
36ca62cab7 MDL-29474 display the dependancy information on the upgrade screen. 2011-10-20 11:13:33 +01:00
Henning Bostelmann
cc9fc649a1 MDL-28219 QE2 adaptive behaviour: fix scores and penalties 2011-10-12 23:27:10 +01:00
Eloy Lafuente (stronk7)
033d656617 MDL-29520 - mysql multitable delete, outer join some tables 2011-10-09 22:15:27 +02:00
Eloy Lafuente (stronk7)
cec6a15b99 Merge branch 'MDL-29644' of git://github.com/timhunt/moodle 2011-10-04 23:34:15 +02: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
f0bfd964ba MDL-29520 question engine: work-around bad MySQL delete performance.
This is a temporary fix, until the new API from MDL-29589 is available.

(amended to fix comments)
2011-10-04 12:03:41 +02:00
Tim Hunt
7042a252c5 MDL-29571 questions: improve class=accesshide screen-reader hints.
This changes the hint that comes before the question text. There are
unit tests to verify the new behaviour.

(amended to fix comments)
2011-10-04 11:50:56 +02:00
Tim Hunt
9d1658a07e MDL-29571 qtype description refactor unit test code a bit. 2011-10-04 11:50:12 +02:00
Tim Hunt
f123d67f60 MDL-29511 cannot review previous steps of a question attempt since MDL-28679. 2011-09-29 21:48:23 +01:00
Eloy Lafuente (stronk7)
bde5c82a20 Merge branch 'MDL-28686' of git://github.com/bostelm/moodle 2011-09-27 00:45:45 +02:00
Tim Hunt
d47d12d0d4 MDL-28679 question response history displays states incorrectly. 2011-09-16 16:05:12 +01:00
Sam Hemelryk
d609d96261 MDL-28599 textlib Separated collator to collatorlib with static methods, and added support for locale aware sorting of objects 2011-09-06 15:39:00 +12: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
25d9a6a664 MDL-28653 question output. Add a class to the main div based on question state.
This makes it possible themes do cool things. For example change more of the display depending on whether the answer was correct or not.
2011-08-09 11:31:37 +01:00
Tim Hunt
22c97c6446 MDL-28471 Further tweaks to the question flag code. 2011-07-26 17:43:55 +01:00
Wale Olujide
474ee9389a MDL-28471 make the question flag smaller, and give it a label. 2011-07-26 16:38:07 +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
Eloy Lafuente (stronk7)
4c15bde8f1 Merge branch 'MDL-27948' of git://github.com/timhunt/moodle 2011-06-23 01:14:19 +02:00
Tim Hunt
da72991636 MDL-27979 Should be an edit link for each question when previewing or reviewing a quiz. 2011-06-22 21:07:40 +01:00
Tim Hunt
35d5f1c28d MDL-27948 The question engine should use recordsets to load attempt data
This should be good for performance (memory usage). It also avoids having to construct a meaningless, unique, first column, which is a pain on MyQSL.
2011-06-22 18:53:15 +01:00
Eloy Lafuente (stronk7)
faf1f957ac Merge branch 'MDL-27490' of git://github.com/timhunt/moodle 2011-06-17 17:24:51 +02:00
Tim Hunt
fde4560dae MDL-27490 Implement a manage question behaviours admin page
While doing this, I found various bugs in the manages question types admin page, and so fixed them, and updated the code
there to use $OUTPUT and html_writer.

AMOS BEGIN
 MOV [cannotdeletemissingqtype,admin],[cannotdeletemissingqtype,question]
 MOV [cannotdeleteqtypeinuse,admin],[cannotdeleteqtypeinuse,question]
 MOV [cannotdeleteqtypeneeded,admin],[cannotdeleteqtypeneeded,question]
 MOV [deleteqtypeareyousure,admin],[deleteqtypeareyousure,question]
 MOV [deleteqtypeareyousuremessage,admin],[deleteqtypeareyousuremessage,question]
 MOV [deletingqtype,admin],[deletingqtype,question]
 MOV [numquestions,admin],[numquestions,question]
 MOV [numquestionsandhidden,admin],[numquestionsandhidden,question]
 MOV [qtypedeletefiles,admin],[qtypedeletefiles,question]
 MOV [uninstallqtype,admin],[uninstallqtype,question]
AMOS END
2011-06-17 16:21:32 +01:00
Eloy Lafuente (stronk7)
5df6b3c87e Merge branch 'MDL-27877' of git://github.com/timhunt/moodle 2011-06-17 15:32:10 +02:00
Tim Hunt
5f79a9bcb6 MDL-27898 fix question/engine/simpletest/testdatalib.php unit tests.
Now that MDL-27897 is fixed.
2011-06-17 11:28:05 +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
3b049b7626 MDL-27747 question engine stupid typo in DB query broke regrading. #472 2011-06-07 16:22:10 +01:00
Tim Hunt
97cdc1de72 MDL-27747 quiz summary, add a CSS class to the table rows based on question state.
The standard themes do not use this for anything, but it makes it easier for themers to do cool stuff.
Also improve the API for getting the question state class.
2011-06-07 15:11:04 +01:00
Tim Hunt
af2f98ee39 MDL-27747 Imporove API for getting the standard fraction choices.
This includes moving the None option to the top, which is slightly better for usability.
2011-06-07 13:53:29 +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