Issue Details (XML | Word | Printable)

Key: MDL-8648
Type: New Feature New Feature
Status: Resolved Resolved
Resolution: Fixed
Priority: Minor Minor
Assignee: Tim Hunt
Reporter: Manuel de la Torre
Votes: 57
Watchers: 30
Operations

Add/Edit UI Mockup to this issue
If you were logged in you would be able to see more operations.
Moodle

Allow essay questions to be selected by random questions

Created: 24/Feb/07 12:30 PM   Updated: 23/Jul/09 10:11 AM
Return to search
Component/s: Questions, Quiz
Affects Version/s: 1.8
Fix Version/s: 1.9.4, 2.0

File Attachments: 1. Text File random_essay_questions.patch.txt (9 kB)

Environment: Linux Ubuntu, Moodle 1.7.1, PHP 5, MySQL
Issue Links:
Blockers
 
Dependency
 
Duplicate
 
Relates
 

Participants: A. T. Wyatt, Caroline Tam, Constantin Sclifos, Genner Cerna, Manuel de la Torre, Martin Dougiamas, Matt Gibson, Michael Spall, Pierre Pichet, Ray Lawrence, Ryan Wick, Samuli Karevaara, Tim Hill and Tim Hunt
Security Level: None
Resolved date: 28/Nov/08
Affected Branches: MOODLE_18_STABLE
Fixed Branches: MOODLE_19_STABLE, MOODLE_20_STABLE


 Description  « Hide
When you try to add Essay questions to a quiz using the Add Random questions feature, they are added to the quiz but if you try to preview them or take an exam the following message appears:

The number of random questions required is more than this category contains!

The essay questions in the category are not the problem because there are more questions than the ones selected.

It will be great if this feature can be fixed, because many more traditional teachers that like to score the exams by them selves are not using the quiz moodle because they cannot have random exams.



 All   Comments   Change History   Version Control      Sort Order: Ascending order - Click to sort in descending order
Pierre Pichet added a comment - 03/Mar/07 12:14 PM
I reproduce the problem on the UQAM Moodle 1.6.3 , it is specific to essay questions

Pierre Pichet added a comment - 03/Mar/07 10:07 PM
The bug is an old problem 1.6, 1.7 and NOT solved for 1.8.( I have just check)
As it persists for such a long time it is not a blocker but more a minor bug.
I will take a look at it.

Pierre Pichet made changes - 03/Mar/07 10:07 PM
Field Original Value New Value
Affects Version/s 1.6.4 [ 10150 ]
Affects Version/s 1.7.1 [ 10151 ]
Affects Version/s 1.6.2 [ 10119 ]
Affects Version/s 1.6.3 [ 10140 ]
Affects Version/s 1.7 [ 10120 ]
Priority Blocker [ 1 ] Minor [ 4 ]
Affects Version/s 1.6.1 [ 10118 ]
Affects Version/s 1.8 [ 10130 ]
Affects Version/s 1.6 [ 10110 ]
Pierre Pichet made changes - 03/Mar/07 10:33 PM
Assignee Tim Hunt [ timhunt ] Pierre Pichet [ ppichet ]
Pierre Pichet made changes - 04/Mar/07 10:06 PM
Security Possible security issue [ 10002 ]
Pierre Pichet made changes - 04/Mar/07 10:07 PM
Status Open [ 1 ] In Progress [ 3 ]
Pierre Pichet added a comment - 04/Mar/07 10:09 PM
By definition the Essay questions are not usable as random questions .
So should not be used as is.
There should be either
a warning put somewhere when somebody select random on a category where there is an essay question
or
the random function be deactivated.when there is an essay question in it.

will discuss with Tim


Pierre Pichet added a comment - 05/Mar/07 05:26 AM
Actually the code excludes as non randomizable the following question types
'description',
'essay',
probably mostly by the fact that are manually graded.
This should stay as it is.
Perhaps the docs ( and the help ) should be more explicit.
This is why I think that this is fixed but not closed as long as the additional comments have not been put in the help.

And I had Tim advice on this..


Pierre Pichet made changes - 05/Mar/07 05:26 AM
Status In Progress [ 3 ] Resolved [ 5 ]
Resolution Fixed [ 1 ]
Manuel de la Torre added a comment - 09/Mar/07 11:40 AM
Pierre, I understand that by definition on Moodle Essay questions are not usable as random questions. But it will not be possible to change the definition and make them usable as random questions? I understand that this will require heavy coding because of this types of questions are manually graded.

