Articulate Community Forums



Articulate Community Forums » Articulate Product Forums » Articulate Presenter Player SDK » Tracking progress

 
 
LinkBack Thread Tools Search this Thread
Old 11-11-2010, 04:27 AM   # 21
Member
 
TCDown's Avatar
 
Join Date: May 2008
Location: UK
Posts: 73
Default Re: Tracking progress


Hi Brian,

Thanks for your advice.

I cannot get this to work in an LMS.

It appears that g_sRestoreData never gets populated.

I am still trying to access an array after using

arrMyArray = strSomeString.split(",");
arrMyArray[0] is always undefined?

TC
__________________
Always ready to learn something new....
TCDown is offline  
Old 11-11-2010, 11:29 PM   # 22
Member
 
BrianHoule's Avatar
 
Join Date: Dec 2008
Posts: 392
Default Re: Tracking progress


Hi, TC:

Yeah, you're right. Looks like that last bit of code only draws from the shared object. I've had some luck with the following. For this I'm building my own boolean array since the shared object and suspend string store data differently.

Code:
	import flash.external.ExternalInterface;
	var m_sRestoreData:String;
	var m_arrRestoreData:Array = new Array();
	function loadResumeData():Void {
		var oScormData:Object;
		var sViewed:String;
		var arrSharedObj:Array;
		var arrSCORM:Array;
		
		for (var n:Number=0; n < _level0.ArtAPI.GetSlideCount(); n++) {
			m_arrRestoreData.push(false);
		}
		
		if (_level44.ResumeMgr.m_bUseSharedObj) {
			m_sRestoreData = _level44.ResumeMgr.m_strRestoreData;
			arrSharedObj = m_sRestoreData.split(",");
			arrSharedObj.shift();
			for (var x:Number = 0; x < arrSharedObj.length; x++) {
				if (arrSharedObj[x] > 1) { //equals 0 for auto advance, 1 for wait 4 user
					m_arrRestoreData[x] = true;
				}
			}
		} else if (_level44.ResumeMgr.m_bUseSuspendData) {
			oScormData = ExternalInterface.call("parent.SCORM_GetDataChunk"); 
			sViewed = String(oScormData).split("|")[0];
			sViewed = sViewed.split("=")[1];
			m_sRestoreData = sViewed;
			arrSCORM = m_sRestoreData.split(",");
			for (var x:Number = 0; x < arrSCORM.length; x++) {
				if (arrSCORM[x] > 0) { //equals slide numbers, so > 0
					m_arrRestoreData[x] = true;
				}
			}
		}
	}
BrianHoule is offline  
Old 11-16-2010, 05:28 AM   # 23
Member
 
TCDown's Avatar
 
Join Date: May 2008
Location: UK
Posts: 73
Default Re: Tracking progress


Okay here is my working code! It needs a load of tidying up, but in Moodle the state of the menu items (my skin only changes the colour of the menu item text) is remembered across sessions.

I look forward to your comments... Please be gentle

Code:
// I call the chkScorm() function everytime the _root frame is entered
_root.onEnterFrame = function() {
	chkScorm();
}
// 
function chkScorm (){
import flash.external.ExternalInterface;
var getScore:Object;// variable to hold the Full suspend_data string
var susData:String;//  variable to hold the first split of getScore
var vewData:Array;//   variable to hold just the visited pages
var arrVisited:String;
getScore = ExternalInterface.call("parent.SCORM_GetDataChunk"); // grab suspend_data
var getScore:String;
susData = getScore.split("=")[1]; // split getScore on the first "=" and take the 2nd element
vewData = susData.split("|",1);// split susData on "|" and only take one element
arrVisited = vewData[0].split(",");// split vewData on "," take all elements
for (i=0;i<arrVisited.length;i++){// loop through every element of arrVisited
	visited(arrVisited[i]);// call the function to mark a slide visited
}
}

lstSlide=10000; // set an unreasonable # for the last slide
function visited (clip) {
	curSlide = clip; // which slide are we looking at?
	if (curSlide != lstSlide){// check we havent already done this one
	slide = eval("_root._level100.menuContainer.slideItem"+(clip-1));// see if the slide actually exists on level 1 of the menu
	if (!slide){slide = eval("_root._level100.menuContainer.slide2Item"+(clip-1))}; // if not it should be a level 2 menu option
		TweenLite.to(slide.linkText,0.5,{tint:0x0000CC}); // change the text formatting of the menu item
		lstSlide = curSlide; // set the slide for the "if" statement
	}
}
Tony C
__________________
Always ready to learn something new....
TCDown is offline  
Old 12-06-2010, 02:21 PM   # 24
Member
 
