'Topic with tracking' course format hack

'Topic with tracking' course format hack

by Jamie Pratt -
Number of replies: 19
Hi,

Based on the great work done in the fnmoodle project I recently worked on some code tracking activities viewed / completed by a user. I have isolated most of my code (apart from one line) in a new course format.

My code doesn't have the nice feature as in fnmmoodle of having the student click on a link below a resource to indicate when they feel they have finished with a resource. The default for all activities in a course is to decide they are completed when they have been viewed once. We just check the activity logs to see if the user has viewed an activity. You can write a custom function to decide whether an activity has been completed.

See the attached picture of the visual cues that my course format provides to tell a user how far they have progressed in a course :
  • The check box after the activity name is ticked when the activity has been viewed / completed.
  • The first activity in the course has an animated gif displayed after it that alternately flashes between an unchecked checkbox image and the text 'next'
  • The topic in the course with the first incomplete activity is always highlighted (in a similar way to as if the teacher had clicked the highlight light bulb).
  • Using an anchor in the html when the course view page is displayed we jump straight to the topic with the next incomplete activity.
The code to do this is pretty much contained within one course format : topic format with tracking. You have to add one line of code to course/lib.php. This line of code won't affect other course format display at all. You should add a couple of strings to lang/en/moodle.php or the appropriate lang pack(s) as well. Instructions for doing this are in the README in the zip. Just unzip the zip which I will post in a reply to this topic to course/format/ make the changes to course/lib.php and lang/en/moodle.php

Thought I would post this as it may be of use to others. Not sure if it deserves space in the CVS contrib repository.

Disclaimer : Images and inspiration courtesy of fnmoodle.

Jamie






Attachment track.jpg
Average of ratings: -
In reply to Jamie Pratt

Re: 'Topic with tracking' course format

