337 Commits

Author SHA1 Message Date
Tim Hunt
97e9eb203e MDL-52814 questions: Show extra info in the outcomes area not info
Currently the only use is the quiz Redo question button, and that would
be much better placed in the feedback area, not least for langages where
the button label needs to be longer.
2016-02-10 08:47:10 +00:00
Andrew Nicols
650c0086f9 MDL-52339 question: Fix question attempt removal for MySQL
Derived table support was altered in MySQL 5.7 changing the way in which
DELETE FROM works in some cases.

This change modifies the way in which deletion occurs by selecting all IDs
and batching them into groups of 1000.
2016-02-05 09:10:09 +08:00
Tim Hunt
d392b13a63 MDL-52427 questions: all parts of a Q should be clearfix
Otherwise large floated images may overflow.
2015-12-13 20:27:54 +00:00
Ankit Agarwal
c917b53a8d MDL-50269 deprecations: Properly deprecate notify() 2015-12-01 15:29:33 +08:00
Tim Hunt
e5acdcb942 MDL-51771 question engine: fix typo in SQL
Thanks to Pete at learningpool.com for finding thsi bug.
2015-10-18 16:03:29 +01:00
Eloy Lafuente (stronk7)
ca09f076f8 MDL-50182 core: add 3.0 environmental requirements
Only change from 2.9 is the modification of the slasharguments
admin setting string to recommend always to keep the setting enabled
and fix the problem in the server, warning about the drawbacks
of disabling it.

Also, there is a little phpdoc note added to one custom check
to have clearly specified when we can get rid of it.
2015-10-13 00:33:41 +02:00
Tim Hunt
ddc016830d MDL-51476 questions: manual grading validation for ungraded Qs
The change in MDL-51090 broke manually commenting on questions for which
no mark is given (max mark == 0). This fixes it, with unit tests.

Thanks to Nick Phillips for the original suggestion of the fix.
2015-09-25 14:01:33 +01:00
Tim Hunt
b2694c0219 MDL-51090 question: further refinements to validating manual grades 2015-09-01 23:05:37 +01:00
Nelson Moller
52b08f5fce MDL-51090: mod_quiz grading validation of an essay question
An invalid format is casted to 0 (if a string) or to some truncated value in other cases (ex: 10..5).
2015-08-20 19:58:49 +01:00
Eloy Lafuente (stronk7)
188458a604 MDL-50049 deprecation: Extra minor fixes.
- complete and cleanup upgrade.txt
- replace remaining uses in comments.
- fix some incorrect bulk-replacement in previous commit.
2015-07-10 01:59:31 +02:00
Tim Hunt
e7df2335b6 MDL-50373 questions: random Qs must not pick deleted or sub- questions
This was a regression caused by MDL-6340. I missed the necessary
    AND parent = 0 AND hidden = 0
in one query of the question table.
2015-05-27 20:32:47 +01:00
Tim Hunt
5e63b335fe MDL-40992 quiz: option to let students redo questions within an attempt
This feature is designed for use on pracice or formative quizzes.
It is available for quizzes that use Interactive or Immediate feedback
behaviour.

If the teacher turns this on in the quiz settings, then once a student
has finished a question, they get a 'Redo question' button beside the
question. If they click it, then the question they finished is replaced
by a new one so they can try again to practise that particul skill or
bit of knowledge a bit more.

When randomisation is involved, the studnets will be given a question or
variant that they have not seen before if possible.
2015-03-31 14:12:48 +01:00
Tim Hunt
f6579bea94 MDL-40992 question engine: new ways modify question usages
* A method to change the max mark for one question_attempt in the usage

* A method to replace one question in a usage with another, moving the
old question_attempt to the end.

* Methods to set and get metadata (string name value pairs) for each
question_attempt in the usage. This gets stored in the first step in a
way that should not interfere with anything else.
2015-03-26 17:46:48 +00:00
Tim Hunt
47be39ef41 MDL-40992 qbehaviour: new type method, can Qs can finish naturally 2015-03-26 17:46:48 +00:00
M Kassaei
1700bd4dea MDL-40992 quiz: let students to redo questions within an attempt 2015-03-26 17:46:47 +00:00
Tim Hunt
bb93fc24aa MDL-6340 quiz: avoid reusing random questions between attempts
There are several improvements over what we had before:

