Issue Details (XML | Word | Printable)

Key: MDL-4004
Type: New Feature New Feature
Status: Resolved Resolved
Resolution: Fixed
Priority: Major Major
Assignee: Tim Hunt
Reporter: Mark Nielsen
Votes: 24
Watchers: 15
Operations

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

Make the manual grading report work with random questions that pick manually graded questions

Created: 01/Sep/05 07:32 AM   Updated: 18/Feb/09 02:35 AM
Return to search
Component/s: Quiz
Affects Version/s: 1.6.4, 1.7.1
Fix Version/s: 1.9.4

File Attachments: 1. Text File MDL-4004-essay_questions_in_random.patch (2 kB)
2. Text File moodle-1.6.4plus-MDL4004-essay_questions_in_random.patch (2 kB)

Environment: All
Issue Links:
Blockers
 
Dependency
 
Duplicate
 

Participants: A. T. Wyatt, Ashley Holman, Mark Nielsen, Martin Dougiamas, Matt Oquist, Paulo Matos and Tim Hunt
Security Level: None
Resolved date: 28/Nov/08
Affected Branches: MOODLE_16_STABLE, MOODLE_17_STABLE
Fixed Branches: MOODLE_19_STABLE


 Description  « Hide
Encountered a problem for grading Essay Questions.

To reproduce the problem:
0. Edit the essay question type so that the method is_usable_by_random returns true.
1. Add a random question to a quiz and select category X for the random question.
2. In category X only have Essay Question(s)
3. Take the quiz as a student.
4. Go to the Manual Grading Tab as a Teacher and you will find that there are no essay questions to grade.

This is because of how the code checks for essay questions in the quiz. Go to line 256 in grading.php to see how it does this.

The random question type causes a lot of problems for grading Essay Questions because if the random question is pulling from Essays and non-essays then not every student will answer the question.

So, the method for how the grading code looks for essay questions in a quiz and the interface for grading essay questions need to be altered. I'm not entirely sure how random questions work so I am stuck on this problem at the present time.

Another solution is to add ESSAY to the excludedtypes array in random question type.

 All   Comments   Change History   Version Control      Sort Order: Ascending order - Click to sort in descending order
Martin Dougiamas added a comment - 04/Jun/06 03:49 AM
From Gustav Delius (gwd2 at york.ac.uk) Thursday, 1 September 2005, 02:54 PM:

I would support the solution of excluding essay questions from the random questions by adding them to the excluded type array.

However the problem will probably also go away once the manual grading code gets extended to cover all questions. Then the grading code will no longer need to be able to identify all essay questions, it will simply list all questions in the quiz.

From Gustav Delius (gwd2 at york.ac.uk) Monday, 6 February 2006, 06:56 AM:

For now I have simply added essay questions to the list of excluded questions for random questions. This is probably the most sensible thing to do anyway given that essay questions are quite a bit different from the other questions.

From Anthony Borrow (aborrow at jesuitcp.org) Sunday, 5 March 2006, 04:57 AM:

While the issue of not being able to grade random essay questions may be fixed by excluding essay questions from the available random list, I would like to make sure that it does not disappear from the radar screen. If it is ok, I would like to reopen this and change it to a feature request. I think the ability to choose from a category of random essay questions is helpful and would be a great feature.


Paulo Matos added a comment - 25/Oct/06 09:47 PM
I found a solution to use essay questions in random, see this discussion:

http://moodle.org/mod/forum/discuss.php?d=50903

add some improvemnts, it's not perfect but it works. I'm attaching a patch to solve this.

Paulo


Paulo Matos added a comment - 25/Oct/06 09:48 PM
MDL-4004-essay_questions_in_random.patch

Paulo Matos added a comment - 30/Jan/07 10:46 PM
Patch Updated/Verified against moodle v1.6.4+ (2006050540).

Tim Hunt added a comment - 14/Apr/07 05:38 AM
Fiddling with the bug's state to clear the bogus Resolution: fixed.

Tim Hunt added a comment - 21/Sep/07 12:43 AM
Paulo's patch is on the right lines, but unfortunately it is not quite right.

The problem is that some random questions pick not just from a single category, but from a category and all its children. Therefore, the SQL in view_questions in mod/quiz/report/grading/report.php needs to be made even more complicated.


Matt Oquist added a comment - 16/Feb/08 03:51 PM
We've (vlacs.org) run smack into this one and we need it fixed (in 1.8), so I guess I'll probably be working on it.

I'll take a look at Paulo's patch, but any other comments or advice will be appreciated.

--matt


Tim Hunt added a comment - 18/Feb/08 08:32 PM
It would be really great if you could work on this. My comment above on 21st Sept is accurate, but maybe a bit cryptic.

This diagram may help a bit http://docs.moodle.org/en/Development:Quiz_database_structure

Looking at Paulo's patch, it basically adds an OR clause to the SQL to find random questions in categories that contain essay questions.

What it fails to take into account are random questions that pick from a category and all the child categories (this is indicated by questiontext='1' for the random question), and where the essay questions are in the child categories, not the to level category. Bear in mind that the child categories can be nested to arbitrary depth. It should be possible (but hard) to extend the SQL to cover this case.

Note that the random question type makes use of the question_categorylist function from questionlib to get a list of the relevant categories, but this is recursive, and only works for one question at a time, so cannot be directly used in the query.


A. T. Wyatt added a comment - 14/Apr/08 07:36 PM

Ashley Holman added a comment - 09/Jul/08 04:33 PM
+1, would like to see this fixed.

I am migrating courses from WebCT into Moodle, and cannot recreate the randomised essay questions !