77 Commits

Author SHA1 Message Date
Tim Hunt
0a606a2be2 MDL-38538 question auto-save back end.
1. Autosave works in some ways just like a normal save. We ultimately
call $behaviour->process_save() to do the work, and create a new step to
hold the data.

2. However, we come in through a completely different route through the
API, starting with separate auto-save methods. This keeps the auto-save
changes mostly separate, and so reduced the chance of breaking existing
working code.

3. When the time comes to store the auto-save step in the database, we
save it using a negative sequence number.

This is a clever trick that not only distinguises these steps, but also
avoids unique key errors when an auto-save and a real action happen
simultaneously. (There are unit tests for these tricky edge cases.)

4. When we load the data back from the database, most of the time the
auto-save steps are loaded back as if they were a real save, and so the
auto-saved data is used when the question is then rendered.

5. However, before we process another action, we remove the auto-saved
step, so it does not appear in the final history.
2013-03-28 16:51:59 +00:00
Eloy Lafuente (stronk7)
6026f23559 MDL-38311 Add missing comment format. 2013-03-06 02:02:45 +01:00
Eloy Lafuente (stronk7)
9f4da038c8 Merge branch 'MDL-38311' of git://github.com/timhunt/moodle 2013-03-06 01:22:32 +01:00
Tim Hunt
53b8e25626 MDL-38311 questions: manual grading API should accept commentformat
Comment format (FORMAT_...) was correctly being processed when the
manual grading happened as the result of a form submission. It was only
when done using the question_usage or question_attempt API method that
there was no way to specify the format. (Although I think the only place
this API as used was in the unit tests.)

Note that question_attempt::manual_grade API had to change, but I don't
think that is a real API change. Calling code should be using
question_usage::question_attempt, which is backwards compatible.

Note that now, if you don't pass format, then no error is generated, but
a developer debugging message is generated.
2013-03-05 11:51:47 +00:00
Tim Hunt
8407a5498b MDL-38280 manual graded behaviour: unit test for when not answered.
If the student does not submit an answer, the questoin goes to state
gaveup, rather than requiresgrading.
2013-03-01 17:04:04 +00:00
Tim Hunt
03cefcc91b MDL-37506 question code: incorrect preg_quote uses.
For preg_quote to work reliably, you must pass the delimiter you are
using for your regular expression. In many places we were failing to do
that.
2013-01-18 11:18:54 +00:00
Dan Poltawski
054124a3ed MDL-36887 quiz: reorder upgrade.txt's 2012-11-30 11:41:01 +08:00
Eloy Lafuente (stronk7)
663dbbc2e6 MDL-36933 Bump everything to 2012112900
(versions, requires and dependencies)
2012-11-30 03:30:09 +01:00
Frederic Massart
eec4107bdd MDL-36422 question: Fixed malformed HTML in manual marking 2012-11-08 10:20:22 +08:00
Tim Hunt
15dd772736 MDL-34399 questions cleanup: straighten out strange links to question objects. 2012-10-26 11:58:14 +08:00
Frederic Massart
c3cdf1e4cb MDL-34570 Accessibility: Adding labels on text inputs and selects to questions 2012-09-28 11:40:40 +08:00
Rossiani Wijaya
83690170be MDL-34570 accessibility compliance for question: edit string label 2012-09-28 11:40:40 +08:00
Tim Hunt
2c76c89422 MDL-35419 question manual grading: valdiation must handle 0,5
Yet another , as decimal separator issue!

To fix this nicely, I refactored some code into question_utils.
2012-09-13 16:33:15 +01:00
Dan Poltawski
5082d87c03 Merge branch 'wip-mdl-32940' of git://github.com/rajeshtaneja/moodle 2012-07-24 13:39:59 +08:00
Rajesh Taneja
61cca0b7fc MDL-32940 libraries: Replaced deprecated PARAM_NUMBER with PARAM_FLOAT 2012-07-23 17:21:05 +08:00
Tim Hunt
a3e6ad77d2 MDL-34066 adaptive behaviour: refactor logic out of renderer.
These changes move the logic to the behaviour class, which is how things
should be.

It also makes it easier to re-use the code that displays the messages
like "Marks for this submission: 1.00/1.00. Accounting for previous
tries, this gives 0.33/1.00." in other places.

To try to make it clearer what is going on, I introduced a new class
qbehaviour_adaptive_mark_details to hold and document the data that the
behaviour needs to return, and the renderer can base its display on.

As far as my testing can tell (and there are new unit tests), this
commit does not change the existing behaviour.

This commit also replaces all the string concatenation that is going on,
which should help translators. At the moment, a few of the old strings
are still in the language file, and are used in the unit tests to verify
that the behaviour has not changed.

