Moodle 3.4 Activity Completion

Moodle 3.4 Activity Completion

by Joyce Octaviano -
Number of replies: 10

Hi,

Do you know if the new feature in Moodle 3.4 for Activity Completion is applicable in scorm activity?

We really want to manually mark completion in some scorm files. 

Thank you.

Average of ratings: Useful (1)
In reply to Joyce Octaviano

Re: Moodle 3.4 Activity Completion

by Mary Cooch -
Picture of Documentation writers Picture of Moodle HQ Picture of Particularly helpful Moodlers Picture of Testers Picture of Translators
Yes it is. (Just moving this to the SCORM area)
Average of ratings: Useful (1)
In reply to Mary Cooch

Re: Moodle 3.4 Activity Completion

by Joyce Octaviano -

Thank you so much!

In reply to Joyce Octaviano

Re: Moodle 3.4 Activity Completion

by Lyndsey Welch -

Linked to this is there any way of creating automatic emails reminders for those not completing?

In reply to Mary Cooch

Re: Moodle 3.4 Activity Completion

by Julie Aldridge -

We work with a company who just upgraded to 3.4 and this new feature works beautifully for their scorm packages that, on occasion, are not sending a completion result through. Previously we'd have to change the results in the database or clear the attempt and ask them to re-do it. This new feature is such a time saver - it's awesome, thank you smile

In reply to Julie Aldridge

Re: Moodle 3.4 Activity Completion

by Ted Long -

Hi Julie

We're in the process of updating to 3.4 but in the meantime have an urgent need to change the results in the database - we've never amended anything in the database and I must confess, I don't know where to start but this is some we REALLY need to do.

Are you able to advise the best steps to take to chaning the results in the database?  I need a dummies guide!! smile

In reply to Ted Long

Re: Moodle 3.4 Activity Completion

by tim st.clair -
Picture of Plugin developers

Hi Ted, the guide to changing things in the database is "don't, unless you really have to". It's not that easy to figure out where to look either. Why is editing data your only option? There's no "dummies" guide for the Moodle database because to understand how the data hangs together you generally need to read the code of the activity then figure out why things hook up where and the way they do. And then keep a backup of the database for when it all goes haywire.

But just in case I haven't scared you off, here's how the scorm data lives in the database and how to track it down.

First start where you launch your package (the scorm activity page with the Enter button) to grab its activity id. This will look something like http://your-server-name/mod/scorm/view.php?id=651.

In the database, "651" represents a record in the mdl_course_module table, and from that record you need to grab the "instance" of the activity. You find that out using some sql

select instance from mdl_course_module where id = 651

this will give you some value - lets say 128. You then need to find out the recorded scorm data for a user. So you need to know the id of the user you want to examine the data for. I find it's easiest to go into the scorm reports page and find the user, then mouse-over their name and look at the link - on Chrome this appears on the bottom-left of the browser window, and looks something like http://your-server-name/user/view.php?id=3564&course=120. To find all that users scorm data you can now do another query:

select * from mdl_scorm_scoes_track where userid = 3564 and scormid = 128

You'll then get some results - some values will probably be pretty unreadable depending on the type of package you have. Lets say these are the results (this is a scorm 1.2 package):

mysql query recordset results in tabular form

If I wanted to complete this users package on their behalf just by editing data values, here's what sql I'd have to do in three sql statements, using the values we calculated above:

insert into mdl_scorm_scoes_track (userid, scormid, scoid, attempt, element, value, timemodified) values (3564, 128, 390, 1, 'cmi.core.score.raw', '100', unix_timestamp()), (3564, 128, 390, 1, 'cmi.core.score.min', '0', unix_timestamp()), (3564, 128, 390, 1, 'cmi.core.score.max', '100', unix_timestamp());
update mdl_scorm_scoes_track set value = '' where userid = 3564 and scormid = 128 and attempt = 1 and element = 'cmi.core.lesson_status';

update mdl_scorm_scoes_track set value = 'completed' where userid = 3564 and scormid = 128 and attempt = 1 and element = 'cmi.core.exit';

This would make the scorm record think that it was in a completed state, with a score set, and a lesson status of completed. But depending on how your course is set up and if there are any triggers or calculations that take place once a package is completed such as conditionally releasing subsequent course activities, you might need to do some more steps. I'm not entirely sure which of these are absolutely necessary but when I've had to edit like this, this is what worked for me. To perform these steps I'm usually logged on as an admin account.

1. Force or let the cron to run - this might be as simple as running http://your-server-name/admin/cron.php, or waiting 5, 10 or 15 minutes (whatever it is set at on your server).

2. Edit the grade if need be. One thing is that the score of the scorm package might be linked to the grade. To edit it, find the user in the grading tool, and then turn editing on on the page. This will change the grades into editable fields. You then copy the score you set in the package into the grade for that user, then save.

