To Install, download the attached file to this forum post and read the quiz_essay_readme.txt file for the install instructions. Please read carefully! Also, please report bugs/comments/suggestions to this thread. Thanks!
Also, I'm not a pro at coding in quiz so I may have left something out of my code or done something wrong (aka backup before you use). I would appreciate it if one of the quiz voodoo masters could take a look at it
Lastly, an interesting tidbit: I think that this code could be modified without too much hassle to be able to edit student answers for all question types.
Cheers and have fun,
I am so excited to try out this questiontype......I think it may be the answer to one of my really big problems.....I am by no means a programmer....but I have done all of the things in the read me file and I get this message "could not find question state"......have I forgotten something or might this be a bug......I am using moodle 1.5 but it is several weeks old.....could that be the problem?
That would be nice...if some clever programmer were to do that ...as I like the idea of the other functionality you have created, but without the ability to edit I can't use it.
I'm not sure if I qualify as a quiz voodoo master ;) but I have converted all the standard questiontypes from the old to the new quiz model. I had a look through the questiontype.php and it looks fine to me. There were only some minor things that shouldn't cause any problem however: the first three lines in grade_responses are redundant and the field $state->graded should (by convention) be $state->options->graded, because the ->options field is used as a kind of namespace where questiontypes can do what they want. In theory it is possible that a future extension of the core quiz code adds a $state->graded field which would create a conflict in the present code. Other than that I'm pleased to see that the model caters for this somewhat different questiontype quite well
A note on extending the manual grading to all (or more) questiontypes: currently the facilities for manual grading are tightly integrated into the questiontype (e.g. the print_question_formulation_and_controls method). I think it should be possible to decouple this part of the code and reuse it for other questiontypes (including a teacher comment). This would imply that a table for such "manual" feedback is shared by all questiontypes. Maybe the printing code could be integrated as an additional method into the default questiontype. Another issue is the grading code of course. Either the grade_responnses methods af all questiontypes would need to be extended to cater for manual grading, or yet another default method could (probably) be implemented to do the job for all questiontypes.
I think that my method for outputting the question, grading and updating the state and attempt would work for the other question types because I use the quiz or questiontype functions to handle it all. The only thing that is missing from the other question types is the teacher feedback box that you mentioned. But then again, I'm not really sure
I made the 2 changes suggested by Julian and attached the updated code to this post. The changes are only in quiz_15_essay/quiz/questiontypes/essay/questiontype.php
Just downloaded your question type and playing with now, I like it
I had to add "Essay" to the $accepted_qtypes array in quiz\report\analysis\report.php to display the essay questions.. did I miss that in the readme?
Nice work mark
I ran into some issues with the essay mod in 1.4.x so would rather get it as part of the regular upgrade path than doing manual changes (which are more likely to be problematic as they really on my accuracy ;) ).
At this point, would adding in the essay modifications possibly cause problems with future Moodle upgrades? (just not sure and would rather ask before I get locked in to a non-upgradeable Moodle due to my ignorance)
Was that to protect from something else being added as 12?
I'd say so yes.
That was setting the array of question types to 12... better to set it to 50 in the interim because if in the future moodle is released with a question type 12 (and its not the essay question type) the added essay question will clash with the other question.
But what if essay becomes question type 12? Wouldn't 50 clash with that?
Yes the numbers would have to be the same... The number is ultimately used to indentify the question type I.E if set to 50 the essay question type is known as 50 in the tables (qtype)
I had to add "Essay" to the $accepted_qtypes array in
quiz\report\analysis\report.php to display the essay questions.. did I
miss that in the readme?
This was not included in the readme because I never tried it. If it works for you then thats awesome!
Yeah sort of works.. needs alot more than adding Essay to that array... Does display the essay question but also shows fields I assume shouldnt be shown Eg . Feedback and teachers comments.
Im happy to hear you didnt try it, I thought I had broken it
It works great for me.
Thanks for all the work you put into it.
Hope this answers your question,
Both the student and the teacher get to use the html editor if they like.
Also, in your previous post, you said that you have never mucked with your database before. Please, before you do anything to your database, back it up so you have something to fall back on
You see, I need to correct students' translations, and this may require me crosssing out a word here or inserting a word there, so I need to be able to edit their submissions inline, but I also like the idea of being able to correct all of the student's submissions on the same page. That way I could see 20 students versions of the same sentence at once, for example, rather than have to grade 10 different sentences for one student, and then the next student, and so forth. This is really the fastest way for me to handle this kind of correcting work because the correct answer stays fresh in my mind and that is why I find your essay quiz question to be more promising than the online assignment, as long as I can make my feedback inline.
KEY `question` (`question`)
I know how to set the primary key, but what is this "KEY" and how do I set it using php myadmin?
However, I do have a couple points regarding improvements to the essay question that need to be made. First of all, a student is shown "0" points for their grade until the teacher grades the essay. It would be better if a " -" were shown to indicate that no points had been given until the teacher has completed grading ALL of that students attempts at the essay. There should be some way also that Moodle automatically can tell when a teacher has graded all of a students essays in a particular quiz (since they can be graded essay by essay rather than student by student) and indicate to a student quickly that they have all been done. Now a student has to go to the page with all the questions to see if the teacher has reviewed each one.
I've installed the essay 1.5 and can generate essay questions but I have run into an error when I try to grade the essay:
Warning: Invalid argument supplied for foreach() in D:\MoodleDEV\MoodleDEV Sites\master\mod\quiz\regrade.php on line 202
This is on 1.5+ installed today.
I've been over and over the install instructions and don't see that I left anything out. Suggestions would be appreciated
I cannot seem to re-create your warning. I just did a cvs update of the 1.5 dev branch as well. It appears that your attempts array is not getting set properly
Sorry I couldn't help more,
I still have not found a way to correct this erro and I totally reinstalled according to the Readme. I did notice that my mod/quiz/tabs.php is different than the example in the Readme, i.e. I don't have the same 2nd line
$row = new tabobject('attempts', "attempts.php?q=$quiz->id", get_string('attempts', 'quiz'));
instead I have a line
$row = new tabobject('reports', "report.php?q=$quiz->id", get_string('reports', 'quiz'));
Thanks. I'll try the 1.6 quiz code in my 1.5 dev Moodle to see if the essay works.
I'd really like to add this in but just want to be careful that I don't cause problems with future upgrades. (I asked this above but I think the question got lost in the discussion.)
It seems you now have the quiz voodoo masters attention (Gustav), I hope this little project of yours moves forward. This is a most asked for feature.