3 //JMATCH-SPECIFIC SCORM-RELATED JAVASCRIPT CODE
5 function SetScormBrowseTime(){
7 API.LMSSetValue('cmi.core.session_time', MillisecondsToTime((new Date()).getTime() - ScormStartTime));
13 //JMATCH-SPECIFIC CORE JAVASCRIPT CODE
17 var QList = new Array();
18 var ShuffleQs = [boolShuffleQs];
20 function SetUpItems(){
25 //Remove all the table rows and put them in an array for processing
26 var Qs = document.getElementById('Questions');
28 //Remove the table rows to an array
29 while (Qs.getElementsByTagName('tr').length > 0){
30 Row = Qs.getElementsByTagName('tr')[0];
31 Row.getElementsByTagName('td')[0].className = 'Hidden';
32 Row.getElementsByTagName('td')[1].className = 'Hidden';
33 QList.push(Qs.removeChild(Row));
37 if (ShuffleQs == true){
38 QList = Shuffle(QList);
41 //Write the rows back to the table body
42 for (i=0; i<QList.length; i++){
43 Qs.appendChild(QList[i]);
54 API.LMSInitialize('');
55 API.LMSSetValue('cmi.core.lesson_status', 'browsed');
56 API.LMSSetValue('cmi.comments', 'This exercise has no checking or scoring features.');
63 PreloadImages([PreloadImageList]);
73 function DeleteItem(){
74 if ((CurrItem == null)||(document.getElementById('Questions').getElementsByTagName('tr').length < 1)){return;}
76 //Delete the current item
77 var DelItem = CurrItem;
80 document.getElementById('Questions').removeChild(DelItem);
84 var Qs = document.getElementById('Questions');
86 var Len = Qs.getElementsByTagName('tr').length;
88 //Bail if no more items
93 //if no current item, get the last item so we roll forward
94 if (CurrItem == null){
95 CurrItem = Qs.getElementsByTagName('tr')[Len-1];
96 if (CurrItem == null){
101 //if CurrItem has been fully shown, move to the next one
103 CurrItem.getElementsByTagName('td')[0].className = 'Hidden';
104 CurrItem.getElementsByTagName('td')[1].className = 'Hidden';
105 if (CurrItem.nextSibling != null){
106 CurrItem = CurrItem.nextSibling;
109 CurrItem = Qs.getElementsByTagName('tr')[0];
113 //Show the appropriate bits
115 //Show the first item and hide the second
116 CurrItem.getElementsByTagName('td')[0].className = 'Showing';
117 CurrItem.getElementsByTagName('td')[1].className = 'Hidden';
122 CurrItem.getElementsByTagName('td')[0].className = 'Showing';
123 CurrItem.getElementsByTagName('td')[1].className = 'Showing';