macromedia.exchange.extensions.dreamweaver
[Top] [All Lists]

Coursebuilder question

Subject: Coursebuilder question
From: "petaire" <webforumsuser@xxxxxxxxxxxxxx>
Date: Thu, 24 Jul 2008 19:47:33 +0000 (UTC)
Newsgroups: macromedia.exchange.extensions.dreamweaver

Hi,
 I've been using this exact same Coursebuilder interaction in the same way for 
years with the same app and OS and browser but am now getting an error.

 I put a text type interaction in an .htm page in DreamWeaver MX 2004 using the 
CourseBuilder extention and when I bring it up in IE 6.0, it returns an error 
'G01 object undefined
 The person using the browser would normally enter ABCD into the textbox, click 
outside the textbox and would GoTo the next page.

 Instead, the user types ABCD but nothing happens when clicking outside the box 
or pressing the TAB key.

 Precious little has changed since it was working fine for me using almost the 
exact same template, OS, browser, etc. only a month ago!!??  I've been 
repeating this exact methodology for years and never had a problem.  The 
CourseBuilder code appears to be exactly the same as one page in a different 
project in which it is working. The Add Code to Update the template dialog box 
has come up in the past and I clicked the Add button (as usual), the javascript 
folders were added to the directory (as usual)....but I'm getting the error....

 Any thoughts or help would be so very much appreciated (and I'm not above 
realizing that it's a silly user error on my part -- in fact I hope that's all 
it is!)

 Regards,
 Peter
 p.lester@xxxxxxxxxxx
 Will supply phone if needed
 Will supply more code if needed

 <html><!-- #BeginTemplate "/Templates/GrandFather3_ISD_Course.dwt" --><!-- DW6 
