108 Commits

Author SHA1 Message Date
Damyon Wiese
47578dbff4 MDL-42930 Add 2.6.0 upgrade line 2013-11-18 11:47:17 +08:00
Tim Hunt
a568785223 MDL-42743 improve wording of the CBM summary on quiz review 2013-11-07 10:30:06 +00:00
Eloy Lafuente (stronk7)
f39c82ebed MDL-42701 Bump all versions near 2.6 release 2013-11-05 02:36:00 +01:00
Damyon Wiese
6e4dcb9a47 MDL-40493 Question: Explain why setAdminUser is needed for tests 2013-10-09 16:53:21 +08:00
Petr Škoda
c969753885 MDL-40493 question: set real $USER before testing question walktrough 2013-10-09 11:02:35 +13:00
Tim Hunt
8b9ef25ea2 MDL-32188 question CBM: use short certainty name in response summaries. 2013-10-04 21:46:47 +01:00
Tim Hunt
2bf83cb218 MDL-32188 question CBM: minimal handling of certainty -1
Certainty -1 has never been used in standard Moodle, but is
used in Tony-Gardiner Medwin's patches to mean 'No idea' which
we intend to implement: MDL-42077. In the mean time, these changes
avoid errors for people who have used TGM's patches.
2013-10-04 21:46:46 +01:00
Tim Hunt
e74aa0aa97 MDL-32188 question CBM: compute summary stats for CBM behaviours
We now compute the average CBM score, accuracy, CBM bonus and enhanced
accuracy, both for the entire quiz, and for just the questions answered.

Note that these calculations must work correctly in the presence of
descriptions, ungraded questions, and manually graded questions. For
example, imagine a essay added at the end of the quiz "Summarise what
you learned attempting this exercise." This might have max mark zero or
non-zero. The CBM statistics just ignores questions like that.
2013-10-04 17:56:36 +01:00
Tim Hunt
9b2fe16bca MDL-32188 question CBM: improve display of the certainty choices
Switch to the neutral C=1, 2, 3 mode. Also add a helpicon, and improve
line-wrapping.
2013-10-04 17:52:31 +01:00
Tim Hunt
fb74929e97 MDL-32188 question CBM: alter score handling.
We now change so that minfraction is -6 and maxfraction is 3, so getting
the question right a low certainty gives maxmark marks, and you get a
bonus for being more confident (rather than being penalised for being
unconfident). Mathematically it is the same, but the difference is
importnat psychologically.

We also change how partially correct scores are handled.
It is too harsh to penalise a partially correct score with full
certainty by doing a linear interpolation between -6 and +3. Instead,
any partially correct score (e.g. 0.5) becomes that fraction of the
correct score (e.g. 0.5 * 3 = 1.5). Also, any incorrect score is treated
as 0, so if you have a multiple choice question that normally gives a
negative score for a wrong choice, this will now never give a score of
less than -6.

Finally we change how this is displayed to students beside the question.
Rather than saying "Marked out of 1.00", we say "Base mark 1.00", and
then later we say "CBM mark 3.00" (or whatever it is).
2013-10-04 17:52:29 +01:00
Tim Hunt
7ab9ce3a3c MDL-32188 question CBM: fix hard-coded numbers -> constants. 2013-10-04 17:52:26 +01:00
Tim Hunt
c4efeb2b4b MDL-32188 question CBM: fix typos in comments.
Also one method name.
2013-10-04 17:52:24 +01:00
Tim Hunt
02d3e4d557 MDL-32188 question rendering: let behaviours control mark display.
Then use this in the CBM behaviours to change how the question marks are
displayed there.
2013-10-04 17:52:21 +01: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
Tim Hunt
474aa125ca MDL-32188 quiz/question: behaviours can add to the review summary.
At the top of the quiz reivew page, there is a table that summarises
infomration about the quiz attempt as a whole. For some question
behaviours, we would like to be able to add additional information to
that summary.

This commit introduces a generic method for the behaviour to provide
summary information about an entire question usage.
2013-10-04 17:52:16 +01:00
Tim Hunt
f3460297a9 MDL-32188 question engine: behaviour static methods -> new classes
It was always a bit of a hack to use static methods on the
qbehaviour_whatever classes to return metadata about the behaviour. It
is better design to have real qbehaviour_whatever_type classes to report
that metadata, particularly now that we are planning to add more such.