3. Purge the cache (site administration > development > purge all caches). Don't know why, but this has to happen.

4. Force or let the cron to run again. 

At this point any completion rules, or conditional releases will see that the package is in fact completed, the grade is set and updated, and needs to be triggered / updated.

Now, editing the mdl_scorm_scoes_track data can be tricky and depends heavily on your knowledge of both the scorm package and the standard version it is built to - so the example above is for a fairly simple single sco package built for scorm 1.2 within a package that was set to complete upon a certain grade condition. If you need to edit data that is stored in the cmi.suspend_data you might find its significantly more tricky unless you know the ins-and-outs of the package you are trying to examine. For instance, a Articulate scorm package will compress its suspend data using its own compression algorithm based on triplets of alphanumeric values, whereas a Coursesuite scorm package compresses using LZString - either way both are almost impossible to change by hand unless you're particularly technically minded.

You might like to upgrade to 3.4 on a clone of your site and see if the new editing abilities can fix your problem before you go down the data-editing route.

As with any database hacking your mileage may vary, as the saying goes.

side note:

I'd sort of tried to make this into a special block tool hack, for which the relevant code is here: https://gist.github.com/frumbert/2d8d5d2729aec8889e1555dd7956887a - it's not a block you can install because what I'm doing is a horrible hack that most developers would cringe at, but it has the core bits of the sql from above and some calls to internal moodle tasks that need to run to achieve what I needed. If a developer absolutely needed a way to edit in the way I needed to and absolutely needed a place to start, then they could start with my code. But I wouldn't reccomend it.

Good luck!

In reply to tim st.clair

Re: Moodle 3.4 Activity Completion

by Ted Long -

Hi Tim


You Sir, are a gent.  Many thanks for the detailed assistance here, I really appreciate it and for the tool - I'll take a look at it.


Really appreciate your help.

In reply to Ted Long

Re: Moodle 3.4 Activity Completion

by Julie Aldridge -

Hi Ted and Tim

Tim’s description above is why I was so happy to see the new activity completion over-ride feature in 3.4 smile The way Tim has previously been doing it isn’t a way that a non-programmer like myself – or some of the organisations that Tim and I work with could do themselves - and, as Tim mentioned, fiddling with results can be risky and not an optimal solution. But we've sometimes had to do it this way for organisations who are running older versions of Moodle and aren't able to upgrade immediately. 

Also, just in case it’s helpful to anyone, for the organisation Tim and I worked with that just upgraded to 3.4 there was another Moodle feature (I think it’s a new feature, I couldn’t find it in the Moodle v3.0 they previously had) that actually ended up solving their particular completion problem. Most of their learners were completing the scorm package with no issues but there were at least 4 or 5 students a week that couldn’t get a scorm completion to unlock their certificate. The organisation is running a course with an Articulate scorm package that had been built by a third party content provider and we didn’t have access to the Articulate source files. We found that if a student exited and then re-entered the scorm package a few times it would go into ‘review’ mode and no completion would be recorded. We knew the issue was coming from the Articulate package as other scorm packages built in our own software were not having the same problem. After scouring the forums and finding some posts by Dan Marsden (thank you so much Dan for your informative posts if you ever read this) we were able to narrow it down to the mastery over-ride score. In Moodle 3.4 I was able to change the mastery score over-ride setting in the scorm settings page and they have not had a completion issue since. But it’s nice to know they also have the new activity completion over-ride just in case they have any other issues in the future smile 

Cheers

In reply to Julie Aldridge

Re: Moodle 3.4 Activity Completion

by Ted Long -

Hi Julie


Thanks so much for your reply and the additional information. Your issue with Storyline activity completion sounds EXACTLY like the issue I am having.  Would you be as kind as to explain the issues with the mastery over-ride score in more detail?  I'd love to know where I'm going wrong!!

In reply to Ted Long

Re: Moodle 3.4 Activity Completion

by Julie Aldridge -

Hi Ted

I checked the Moodle documentation and I think the mastery score setting may have been put in at Moodle version 3.1 (I could be wrong). If you’re running 3.1 or higher and if you open the ‘edit settings’ page of the scorm activity can you see the setting in the image I’ve attached?

If so, this is the setting that fixed this particular Articulate issue that was happening for us. 

The forum reply from Dan Marsden that helped to pinpoint the issue was this one https://community.articulate.com/discussions/articulate-storyline/storyline-send-to-moodle-lesson_status-failed-before-exam and he pointed to further information here https://docs.moodle.org/34/en/SCORM_FAQ#Moodle_changes_cmi.core.lesson_status_from_.22completed.22_or_.22passed.22_to_.22failed.22

He also posted helpful info on other forums but I can’t find them at the moment. 

If you try the above and have no luck I’d be happy to test one of your packages on our internal 3.4 test site with the same settings we use to see if that resolves your issue. But hopefully the above might work, fingers crossed smile 


Average of ratings: Useful (1)