|
The Articulate Community Forums have moved! Head over to E-Learning Heroes, your new Articulate community site, where you'll find the new forums and a whole lot more! Signup is free. The forums you see here will remain open for browsing, but are no longer open to new posts. |
|
|
LinkBack | Thread Tools | Search this Thread |
|
|
# 21 | ||
|
Member
Join Date: May 2008
Location: UK
Posts: 73
|
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.... |
||
|
|
|
|
# 22 | ||
|
Member
Join Date: Dec 2008
Posts: 392
|
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;
}
}
}
}
|
||
|
|
|
|
# 23 | ||
|
Member
Join Date: May 2008
Location: UK
Posts: 73
|
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
}
}
__________________
Always ready to learn something new.... |
||
|
|
|
|
# 24 | ||
|
Member
Join Date: Jun 2007
Posts: 257
|
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 |
||
|
|
|
|
# 25 | ||
|
Member
Join Date: Nov 2008
Posts: 48
|
Quote:
Last edited by Travis Smith : 01-04-2011 at 10:11 AM. |
||
|
|
|
|
# 26 | ||
|
Member
Join Date: May 2008
Location: UK
Posts: 73
|
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:
__________________
Always ready to learn something new.... |
||
|
|
|
|
# 27 | ||
|
Member
Join Date: Nov 2008
Posts: 48
|
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. |
||
|
|
|
|
# 28 | ||
|
Member
Join Date: Oct 2010
Posts: 21
|
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! |
||
|
|
|
|
# 29 | ||
|
Member
Join Date: Dec 2008
Posts: 392
|
Quote:
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 |
||
|
|
|
|
# 30 | ||
|
Member
Join Date: Jun 2007
Posts: 257
|
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 |
||
|
|