Time on lesson display

Time on lesson display

by Tom Wilson -
Number of replies: 19
I am using 1.6+ for my courses and wonder if anyone may have a solution for the this time on lesson display issue. My students are required to spend a minimum amount of total time for each lesson, but have difficulty judging when the minimum time is about to be met. They can use their browser to refresh the timer but the display of elapsed time appears above the main text box, requiring scrolling back up and causing a lot of frustration. I am including a basic illustration of the problem in this flash demo. Any help is appreciated. Tom W.
Average of ratings: -
In reply to Tom Wilson

Re: Time on lesson display

by Art Lader -
Don't know how for sure to help you, Tim, but you are right.
It would be useful to have the timer displayed in the middle
and at the bottom of the page, too. Or floating as the page
is scrolled.

In lesson/view.php, down around line 560, there is a bit of code
that looks to me like it makes the timer show up. Maybe a solution is
just a matter of reproducing that block of code in a couple of
additional places. Anyone know if that's the answer?

Reagrds,
Art




Attachment timer-stuff.jpg
In reply to Art Lader

Re: Time on lesson display

by Tom Wilson -
Hey Art -that's a great place to start. Anybody else have ideas on changing the time display positions? I will pass this along to my webmaster and see what she thinks. Coming to Albuquerque? Hope to see you there.
Regards,
Tom
In reply to Art Lader

Re: Time on lesson display

by Asana Draper -

We are using Moodle 1.9 and have timers on in Lessons.  Students are required to spend a certain amount of time in each lesson before moving on.

Our problem is....we have tried several ways to include the timer at the bottom of the page as well so that students do not have to scroll back up to the top of the page to view Time Remaining.  We can get it to display a 2nd time if we duplicate code in the lesson/timer.js file, but we cannot control where it displays.  We have tried several things:

  1. adding duplicate code in the lesson/view.php page (used echo statement that Mark included in the top of the timer.js page and just changed reference from liveclock_lite.js to timer.js).  This made the timer show up below the Continue button in lesson/view.php, but removed it from the right column under the Time Remaining header.
  2. adding a div to the timer.js page itself, but were only able to control the position somewhat.  Couldn't seem to move it to the bottom of a lesson's right hand column where it is most needed.
  3. adding a style to for the above div to the standard/styles_layout.css.  Still cannot control the exact positioning of the second timer.

Any feedback about the best way to include a second instance of the time remaining timer to a lesson would be greatly appreciated!

See attached screenshot or let me know if you need more details.

Attachment timerscreenshot.gif
In reply to Asana Draper

Re: Time on lesson display

by Joseph Rézeau -
Picture of Core developers Picture of Particularly helpful Moodlers Picture of Plugin developers Picture of Testers Picture of Translators
Hi Asana,
The display of the timer in the Lesson module is not as good as that in the Quiz module. Here is a working solution involving only modification of your CSS stylesheet. Add the following lines at the end of any of the CSS files of your current moodle theme. The timer will "float" vertically as the student scrolls down the window and will always be positioned within view. You can play with the "top" parameters to suit your own needs.
#mod-lesson-view .clock.sideblock .header { position:fixed; top:200px; } #mod-lesson-view .clock.sideblock .content { position:fixed; top:220px; }
Joseph
Attachment image00.jpg
Average of ratings: Useful (1)
In reply to Joseph Rézeau

Re: Time on lesson display

by Asana Draper -

THANK YOU - THANK YOU - THANK YOU!

That works great for us.

In reply to Joseph Rézeau

Re: Time on lesson display

by Chris Collman -
Picture of Documentation writers
Hi Joseph,
I want students to remain in the lesson for at least 10 minutes and score 70% before moving on to the next Lesson.

The above is a count down timer which would work for me if it did not cut off their answers.

How can I show students how long they have been in the lesson for purposes of the next lesson's dependency setting?

Or will have have to find the code in Lesson and disable the cut off "feature" but still show the timer? My site's policy is to allow students to stay in a lesson as long as they want, so changing the site wide code is not a big deal.

Any hints? Will something like Quiz user with unlimited time role work??? I will run off to permissions to see what is there for Lesson. Thanks Chris
In reply to Chris Collman

Re: Time on lesson display

by Joseph Rézeau -
Picture of Core developers Picture of Particularly helpful Moodlers Picture of Plugin developers Picture of Testers Picture of Translators
Hi Chris,
If I understand you correctly you want to display a countdown timer but you don't want it to have any effect when it reaches zero? If that is what you want I will try to find a hack.

Joseph
In reply to Chris Collman

