Can the JavaScript Timer be refloated?

Can the JavaScript Timer be refloated?

Peter Ruthven-Stuart -
回帖数:21
Plugin developers的头像
I have just recently upgraded from 1.4.4 to 1.5.2, and have noticed that the JavaScript Timer in the quiz no longer floats and is stationary in the bottom left hand corner of quiz pages. I understand from another post that this may not be a problem with explorer, but it is a problem with Firefox.

Certainly, quiz takers can scroll down and check the time. However, the floating timer was far more user friendly. Is there anyway that that the timer can be 'refloated'?

I realise that one workaround to the sunken timer is to limit the number of questions per page to just one or two. This way, depending on the length of individual questions, the timer will probably be visible without scolling. However, there are occasions when limiting the number of questions on a page is not a viable option.

Any ideas will be greatly appreciated.
回复Peter Ruthven-Stuart

Re: Can the JavaScript Timer be refloated?

Brian Koontz -
Not to hijack this thread, but while we're on the subject of timers, is there any way to simply disable it?  What we're finding is that students are taking right up to the time limit to complete timed quizzes, and then complaining because the timer stopped or was slow to update due to network delays.  We are rethinking the strategy of using a timer and instead simply putting the responsibility on the student to keep their own time.

  --Brian
回复Brian Koontz

Re: Can the JavaScript Timer be refloated?

Martin Dougiamas -
Core developers的头像 Documentation writers的头像 Moodle HQ的头像 Particularly helpful Moodlers的头像 Plugin developers的头像 Testers的头像
It's an option, off by default.  See quiz settings when creating a quiz.
回复Martin Dougiamas

Re: Can the JavaScript Timer be refloated?

Timothy Takemoto -

Dear Martin,

I think that what Brian means is that it would be nice to be able to set a time limit but have not timer. As it stands, the timer is always shown during timed tests. I think.

Timothy

回复Timothy Takemoto

Re: Can the JavaScript Timer be refloated?

Martin Dougiamas -
Core developers的头像 Documentation writers的头像 Moodle HQ的头像 Particularly helpful Moodlers的头像 Plugin developers的头像 Testers的头像
It is, but what's the point of having a time limit if there's no feedback?   The time taken is always recorded anyway.

And would you want to quiz to suddenly shutdown without any warning?
回复Peter Ruthven-Stuart

Re: Can the JavaScript Timer be refloated?

Urs Hunkler -
Core developers的头像

I committed an update to the quiz CSS file "styles.php" that gives the timer a fixed position in FF. IE still uses JS positioning. You can either add the following properties to "mod/quiz/styles.php" of your Moodle installation or update "styles.php" from CVS.

#mod-quiz-attempt #timer .generalbox {
  width:150px
}
#mod-quiz-attempt #timer {
  position:fixed !important;
  top:100px !important;
  left:10px !important
}
* html #mod-quiz-attempt #timer { /*IE special for JS positioning */
  position:absolute !important
}

Please report if the changes should not work. Thank you very much
Urs

回复Urs Hunkler

Re: Can the JavaScript Timer be refloated?

Peter Ruthven-Stuart -
Plugin developers的头像
Urs,

Thank you very much for your help.

I downloaded the updated "styles.php" from CVS and installed it into my moodle. The timer still does not float in Mac Safari or Firefox sad. However, it does float in Windows IE. I'm not sure about Windows Firefox.

Given that most of my students use Windows IE, or at least have IE, this fix helps a lot. Thanks again smile.
回复Peter Ruthven-Stuart

Re: Can the JavaScript Timer be refloated?

Urs Hunkler -
Core developers的头像

Peter, you are welcome. On MAC OS X with Safari 1.3.1 and FF 1.06 the floating timer works on our Mac. Could you please check in FF with the "Web Developer Toolbar" if the added CSS properties are loaded? (Web Developer/CSS/View CSS).

Thanks for your help.
Urs

回复Urs Hunkler

Re: Can the JavaScript Timer be refloated?

Peter Ruthven-Stuart -
Plugin developers的头像
Urs,

Thank you for your help.

Your  rewritten 'styles.php' seems to be working. I guess the first time I tried, the orginal script was still saved on the server cache.

Anyway, I can now report that the timer floats in the following Mac browsers:
  • Firefox 1.0.7
  • Safari 1.3.1
  • Mozilla 1.7.6
Thanks again approve
回复Urs Hunkler

Re: Can the JavaScript Timer be refloated?

koen roggemans -
Core developers的头像 Documentation writers的头像 Moodle HQ的头像 Particularly helpful Moodlers的头像 Plugin developers的头像 Translators的头像
Hi Urs,