this.onEnterFrame's Avatar
 
Join Date: Jun 2007
Posts: 257
Default Re: Tracking progress


I know i am chiming in a bit late here... sorry.
Your solution looks pretty good. It might be a lot of code to run every frame...
I leveraged the built in Articulate code that tracks slide views.
I run this once on start up.. then update the list of slides viewed when the slide changes.
I keep my own array for slides viewed as well (not in this snippet)

Code:
var ArtAPI = _level0.ArtAPI;
var presData = ArtAPI.GetPresentationData()
for (i = 0; i < ArtAPI.GetSlideCount();  i++) {
	var strSlideId = presData.Slides[0].Slide[i]._attributes.id;
	var viewLength:Number = _level44.g_oTrackingInfo[strSlideId].arrViews.length;
	if (viewLength >0) {
		      //we have seen this slide before
		} else {
			// has not been seen yet
		}
}
__________________
Lots of Articulate widgets at:
eLearningEnhanced.com
Follow me on Twitter @onEnterFrame
Visit my blog: www.frameEntered.com
this.onEnterFrame is offline  
Old 01-04-2011, 09:17 AM   # 25
Member
 
Join Date: Nov 2008
Posts: 48
Default Re: Tracking progress


Quote:
Originally Posted by beeneeb View Post
Hi Brian,

This isn't what you're looking for, but it might get you pointed in the right direction:

Understanding resume data in Presenter ’09 content published for LMS – Articulate Presenter ’09 Knowledge Base
So how would I access this data?


Last edited by Travis Smith : 01-04-2011 at 10:11 AM.
Travis Smith is offline  
Old 01-04-2011, 09:54 AM   # 26
Member
 
TCDown's Avatar
 
Join Date: May 2008
Location: UK
Posts: 73
Default Re: Tracking progress


Not quite that simple.. The code below will grab the suspend_data and split the list of visited pages into an array.
It can probably be a lot better in synax but should get you on the way.

Quote:
import flash.external.ExternalInterface;
var getScore:Object;
var susData:String;
var vewData:Array;
var arrVisited:String;
getScore = ExternalInterface.call("parent.SCORM_GetDataChunk" );
var getScore:String;
//strString = new String(getScore);
susData = getScore.split("=")[1];
vewData = susData.split("|",1);
arrVisited = vewData[0].split(",");
__________________
Always ready to learn something new....
TCDown is offline  
Old 01-04-2011, 09:58 AM   # 27
Member
 
Join Date: Nov 2008
Posts: 48
Default Re: Tracking progress


I guess simple would be too complicated? Or developers wouldn't have jobs? Wait, that's me...a little. Thanks for the help!!!

It looks like you have 2 getScores variables?


Last edited by Travis Smith : 01-04-2011 at 10:06 AM.
Travis Smith is offline  
Old 01-18-2011, 11:15 AM   # 28
Member
 
Join Date: Oct 2010
Posts: 21
Default Re: Tracking progress


Does anyone know of a way to create a custom progress tracker in which only select slides are included? Specifically, instead of showing the users every slide in the presentation, I want to show the 6 topics only - which would link to the first slide in each topic.

Thanks!
A@OSPI is offline  
Old 01-19-2011, 09:31 AM   # 29
Member
 
BrianHoule's Avatar
 
Join Date: Dec 2008
Posts: 392
Default Re: Tracking progress


Quote:
Originally Posted by A@OSPI View Post
Does anyone know of a way to create a custom progress tracker in which only select slides are included? Specifically, instead of showing the users every slide in the presentation, I want to show the 6 topics only - which would link to the first slide in each topic.

Thanks!
Hi, A@OSPI:

I would hide all those slides you don't want to appear in your tracker (I'm assuming you mean some sort of menu here), then parse the associative array returned by GetPresentationData() and exclude the hidden slides.

A few earlier threads on this forum discuss how those arrays are structured.

Good luck,
Brian
BrianHoule is offline  
Old 01-19-2011, 10:59 AM   # 30
Member
 
this.onEnterFrame's Avatar
 
Join Date: Jun 2007
Posts: 257
Default Re: Tracking progress


If you use the slide levels you could set the topic titles to level one and have your progress tracker ignore the other levels
__________________
Lots of Articulate widgets at:
eLearningEnhanced.com
Follow me on Twitter @onEnterFrame
Visit my blog: www.frameEntered.com
this.onEnterFrame is offline  
 


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




Articulate E-Learning Blogs


LinkBacks Enabled by vBSEO 3.1.0