Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
path: root/Explore/elr/Science/S0501
diff options
context:
space:
mode:
Diffstat (limited to 'Explore/elr/Science/S0501')
-rwxr-xr-xExplore/elr/Science/S0501/module/blank.html1
-rwxr-xr-xExplore/elr/Science/S0501/module/courseData.xml28
-rwxr-xr-xExplore/elr/Science/S0501/module/lev.swfbin179378 -> 0 bytes
-rwxr-xr-xExplore/elr/Science/S0501/module/module1.htm47
-rwxr-xr-xExplore/elr/Science/S0501/module/module1_controller.html18
-rwxr-xr-xExplore/elr/Science/S0501/module/module1_home.html7
-rwxr-xr-xExplore/elr/Science/S0501/module/swf/L5-01/L5-01.swfbin746342 -> 0 bytes
-rwxr-xr-xExplore/elr/Science/S0501/module/swf/L5-02/L5-02.swfbin443936 -> 0 bytes
-rwxr-xr-xExplore/elr/Science/S0501/module/swf/L5-03/L5-03.swfbin1075351 -> 0 bytes
-rwxr-xr-xExplore/elr/Science/S0501/module/swf/L5-04/L5-04.swfbin1438759 -> 0 bytes
-rwxr-xr-xExplore/elr/Science/S0501/module/swf/L5-05/cirtificate.swfbin302693 -> 0 bytes
-rwxr-xr-xExplore/elr/Science/S0501/shared/images/back.gifbin887 -> 0 bytes
-rwxr-xr-xExplore/elr/Science/S0501/shared/images/forward.gifbin888 -> 0 bytes
-rwxr-xr-xExplore/elr/Science/S0501/shared/scripts/aicc.jarbin5218 -> 0 bytes
-rwxr-xr-xExplore/elr/Science/S0501/shared/scripts/csl_aiccadapter.js714
-rwxr-xr-xExplore/elr/Science/S0501/shared/scripts/csl_cmiinteractions.js191
-rwxr-xr-xExplore/elr/Science/S0501/shared/scripts/csl_extensions.js468
-rwxr-xr-xExplore/elr/Science/S0501/shared/scripts/csl_interactionsadapter.js42
-rwxr-xr-xExplore/elr/Science/S0501/shared/scripts/csl_navigation.js405
-rwxr-xr-xExplore/elr/Science/S0501/shared/scripts/csl_randomassmt.js2973
-rwxr-xr-xExplore/elr/Science/S0501/shared/scripts/csl_scofunctions.js624
-rwxr-xr-xExplore/elr/Science/S0501/shared/scripts/csl_staticwrapper.js56
-rwxr-xr-xExplore/elr/Science/S0501/shared/scripts/csl_utils.js98
23 files changed, 0 insertions, 5672 deletions
diff --git a/Explore/elr/Science/S0501/module/blank.html b/Explore/elr/Science/S0501/module/blank.html
deleted file mode 100755
index 3fc4bb3..0000000
--- a/Explore/elr/Science/S0501/module/blank.html
+++ /dev/null
@@ -1 +0,0 @@
-<HTML><BODY></BODY></HTML> \ No newline at end of file
diff --git a/Explore/elr/Science/S0501/module/courseData.xml b/Explore/elr/Science/S0501/module/courseData.xml
deleted file mode 100755
index ff67b36..0000000
--- a/Explore/elr/Science/S0501/module/courseData.xml
+++ /dev/null
@@ -1,28 +0,0 @@
-<course isflipbook='true'>
- <page>
- <name>Introduction</name>
- <fileName>swf/L5-01/L5-01.swf</fileName>
- <ID>L5-01</ID>
- </page>
- <page ishome='true'>>
- <name>Main Menu</name>
- <fileName>swf/L5-02/L5-02.swf</fileName>
- <ID>L5-02</ID>
- </page>
- <page>
- <name>Plants</name>
- <fileName>swf/L5-03/L5-03.swf</fileName>
- <ID>L5-03</ID>
- </page>
- <page>
- <name>Animals</name>
- <fileName>swf/L5-04/L5-04.swf</fileName>
- <ID>L5-04</ID>
- </page>
- <page>
- <name>Conclusion</name>
- <fileName>swf/L5-05/cirtificate.swf</fileName>
- <ID>L5-05</ID>
- </page>
-
-</course> \ No newline at end of file
diff --git a/Explore/elr/Science/S0501/module/lev.swf b/Explore/elr/Science/S0501/module/lev.swf
deleted file mode 100755
index 34f8c34..0000000
--- a/Explore/elr/Science/S0501/module/lev.swf
+++ /dev/null
Binary files differ
diff --git a/Explore/elr/Science/S0501/module/module1.htm b/Explore/elr/Science/S0501/module/module1.htm
deleted file mode 100755
index ff75d97..0000000
--- a/Explore/elr/Science/S0501/module/module1.htm
+++ /dev/null
@@ -1,47 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
-<html>
-<head>
-<title>Untitled Document</title>
-<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
-<script>
-function closeWin()
-{
-top.close();
-window.close();
-parent.window.close();
-}
-</script>
-<!-- Start of StatCounter Code -->
-<script type="text/javascript">
-var sc_project=3285062;
-var sc_invisible=0;
-var sc_partition=21;
-var sc_security="3cc7ba75";
-</script>
-<script type="text/javascript">
-var gaJsHost = (("https:" == document.location.protocol) ?
-"https://ssl." : "http://www.");
-document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js'
-type='text/javascript'%3E%3C/script%3E"));
-</script>
-<script type="text/javascript">
-try {
-var pageTracker = _gat._getTracker("UA-3767630-1"); pageTracker._trackPageview(); } catch(err) {}</script>
-
-<script type="text/javascript" src="http://www.statcounter.com/counter/counter_xhtml.js"></script><noscript><div class="statcounter"><a class="statcounter" href="http://www.statcounter.com/"><img class="statcounter" src="http://c22.statcounter.com/3285062/0/3cc7ba75/0/" alt="website tracker" /></a></div></noscript>
-<!-- End of StatCounter Code -->
-</head>
-
-<body leftmargin="0" topmargin="0" marginwidth="0" marginheight="0">
-<table width="100%" border="0" cellspacing="0" cellpadding="0">
- <tr>
- <td align="left" valign="top">
- <object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0" width="800" height="600">
- <param name="quality" value="high">
- <param name="SRC" value="lev.swf">
- <embed src="lev.swf" width="800" height="600" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash"></embed></object>
- </td>
- </tr>
-</table>
-</body>
-</html>
diff --git a/Explore/elr/Science/S0501/module/module1_controller.html b/Explore/elr/Science/S0501/module/module1_controller.html
deleted file mode 100755
index bcbaabf..0000000
--- a/Explore/elr/Science/S0501/module/module1_controller.html
+++ /dev/null
@@ -1,18 +0,0 @@
-<html>
-<head>
-<script language='javascript' src='../shared/scripts/csl_scofunctions.js'></script>
-<script language='javascript' src='../shared/scripts/csl_navigation.js'></script>
-<script language='javascript' src='../shared/scripts/csl_extensions.js'></script>
-<script language='javascript' src='../shared/scripts/csl_randomassmt.js'></script>
-<script language='javascript' src='../shared/scripts/csl_utils.js'></script>
-<script language='javascript'>
- addPage("0","module1.htm");
- var contentFrame = parent.frames.content;
- setContentFrame(contentFrame);
- loadPage();
-</script>
-</head>
-<body onunload="unloadPage()" >
-
-</body>
-</html>
diff --git a/Explore/elr/Science/S0501/module/module1_home.html b/Explore/elr/Science/S0501/module/module1_home.html
deleted file mode 100755
index 3661ef8..0000000
--- a/Explore/elr/Science/S0501/module/module1_home.html
+++ /dev/null
@@ -1,7 +0,0 @@
-<HTML>
- <head><title></title></head>
- <frameset rows="*,100%" >
- <frame name="controller" scrolling="no" src="module1_controller.html" noresize frameborder="0" border="0" framespacing="0">
- <frame name="content" src="blank.html" noresize frameborder="0" border="0" framespacing="0">
- </frameset>
-</HTML> \ No newline at end of file
diff --git a/Explore/elr/Science/S0501/module/swf/L5-01/L5-01.swf b/Explore/elr/Science/S0501/module/swf/L5-01/L5-01.swf
deleted file mode 100755
index 82d5b01..0000000
--- a/Explore/elr/Science/S0501/module/swf/L5-01/L5-01.swf
+++ /dev/null
Binary files differ
diff --git a/Explore/elr/Science/S0501/module/swf/L5-02/L5-02.swf b/Explore/elr/Science/S0501/module/swf/L5-02/L5-02.swf
deleted file mode 100755
index 9d0bcfe..0000000
--- a/Explore/elr/Science/S0501/module/swf/L5-02/L5-02.swf
+++ /dev/null
Binary files differ
diff --git a/Explore/elr/Science/S0501/module/swf/L5-03/L5-03.swf b/Explore/elr/Science/S0501/module/swf/L5-03/L5-03.swf
deleted file mode 100755
index 8750c65..0000000
--- a/Explore/elr/Science/S0501/module/swf/L5-03/L5-03.swf
+++ /dev/null
Binary files differ
diff --git a/Explore/elr/Science/S0501/module/swf/L5-04/L5-04.swf b/Explore/elr/Science/S0501/module/swf/L5-04/L5-04.swf
deleted file mode 100755
index 34f8752..0000000
--- a/Explore/elr/Science/S0501/module/swf/L5-04/L5-04.swf
+++ /dev/null
Binary files differ
diff --git a/Explore/elr/Science/S0501/module/swf/L5-05/cirtificate.swf b/Explore/elr/Science/S0501/module/swf/L5-05/cirtificate.swf
deleted file mode 100755
index 9630f8f..0000000
--- a/Explore/elr/Science/S0501/module/swf/L5-05/cirtificate.swf
+++ /dev/null
Binary files differ
diff --git a/Explore/elr/Science/S0501/shared/images/back.gif b/Explore/elr/Science/S0501/shared/images/back.gif
deleted file mode 100755
index b1e83d9..0000000
--- a/Explore/elr/Science/S0501/shared/images/back.gif
+++ /dev/null
Binary files differ
diff --git a/Explore/elr/Science/S0501/shared/images/forward.gif b/Explore/elr/Science/S0501/shared/images/forward.gif
deleted file mode 100755
index 6c42c32..0000000
--- a/Explore/elr/Science/S0501/shared/images/forward.gif
+++ /dev/null
Binary files differ
diff --git a/Explore/elr/Science/S0501/shared/scripts/aicc.jar b/Explore/elr/Science/S0501/shared/scripts/aicc.jar
deleted file mode 100755
index 19462a9..0000000
--- a/Explore/elr/Science/S0501/shared/scripts/aicc.jar
+++ /dev/null
Binary files differ
diff --git a/Explore/elr/Science/S0501/shared/scripts/csl_aiccadapter.js b/Explore/elr/Science/S0501/shared/scripts/csl_aiccadapter.js
deleted file mode 100755
index 100b5fc..0000000
--- a/Explore/elr/Science/S0501/shared/scripts/csl_aiccadapter.js
+++ /dev/null
@@ -1,714 +0,0 @@
-
-
-
-
-// version --- CSL_1.3.0.0
-
-
-//
-// The following variable is used to specify whether to use the aiccconnector.jsp to connect to the LMS or not.
-// The aiccconnector.jsp should be used inside the same folder as the javascript files. This is required because
-// of the domain restrictions when the content is deployed in a different server than the LMS.
-//
-
-var jspUsed = false;
-
-
-var AICCurl = "";
-var AICCsid = "";
-var AICCver = "";
-
-var LMSEnabled = false;
-var aicc_controllerFrame;
-var aicc_controllerFrame_loc;;
-
-var CoreGroup;
-var ObjectiveStatus;
-var AICCCoreLesson = "";
-var isInitialized = false;
-
-var timeout = false;
-var timeoutInMilliSeconds = 3000;
-
-var errorMessage = "";
-var errorCode = "";
-
-
-
-
-// ****************************************************************************************
-// Private functions, to be used only inside this document.
-// ****************************************************************************************/
-
-var agt=navigator.userAgent.toLowerCase();
-
- // *** BROWSER VERSION ***
-
- var is_major = parseInt(navigator.appVersion);
- var is_minor = parseFloat(navigator.appVersion);
-
- var is_nav = ((agt.indexOf('mozilla')!=-1) && (agt.indexOf('spoofer')==-1)
- && (agt.indexOf('compatible') == -1) && (agt.indexOf('opera')==-1)
- && (agt.indexOf('webtv')==-1) && (agt.indexOf('hotjava')==-1));
- var is_nav4up = (is_nav && (is_major >= 4));
-
- var is_nav6 = (is_nav && (is_major == 5));
- var is_nav6up = (is_nav && (is_major >= 5));
-
-
-
- var is_ie = ((agt.indexOf("msie") != -1) && (agt.indexOf("opera") == -1));
- var is_ie4up = (is_ie && (is_major >= 4));
-
-
-//
-// Constructor for object AICCCoreGroup
-//
-//
-
-function AICCCoreGroup(){
- this.studentId = '';
- this.studentName = '';
- this.credit = '';
- this.lessonLocation = '';
- this.lessonStatus = '';
- this.score = '';
- this.time = '';
- this.toString = CoreGroup_toString;
- this.fromString = CoreGroup_fromString;
- this.isValid = false;
-}
-
-
-
-//
-// Constructor for AICCCoreVendor. Currently not implemented.
-//
-//
-function AICCCoreVendor(){
-}
-
-
-function AICCObjectiveStatus(){
-
- this.objectiveID = '';
- this.score = '';
- this.status = '';
-
- this.toString = ObjectiveStatus_toString;
- this.fromString = ObjectiveStatus_fromString;
-}
-
-
-function CoreGroup_toString(){
- var tString = "";
- tString += "student_id=" + this.studentId + "\n";
- tString += "student_name=" + this.studentName + "\n";
- tString += "lesson_location=" + this.lessonLocation + "\n";
- tString += "credit=" + this.credit + "\n";
- tString += "lesson_status=" + this.lessonStatus + "\n";
- tString += "score=" + this.score + "\n";
- tString += "time=" + this.time + "\n";
-
- return tString;
-}
-
-
-
-
-
-function CoreGroup_fromString(aiccdata){
-
- var index;
- var nextGroupIndex;
- var groupString;
- var nextIndex;
-
- var value = "";
- var spaceCharRemover = new RegExp();
- spaceCharRemover.compile("([^\n\r\t\f\v]+)");
-
-
- regExp.compile("error=(.+)");
-
- if(regExp.test(aiccdata)){
- value = RegExp.$1 ;
- if(spaceCharRemover.test(value)) value = RegExp.$1;
- error = parseInt(value);
- }
- else error = -1;
-
-
- if( error == 0 ){
- this.isValid = true;
- }
- else{
- errorCode = "301";
- errorMessage = aiccdata;
- }
-
- index = aiccdata.indexOf("[core]");
- if( index != -1 ){
- index += 6;
- nextGroupIndex = getNextGroupIndex(aiccdata,index);
- groupString = aiccdata.substring( index, nextGroupIndex-1 );
- }
-
-
- if( groupString ){
-
-
-
- regExp.compile("student_id=(.+)");
- if( regExp.test(groupString) ) {
- value = RegExp.$1;
- if(spaceCharRemover.test(value)) value = RegExp.$1;
- this.studentId = value;
- }
-
- else this.studentId = "";
-
-
-
- regExp.compile("student_name=(.+)");
- if( regExp.test(groupString) ) {
- value = RegExp.$1;
- if(spaceCharRemover.test(value)) value = RegExp.$1;
- this.studentName = value;
- }
- else this.studentName = "";
-
-
- regExp.compile("lesson_location=(.+)");
- if( regExp.test(groupString) ) {
- value = RegExp.$1;
- if(spaceCharRemover.test(value)) value = RegExp.$1;
- this.lessonLocation = value;
- }
- else this.lessonLocation = "";
-
-
- regExp.compile("credit=(.+)");
- if( regExp.test(groupString) ) {
- value = RegExp.$1;
- if(spaceCharRemover.test(value)) value = RegExp.$1;
- this.credit = value;
- }
- else this.credit = "";
-
- regExp.compile("lesson_status=(.+)");
- if( regExp.test(groupString) ) {
- value = RegExp.$1;
- if(spaceCharRemover.test(value)) value = RegExp.$1;
- this.lessonStatus = value;
- }
- else this.lessonStatus = "";
-
- regExp.compile("score=(.+)");
- if( regExp.test(groupString) ) {
- value = RegExp.$1;
- if(spaceCharRemover.test(value)) value = RegExp.$1;
- this.score = value;
- }
- else this.score = "0";
-
- regExp.compile("time=(.+)");
- if( regExp.test(groupString) ) {
- value = RegExp.$1;
- if(spaceCharRemover.test(value)) value = RegExp.$1;
- this.time = value;
- }
- else this.time = "00:00:00";
- }
-}
-
-
-
-function ObjectiveStatus_toString(){
- var tString = "";
- tString += "j_id=" + this.objectiveID + "\n";
- tString += "j_score=" + this.score+ "\n";
- tString += "j_status=" + this.status+ "\n";
-
- return tString;
-}
-
-
-function ObjectiveStatus_fromString(aiccdata){
-
- var index = aiccdata.indexOf("[objectives_status]") + 19;
- var nextGroupIndex = getNextGroupIndex(aiccdata,index);
- var groupString = aiccdata.substring( index, nextGroupIndex-1 );
-
- index = aiccdata.indexOf("j_id");
- if( index != -1 ){
- nextIndex = getNextIndex(aiccdata, index+5 );
- this.objectiveID = aiccdata.substring(index, nextIndex );
- }
-
- index = aiccdata.indexOf("j_score") ;
- if( index != -1 ){
- nextIndex = getNextIndex(aiccdata, index+8 );
- this.score = aiccdata.substring(index, nextIndex );
- }
-
- index = aiccdata.indexOf("j_status") ;
- if( index != -1 ){
- nextIndex = getNextIndex(aiccdata, index+9 );
- this.status = aiccdata.substring(index, nextIndex );
- }
-}
-
-
-
-function AICCCoreLesson(){
- this.fromString = CoreLesson_fromString;
-}
-
-
-
-function CoreLesson_toString(){
-
-}
-
-
-
-function parseCoreLessonString(aiccdata){
- var index = aiccdata.indexOf("[core_lesson]");
- if( index != -1 ){
- index = index + 13;
- var nextGroupIndex = getNextGroupIndex(aiccdata,index);
- var groupString = aiccdata.substring( index, nextGroupIndex-1 );
- AICCCoreLesson = groupString;
- }
- else{
- AICCCoreLesson = "";
- }
-}
-
-
-function getNextIndex(data, fromIndex ){
- var nextIndex;
- nextIndex = data.indexOf("\n",fromIndex);
- nextIndex--;
- if(nextIndex <= -1){
- nextIndex = data.length;
- }
- return nextIndex;
-}
-
-function getNextGroupIndex(data,fromIndex) {
- var nextIndex = data.indexOf("[",fromIndex);
- if(nextIndex == -1){
- nextIndex = data.length;
- }
- return nextIndex+1;
-}
-
-
-
-function parseQueryString(url){
- AICCurl = getParamValue("aicc_url",url);
- AICCsid = getParamValue("aicc_sid",url);
-
- AICCsid = unescape(AICCsid);
-
- if( AICCurl ){
- if( AICCurl != "" ){
- AICCurl = unescape(AICCurl);
- if( AICCurl.indexOf("http") == -1 && AICCurl.indexOf("https") == -1 ){
- AICCurl = location.protocol + "//" + AICCurl;
- }
- LMSEnabled = true;
- }
- }
-
-}
-
-function loadAICCResponse(){
- var tempURL = "";
- if( LMSEnabled ){
- if( jspUsed ){
- tempURL = "aiccconnector.jsp?session_id=" + AICCsid + "&aicc_url=" + AICCurl;
- }
- else{
- tempURL = AICCurl + "?command=getparam&session_id=" + AICCsid;
- }
- }
-
- if( ( document.all || is_nav6 || is_nav6up) && LMSEnabled ){
-
- parent.aiccresponse.location.href= tempURL;
-
- }
-}
-
-function getAICCData(){
-
- var tDataString = "";
- if( document.all ){
- if( parent.aiccresponse ){
- tDataString = parent.aiccresponse.document.body.innerText;
- }
- }
- else{
-
- if(( is_nav6 || is_nav6up ) && parent.aiccresponse.document.body){
-
- var tNode = searchForTextNode(parent.aiccresponse.document.body);
-
- if(tNode != null ) tDataString = "" + tNode.nodeValue;
- else tDataString = "";
-
- }
- else if( parent.aiccloader.document.applets['aiccapplet'] ){
-
- parent.aiccloader.document.applets['aiccapplet'].setAICCURL(AICCurl);
-
- parent.aiccloader.document.applets['aiccapplet'].setAICCSession(AICCsid);
-
- tDataString = "" + parent.aiccloader.document.applets['aiccapplet'].getAICCData();
-
- }
- }
-
- CoreGroup = new AICCCoreGroup();
- CoreGroup.fromString( tDataString );
- ObjectiveStatus = new AICCObjectiveStatus();
- ObjectiveStatus.fromString( tDataString );
-
- parseCoreLessonString( tDataString );
- if( isAdapterLoaded() ){
- isInitialized = true;
- return "true";
- }
- else{
- return "false";
- }
-}
-
-
-
-function getParamValue( paramname , querystring ){
-
- var start = querystring.indexOf(paramname);
- var tString = querystring.substring(start,querystring.length );
-
- var end = tString.indexOf("&");
- if( tString.indexOf("&") == -1 ){
- end = tString.length;
- }
-
- tString = tString.substring( tString.indexOf(paramname), end );
- var paramValue = tString.substring( tString.indexOf("=") +1 , tString.length );
-
- return paramValue;
-}
-
-
-function isAdapterLoaded(){
- if( CoreGroup ){
- if( CoreGroup.isValid == true ){
- return true;
- }
- else{
- return false;
- }
- }
- else{
- return false;
- }
-}
-
-
-function holdOnFewSeconds(){
- for(i=0; i < 10000; i++){
-
- }
-}
-
-
-
-//
-// The following functions are the AICC equivalent of the SCORM standard calls.
-//
-
-var tAttempts = 0;
-var isLoading = true;
-var iTotalAttempts = 30;
-
-function setControllerFrame(pFrame, pLoc ){
- aicc_controllerFrame = pFrame;
- aicc_controllerFrame_loc = pLoc;
-}
-
-
-function lookForContentChange(){
- tAttempts++;
- if( tAttempts < iTotalAttempts ){
- if( document.all ){
- var tString = "";
- if( parent.aiccresponse.document.body && parent.aiccresponse.document.body.innerText)
- tString = parent.aiccresponse.document.body.innerText ;
-
- if( tString.length > 0 ){
- aicc_controllerFrame.location.href = aicc_controllerFrame_loc;
- isLoading = false;
- }
- else{
- setTimeout('lookForContentChange()',500);
- }
- }
- else if(is_nav6 || is_nav6up){
- var tString = "";
-
- var tNode = searchForTextNode(parent.aiccresponse.document.body);
- if(tNode && tNode.nodeValue) tString = tNode.nodeValue;
-
-
- if( tString.length > 0 ){
-
- aicc_controllerFrame.location.href = aicc_controllerFrame_loc;
-
- isLoading = false;
-
- }
-
- else{
-
- setTimeout('lookForContentChange()',500);
-
- }
-
- }
- else{
- if(document.applets['aiccapplet'] ){
- aicc_controllerFrame.location.href = aicc_controllerFrame_loc;
- isLoading = false;
- }
- else{
- setTimeout('lookForContentChange()',500);
- }
- }
- }
- else{
- isLoading = false;
- alert("Unable to connect to the AICC LMS. Connection timed out.");
- }
-}
-
-
-
-function initAICCAdapter(){
- if( isInitialized ){
- return "";
- }
- getAICCData();
- return true;
-}
-
-
-function finishAICCAdapter(){
-
- tAICCData = "error=0\nerror_text=Successful\nversion=2.0\naicc_data=\n[core]\n";
- tAICCData += CoreGroup + "\n[core_lesson]\n";
- tAICCData += AICCCoreLesson + "\n[core_vendor]\n\n[objectives_status]\n";
- if( ObjectiveStatus ){
- tAICCData += ObjectiveStatus.toString();
- }
-
- if( isAdapterLoaded() ){
- //tempAICCurl = location.protocol + "//" + AICCurl + "?command=putparam&session_id=" + AICCsid + "&version=2.0";
- tempAICCurl = AICCurl + "?command=putparam&session_id=" + AICCsid + "&version=2.0";
- var tForm = parent.frames['aiccloader'].document.forms['aicc'];
- tForm.action = tempAICCurl;
- tForm.session_id.value = AICCsid;
- tForm.aicc_data.value = tAICCData;
- tForm.submit();
- return "true";
- }
- else{
- return "false";
- }
-
-}
-
-
-function getLastErrorFromAICC(){
- return errorCode;
-}
-
-function getErrorStringFromAICC(){
- return errorMessage;
-}
-
-function getDiagnosticFromAICC(){
- return "";
-}
-
-
-function setValueToAICC(pName, pValue){
-
- if( !isAdapterLoaded()){
- alert("The LMS adapter is not initialized. Can't set the value");
- return "false";
- }
- if( pName == "cmi.core.lesson_location" ){
- CoreGroup.lessonLocation = pValue;
- }
- else if( pName == "cmi.core.lesson_status" ){
- CoreGroup.lessonStatus = pValue;
- }
- else if( pName == "cmi.core.score.raw" ){
- CoreGroup.score = pValue;
- }
- else if( pName == "cmi.suspend_data" ){
- AICCCoreLesson = pValue;
- }
- else if( pName == "cmi.core.total_time" ){
- CoreGroup.time = pValue;
- }
- else{
- if( errorCode != "301" ){
- //errorCode = "401";
- //errorMessage = "The requested Data Model is not supported or read only";
- }
- return "false";
- }
- return "true";
-}
-
-
-function getValueFromAICC(pName){
-
- if( !isAdapterLoaded()){
- alert("The LMS adapter is not initialized. Can't get the value");
- return;
- }
- if( pName == "cmi.core.lesson_location" ){
- return CoreGroup.lessonLocation;
- }
- else if( pName == "cmi.core.lesson_status" ){
- return CoreGroup.lessonStatus;
- }
- else if( pName == "cmi.core.score.raw" ){
- return CoreGroup.score;
- }
- else if( pName == "cmi.suspend_data" ){
- return AICCCoreLesson;
- }
- else if( pName == "cmi.core.total_time" ){
- return CoreGroup.time;
- }
- else if( pName == "cmi.core.student_id" ){
- return CoreGroup.studentId;
- }
- else if( pName == "cmi.core.student_name" ){
- return CoreGroup.studentName;
- }
- else if( pName == "cmi.core.credit" ){
- return CoreGroup.credit;
- }
- else{
- if( errorCode != "301" ){
- //errorCode = "401";
- //errorMessage = "The requested Data Model is not supported or read only";
- }
- return "";
- }
- return "";
-}
-
-
-function commitAICCAdapter(){
-
- tAICCData = "error=0\nerror_text=Successful\nversion=2.0\naicc_data=\n[core]\n";
- tAICCData += CoreGroup + "\n[core_lesson]\n";
- tAICCData += AICCCoreLesson + "\n[core_vendor]\n\n[objectives_status]\n";
- if( ObjectiveStatus ){
- tAICCData += ObjectiveStatus.toString();
- }
-
- if( isAdapterLoaded() ){
- //tempAICCurl = location.protocol + "//" + AICCurl + "?command=putparam&session_id=" + AICCsid + "&version=2.0";
- tempAICCurl = AICCurl + "?command=putparam&session_id=" + AICCsid + "&version=2.0";
- var tForm = parent.frames['aiccDataCommiter'].document.forms['aicc'];
- tForm.action = tempAICCurl;
- tForm.session_id.value = AICCsid;
- tForm.aicc_data.value = tAICCData;
- tForm.submit();
- setTimeout("changeAiccDataCommiterLocation()" , 5000);
- return "true";
- }
- else{
- return "false";
- }
-}
-
-function changeAiccDataCommiterLocation(){
- parent.frames['aiccDataCommiter'].document.location.href = "aiccDataCommiter.html" ;
-}
-
-
-function AICCDataModel(){
- this.LMSInitialize = initAICCAdapter;
- this.LMSFinish = finishAICCAdapter;
- this.LMSCommit = commitAICCAdapter;
- this.LMSGetValue = getValueFromAICC;
- this.LMSSetValue = setValueToAICC;
- this.LMSGetLastError = getLastErrorFromAICC;
- this.LMSGetErrorString = getErrorStringFromAICC;
- this.LMSGetDiagnostic = getDiagnosticFromAICC;
-}
-
-// breadth first search for a text node.
-function searchForTextNode(pNode){
-
- pNode.normalize(); // remove unnecessary text nodes.
- var nodeToReturn= null;
-
- var childNodes = pNode.childNodes;
- var number = childNodes.length;
- var counter = 0;
- var childNode = null;
-
- while( counter < number ){
- childNode= childNodes[counter];
-
- if(childNode.nodeType == 3){
- nodeToReturn = childNode;
- break;
- }
-
- counter++;
- }
-
-
- if(nodeToReturn == null){
- counter = 0;
-
- while( counter < number ){
- childNode= childNodes[counter];
-
- nodeToReturn = searchForTextNode(childNode);
-
- if(nodeToReturn != null) break;
-
- counter++;
- }
- }
-
-
- return nodeToReturn;
-}
-
-
-var regExp = new RegExp();
-
-var aiccapi;
-
-parseQueryString(top.location.search);
-
-if( AICCurl.length > 0 ){
- aiccapi = new AICCDataModel();
-}
diff --git a/Explore/elr/Science/S0501/shared/scripts/csl_cmiinteractions.js b/Explore/elr/Science/S0501/shared/scripts/csl_cmiinteractions.js
deleted file mode 100755
index 62d90a1..0000000
--- a/Explore/elr/Science/S0501/shared/scripts/csl_cmiinteractions.js
+++ /dev/null
@@ -1,191 +0,0 @@
-
-
-
-
-// version --- CSL_1.3.0.0
-
-
-function CMIContainer()
-{
- this.ID = "CMIContainer";
- this.interactions = new Array();
-
- this.addInteraction = _addInteraction;
-
- this.saveInteractions = _saveInteractions;
- this.name = "cmi.interactions";
-}
-
-
-function _addInteraction(pInteractionObject)
-{
- this.interactions[this.interactions.length] = pInteractionObject;
-}
-
-
-function _saveInteractions()
-{
- var interaction = null;
-
- //var communicationsFrame = communicationsFrame;
- if(!communicationsFrame){
- communicationsFrame = self;
- }
- var counter = 0;
- var size = this.interactions.length;
- var name = "cmi.interactions.";
-
- var dmName = "";
- while(counter < size)
- {
- interaction = this.interactions[counter];
- dmName = name + counter;
-
- communicationsFrame.setValue(dmName + ".id" , interaction.id);
- communicationsFrame.setValue(dmName + ".type" , interaction.type);
- communicationsFrame.setValue(dmName + ".time" , interaction.time);
- communicationsFrame.setValue(dmName + ".weighting" , interaction.weighting);
- communicationsFrame.setValue(dmName + ".student_response" , interaction.student_response);
- communicationsFrame.setValue(dmName + ".correct_responses.0.pattern" , interaction.correct_response);
- communicationsFrame.setValue(dmName + ".latency" , interaction.latency);
- communicationsFrame.setValue(dmName + ".result" , interaction.result);
-
- counter++;
- }
-
-
-
-}
-
-function CMIInteraction(pID)
-{
- this.id = pID;
- this.type = "";
- this.time = "00:00:00";
- this.weighting = "0";
- this.student_response = "";
- this.correct_response = ""; // supports only one correct response pattern
- this.latency = "00:00:00";
- this.result = "";
-
- this.setType = _setType;
- this.getType = _getType;
-
- this.setTime = _setTime;
- this.getTime = _getTime;
-
- this.setWeight = _setWeight;
- this.getWeight = _getWeight;
-
- this.setStudentResponse = _setStudentResponse;
- this.getStudentResponse = _getStudentResponse;
-
- this.setCorrectResponse = _setCorrectResponse;
- this.getCorrectResponse = _getCorrectResponse;
-
- this.setLatency = _setLatency;
- this.getLatency = _getLatency;
-
- this.setResult = _setResult;
- this.getResult = _getResult;
-
-
-}
-
-
-
-function _setType(pValue){
- this.type = pValue;
-}
-
-
-
-function _getType(){
- return this.type;
-}
-
-
-
-function _setTime(pValue){
- this.time = pValue;
-}
-
-
-function _getTime(){
- return this.time;
-}
-
-
-
-function _setWeight(pValue){
- this.weight = pValue;
-}
-
-
-function _getWeight(){
- return this.weight;
-}
-
-
-
-function _setStudentResponse(pValue){
- this.student_response = pValue;
-}
-
-
-function _getStudentResponse(){
- return this.student_response;
-}
-
-
-function _setCorrectResponse(pValue){
- this.correct_response = pValue;
-}
-
-function _getCorrectResponse(){
- return this.correct_response;
-}
-
-function _setLatency(pValue){
- this.latency = pValue;
-}
-
-function _getLatency(){
- return this.latency;
-}
-
-function _setResult(pValue){
- this.result = pValue;
-}
-
-function _getResult(){
- return this.result;
-}
-
-var communicationsFrame = null;
-var cmiContainer = new CMIContainer();
-
-
-
-
-function setCommunicationsFrame(pWindow){
- communicationsFrame = pWindow;
-}
-
-
-
-function getInteraction(pId){
- return new CMIInteraction(pId);
-}
-
-
-
-function addInteraction(pInteraction){
- cmiContainer.addInteraction(pInteraction);
-}
-
-
-
-function saveInteractions(){
- cmiContainer.saveInteractions();
-} \ No newline at end of file
diff --git a/Explore/elr/Science/S0501/shared/scripts/csl_extensions.js b/Explore/elr/Science/S0501/shared/scripts/csl_extensions.js
deleted file mode 100755
index b62e200..0000000
--- a/Explore/elr/Science/S0501/shared/scripts/csl_extensions.js
+++ /dev/null
@@ -1,468 +0,0 @@
-
-
-
-
-// version --- CSL_1.3.0.0
-
-var opelapi = findOpelPresentationAPI(window);
-
-var iPopup;
-
-var iPopupHead = "<html><head> <title> DigitalThink, Inc. </title></head><body bgcolor='#dddddd'>";
-iPopupHead += "<style type='text/css'> <!--";
-iPopupHead += ".title { background: #00319C;font: font-size:12px; font-weight: bold; font-family: Arial, Helvetica, sans-serif;color: White;}";
-iPopupHead += ".term {font-family: Verdana, Arial, Helvetica, sans-serif;font-size:12px; font-weight: bold; color: #555555; text-decoration: none;}";
-iPopupHead += ".definition {font-family: Verdana, Arial, Helvetica, sans-serif; font-size:12px; font-weight: normal;color: #555555;text-decoration: none;}";
-iPopupHead += "--></style> </head>";
-
-
-
-
-
-function showGlossary(pTerm,pDefn){
- if(pDefn){
- if( opelapi ){
- opelapi.showGlossary(pTerm,pDefn);
- }
- else{
- var tString = iPopupHead;
- tString += "<table> <TR > <TD class='title'> Glossary </TD></TR> ";
- tString += "<TR><TD class='term'>" + pTerm +" </TD></TR> ";
- tString += "<TR><TD class='definition'>" + pDefn +" </TD></TR> ";
- tString += "<TR><td class='definition'>&nbsp;</td></TR> ";
- tString += "</TABLE> <hr style='color: #00009C;'> </body></html>";
- writeToPopup(tString);
- //alert("Show in Pop Up");
- }
- }else{
- if( opelapi ){
- var definition = getDefinition(pTerm);
- opelapi.showGlossary(pTerm,definition);
- }
- else{
- var tString = iPopupHead;
- tString += "<table> <TR > <TD class='title'> Glossary </TD></TR> ";
- tString += "<TR><TD class='term'>" + pTerm +" </TD></TR> ";
- tString += "<TR><TD class='definition'>" + definition +" </TD></TR> ";
- tString += "<TR><td class='definition'>&nbsp;</td></TR> ";
- tString += "</TABLE> <hr style='color: #00009C;'> </body></html>";
- writeToPopup(tString);
- //alert("Show in Pop Up");
- }
- }
-}
-
-
-
-
-function showTip(pTip){
- if( opelapi ){
- opelapi.showTip(pTip);
- }
- else{
- var tString = iPopupHead;;
- tString += "<table><TR > <TD class='title'> Tips </TD></TR> ";
- tString += "<TR><td class='definition'>" + pTip +" </td></TR> ";
- tString += "<TR><td class='definition'>&nbsp;</td></TR> ";
- tString += "</TABLE> <hr style='color: #00009C;'></body></html>";
- writeToPopup(tString);
- }
-}
-
-
-
-
-function showResources(){
- if( opelapi ){
- opelapi.showResources();
- }
- else{
- var tString = iPopupHead;;
- tString += "<table><TR > <TD class='title'> Not implemented! </TD></TR> ";
- tString += "<TR><td class='definition'> Sorry! This feature is currently being implemented.</td></TR> ";
- tString += "</TABLE></body></html>";
- writeToPopup(tString);
- }
-}
-
-
-
-
-function showTutor(){
- if( opelapi ){
- opelapi.showTutor();
- }
- else{
- var tString = iPopupHead;;
- tString += "<table><TR > <TD class='title'> Oops! </TD></TR> ";
- tString += "<TR><td class='definition'> Sorry! This feature is not supported in the current learning environment. </td></TR> ";
- tString += "</TABLE></body></html>";
- writeToPopup(tString);
- }
-}
-
-
-
-
-function showNotes(){
- if( opelapi ){
- opelapi.showNotes();
- }
- else{
- var tString = iPopupHead;;
- tString += "<table><TR > <TD class='title'> Oops! </TD></TR> ";
- tString += "<TR><td class='definition'> Sorry! This feature is not supported in the current learning environment. </td></TR> ";
- tString += "</TABLE></body></html>";
- writeToPopup(tString);
- }
-}
-
-
-
-
-function showCertificate(){
- if( opelapi ){
- opelapi.handleCertificate();
- }
-}
-
-
-
-function gotoMainMenu(){
- if( opelapi ){
- opelapi.gotoMainMenu();
- }
- else{
- var tString = iPopupHead;;
- tString += "<table><TR > <TD class='title'> Oops! </TD></TR> ";
- tString += "<TR><td class='definition'> Sorry! This feature is not supported in the current learning environment. </td></TR> ";
- tString += "</TABLE></body></html>";
- writeToPopup(tString);
- }
-}
-
-
-
-
-
-
-function courseMenu(){
- if( opelapi ){
- opelapi.gotoMainMenu();
- }
- else{
- var tString = iPopupHead;;
- tString += "<table><TR > <TD class='title'> Oops! </TD></TR> ";
- tString += "<TR><td class='definition'> Sorry! This feature is not supported in the current learning environment. </td></TR> ";
- tString += "</TABLE></body></html>";
- writeToPopup(tString);
- }
-}
-
-
-
-
-
-
-function getTermFromGlossary(pTermName){
- return glossaryObject.getTerm(pTermName);
-}
-
-
-function termExists(pTermName){
- return glossaryObject.termExists(pTermName);
-}
-
-
-
-function getTermList(){
- return glossaryObject.getTermList();
-}
-
-
-
-function getTermCount(){
- return glossaryObject.getTermCount();
-}
-
-
-
-function getDefinition(pTermName){
- if(glossaryObject.termExists(pTermName)){
- return glossaryObject.getTerm(pTermName).getDefinition();
- }else{
- return null;
- }
-}
-
-
-
-function getDefinitionAt(pTermName , pIndex){
- if(glossaryObject.termExists(pTermName)){
- return glossaryObject.getTerm(pTermName).getDefinitionAt(pIndex);
- }else{
- return null;
- }
-}
-
-
-
-function getAllDefinitions(pTermName){
- if(glossaryObject.termExists(pTermName)){
- return glossaryObject.getTerm(pTermName).getAllDefinitions();
- }else{
- return null;
- }
-}
-
-
-
-
-function getDefinitionCount(pTermName){
- if(glossaryObject.termExists(pTermName)){
- return glossaryObject.getTerm(pTermName).getDefinitionCount();
- }else{
- return null;
- }
-}
-
-
-
-function createTerm(pTermName , pDefinition){
- return new GlossaryTerm(pTermName , pDefinition);
-}
-
-
-
-function addTermToGlossary(pTermObject){
- glossaryObject.addTerm(pTermObject);
-}
-
-
-
-
-function getSortedGlossary(){
- return glossaryObject.getSortedGlossary();
-}
-
-
-
-
-/// Private Variables and Functions , DO NOT USE THESE DIRECTLY
-
-
-var glossaryObject = new Glossary();
-
-
-
-function Glossary(){
- this.glossaryList = new Object();
-
-
- this.addTerm = _addTerm;
- this.getTerm = _getTerm;
- this.getTermList = _getTermList;
- this.getTermCount = _getTermCount;
-
- this.getDefinition = _getDefinition;
- this.getSortedGlossary = _getSortedGlossary;
-
- this.termExists = _termExists;
-
- function _addTerm(pGlossaryTermObject){
- this.glossaryList[pGlossaryTermObject.getTerm()] = pGlossaryTermObject;
- }
-
- function _getDefinition(pTermName){
- var tGlossaryTerm = this.glossaryList[pTermName];
- if(tGlossaryTerm){
- return tGlossaryTerm.getDefinition();
- }
- return null;
- }
-
- function _getTermCount(){
- var key;
- var counter = 0;
- for(key in this.glossaryList){
- counter++;
- }
- return counter;
- }
-
- function _getSortedGlossary(){
- var terms = this.getTermList();
- var sortedGlossary = new Array();
-
- terms.sort();
- for(j=0;j<terms.length;j++){
- sortedGlossary[sortedGlossary.length] = this.getTerm(terms[j]);
- }
- return sortedGlossary;
- }
-
-
- function _getTerm(pTermName){
- var key;
- for(key in this.glossaryList){
- if(pTermName == key){
- return this.glossaryList[key]
- }
- }
- return null;
- }
-
- function _getTermList(){
- var termList = new Array();
- var key;
- for(key in this.glossaryList){
- termList[termList.length]= key;
- }
- return termList;
- }
-
- function _termExists(pTermName){
- var exists = false;
- var tTerm = this.glossaryList[pTermName];
- if(tTerm){
- exists = true;
- }
- return exists;
- }
-
-}/// END OF GLOSSARY OBJECT DEFINITION
-
-
-
-function GlossaryTerm(pTermName,pDefinition){
-
- this.term = pTermName;
- this.definitionList = new Array();
- this.definitionList[0] = pDefinition;
-
-
- this.addDefinition = _addDefinition;
-
- this.getDefinition = _getDefinition;
- this.getDefinitionAt = _getDefinitionAt;
- this.getDefinitionCount = _getDefinitionCount;
- this.getAllDefinitions = _getAllDefinitions;
-
- this.getTerm = __getTerm;
-
-
- function _addDefinition(pDefinition){
- this.definitionList[this.definitionList.length] = pDefinition;
- warn("definitionListLength : " , this.definitionList.length);
- }
-
-
- function _getDefinition(){
- var tDefinition = this.definitionList[0];
- if(tDefinition){
- return tDefinition;
- }else{
- return null;
- }
- }
-
-
- function _getDefinitionAt(pIndex){
- var tDefinition = "";
- if( !isNaN(pIndex) && pIndex > -1 && pIndex < this.definitionList.length){
- tDefinition = this.definitionList[Math.floor(pIndex)];
- }
- return tDefinition;
- }
-
- function __getTerm(){
- return this.term;
- }
-
- function _getDefinitionCount(){
- return this.definitionList.length;
- }
-
- function _getAllDefinitions(){
- var tArray = new Array();
- var len = this.definitionList.length;
- var counter = 0;
-
- while(counter < len){
- tArray[counter] = this.definitionList[counter];
- counter++;
- }
- return tArray;
- }
-
-}/// END OF GLOSSARYTERM DEFINITION
-
-
-
-
-
-function writeToPopup( tContent){
- if( !iPopup || !window.csl_popup ){
- iPopup = window.open("","csl_popup",",width=480,height=180,scrollbars=yes");
- }
- iPopup.document.write(tContent);
- iPopup.document.close();
- iPopup.focus();
-}
-
-
-function findOpelPresentationAPI(win){
- //debugger;
- var findAPITries = 0;
- var tChildFrame;
- while ( win != null && win.OpelPresentationAPI == null ){
- findAPITries++;
-
- if (findAPITries > 10) {
- break;
- }
- tChildFrame = findInChildFrames(win);
- if( tChildFrame){
- return tChildFrame;
- }
- win = win.parent;
- }
-
-
-
- if(!win || !win.OpelPresentationAPI) {
- if(win.opener){
- var API = findOpelPresentationAPI(win.opener);
- return API;
- }
- }
-
- if(win) return win.OpelPresentationAPI;
- else return null;
-}
-
-
-function findInChildFrames(win){
- for(i=0; i< win.frames.length ; i++ ){
- if( win.frames[i].OpelPresentationAPI ){
- return win.frames[i];
- }
- }
- return null;
-}
-
-
-function displayURLIfOnline(pURL,pWindowName,pFeatures){
- if(opelapi){
- var isOnline = opelapi.isOnline();
- if(isOnline){
- window.open(pURL,pWindowName,pFeatures);
- }
- else{
- alert('You are in offline mode, please come online and check the link');
- }
- }
- else{
- window.open(pURL,pWindowName,pFeatures);
- }
-} \ No newline at end of file
diff --git a/Explore/elr/Science/S0501/shared/scripts/csl_interactionsadapter.js b/Explore/elr/Science/S0501/shared/scripts/csl_interactionsadapter.js
deleted file mode 100755
index dba251b..0000000
--- a/Explore/elr/Science/S0501/shared/scripts/csl_interactionsadapter.js
+++ /dev/null
@@ -1,42 +0,0 @@
-
-
-
-
-// version --- CSL_1.3.0.0
-
-
-
-function saveAsCMIInteractions()
-{
- var tQuestions = parent.quizheader.iFinalQuestions;
- var tQuestion = null;
-
- var counter = 0;
- var size = tQuestions.length;
- var interaction = null;
-
- while(counter < size)
- {
- tQuestion = tQuestions[counter];
- interaction = getInteraction(tQuestion.id);
-
- if(tQuestion.type == "single" || tQuestion.type == "multiple" ){
- interaction.type= "choice";
- }
-
- interaction.student_response = parent.quizheader.iUserAnswers[counter];
- interaction.correct_response = parent.quizheader.iAnswersArray[counter];
- interaction.weighting = "1";
-
- if(tQuestion.userResponse)
- {
- interaction.result = "correct";
- }else{
- interaction.result = "wrong";
- }
- addInteraction(interaction);
- counter++;
- }
-
- saveInteractions();
-} \ No newline at end of file
diff --git a/Explore/elr/Science/S0501/shared/scripts/csl_navigation.js b/Explore/elr/Science/S0501/shared/scripts/csl_navigation.js
deleted file mode 100755
index 619f079..0000000
--- a/Explore/elr/Science/S0501/shared/scripts/csl_navigation.js
+++ /dev/null
@@ -1,405 +0,0 @@
-
-
-// version --- CSL_1.3.0.0
-
-
-
-var resume = false;
-
-
-var calculateStatus = true;
-
-var loadFirstPage = true;
-
-
-//
-// Public functions
-//
-
-
-
-
-function setContentFrame(pFrame){
- contentFrame = pFrame;
-}
-
-
-
-function getContentFrame(){
- return contentFrame;
-}
-
-
-
-
-function addPage(pageId,pageURL){
- var tPage = new Page(pageId,pageURL);
- pages[pages.length] = tPage;
- tPage.index = Page.counter++;
- iAllowedScore += 1.0;
-}
-
-
-
-
-
-
-function gotoFirstPage(){
- saveCurrentPageData();
- var tPage = pages[0];
- if( tPage ){
- currentPage = 0;
- if(setValue){
- setValue(LESSON_LOCATION,tPage.pageURL);
- }
- contentFrame.document.location.href = selfLocation + tPage.pageURL;
- }
-}
-
-// This function will take the user to the last visited page in the SCO.
-function gotoLastVisitedPage(){
- if( getValue && resume){
- var resumeLocation = getValue(LESSON_LOCATION);
- if(checkResume(resumeLocation)){
- setCurrentPage(resumeLocation);
- contentFrame.document.location.href = resumeLocation;
- }
- else{
- var tPage = pages[0];
-
- if( tPage ){
- currentPage = 0;
- if(setValue){
- setValue(LESSON_LOCATION,tPage.pageURL);
- }
- contentFrame.document.location.href = selfLocation + tPage.pageURL;
- }
- }
- }
- else{
- gotoFirstPage();
- }
-}
-
-
-
-function gotoLastPage(){
- saveCurrentPageData();
- var tPage = pages[pages.length - 1];
- if(tPage){
- currentPage = pages.length - 1;
- if(setValue){
- setValue(LESSON_LOCATION,tPage.pageURL);
- }
- contentFrame.document.location.href = selfLocation + tPage.pageURL;
- }
-}
-
-
-
-
-
-function gotoPreviousPage(){
- saveCurrentPageData();
- if( currentPage > 0 ){
- var tIndex = currentPage - 1;
- var tPage = pages[tIndex];
- if( tPage ){
- currentPage = tIndex;
- if(setValue){
- setValue(LESSON_LOCATION,tPage.pageURL);
- }
- contentFrame.document.location.href = selfLocation + tPage.pageURL;
- }
- }
-}
-
-
-
-
-function gotoNextPage(){
- saveCurrentPageData();
- if( (currentPage + 1) < pages.length ){
- var tIndex = currentPage + 1;
- var tPage = pages[tIndex];
- if( tPage ){
- currentPage = tIndex;
- if(setValue){
- setValue(LESSON_LOCATION,tPage.pageURL);
- }
- contentFrame.document.location.href = selfLocation + tPage.pageURL;
- }
- }
-}
-
-
-function gotoPage(pageid){
-
- saveCurrentPageData();
- pageid = getPageIndex(pageid);
- if( pageid < pages.length && pageid >= 0){
- var tPage = pages[pageid];
- if( tPage ){
- currentPage = pageid;
- if(setValue){
- setValue(LESSON_LOCATION,tPage.pageURL);
- }
- contentFrame.document.location.href = selfLocation + tPage.pageURL;
- }
- }
-
-
-}
-
-function launchSCO(){
- getDataFromPersistence();
- selfLocation = self.location.href.substring(0, self.location.href.lastIndexOf("/") +1 ) ;
- if( loadFirstPage ){
- gotoLastVisitedPage();
- }
-}
-
-function exitSCO(){
- updateData();
-}
-
-
-
-function setCurrentPageStatus(status){
-
- var tPage = pages[currentPage];
- if( tPage ){
- if( status == "VISITED" ){
- tPage.userScore = 1.0;
- tPage.userStatus = VISITED;
- }
- else if( status == "PASSED" ){
- tPage.userScore = 1.0;
- tPage.userStatus = PASSED;
- }
- else if( status == "REVIEW" ){
- tPage.userScore = 0.0;
- tPage.userStatus = REVIEW;
- }
- else{
- tPage.userStatus = VISITED;
- }
- }
-}
-
-// The following variable and functions are used internally within this Javascripts and hence
-// should not be used outside this Javascript.
-
-
-var pages = new Array();
-// Current Page Index //
-var currentPage = -1;
-// Content Frame , Represents the frame in which the SCO's html pages will be launched
-var contentFrame = null;
-
-// Resume Location //
-var LESSON_LOCATION = "cmi.core.lesson_location";
-
-var iAllowedScore = 0.0;
-
-var iTotalUserScore = 0.0;
-var selfLocation = "";
-
-var UNVISITED = -1;
-var REVIEW = 0;
-var VISITED = 1;
-var PASSED = 2;
-
-var iUserStatus = "incomplete";
-
-
-
-function Page(pageId,pageURL){
- this.pageId = pageId;
- this.pageURL = pageURL;
- this.index = 0;
-
- this.userStatus = UNVISITED;
- this.userScore = 0.0;
-}
-Page.counter = 0;
-
-//
-// This function is added so that the navigation controls can change their
-// Appearance if there isnt any next page
-//
-
-function hasNextPage(){
- var retValue = false;
- var tIndex = currentPage + 1;
- if(pages[tIndex]){
- retValue = true;
- }
- return retValue;
-}
-
-//
-// This function is added so that the navigation controls can change their
-// Appearance if there isnt any previous page
-//
-
-function hasPreviousPage(){
- var retValue = false;
- var tIndex = currentPage - 1;
-
- if(pages[tIndex]){
- retValue = true;
- }
- return retValue;
-}
-
-
-function setCurrentPage(launchURL){
- var size = pages.length;
- var counter = 0;
- var tPage = null;
- matchFound = true;
-
- while(counter < size){
- tPage = pages[counter];
- if(tPage.pageURL == launchURL){
- matchFound = true;
- break;
- }
- counter++;
- }
- if(!matchFound){
- currentPage = 0;
- }else{
- currentPage = counter;
- }
-}
-
-function saveCurrentPageData(){
- if( currentPage > -1 ){
- setCurrentPageStatus("VISITED");
- }
-}
-
-function setPageStatus(pPageData){
- //debugger;
- var statusesData= pPageData.split(';');
- var length = statusesData.length;
- var counter = 0;
-
- var tData = "";
- var tDataArray = null;
- var pageId = "";
- var pageStatus = "";
- var pageStatuses= new Object();
-
- // get all the statuses.
- while( counter < length ){
- tData = statusesData[counter] + "";
- if(tData){
- tDataArray= tData.split(',');
- pageId = tDataArray[0];// pageid is first .
- pageStatus= tDataArray[1];// status is next .
-
- pageStatuses[pageId] = pageStatus;
- }
- counter++;
- }
-
- // now set all of them.
- for(pageindex = 0; pageindex < pages.length; pageindex++){
- var tPage = pages[pageindex];
- var tPageId = tPage.pageId + "";
- var tStatus;
-
- if( tPage ){
- tStatus = pageStatuses[tPageId];
-
- if(tStatus){
- tStatus= parseInt(tStatus);
- }
- else{
- tStatus = UNVISITED;
- }
-
- tPage.userStatus= tStatus;
- if( tPage.userStatus > REVIEW ){
- tPage.userScore = 1.0;
- }
- else{
- tPage.userScore = 0.0;
- }
- }
- }
-}
-
-
-function getDataFromPersistence(){
- var tPageData = "";
- if( self.getElementFromSuspendData ){
- tPageData = getElementFromSuspendData("page_data");
- }
- setPageStatus(tPageData);
-}
-
-function updateData(){
- saveCurrentPageData();
- var tString ="";
- iTotalUserScore = 0;
- for( i=0; i< pages.length; i++){
- tPage = pages[i];
- if( tPage ){
- if( tPage.userStatus > REVIEW ){
- iTotalUserScore += tPage.userScore;
- }
- tString += tPage.pageId + "," + tPage.userStatus + ";";
- }
- }
-
- if( calculateStatus && iAllowedScore > 0 ){
- if( iTotalUserScore >= iAllowedScore ){
- iUserStatus = "completed";
- }
- else{
- iUserStatus = "incomplete";
- }
- //setValue("cmi.core.score.raw",iTotalUserScore);
- setValue("cmi.core.lesson_status",iUserStatus );
- }
- if( self.addToSuspendData ){
- addToSuspendData("page_data",tString);
- }
-}
-
-
-function getPageIndex(pageid){
- var tPage;
- for( i=0; i < pages.length; i++){
- tPage = pages[i];
-
- if( tPage ){
- if( tPage.pageId == pageid ){
- return i;
- }
- }
- }
- return -1;
-}
-
-function checkResume(pLocation){
- var isValid = false;
- var counter = 0;
- var length = pages.length;
- var location = null;
-
- while(counter < length){
- location= pages[counter].pageURL;
- if(pLocation == location){
- isValid = true;
- break;
- }
- counter++;
- }
-
- return isValid;
-}
diff --git a/Explore/elr/Science/S0501/shared/scripts/csl_randomassmt.js b/Explore/elr/Science/S0501/shared/scripts/csl_randomassmt.js
deleted file mode 100755
index 1538995..0000000
--- a/Explore/elr/Science/S0501/shared/scripts/csl_randomassmt.js
+++ /dev/null
@@ -1,2973 +0,0 @@
-
-
-
-// version --- CSL_1.3.0.0
-
-
-
-var passThreshold;
-
-
-
-var retainOrder = false;
-
-
-
-var isSingleQuestionPerPage=false;
-
-
-
-var isRandomized = true;
-
-var showPercentage = false;
-
-var repeatAcrossAttempts = true;
-
-
-
-var doAttemptAllAnswers = true;
-
-var resumeAssessment = false;
-
-
-
-
-
-
-var flashWidth=250;
-
-
-
-var flashHeight=250;
-
-
-function Answer(pText,pTrue){
- this.text = pText;
- this.correct = pTrue;
-}
-
-
-
-
-function Question(pId,pText,pType,pImageSRC){
-
- this.launchURL = "";
- this.id = pId;
-
- this.index = 0;
-
- this.questionIdCache = new Object();
-
- this.text = pText;
- this.type = pType;
- this.image = pImageSRC;
-
- this.correctFeedbackText = "";
- this.incorrectFeedbackText = "";
- this.mandatory = false;
- this.leafQuestion = true;
- this.mandatoryChildren = new Array();
- this.randomChildren = new Array();
- this.numberOfQuestionsToReturn = 0;
-
- this.answers = new Array();
- this.addAnswer = addAnswer;
- this.isAdded = false;
- this.userResponse = false;
-
- this.toString = questionToString;
-
- this.setCorrectFeedback = setCorrectFeedback;
- this.setIncorrectFeedback = setIncorrectFeedback;
- this.setLaunchURL = setLaunchURL;
- this.getLaunchURL = getLaunchURL;
-
- this.setId = setId;
- this.getId = getId;
-
- this.setMandatory = setMandatory;
- this.getMandatory = getMandatory;
-
- this.isLeafQuestion = isLeafQuestion;
-
- this.setNumberOfQuestionsToReturn = setNumberOfQuestionsToReturn;
- this.getNumberOfQuestionsToReturn = getNumberOfQuestionsToReturn;
-
- this.getTotalNumberOfQuestions = getTotalNumberOfQuestions;
- this.getNumberOfRandomQuestions = getNumberOfRandomQuestions;
- this.getNumberOfMandatoryQuestions= getNumberOfMandatoryQuestions;
-
- this.addQuestion = addQuestion;
- this.addMandatoryQuestions = addMandatoryQuestions;
- this.getRandomQuestion = getRandomQuestion;
- this.getMandatoryQuestion = getMandatoryQuestion;
- this.getRandomizedQuestions = getRandomizedQuestions;
-
- this.getDifferentRandomQuestions = _getDifferentRandomQuestions;
- this.getNumberOfPreviousQuestions = _getNumberOfPreviousQuestions;
-
- this.getQuestionById = getQuestionById;
- this.containsQuestion = containsQuestion;
-
- this.threshold = 0; // field is valid only for pool question objects.
- this.setThreshold = _setThreshold;
- this.getThreshold = _getThreshold;
-
- this.rolledUpStatus = false; // if the number of questions passed are more than threshold , value will be true.
- this.getRolledUpStatus = _getRolledUpStatus;
-
- this.instructionText = "";
-
- this.setInstructionText = _setInstructionText;
- this.getInstructionText = _getInstructionText;
-
-
- //Added to suit the render functionality
- this.questionRenderer = _defaultQuestionRenderer;
- this.resultRenderer = _defaultResultRenderer;
- this.choiceRenderer = _defaultChoiceRenderer;
- this.resultChoiceRenderer = _defaultResultChoiceRenderer;
- this.defaultSummaryCorrectRenderer = _defaultSummaryCorrectRenderer;
- this.defaultSummaryInCorrectRenderer=_defaultSummaryInCorrectRenderer;
- this.defaultSummaryNotAttemptedRenderer= _defaultSummaryNotAttemptedRenderer;
- this.getRenderer = _getRenderer;
- this.getResultRenderer = _getResultRenderer;
- this.getChoiceRenderer = _getChoiceRenderer;
- this.getResultChoiceRenderer = _getResultChoiceRenderer;
- this.InstructionTextRenderer=_defaultInstructionTextRenderer;
- this.instantCorrectFeedbackRenderer=_defaultInstantCorrectFeedbackRenderer;
- this.instantInCorrectFeedbackRenderer=_defaultInstantInCorrectFeedbackRenderer;
-
-
-}
-
-function getLaunchURL(){
- return this.launchURL;
-}
-function setLaunchURL(pURL){
- this.launchURL = pURL;
-}
-function setId(pId){
- this.id = pId;
-}
-function getId(){
- return this.id;
-}
-
-
-
-
-function _setInstructionText(pText){
- this.instructionText = pText;
-}
-
-function _getInstructionText(){
- return this.instructionText;
-}
-
-
-
-function setMandatory(pBoolean){
- this.mandatory = pBoolean;
-}
-
-
-
-function setCorrectFeedback(pFeedback){
- this.correctFeedbackText = pFeedback;
-}
-
-
-
-function setIncorrectFeedback(pFeedback){
- this.incorrectFeedbackText = pFeedback;
-}
-
-
-function getMandatory(){
- return this.mandatory;
-}
-
-function isLeafQuestion(){
- return this.leafQuestion;
-}
-
-
-
-function addQuestion(pQuestion){
- if(pQuestion.getMandatory()){
- this.mandatoryChildren[this.mandatoryChildren.length]= pQuestion;
- }else{
- this.randomChildren[this.randomChildren.length] = pQuestion;
- }
- this.leafQuestion = false;
- this.questionIdCache[pQuestion.getId()] = true;
-}
-
-
-
-
-function addAnswer(pIndex , pAnswer){
- this.answers[pIndex] = pAnswer;
-}
-function getTotalNumberOfQuestions(){
- return this.randomChildren.length + this.mandatoryChildren.length;
-}
-function getNumberOfRandomQuestions(){
- return this.randomChildren.length;
-}
-function getNumberOfMandatoryQuestions(){
- return this.mandatoryChildren.length;
-}
-
-
-
-function setNumberOfQuestionsToReturn(pNumber){
- var tNum = parseInt(pNumber);
-
- if(tNum >= 0 ){
- if(tNum < this.mandatoryChildren.length || tNum > (this.mandatoryChildren.length + this.randomChildren.length))
- {
- var message = "The Number Of Mandatory Questions are more than the number of questions you have asked"
- message += " or the total number of questions are less";
- alert(message);
- }
- else
- {
- this.numberOfQuestionsToReturn = tNum;
- }
- }else{
- alert("Enter a positive number for setNumberOfQuestionsToReturn");
- }
-}
-
-function getNumberOfQuestionsToReturn(){
- return this.numberOfQuestionsToReturn;
-}
-
-
-function getRandomQuestion(pIndex){
- var retValue = null;
- if(pIndex < this.randomChildren.length && pIndex >= 0){
- retValue = this.randomChildren[pIndex];
- }
-return retValue;
-}
-
-function getMandatoryQuestion(pIndex){
- var retValue = null;
- if(pIndex < this.mandatoryChildren.length && pIndex >= 0){
- retValue = this.mandatoryChildren[pIndex];
- }
-return retValue;
-}
-
-
-var tPoolQuestionOrder = "";
-
-function getRandomizedQuestions(pOrder,pArray , pIdCache){
-
- var numOfMandatory = this.getNumberOfMandatoryQuestions();
- var numOfRandomQuestions = this.getNumberOfRandomQuestions() - 1;
- var totalQuestions = this.getNumberOfQuestionsToReturn();
-
- var numberToRandomize = totalQuestions - numOfMandatory;
-
- var tQuestion = this.getRandomQuestion(0);
-
- if( !tQuestion ){
- tQuestion = this.getMandatoryQuestion(0);
- }
- // randomize the 'normal' way only if repeatAcrossAttempts is true OR repeatAcrossAttempts is false AND child questions are pools.
- // the repeatAcrossAttempts logic is NOT applied to child pool questions.
-
- if( (!retainOrder && repeatAcrossAttempts) || (!retainOrder && !repeatAcrossAttempts && !tQuestion.isLeafQuestion()) ){
- if(numberToRandomize >= 0 ){
-
- tPoolQuestionOrder = "";
- this.addMandatoryQuestions(pOrder,pArray , pIdCache);
-
- var randomIndex = null;
- var previousIndexCache = new Object();
-
- var iterator = 0;
- var tQuestion = null;
-
- while(iterator < numberToRandomize){
- if( isRandomized ){
- randomIndex = Math.round(Math.random()*numOfRandomQuestions);
- }
- else{
- randomIndex = iterator;
- }
- // The following line is added to avoid an error thrown in Solaris/mozilla.
- randomIndex = parseInt( randomIndex );
- if(!previousIndexCache[randomIndex]){
- tQuestion = this.getRandomQuestion(randomIndex);
- if(tQuestion.isLeafQuestion()){
- pArray[pArray.length] = tQuestion;
-
- // Added by Jayaprakash A
- tQuestion.index = pArray.length -1;
-
- pOrder[ORDER] += tQuestion.getId() + ",";
- tPoolQuestionOrder += tQuestion.getId() + ",";
- }
- else{
- //debugger;
- tQuestion.getRandomizedQuestions(pOrder,pArray,pIdCache);
- }
- previousIndexCache[randomIndex] = true;
- ++iterator;
- }
- }
- }
- }else{
- this.getDifferentRandomQuestions(pOrder , pArray , pIdCache);
- }
- //addToSuspendData( this.id + "_pool" , tPoolQuestionOrder );
- tPoolQuestionOrder = "";
- return pArray;
-}
-
-function _getDifferentRandomQuestions(pOrder , pArray , pPreviousQuestionsCache){
- var numOfMandatory = this.getNumberOfMandatoryQuestions();
- var numOfRandomQuestions = this.getNumberOfRandomQuestions() - 1;
- var totalQuestions = this.getNumberOfQuestionsToReturn();
-
- var numberToRandomize = totalQuestions - numOfMandatory;
-
- //debugger;
- var numberOfPreviousQuestions = this.getNumberOfPreviousQuestions(pPreviousQuestionsCache);
- //alert("numberOfPreviousQuestions== "+numberOfPreviousQuestions);
- //alert("this.getTotalNumberOfQuestions()== "+this.getTotalNumberOfQuestions());
- if( numberOfPreviousQuestions < this.getTotalNumberOfQuestions() ){
- if(numberToRandomize >= 0 ){
-
- tPoolQuestionOrder = "";
- this.addMandatoryQuestions(pOrder,pArray , pPreviousQuestionsCache);
-
- var randomIndex = null;
- var previousIndexCache = new Object();
-
- var iterator = 0;
- var tQuestion = null;
-
- while(iterator < numberToRandomize){
- if( isRandomized ){
- randomIndex = Math.round(Math.random()*numOfRandomQuestions);
- }
- else{
- randomIndex = iterator;
- }
- // The following line is added to avoid an error thrown in Solaris/mozilla.
- randomIndex = parseInt( randomIndex );
- if(!previousIndexCache[randomIndex]){
- tQuestion = this.getRandomQuestion(randomIndex);
- if( !pPreviousQuestionsCache[tQuestion.getId()] ){
-
- if(tQuestion.isLeafQuestion()){
- pArray[pArray.length] = tQuestion;
-
- // Added by Jayaprakash A
- tQuestion.index = pArray.length -1;
-
- pOrder[ORDER] += tQuestion.getId() + ",";
- tPoolQuestionOrder += tQuestion.getId() + ",";
- }
- // this should never be the case , since this pool contains only leaf child questions.
- else{
- tQuestion.getDifferentRandomQuestions(pOrder,pArray , pPreviousQuestionsCache) ;
- }
- previousIndexCache[randomIndex] = true;
- ++iterator;
- }
- }
- }
- }
- }else{
- alert("Cannot Randomize , all the questions have been exhausted !");
- return pArray;
- }
- //addToSuspendData( this.id + "_pool" , tPoolQuestionOrder );
- tPoolQuestionOrder = "";
- return pArray;
-}
-
-function _getNumberOfPreviousQuestions(pIdCache){
- var count = 0;
- for(var id in pIdCache){
- if( this.containsQuestion(id) ){
- count++;
- }
- }
- return count;
-}
-
-function addMandatoryQuestions(pOrder,pArray , pIdCache){
- var index = this.mandatoryChildren.length;
- for(var i = 0 ; i < index ; i ++){
- if(this.mandatoryChildren[i].isLeafQuestion()){
- pArray[pArray.length] = this.mandatoryChildren[i];
-
- // Added by Jayaprakash A
- this.mandatoryChildren[i].index = pArray.length -1;
-
- pOrder[ORDER] += this.mandatoryChildren[i].getId() + ",";
- tPoolQuestionOrder += this.mandatoryChildren[i].getId() + ",";
- }
- else{
- this.mandatoryChildren[i].getRandomizedQuestions(pOrder,pArray , pIdCache);
- }
- }
-}
-
-function containsQuestion(pId){
- var retValue = this.questionIdCache[pId];
- if(!retValue){
- retValue = false;
- }
-return retValue;
-}
-
-function getQuestionById(pId){
- var tQuestion = null;
- var size = this.randomChildren.length;
- for(var i = 0 ; i < size ; i ++){
- if(pId == this.randomChildren[i].getId()){
- tQuestion = this.randomChildren[i];
- break;
- }
- }
- if(null == tQuestion){
- size = this.mandatoryChildren.length;
- for(var i = 0 ; i < size ; i ++){
- if(pId == this.mandatoryChildren[i].getId()){
- tQuestion = this.mandatoryChildren[i];
- break;
- }
- }
- }
-return tQuestion;
-}
-
-function _getThreshold(){
- return this.threshold;
-}
-
-function _setThreshold(pThreshold){
- if(!isNaN(pThreshold)){
- if(pThreshold <= this.getNumberOfQuestionsToReturn()){
- this.threshold = pThreshold;
- }else{
- alert("Threshold is greater than numberOfQuestionsToReturn for pool : " + this.id + " !");
- }
- }
-}
-
-function _getRolledUpStatus(pQuestions){
- //debugger;
- var status = false;
-
- var tQuestion = this.getRandomQuestion(0);
- if(!tQuestion)
- {
- tQuestion= this.getMandatoryQuestion(0);
- }
-
- if(tQuestion)
- {
- if(tQuestion.isLeafQuestion())
- {
- var counter = 0;
- var size = pQuestions.length;
- var tQuestion = null;
- var numOfCorrect= 0;
-
- while(counter < size)
- {
- tQuestion = pQuestions[counter];
- if(this.containsQuestion(tQuestion.id))
- {
- if(tQuestion.userResponse)
- {
- numOfCorrect++;
- }
- }
- counter++;
- }
-
- if(numOfCorrect >= this.threshold)
- {
- status = true;
- }
- }else
- {
- var counter = 0;
- var size = this.mandatoryChildren.length;
- var tQuestion = null;
- var numOfCorrect= 0;
-
- while(counter < size)
- {
- tQuestion = this.mandatoryChildren[counter];
- if(tQuestion.getRolledUpStatus(pQuestions))
- {
- numOfCorrect++;
- }
- counter++;
- }
-
- counter = 0;
- size = this.randomChildren.length;
- tQuestion = null;
- numOfCorrect = 0;
-
- while(counter < size)
- {
- tQuestion = this.randomChildren[counter];
- if(tQuestion.getRolledUpStatus(pQuestions))
- {
- numOfCorrect++;
- }
- counter++;
- }
-
- if(numOfCorrect >= this.threshold)
- {
- status = true;
- }
- }
- }
-
- return status;
-}
-
-/// END OF QUESTION OBJECT DEFINITION
-
-
-
-function getPoolStatus(pPoolId){
- var status = false;
-
- if(pPoolId == iQuestions.id)
- {
- status = iQuestions.getRolledUpStatus(iHeaderFrame.iFinalQuestions);
- }else{
- tQuestionPool = searchQuestionPool(iQuestions , pPoolId);
-
- if(tQuestionPool)
- {
- status = tQuestionPool.getRolledUpStatus(iHeaderFrame.iFinalQuestions);
- }
- else{
- alert("Pool with ID : " + pPoolId + " not found !");
- }
- }
- return status;
-}
-
-function searchQuestionPool(pParentQuestion , pPoolId){
- var tQuestion = null;
-
- if(pParentQuestion.containsQuestion(pPoolId))
- {
- tQuestion = pParentQuestion.getQuestionById(pPoolId);
- }else{
-
- // check if parent pool contains leaf questions....
-
- var tChildQuestion = pParentQuestion.mandatoryChildren[0];
- if(!tChildQuestion)
- {
- tChildQuestion = pParentQuestion.randomChildren[0];
- }
-
- if(!tChildQuestion || tChildQuestion.isLeafQuestion())
- {
- return tQuestion;
- }
-
- // end of check
-
- var counter = 0;
- var size = pParentQuestion.mandatoryChildren.length;
- tChildQuestion = null;
-
-
- while(counter < size && tQuestion == null)
- {
- tChildQuestion = pParentQuestion.mandatoryChildren[counter];
- if(tChildQuestion.containsQuestion(pPoolId))
- {
- return tChildQuestion.getQuestionById(pPoolId);
- }
- else
- {
- tQuestion = searchQuestionPool(tChildQuestion , pPoolId);
- }
- counter++;
- }
-
-
- if(!tQuestion){
- counter = 0;
- size = pParentQuestion.randomChildren.length;
- tChildQuestion = null;
-
-
- while(counter < size && tQuestion == null)
- {
- tChildQuestion = pParentQuestion.randomChildren[counter];
- if(tChildQuestion.containsQuestion(pPoolId))
- {
- return tChildQuestion.getQuestionById(pPoolId);
- }
- else
- {
- tQuestion = searchQuestionPool(tChildQuestion , pPoolId);
- }
- counter++;
- }
- }
- }
- return tQuestion;
-}
-
-
-
-
-function writeOutput(pContentPage){
- if( !pContentPage ){
- alert("Content document not found.");
- return;
- }
-
- iContentPage = pContentPage;
- initializeVariables();
-
- var tString = "";
- var tQuestion ;
-
- randomizeQuestions();
-
- for (i=0; i < displayQuestions ; i++){
-
- tQuestion = iFinalQuestions[i];
- if( tQuestion ){
- tString += generateQuestionHTML( tQuestion, i );
- }
- }
-
- iContentPage.document.write(tString);
- iContentPage.document.close();
-}
-
-
-
-/// This function gets the user answers from the suspend data and populates the Javascript Datamodels.
-
-
-
-
-function initializeResults(){
-
- var totalQuestions = 0;
- var tQuestionOrderString = "";
- var tUserResponse = "";
-
- tQuestionOrderString = getElementFromSuspendData("questionorder") ;
-
- var tOrderArray = tQuestionOrderString.split(',');
- var order;
- // Added by Jayaprakash A
- var tQuestion;
- if(!retainOrder && !repeatAcrossAttempts){
- for( qs=tOrderArray.length - displayQuestions; qs < tOrderArray.length ; qs++ ){
- order = parseInt( tOrderArray[qs] );
- if( !isNaN( order ) ){
- tQuestion = retrieveQuestion(order,iQuestions);
- iFinalQuestions[totalQuestions] = tQuestion;
- // Added by Jayaprakash A
- tQuestion.index = iFinalQuestions.length -1;
- totalQuestions++;
- }
- }
- }else{
- for( qs=0; qs < tOrderArray.length ; qs++ ){
- order = parseInt( tOrderArray[qs] );
- if( !isNaN( order ) ){
- tQuestion = retrieveQuestion(order,iQuestions);
- iFinalQuestions[totalQuestions] = tQuestion;
- // Added by Jayaprakash A
- tQuestion.index = iFinalQuestions.length -1;
- totalQuestions++;
- }
- }
- }
-
- retrieveUserResponse();
-}
-
-
-
-
-function gererateResultSummary(pContentPage){
- if( !pContentPage ){
- alert("Content document not found.");
- return;
- }
-
- iFinalQuestions = iHeaderFrame.iFinalQuestions;
- userSelected = iHeaderFrame.iUserAnswers;
-
- score = iHeaderFrame.score;
- iContentPage = pContentPage;
- var tString = '';
- if( showPercentage ){
- score = (score/displayQuestions) * 100;
- score = Math.round(score);
- tString += '<font face="Arial,Helvetica" size="2">You had <strong>' + score +'% </strong> out of ' + displayQuestions + ' questions.';
- }
- else{
- tString += '<font face="Arial,Helvetica" size="2">You had <strong>' + score +' correct answers</strong> out of ' + displayQuestions + ' questions.';
- }
-
- initializeVariables();
-
- var tQuestion;
- for (i=0; i < displayQuestions; i++ ){
- tQuestion = iFinalQuestions[i];
- if( tQuestion ){
- var qn = i+1;
- if( tQuestion.userResponse ){
- tString += '<hr> Question ' + qn + ' - ' + insertCommas( userSelected[i] ) + ' -- <bold>Correct</bold><p>';
- }
- else{
- if(userSelected[i]){
- tString += '<hr> Question ' + qn + ' - ' + insertCommas( userSelected[i] ) + ' -- <bold><font color="red">Incorrect</font></bold><p>';
- }
- else{
- tString += '<hr> Question ' + qn + ' - ' + insertCommas( userSelected[i] ) + ' -- <bold><font color="red">Not Attempted</font></bold><p>';
- }
-
- }
- }
- }
- tString += '<hr></font>';
- iContentPage.document.write(tString);
- iContentPage.document.close();
-}
-
-
-
-
-function generateResultExplanation(pContentPage){
- if( !pContentPage ){
- alert("Content document not found.");
- return;
- }
-
- iFinalQuestions = iHeaderFrame.iFinalQuestions;
- userSelected = iHeaderFrame.iUserAnswers;
-
-
-
- iContentPage = pContentPage;
-
- var tString = "";
- tString += '<form name="qz">';
- for (i=0; i < displayQuestions ; i++){
- tQuestion = iFinalQuestions[i];
- if( tQuestion ){
- tString += generateFeedback( tQuestion, i );
- }
- tString += "<br>";
- }
- tString += '</form>';
- iContentPage.document.write(tString);
- iContentPage.document.close();
-}
-
-
-
-
-function setQuestionsForm(pForm){
- iQuestionsForm = pForm;
-}
-
-
-
-
-function answeredAllQuestions(){
- var allAnswered = true;
- for(var i=0;i< displayQuestions;i++){
- if(!userSelected[i]){
- allAnswered = false;
- break;
- }
- }
- return allAnswered;
-}
-
-
-
-
-
-
-
-function submitAnswers(resultsPage){
- if ( !resultsPage ){
- alert("Valid Results page has to be passed");
- return;
- }
-
-
- var tAttempted = 0;
- var allAnswered = true;
- var firstUnAnswered;
- getCheckboxValue();
- setUserResponses();
-
- if(doAttemptAllAnswers){
- for(var i=0;i< displayQuestions;i++){
- if(userSelected[i]){
- if( userSelected[i].length <= 0 ){
- allAnswered = false;
- firstUnAnswered = iFinalQuestions[i].id;
- unAnsweredQuestionNumber = i+1;
- break;
- }
- }
- else{
- allAnswered = false;
- firstUnAnswered = iFinalQuestions[i].id;
- unAnsweredQuestionNumber = i+1;
- break;
- }
- }
- }
- iHeaderFrame.iFinalQuestions = iFinalQuestions;
- iHeaderFrame.iUserAnswers = userSelected;
- iHeaderFrame.iAnswersArray= iAnswersArray;
- iHeaderFrame.score = score;
-
- if (getElementFromSuspendData("lesson_status") == "attempted"){
- addToSuspendData("lesson_status" , "");
- }
- if( !allAnswered ){
- alert("You did not answer question number " + unAnsweredQuestionNumber + " !");
- tLoc = iContentPage.location.href;
- if( tLoc.indexOf("#") != -1 ){
- tLoc = tLoc.substring(0,tLoc.indexOf("#") );
- }
- tLoc += "#qs" + firstUnAnswered;
- if(document.all) {
- iContentPage.location.href = tLoc;
- }
- else if(document.layers) {
- iContentPage.document.URL = tLoc;
- }
- }
- else{
-
- saveUserAnswers();
-
- var scorePercentage = ((score/displayQuestions)*100);
- var scoreRound = Math.floor(scorePercentage);
- if( showPercentage ){
- doLMSSetValue("cmi.core.score.raw",scorePercentage);
- doLMSSetValue("cmi.core.score.max",100);
- }
- else{
- doLMSSetValue("cmi.core.score.raw",score);
- doLMSSetValue("cmi.core.score.max",iFinalQuestions.length);
- }
- if ( scoreRound >= passThreshold ) {
- doLMSSetValue("cmi.core.lesson_status","passed");
- }else{
- doLMSSetValue("cmi.core.lesson_status","failed");
- }
-
- // remove list of questions marked for review
- addToSuspendData("questionIndex" , "");
-
- addToSuspendData("QuestionId" , "");
-
- addToSuspendData("answersselected" , "");
-
- // commit answers.
- if(!resumeAssessment)
- addToSuspendData("questionorder", totalQuestionOrder );// add question order to suspend data
- doLMSCommit();
- iContentPage.location.href = resultsPage;
- }
-}
-
-
-
-
- function setHeaderFrame(pHeader){
- iHeaderFrame = pHeader;
- }
-
-
-//
-// Following variables and functions are only for internal purposes and should
-// not be used outside of this javascript file.
-//
-
-var ORDER = "ORDER";
-var qOrder = new Object();
-qOrder[ORDER] = "";
-
-
-
-var iHeaderFrame;
-
-var totalQuestions = 0;
-var currentQuestion = 0;
-var questionNumbers = 1;
-var currentIndex = 1;
-var iQuestionOrder = "";
-var iQuestions = new Question("PARENT","","");
-var iFinalQuestions = new Array();
-var iAnswersArray = new Array();
-var iRandomIndices = new Array();
-var userSelected = new Array();
-var totalQuestionOrder = "";
-var score = 0;
-
-var iContentPage;
-
-var iQuestionsForm;
-
-
-var reviewQuestions = new Array();
-var userAnswers = new Array();
-var reviewQuestionNumber = new Array(); // list of questionIds marked for review
-var reviewQuestionCache = new Object(); // for fast lookup ,
-
-
-function initializeVariables(){
-
- currentQuestion = 0;
- questionNumbers = 1;
- currentIndex = 1;
- iQuestionOrder = "";
-
-}
-
-
-function randomizeQuestions(){
-
- var tSuspendData = doLMSGetValue("cmi.suspend_data");
- if( iFinalQuestions.length > 0 ){
- return;
- }
- //debugger;
- if( tSuspendData.indexOf("questionorder") == -1 || retainOrder == false ){
- var tQuestionOrderString = getElementFromSuspendData("questionorder") ;
- var tOrderArray = tQuestionOrderString.split(',');
- var tIdCache = generatePreviousIdCache(tOrderArray);
-
- var questionOrder = "";
-
- iQuestions.getRandomizedQuestions(qOrder,iFinalQuestions , tIdCache);
- iQuestionOrder = qOrder[ORDER].substring(0,qOrder[ORDER].length - 1); // Remove the trailing comma ',' //
-
- if (tQuestionOrderString && !repeatAcrossAttempts){
- questionOrder = tQuestionOrderString + "," + iQuestionOrder ;
- }
- else{
- questionOrder = iQuestionOrder ;
- }
- totalQuestionOrder = questionOrder;
- if(resumeAssessment)
- addToSuspendData("questionorder", questionOrder ); //commented by Manu , moved to submitAnswers()
- }
- else{
- var tTotalQuestionPools = iQuestions.mandatoryChildren.length + iQuestions.randomChildren.length;
- var tQuestionPool;
- var tQuestionPoolId = "";
- var totalQuestions = 0;
- var tQuestionOrderString = "";
- var tUserResponse = "";
-
- tQuestionOrderString = getElementFromSuspendData("questionorder") ;
-
- totalQuestionOrder = tQuestionOrderString;
-
- var tOrderArray = tQuestionOrderString.split(',');
- var order;
- // Added by Jayaprakash A
- var tQuestion;
- for( qs=0; qs < tOrderArray.length ; qs++ ){
- order = parseInt( tOrderArray[qs] );
- if( !isNaN( order ) ){
- tQuestion = retrieveQuestion(order,iQuestions);
- iFinalQuestions[totalQuestions] = tQuestion;
- // Added by Jayaprakash A
- tQuestion.index = iFinalQuestions.length -1;
- totalQuestions++;
- }
- }
-
- if(resumeAssessment) {
- var isFinished = false;
- //if (getElementFromSuspendData("lesson_status") == "attempted") isFinished = true ;
- //if( isFinished ){
- currentQustionIndex = getQuestionId();
- getUserSelectedArrayInSuspendData();
- //}
-
- if(tSuspendData.indexOf("questionIndex") != -1){
- // get the list of questions marked for review.
- var marked = getElementFromSuspendData("questionIndex");
- var indices = marked.split(',');
- var length = indices.length ;
- var counter = 0;
- var questionId = "";
- while(counter < length){
- questionId = indices[counter];
- // remove duplicate entries if any.
- if(questionId && !reviewQuestionCache[questionId]){
- reviewQuestionNumber[reviewQuestionNumber.length] = questionId;
- reviewQuestionCache[questionId] = 1; // dummy value , just need the questionId
- }
- counter++;
- }
- }
- }
-
-
- }
-}
-
-function generatePreviousIdCache(pOrderArray){
- var size = pOrderArray.length;
- var counter = 0;
- var tString = "";
- var IdCache = new Object();
-
- while(counter < size){
- tString = pOrderArray[counter];
- IdCache[tString] = true;
- counter++;
- }
- return IdCache;
-}
-
-
-function retrieveQuestion(pId,pParentQuestion){
- var tQuestion = null;
- if( pParentQuestion.containsQuestion(pId) ){
- tQuestion = pParentQuestion.getQuestionById(pId);
- }
- else{
- tQuestion = searchInChildQuestions(pId , pParentQuestion);
- }
- return tQuestion;
-}
-
-function saveUserAnswers(){
- if( userSelected != null ){
- tString = "";
- for(i=0; i < userSelected.length; i++){
- if(userSelected[i])
- tString += userSelected[i];
- if( i < (userSelected.length - 1) ){
- tString += ";";
- }
- }
- }
- addToSuspendData("answers",tString);
-}
-
-/// This function gets the user answers from the suspend data and populates the Javascript Datamodels.
-
-function retrieveUserResponse(){
- var tString = getElementFromSuspendData("answers");
- if( tString ){
- var tArray = tString.split(";");
- }
- for( i=0; i < tArray.length; i++){
-
- userSelected[i] = tArray[i];
- }
- setUserResponses();
- return userSelected;
-}
-
-
-function searchInChildQuestions(pId , pParentQuestion){
- var size = pParentQuestion.getNumberOfRandomQuestions();
- var tQuestion = null;
- var tParent = null;
-
- for(var index = 0 ; index < size ; index++){
- tParent = pParentQuestion.getRandomQuestion(index);
- if( tParent.containsQuestion(pId) ){
- tQuestion = tParent.getQuestionById(pId);
- break;
- }
- else{
- tQuestion = searchInChildQuestions(pId , tParent);
- }
- }
- if(null == tQuestion){
- size = pParentQuestion.getNumberOfMandatoryQuestions();
- for(var index = 0 ; index < size ; index++){
- tParent = pParentQuestion.getMandatoryQuestion(index);
- if( tParent.containsQuestion(pId) ){
- tQuestion = tParent.getQuestionById(pId);
- break;
- }
- else{
- tQuestion = searchInChildQuestions(pId , tParent);
- }
- }
- }
- return tQuestion;
-}
-
-
-
-
-function questionToString(){
- return generateQuestionHTML(this, this.index );
-}
-
-
-function generateQuestionHTML( pQuestion, index ){
- var tString = "";
- var tAnswers = pQuestion.answers;
- var tAnswer;
- var tType = "radio";
-
- var correctAnsString = "";
-
- if( pQuestion.type == "multiple" ){
- tType = "checkbox";
-
- tString += '<tr><td> <a name="qs' + pQuestion.id + '">&nbsp;</a></td> </tr>';
- tString += '<tr>\n <td colspan="3"> \n';
- tString += '<div class="qtext" name="qs' + pQuestion.id + 'Layer"><table cellpadding=0 cellspacing=0 border=0><tr><td valign=top align="left" width=25><span name="' + pQuestion.id + 'question" class="qtext"> \n';
- tString += (index + 1) + '. &nbsp;&nbsp;</td><td valign=top align=left class="qtext" colspan=3 width=575>' + pQuestion.text + '<br><br>';
- tString += '</span> \n';
-
- if(!pQuestion.instructionText){
- tString += '<span class="blue">Please select&nbsp;&nbsp;<b>all the correct answers</b>.</span></td></tr>\n';
- }else{
- tString += pQuestion.instructionText;
- }
- }
- else{
- tString += '<tr><td> <a name="qs' + pQuestion.id + '">&nbsp;</a></td> </tr>';
- tString += '<tr>\n <td colspan="3"> \n';
- tString += '<div class="qtext" name="qs' + pQuestion.id + 'Layer"><table cellpadding=0 cellspacing=0 border=0 width=600><tr><td valign=top width=25 align=left><span name="' + pQuestion.id + 'question" class="qtext"> \n';
- tString += (index + 1) + '. &nbsp;&nbsp;</td><td valign=top class="qtext" align=left colspan=3 width=575>' + pQuestion.text + '<br><br>';
- tString += '</span> \n';
- if(!pQuestion.instructionText){
- tString += '<span class="blue">Please select <b>the best answer</b>.</span></td></tr>\n';
- }
- else{
- tString += pQuestion.instructionText;
- }
-
- }
- var questionLetter = 1;
- if(doLMSGetValue("cmi.suspend_data").indexOf("lesson_status") != -1){
- tArray = getUserResponse();
- for( j=0; j < tAnswers.length; j++ ){
- if( tAnswers[j].correct == true ){
- if( correctAnsString.length > 0 ){
- correctAnsString += "," + (j+1)
- }
- else{
- correctAnsString += (j+1);
- }
- }
- var userclick=userAttemptedValues((index + 1),tArray,questionLetter);
-
- tString += '<tr><td width=15 align=left>&nbsp;</td><td valign=top width=15 align=left><span class="choice" name="' + pQuestion.id +'choice' + (j+1) + '">\n';
- if( pQuestion.type == 'multiple' ){
- if(userclick=="true" && resumeAssessment){
- tString += '<input name="qs' + pQuestion.id + 'choiceBtn" value="' + (j+1) + '" type="checkbox" checked onClick="checkCurentQuestionOnClick(\'' + pQuestion.index + '\')">\n';
- }
- else{
- tString += '<input name="qs' + pQuestion.id + 'choiceBtn" value="' + (j+1) + '" type="checkbox" onClick="checkCurentQuestionOnClick(\'' + pQuestion.index + '\')">\n';
- }
- }
- else if( pQuestion.type == 'single' ){
- if(userclick=="true" && resumeAssessment){
- tString += '<input name="qs'+ pQuestion.id + 'RadioInp" type="radio" checked onClick="checkCurentQuestionOnClick(\'' + pQuestion.index + '\')">\n';
- }
- else{
- tString += '<input name="qs'+ pQuestion.id + 'RadioInp" type="radio" onClick="checkCurentQuestionOnClick(\'' + pQuestion.index + '\')">\n';
- }
- }
-
- questionLetters = String.fromCharCode( questionLetter + 64 );
-
- tString += '</input></td><td valign=top class="qtext" align="left" width=15>' + questionLetters + '.&nbsp;&nbsp;</td><td valign=top align=left class="qtext" width=555>';
- tString += tAnswers[j].text;
- tString += '<br><br></td></tr>\n';
- questionLetter++;
- }
- }
- else{
- for( j=0; j < tAnswers.length; j++ ){
- if( tAnswers[j].correct == true ){
- if( correctAnsString.length > 0 ){
- correctAnsString += "," + (j+1);
- }
- else{
- correctAnsString += (j+1);
- }
- }
- tString += '<tr><td width=15 align=left>&nbsp;</td><td valign=top width=15 align=left><span class="choice" name="' + pQuestion.id +'choice' + (j+1) + '">\n';
- if( pQuestion.type == 'multiple' ){
- tString += '<input name="qs' + pQuestion.id + 'choiceBtn" value="' + (j+1) + '" type="checkbox" onClick="checkCurentQuestionOnClick(\'' + pQuestion.index + '\')">\n';
- }
- else if( pQuestion.type == 'single' ){
- tString += '<input name="qs'+ pQuestion.id + 'RadioInp" type="radio" onClick="checkCurentQuestionOnClick(\'' + pQuestion.index + '\')">\n';
- }
-
- questionLetters = String.fromCharCode( questionLetter + 64 );
-
- tString += '</input></td><td valign=top class="qtext" align="left" width=15>' + questionLetters + '.&nbsp;&nbsp;</td><td valign=top align=left class="qtext" width=555>';
- tString += tAnswers[j].text;
- tString += '<br><br></td></tr>\n';
- questionLetter++;
- }
- }
- tString += '</p>\n';
- tString += '</td></tr></table></div>\n';
- tString += '</td>\n</tr>\n';
-
- questionNumbers++;
- iAnswersArray[ index ] = correctAnsString;
- return tString;
-}
-
-function checkIfSelected(userAnswer, option){
- option = new String(option);
- if( userAnswer.indexOf(option) == -1 ){
- return "";
- }
- else{
- return "checked";
- }
-}
-
-
-function generateFeedback(pQuestion, index){
-
- var tString = "";
- var tAnswers = pQuestion.answers;
- var correctAnsString = "";
-
- if( pQuestion.type == "multiple" ){
- tType = "checkbox";
-
- tString += '<table><tr>\n <td colspan="3"> \n';
- tString += '<div class="qtext" name="' + pQuestion.id + 'Layer"><table cellpadding=0 cellspacing=0 border=0><tr><td valign=top class="qtext" width=25><span name="' + pQuestion.id + 'question" class="qtext"> \n';
- tString += questionNumbers + '. &nbsp;&nbsp;</td><td valign=top class="qtext" colspan=3 width=575>' + pQuestion.text + '<br><br>';
- tString += '</span> \n';
-
-
- if(!pQuestion.instructionText){
- tString += '<span class="blue">Please select&nbsp;&nbsp; <b>all the correct answers</b>.</span></td></tr>\n';
- }else{
- tString += pQuestion.instructionText;
- }
- tString += '<br>\n';
- }
- else{
- tString += '<table><tr>\n <td colspan="3"> \n';
- tString += '<div class="qtext" name="' + pQuestion.id + 'Layer"><table cellpadding=0 cellspacing=0 border=0><tr><td valign=top class="qtext" align=left width=25><span name="' + pQuestion.id + 'question" class="qtext"> \n';
- tString += questionNumbers + '. &nbsp;&nbsp;</td><td valign=top align=left class="qtext" colspan=3 width=575>' + pQuestion.text + '<br><br>';
- tString += '</span> \n';
-
-
- if(!pQuestion.instructionText){
- tString += '<span class="blue">Please select <b>the best answer</b>.</span></td></tr>\n';
- }else{
- tString += pQuestion.instructionText;
- }
-
- }
- var questionLetter = 1;
- for( j=0; j < tAnswers.length; j++ ){
- if( tAnswers[j].correct == true ){
- if( correctAnsString.length > 0 ){
- correctAnsString += "," + (j+1);
- }
- else{
- correctAnsString += (j+1);
- }
- }
-
- tString += '<tr><td width=15>&nbsp;</td><td valign=top align=left width=15><span class="choice" name="' + pQuestion.id +'choice' + (j+1) + '">\n';
- if( pQuestion.type == 'multiple' ){
- tString += '<input disabled name="' + pQuestion.id + 'choiceBtn" value="' + (j+1) + '" type="checkbox" ' +checkIfSelected(userSelected[index],j+1) + ' >\n';
- }
- else if( pQuestion.type == 'single' ){
- tString += '<input disabled name="'+ pQuestion.id + 'RadioInp" type="radio" ' + checkIfSelected(userSelected[index],j+1) + ' >\n';
- }
- questionLetters = String.fromCharCode( questionLetter + 64 );
-
- tString += '</input></td><td valign=top width=15 align=left class="qtext">' + questionLetters + '.&nbsp;&nbsp;</td><td valign=top class="qtext" align=left width=555>';
- tString += tAnswers[j].text;
- tString += '<br><br></td></tr>\n';
- questionLetter++;
- }
-
- var tFeedback;
- if( pQuestion.userResponse ){
- tFeedback = pQuestion.correctFeedbackText;
- }
- else{
- tFeedback = pQuestion.incorrectFeedbackText;
- }
- if( tFeedback == "" ){
- tFeedback = correctAnswerString(correctAnsString);
- }
-
- tString += '</p>';
- tString += '<tr><td> </td><td colspan=3 class="qtext">' + tFeedback;
- tString += '</td></tr></table></div>\n';
- tString += '</td>\n</tr></table>\n';
-
- questionNumbers++;
- return tString;
-
-}
-
-
-function insertCommas(pString){
- var newString = "";
- var tChars = pString.split(",");
- var tNumber;
- for( chars=0; chars < tChars.length ; chars++){
-
- tNumber = tChars[chars];
- tNumber = parseInt( tNumber );
-
- if( !isNaN( tNumber ) ){
- if( tChars.length > 1 ){
- if( chars >= tChars.length -1 ){
- newString += " and ";
- }
-
- }
-
- newString += String.fromCharCode( tNumber + 64 ) ;
-
- if( tChars.length > 1 && (chars < tChars.length -2 ) ){
- newString += ",";
- }
- }
- }
- return newString;
-}
-
-
-function correctAnswerString(answers){
- var tString = "";
-
- tString += "The correct answer";
- if( answers.length == 1 ){
- tString += " is " + insertCommas(answers) + ".";
- }
- else{
- tString += "s are " + insertCommas(answers) + ".";
- }
- return tString;
-}
-
- function updateRadio(queName,value){
- //userSelected[queName] = value;
- // commented by surekha as the below function works same as above
- checkCurentQuestionOnClick(queName);
- }
-
-
- function setUserResponses(){
- score = 0;
- for(var i=0;i< iFinalQuestions.length;i++){
- generateQuestionHTML(iFinalQuestions[i],i);
- if(userSelected[i] == iAnswersArray[i]){
- iFinalQuestions[i].userResponse = true;
- score++;
- }
- }
- }
-
-
- function getCheckboxValue() {
- var tQuestion;
- for( i=0; i < displayQuestions; i++){
- tQuestion = iFinalQuestions[i];
- checkForCorrectResponse( tQuestion,i );
- }
-}
-
-//updated by Sampad in order to handle single Question per Page with resume functionality.. to get back user response
-
-function checkForCorrectResponse(pQuestion,index){
- var tStr = "";
-
- if(isSingleQuestionPerPage)
- {
- var f = parent.quizheader.iQuestionsForm;
- }
- else
- {
- var f = iQuestionsForm;
- }
-
- //var f = iQuestionsForm;//iContentPage.document.xp;
- var selCount =0;
- var button;
- var radiobutton;
-
- tStr = "";
- if( pQuestion ){
- if( pQuestion.type == 'multiple' ){
- eval('button = f.qs' + pQuestion.id + 'choiceBtn' );
- if( button ){
- for( j=0; j < button.length; j++ ){
- if( button[j].checked ){
- if( tStr.length > 0 ){
- tStr += "," + button[j].value;
- }
- else{
- tStr += button[j].value;
- }
- }
- }
- userSelected[index] = tStr;
- //alert("question" + index + "response" +tStr);
- }
- }
- else{
- var temp='radiobutton = f.qs' + pQuestion.id + 'RadioInp';
- eval(temp );
- if( radiobutton ){
- for( j=0; j < radiobutton.length; j++ ){
- if( radiobutton[j].checked ){
- tStr += j+1;
- }
- }
- userSelected[index] = tStr;
- //alert("question" + index + "response" +tStr);
- }
- }
- }
-}
-
-
-var currentQustionIndex = 0;
-
-
-
-
-function hasNextQuestion(){
- var tReturn = false;
- if( currentQustionIndex < iFinalQuestions.length ){
- tReturn = true;
- }
- return tReturn;
-}
-
-
-
-function getNextQuestion(){
- var tQuestion = iFinalQuestions[currentQustionIndex];
- addToSuspendData("QuestionId" , currentQustionIndex);
- currentQustionIndex++;
- doLMSCommit();
- return tQuestion;
-}
-
-
-
-function getNextQuestionString(){
- var tQuestion = getNextQuestion();
- var tString = "";
- if( tQuestion ){
- tString = generateQuestionHTML(tQuestion, currentQustionIndex-1 );
- }
- return tString;
-}
-
-
-
-function checkCurrentQuestion(){
- var tQuestion = iFinalQuestions[currentQustionIndex-1];
- checkForCorrectResponse( tQuestion, currentQustionIndex-1 );
-}
-
-
-
-function getFeedbackString(){
- var tQuestion = iFinalQuestions[currentQustionIndex-1];
- if(userSelected[currentQustionIndex-1] == iAnswersArray[currentQustionIndex-1]){
- return tQuestion.correctFeedbackText;
- }
- else{
- return tQuestion.incorrectFeedbackText;
- }
-}
-
-
-
-function getUserSelectedArrayInSuspendData(){
- var tString = getElementFromSuspendData("answersselected");
- if(tString.indexOf("#") !=0 ){
- var tArray = tString.split("#");
- for(var l=0; l < tArray.length; l++){
- var tIndex = tArray[l].indexOf(",");
- var tQuestionNumber = tArray[l].substring(0,tIndex);
- userSelected[tQuestionNumber] = tArray[l].substring((tIndex+1),tArray[l].length);
- }
- }
- else{
- userSelected[tString.substring(0,tString.indexOf(","))] = tString.substring(tString.indexOf(","),tString.length);
- }
-
- return userSelected;
-}
-
-function getQuestionId(){
- var tSuspendDataValue = doLMSGetValue("cmi.suspend_data");
- if(tSuspendDataValue.indexOf("QuestionId") != -1){
- userattempts = getElementFromSuspendData("QuestionId");
- if(!userattempts) userattempts = 0;
- if(userattempts > displayQuestions - 1) userattempts = 0;
- return parseInt(userattempts);
- }
- else{
- return 0;
- }
-}
-
-function getUserResponse(){
- var userSelectedAnswer = new Array();
- var tString = getElementFromSuspendData("answersselected");
- var tArray = tString.split("#");
- for(var l=0; l < tArray.length; l++){
- var tIndex = tArray[l].indexOf(",");
- var tQuestionNumber = tArray[l].substring(0,tIndex);
- userSelectedAnswer[tQuestionNumber] = tArray[l].substring(tIndex,(tArray[l].length+1))+",";
- }
- userAnswers = userSelectedAnswer;
- return userSelectedAnswer;
-}
-
-//updated by Sampad in order to handle single Question per Page with resume functionality.. to get back user response
-
-function checkCurentQuestionOnClick(pId){
- addToSuspendData("lesson_status","attempted");
- var tUserString = "";
- var tUserSelection = new Array();
- if(isSingleQuestionPerPage)
- {
- var tQuestion = parent.quizheader.iFinalQuestions[pId];
- }
- else
- {
- var tQuestion = iFinalQuestions[pId];
- }
- //alert("user Selected"+tQuestion);
- checkForCorrectResponse( tQuestion, pId );
-
- tUserSelection[pId] = userSelected[pId];
- for(i=0;i<tUserSelection.length;i++){
- if(tUserSelection[i]){
- tUserString = i+","+tUserSelection[i];
- }
- }
- var tUserSuspendValue = getElementFromSuspendData("answersselected");
- tUserSuspendValue = "#" + tUserSuspendValue;
-
- if(tUserString == ""){
- var tIndex = tUserSuspendValue.indexOf("#"+pId+",");
- tUserSuspendValue = tUserSuspendValue.substring(1,tUserSuspendValue.length);
- if(tIndex !=-1){
- var tUserArrayInSuspendData = getUserSelectedArrayInSuspendData();
- tUserArrayInSuspendData[pId] = "";
- for(var l=0;l<tUserArrayInSuspendData.length;l++){
- tUserString = tUserString + l + "," + tUserArrayInSuspendData[l] + "#";
- }
- tUserString = tUserString.substring(0,(tUserString.length-1));
- }
- }
- else{
- if(doLMSGetValue("cmi.suspend_data").indexOf("answersselected") != -1 && tUserSuspendValue != "#"){
- var tIndex = tUserString.indexOf(",");
- var toCheck = "#" + tUserString.substring(0,(tIndex+1));
- var tUserAttemptedIndex = tUserSuspendValue.indexOf(toCheck);
- tUserSuspendValue = tUserSuspendValue.substring(1,tUserSuspendValue.length);
- if(tUserAttemptedIndex == -1){
- tUserString = tUserSuspendValue + "#" + tUserString;
- }
- else{
- var tUserArrayInSuspendData = getUserSelectedArrayInSuspendData();
- tUserArrayInSuspendData[tUserString.substring(0,tIndex)] = tUserString.substring((tIndex+1),tUserString.length);
- tUserString = "";
- for(var l=0;l<tUserArrayInSuspendData.length;l++){
-
- tUserString = tUserString + l + "," + tUserArrayInSuspendData[l] + "#";
- }
- tUserString = tUserString.substring(0,(tUserString.length-1));
- }
- }
- }
- addToSuspendData("answersselected",tUserString);
-
-}
-
-
-function userAttemptedValues(pQid,pArray,pQindex){
- var temp;
- var userselectedvalues=pArray[pQid-1];
- if(userselectedvalues){
- temp=','+(pQindex)+',';
- if(userselectedvalues.indexOf(temp) >= 0){
- return "true";
- }
- else
- return "false";
- }
-}
-
-
-
-
-function markQuestion(pQuestionIndex,pReviewChecked){
- var marked = "";
- if(doLMSGetValue("cmi.suspend_data").indexOf("questionIndex") != -1){
- if(pReviewChecked=="true"){
- reviewQuestionNumber[reviewQuestionNumber.length] = pQuestionIndex;
- reviewQuestionCache[pQuestionIndex] = 1;
- marked = getElementFromSuspendData("questionIndex") + ","+pQuestionIndex;
- }
- else{
- reviewQuestionCache[pQuestionIndex] = null;
- removeIndex(pQuestionIndex);
- marked = getElementFromSuspendData("questionIndex");
- }
- }
- else{
- reviewQuestionNumber[reviewQuestionNumber.length] = pQuestionIndex;
- marked = ","+pQuestionIndex;
- }
- addToSuspendData("questionIndex" , marked);
- doLMSCommit();
-}
-
-function getIndicesOfQuestionsMarkedForReview(){
- //reviewQuestionNumber = reviewQuestionNumber.sort();
- return reviewQuestionNumber;
-}
-
-
-function selectQuestion(pIndex){
- currentQustionIndex = parseInt(pIndex);
- reviewQuestionCache[pIndex] = null;
- removeIndex(pIndex);
-}
-
-function removeIndex(pIndex){
- var counter = 0;
- var length = reviewQuestionNumber.length;
- var index = 0;
- while(counter < length){
- index = reviewQuestionNumber[counter];
- if(index == pIndex){
- reviewQuestionNumber[counter] = null;
- var marked = getElementFromSuspendData("questionIndex");
- marked = marked.substring(1,marked.length);
-
- addToSuspendData("questionIndex" , "");
- var indices = marked.split(',');
- indices[counter] = null;
- var tempMarked = "";
- for(var i=0;i<indices.length;i++){
- tempMarked = tempMarked + indices[i] + ",";
- }
-
- if(tempMarked != "")
- tempMarked = tempMarked.substring(0,(tempMarked.length-1));
-
- tempMarked = "," + tempMarked;
-
- addToSuspendData("questionIndex" , tempMarked);
- doLMSCommit();
- }
- counter++;
- }
-}
-
-function getUserSelected(){
- return userAnswers;
-}
-
-
-
-
-function hasPreviousQuestion(){
- if (currentQustionIndex > 0) return true;
- else return false;
-}
-
-
-
-function decrementCursor(){
- if (currentQustionIndex > 0) currentQustionIndex--;
- if (currentQustionIndex > 0) currentQustionIndex--;
-}
-
-
-
-
-
-
-
-
-
-
-
-
-
-//Start Change of Model by Manu/Monalika/Sampad/Arijit
-
-//Base token to declare in the assessment page
-
-
-
-
-var QUESTIONS_TOKEN = "@@QUESTIONS@@";
-
-//Question numbers after randomization
-
-
-var QUESTION_ID_TOKEN = "@@QUESTION_ID@@";
-
-//Question Stem text
-
-
-
-var QUESTION_TEXT_TOKEN = "@@QUESTION_TEXT@@";
-//Image text
-
-
-
-var IMAGE_TEXT_TOKEN = "@@IMAGE_TEXT@@";
-
-
-//Instruction text
-
-var QUESTION_ITEXT_TOKEN= "@@QUESTION_ITEXT@@";
-
-//Question display number
-
-
-var QUESTION_NUMBER = "@@QUESTION_NUMBER@@";
-
-//Choices or distracters for the question
-
-
-
-var CHOICE_TOKEN = "@@CHOICE@@";
-
-
-// Feedback
-
-var FEEDBACK_TOKEN = "@@FEEDBACK@@";
-
-//Summary
-var SUMMARY_TOKEN = "@@SUMMARY@@";
-
-//Correct Summary
-
-var CORRECT_SUMMARY_TOKEN = "@@CORRECT_SUMMARY@@";
-//Incorrect Summary
-
-var INCORRECT_SUMMARY_TOKEN= "@@INCORRECT_SUMMARY@@";
-//Not Attempted Summary
-
-
-
-var NOT_ATTEMPTED_SUMMARY_TOKEN = "@@NOT_ATTEMPTED_SUMMARY@@";
-//Instruction text for each question
-
-var INSTRUCTION_TEXT_TOKEN="@@INSTRUCTION_TEXT@@";
-//Correct number of answer given by the user in percent or number
-
-
-var SCORE_TOKEN="@@SCORE@@";
-//Total number of question displayed
-
-
-var TOTAL_QUESTION_TOKEN="@@TOTAL_QUESTION@@";
-//Correct Instant feedback - Only used for single question per page type
-
-
-var CORRECT_INSTANT_FEEDBACK_TEXT_TOKEN="@@CORRECT_INSTANT_FEEDBACK_TEXT@@";
-//Incorrect Instant feedback - Only used for single question per page type
-
-
-var INCORRECT_INSTANT_FEEDBACK_TEXT_TOKEN="@@INCORRECT_INSTANT_FEEDBACK_TEXT@@";
-
-
-//Renderers
-
-//Default Renderers for Question Page
-var _defaultQuestionRenderer = new QuestionRenderer();
-
-//Choice Renderer for Question Page
-var _defaultChoiceRenderer = new ChoiceRenderer();
-
-//Default Renderers for Result Page
-var _defaultResultRenderer = new ResultRenderer();
-
-//Choice Renderer for Result Page - Choices
-var _defaultResultChoiceRenderer = new ResultChoiceRenderer();
-
-//Default Renderers for Result Summary
-var _defaultSummaryCorrectRenderer = new SummaryCorrectRenderer();
-var _defaultSummaryInCorrectRenderer = new SummaryInCorrectRenderer();
-var _defaultSummaryNotAttemptedRenderer = new SummaryNotAttemptedRenderer();
-
-//Default Renderers for Result - Scores
-var _defaultScoreRenderer=new ScoreRenderer();
-
-//Default Renderers for Result - Instruction text
-var _defaultInstructionTextRenderer = new InstructionTextRenderer();
-
-//Default Renderers forInstant Feedback in single question per page type assessments
-var _defaultInstantCorrectFeedbackRenderer=new InstantCorrectFeedbackRenderer();
-var _defaultInstantInCorrectFeedbackRenderer=new InstantInCorrectFeedbackRenderer();
-
-
-
-
-
-
-
-//Defining the html strings which will be replaced by default while rendering
-//All the methods below can be overriden in the pageLayout file to customize the assessment look and feel
-
-
-//Setting HTML Code block for Question Page
-
-_defaultQuestionRenderer.setHtmlCode('<tr><td bgcolor="yellow" width=575> <a name="qs@@QUESTION_ID@@">&nbsp;</a></td> </tr>'+
-
- '<tr>\n <td> \n'+
-
- '<table cellpadding=0 cellspacing=0 border=0><tr><td valign=top align="left" width=25>'+
-
- '<span name="@@QUESTION_ID@@question" class="qtext1"> \n'+
-
- '@@QUESTION_NUMBER@@. &nbsp;&nbsp;</td><td valign=top align=left class="qtextGreen" width=575 colspan=3>'+
-
- '@@QUESTION_TEXT@@</td></tr><tr><td colspan=4>@@IMAGE_TEXT@@<br><br></td> </tr>'+
-
- '<tr><td colspan=4>@@QUESTION_ITEXT@@</span> \n@@CHOICE@@</td></tr></table></td></tr>');
-
-
-//Setting HTML Code block for instruction text
-
-
-_defaultInstructionTextRenderer.setHtmlCode('<span class="blue">Please select&nbsp;&nbsp;<b>@@INSTRUCTION_TEXT@@</b>.</span><br><br></td></tr>\n');
-
-
-//Setting HTML Code block for Score display
-
-
-_defaultScoreRenderer.setHtmlCode("<tr><td class='blue'>You had <strong> @@SCORE@@ %</strong> out of @@TOTAL_QUESTION@@ Questions Correct.</td></tr>");
-
-
-//Setting HTML Code block for Correct Summary
-
-
-_defaultSummaryCorrectRenderer.setHtmlCode('<tr><td class="qtext">Question @@CORRECT_SUMMARY@@ -- Correct</td></tr>');
-
-
-//Setting HTML Code block for Incorrect Summary
-
-
-_defaultSummaryInCorrectRenderer.setHtmlCode('<tr><td class="qtext"> Question@@INCORRECT_SUMMARY@@ -- Incorrect</td></tr>');
-
-
-//Setting HTML Code block for Summary Not Attempted answer
-
-
-_defaultSummaryNotAttemptedRenderer.setHtmlCode('<tr><td class="qtext">Question @@NOT_ATTEMPTED_SUMMARY@@ -- Not Attempted</td></tr>');
-
-
-//Setting HTML Code block for Result Page
-
-
-_defaultResultRenderer.setHtmlCode('<tr><td bgcolor="yellow"> <a name="qs@@QUESTION_ID@@">&nbsp;</a></td> </tr>'+
-
- '<tr>\n <td> \n'+
-
- '<table cellpadding=0 cellspacing=0 border=0><tr><td valign=top align="left" width=25>'+
-
- '<span name="@@QUESTION_ID@@question" class="qtext1"> \n'+
-
- '@@QUESTION_NUMBER@@. &nbsp;&nbsp;</td><td valign=top align=left class="qtextGreen" width=575 colspan=3>'+
-
- '@@QUESTION_TEXT@@</td></tr><tr><td colspan=4>@@IMAGE_TEXT@@<br><br></td> </tr>'+
-
- '<tr><td colspan=4>@@QUESTION_ITEXT@@</span> \n@@CHOICE@@</td></tr><tr><td valign=top align=left class="qtext1" colspan=4>@@FEEDBACK@@</span></td></tr></table></td></tr>');
-
-
-
-//Setting HTML Code block for instant Correct Feedback
-
-
-_defaultInstantCorrectFeedbackRenderer.setHtmlCode('<tr><td class="green">@@CORRECT_INSTANT_FEEDBACK_TEXT@@</td></tr>');
-
-
-//Setting HTML Code block for instant Incorrect Feedback
-
-
-_defaultInstantInCorrectFeedbackRenderer.setHtmlCode('<tr><td class="red">@@INCORRECT_INSTANT_FEEDBACK_TEXT@@</td></tr>');
-
-
-//The above methods can be overridden in the pageLayout file
-
-
-
-// Methods for Question Page
-
-function _getRenderer(){
-
- return this.guestionRenderer ;
-
-}
-
-
-function _getChoiceRenderer(){
-
- return this.choiceRenderer;
-
-}
-
-//main rendering function to be called from the Assessment Page (Multi Question / Page)
-
-
-
-function AssessmentPageRenderer(pDocument){
-
- iContentPage =pDocument;// inorder to set the content page reference.
-
- this.htmlDocument = pDocument;
-
- this.defaultQuestionRenderer = _defaultQuestionRenderer;
-
- this.render = _render;
-
- this.htmlCode = null;
-
- this.setHtmlCode = _setHtmlCode;
-
-
-}
-
-
-function _setHtmlCode(pCodeString){
-
- this.htmlCode = pCodeString;
-
-}
-
-//render() called from Assessment page
-
-
-
-
-function _render(){
-
- //debugger;
-
- if(!this.htmlDocument) {
-
- alert("please set the html document reference!");
-
- return;
-
- }
-
- var questionString = "";
-
- var length = iFinalQuestions.length;
-
- var index = 0;
-
- var question = "null";
-
- while(index < length){
-
- question = iFinalQuestions[index];
- //alert("question== "+ (question.getRenderer()));
-
- if(question.getRenderer())
-
- questionString += question.getRenderer().render(question , index);
-
- else
-
- questionString += this.defaultQuestionRenderer.render(question , index);
-
- index++;
-
- }
-
- this.htmlDocument.write(replaceToken(QUESTIONS_TOKEN,this.htmlCode , questionString));
-
- this.htmlDocument.close();
-
-}
-
-
-// Question Renderer
-function QuestionRenderer(){
-
- this.htmlCode = null;
-
- this.setHtmlCode = _setQuestionHtmlCode;
- this.InstructionTextRenderer=_defaultInstructionTextRenderer;
- this.render = _renderQuestion;
-
- this.choiceRenderer = _defaultChoiceRenderer;
-
- this.setChoiceRenderer = _setChoiceRenderer;
-
- this.getChoiceRenderer = _getChoiceRenderer;
-
-}
-
-
-//Replacing Tokens in Assessment page with Respective Code blocks
-
-function _renderQuestion(pQuestion , pIndex){
-
- //debugger;
-
- var imageString = ""; //added to display images/swf
-
- if(pQuestion.image){
- if(pQuestion.image.substring(pQuestion.image.lastIndexOf(".")+1) == 'swf') {
-var imageString = '<object classid=\"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000\"';
- imageString += 'codebase=\"http://download.macromedia.com/pub/shockwave/cabs/flash/';
-imageString += 'swflash.cab#version=6,0,29,0\" width=\"'+flashWidth+'\"';
-imageString += 'height=\"'+flashHeight+'\"><param name=\"movie\"';
-imageString += 'value=\"'+pQuestion.image+'\"><param name=\"quality\"';
-imageString += 'value=\"high\">';
-imageString += '<embed src=\"'+pQuestion.image+'\" quality=\"high\"';
-imageString += 'pluginspage=\"http://www.macromedia.com/go/getflashplayer\"';
-imageString += 'type=\"application/x-shockwave-flash\" width=\"'+flashWidth+'\"'; imageString += 'height=\"'+flashHeight+'\"></embed></object>';
-
- }
- else {
-var imageString = '<img border=\"0\" src=\"' + pQuestion.image + '\"';
-imageString += 'usemap=\"#HeaderMap\" alt=\"\">';
-
- }
- }
-
-
- var questionString = "";
-
- questionString = replaceToken(QUESTION_ID_TOKEN , this.htmlCode , pQuestion.getId());
-
- questionString = replaceToken(QUESTION_TEXT_TOKEN , questionString , pQuestion.text);
-
- questionString = replaceToken(IMAGE_TEXT_TOKEN , questionString , imageString);
-
- var iText = "";
- var instructionrenderer=pQuestion.InstructionTextRenderer;
-
- if(!pQuestion.getInstructionText()){
-
- iText= instructionrenderer.render(pQuestion.type);
-
- }else {
-
- iText= pQuestion.getInstructionText();
-
- }
-
- questionString = replaceToken(QUESTION_ITEXT_TOKEN , questionString , iText);
-
- questionString = replaceToken(QUESTION_NUMBER , questionString , pIndex+1);
-
-
-
- var choiceRenderer = pQuestion.getChoiceRenderer();
-
- if(!choiceRenderer)
-
- choiceRenderer = this.choiceRenderer;
-
-//Calls the render() of QuestionRenderer for generating Choices to replace @@CHOICE@@ token
- questionString = replaceToken(CHOICE_TOKEN , questionString , choiceRenderer.render(pQuestion.answers , pQuestion , pIndex));
-
- return questionString;
-
-}
-
-
-
-function _setQuestionHtmlCode(pCode){
-
- this.htmlCode = pCode;
-
-}
-
-
-
-
-// Choice Renderer
-
-function _setChoiceRenderer(pRenderer){
-
- this.choiceRenderer = pRenderer;
-
-}
-
-
-
-function _getChoiceRenderer(){
-
- return this.choiceRenderer;
-
-}
-
-
-
-function ChoiceRenderer(){
-
- this.htmlCode = null;
-
- this.setHtmlCode = _setChoiceHtmlCode;
-
- this.render = _renderChoice;
-
-
-
-}
-
-function _setChoiceHtmlCode(pCode){
-
- this.htmlCode = pCode;
-
-}
-
-// render() for Choices in Question page
-function _renderChoice(pAnswersArray , pQuestion , pIndex){
-
- var completeChoiceString = "";
- var tAnswers = pQuestion.answers;
- var choice = null;
-
- var numberOfChoices = pAnswersArray.length;
- var correctAnsString = "";
- var index = 0;
- var tArray=null;
-
- var questionLetter = 1;
-
- if(doLMSGetValue("cmi.suspend_data").indexOf("lesson_status") != -1){
- tArray = getUserResponse();
-
- }
- //addition
- for( j=0; j < tAnswers.length; j++ ){
- if( tAnswers[j].correct == true ){
- if( correctAnsString.length > 0 ){
- correctAnsString += "," + (j+1)
- }
- else{
- correctAnsString += (j+1);
- }
- }
- }
- iAnswersArray[ pIndex ] = correctAnsString;
-
- //end for
-
-
- while(index < numberOfChoices){
-
- choice = pAnswersArray[index];
-
- if(tArray)
- var userclick=userAttemptedValues((pIndex + 1),tArray,questionLetter);
-
- completeChoiceString += '<tr><td width=15 align=left>&nbsp;</td><td valign=top width=15 align=left><span class="choice" name="' + pQuestion.id +'choice' + (index+1) + '">\n';
-
-
- if( pQuestion.type == 'multiple' )
- {
- if(userclick=="true" && resumeAssessment){
- completeChoiceString += '<input name="qs' + pQuestion.id + 'choiceBtn" value="' + (index+1) + '" type="checkbox" checked onClick="checkCurentQuestionOnClick(\'' + pQuestion.index + '\')" >\n';
- }
- else
- {
- completeChoiceString += '<input name="qs' + pQuestion.id + 'choiceBtn" value="' + (index+1) + '" type="checkbox" onClick="checkCurentQuestionOnClick(\'' + pQuestion.index + '\')" >\n';
- }
- }
-
- else if( pQuestion.type == 'single' ){
-
- if(userclick=="true" && resumeAssessment){
- completeChoiceString += '<input name="qs'+ pQuestion.id + 'RadioInp" type="radio" checked onClick="checkCurentQuestionOnClick(\'' + pQuestion.index + '\')">\n';
-
- }
- else
- {
-
- completeChoiceString += '<input name="qs'+ pQuestion.id + 'RadioInp" type="radio" onClick="checkCurentQuestionOnClick(\'' + pQuestion.index + '\')">\n';
- }
- }
-
-
-
- questionLetters = String.fromCharCode( questionLetter + 64 );
-
-
-
- completeChoiceString += '</input></span></td><td valign=top class="qtext" align="left" width=15>' + questionLetters + '.&nbsp;&nbsp;</td><td valign=top align=left class="qtext" width=555>';
-
- completeChoiceString += choice.text;
-
- completeChoiceString += '<br><br></td></tr>\n';
-
- questionLetter++;
-
- index++;
-
- }
-
- return completeChoiceString;
-
-}
-
-function InstructionTextRenderer()
-{
-this.htmlCode=null;
-this.setHtmlCode=_setInstructionHtmlCode;
-this.render= _renderInstructionText;
-}
-
-function _setInstructionHtmlCode(pCode)
-{
- this.htmlCode=pCode;
-
-}
-
-function _renderInstructionText(pType)
-{
- var instructionText="";
- if(pType=='multiple')
- {
- instructionText+='all the correct answers.'
- }
- else
- {
- instructionText+='the best answer.'
- }
-
- var tempstring=replaceToken(INSTRUCTION_TEXT_TOKEN,this.htmlCode,instructionText);
- return tempstring;
-}
-
-
-// Result Page
-
-
-
-function _setResultChoiceRenderer(pRenderer){
-
- this.resultChoiceRenderer = pRenderer;
-
-}
-
-
-
-function _getResultChoiceRenderer(){
-
- return this.resultChoiceRenderer;
-
-}
-
-
-
-function _setResultHtmlCode(pCode){
-
- this.htmlCode = pCode;
-
-}
-
-
-
-// Results Choice Renderer
-
-
-
-function ResultChoiceRenderer(){
-
- this.htmlCode = null;
-
- this.setHtmlCode = _setResultChoiceHtmlCode;
-
- this.render = _renderResultChoice;
-
-}
-
-
-
-function _setResultChoiceHtmlCode(pCode){
-
- this.htmlCode = pCode;
-
-}
-
-
-
-function _renderResultChoice(pAnswersArray , pQuestion , pIndex){
-
- var completeChoiceString = "";
-
- var choice = null;
-
- var numberOfChoices = pAnswersArray.length;
-
- var index = 0;
-
- var questionLetter = 1;
- var tAnswers = pAnswersArray;
- var correctAnsString = "";
-
- while(index < numberOfChoices){
-
- choice = pAnswersArray[index];
-
- if( tAnswers[index].correct == true ){
- if( correctAnsString.length > 0 ){
- correctAnsString += "," + (index+1);
- }
- else{
- correctAnsString += (index+1);
- }
- }
-
- completeChoiceString += '<tr><td width=15>&nbsp;</td><td valign=top align=left width=15><span class="choice" name="' + pQuestion.id +'choice' + (index+1) + '">\n';
- if( pQuestion.type == 'multiple' ){
- completeChoiceString += '<input disabled name="' + pQuestion.id + 'choiceBtn" value="' + (j+1) + '" type="checkbox" ' +checkIfSelected(userSelected[pIndex],index+1) + ' >\n';
- }
- else if( pQuestion.type == 'single' ){
- completeChoiceString += '<input disabled name="'+ pQuestion.id + 'RadioInp" type="radio" ' + checkIfSelected(userSelected[pIndex],index+1) + ' >\n';
- }
-
- questionLetters = String.fromCharCode( questionLetter + 64 );
-
- completeChoiceString += '</input></td><td valign=top width=15 align=left class="qtext">' + questionLetters + '.&nbsp;&nbsp;</td><td valign=top class="qtext" align=left width=555>';
- completeChoiceString += tAnswers[index].text;
- completeChoiceString += '<br><br></td></tr>\n';
- questionLetter++;
- index++;
- }
-
- return completeChoiceString;
-
-}
-
-
-//Results Renderer
-
-
-function ResultRenderer(){
-
- this.htmlCode = null;
-
- this.setHtmlCode = _setResultHtmlCode;
-
- this.render = _renderResult;
-
- this.choiceRenderer = _defaultResultChoiceRenderer;
-
- this.setChoiceRenderer = _setResultChoiceRenderer;
-
- this.getChoiceRenderer = _getResultChoiceRenderer;
-
-}
-
-
-function _getResultRenderer(){
-
- return this.resultRenderer;
-
-}
-
-
-function ResultsPageRenderer(pDocument){
-
- iContentPage =pDocument;
-
- this.htmlDocument = pDocument;
-
- this.defaultResultRenderer = _defaultResultRenderer;
-
- this.render = _resRender;
-
- this.htmlCode = null;
-
- this.setHtmlCode = _setHtmlCode;
-
-}
-
-//resRnder() function called from Result page
-
-
-function _resRender(){
-
- //debugger;
-
-
- userSelected = iHeaderFrame.iUserAnswers;
-
- if(!this.htmlDocument) {
-
- alert("please set the html document reference!");
-
- return;
-
- }
-
- var resultString = "";
-
- var length = iFinalQuestions.length;
-
- var index = 0;
-
- var question = "null";
-
-
-
- resultString += '<form name="qz">';
- while(index < length){
-
- question = iFinalQuestions[index];
- //alert("question== "+ (question.getRenderer()));
-
- if(question.getResultRenderer())
-
- resultString += question.getResultRenderer().render(question , index);
-
- else
-
- resultString += this.defaultResultRenderer.render(question , index);
-
- index++;
-
- }
- resultString += '</form>';
-
- this.htmlDocument.write(replaceToken(QUESTIONS_TOKEN,this.htmlCode , resultString));
-
- this.htmlDocument.close();
-
-}
-
-//Replacing Tokens in Result page with Respective Code blocks
-function _renderResult(pQuestion , pIndex){
-
- //debugger;
-
- var imageString = "";
-
- if(pQuestion.image){
- if(pQuestion.image.substring(pQuestion.image.lastIndexOf(".")+1) == 'swf') {
-var imageString = '<object classid=\"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000\"';
- imageString += 'codebase=\"http://download.macromedia.com/pub/shockwave/cabs/flash/';
-imageString += 'swflash.cab#version=6,0,29,0\" width=\"'+flashWidth+'\"';
-imageString += 'height=\"'+flashHeight+'\"><param name=\"movie\"';
-imageString += 'value=\"'+pQuestion.image+'\"><param name=\"quality\"';
-imageString += 'value=\"high\">';
-imageString += '<embed src=\"'+pQuestion.image+'\" quality=\"high\"';
-imageString += 'pluginspage=\"http://www.macromedia.com/go/getflashplayer\"';
-imageString += 'type=\"application/x-shockwave-flash\" width=\"'+flashWidth+'\"'; imageString += 'height=\"'+flashHeight+'\"></embed></object>';
-
- }
- else {
-var imageString = '<img border=\"0\" src=\"' + pQuestion.image + '\"';
-imageString += 'usemap=\"#HeaderMap\" alt=\"\">';
-
- }
- }
-
-
-
- var resultString = "";
-
- resultString = replaceToken(QUESTION_ID_TOKEN , this.htmlCode , pQuestion.getId());
-
- resultString = replaceToken(QUESTION_TEXT_TOKEN , resultString , pQuestion.text);
- resultString = replaceToken(IMAGE_TEXT_TOKEN , resultString , imageString);
-
- var iText = "";
- var instructionrenderer=pQuestion.InstructionTextRenderer;
- if(!pQuestion.getInstructionText()){
-
- iText= instructionrenderer.render(pQuestion.type);
-
- }else {
-
- iText= pQuestion.getInstructionText();
-
- }
- var tFeedback;
- if( pQuestion.userResponse ){
- tFeedback = pQuestion.correctFeedbackText;
- }
- else{
- tFeedback = pQuestion.incorrectFeedbackText;
- }
- if( tFeedback == "" ){
- tFeedback = correctAnswerString(correctAnsString);
- }
-
- resultString = replaceToken(QUESTION_ITEXT_TOKEN , resultString , iText);
-
- resultString = replaceToken(QUESTION_NUMBER , resultString , pIndex+1);
-
-
-
- var resultChoiceRenderer = pQuestion.getResultChoiceRenderer();
-
-
- if(!resultChoiceRenderer)
-
- resultChoiceRenderer = this.resultChoiceRenderer;
-
-//Calls the render() of Results Renderer for the generating disabled Choices to replace @@CHOICE@@ token
- resultString = replaceToken(CHOICE_TOKEN , resultString , resultChoiceRenderer.render(pQuestion.answers , pQuestion , pIndex));
- resultString = replaceToken(FEEDBACK_TOKEN , resultString , tFeedback);
- return resultString;
-
-}
-
-
-//Summary Renderer
-
-//Summary Renderer called from Result Summary page
-
-
-
-function SummaryPageRenderer(pDocument)
-{
-
-this.htmlDocument=pDocument;
-this.defaultSummaryCorrectRenderer = _defaultSummaryCorrectRenderer;
-this.defaultSummaryInCorrectRenderer = _defaultSummaryInCorrectRenderer;
-this.defaultSummaryNotAttemptedRenderer= _defaultSummaryNotAttemptedRenderer;
-this.defaultScoreRenderer= _defaultScoreRenderer;
-this.render = _summaryRender;
-this.htmlCode= null;
-this.setHtmlCode= _setSummaryHtmlCode;
-
-}
-
-
-
-
-function _setSummaryHtmlCode(pCodeString)
-{
-this.htmlCode=pCodeString;
-}
-
-
-
-
-function _summaryRender()
-{
-
- if(!this.htmlDocument)
- {
- alert("please set the html document reference!");
- return;
- }
-
- iFinalQuestions = iHeaderFrame.iFinalQuestions;
-
- userSelected = iHeaderFrame.iUserAnswers;
-
- var length = iFinalQuestions.length;
-
- var index = 0;
-
- score = iHeaderFrame.score;
-
- question = null;
-
- var tString = '';
-
- if( showPercentage ){
- score = (score/displayQuestions) * 100;
- score = Math.round(score);
- tString= this.defaultScoreRenderer.render(score,displayQuestions);
- }
- else{
- tString= this.defaultScoreRenderer.render(score,displayQuestions);
- }
- initializeVariables();
-
- var summaryString = tString;
-
- while(index < displayQuestions)
- {
- question = iFinalQuestions[index];
-
- if(question)
- {
-
- if(question.userResponse){
-
- summaryString += this.defaultSummaryCorrectRenderer.render(index+1 , userSelected[index]);
- }
-
- else
- {
- if(userSelected[index])
- {
-
- summaryString += this.defaultSummaryInCorrectRenderer.render(index+1 , userSelected[index]);
- }
- else
- {
- summaryString += this.defaultSummaryNotAttemptedRenderer.render(index+1 , userSelected[index]);
- }
- }
- }
-
- index++;
-
- }
-
- this.htmlDocument.write(replaceToken(SUMMARY_TOKEN,this.htmlCode , summaryString));
-
- this.htmlDocument.close();
- }
-
-
-
-// CorrectSummary Renderer
-function SummaryCorrectRenderer()
- {
- this.htmlCode = null;
-
- this.setHtmlCode = _setSummaryCorrectHtmlCode;
-
- this.render = _renderSummaryCorrect;
- }
-
-
-
-function _setSummaryCorrectHtmlCode(pCode)
- {
- this.htmlCode=pCode;
-
- }
-
-
-
-function _renderSummaryCorrect(index,pString)
- {
-
- var SummaryCorrectString = index.toString();
- SummaryCorrectString+= " ";
- SummaryCorrectString += insertCommas(pString);
- var tempString= replaceToken(CORRECT_SUMMARY_TOKEN, this.htmlCode, SummaryCorrectString);
- return tempString;
-
- }
-
-
-//SummaryIncorrect
-function SummaryInCorrectRenderer()
- {
- this.htmlCode = null;
-
- this.setHtmlCode = _setSummaryInCorrectHtmlCode;
-
- this.render = _renderSummaryInCorrect;
- }
-
-
-
-function _setSummaryInCorrectHtmlCode(pCode)
- {
- this.htmlCode=pCode;
-
- }
-
-
-
-function _renderSummaryInCorrect(index,pString)
- {
-
- var SummaryInCorrectString = index.toString();
- SummaryInCorrectString+= " ";
- SummaryInCorrectString += insertCommas(pString);
- var tempString= replaceToken(INCORRECT_SUMMARY_TOKEN, this.htmlCode, SummaryInCorrectString);
- return tempString;
-
- }
-
-//summary Not attempted
-function SummaryNotAttemptedRenderer()
- {
- this.htmlCode = null;
-
- this.setHtmlCode = _setSummaryNotAttemptedHtmlCode;
-
- this.render = _renderSummaryNotAttempted;
- }
-
-
-
-function _setSummaryNotAttemptedHtmlCode(pCode)
- {
- this.htmlCode=pCode;
-
- }
-
-
-
-function _renderSummaryNotAttempted(index,pString)
- {
-
- var SummaryNotAttemptedString = index.toString();
- SummaryNotAttemptedString+= " ";
- SummaryNotAttemptedString += insertCommas(pString);
- var tempString= replaceToken(NOT_ATTEMPTED_SUMMARY_TOKEN, this.htmlCode, SummaryNotAttemptedString);
- return tempString;
-
- }
-
-
-
-function ScoreRenderer()
- {
- this.htmlCode=null;
- this.setHtmlCode= _setScoreHtml;
- this.render=_renderScore;
-
- }
-
-
-
-function _setScoreHtml(pCode)
- {
- this.htmlCode=pCode;
- }
-
-
-
-function _renderScore(pScore,pDisplayQuestion)
- {
- var finalScoreText=replaceToken(SCORE_TOKEN,this.htmlCode,pScore);
- this.setHtmlCode(finalScoreText);
- finalScoreText=replaceToken(TOTAL_QUESTION_TOKEN,this.htmlCode,pDisplayQuestion);
- return finalScoreText;
- }
-
-
-
-function _setCorrectFeedbackHtmlCode(pCode)
-{
- this.htmlCode=pCode;
-}
-
-
-
-function _setInCorrectFeedbackHtmlCode(pCode)
-{
- this.htmlCode=pCode;
-}
-
-
-
-//for single question per Page type assessment.....
-
-
-function SinglePageAssessmentRenderer()
-{
-
- this.htmlDocument = null;
- this.setHtmlDocument = _setSinglePageAssessmentHtmlDocument;
- this.defaultQuestionRenderer = _defaultQuestionRenderer;
-
- this.render = _singlePageAssessmentrender;
-
- this.htmlCode = null;
-
- this.setHtmlCode = _setSinglePageAssessmentHtmlCode;
-
-
-}
-
-
-
-function _setSinglePageAssessmentHtmlCode(pCodeString){
-
- this.htmlCode = pCodeString;
-
-}
-
-
-
-function _setSinglePageAssessmentHtmlDocument(pDocument,pFormName){
-
- iContentPage =pDocument;
-
- setQuestionsForm(pFormName);
-
- this.htmlDocument = pDocument;
-
-}
-
-
-
-function _singlePageAssessmentrender()
-{
-
- if(!this.htmlDocument) {
-
- alert("please set the html document reference!");
-
- return;
-
- }
-
- var questionString = "";
-
- var questionNum = currentQustionIndex;
-
- var question = "null";
-
-
-if(hasNextQuestion() )
-{
- var question = getNextQuestion();
- if(question.getRenderer())
- questionString += question.getRenderer().render(question , questionNum);
- else
- questionString += this.defaultQuestionRenderer.render(question , questionNum);
-}
-
-this.htmlDocument.write(replaceToken(QUESTIONS_TOKEN,this.htmlCode , questionString));
-this.htmlDocument.close();
-
-}
-
-
-
-function InstantCorrectFeedbackRenderer()
-{
-this.htmlCode=null;
-this.setHtmlCode=_setCorrectFeedbackHtmlCode;
-this.render=_renderInstantCorrectFeedback;
-}
-
-
-
-function _renderInstantCorrectFeedback(pQuestion)
-{
-
-var feedbackString=replaceToken(CORRECT_INSTANT_FEEDBACK_TEXT_TOKEN,this.htmlCode,pQuestion.correctFeedbackText);
-return feedbackString;
-}
-
-
-
-function InstantInCorrectFeedbackRenderer()
-{
-this.htmlCode=null;
-this.setHtmlCode=_setInCorrectFeedbackHtmlCode;
-this.render=_renderInstantInCorrectFeedback;
-}
-
-
-
-function _renderInstantInCorrectFeedback(pQuestion)
-{
-
-var feedbackString=replaceToken(INCORRECT_INSTANT_FEEDBACK_TEXT_TOKEN,this.htmlCode,pQuestion.incorrectFeedbackText);
-return feedbackString;
-}
-
-
-// Ending Renderer
-
-
-
-
-
-
-
-// Global
-
-// replaces all occurences of the token.
-function replaceToken(pToken , pOriginalString , pStringToReplaceWith){
-
- //alert("Token" +pToken +"Original String" + pOriginalString + "ReplaceString" + pStringToReplaceWith);
-
- var index = pOriginalString.indexOf(pToken);
-
- var modifiedString = pOriginalString;
-
- if(index!=-1){
-
- var startString = pOriginalString.substring(0 , index);
-
- var endString = pOriginalString.substring(index+pToken.length);
-
- modifiedString = startString + pStringToReplaceWith + endString;
-
-
-
- if(modifiedString.indexOf(pToken) != -1)
-
- modifiedString = replaceToken(pToken , modifiedString , pStringToReplaceWith);
-
- }
-
- return modifiedString;
-
-}
-
-//used to return instant feedback string of the Question object. for Single question/page
-
-function getInstantFeedbackString(){
-
- var tQuestion = iFinalQuestions[currentQustionIndex-1];
- if(userSelected[currentQustionIndex-1] == iAnswersArray[currentQustionIndex-1]){
- return tQuestion.instantCorrectFeedbackRenderer.render(tQuestion);
- }
- else{
- return tQuestion.instantInCorrectFeedbackRenderer.render(tQuestion);
- }
-}
-
-
-//End Change of Model by Manu/Monalika/Sampad/Arijit
diff --git a/Explore/elr/Science/S0501/shared/scripts/csl_scofunctions.js b/Explore/elr/Science/S0501/shared/scripts/csl_scofunctions.js
deleted file mode 100755
index 3427e59..0000000
--- a/Explore/elr/Science/S0501/shared/scripts/csl_scofunctions.js
+++ /dev/null
@@ -1,624 +0,0 @@
-
-
-
-// version --- CSL_1.3.0.0
-
-var startDate;
-var exitPageStatus;
-
-
-
-var useCustomSearch = false;
-
-
-
-function loadPage(){
- var result = doLMSInitialize();
- var status = doLMSGetValue( "cmi.core.lesson_status" );
- if (status == "not attempted"){
- // the student is now attempting the lesson
- doLMSSetValue( "cmi.core.lesson_status", "incomplete" );
- }
- exitPageStatus = false;
- startTimer();
- if( self.launchSCO ){
- launchSCO();
- }
-}
-
-
-
-
-function getValue(pDataModelName){
- return doLMSGetValue(pDataModelName);
-}
-
-
-
-
-function setValue(pDataModelName , pValue){
- return doLMSSetValue(pDataModelName , pValue);
-}
-
-
-
-function startTimer(){
- startDate = new Date().getTime();
-}
-
-
-
-
-function computeTime(){
- if ( startDate != 0 ){
- var currentDate = new Date().getTime();
- var elapsedSeconds = ( (currentDate - startDate) / 1000 );
- var formattedTime = convertTotalSeconds( elapsedSeconds );
- }
- else{
- formattedTime = "00:00:00.0";
- }
- doLMSSetValue( "cmi.core.session_time", formattedTime );
-}
-
-
-
-
-function doBack(){
- if( exitPageStatus == false ){
- doLMSSetValue( "cmi.core.exit", "suspend" );
- if( self.exitSCO ){
- exitSCO();
- }
- computeTime();
- exitPageStatus = true;
- var result;
- //result = doLMSCommit();
- // NOTE: LMSFinish will unload the current SCO. All processing
- // relative to the current page must be performed prior
- // to calling LMSFinish.
- result = doLMSFinish();
- }
-}
-
-
-
-
-function doContinue( status ){
- // Reinitialize Exit to blank
- if( exitPageStatus == false ){
- doLMSSetValue( "cmi.core.exit", "" );
- var mode = doLMSGetValue( "cmi.core.lesson_mode" );
- if ( mode != "review" && mode != "browse" ) {
- if( status ){
- doLMSSetValue( "cmi.core.lesson_status", status );
- }
- }
- if( self.exitSCO ){
- exitSCO();
- }
- computeTime();
- exitPageStatus = true;
- var result;
- //result = doLMSCommit();
- result = doLMSFinish();
- }
-}
-
-
-
-function doQuit(){
- if( exitPageStatus == false ){
- doLMSSetValue( "cmi.core.exit", "logout" );
- if( self.exitSCO ){
- exitSCO();
- }
- computeTime();
- exitPageStatus = true;
- var result;
- result = doLMSCommit();
- result = doLMSFinish();
- }
-}
-
-function unloadPage(){
- if (exitPageStatus != true){
- if( self.exitSCO ){
- exitSCO();
- }
- exitPageStatus = true;
- computeTime();
- doLMSFinish();
- }
-}
-
-function isOPELPlatform(){
- var retValue = false;
- var api = getAPIHandle();
- if (null == api){
- return false;
- }
- else {
- api.LMSGetValue("dt.progress");
- var err = ErrorHandler();
- if(err != _NotImplementedError && err != _InvalidArgumentError){
- retValue = true;
- }
- }
- return retValue;
-}
-
-
-
-
-
-function convertTotalSeconds(ts){
- var sec = (ts % 60);
-
- ts -= sec;
- var tmp = (ts % 3600); //# of seconds in the total # of minutes
- ts -= tmp; //# of seconds in the total # of hours
-
- // convert seconds to conform to CMITimespan type (e.g. SS.00)
- sec = Math.round(sec*100)/100;
-
- var strSec = new String(sec);
- var strWholeSec = strSec;
- var strFractionSec = "";
-
- if (strSec.indexOf(".") != -1) {
- strWholeSec = strSec.substring(0, strSec.indexOf("."));
- strFractionSec = strSec.substring(strSec.indexOf(".")+1, strSec.length);
- }
-
- if (strWholeSec.length < 2){
- strWholeSec = "0" + strWholeSec;
- }
- strSec = strWholeSec;
-
- if (strFractionSec.length) {
- strSec = strSec+ "." + strFractionSec;
- }
-
- if ((ts % 3600) != 0 )
- var hour = 0;
- else var hour = (ts / 3600);
- if ( (tmp % 60) != 0 )
- var min = 0;
- else var min = (tmp / 60);
-
- if ((new String(hour)).length < 2)
- hour = "0"+hour;
- if ((new String(min)).length < 2)
- min = "0"+min;
-
- var rtnVal = hour+":"+min+":"+strSec;
-
- return rtnVal;
-}
-
-
-
-
-var OPELObjectName = "OpelPresentationAPI"; //.........Name of Object Specific to OPEL...........//
-
-var DesktopObjectName = "DesktopPresentationAPI"; //...Name of Object Specific to OPEL Desktop...//
-
-// Reference to the platform specific object for SCOs to communicate
-// with which can be OPELObject or DesktopObject
-
-var platformObject = null;
-//
-//NOTE: At Anytime either OPELObject or DTDektopObject will be present , both cannot be present
-// at the same time.
-//
-var _Debug = false; // set this to false to turn debugging off
- // and get rid of those annoying alert boxes.
-// Define exception/error codes
-var _NoError = 0;
-var _GeneralException = 101;
-var _ServerBusy = 102;
-var _InvalidArgumentError = 201;
-var _ElementCannotHaveChildren = 202;
-var _ElementIsNotAnArray = 203;
-var _NotInitialized = 301;
-var _NotImplementedError = 401;
-var _InvalidSetValue = 402;
-var _ElementIsReadOnly = 403;
-var _ElementIsWriteOnly = 404;
-var _IncorrectDataType = 405;
-
-// local variable definitions
-var apiHandle = null;
-var API = null;
-var findAPITries = 0;
-
-var lookForAICC = false;
-
-// Function: doLMSInitialize()
-// Inputs: None
-// Return: CMIBoolean true if the initialization was successful, or
-// CMIBoolean false if the initialization failed.
-//
-// Description:
-// Initialize communication with LMS by calling the LMSInitialize
-// function which will be implemented by the LMS.
-//
-//
-function doLMSInitialize(){
- var api = getAPIHandle();
- if (api == null) {
- var returnValue = "";
- alert("Unable to locate the LMS's API Implementation.\nLMSGetValue was not successful.");
- return returnValue;
- }
-
- var result = api.LMSInitialize("");
-
- if (result.toString() != "true") {
- var err = ErrorHandler();
- }
- return result.toString();
-}
-
-//
-//
-// Function doLMSFinish()
-// Inputs: None
-// Return: CMIBoolean true if successful
-// CMIBoolean false if failed.
-//
-// Description:
-// Close communication with LMS by calling the LMSFinish
-// function which will be implemented by the LMS
-//
-//
-function doLMSFinish(){
- var api = getAPIHandle();
- if (api == null) {
- var returnValue = "";
- alert("Unable to locate the LMS's API Implementation.\nLMSGetValue was not successful.");
- return returnValue;
- }
- else {
- // call the LMSFinish function that should be implemented by the API
-
- var result = api.LMSFinish("");
- if (result.toString() != "true") {
- var err = ErrorHandler();
- }
- }
-
- return result.toString();
-}
-
-//
-//
-// Function doLMSGetValue(name)
-// Inputs: name - string representing the cmi data model defined category or
-// element (e.g. cmi.core.student_id)
-// Return: The value presently assigned by the LMS to the cmi data model
-// element defined by the element or category identified by the name
-// input value.
-//
-// Description:
-// Wraps the call to the LMS LMSGetValue method
-//
-//
-function doLMSGetValue(name){
- var api = getAPIHandle();
- if (api == null) {
- var returnValue = "";
- alert("Unable to locate the LMS's API Implementation.\nLMSGetValue was not successful.");
- return returnValue;
- }
- else{
- var value = api.LMSGetValue(name);
- var errCode = api.LMSGetLastError().toString();
- if (errCode != _NoError) {
- // an error was encountered so display the error description
- var errDescription = api.LMSGetErrorString(errCode);
- alert("LMSGetValue("+name+") failed. \n"+ errDescription);
- return "";
- }
- else {
-
- return "" + value.toString();
- }
- }
-}
-
-//
-//
-// Function doLMSSetValue(name, value)
-// Inputs: name -string representing the data model defined category or element
-// value -the value that the named element or category will be assigned
-// Return: CMIBoolean true if successful
-// CMIBoolean false if failed.
-//
-// Description:
-// Wraps the call to the LMS LMSSetValue function
-//
-//
-function doLMSSetValue(name, value){
- var api = getAPIHandle();
- if (api == null) {
- var returnValue = "";
- alert("Unable to locate the LMS's API Implementation.\nLMSGetValue was not successful.");
- return returnValue;
- }
- else{
- var result = api.LMSSetValue(name, value);
- if (result.toString() != "true"){
- var err = ErrorHandler();
- }
- }
-
- return;
-}
-
-//
-//
-// Function doLMSCommit()
-// Inputs: None
-// Return: None
-//
-// Description:
-// Call the LMSCommit function
-//
-//
-function doLMSCommit(){
- var api = getAPIHandle();
- if (api == null) {
- var returnValue = "";
- alert("Unable to locate the LMS's API Implementation.\nLMSGetValue was not successful.");
- return returnValue;
- }
- else{
- var result = api.LMSCommit("");
- if (result != "true"){
- var err = ErrorHandler();
- }
- }
-
- return result.toString();
-}
-
-//
-//
-// Function doLMSGetLastError()
-// Inputs: None
-// Return: The error code that was set by the last LMS function call
-//
-// Description:
-// Call the LMSGetLastError function
-//
-//
-function doLMSGetLastError(){
- var api = getAPIHandle();
- if (api == null){
- var returnValue = "";
- if( self.aiccapi == null ){
- alert("Unable to locate the LMS's API Implementation.\nLMSGetValue was not successful.");
- }
- else{
- returnValue = aiccapi.LMSGetLastError();
- }
- return returnValue;
- }
-
- return api.LMSGetLastError().toString();
-}
-
-//
-//
-// Function doLMSGetErrorString(errorCode)
-// Inputs: errorCode - Error Code
-// Return: The textual description that corresponds to the input error code
-//
-// Description:
-// Call the LMSGetErrorString function
-//
-//
-function doLMSGetErrorString(errorCode){
- var api = getAPIHandle();
- if (api == null){
- var returnValue = "";
- alert("Unable to locate the LMS's API Implementation.\nLMSGetValue was not successful.");
- return returnValue;
- }
-
- return api.LMSGetErrorString(errorCode).toString();
-}
-
-//
-//
-// Function doLMSGetDiagnostic(errorCode)
-// Inputs: errorCode - Error Code(integer format), or null
-// Return: The vendor specific textual description that corresponds to the
-// input error code
-//
-// Description:
-// Call the LMSGetDiagnostic function
-//
-//
-function doLMSGetDiagnostic(errorCode){
- var api = getAPIHandle();
- if (api == null){
- var returnValue = "";
- alert("Unable to locate the LMS's API Implementation.\nLMSGetValue was not successful.");
- return returnValue;
- }
-
- return api.LMSGetDiagnostic(errorCode).toString();
-}
-
-//
-//
-// Function LMSIsInitialized()
-// Inputs: none
-// Return: true if the LMS API is currently initialized, otherwise false
-//
-// Description:
-// Determines if the LMS API is currently initialized or not.
-//
-//
-function LMSIsInitialized(){
- // there is no direct method for determining if the LMS API is initialized
- // for example an LMSIsInitialized function defined on the API so we'll try
- // a simple LMSGetValue and trap for the LMS Not Initialized Error
-
- var api = getAPIHandle();
- if (api == null) {
- alert("Unable to locate the LMS's API Implementation.\nLMSIsInitialized() failed.");
- return false;
- }
- else{
- var value = api.LMSGetValue("cmi.core.student_name");
- var errCode = api.LMSGetLastError().toString();
- if (errCode == _NotInitialized){
- return false;
- }
- else{
- return true;
- }
- }
-}
-
-//
-//
-// Function ErrorHandler()
-// Inputs: None
-// Return: The current value of the LMS Error Code
-//
-// Description:
-// Determines if an error was encountered by the previous API call
-// and if so, displays a message to the user. If the error code
-// has associated text it is also displayed.
-//
-//
-function ErrorHandler(){
- var api = getAPIHandle();
- if (api == null){
- alert("Unable to locate the LMS's API Implementation.\nCannot determine LMS error code.");
- return;
- }
-
- // check for errors caused by or from the LMS
- var errCode = api.LMSGetLastError().toString();
- if (errCode != _NoError){
- // an error was encountered so display the error description
- var errDescription = api.LMSGetErrorString(errCode);
-
- if (_Debug == true) {
- errDescription += "\n";
- errDescription += api.LMSGetDiagnostic(null);
- // by passing null to LMSGetDiagnostic, we get any available diagnostics
- // on the previous error.
- }
-
- if(_Debug)alert(errDescription);
- }
-
- return errCode;
-}
-
-//
-//
-// Function getAPIHandle()
-// Inputs: None
-// Return: value contained by APIHandle
-//
-// Description:
-// Returns the handle to API object if it was previously set,
-// otherwise it returns null
-//
-//
-function getAPIHandle(){
-
- if( self.aiccapi ){
- return self.aiccapi;
- }
- if (apiHandle == null){
- apiHandle = getAPI();
- }
-
- return apiHandle;
-}
-
-
-//
-//
-// Function findAPI(win)
-// Inputs: win - a Window Object
-// Return: If an API object is found, it's returned, otherwise null is returned
-//
-// Description:
-// This function looks for an object named API in parent and opener windows
-//
-//
-
-
-
-//
-// Added Code to locate the OPEL Specific Object to enable a SCO to
-// communicate with the platform(OPEL).
-//
-
-
-function findAPI(win){
- while ((win.API == null) && (win.parent != null) && (win.parent != win)) {
- findAPITries++;
-
- // Note: 10 is an arbitrary number, but should be more than sufficient
- if (findAPITries > 10) {
- alert("Error finding API -- too deeply nested.");
- return null;
- }
-
- win = win.parent;
-
- var numOfFrames = win.frames.length;
- var counter = 0;
-
- while(counter < numOfFrames){
- if(win.frames[counter].API){
- return win.frames[counter].API;
- }
- counter++;
- }
- }
- return win.API;
-}
-
-
-
-//
-//
-// Function getAPI()
-// Inputs: none
-// Return: If an API object is found, it's returned, otherwise null is returned
-//
-// Description:
-// This function looks for an object named API, first in the current window's
-// frame hierarchy and then, if necessary, in the current window's opener window
-// hierarchy (if there is an opener window).
-//
-//
-function getAPI(){
- var theAPI = findAPI(window);
- if ((theAPI == null) && (top.opener != null) && (typeof(top.opener) != "undefined")) {
- theAPI = findAPI(top.opener);
- }
-
- if(theAPI == null && useCustomSearch){
- if(searchInOtherLocations){
- theAPI = searchInOtherLocations();
- }
- }
-
- if (theAPI == null){
- alert("Unable to find an API adapter");
- }
- return theAPI;
-} \ No newline at end of file
diff --git a/Explore/elr/Science/S0501/shared/scripts/csl_staticwrapper.js b/Explore/elr/Science/S0501/shared/scripts/csl_staticwrapper.js
deleted file mode 100755
index 805f7fd..0000000
--- a/Explore/elr/Science/S0501/shared/scripts/csl_staticwrapper.js
+++ /dev/null
@@ -1,56 +0,0 @@
-
-
-// CSL_1.3.0.0
-function StaticAdapter(){
-
- this.LMSInitialize = _initialize;
- this.LMSSetValue = _setValue;
- this.LMSGetValue = _getValue;
- this.LMSGetLastError = _getLastError;
- this.LMSGetErrorString = _getErrorString;
- this.LMSGetDiagnostic = _getDiagnostic;
- this.LMSCommit = _commit;
- this.LMSFinish = _finish;
-
-
-}
-
-
-function _initialize(){
- return "true";
-}
-
-function _getValue(pElementName){
- return "";
-}
-
-function _setValue(pElementName , pElementValue){
- return "true";
-}
-
-function _getLastError(){
- return 0;
-}
-
-function _getErrorString(){
- return "";
-}
-
-function _getDiagnostic(){
- return "";
-}
-
-function _commit(){
- return "true";
-}
-
-function _finish(){
- return "true";
-}
-
-/// END OF StaticAdapter Object Definition
-
-
-// initialize the API Adapter For SCOs
-
-var API = new StaticAdapter(); \ No newline at end of file
diff --git a/Explore/elr/Science/S0501/shared/scripts/csl_utils.js b/Explore/elr/Science/S0501/shared/scripts/csl_utils.js
deleted file mode 100755
index 6cc849a..0000000
--- a/Explore/elr/Science/S0501/shared/scripts/csl_utils.js
+++ /dev/null
@@ -1,98 +0,0 @@
-
-
-// CSL_1.3.0.0
-
-
-
-
- function getElementFromSuspendData(elementName){
- var tString = getValue("cmi.suspend_data");
- if( tString == null ){
- tString = "";
- }
- return getElementValue(tString,elementName);
- }
-
-
-
-
-
-
- function addToSuspendData(tagName, tagValue){
- var tString = getValue("cmi.suspend_data");
-
- if( tString == null ){
- tString = "";
- }
-
- tString = addElement( tString, tagName, tagValue );
- setValue("cmi.suspend_data", tString);
-
- }
-
-
-
-
-
-
-
- function setNumberOfAttempts(pAttempts){
- addToSuspendData("attempts",pAttempts);
- }
-
-
-
-
- function getNumberOfAttempts(){
- var tString = getElementFromSuspendData("attempts");
- var tAttempts = parseInt(tString);
- if( isNaN(tAttempts) ){
- tAttempts = 0;
- }
- return tAttempts;
- }
-
-
-
-
-
- //The following functions are private and should not be used by content developers unless there is a custom requirement.
-function getElementValue(completeString, tagName){
-
- var tStartIndex = completeString.indexOf( "<" +tagName+ ">" ) ;
- var tString = "";
-
- if( tStartIndex != -1 ){
- tStartIndex = tStartIndex + tagName.length + 2;
- var tEndIndex = completeString.indexOf("</" + tagName + ">");
- if( tEndIndex == -1 ){
- tEndIndex = completeString.length;
- }
- tString = completeString.substring( tStartIndex, tEndIndex );
- }
- return tString;
-}
-
-function getElementString(tagName, tagValue){
- return "<" + tagName + ">" + tagValue + "</" + tagName + ">";
-}
-
-
-function addElement(completeString, tagName, tagValue){
- var tStartIndex = completeString.indexOf( "<" +tagName+ ">" );
-
- if( tStartIndex == -1 ){
- completeString += getElementString(tagName,tagValue);
- }
- else{
- tStartIndex += tagName.length + 2;
- tEndIndex = completeString.indexOf("</" + tagName + ">");
- completeString = completeString.substring(0,tStartIndex) + tagValue + completeString.substring(tEndIndex,completeString.length);
- }
- return completeString;
-}
-
-
-
-
- \ No newline at end of file