Essay question in 1.6

Essay question in 1.6

by Gustav W Delius -
Number of replies: 47
I have added the essay question type contributed by Mark Nielsen to Moodle 1.6dev. Mark documented his code well and it looks well written.

I think we should test and develop the essay question type in Moodle 1.6dev for a while before possibly deciding to port it back to Moodle 1.5. One issue to discuss for example is whether it would be desirable to share code and appearance between the essay marking interfaces in the assignment module and the quiz module.

I only made small changes to Mark's code. For example I renamed regrade.php to grading.php because 'regrading' is too easily confused with the automatic regrading facility. I also changed the tab to "Manual grading".
Average of ratings: -
In reply to Gustav W Delius

Re: Essay question in 1.6

by Genner Cerna -
good, as soon as it's bug free and can easily be integrated to 1.5+, so much the better.
In reply to Gustav W Delius

Re: Essay question in 1.6

by N Hansen -
You know, another thing you might want to fix is that the grade essays tab appears in quizzes that don't even have any essays. It seems to me that should only appear when there are actually essays in the quiz.
In reply to N Hansen

Re: Essay question in 1.6

by Gustav W Delius -
Well, I have renamed the page to "Manual grading" because in future it is supposed to work also for other question types. I expect this will be implemented before the release of Moodle 1.6.
In reply to Gustav W Delius

Re: Essay question in 1.6

by Andrew Miller -
Any further thoughts on releasing this in a 1.5.x release? I have a couple teachers who would love to see it out officially before 1.6 (especially given that 1.6 won't be out in time for the upcoming fall semester) . smile
In reply to Andrew Miller

Re: Essay question in 1.6

by Andrew Miller -
Bump.... smile (on the question above)
In reply to Andrew Miller

Re: Essay question in 1.6

by Martin Dougiamas -
Picture of Core developers Picture of Documentation writers Picture of Moodle HQ Picture of Particularly helpful Moodlers Picture of Plugin developers Picture of Testers
New features of this size do not and will not go into the current stable branch. However, someone could package it as an optional plugin you could add yourself.
In reply to Martin Dougiamas

Re: Essay question in 1.6

by Andrew Miller -
I see....thanks for the info.

There is actually a plugin for this for 1.5 however I was concerned that adding it would curtail my ability to upgrade 1.5.x to 1.6 (I'd asked this question in the 1.5 quiz plugin thread and never got a response sad ). If I add it to 1.5 and then am not able to smoothly upgrade to 1.6 (without losing the info), I'll be in worse shape than if I hadn't added it (I have teachers who really want it....but I'm betting they'd be quite unhappy if they put a lot of time in and then had to redo those questions).

Thanks.
In reply to Martin Dougiamas

Re: Essay question in 1.6

by James Robertson -

That would be great!  I understand that substantive feature additions don't go into the current stable branch, but I suspect that the number of "someones" that could package the planned 1.6 version for 1.5 is fairly small and that they are all rather busy.  So which would you tend to recommend?

  1. Waiting to see if someone is able to do this packaging
  2. Using Michael Penney's 1.5 essay question

A related question: is Michael Penney's 1.5 essay question an earlier version of the planned 1.6 essay question (hence one could expect that upgrading to 1.6 will go smoothly) or is it an independent and different approach?  If independent, is it apt to lead to problems when changing from it to standard 1.6 essay questions?

I don't know how much of this is a Martin, Gustav, or Michael question -- perhaps all three at once and others as well.  I do know that I would like to move ahead with essay questions for next term, but not if it is going to cause me grief later on.  I realize no one can tell for sure which is the best option or what the upgrade to 1.6 will be like.  But I don't have any basis at all for choosing and would appreciate any information & recommendations that can be given.

Thanks,

Jim.

In reply to James Robertson

Re: Essay question in 1.6

by Jean-Michel Védrine -
Hello,
Well I'm surely not a Moodle quiz guru, but contributing the detailed responses report plugin, I learned some things on the quiz code and structure, so I think that I can easily repackage essay 1.6 for 1.5x (in fact I was already in the process to do it because I need it for the next accademic year in 15 days).
The files are ready but I still have some testing to do because I want to be sure everything is OK not to mess other Moodle users database.
I think all will be ready in 2 or 3 days.
In reply to Jean-Michel Védrine

Re: Essay question in 1.6

by Tim Allen -
I think the 1.5 version is already available in another thread, unless I have missed something (it is almost 2 a.m. here after all! wink)
In reply to Tim Allen

Re: Essay question in 1.6

by Jean-Michel Védrine -
Yes there is a 1.5 version available but here I speak about backporting to 1.5x the 1.6dev version with all the changes that were made when essay was added to CVS.
The idea is to have a parallel developpment of the 2 versions to ease the upgade process to 1.6 when it will be available for Moodle users (including me grand sourire) wanting to use essay questions now.
It is nearly done now, I have also added the code to enable group view and improved the display of essay questions in the detailed responses report.
To Gustav:
1) I will post later the same improvements for the 1.6dev version.
2) I think that bug 3872 is only in the 1.6 branch because I can't reproduce it in 1.5x. Most probably a bug in grading.php. I will look into it if I can.
In reply to Jean-Michel Védrine

