Close Quiz Time enabling itself

Close Quiz Time enabling itself

by Carly Born -
Number of replies: 9
We seem to be having a strange problem. I've used the Hot Pot module to import a large number of exercises into several sections of a course. In all three cases, the exercises seemed to have picked up a open and close time and enabled it, even though the instructor did not do this intentionally and the original source course does not have these options set.

Even going in and trying to disable the open and close times by hand does not work, they just go and enable themselves again. I can change the close date, which I have done. But I don't understand the behavior at all and am hoping that someone can help me out.

We are using Moodle 1.8.3 on PHP 5.2.5. Any help or suggestions would be appreciated.
Average of ratings: -
In reply to Carly Born

Re: Close Quiz Time enabling itself

by Gordon Bateson -
Picture of Core developers Picture of Peer reviewers Picture of Plugin developers
Hi Carly,

> the exercises seemed to have picked up a open and close time and enabled it

As far as I know, when you add several HotPots at once the open/close times that are set on the "Adding a Hot Potatoes Quiz" are used for all HotPots that are added. You seem to be reporting a different behavior so I will look into that.

> trying to disable the open and close times by hand does not work,
> they just go and enable themselves again

I understand this to mean that you cannot disable the open and close time on a HotPot. I will certainly need to investigate that !

Thanks for the Moodle/PHP info.

Gordon
In reply to Gordon Bateson

Re: Close Quiz Time enabling itself

by Gordon Bateson -
Picture of Core developers Picture of Peer reviewers Picture of Plugin developers
Hi Carly,
I checked the behavior of the HotPot module in Moodle 1.8 and it behaves how I thought it did, namely, if you do not enable the open/close dates, then they will not be applied to the HotPots that are added to the course.

For your reference, I have attached a screen shot of the settings I used when I added the HotPots. Notice that the "Enable" check boxes next to the dates are NOT checked. This means the dates are NOT enabled.

Perhaps there is some confusion because in some other activity modules in Moodle 1.8 the dates commonly have a "Disable" checkbox, so you check the box to disable the date. In contrast the HotPot module has an "Enable" checkbox.

Maybe when you originally added the HotPots you checked the box next to the dates thinking this would disable the dates, but in fact you were inadvertently enabling the dates. Is that a possibility?

regards
Gordon


Attachment adding.hotpot.chain.from.folder.jpg
In reply to Gordon Bateson

Re: Close Quiz Time enabling itself

by Carly Born -
I can understand why you might think this, but it's not the case. We discovered the problem because the students in the class could not do the exercises (as they were closed already), not because I misread the screen.

Actually, our Moodle admin as found and fixed (he believes) the problem. I'll get him to post his solution here.

Thanks for your response, though, it's nice to see that someone is listening!
In reply to Carly Born

Re: Close Quiz Time enabling itself

by Matthew Bockol -
Hi Folks,

I'm the Moodle admin Carly mentioned. Below is the patch I used. The mdl_hotpot table has two fields:

timeopen
timeclose

These are populated with a unix epoch timestamp when the user sets an open and close time.
If the user doesn't set that time, these remain zero.

In the code below, the $form->timeopen was being rewritten when the timeopen/timeclose values were zero.
This gave us a 1970 start and end time whenever we reloaded the page, even though the database had zero set.

The patch checks explicitly for $form->timeopen being equal to zero, and preserves it.


Matt


--- /home/mbockol/mod.html-orig 2008-04-17 11:23:51.000000000 -0500
+++ mod-fix.html 2008-04-17 11:25:09.000000000 -0500
@@ -119,9 +119,11 @@

 :
 timeopen && $course->format == "weeks") {
+ if (!$form->timeopen && $form->timeopen != 0 && $course->format == "weeks") {
 $form->timeopen = $course->startdate + (($form->section - 1) * 608400);
 }
+
+
 print_date_selector("openday", "openmonth", "openyear", $form->timeopen);
 print ' - ';
 print_time_selector("openhour", "openminute", $form->timeopen);
@@ -133,9 +135,12 @@

 :
 timeclose && $course->format == "weeks") {
+ if (!$form->timeclose && $form->timeclose != 0 && $course->format == "weeks") {
 $form->timeclose= $course->startdate + (($form->section) * 608400);
 }
+
+
+
 print_date_selector("closeday", "closemonth", "closeyear", $form->timeclose);
 print ' - ';
 print_time_selector("closehour", "closeminute", $form->timeclose);
In reply to Matthew Bockol

Re: Close Quiz Time enabling itself

by Gordon Bateson -
Picture of Core developers Picture of Peer reviewers Picture of Plugin developers
Aha! Thank you Mathew.

When I switch the course format to "weeks", my HotPot module behaves exactly as you describe. Sorry for my earlier misunderstanding.

Strange thing is I have no recollection whatsoever of writing that code. It seems to have been added to the HotPot module in Moodle 1.6, 1.7 and 1.8. Very strange. I don't think we need it, so I will remove it.

Moodle 1.9 and later are not affected because they generate the forms in a different way - using the "moodleform" object.

The updated scripts for Moodle 1.6, 1.7 and 1.8 should be available from the Moodle downloads page and CVS soon. "Soon" used to mean "within 24 hours", but I think there is a different system now whereby changes to Moodle core code, of which the HotPot module constitutes a small part, have to be approved at a Tuesday meeting, so "soon" might mean "next week".

If you are in a hurry you may be able download the latest HotPot module for your Moodle from my server.

best regards
Gordon

In reply to Carly Born

Re: Close Quiz Time enabling itself

by Andy Wallis -
We have had the same problem and I reported on it earlier in the link you copied elsewhere. We run Moodle 1.8.2+ on an IIS server, PHP 5.1.6.

It's not that big of a deal. It's just that every time one updates a quiz, the "enable date" boxes get checked automatically upon opening the page. One has to remember to uncheck them when saving the updated page.

Strange, but not a deal breaker. I am glad to see our campus isn't alone too. smile

I'm hoping the problem will disappear when we install 1.9. We may also move to a linux server with apache, which I hope will solve this and a few other minor issues.
In reply to Andy Wallis

Re: Close Quiz Time enabling itself

by Carly Born -
It was actually a big deal here. Our profs are new to using HotPot exercises in Moodle and aren't all that adept at the finer controls available to them yet. I created the Hot Pot exercises for them and showed them how to import them into their courses. So they and their students were quite confused.

Like I said, we seem to have fixed the problem, so as soon as my Moodle admin gets a few moments, I'll get him to post the fix.