Pierre Pichet added a comment - 09/Mar/07 12:58 PM
I am not sure that this should such a problem because you can use the same essay question as a regular question in the quiz.
I will look at the code and come back later.
As this policy of not allowing Essay in random, seems the official one, I will keep the bug in the same state.

Tim Hunt added a comment - 13/Mar/07 06:18 PM
The real issue is that random questions don't interact well with manual grading. This is the only reason that Essay questions are excluded from random. We really need to fix this, but it is quite a lot of work, so don't hold your breath.

See this thread for more information: http://moodle.org/mod/forum/discuss.php?d=50903


Tim Hunt made changes - 13/Mar/07 06:18 PM
Status Resolved [ 5 ] Reopened [ 4 ]
Fix Version/s 1.5 [ 10102 ]
Resolution Fixed [ 1 ]
Assignee Pierre Pichet [ ppichet ] Tim Hunt [ timhunt ]
Martin Dougiamas made changes - 18/Jun/07 09:58 AM
Fix Version/s 1.5 [ 10102 ]
Matt Gibson added a comment - 18/Sep/07 06:36 PM
I've just run into this problem and for me, it's significant. I'd like to have a quiz composed entirely of random essay questions which are 3 or 6 mark questions so that I can give students a written exam which is different for each student. This is important to prevent cheating when I cannot schedule a computer room to run the exam.

Is there a time frame for fixing it?


Ray Lawrence added a comment - 18/Sep/07 08:23 PM
I've not needed to use random essay questions and as a result of this wasn't aware of this issue. I agree with Matt that this is a significant issue. I'm surprised that it is only flagged as of "Minor" importance.

I noticed recently that the manual grading area doesn't reflect groups either.


Tim Hunt made changes - 21/Sep/07 12:19 AM
Summary Error when you choose Essay questions randomly Essay questions cannot be used by random questions, becuase the manual grading code can't cope
Tim Hunt added a comment - 21/Sep/07 12:31 AM
There are a number of issues with the manual grading code that means we cannot turn on the setting that lets random questions pick essay questions. I am turning this bug into a tracking bug for these issues.

Tim Hunt made changes - 21/Sep/07 12:31 AM
Summary Essay questions cannot be used by random questions, becuase the manual grading code can't cope Allopw essay questions to be selected by random questions
Database [MySQL]
Issue Type Bug [ 1 ] New Feature [ 2 ]
Tim Hunt made changes - 21/Sep/07 12:32 AM
Link This issue is blocked by MDL-4004 [ MDL-4004 ]
Tim Hunt added a comment - 21/Sep/07 12:36 AM
I created MDL-11376 for the manual grading ignoring groups bug.

Tim Hunt made changes - 19/Nov/07 10:02 PM
Link This issue is duplicated by MDL-12253 [ MDL-12253 ]
Samuli Karevaara added a comment - 04/Feb/08 04:07 PM
+1 for fixing this.

So far we have worked around this by adding the question texts as Cloze type questions with 0 points and an empty drop-down or similar as the aswer text. This way the question texts can be randomized. Then the answer can be taken in with a non-randomized essay question (that has no question text at all). But obviously having this bug fixed would make things easier.

IIRC the Description type questions can't be randomized either, so the Cloze-hack mentioned above is used.


Caroline Tam added a comment - 04/Mar/08 04:39 AM
Another +1 for fixing this.

In our Moodle install, we have an instructor who wants to create a quiz composed entirely of essay questions and have it be randomly pulled. It is extremely fustrating for the instructor to see the error message that states that there are no questions available in the category. To have an error message that says essay questions cannot be randomized is a lot better that telling them that there are no questions avaiable, especially when the instructor knows it is there.


Caroline Tam added a comment - 25/Mar/08 03:26 AM
It doesn't sound like there was any action here, so I am adding another comment to bump this issue up! Thanks!!

Matt Gibson added a comment - 25/Mar/08 04:54 AM
Caroline - this issue is blocked by MDL-4004, which has seen action recently as Matt Oquist says he is working on it. Add yourself as a watcher there to stay informed

