Picture of Jonathan Hollingsworth
Determining User's Progress from data in cms.suspend_data
by Jonathan Hollingsworth - Monday, 14 March 2016, 10:29 PM
 

Hello,

We currently have some courses that are non-assessment only.  The user can pick and choose their route through the content.

As they read different sections, start a video, etc. I can see the SCO writing data to cmi.suspend_data and updating the progress marker on the course.

My challenge is, I also need to show a percentage complete of each course in a dash-board outside of the SCO.  I think the only way to do this is to make sense of the cms.suspect_data "completion" value - the one that's typically lots of 0s and 1s.

I'm presuming that each location represents a chunk of content that is either done (1) or not (0).  Is this correct?

Is there a way of being able to interpret this data more accurately?  I.e. look at the which section each chunk is in?

Many thanks,

Picture of Matt Leathes
Re: Determining User's Progress from data in cms.suspend_data
by Matt Leathes - Tuesday, 15 March 2016, 10:10 AM
 

Hi Jonathan

Previously when we've had to do something like that (as with our Kineo Essentials suite) we've actually amended the course code to write out the progress-as-a-percentage to the cmi.core.score.raw field, just to leave everything in the control of the SCO rather than the LMS having to interpret the internal tracking data of the course.

That said, doing it the way you suggest is pretty low-risk.

You can indeed look at which section each chunk is in - the index of each integer matches up to the _trackingId property in blocks.json i.e. if the first integer in the completion string is 1 then you know the block with _trackingId of 0 is completed.

FYI there's actually a third possible value for each entry in the completion string - a dash. This indicates that there is no block with that particular _trackingId.

Picture of Jonathan Hollingsworth
Re: Determining User's Progress from data in cms.suspend_data
by Jonathan Hollingsworth - Thursday, 17 March 2016, 1:34 AM
 

Thanks for the reply Matt.  

Yeah, I think I'm just going to count the total number of 1s and 0s, and use that as the denominator in a percentage calculation.  It's a little crude, but it'll do given our timeframes.

Appreciate your help.

Jonathan

Picture of Richard Lilleker
Re: Determining User's Progress from data in cms.suspend_data
by Richard Lilleker - Thursday, 20 September 2018, 10:05 AM
 

Hi Matt,

I'd like to be able to write out the progress as a percentage value to the LMS via SCORM.

Do you have an example of how to do this? Is it something I'd need to modify in the SPOOR plugin?

I'm quite comfortable in writing some new code to get this to work :)

Thanks

Richard

Picture of Matt Leathes
Re: Determining User's Progress from data in cms.suspend_data
by Matt Leathes - Thursday, 20 September 2018, 10:15 AM
 

Yes, you'd do this in the spoor plugin. The key part is working out where in SCORM you're going to save that data as there's no dedicated field for it. In the example I gave above, there was no requirement to record a score - it was therefore safe to write the progress-as-percentage to the score field.

Picture of Richard Lilleker
Re: Determining User's Progress from data in cms.suspend_data
by Richard Lilleker - Thursday, 20 September 2018, 3:46 PM
 

That's great - thanks Matt.

I'm assuming there's a way to reliably obtain the progress-as-percentage through some sort of function? Or will it need to be computed?

Thanks

Picture of Matt Leathes
Re: Determining User's Progress from data in cms.suspend_data
by Matt Leathes - Thursday, 20 September 2018, 4:33 PM
 

It would need to be computed. A fairly easy way of doing this is mentioned above.

Picture of Richard Lilleker
Re: Determining User's Progress from data in cms.suspend_data
by Richard Lilleker - Friday, 21 September 2018, 11:36 AM
 

I've been having a look at the SPOOR plugin and have managed to get at "_data" in the wrapper.js file which obviously outputs something like this:

