Node API
May 21, 2009 12:00 AM
Yeh:) that's the way I've resorted to working it. I pull alternate window titles in using some custom javascript and a configuration XML file. I don't go as deep as typical packages Lesson = SCO > Section > Activity. So my page tags are s1_a1, etc...
I have a funny feeling that the classic deeptree structure contributes to the typical ickyness of e-packaging. My theory is that this is a major contributing factor. Too deep. Too legacy. Also avoiding screen / page if possible. Trying something different / focused / relevant.
______________________________________________
This is one of the four main methods in the custom script extension.
function updatePageTitle(){ sectionNumber=VarCurrentChapterName.getValue(); sectionNumber=parseInt(sectionNumber.substring(1,3)); activityNumber=VarCurrentPageName.getValue(); activityNumber=parseInt(activityNumber.substring(1,3)); if(VarCurrentChapterName.getValue()=="~~~null~~~"){ pageTitle=VarCurrentPageName.getValue(); pageParent=""; }else if (VarCurrentPageName.getValue().length<4){ //pull out the page title and page parent (section) //this works fine in Firefox... will need to loop thru the children to make the pageTitle stick //ghost nodes... a known issue with Firefox / Gecko pageParent=xmlDoc.getElementsByTagName("section")[sectionNumber-1].getAttribute("title")+" > "; sParent=xmlDoc.getElementsByTagName("section") var activityIterator=0; for (var j=0;j
_____________________________
The other methods are:
processScore() - runs OR logic on the 'Test Out' output with the masteryArray. Everything is tracked in binary strings stored in Lectora variables - I'm creating these in the custom script.
completeSection(section) - forces address in masteryArray for section to true. completeSection(2) = 0,0,0,0,0 --> 0,1,0,0,0)
completeActivity(section, activity) - forces section / activity address to true. completeActivity(2,1) sets activity 1 in section 2 to true / complete, completeActivity(1) sets activity in the current section to complete, completActivity() sets the current activity in the current section to complete. Also calculates whether all of the activities in the referenced section are complete. If they are, call completeSection for that section.
The supporting methods are:
makeMasteryArray(sectionCount) - parses the config.xml section nodes and builds a delimited binary string for the overall mastery (0,0,0,0,0)
makeSectionArrays(sectionCount) - parses the activity nodes for each section and builds a delimited binary string for each section (0,0,0)
makeArrayString(length) - called by makeMastery.. and makeSection.. to build up the array strings.
This is the simplest way I could come up with to aggregate activity completion and parallel that with a prescriptive pre-test output. Working pretty well so far and doesn't necessarily marry me to Lectora if we manage to find another tool. Have some other things planned for objective abstraction / mapping but we aren't using those nodes in this iteration. Those are reference only.
Discussions have been disabled for this post