257 Commits

Author SHA1 Message Date
James Pratt
038014c415 MDL-41760 quiz_statistics : response analysis for first/last/all tries 2014-03-18 18:47:19 +07:00
Tim Hunt
8011be189e MDL-33653 fix preview links on calc qtype edit forms.
Also, refactor how we render preview icons, to eliminate duplication.
2014-03-07 19:46:56 +00: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
James Pratt
99caa248a8 MDL-43478 quiz responses report : display last / first / all tries
when using multiple try question behaviour
2014-02-23 13:39:08 +07: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
Sam Hemelryk
39a0509b68 Merge branch 'MDL-43929' of git://github.com/timhunt/moodle 2014-02-11 08:27:35 +13:00
Tim Hunt
029870ee95 MDL-44053 question restore from 2.0: fix regression from MDL-43670 2014-02-09 17:49:03 +00:00
Tim Hunt
1eb470fc42 MDL-43929 question manual grading: keep comment when validation fails.
If the validation failed, so the manual grading page was re-displayed
with a validation error, then any comment that had just been typed in
was getting lost. This fixes that.
2014-02-07 21:55:05 +00:00
Sam Hemelryk
9123721e4f Merge branch 'MDL-43246' of git://github.com/timhunt/moodle 2014-01-28 12:16:20 +13:00
Eloy Lafuente (stronk7)
835ef9d84c Merge branch 'MDL-43874' of git://github.com/timhunt/moodle 2014-01-27 23:52:07 +01:00
Tim Hunt
e101ec9fd7 MDL-43874 quiz, teacher comments should respect display options.
Whether the comments on manually graded questions were visible to
students should have been controlled by the 'Specific feedback' Review
option in the quiz settings. However, the quiz was not setting
$displayoptions->manualcomment, so it did not work.
2014-01-27 12:01:32 +00:00
M Kassaei
435d32798b MDL-33839d, Remove the move icon from the question bank 2014-01-24 14:40:16 +00:00
Tim Hunt
84b3710842 MDL-43246 question engine: avoid order-by id.
This was breaking with oracle master/master replication. Fortunately all
the places that needed to be changed were private to datalib.php. There
is still some ordering by id there, but only places where we want a
consitent, rather than meaningful, order, so that is OK.

The queries changed by this patch all have subqueries in aggregate
queries that pull out the latest step for a question_attempt. Those
queries used to look for MAX(id) but now they look for
MAX(sequencenumber). This is equivalent (for databases where ids always
increase with time, except for auto-saved steps. In the past,  an
auto-saved step might have been considered latest. Now the latest step
will always be one that has been properly processed. You can aruge that
this change is an improvement. Anyway, it is a moot point. All these
queries are only used in reports which are run on completed attempts,
where there will not be any autosaved data.
2014-01-23 15:20:59 +00:00
Tim Hunt
5b0a31bf20 MDL-43246 some question data mapper unit tests
With fixes for the issues unearthed by these tests.
2014-01-23 15:20:58 +00:00
Tim Hunt
28273694e5 MDL-43246 give unit tests class a better name. 2014-01-23 15:20:57 +00:00
Damyon Wiese
ae69bab27f Merge branch 'MDL-39756-essay' of https://github.com/ktemkin/moodle 2014-01-20 16:20:15 +08:00
Tim Hunt
3d96b4945a MDL-43733 use any auto-saved responses when questions are finished.
Before this, autosave was only working to save data when a student went
back in to continue an attempt. If the student, having crashed out,
never went back in and continued the attempt, their auto-saved responses
were not used when the attempt was automatically finished. That was a
rather bad oversight, which should now be fixed.
2014-01-17 16:58:13 +00:00
Kyle Temkin
a4f765eb1d MDL-39756 add advanced attachment options to essay question type
Adds a set of options to the essay question type which implement
the following new features:

-Adds an input format which accepts only file uploads, and no
 inline text.
-Adds an option to make the inline text response optional when
 attachments are enabled, so students can choose to upload
 an essay file.
-Adds an option to make attachments required, so essays without
 attachments will be marked incomplete.
2014-01-15 12:43:04 -05:00
Petr Škoda
c0fa7b0d93 MDL-43511 do not cache the MUC cache in question code 2014-01-12 18:20:52 +08:00
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