For example, inheritance works better with real classes. See, for
example, the improvements in
question_engine::get_behaviour_unused_display_options().

This change has been implemented in a backwards-compatbile way. Old
behaviours will continue to work. There will just be some developer debug
output to prompt people to upgrade their code properly.
2013-10-04 12:15:01 +01:00
Jamie Pratt
d50b05e696 MDL-41751 changes to api of question_response_analyser
and code refactoring and clean up.
2013-09-27 17:38:13 +07:00
Tim Hunt
7a55fd3888 MDL-41366 qbehaviour_informationitem fix name capitalisation. 2013-08-21 12:28:20 +01:00
Tim Hunt
afb1b3d03b MDL-39980 question engine: Attempt on last loses response files
When doing Each attempt builds on last, we need to copy any response
files into a draft file area, and then re-save them.

While writing the unit test for this, I had to deal with a todo in the
question engine so that questions with files in the response could be
unit-tested.

I also found an fixed a bug with qtype_essay_question::is_same_response
and fixed some notices in the existing essay/manual graded unit tests.
2013-08-15 12:55:13 +01:00
Dan Poltawski
ed07242713 MDL-39507 qtype_essay: hacky fix for unit tests
This is just to get the tests passing for integration purposes. Tim
may want to do a robust fix and revert this.
2013-08-13 10:47:19 +08:00
Ruslan Kabalin
f8e28244cb MDL-31226: quiz: Fix message for attempts built on previous.
At the moment, when attempt is built on the last one, "not yet answered"
message is shown, which confuses many people. This patch modifies the state to
"complete" for attempt based on previous and modifies the output string.

Many thanks to Tim Hunt for guiding me through quiz infrastructure and some code
suggestions.
2013-08-02 16:19:18 +01:00
Sam Hemelryk
ee4e6c04e2 Merge branch 'MDL-30320' of git://github.com/timhunt/moodle 2013-06-12 09:38:38 +12:00
Eloy Lafuente (stronk7)
c9e54743ec MDL-39753 Add 2.5.0 upgrade line 2013-05-20 15:33:19 +02:00
Tim Hunt
06616f4b70 MDL-30320 question engine: remove API deprectaed in Moodle 2.2. 2013-05-19 23:38:19 +01:00
Eloy Lafuente (stronk7)
05bf4b17e8 Merge branch 'MDL-29758' of git://github.com/jmvedrine/moodle 2013-05-10 02:53:49 +02:00
Jean-Michel Vedrine
d56ab3b992 MDL-29758 make Cloze question feedback display more informative
as it was in Moodle 1.9
2013-05-09 07:55:43 +02:00
Damyon Wiese
a04e97ef0c MDL-39412 Prevent developer warnings on upgrade from 24 to master 2013-05-09 11:26:25 +08:00
Tim Hunt
cbdb09a9ef MDL-39412 disabling manual graded behaviour refinements
1. Change behaviour admin settings so you can only select enabled
behaviours.
2. During the upgrade, change admin settings that might be currently set
to manual graded, so that instead they are set to deferredfeedback (if
that is available. If not, we just take the first alphabetically.)
2013-05-09 11:24:43 +08:00
Tim Hunt
103928da0b MDL-39412 question behaviours: hide manual graded option
The ability to set all your quiz questions to require manual grading is
an interesting possibility, but practically almost useless.

If you set that accidentally, then you are badly stuck. There is no way
to fix it after the students have answered the quiz.

Therefore, we should set the config option to hide that option from the
UI. We do this for all Moodle sites as part of the upgrade, not just for
new installs.

If any admin wants to re-enable this, they can later.
2013-05-02 17:02:46 +01:00
Eloy Lafuente (stronk7)
cedb0aab5a MDL-39434 Bump all versions near 2.5 release 2013-05-01 18:03:29 +02:00
Jean-Michel Vedrine
dc5133edca MDL-37784 Adaptive no penalty display wrong penalty info
Adaptive Mode tells students they have been penalized even when set to no penalties
2013-04-23 08:30:42 +02:00
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