by Jamie Pratt -
Here is the code. (didn't attach it to the last post as I wanted to attach a screen shot.)


In reply to Jamie Pratt

Re: 'Topic with tracking' course format

by David Brighton -

Thank you, thank you, thank you, thank you!

I was looking for somehting like this and could not get the activity locking mod to work, this is such a useful addition for helping students keep track of where they are. I was surprised that there was not a default view like the activity outline already in moodle, progress tracking seems pretty much mandatory in a course.

Thank you, thank you, thank you, thank you again!

In reply to Jamie Pratt

Re: 'Topic with tracking' course format

by Jamie Pratt -
oops. I said 'Using an anchor in the html when the course view page is displayed we jump straight to the topic with the next incomplete activity.' Not true.

#nextactivity and #nextsection anchors are included in the html and I used them to jump from a Flash activity when it was finished to show the next section of the course with an incomplete activity. But you would need to add some javascript to this page to have it jump to the nextsection anchor every time the course view page loaded - if that is desirable.


In reply to Jamie Pratt

Re: 'Topic with tracking' course format hack

by Darren Smith -
This looks very interesting. I will try this on my test server.

I love the fact it's (effectively) all within the course format.
In reply to Jamie Pratt

Re: 'Topic with tracking' course format hack

by David Mack -
Excellent!

don't suppose anyone has any functions written yet for determining when specific resources have been completed (i.e. quiziscompleted() ) for sticking in this format.php?
In reply to David Mack

Re: 'Topic with tracking' course format hack

by Chardelle Busch -
Picture of Core developers
Jamie,

Have you seen the activity locking code (see the Conditional Activities forum), it will also place a check when viewed, or when finished (e.g. when get to the end of a lesson). There's an option to have the check come before or after the activity, and it works for all course formats.
Attachment checks.gif
In reply to Chardelle Busch

Re: 'Topic with tracking' course format hack

by Jamie Pratt -

Hi Chardelle,

No. I hadn't seen that.mixed Looks like I could have used that instead of developing my tracking course format.

My code involves very little change to the core Moodle code (2-3 lines added) which might make it easier to upgrade your Moodle.

Jamie

In reply to Jamie Pratt

Re: 'Topic with tracking' course format hack

by Adam Johnston -
How hard was it for you to mod this?  I am wondering if weekly could be modded, and then if I could just replace the existing weekly and topical formats with the new ones with checkmarks so all my teachers can use this.  I have installed activity locking right now, but its more complicated for the user having to program when something is complete (score totals) versus just when it is seen. 

If its too hard to change the weekly format then I will stick with activity locking I suppose simply so I can have the same thing across the board, especially since it will help the students see what they have done and it doesn't really affect the teachers much.

In reply to Adam Johnston

Re: 'Topic with tracking' course format hack

by Chardelle Busch -
Picture of Core developers
Hi Dawn,

Firstly, I am so glad to hear you are okay in AL, my thoughts are with you.

If you've gotten all of the activity locking code installed, you're done with hard part.  The code is meant to be used to make activities "locked" until prerequisite activity functions have been met--either by time delay, or by grade, or by being viewed.  So, if you want an activity to be locked, you turn editing on and click on the little lock icon for the locking options. 

However, a nice little side effect, if you will, is that even with no conditional locking set on any activities, if you set your course settings for locking before each activity, you will see the little empty square in front of each activity.  Once a user clicks on the activity, the green check appears in the box--unfortunately it does not allow for users to do any checking by themselves (but, until that code is developed, this will have to do).  I like it because my users can "jump" around a course and this helps tell them where they have been.

Note:  To test this you must actually log in as a student (not login as), since the locking uses each user's personal data.

Hope this helps, and Good Luck.
In reply to Chardelle Busch

Re: 'Topic with tracking' course format hack

by Dawn Wright -

Thanks Chardelle

We are at the upper end of Mobile Bay and fortunately the Academy Building sits high enough the storm surge did not reach it. But we were without power there for several days and were still experiencing periodic outages through last Friday. The homes of many of our staff are damaged and some are still without power, though nothing like our neighbors just 25 miles south and west of us. In the last 12 months, we've had three large hurricanes just graze Mobile and I think Katrina is the last hurricane that I am going to stay here and ride out.  Other than the occasional blizzard, I think Colorado is a pretty safe place to live, isn't it?

Thanks for explaining this to me. I read and reread your explanation but still could not see the place for the student to toggle the check mark on or off. Then I finally noticed the phrase "if  you set your course settings for locking before each activity" ! That was what I am missing (other than getting the icons in the right directory). I didn't realize the activity locking option was added to the course settings page. surprise

Again thanks for helping me get this working.

dawn

In reply to Chardelle Busch

Re: 'Topic with tracking' course format hack

by Dawn Wright -

Chardelle

After trying to get our school back functioning after Katrina, I think I have exhausted all my anti-blond energies.

I'm trying to set up and use activity tracking so I can get what you describe and illustrate so nicely in your 14 August posting. Is there a "Readme" or "How To" for activity locking somewhere that may help me learn how to set this up properly. I installed it and added the extra code to the course/lib.php to get rid of the "fatal error" and I can see the lock set up but nothing seems to give me an option to allow students to check off items they've completed. Or to tell me really how activity locking works. Right now I am playing with it trying to learn how it works by trial and error.

Did I miss something in the install?

I do have the very nice Humbolt Course Menu installed too, in case that conflicts somehow. I hope not because I need that as well as the item checkoff if I can get them both.

Thanks so much in advance for what ever help you can provide.

dawn

In reply to Chardelle Busch

Re: 'Topic with tracking' course format hack

by Rashan Anushka -
Hi, I was looking somewhere to download this but couldnt find. Can u help me?
In reply to Rashan Anushka

Re: 'Topic with tracking' course format hack

by Dawn Wright -

http://cvs.sourceforge.net/viewcvs.py/moodle/contrib/ 

If you are asking about the Activity Locking module, I got it from the moodle/contrib above.

In reply to Dawn Wright

Re: 'Topic with tracking' course format hack

by Ger Tielemans -
checkmarks suggest that the student finished the job. But he can/must visit it sometimes again. How about replacing it with footprints?
Attachment ScreenShot006.gif
In reply to Ger Tielemans

Re: 'Topic with tracking' course format hack

by Adam Johnston -
I like the idea of pawprints too.  Seeing as you have a mockup, did you mod the files or create images so I could use them?  Otherwise I will just make some of my own when I get some time to change it.
mrjohnston
In reply to Adam Johnston

Re: 'Topic with tracking' course format hack

by Ger Tielemans -
I only modified the checkmarks into footprints - foundsomewhere on my harddisc, unknown source smile - in this course format. So this is the same course format. (And would prefer that student could decide to change the footprint into a checkmark as symbol for "no longer necessary to visit")
In reply to Ger Tielemans

Re: 'Topic with tracking' course format hack

by Ger Tielemans -
Looking more close to this nice format:
  • I implemented the code - again - in a fresh 1.5.3 testserver
  • without the extra javascript the next item is jumping weird. (Jamie, is the javascript that can repair this available?)
  • as you also can see in the picture above that was taken from 1.5.2: some activities are missing the checkmark:
    • Forum (But the Roma version forumPLUS or forumTT does show it)
    • glossary is also missing the checkmark
    • ..
In reply to Ger Tielemans

Re: 'Topic with tracking' course format hack

by Ger Tielemans -
mmm, I see in the code that you choose for this exception for forum label and glossary.. (I recognise this problem: when is a task like forum, wiki, glossary, journal finished?)