-->
 <head>
 <title>IBM InfoSphere Information Services Director</title>
 <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
 <script language="JavaScript">




 function getHREF(){ //gets the page URL

        var MaxBarLength = 200;
        var totalUnits = 13;   //Set this to the last unit/lesson number that 
has 
tutorial content i.e. the Guided Tour.
        var resultString; //used to display results

        //create an array that holds a mapping of the unit to page number. For 
example, array index 6 will hold the page count for the unit 6. Array index 13 

 will hold the page count for unit 13 and so on.
        var unitPageArray = new Array();
        
        var guidedTour = 9; //This needs to be manually set with each 
Flexlearning 
course to the lesson number of the guided tour section.

        unitPageArray[0] = 0; //this will never have a value because there is 
no zero 
lesson
        unitPageArray[1] = 2; //this will have a value of 2 because of the page 
with 
a 10.htm in it
        unitPageArray[2] = 9; //this will have a value of 9
        unitPageArray[3] = 4; //this will have a value of 4
        unitPageArray[4] = 6; //   PETER -- you must count lesson pages and 
change 
this from course to course
        unitPageArray[5] = 4; //unit 5 is the fifth lesson
        unitPageArray[6] = 9; 
        unitPageArray[7] = 3; 
        unitPageArray[8] = 6; 
        unitPageArray[9] = 67; 
        unitPageArray[10] = 19; 
        unitPageArray[11] = 5; 
        unitPageArray[12] = 31; 
        unitPageArray[13] = 10; 
        unitPageArray[14] = 4; //PETER and AARON We'll need to adjust 
count/flash 
display to reflect "lessons" 14 and 15 
        unitPageArray[15] = 1; //PETER and AARON We'll need to adjust 
count/flash 
display to reflect "lessons" 14 and 15


        //Guided Tour subLessonCountArray - The guided tour may have sub 
lessons 
within it. This array holds the page counts for each of the sublessons
        //for example, 0005.htm, 1005.htm, 2005.htm....n005.htm
        var subLessonCountArray = new Array();
        subLessonCountArray[0] = 0; //PETER, for most courses, set 
subLessonCountArray[0] (= to whatever) ONLY:  not CountArray[1], [2], etc.  Set 
This to 

 page number within [0].  If there are no sublessons, then set this array[0] = 
Total pages in Guided Tour and the rest of the array numbers = 0.  Else, set 

 each of the array numbers to the sub section's total count 
        subLessonCountArray[1] = 0;
        subLessonCountArray[2] = 0;
        subLessonCountArray[3] = 0;
        subLessonCountArray[4] = 0;
        subLessonCountArray[5] = 0;
        subLessonCountArray[6] = 0;
        subLessonCountArray[7] = 0;
        subLessonCountArray[8] = 0;
        subLessonCountArray[9] = 0;


        var url=location.href; // DO NOT CHANGE ANY OF THE FOLLOWING 
        var pageNumber = url.substring((url.length - 8), url.length -4);
        var pageUnit = url.substring((url.length - 12), (url.length - 9));
        var intPageNumber = parseInt(pageNumber, 10);
        var intPageUnit = parseInt(pageUnit, 10);
        var actualPage = (intPageNumber / 5);


        if(intPageUnit == guidedTour){
                //we are in the guided tour

                //get the subUnitNumber off the front of the page number string 
- example: 
1005  ---> we want to get the 1
                var subUnitNumber = pageNumber.substring(0, 1);
                var intsubUnitNumber = parseInt(subUnitNumber, 10);
                
                //get the sub unit page count
                var subUnitPage = pageNumber.substring(1, 4);
                var intsubUnitPage = parseInt(subUnitPage, 10);         

                //get the actual subunit page number we are on by dividing the 
last 3 digits 
of the page count url by 5
                varActualSubUnitPageCount = (intsubUnitPage / 5);
        
                //add up the subunit page counts that lead to this sublesson we 
currently 
are on. Then at the end, add the current page we are on in the sub 

 unit to that number.
                var i=0;
                var addedSubs = 0;
                for(i=0;i<intsubUnitNumber;i++){
                        addedSubs = addedSubs + subLessonCountArray[i];
                }
                
                //currentSubPageCount will hold the page we are on out of the 
lessons total 
pages
                actualPage = addedSubs + varActualSubUnitPageCount;

        }



        if(intPageUnit > totalUnits){
                //if the unit we are on is greater in number than the hardcoded 
totalUnits, 
then we just show the totalUnits number
                intPageUnit = totalUnits;
                resultString = 'Lesson ' + intPageUnit + ' of ' + totalUnits + 
'. Page 
Progress:';
                document.getElementById('txt').value = resultString;
                BarLength = MaxBarLength;
        }       
        else{
        
                //resultString = 'Page ' + actualPage + ' of ' + 
unitPageArray[intPageUnit]+ 
' in Lesson ' + intPageUnit + ' of ' + totalUnits + ' .';
                resultString = 'Lesson ' + intPageUnit + ' of ' + totalUnits + 
'. Page 
Progress:';
                document.getElementById('txt').value = resultString;
                var BarLength = (actualPage/unitPageArray[intPageUnit]) * 
MaxBarLength;
        }

        return BarLength;
 }

 <!--
 function MM_reloadPage(init) {  //reloads the window if Nav4 resized
   if (init==true) with (navigator) {if 
((appName=="Netscape")&&(parseInt(appVersion)==4)) {
     document.MM_pgW=innerWidth; document.MM_pgH=innerHeight; 
onresize=MM_reloadPage; }}
   else if (innerWidth!=document.MM_pgW || innerHeight!=document.MM_pgH) 
location.reload();
 }
 MM_reloadPage(true);
 // -->
 </script>
 <!-- #BeginEditable "CourseBuilder" -->
 <script language="JavaScript">
 <!--
 function MM_initInteractions(){}

 function P7_getHW(t,a) { //v2.03 by PVII
   var r,p,h=0,w=0;if((p=MM_findObj(a)) !=null){
   if(document.all || 
document.getElementById){h=parseInt(p.offsetHeight);w=parseInt(p.offsetWidth);
   if(!h){h=parseInt(p.style.pixelHeight);w=parseInt(p.style.pixelWidth);}
   }else 
if(document.layers){h=parseInt(p.clip.height);w=parseInt(p.clip.width);}}
   if(t=="width"){r=w;}else{r=h;}return r; 
 }

 function P7_MM1dwt() { //v2.03 by PVII
   var g,lh,sw,fr = false;
   if(!document.p7mc)return;
   for(var x=0;x<p7m1.length;x++){tl=p7m1[x].id;lh="P7CM1DWT0"+tl;
        if((g=MM_findObj(lh)) !=null){fr=true;sw=0;break;}
        lh="P7CM1DWT1"+tl;if((g=MM_findObj(lh)) !=null){fr=true;sw=1;break;}}
   if(fr){eval("P7_trigMenuMagic1('"+tl+"',"+sw+")");}
 }

 function P7_setMenuMagic1() { //v2.03 by PVII
   var 
s,d,g,g2,gg,ww,kx,th,tu,ts,nu,xx,k=0,pa=0;args=P7_setMenuMagic1.arguments;
   if((navigator.appName=="Netscape") && parseInt(navigator.appVersion)>4 && 
navigator.userAgent.indexOf("Opera")==-1){pa="px";}
   
if(navigator.userAgent.indexOf("Opera")>-1){P7OperaW=window.innerWidth;P7OperaH=
window.innerHeight;}
   if(!document.p7mc) {
    p7m=new Array();document.p7mc=true;p7ms=new Array();document.P7_imswap=new 
Array();document.P7_imswapo=new Array();
    p7m1=new Array();p7m2=new Array();p7mprop=new 
Object();p7mprop.p7offset=args[0];p7mprop.p7rate=args[1];
    p7mprop.p7delay=args[2];p7mprop.p7bottom=args[3];
    if(document.layers){p7mprop.p7pageh = document.height;}}
   for(var x=4;x<args.length;x+=3){if((g=MM_findObj(args[x])) !=null){
     p7m[k]=args[x];g.p7imname=args[x+2];g.p7sub=args[x+1];
     g2=MM_findObj(args[x+2]);tu=g2.src;ts=tu.lastIndexOf(".");
     nu=tu.substring(0,ts)+"_open"+tu.substring(ts,tu.length);
        nu2=tu.substring(0,ts)+"_over"+tu.substring(ts,tu.length);
     document.P7_imswap[k]=new Image();document.P7_imswap[k].src=nu;
        document.P7_imswapo[k]=new Image();document.P7_imswapo[k].src=nu2;k++;}}
   var lf=0;for (var j=0;j<p7m.length;j++){
    if((g=MM_findObj(p7m[j])) 
!=null){d=(document.layers)?g:g.style;p7m1[j]=g;g.p7waiting=false;
     if(j==0){lf=parseInt(d.left);th=parseInt(d.top);}
     if(j>0){d.left=(lf+pa);th+=P7_getHW('height',p7m[j-1]);d.top=(th+pa);}
     if((s=MM_findObj(g.p7sub)) !=null){p7m2[j]=s;ww=P7_getHW('width',g.p7sub);
      kx=lf-ww-20;dd=(document.layers)?s:s.style;
      
dd.left=(kx+pa);dd.top=(th+pa);p7ms[j]=th;dd.visibility="visible";s.p7open=false
;s.p7waiting=false;}}}
   if((g=MM_findObj(p7mprop.p7bottom)) !=null){d=(document.layers)?g:g.style;
    
d.left=(lf+parseInt(args[0])+pa);th+=P7_getHW('height',p7m[p7m.length-1]);d.top=
(th+pa);}
 }

 function P7_wait(a) { //v2.03 by PVII
   var ma,mb;if((mb=MM_findObj(a)) !=null){
    if(!mb.p7waiting || mb.p7waiting=="none"){return;}
     ma=mb.p7waiting;mb.p7waiting=false;eval(ma);}
 }

 function P7_trigMenuMagic1(a,sw) { //v2.03 by PVII
   var x,g,gg,d,dd,w,lp,tp,im,im2,ts,nu,e,pa=0;
   if(!document.p7mc)return;
   if((navigator.appName=="Netscape") && parseInt(navigator.appVersion)>4 && 
navigator.userAgent.indexOf("Opera")==-1){pa="px";}
   if(navigator.userAgent.indexOf("Opera")>-1){if( P7OperaW!=window.innerWidth 
|| P7OperaH!=window.innerHeight)P7_setMenuMagic1();}
   var ofs=parseInt(p7mprop.p7offset),trt = parseInt(p7mprop.p7rate);
   var tdy=parseI

<Prev in Thread] Current Thread [Next in Thread>
  • Coursebuilder question, petaire <=