Re: Time on lesson display

by Greg Smith -
Hello Chris,
As you suggest, just commenting out the lines that terminate the lesson when it times out is the simplest.
in our moodle version 1.9.1 it is
line 454 and 455 in mod/lesson/view.php which read :
redirect("$CFG->wwwroot/mod/lesson/view.php . . .
die; // Shouldn't be . . .

(since the redirect command is no longer active, it IS necessary to comment out the "die;" command as well.)

If the timer is not on, these lines are never executed and it is a non-issue. If there is another lesson where they should be thrown out, then an if statement is needed around the 2 ilnes.
Greg


ps
in ver. 1.8, I believe it is just line #447 (there is no "die;" line in that ver. of mod/lesson/view.php)
In reply to Chris Collman

Re: Time on lesson display

by Greg Smith -
Chris,
I just noticed that the same 2 lines (or 1 line) are also in

mod/lesson/action/continue.php and may also need to be commented out
the "same" 2 lines 36-37 like this:

// redirect("$CFG->wwwroot/mod/lesson/view.php ...
// die; // Shouldn't be ...
(either // or # will comment out the remainder of a line)

A, related, big issue for us is that the count-down lesson timer does not give a person credit for time spent in a lesson - it does not accumulate the time. No university I know of, nor any state accrediting agency with commercial vendors, when requiring a certain amount of time be spent in an on-line course, demands that any particualr lesson (each and every one of them!) be spent "all at once" in one session. (this is not a test, this is lesson material) However, that is what is happening the count-down timer is programmed to demand the full time be spent all at once or it is not counted at all. It is causing a great deal of frustration among our students.

Here is hoping for some teacher responses "from the field" on this.
I will start a new topic on it soon - if someone else does not sooner.
Hopefully, someone has delt with this and come up with a solution or,
it is already planned for the next release. ... (?)

In reply to Greg Smith

Re: Time on lesson display

by Joseph Rézeau -
Picture of Core developers Picture of Particularly helpful Moodlers Picture of Plugin developers Picture of Testers Picture of Translators

Greg > No university I know of, nor any state accrediting agency with commercial vendors, when requiring a certain amount of time be spent in an on-line course, etc.

Any institution which requires its students to "spend a certain amount of time in an on-line course" should be told that this requirement is meaningless (on its own). A student may well be logged-in in an online course for hours on end and be surfing the Web in another window at the same time, or play games, have a meal, etc.

I am truly amazed at the complete ignorance of such matters in those administration people who should know better. This is not only true of online courses, of course and a student who physically attends a certain number of hours of a course may be sitting at the back of the room, daydreaming all the time.wink

Joseph

In reply to Greg Smith

Re: Time on lesson display

by Michael Penney -
We have build some custom tools for this - that enables us to record a time on spent watching an online video, users can leave and return and the time re-starts when they return.

What we do is use a custom module and the video is built as micro-content - chunked into short bits. As each bit finishes, it sends a message to the custom module that records the time spent (in this case the length of the micro-content piece) and automatically forwards the user to the next micro-video piece. We've also done some projects where an action-script in the swf sends a message about the time spent in a section of an interactive lesson.
In reply to Michael Penney

Re: Time on lesson display

by Greg Smith -
Fixing the countdown lesson timer
and
Making the minimum time spent in a lesson, Dependant on -> Time Spent (minutes), accumulative, a sum, a total, not contiguous.

Michael, it sounds like you have done a lot of very good work. In our case, at Tom Wilson Counseling dot com, (he says you know him) our content is more traditional text.

We have tested both timed and untimed versions of the same class required by state agencies, i.e. DMVs, courts, Probation etc. We found that if given the chance to beat the system (i.e., guess repeatedly at the right answer to move along in the course) the overwhelming majority of mandatory class participants will use that strategy and spend as little time as possible. As such, a timer makes sense, but not forcing it "all at once" - which causes a lot of frustration that we don't want.

Changing the Dependant on -> Time Spent (minutes) to be a total was easy. The code is in only one spot, around line 100 in mod/lesson/view.php. All the needed information is there, it just needed to be totaled. (see below)

The issue/problem is that the records in the lesson_timer table are not always being recorded or read properly (when re-entering a lesson) and we are hoping you or someone has noticed this and has a fix for it.
(I won't get redundant with the details since you - and others out there may already know this)
Any knowledge you can share will be appreciated.
Thank you.

the "Dependant on" condition:
from this
98 // go through all the times and test to see if any of them satisfy the condition
99 foreach($attempttimes as $attempttime) {
100 $duration = $attempttime->lessontime - $attempttime->starttime;
101 if ($conditions->timespent < $duration/60) {
102 $timespent = true;
103 }
104 }


to this
98 // go through all the times and get the total to see if it meets the condition
99 $duration = 0;
100 foreach($attempttimes as $attempttime) {
101 $duration += $attempttime->lessontime - $attempttime->starttime;
102 }
103 if ($conditions->timespent < $duration/60) {
104 $timespent = true;
105 }

In reply to Michael Penney

Re: Time on lesson display

by Greg Smith -
Michael,
Here is some of the specific experience I had (and others may have noticed also?):

I re-entered an un-timed lesson (from my/index.php home page) and it asked "Do you want to start on the last page you saw?" so it knew I had been out and returned but, after I click 'yes' it updates the old lesson_timer record including all the time I have been gone. It did not start a new lesson_timer record, as it should have.

with the timer on, I re-entered a lesson (from my/index.php home page) and it told me "Required time in lesson not met. Click continue to restart." so it knew I had been out and returned but, already, it has updated the previous lesson_timer record to include all the time I have been gone. It did not start a new record.

When I had only entered the first page of a lesson, previously, and left, it did not ask "Do you want to ..." (which makes sense) and it did, correctly, write a new lesson_timer record.
When I entered one time from a course index page, it started a new record properly.

If you can duplicate this, it should go in as a bug report? (ps we are running ver.1.9)

Thanks again!
Greg
In reply to Greg Smith

Re: Time on lesson display

by Brett Hallongren -

Greg:

We have a custom course timer that works with a full course (sits on the front page and tells the student how much time they have been in the entire course)  unfortunately, it broke when we upgraded to 1.9.5 and the programmer is no longer available so we are looking for an alternative.  The countdown timer would certainly work for us but the problem you have outlined is definitely an issue.  The countdown timer just keeps counting down if you are in the lesson or not.

Have you found a fix for this yet?

Thanks.

In reply to Brett Hallongren

Re: Time on lesson display

by Greg Smith -
Brett,
I just now returned to the moodle forum after that last posting.
Sorry to be so long in responding.
Yes, eventually, I determined the error was in their placement of a block of code. I just had to move it up in the program to where it belonged. I should add it to their bug report.
I don't see my notes on it right now. I will have to get back to you later.

In reply to Brett Hallongren

Re: Time on lesson display

by Greg Smith -
Brett,
I am finally back. Have you gotten a programmer and fixed it also?...
Solution: in mod/lesson/view.php The code that writes the new record, must be moved. Currently, it is below the code, from lines 248 to 285, that prompts the user with the question or comment mentioned above ("Do you want to start on the last page you saw?"...) and then terminates the page, forcing us to move our code, now at lines 314 through 330, up above 248, somewhere under 175. To move it under line 189 seems the best as that is where the log record is also written. (the block is also mislabeled - it is not for a timed test - copied from a quiz page?).
You can email me with questions.
Greg

In reply to Greg Smith

Re: Time on lesson display

by Brett Hallongren -

Greg:

I've actually been swamped with other non-Moodle work lately and haven't had time to revisit this issue.  I will give it a try as soon as I dig out a bit and am able to refocus on moving over to 1.9x.  Thanks for the update, I am sure it will work well.

In reply to Greg Smith

Re: Time on lesson display

by Chris Collman -
Picture of Documentation writers
Hi Greg,
I appreciate your comment about "all at once". My usual comment is that Moodle is used in many different ways by many different types of organizations and people. There was an initial vision about time (just to name one feature in Lesson or Moodle for that matter) which did not include all potentials. What were those developers thinking back in MoodleHistory? smile

All things are relative. On a practical level, instructional blocks of 15 minutes are different from those of 8 hours. The Lesson timer is another one of those rules, which to some makes about as much sense as having the same rules for seat time as book reading, or the same rules for synchronous as asynchronous education.

I am sure many of us wonder if there is any research that indicates sitting in a boring class produces significantly better outcomes than completing a boring on line asynchronous class without time measures. I suspect those good old "credit hour" concepts will be around long after the name disappears.

Best Chris



In reply to Chris Collman

Re: Time on lesson display

by Husain Choolawala -
We have four lessons in a course and would like to setup a minimum time spent requirement of 30 minutes for each lesson. I can use the lesson dependency setting of lessons 2, 3 and 4 to force the student to spend 30 minutes in lessons 1, 2 and 3 respectively. How do I setup the dependency for lesson 4, since there is no lesson after it ?