Ray Lawrence made changes - 25/Mar/08 06:22 AM
Summary Allopw essay questions to be selected by random questions Allow essay questions to be selected by random questions
A. T. Wyatt added a comment - 14/Apr/08 07:38 PM

Constantin Sclifos added a comment - 08/May/08 04:49 PM
The same is on Moodle version 1.9 + (Build: 20080402), it will be a good thing to fix it ...

Tim Hunt made changes - 01/Sep/08 12:02 PM
Link This issue is duplicated by MDL-16282 [ MDL-16282 ]
Martin Dougiamas added a comment - 12/Sep/08 12:08 PM
Let's get a quick fix in for this (even if it's not efficient etc) since it has so many votes.

Martin Dougiamas made changes - 12/Sep/08 12:08 PM
Fix Version/s 2.0 [ 10122 ]
Fix Version/s 1.9.3 [ 10290 ]
Martin Dougiamas made changes - 15/Oct/08 03:00 PM
Fix Version/s 1.9.3 [ 10290 ]
Fix Version/s 1.9.4 [ 10300 ]
Tim Hill added a comment - 16/Oct/08 07:54 AM
Volunteered to try moodle this semester as an alternative for our faculty using WebCT/BB and have been quite pleased until discovering this very significant shortcoming. Will have to report that lacking random essay questions makes moodle a non-starter for us. Meanwhile I must scramble to work around for my exam on Monday - argh! For now I'm back to WebCT/BB which is otherwise inferior but handles this particular issue quite easily and effectively. Please fix asap!

Genner Cerna added a comment - 21/Oct/08 06:09 PM
please include a fix on the next release. thanks

Dmitry Pupinin made changes - 19/Nov/08 05:36 AM
Link This issue has been marked as being related by MDL-17279 [ MDL-17279 ]
Tim Hunt added a comment - 26/Nov/08 07:11 PM
The attached patch (random_essay_questions.patch.txt), which applies to the 1.9 stable branch, allows essay questions to be selected by random questions. It appears to work following some quick testing, but it now needs more thorough testing.

To use:

1. Apply the patch to a recent 1.9.3+ test installation.
2. Go to Admin -> Miscellaneous -> Experimental and turn on the option 'Random questions can use manually graded questions'.

How it is supposed to work:

They key point here (in addition to the admin setting) is ensuring that the random questions show up in the manual grading report, but only if they actually need manual grading. And then that manually grading them actually works. (Manually grading random questions from the attempt review page has worked for some time.)

What needs to be tested: (If possible, test with Admin -> Server -> Debugging settings turned on to full, and report any errors/warnings/notices seen.)

A. That it works when you have a category of
i) all essay questions.
ii) some essay and some non-essay questions
iii) all non-essay questions.

B. That it works both when selecting both
i) questions just one category
ii) questions from a category and all its categories.

C. Nasty situations like this: Create a category with one essay question and five short-answer questions. Explicitly add the essay question to the quiz as a non-random question, then add two random questions from the same category (which will then pick from the remaining 5 questions). Ensure that the essay question still shows up in the report, but the random questions don't.

D. People who can test on a COPY of their production site with a huge question bank would be greatly appreciated.

Just to be clear in cases A i) and A ii) the random question should appear in the manual grading report. In case A iii) it should not.

In case A ii) when you go in to grade a particular question, all student's attempts at the random question, both the ones where that student got an essay, and the ones where they got something else, should be shown in the manual grading report. I know that is not ideal, but that is what is possible.


Tim Hunt made changes - 26/Nov/08 07:11 PM
Attachment random_essay_questions.patch.txt [ 15733 ]
Tim Hunt made changes - 27/Nov/08 12:08 PM
Attachment random_essay_questions.patch.txt [ 15733 ]
Tim Hunt added a comment - 27/Nov/08 12:09 PM
Just uploaded a revised patch. It works in fundamentally the same way, the code is just organised a bit better.

Tim Hunt made changes - 27/Nov/08 12:09 PM
Attachment random_essay_questions.patch.txt [ 15743 ]
tjhunt committed 6 files to 'Moodle CVS' - 28/Nov/08 03:07 PM
random essay questions: MDL-8648 Allow essay questions to be selected by random question.

In the 1.9 branch this is controlled by a new option under Admin -> Experimental. In Moodle 2.0 dev it is not optional, it just works.