{"lang":"en","completion":"-1000000000000010001","questions":"","_isCourseComplete":false,"_isAssessmentPassed":false,"assessment":{"test":[0,0,null,0,1,{"5b1e825c097941cb06eb4405":null,"5b1e8290097941cb06eb4407":null,"5b1e8b70097941cb06eb4412":null,"5b1e82ac097941cb06eb4409":null,"5b2a336396154911073eeeb5":null,"5ba3a193f0523af104acf5a8":null}],"Quiz 1":[0,0,null,null,0,{"5b2a294e96154911073eeeae":null,"5b2a2d1c96154911073eeeb2":null,"5b3cd527c7dfbb294eef2d68":null}],"Test Your Knowledge":[0,0,null,0,1,{"5ba25d420ef57b5b078abd8e":null,"5ba25d420ef57b5b078abd8c":null,"5ba25d420ef57b5b078abd8d":null}],"":[0,0,null,null,0,{"5b4f3ddecde9ff7a097ba0c0":null,"5b4f3e23cde9ff7a097ba0c1":null}]}}

 

Is there an easier way to just get the "completion" part? I've noticed in default.js there's a serializer which gets just the long completion string which is then sent back to "getSessionState()" in adapt-stateful-session.js, but I can't seem to find a way to get this.

My other thought was just to do some quick and dirty string splitting / parsing!

Thanks

Richard

Picture of Matt Leathes
Re: Determining User's Progress from data in cms.suspend_data
by Matt Leathes - Friday, 21 September 2018, 12:20 PM
 

it's a JSON string so you just need to JSON.parse it to get an object, you can then access the completion property of that object

You probably want to hook into this function.

Picture of Richard Lilleker
Re: Determining User's Progress from data in cms.suspend_data
by Richard Lilleker - Friday, 21 September 2018, 3:23 PM
 

Thanks Matt - that's useful.

I've managed to obtain the "completion" string and have performed a basic calculation of 1s and 0s to get a percentage complete. However, the percentage I'm obtaining is slightly off the value that's determined by the progress bar.

Could this perhaps be a difference in the way the progress bar is calculating the completion?

Picture of Matt Leathes
Re: Determining User's Progress from data in cms.suspend_data
by Matt Leathes - Monday, 24 September 2018, 8:59 AM
 

The completion string in spoor is based on number of blocks completed; the completion in page level progress is based on number of components completed in the current page.

Picture of Richard Lilleker
Re: Determining User's Progress from data in cms.suspend_data
by Richard Lilleker - Monday, 24 September 2018, 9:16 AM
 

Ah that makes sense. I had a look in the code for the page level progress extension and figured that it was calculating the percentage differently - it also seems to add an extra '1' if _showPageCompletion is true.

Ideally I want the percentages to match up so that the value written back to the LMS is the same as that displayed in the Adapt course. I'm guessing in order to do this I'd need to count completed components by iterating through Adapt.contentObjects.models?

Picture of Matt Leathes
Re: Determining User's Progress from data in cms.suspend_data
by Matt Leathes - Monday, 24 September 2018, 10:12 AM
 

There's quite a few ways you could do it TBH... I get the impression from what you're saying that your course is just a single page, in which case you could just do $('.page-level-progress-navigation-bar').width();

Or you could do Adapt.findById('co-05').get('completedChildrenAsPercentage'); (where 'co-05' is the page id)

 

Picture of Richard Lilleker
Re: Determining User's Progress from data in cms.suspend_data
by Richard Lilleker - Monday, 24 September 2018, 10:50 AM
 

The course is actually multiple pages - probably around 20 or so.

I've already modified the page level progress extension so that it displays some text above the progress bar which reads "You have completed X%". The issue now is getting this exact value written back to the LMS.

Counting the completion string in SPOOR is by far the easiest! I might resort to iterating through the entire contentObjects model and counting completion that way.

Edit:

If I can hook into the "pageProgressLevel" extension then I can use the already existing function titled calculateCompletion and pass in the "course" model. I think this gives me the values I'm looking for which means I should be able to calculate an accurate completion percentage!

Picture of Barry Jenkin
Re: Determining User's Progress from data in cms.suspend_data
by Barry Jenkin - Friday, 28 September 2018, 1:40 AM
 

I've also been trying to hunt for a solution via Page Level Progress completion calculation as I have a couple of LMSs with dashboard progress bars.