Re: Essay question in 1.6

by Eugene Ritter -
If you do finish  porting the 1.6 dev essay functionality to 1.5 please post it. I'm very  interested  in introducing it for the fall semester and would be happy to test it or help in anyway possible as well.
In reply to Jean-Michel Védrine

Re: Essay question in 1.6

by James Robertson -

Wow, thanks! Please let us know when it's ready to begin testing and how to retrieve it.  Thanks also for the detailed response plugin.

Jim.

In reply to James Robertson

Re: Essay question in 1.6

by Andrew Miller -
This is precisely my question (but expressed much better than I did).

Thanks much to jean-michel for looking at repackaging the 1.6 essay question as a 1.5 plugin...I'll keep an eye on this topic.

Thanks again.
In reply to Andrew Miller

Re: Essay question in 1.6

by Jean-Michel Védrine -
Hello,
here is my version of the essay quiz questiontype for Moodle 1.5x strictly conform to the version in Moodle 1.6 CVS.
I will update this package when changes will be made to CVS
The differences are :
- all the changes needed to take into account differences between quiz 1.5 and quiz 1.6 (mainly change in table fields names)
- I enabled the group selector and view
- I improved the display of essay questions in the detailed responses report plugin (only student response is displayed and truncated to 40 chars as they can be very long)
the last 2 modifications will be merged with the 1.6 version very soon, I hope.

For users of a previous version of quiz_15_essay, here is how to upgrade to this version.
a) if you used 12 as the qestiontype id for essay questions
(that is, if your mod/quiz/localib.php file contain the line define("ESSAY",        "12");)
- delete the mod/quiz/regrade.php file from your server (this file wil be replaced by the mod/quiz/grading.php file later)
- in mod/quiz/tabs.php change the line :
$row[] = new tabobject('manualregrade', "regrade.php?quizid=$quiz->id", get_string("gradeessays", "quiz"));
to:
$row[] = new tabobject('manualgrading', "grading.php?quizid=$quiz->id", get_string("manualgrading", "quiz"));
- edit lang/yourlang/quiz.php to replace the old defines for the essay questions with the new ones from langlines_en.txt
- upload or copy all the files of the new package quiz subdirectory to the proper place on your server

