Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
…912cdd6b-5c7d-d5a7-a2ba-d0f0cdb91641
  • Loading branch information
Johnathan Kemp committed Apr 17, 2012
1 parent e9699c5 commit a9aeaa0
Show file tree
Hide file tree
Showing 107 changed files with 2,973 additions and 0 deletions.
1,440 changes: 1,440 additions & 0 deletions modules/xerte/parent_templates/Nottingham/data_orig.xwd

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions modules/xerte/parent_templates/Nottingham/models/cMcq.rlm
@@ -0,0 +1 @@
<PG title="Multiple Choice Connector" name="Connector MCQ"> <SCR name="getPageID"><![CDATA[pageIcon = icon.parentNode.clip();if (rootIcon.projMode == "dev"){// Page Wizard pageIcon.templateData = pageIcon.extXML.toObject(); pageIcon.templateData = pageIcon.templateData.pageWizard[0]; // routed pages only pageID_array = new Array(); pageTitle_array = new Array(); pageMode_array = new Array(); for (i = 0; i < rootIcon.pages.length; i++){ pageID_array.push(rootIcon.pages[i].extXML.firstChild.childNodes[0].attributes.pageID); pageTitle_array.push(rootIcon.pages[i].extXML.firstChild.childNodes[0].attributes.name); pageMode_array.push(rootIcon.pages[i].extXML.firstChild.childNodes[0].attributes.pageMode); } navOffset = 0; } else { // Toolkits myXML = new XML(extXML.firstChild.childNodes[rootIcon.getPageIndex() - pgOffset]); pageIcon.templateData = myXML.toObject(); // routed pages only pageID_array = new Array(); pageTitle_array = new Array(); pageMode_array = new Array(); for (i = 0; i < extXML.firstChild.childNodes.length; i++){ pageID_array.push(extXML.firstChild.childNodes[i].attributes.pageID); pageTitle_array.push(extXML.firstChild.childNodes[i].attributes.name); pageMode_array.push(extXML.firstChild.childNodes[i].attributes.pageMode); } navOffset = pgOffset - 1; } rootIcon.setTitleText(templateData.learningObject[0].name);// handle multiple page data definitions in a project if (rootIcon.projectPageIndex == undefined){ rootIcon.projectPageIndex = 0;}// check if this page has a definition for the current project index and default to 0 if notif (pageIcon.templateData.cMcq[rootIcon.projectPageIndex].name == undefined){ projPI = 0;} else { projPI = rootIcon.projectPageIndex; } ]]></SCR> <SCR id="fnSetNavigation" isFunc="1" name="fnSetNavigation"><![CDATA[// rootIcon.contButton must be reset to on// when a page loads so even if it is turned off before navigating to a page// it appears on again, however you can turn it off in script in the destination page.// next button and continue buttonif (nextSet != undefined){ rootIcon.nextBtn._visible = nextSet; rootIcon.mask6._visible = nextSet; rootIcon.maskee6._visible = nextSet; rootIcon.contButton._visible = nextSet; // will auto reset when destination page loads to on!}// back buttonif (backSet != undefined){ rootIcon.backBtn._visible = backSet; rootIcon.mask11._visible = backSet; rootIcon.maskee11._visible = backSet;}// table of contentsif (tocSet != undefined){ rootIcon.tocBtn._visible = tocSet; rootIcon.mask14._visible = tocSet; rootIcon.maskee14._visible = tocSet;}// progress buttonif (progSet != undefined){ rootIcon.progress._visible = progSet; rootIcon.progBG._visible = progSet; } //debug(" tocSet = " + tocSet + " backSet = " + backSet + " progSet = " + progSet + " nextSet = " + nextSet);]]></SCR> <SCR isFunc="1" id="fnListToClipboard" name="fnListToClipboard"><![CDATA[// outputs a list of page titles and page ids to the clipboardclipBoardText = "";if (reportStyle == "text"){ for (i = 0; i < pageID_array.length; i++){ // output a list of titles and pageIDs clipBoardText = clipBoardText + pageLabel + " " + (i + 1) + " " + titleLabel + " " + pageTitle_array[i] + " | " + idLabel + " " + pageID_array[i] + " | " + modeLabel + " " + pageMode_array[i] + chr(13) + chr(10); } System.setClipboard(clipBoardText);} else if (reportStyle == "html"){// html versionclipBoardText = '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">';clipBoardText = clipBoardText + chr(13) + chr(10);clipBoardText = clipBoardText + '<html><head><title>' + reportTitle + '</title></head><body>';clipBoardText = clipBoardText + chr(13) + chr(10);clipBoardText = clipBoardText + '<table border="1" cellpadding="5">' + chr(13) + chr(10);clipBoardText = clipBoardText + '<tr><td bgcolor="yellow">' + pageLabel + '</td><td bgcolor="lightgreen">' + titleLabel + '</td><td bgcolor="lightblue">' + idLabel + '</td><td bgcolor="pink">' + modeLabel + '</td></tr>' + chr(13) + chr(10); for (i = 0; i < pageID_array.length; i++){ clipBoardText = clipBoardText + '<tr><td bgcolor="yellow">' + (i + 1) + '</td><td bgcolor="lightgreen">' + pageTitle_array[i] + '</td><td bgcolor="lightblue">' + pageID_array[i] + '</td><td bgcolor="pink">' + pageMode_array[i] + '</td></tr>' + chr(13) + chr(10); } clipBoardText = clipBoardText + '</table></body></html>' + chr(13) + chr(10); System.setClipboard(clipBoardText);} else { // do nothing}]]></SCR> <SCR name="set up"><![CDATA[reportTitle = pageIcon.templateData.cMcq[projPI].cMcqLang[0].reportTitle;pageLabel = pageIcon.templateData.cMcq[projPI].cMcqLang[0].pageLabel;titleLabel = pageIcon.templateData.cMcq[projPI].cMcqLang[0].titleLabel;idLabel = pageIcon.templateData.cMcq[projPI].cMcqLang[0].idLabel;modeLabel = pageIcon.templateData.cMcq[projPI].cMcqLang[0].modeLabel;notFoundMessage = pageIcon.templateData.cMcq[projPI].cMcqLang[0].notFoundMessage;notSetMessage = pageIcon.templateData.cMcq[projPI].cMcqLang[0].notSetMessage;// set text stringsconfirmBtnTxt = pageIcon.templateData.cMcq[projPI].cMcqLang[0].confirmBtnTxt;confirmBtnTip = pageIcon.templateData.cMcq[projPI].cMcqLang[0].confirmBtnTip;if (pageIcon.templateData.cMcq[projPI].cMcqLang[0].confirmBtnWidth != undefined){ confirmBtnWidth = pageIcon.templateData.cMcq[projPI].cMcqLang[0].confirmBtnWidth;} else { confirmBtnWidth = "100";} align = pageIcon.templateData.cMcq[projPI].align;pageMode = pageIcon.templateData.cMcq[projPI].pageMode;if ((pageMode == "development") && (pageIcon.templateData.cMcq[projPI].listToClip != undefined)){ reportStyle = pageIcon.templateData.cMcq[projPI].listToClip; fnListToClipboard();}// save current navigation settingsnextState = rootIcon.nextBtn._visible;backState = rootIcon.backBtn._visible;contState = rootIcon.contButton._visible;progState = rootIcon.progress._visible;tocState = rootIcon.tocBtn._visible;// configure navigation settings for this page;nextSet = pageIcon.templateData.cMcq[projPI].nextSet;backSet = pageIcon.templateData.cMcq[projPI].backSet;progSet = pageIcon.templateData.cMcq[projPI].progSet;tocSet = pageIcon.templateData.cMcq[projPI].tocSet;// action navigation settingsfnSetNavigation();panelWidth = pageIcon.templateData.cMcq[projPI].panelWidth;if (panelWidth == "Small"){ panelW = 300; textW = 440;} else if (panelWidth == "Medium"){ panelW = 450; textW = 290;} else if (panelWidth == "Large"){ panelW = 600; textW = 140;} else { panelW = 760; textW = 0;}if (rootIcon.getProperty('visuals') == "1") { topVOffset = 15;}else { topVOffset = 30;}if (pageIcon.templateData.cMcq[projPI].narration != undefined){ narration = pageIcon.templateData.cMcq[projPI].narration; rootIcon.broadcast('showAudio');}]]></SCR> <DIS w="panelW " h="474 - topVOffset" tabIndex="-1" id="panel" name="panel" x="align == 'Left' ? 20 : textW + 40" y="20 + topVOffset" type="ext" url="templatePath + 'common/whitePanel.swf'"><![CDATA[]]></DIS> <DIS name="instruction" x="align == 'Left' ? panel._x + panelW + 20 : 20" y="panel._y" w="textW" h="10" type="text"><![CDATA[{pageIcon.templateData.cMcq[projPI].instruction}]]></DIS> <DIS textColour="#000000" id="prpt" name="question" x="panel._x + 20" y="panel._y + 20" w="panelW - 40" h="10" type="text"><![CDATA[{pageIcon.templateData.cMcq[projPI].prompt}]]></DIS> <SCR name="makeOptions"><![CDATA[ln = pageIcon.templateData.cMcq[projPI].cOption.length;optionTracking = new Array();if (icon.attributes.built != "true"){ icon.nextSibling.childNodes[1].duplicate(pageIcon.templateData.cMcq[projPI].cOption.length - 2); icon.attributes.built = "true";}]]></SCR> <INT id="ques" name="buttonInteraction" perpetual="1"> <RES w="panelW - 60" textColour="#000000" name="protoOption" type="radio" x="prpt._x" y="prpt._y + prpt._height + 30" label="{pageIcon.templateData.cMcq[projPI].cOption[icon.index()].text}" group="grp" erase="1" exit="0"> <SCR name="trackAnswers"><![CDATA[//track the question for (i = 0; i < ln; i++){ optionTracking[i] = 0; } optionTracking[icon.parentNode.index()] = 1;btnSubmit.setEnabled(true);]]></SCR> </RES> <RES w="panelW - 60" textColour="#000000" name="protoOption" type="radio" x="prpt._x" y="_ytile + 10" label="{pageIcon.templateData.cMcq[projPI].cOption[icon.index()].text}" group="grp" erase="1" exit="0"> <SCR name="trackAnswers"><![CDATA[//track the question for (i = 0; i < ln; i++){ optionTracking[i] = 0; } optionTracking[icon.parentNode.index()] = 1;btnSubmit.setEnabled(true);]]></SCR> </RES> <RES w="confirmBtnWidth" toolTip="{confirmBtnTip}" enabled="0" rs="btnSubmit" swf="templatePath + 'common/button.swf'" name="button" type="button" x="prpt._x" y="_ytile + 10" label="{confirmBtnTxt}" erase="1" exit="0"> <SCR name="goToDestination"><![CDATA[//locate destination of selected questionfor (i = 0; i < ln; i++){ if (optionTracking[i] == 1){ // found selected answer destPageName = pageIcon.templateData.cMcq[projPI].cOption[i].destination; nextSet = pageIcon.templateData.cMcq[projPI].cOption[i].nextSet; backSet = pageIcon.templateData.cMcq[projPI].cOption[i].backSet; progSet = pageIcon.templateData.cMcq[projPI].cOption[i].progSet; tocSet = pageIcon.templateData.cMcq[projPI].cOption[i].tocSet; }}pageFound = "false";if ((destPageName == undefined) || (destPageName == "")) { // pageID not specified message txtPageNotFound.setText(notSetMessage);} else { // a destination has been specified // navigate to destination page for (i = 0; i < pageID_array.length; i++){ if (pageID_array[i] == destPageName){ pageFound = "true"; destinationIndex = i; // setup navigation for next page if (nextSet == undefined){ nextSet = nextState; } if (backSet == undefined){ backSet = backState; } if (progSet == undefined){ progSet = progState; } if (tocSet == undefined){ tocSet = tocState; } // set navigation prior to going to next page fnSetNavigation(); // go to destination page rootIcon.gotoPage(destinationIndex + navOffset); break; } } if (pageFound = "false"){ // pageID was set but not found txtPageNotFound.setText(idLabel + "<br>" + destPageName + "<br>" + notFoundMessage) }}if ((pageMode == "development") && (pageFound == "false")){// set up page not found text box txtPageNotFound.clear(); txtPageNotFound.beginFill(0xFFFFCC, 100); txtPageNotFound.lineStyle(1,0x000000,100); txtPageNotFound.drawRect(-10,-10,250,200,20); txtPageNotFound._visible = 1; txtPageNotFound.wipe('in',0.25,'Strong','easeIn',2) }]]></SCR> </RES> </INT> <SCR name="define Development info"><![CDATA[// this script must run before the routingInfo text icon, otherwise the update of the text property// takes place to late and the destination display for the first tab is undefined// the second tab shows the first tabs destinations etc.if (pageIcon.templateData.cMcq[projPI].pageMode == "development"){ // only show destination information in development mode routingInfoText = ""; routingInfoX = 0; maxTextLength = 0 // loop through options and find longest option text whilst building up routing information for this tab for (i = 0; i < ln; i++){ if (Number(pageIcon.templateData.cMcq[projPI].cOption[i].text.length) > maxTextLength){ maxTextLength = pageIcon.templateData.cMcq[projPI].cOption[i].text.length; } routingInfoText = routingInfoText + "<li>" + pageIcon.templateData.cMcq[projPI].cOption[i].destination + "</li><br>"; } // position destination information // maxTextLength is in characters - need to add a multiplier to allow for character width maxTextLength = maxTextLength * 6.5; routingInfoX += maxTextLength + Number(prpt._x) + 45; routingInfoY = Number(prpt._y) + Number(prpt._height) + 30;} ]]></SCR> <DIS textColour="#FF0000" id="routingInfo" name="routingInfo" x="0" y="0" w="400" h="400" type="text"><![CDATA[{routingInfoText}]]></DIS> <DIS embedVars="1" textColour="#FF0000" textSize="20" id="txtPageNotFound" name="txtPageNotFound" x="panel._x + 10 + ((panelW -180) / 2)" y="panel._y + ((474 - 80 - topVOffset) / 2)" w="180" h="80" type="text"><![CDATA[]]></DIS> <SCR name="finalTidyUp"><![CDATA[// position and display the routing data if in development modeif (pageIcon.templateData.cMcq[projPI].pageMode == "development"){ // must set properties after the icon routingInfo is defined in the project tree routingInfo._x = routingInfoX; routingInfo._y = routingInfoY; routingInfo._visible = true;}else { // hide routing info as this is live usage routingInfo._visible = false;}]]></SCR> </PG>
Expand Down

0 comments on commit a9aeaa0

Please sign in to comment.