1. We track all the questions seen in the the student's previous
quiz attempts, so that when they start a new quiz attempt, they get
questions they have not seen before if possible.

2. When there are no more unseen questions, we start repeating, but
always taking from the questions with the fewest attempts so far.

3. A similar logic is applied with variants within one question.

There is lots of credit to go around here. Oleg Sychev's students Alex
Shkarupa, Sergei Bastrykin and Darya Beda all worked on this over
several years, helping to clarify the problem and shape the best
solution. In the end, their various attempts were rewritten into this
final patch by me.
2015-03-26 17:45:49 +00:00
Tim Hunt
441d284ada MDL-40990 quiz: option to require prev Q finished before next shown
Further improvements to this code, including resolving edge cases:

* The new feature can only be used when it is possible for the
previous question in the quiz to be complete.

* Also, this new feature cannot be used in combination with shuffle
questions, because that make no sense; nor in combination with
sequential navigation, because to make that work properly would be a lot
of effort. If someone needs that to work later, it should be possible
for them to implement it.

* There were changes in the edit renderer API, to try to make things
more  consistent, and to make it less likely we will need to change
things again in the future. See mod/quiz/upgrade.txt.

* As part of this change, the styling of the Edit quiz page was tweaked
to make slighly more efficient use of the horizontal space, and to be
more symmetrical.
2015-03-17 17:16:22 +00:00
M Kassaei
f7785e42b3 MDL-40990 quiz: option to require prev Q finished before next shown 2015-03-17 17:10:13 +00:00
Tim Hunt
fd7a8af50b MDL-40990 qbehaviours: method to say if attempts can finish naturally 2015-03-13 14:23:02 +00:00
Tim Hunt
df44db5baa MDL-48373 behat, questions: convert tests to use the new steps
The new steps make it more efficient to create questions.

While making the changes, I took the opportunity to alter the tests to
follow Behat best practices, and only test one thing per scenario.
2014-12-05 12:22:27 +00:00
Damyon Wiese
bdb319a5b1 Merge branch 'MDL-47740' of git://github.com/timhunt/moodle 2014-10-24 11:48:01 +02:00
Tim Hunt
a8de866712 MDL-47740 question engine: let qs update variant later if appropriate
Variant has two purposes. First to determine which version of the
question the student will see. Hence it is used to set up the state
of the quetsion when the question is started. Then the internal state of
the question is saved in the first step.

Once that has been done, the variant number is purely informative, and
just used to break down the statistics.

In some cases (the one I have in mind is qtype_opaque) then there is a
complex randomisation process, which may lead to several inital variant
numbers acutally giving the same version of the question. In this case
it is nice if the question can update the stored variant number, to make
the statistics more meaningful.
2014-10-21 11:43:57 +01:00
Tim Hunt
cf256c05d8 MDL-32616 question engine: set_max_mark_in_attempts MySQL perf
The MySQL (& Maria DB) query 'optimizer' was failing to handle this
query, so for that DB only, we give it an equivalent query that it can
get right.

With unit test.
2014-10-20 12:06:39 +01:00
Tim Hunt
7ad0e2e654 MDL-32616 question engine: move unit test to better name 2014-10-20 12:06:38 +01:00
Dan Poltawski
735c7ee41a Merge branch 'MDL-47122' of git://github.com/timhunt/moodle 2014-09-08 14:28:30 +01:00
Tim Hunt
16e246ac52 MDL-47122 question_engine_data_mapper: which methods are public.
That is, which may be used from outside the question engine.
2014-09-08 13:24:17 +01:00
Tim Hunt
a7b4c96440 MDL-46761 fix PHPdocs on question_usage_by_activity::get_total_mark
Thanks to Tony Gardner-Medwin for spotting this.
2014-09-07 11:37:43 +01:00
Tim Hunt
4040e2dd11 MDL-47122 use insert_records to improve question engine performance. 2014-09-04 23:15:27 +01:00
Tim Hunt
f4fe3968a2 MDL-46212 questions: add {} whenver vars are put into "" strings
Having had one subtle bug cased be this, I decided to do a search and
fix all of these.
2014-07-03 14:02:39 +01:00
Damyon Wiese
84f08cfa9d MDL-45606 Unit test fix for MySQL and added a comment about the removed code. 2014-05-20 18:01:32 +08:00
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