b) if you used another number than 12 as the questiontype id for essay question
(for instance your mod/quiz/localib.php file contain define("ESSAY",        "50");)
You need to follow all the steps of the above procedure and additionnaly run this mysql statement on your database :
(!!! IMPORTANT : DON't FORGET TO REPLACE prefix WITH THE TABLE PREFIX OF YOUR MOODLE DATABASE !!!)
UPDATE prefix_quiz_questions SET qtype ='12' WHERE qtype ='50';
Of course replace 50 with whatever you used for essay qtype id.

Note : Be cautious ! Of course I tested this package, but I suggest not to install it right now on your production server. Wait a few days that some other Moodle users tested it, just to be sure everything is OK.
In reply to Jean-Michel Védrine

Re: Essay question in 1.6

by James Robertson -

Wow, this is really something cool!  It installed just fine, your instructions were easy to follow.  One suggestion: on the two mysql commands, it will help idiots like myself to be told they can copy and paste the commands in the PhpMyAdmin SQL box (my son pointed it out to me).  I asked him because I was uneasy about typing the whole string without errors.

So far it seems to work well.  On first preview, I had an "Add Block" box show up in the upper left, which shifted the entire upper display to the right.  It gave two choices in the drop-down: HTML and Quiz Results.  Later I didn't see it and haven't been able to produce it again.  Other than that, everything looks fine on initial testing (1 short quiz and 2 dummy students).

Thanks again,

Jim.

In reply to James Robertson

Re: Essay question in 1.6

by James Robertson -

The "Add Block" box appears when the "Blocks Editing" button is selected.  If a Quiz Results block is selected and configured, it displays summary quiz results on the Quiz Info page for students and instructor.  I can't see what selecting an HTML block does.

Jim.

In reply to Jean-Michel Védrine

Re: Essay question in 1.6

by James Robertson -

Two suggestions and a bug (I realize you are just repackaging, but I don't know where else to put this):

1. Bug: My test quiz had 3 essay questions and 1 short answer.  On completion (as a student) I was given a score of 25%.  The essay questions were shown as "Incorrect."  There was no indication to the student that there were unscored questions.  I presume this is the current design.  The score should indicate percentage based on the graded questions and also show the number of graded and ungraded questions.  I consider this a bug, since it is misleading as it stands and will certainly increase student anxiety.  If something like this is not already planned, let me know and I will enter it in the bug tracker.

2. Suggestion: Could essay question stats be added to item analysis (divided into 100%, partial, 0% rather than different responses).

3. Suggestion: The HTML editior is displayed for each student & each question when grading.  It works fine on my small test quiz on localhost, but I wonder about display time on several students & questions on a production site.  I am relatively new and have not had trouble with the HTML editor in grading, but apparently there can be problems under some conditions.  Are there any alternatives that would provide a quicker interface (e.g., some of the assignment grading discussions).

Thanks,

Jim.

In reply to James Robertson

Re: Essay question in 1.6

by Michael Penney -
3. Suggestion: The HTML editior is displayed for each student & each question when grading.  It works fine on my small test quiz on localhost, but I wonder about display time on several students & questions on a production site.  I am relatively new and have not had trouble with the HTML editor in grading, but apparently there can be problems under some conditions.  Are there any alternatives that would provide a quicker interface (e.g., some of the assignment grading discussions).

I would highly second this, the HTML editor is a nice tool, but highly unstable on some browsers when displayed more than a few times/page, and not displayed at all on others. I'd suggest that it not be enabled by default, and that teachers can enable it on a per/quiz or per/question basis.
In reply to James Robertson

Re: Essay question in 1.6

by James Robertson -

Reported #1 in Aug 17 11:21 pm post as bug 3936 - Essay Question used in score before grading.

Michael, thanks for your comment on #3, glad to know someone shares my concern.  Is there a process for getting it discussed officially?

Jim.

In reply to James Robertson

Re: Essay question in 1.6

by Jean-Michel Védrine -
Hello James,
I completely agree with your 3 remarks.
#1 : this is a real problem with the actual state of the essay questiontype because it was made as a plugin, with minimal impact on Moodle originals files. Now that it is added to Moodle 1.6 we should modify the quiz module so that it knows about ungraded questions and produce a more exact display.
Of course this will left the problem for 1.5x because i will have to release the same changed files at each new version of these files !!!
#2 : as I studied the iten analysis plugin to correct some problems some weeks ago, I will look into that. Your idea to classify responses seems interesting
#3 : I completely agree. But I must admit I never looked at how htmarea is activated or deactivated for a text area in Moodle. In fact I know nearly nothing about htmlarea. I found in the forums a message about how to convert a textarea to use the editor but no message about how to activate or deactivate the editor. I will look in the code to see if I can found the necessary informations.
Do you think it should be an optional setting at the quiz level or at the question level ?
In reply to Jean-Michel Védrine

Re: Essay question in 1.6

by James Robertson -

Hi Jean-Michel, thanks for looking at these. 

With #1, I would expect it might be possible to add a block of code with a begin and end comment that gets copied into whatever the current display file is.  One already has to copy lines of code into some files with this download, so it isn't asking much to copy some code into another file or two (assuming the required code can be restricted to one or two places).  That way it is up to the user to maintain upgrades through versions of 1.5x if the copied-in lines remain the same (which they likely would through 1.5x).

Thanks for looking at #2.

As for #3, I am having a hard time visualizing whether quiz level or question level would be better.  Initially I would think question level.  But I would be interested in others' opinions, espectially Michael Penney's (since he seems to have dealt with this issue a lot).

Jim.

In reply to James Robertson

Re: Essay question in 1.6

by N Hansen -
As for #3, I am having a hard time visualizing whether quiz level or question level would be better.  Initially I would think question level.  But I would be interested in others' opinions, espectially Michael Penney's (since he seems to have dealt with this issue a lot).

At the quiz level, please, or even at the site or course level! I am using this for literally hundreds of questions in a course (htmlarea the only way I can provide the formatting necessary to my students to actually be able to answer the questions) and to have to check a box for every question to enable it would be a big hassle. I would prefer to have htmlarea by default, but don't mind having to check a setting a couple times, but every time will be too much. Html area works with Firefox and IE (except the stupid IE5 on Mac). Since that covers the vast majority of browsers out there and even if someone doesn't use one of those browsers regularly they probably have one of them on their machine anyway, I don't see any reason to not expect them to use a compliant browser. And moreover, if you are having trouble with the loading of too many areas on a page, then it is very easy to add page breaks after only a couple questions.

In reply to N Hansen

Re: Essay question in 1.6

by Michael Penney -
Html area works with Firefox and IE

Actually, HTML area still (seemingly) randomly fails in IE on Windows (in a variety of text entry areas), which is why it may not be a good idea to rely on it for something important like a quiz essay question.

However, I think defining whether to use it in a quiz at the quiz level is fine, so long as it is off by default.

However, it is probably more important to get backup and restore working and a few other interface issues resolved so essay can go  in 1.6--if it can't go into 1.6 then whether it uses html area or not is pretty much a moot point.
In reply to James Robertson

Re: Essay question in 1.6

by James Robertson -
Thanks for your replies -- quiz level sounds fine to me.  And thanks Michel for putting all this in perspective -- getting backup/restore and other structural issues settled so it can be released with 1.6 is the important thing.
In reply to James Robertson

Re: Essay question in 1.6

by Michael Penney -
I know our 1.5 version in CVS/contrib you can back up the questions. I think it also backs up attempts, though with this disabled globally in quiz, it is hard to tell.

IMO, if quiz still can't backup some attempts for some question types, it would be better let it backup the attempts for the ones it can, and print a message about the ones it can't.
In reply to Michael Penney

Re: Essay question in 1.6

by Dawn Wright -

Michael & Mark

I guess I'm a bit confused. I'm trying to get a 1.5.2 up and running and I need to have essays in our quizzes.  It sounds as if I should use the essay 1.5 version in Contrib and we will be able to back up and restore courses with the essays in the quizzes. Am I understanding this correctly?

Thanks for all

In reply to Jean-Michel Védrine

Re: Essay question in 1.6

by Dawn Wright -

HI Jean-Michel

I just upgraded my development Moodle from 1.4.4+ to 1.5.2+ and installed your 1.5x essay question. Initially I was unable to get it to work properly but I discovered I followed your instructions too literally, i.e. I created the new database tables replacing "prefix_quiz_essay" with "mdl_15_quiz_essay" . After inspecting my database tables more closely I found all the other quiz tables named "mdl_15quiz... " and realized the underscore after "prefix" was not required.  After taking out the extra underscore, the essay question began to work.

Anyway, this is a great addition and I appreciate your work on this .

dawn

In reply to Dawn Wright

Re: Essay question in 1.6

by James Robertson -

I think the prefix usually ends with an underscore, for example I use the default "mdl_".  So I used "mdl_quiz_essay" and it worked fine.  But if you have a prefix defined that does not end with an underscore ("mdl_15"), then it could become confusing.  I guess the instruction should say "...don't forget to replace prefix_ with..."

Jim.

In reply to Jean-Michel Védrine

Essay backup in 1.5

by Jaroslav Šeděnka -
Is there a plan to handle backup/restore of essay questions in 1.5? The two additional tables and essay questions are not backed up with this version of quiz_essay. I'd really appretiate backporting of the backup procedure as well.
In reply to Jaroslav Šeděnka

Re: Essay backup in 1.5

by Dawn Wright -

Jaroslav

Did you upgrade from a 1.4.x using essay? I wonder if adding these tables would allow me to see and edit the 1.4 essay questions that were in my exams before I upgraded ot 1.5?

In reply to Dawn Wright

Re: Essay backup in 1.5

by Jaroslav Šeděnka -
We did not, this is the first time we're trying the essay questions. I don't have a clue how the 1.4 essay question looked like so I can't help mixed.
In reply to Jaroslav Šeděnka

Re: Essay backup in 1.5

by Jean-Michel Védrine -
Unfortunately there is currently no backup/restore code for essay questions even in Moodle 1.6dev sad so we don't need to backport but to code wink
In reply to Jean-Michel Védrine

Re: Essay backup in 1.5

by Erich Nielsen -

I was about to write a posting on this issue, then I discovered this thread.

What to do, then?

How is the easiest way to restore a backup of quizes with essay?

Erich N

In reply to Jean-Michel Védrine

Re: Essay backup in 1.5

by Gustav W Delius -
Yes, the essay question type needs someone to work on it. I had added it to CVS so that it could be developed further. Unfortunately there has been no work on it since. As it is currently it can't be included in Moodle 1.6 final.
In reply to Gustav W Delius

Re: Essay backup in 1.5

by Mark Nielsen -
Backup/Restore now works with essay questions in 1.6.  In the process of doing this, I fixed several other bugs in the quiz restore code.  NOTE: restoring user attempts is not supported yet in quiz, please refer to this post for turning it on http://moodle.org/mod/forum/discuss.php?d=30923.  With that said, I don't know if restoring user attempts for all question types actually works.  I just tested for essay questions.

As for record deletion, the quiz_essay table gets cleaned up on course deletion like all of the other question types.  quiz_essay_states table DOES NOT get cleaned up but nor does quiz_rqp_states (correct me if I'm wrong).  So, I'm holding off on that till quiz_rqp_states actually does it as well.

Cheers,
Mark
In reply to Mark Nielsen

Re: Essay backup in 1.5

by James Robertson -

Is this to a point where it could profitably be added to the 1.5 repackaging?  Or would we be better off using Michael Penney's essay question?  My initial preference has been for the repackaged 1.6 version since I anticipate a smoother transition to 1.6 using it.  But I'm already using other Humboldt contributions and they seem pretty stable, so I'm not opposed to using their essay question if it is more stable.

Jim.

In reply to James Robertson

Re: Essay backup in 1.5

by Jean-Michel Védrine -
Yes, I will add mark's work to my repackaging of 1.6 essay question for Moodle 1.5x. It is in fact already done and I am testing it. Seems to be working like a charm, including restoring user's attempts grand sourire (of course, this is if you suppress the 2 lines blocking the restore of user's attempts in the current Moodle version)
Should be ready in a day or 2.
To my best knowledge what you call "Michael Penney's essay question" and Mark Nielsen's work that has been included in Moodle 1.6 CVS are the same thing ... But maybe I am confused.
Note: I am only backporting code for 1.5x but I wrote no code for the essay question. I only take into account the (few) differences between quiz 1.5 and 1.6.
As you said the aim of this work is to ease transition for Moodle users wanting to use essay questions with Moodle 1.5x when they upgrade to 1.6 latter.
In reply to Jean-Michel Védrine

Re: Essay backup in 1.5

by Michael Penney -
One thing that would be nice to have is a way to suppress the 'incorrect' statement when a student completes an essay question.
In reply to Jean-Michel Védrine

Re: Essay backup in 1.5

by James Robertson -

Wonderful!  Thanks Mark for your work and Jean-Michel for repackaging.

To my best knowledge what you call "Michael Penney's essay question" and Mark Nielsen's work that has been included in Moodle 1.6 CVS are the same thing...

So there aren't two versions of quiz essay floating around, just one?  That makes choosing a lot easier wink.

In reply to James Robertson

Re: Essay backup in 1.5

by Jean-Michel Védrine -
Hello,
Here is a new version of the essay question repackaged for Moodle 1.52 (it has been tested with Moodle 1.52 and Moodle 1.52+ but not with previous versions so people still using an older version of the 1.5 branch should make some tests before upgrading a production server)
The difference with the previous version given in this thread is the inclusion of Mark's code for backup/restore. Unfortunately I didn't had time to finish other modifications suggested here. With the begining of the accademic year, September is certainly the worst period for personal projects triste.
Please note that I resisted the tentation to comment the 2 lines:
notify("Restoring quiz without user attempts. Restoring of user attempts will be implemented in Moodle 1.5.1");
        return true;
in the mod/quiz/restorelib.php to activate restore of user's attempts, so it is NOT enabled in this version. It is up to you to decide if you want to do it.
But like Mark I made some tests, and has no problem restoring user's attempts for essay questions.
Short note for people upgrading from the previous version:
If you have already installed the version of quiz_15_essay I gave in this thread, you only need to copy the 3 files restorelib.php, backuplib.php and lib.php from this package over the existing files in mod/quiz. Of course you should backup old files before.
In reply to Jean-Michel Védrine

Re: Essay backup in 1.5

by James Robertson -
Got it!  Thanks very much -- September is indeed a busy time, so I'm grateful you were able to find the time to add Mark's backup/restore.
In reply to Mark Nielsen

Re: Essay backup in 1.5

by Gustav W Delius -
Mark, thank you very much for your work on the essay question backup and restore code.
In reply to Gustav W Delius

Re: Essay backup in 1.5

by Jean-Michel Védrine -
Gustav,
You should commit to the 1.5 branch the bugs corrections commited by Mark in restorelib.php. Not the essay code but just the bugfixes.
In reply to Gustav W Delius

Re: Essay question in 1.6

by Rob Hindman -
Have there been any updates or new developments with regard to this contribution?  If I'm seeing the thread correctly, the last posts were in September.  Does the version posted by jean-michel vedrine last September still work well with the current 1.5.3+?