The main change is letting the manual grading report know which random questions might need manual grading. MDL-4004 - this depends on the random question under consideration, which requires a new questiontype method.

I also changed the random question code so that I could remove some global variables.
MODIFY question/type/random/questiontype.php   Rev. 1.26    (+64 -6 lines)
MODIFY question/type/questiontype.php   Rev. 1.108    (+11 -2 lines)
MODIFY lib/questionlib.php   Rev. 1.177    (+6 -18 lines)
MODIFY question/type/essay/questiontype.php   Rev. 1.30    (+1 -5 lines)
ADD lang/en_utf8/qtype_random.php   Rev. 1.1    (+0 -0 lines)
MODIFY mod/quiz/report/grading/report.php   Rev. 1.50    (+4 -3 lines)
tjhunt committed 6 files to 'Moodle CVS' on branch 'MOODLE_19_STABLE' - 28/Nov/08 03:07 PM
random essay questions: MDL-8648 Allow essay questions to be selected by random question.

In the 1.9 branch this is controlled by a new option under Admin -> Experimental. In Moodle 2.0 dev it is not optional, it just works.

The main change is letting the manual grading report know which random questions might need manual grading. MDL-4004 - this depends on the random question under consideration, which requires a new questiontype method.

I also changed the random question code so that I could remove some global variables.
MODIFY admin/settings/Attic/misc.php   Rev. 1.14.2.4    (+4 -1 lines)
MODIFY question/type/questiontype.php   Rev. 1.74.2.14    (+11 -2 lines)
MODIFY question/type/essay/questiontype.php   Rev. 1.20.2.8    (+7 -2 lines)
MODIFY question/type/random/questiontype.php   Rev. 1.12.2.7    (+68 -8 lines)
MODIFY lang/en_utf8/qtype_random.php   Rev. 1.1.2.2    (+4 -0 lines)
MODIFY mod/quiz/report/grading/report.php   Rev. 1.25.2.14    (+4 -3 lines)
Tim Hunt made changes - 28/Nov/08 03:07 PM
Link This issue will be resolved by MDL-4004 [ MDL-4004 ]
Tim Hunt added a comment - 28/Nov/08 03:09 PM
Now checked in.

Note that in Moodle 2.0 there is no option. Essay questions are treated just like any other question type by random questions.

The main performance impact of this is that it increases the work required to display the manual grading report - one extra DB query per random question in the quiz. Worse if the random question selects from subcategories too - but that is no longer the default in Moodle 2.0. I think that is acceptable.


Tim Hunt made changes - 28/Nov/08 03:09 PM
Status Reopened [ 4 ] Resolved [ 5 ]
Resolution Fixed [ 1 ]
martignoni committed 1 file to 'Lang CVS' - 07/Dec/08 11:50 PM
MDL-8648 New lang file added
ADD fr_utf8/qtype_random.php   Rev. 1.1    (+0 -0 lines)
tjhunt committed 1 file to 'Moodle CVS' - 26/Mar/09 10:54 AM
random essay questions: MDL-8648 fix merge problem.
MODIFY lib/questionlib.php   Rev. 1.192    (+6 -2 lines)
Mitsuhiro Yoshida committed 2 files to 'Lang CVS' - 17/Jun/09 12:47 PM
Brushed up translated strings for global search block.
MDL-8648 Translated new strings for random question.
MODIFY ja_utf8/block_search.php   Rev. 1.4    (+3 -3 lines)
MODIFY ja_utf8/qtype_random.php   Rev. 1.3    (+3 -1 lines)
Ryan Wick added a comment - 23/Jul/09 12:02 AM
I recently tried to patch using this into our Moodle system. I get a "Reversed <or previously applied> patch detected". Is this patch working for 1.9.5?

Michael Spall added a comment - 23/Jul/09 12:39 AM
Ryan,

This fix was checked in to MOODLE_19_STABLE on 28/Nov/08 by Tim Hunt so it is in Moodle 1.9.5. One way to see the commits that have been associated with a particular tracker issue is to click the version control tab above. Also, this bug has been marked resolved with resolution fixed. In 1.9 with the fix, there is an admin option to turn it on.


Tim Hunt added a comment - 23/Jul/09 10:11 AM
Yes. If you have Moodle 1.9.5, you just need to go and enable this in the admin settings - under experimental, I think.