236 Commits

Author SHA1 Message Date
Sam Hemelryk
a59a423926 Merge branch 'MDL-42084-master' of git://github.com/sammarshallou/moodle 2013-12-03 11:12:34 +13:00
Damyon Wiese
34b67813ec Merge branch 'MDL-42598' of git://github.com/timhunt/moodle 2013-11-13 13:43:52 +08:00
Tim Hunt
3fc9410f84 MDL-42790 essay attempt on last: fix plain reponse mode
Plain responses, without files, were getting messed up by the
fix for MDL-39980. Something that looked like an HTML comment was being
appended.

This fix works by avoiding appending anything if there are no files. The
new unit test (which was failing before I fixed the code) confirms that
this works. The other tests should be enough to verify that there are no
regressions.
2013-11-08 15:13:04 +00:00
rwijaya
c544ee92f5 MDL-41615 quiz_mod: fix heading levels for usability and accessibility 2013-11-07 12:04:00 +08: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
d7db097db1 MDL-42598 quiz variant randomisation not random enough.
A student would get the same question variants (for example for a
calculated question) on their first attempt at both copies of a
duplicated quiz.
2013-10-29 16:19:24 +00:00
Tim Hunt
e9af46d8e7 MDL-32188 fix type in question/engine/upgrade.txt 2013-10-09 09:14:24 +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
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
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
Jamie Pratt
59abb70716 MDL-41752 question statistics class moved and improved
quiz_question_statistics_stats renamed to question_statistics_calculator
separate class question_statistics used to store calculated stats
and api changed, also code generally cleaned up.
2013-09-27 16:24:18 +07:00
Jamie Pratt
515b3ae6a7 MDL-41752 question statistics class moved and improved
quiz_question_statistics_stats renamed to question_statistics_calculator
separate class question_statistics used to store calculated stats
and api changed, also code generally cleaned up.
2013-09-27 14:10:53 +07:00
Jamie Pratt
e68e4ccfdc MDL-41725 move db tables from quiz stats report
to question bank

- move cron to clean up old cache records move code and
rename classes
- further review of the quiz reports statistics code
- starting to separate calculations of quiz stats, question stats and
response analysis
- introduce hashcode db field for cached stats convert
- code to use qubaids hashcode for caches

We just drop the old tables (including previous upgrade steps) and
re-create the new ones, because these tables just cache calculated
statistics. No important data is stored in them.
2013-09-20 16:27:06 +07:00
Sam Hemelryk
26c9c586c9 Merge branch 'MDL-41572-master' of git://github.com/jamiepratt/moodle 2013-09-17 14:30:16 +12:00
Jamie Pratt
764f6153d1 MDL-41572 pass through question behaviour vars with correct prefix
Through prepare_simulated_post_data. Also includes unit tests for
multiple attempts and tries.
2013-09-15 17:52:18 +07:00
Jamie Pratt
f7f596a2a7 MDL-41571 move forced_choices_selection_strategy
out of question/engine/tests/helpers.php to
question/engine/lib.php
2013-09-10 14:29:01 +07:00
Tim Hunt
0d14f2eb1e MDL-41348 question code depends on filelib.
I think this used to work because mod/forum/lib.php used to be included
everywhere, and in turn included lib/formslib.php. We should declare the
dependencey explicitly.
2013-08-28 11:15:24 +01:00
Tim Hunt
d629327a14 MDL-39980 essay attempt-on-last. Handle the no-files case.
This slighly changes the format for the way answers are stroed in the DB
in the case where there is some HTML content, but no files. This should
not cause any problems.
2013-08-21 11:56:17 +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
942a0e37d4 Merge branch 'MDL-39507' of git://github.com/timhunt/moodle 2013-08-13 09:52:35 +08: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
Tim Hunt
df7d175d0f MDL-41091 questions: fix get_all_submitted_qt_vars for unit testing. 2013-08-08 14:41:53 +01:00
Petr Škoda
2f1e464a88 MDL-40438 migrate all collatorlib:: and textlib:: uses 2013-08-06 21:04:35 +02:00
Marina Glancy
87934924be Merge branch 'MDL-31226-master' of https://github.com/lucisgit/moodle 2013-08-06 14:38:08 +10: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
Jamie Pratt
c2b051c7aa MDL-40542 need to be able to select variant
in unit tests
2013-07-23 15:11:56 +08:00
Jamie Pratt
c2f2e7f008 MDL-40541 need to be able to select random q
in unit tests
2013-07-23 15:08:32 +08:00
Jamie Pratt
388f047345 MDL-40543 convert from simulated responses
to post data
2013-07-23 15:00:02 +08:00
Petr Škoda
1c74b26090 MDL-40220 use new core_component::get_plugin_directory() 2013-07-16 22:38:38 +02:00
Petr Škoda
bd3b3bba9f MDL-40220 use new core_component::get_plugin_list() 2013-07-16 22:36:11 +02:00
Jamie Pratt
01c898ecec MDL-40171 question saving test 2013-07-09 15:08:01 +08:00
Sam Hemelryk
018fc94211 Merge branch 'MDL-39978' of git://github.com/timhunt/moodle 2013-06-10 14:48:21 +12:00
Tim Hunt
ea07b2d622 MDL-39978 Essays with files break each attempt builds on last 2013-05-31 20:47:26 +01:00
Tim Hunt
f593a6414c MDL-39945 qtype multichoice was not comparing blank responses correctly. 2013-05-30 19:19:32 +01:00
Tim Hunt
0a5aa9c610 MDL-27748 question: grade options should be localised.
question_bank::fraction_options should use format_float to display
decimal pionts correctly.
2013-05-19 23:39:23 +01: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
Tim Hunt
c7fbfe46f9 MDL-38538 question autosave: fix sequencecheck handling. 2013-04-04 15:32:32 +01:00
Dan Poltawski
ac8bc0f947 Merge branch 'MDL-34640' of git://github.com/timhunt/moodle 2013-04-03 13:57:02 +08:00
Tim Hunt
d122fe3245 MDL-38538 question autosave: fix missing method.
Also change the unit tests to detect this problem.
2013-04-02 16:53:25 +01:00
Tim Hunt
dc1ee5cb29 MDL-34640 question repsponse files: remaining tidy up of this code. 2013-03-30 21:16:18 +00:00
Mathieu Petit-Clair
d0782585c8 MDL-34640: adding code to pass contextid and question type to question_file_loader. 2013-03-30 19:57:03 +00:00
Tim Hunt
8a1e7b7756 MDL-34640 quesion reponse files: PARTIAL SOLUTION to allowing resonse files to be graded automatically. 2013-03-30 19:53:15 +00: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
Tim Hunt
eca230b521 MDL-38538 question unit tests: improve things a bit.
1. Split the question_attempt tests into one class per file.
2. Imporve the API to give tests more control, and to test more of the
   important code. Some of this is not used here, but it is about to be.
2013-03-28 16:05:34 +00:00
Tim Hunt
770e4a467f MDL-38311 question manual grading: comment fixes. 2013-03-06 09:27:11 +00:00