You sollotion for the positioning doesn't seem to work for IE. I've noticed the clock is shown in the statusbar, wich is also a good sollution, but the statusbar isn't shown in the "safe window" option of the quiz.
How do I get a floating timer in IE in the safe window version of quizes?
回复koen roggemans

Re: Can the JavaScript Timer be refloated?

Urs Hunkler -
Core developers的头像

Koen, very strange - the timer also does not work on my computer any more in IE 伤心 Some changes must have been made which kill the timer for IE now.

Did anybody change something in the quiz pages which affects the timer?

Urs

回复Urs Hunkler

Re: Can the JavaScript Timer be refloated?

koen roggemans -
Core developers的头像 Documentation writers的头像 Moodle HQ的头像 Particularly helpful Moodlers的头像 Plugin developers的头像 Translators的头像
I kept CVS in my mailbox since end of july and as far as I can tell, I can only find your changes on 10/8  and 21/9 to quiz\styles.php that can affect the timer.

There's also this change by Penny on 11/8, but I can't imagine that would affect what's on screen.

Are you sure it has ever worked on IE in 1.5?
     if(quizTimerValue == 0) {
clearTimeout(timeout_id);
- document.forms[0].timeup.value = 1;
- document.forms[0].submit();
+ document.forms['responseform'].timeup.value = 1;

+ document.forms['responseform'].submit();

回复koen roggemans

Re: Can the JavaScript Timer be refloated?

Urs Hunkler -
Core developers的头像

Koen, I changed the CSS because the timer was only floating in MSIE and not in Firefox. I tried if it works in MSIE and it did.

I'll investigate.
Urs

回复koen roggemans

Re: Can the JavaScript Timer be refloated?

Urs Hunkler -
Core developers的头像

Koen, thanks for checking the changes. It looks as if I had the working MSIE version still in the cache when I double checked my changes the last time 伤心 Now I optimized the JavaScript and the CSS to give Firefox and Opera the same behavior as MSIE. It's in CVS.

Urs

回复Urs Hunkler

Timer slows and stops on an oldish mac and Safari

Timothy Takemoto -

Different to this thread but there seems to be a lot of timer related posts here...

One of my students uses
Power Mac G4 (PCI Classic)
PowerPC G4, 400MHz
With OSX and a recent download of Safari. The quiz timer runs slow and stops. Is this because the machine is old and slow? Can anything be done other than to say "get a new personal computer"? Or is the above not so old?

Tim

回复Peter Ruthven-Stuart

Re: Can the JavaScript Timer be refloated?

Dawn Wright -

We've are just upgrading to 1.5.2 and I too noticed the countdown timer was no longer floating but stationary at the bottom of the quiz.  Having it floating and visible at all times seems to be better.

But my question has to do with the way the timer is working in 1.5.2, i.e. does it still shut down the quiz at time expiration and give the student a "0" score if they have not yet submitted their exam?  We have had several students in our version 1.4.4. become extremely upset when that happened on a three hour exam and they got no credit for their work. Is there a way to have the quiz shut down but save the work they have at that point?

回复Dawn Wright

Re: Can the JavaScript Timer be refloated?

Martin Dougiamas -
Core developers的头像 Documentation writers的头像 Moodle HQ的头像 Particularly helpful Moodlers的头像 Plugin developers的头像 Testers的头像
I don't know if it saves the current state of the quiz but I agree it should ... can someone check this definitively?
回复Martin Dougiamas

Re: Can the JavaScript Timer be refloated?

Jean-Marc Hilson -

Hello,

It does.

The current state of the quizz is saved when the timer is closed.

BUT if a student click on 'Continue' without having clicked on 'Save' before, it DOES NOT save his answers!

It should be very usefull to hide this button 'Continue'!

JM

回复Jean-Marc Hilson

Re: Can the JavaScript Timer be refloated?

Dawn Wright -

May I restate your post to make sure I understand?

In 1.5.2, if a student does not "Submit his quiz for grade" before the countdown timer expires, the student's answers (quiz state) are saved so that the student will/can get credit for the work completed.

When we rollout version 1.5.2, we are planning on taking full advantage of the ability to segment our 100 question final exams into multiple pages so that the "Save with out submit" button is frequently presented to and I hope used by our students. When you mention "Continue" causing the state of an exam to not be saved if the timer expires, I hope you are not referring to the "Save without submit" button.

I do agree with Martin in that we do want to have the quiz automatically close when the time limit (3 hours in our final exam) expires.

thanks

dawn