Thanks to Oleg Sychev for making a helpful suggestion about the API.
2012-07-19 12:50:17 +01:00
Eloy Lafuente (stronk7)
c5e783e512 MDL-33794 version.php: Bump all versions, requires and dependencies to 2012061700 2012-06-18 02:37:00 +02:00
Tim Hunt
ee326d5e7d MDL-33548 quiz manual grading: check the grade is in range.
To do this nicely, I refactored some code out of the quiz manual grading
report.
2012-06-06 20:21:33 +01:00
Petr Skoda
2338458ac5 MDL-32569 drop all migrated question simpletests 2012-04-21 16:43:34 +02:00
Sam Hemelryk
3211569a6a Revert "MDL-30843 and MDL-30842 - accessibility compliance: Add <label> for form input text and select tag"
This reverts commit f9f281b8fee75c2416d71bae7583fd026b9ccabb.
2012-04-11 17:18:58 +12:00
Dan Poltawski
7a1ed64587 Merge branch 'w15_MDL-32323_m23_phpunit3' of git://github.com/skodak/moodle 2012-04-11 09:32:58 +08: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
Sam Hemelryk
5bfeb5ffd3 Merge branch 'MDL-30843_b' of git://github.com/rwijaya/moodle 2012-04-10 12:34:37 +12:00
Rossiani Wijaya
f9f281b8fe MDL-30843 and MDL-30842 - accessibility compliance: Add <label> for form input text and select tag 2012-03-30 16:26:58 +08:00
Petr Skoda
caee6e6c26 MDL-32251 E_STRICT fixes part 3 2012-03-29 15:24:30 +02:00
Petr Skoda
072db71c90 MDL-32094 fix question related E_STRICT problems 2012-03-18 18:33:54 +01:00
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
Eloy Lafuente (stronk7)
30c99be2f0 Merge branch 'MDL-30031' of git://github.com/bostelm/moodle 2012-01-09 02:14:20 +01:00
Tim Hunt
c2f5e2ab81 MDL-30635 enable standard cron for all question and quiz plugin types.
* Support for old non-standard cron for quiz reports dropped. (Standard
cron support was added in 2.2

* Cron support added for qbehaviour, qformat and quizacces plugins.

* qtypes were already supported in the standard way.
2012-01-06 18:42:35 +00:00
Henning Bostelmann
096c30165b MDL-30031 Adaptive question behaviour: ignore invalid answers without penalty 2011-12-28 17:17:52 +00:00
Henning Bostelmann
4c0b36283a MDL-29772 Adaptive question behaviour: improve penalty information
also fixes MDL-29780: suppress penalty information if question penalty is 0
2011-12-06 10:46:50 +00:00
Tim Hunt
3d17cd3f1c MDL-30300 qbehaviours: convert to the new is_compatible_question API. 2011-11-16 11:11:10 +00:00
Tim Hunt
15d660a8fd MDL-30300 question behaviours: improve q compatibility API. 2011-11-16 10:52:19 +00:00
Tim Hunt
75a31c9039 MDL-29808 qbehaviours: update to use ->dependencies in version.php 2011-11-10 19:12:25 +00:00
Tim Hunt
78f8261f6e MDL-29879 qbehaviour missing. Fix bad lang string. 2011-11-01 10:37:48 +00:00
Henning Bostelmann
cc9fc649a1 MDL-28219 QE2 adaptive behaviour: fix scores and penalties 2011-10-12 23:27:10 +01:00
Tim Hunt
9d1658a07e MDL-29571 qtype description refactor unit test code a bit. 2011-10-04 11:50:12 +02:00
Tim Hunt
05a5c2f9a2 MDL-28108 oops! I got the cut-off percentage wrong. 2011-06-29 22:02:59 +01:00
Tim Hunt
5cc532e8e9 MDL-28024 adaptive qbehaviour. Displayed penalties not rounded correctly. 2011-06-24 14:26:49 +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
Sam Hemelryk
8a322fc19b Merge branch 'MDL-24255' of git://github.com/timhunt/moodle 2011-06-20 15:51:59 +08:00
Tim Hunt
2d6829727d MDL-24255 Use the proper editor element for manual grading comments.
It would be nice if someone imporoved the API for using the HTML editor outside formslib.
2011-06-18 21:15:40 +01:00
Tim Hunt
88ef9d0b2b MDL-27916 Question state was described wrongly in adaptive and immediate feedback behaviours. 2011-06-18 13:29:39 +01: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
David Mudrak
d1c77ac372 MDL-27789 The new question plugins reported as standard ones 2011-06-09 14:29:27 +02:00
Eloy Lafuente (stronk7)
36e91f1de1 MDL-20636 Whitespace fixes 2011-06-06 16:38:46 +01:00
Tim Hunt
a4c982917e MDL-20636 truefalse qtype clean up other unit tests to use the new way of making test tf questions. 2011-05-27 14:43:28 +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
8f9145bb52 MDL-27505 Remove the ou-specific question types from the main branch.
The OU question types are now available from https://github.com/timhunt.
2011-05-16 08:30:44 +01:00