Adobe Connect User Community
Menu

#1 2012-08-05 13:47:16

**_goal2090_**

HTML/Javascript Content for Use In Connect Pro ()

I am new to this and trying to figure out how to use  "getParameter" I have a page with 3 html files. one of the page2.html has textboxed (this is user input). I just need to know how do you send and read the values if you come back to the survey

here is the simple index.html
<html xmlns="https://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
        <title>HTML to Connect: Prototype</title>
        <script src="scripts/ConnectCommon.js"> </script>
        <script type="text/javascript">
            function loadJSFile(file_str)
            {
                document.write('<script src="', file_str, '" type="text/JavaScript"><\/script>');
            }

            var isAICC_bln = isAICCwindow(window);

            if(isAICC_bln)
            {
                loadJSFile("scripts/ConnectAICC.js");
            } else {
                loadJSFile("scripts/ConnectSCORM.js");
            }

        </script>
        <script type="text/javascript" language="JavaScript">

            // AEC: Change reference to file to load from content here
            var windowContent_str = "content/navigation.htm";

            // AEC: Set whether to send score as a percentage (overrides the value set in AICCtoConnect.js)
            setLMSScoreAsPercent(true);

            // AEC: Set whether to warn when tracking is disabled (this is not related to debugging option)
            setWarnWhenNoTracking(false);

            // AEC: Set debugging option here (overrides the value set in AICCtoConnect.js)
            setDebug(false);

            // AEC: Set exit URL and wait period (if appropriate).  This is *only* in effect, in case the browser can't be closed
            setExitURL('content/exit.htm', 1.5);

            // AEC: Start loading data from Connect
            initialize(3, 'launchContent', this, windowContent_str);

            // AEC: Custom (Define custom properties and methods for content here, if appropriate)
            function launchContent(url_str)
            {
                window.navigation.location.href = url_str;
            }

        </script>
    </head>

    <frameset frameborder="0" border="0" framespacing="0" rows="480,*" onunload="onBrowserClose()">
      <frame src="scripts/loading.htm" name="content" frameborder="0">
      <frame src="scripts/blank.htm" name="navigation" frameborder="0">
      <noframes>
        <body>
          <p>This web page uses frames, but your browser doesn't support them.</p>
        </body>
      </noframes>
    </frameset>

</html>

here is page2.html


------------------------------------------------------------------------------------------------------------------------

<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Page 2</title>
<style type="text/css">
<!--
body {
    background-image: url(images/Photography.jpg);
    background-repeat: no-repeat;
    background-position:center

}
.style4 {
    font-size: 24px;
    font-weight: bold;
}
.style5 {font-size: 24px}
-->
</style></head>
<body bgcolor="#ffffff">
<div align="center">
  <p align="left">&nbsp;</p>
  <p align="left">&nbsp;</p>
  <table width="557" border="0" align="center">
    <tr>
      <td width="535"><span class="style4">The Shutter Release</span></td>
    </tr>
    <tr>
      <td>
          <table>
         <tr>
           <td> <input id="Text1" type="text" runat="server" disable="true" text="Sport1"/></td>
            <td> <input id="txt_sport1" type="text" runat="server" disable="false"/></td>
         </tr>
         <tr>
           <td> <input id="Text2" type="text" runat="server" disable="true" text="Sport2"/></td>
            <td> <input id="txt_sport2" type="text" runat="server" disable="false"/></td>
         </tr>
       
        </table>
     </td>
    </tr>
  </table>
</body>
</html>
I read this link but still confused and I appreciated if somesome show me an example
http://www.connectusers.com/tutorials/2 … /index.php

thanks

Offline

#2 2012-08-06 14:19:38

**_AChemey_**

Re: HTML/Javascript Content for Use In Connect Pro ()

Did you review the examples that were included in the article?

It seems as if your launch file is: content/navigation.htm.  This file would be modified to include a reference to the tracking methods and properties that have been defined.  Typically, it would be something like this:

var tracking = parent;

Then if you have already sent data to the LMS - you could retreive it by calling the GET methods (e.g. tracking.getLessonLocation() or tracking.getLessonData()).

This returns the data that you had sent to the LMS for those values.  You need to know what they mean and thus can take the learner to the page they left off; or remember how they answered specific questions, etc.

Feel free to contact me off-list for as much assistance as possible.

-Andrew

Offline

#3 2012-08-06 20:45:24

**_goal2090_**

Re: HTML/Javascript Content for Use In Connect Pro ()

Hey Andrew  thank you for ur help.
yes I did look at the example but i still don't see an example of passing/get user input
here is my navigation.htm page:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
        <title>Navigation Frame</title>
        <script language="javascript">
            var pageStructure_ary = ["page1.htm", "page2.htm", "page3.htm"];
            var pageQuestion_ary = [0,1,0];

            var currentPage_int = 0;

            var subFolder_str = "";
            var tracking = parent;

            // These are global variables used any time a setInterval is executed in this navigation code.
            // It's a bit of an overkill, but the "var" is the interval; the "str" is the name of function
            // to execute when the interval is completed; the "obj" is the object to execute the function.
            var navigationInterval_var = '';
            var navigationInterval_obj = '';
            var navigationInterval_str = '';


            function nextPage()
            {
                if(currentPage_int+1 < pageStructure_ary.length)
                {
                    currentPage_int++;
                    tracking.content.location.href = subFolder_str + pageStructure_ary[currentPage_int];
                }
                checkButtonStates();
            }

            function previousPage()
            {
                if(currentPage_int > 0)
                {
                    currentPage_int--;
                    tracking.content.location.href = subFolder_str + pageStructure_ary[currentPage_int];
                }
                checkButtonStates();
            }

            function exitPage()
            {
                tracking.sendTrackingData();
                tracking.sendExitData();
                navigationInterval_obj = tracking;
                navigationInterval_str = 'setBrowserClosed';
                navigationInterval_var = setInterval(waitForEmptyQueue, 100);
            }

            function checkButtonStates()
            {
                if(currentPage_int == 0)
                {
                    Previous.disabled = true;
                } else {
                    Previous.disabled = false;
                }

                if(currentPage_int + 1 >= pageStructure_ary.length)
                {
                    Next.disabled = true;
                    // Since we are at the last page - call a function to indicate that.
                    // This is NOT used in all cases, but currently set's completion
                    // based on being at last page
                    setLastPage(true);
                } else {
                    Next.disabled = false;
                }
                tracking.setLessonLocation(currentPage_int);
            }

            function setLocation(location_var)
            {
                var tempLocation_var = '';
                if(typeof(location_var) != "undefined")
                {
                    tempLocation_var = location_var;
                }
                tracking.setLessonLocation(tempLocation_var);
            }

            function getCurrentPage(loadPage_bln)
            {
                var tempCurrentPage_int = tracking.getLessonLocation();
                if(tempCurrentPage_int > 0)
                {
                    currentPage_int = tempCurrentPage_int;
                } else {
                    currentPage_int = 0;
                }

                if(loadPage_bln)
                {
                    tracking.content.location.href = subFolder_str + pageStructure_ary[currentPage_int];
                }

                checkButtonStates();
            }

            function setLastPage(isLastPage_bln)
            {
                // AEC: Behavior of the last page is determined by the content.  In this example, the
                // last page set's the "completion" status.  The status is "incomplete" until the last
                // page is reached.  A better alternative is to set completion based on viewing *all*
                // pages in the array pageStructureArray.  See example that includes a Flash Interaction
                // for this concept.

                if(typeof(isLastPage_bln) != 'undefined')
                {
                    if(isLastPage_bln)
                    {
                        tracking.setScoreRaw('100');
                        tracking.setLessonStatus('completed');
                    } else {
                        tracking.setLessonStatus('incomplete');
                    }
                } else {
                    // This function shouldn't be called for any other reason, but we'll ignore for now
                }
            }

            function waitForEmptyQueue()
            {
                if(tracking.checkQueue() == 0)
                {
                    // Queue is empty
                    clearInterval(navigationInterval_var);
                    if(typeof(navigationInterval_str) != 'undefined' && navigationInterval_str != '')
                    {
                        if(typeof(navigationInterval_obj) == 'undefined' || navigationInterval_obj == '')
                        {
                            executeFunction_obj = this;
                        }
                        navigationInterval_obj[navigationInterval_str]();
                    }
                    navigationInterval_obj = '';
                    navigationInterval_str = '';
                }
            }

        </script>
    </head>

    <body onLoad="getCurrentPage(true)">
        <center>
            <input type="button" name="Previous" id="Previous" value="&lt; Previous" onClick = "previousPage()" />

            <input type="button" name="Exit" id="Exit" value="    Exit    " onClick = "exitPage()" />

            <input type="button" name="Next" id="Next" value="    Next &gt;   " onClick="nextPage()" />
        </center>
    </body>
</html>

Offline

#4 2012-08-07 10:12:09

**_AChemey_**

Re: HTML/Javascript Content for Use In Connect Pro ()

Assuming you have a text entry field named "txt_sport1" and it contains the only data that you'd like to store with the LMS... 

To send the data to the LMS, you'd call:

var str_DataToSend = txt_sport1.text;
tracking.setLessonData(str_DataToSend);



To retrieve that data and display it as the default text you'd call:

var str_DataToRetrieve = tracking.getLessonData();
txt_sport1.text = str_DataToRetrieve;


Obviously, this get's more complicated if you have more data that you want to send.  I'd recommend a name/value-pair; delimited via some character (e.g. something like: txt_sport1=VALUE&txt_sport2=VALUE).

-Andrew

Offline

#5 2012-08-08 22:13:54

**_goal2090_**

Re: HTML/Javascript Content for Use In Connect Pro ()

Hey Andrew, thank you soooo much for you help. I just still have one question :).  I am still confused on where we put this and how do we call it or check for it. in other words:
this is page2.html
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Page 2</title>
<style type="text/css">
<!--
body {
    background-image: url(images/Photography.jpg);
    background-repeat: no-repeat;
    background-position:center

}
.style4 {
    font-size: 24px;
    font-weight: bold;
}
.style5 {font-size: 24px}

-->
</style></head>
<body bgcolor="#ffffff">
<div align="center">
  <p align="left">&nbsp;</p>
  <p align="left">&nbsp;</p>
  <table width="557" border="0" align="center">
    <tr>
      <td width="535"><span class="style4">The Shutter Release</span></td>
    </tr>
    <tr>
      <td>
          <table>
         <tr>
           <td> <input id="Text1" type="text" runat="server" disable="true" text="Sport1"/></td>
            <td> <input id="txt_sport1" type="text" runat="server" disable="false"/></td>
         </tr>
         <tr>
           <td> <input id="Text2" type="text" runat="server" disable="true" text="Sport2"/></td>
            <td> <input id="txt_sport1" type="text" runat="server" disable="false"/></td>
         </tr>
       
        </table>
     </td>
    </tr>
  </table>
</body>
</html>

now this code will not be in pgae2.html it will be  put  in navigation.html right? if yes tthen where  will this go in that page? should I create a function ? if yes then how would I call it when clicking page2.htm
    var str_DataToSend = document.getElementById('txt_sport1').value;
     tracking.setLessonData(str_DataToSend);

     var str_DataToSend2 = document.getElementById('txt_sport2').value;
     tracking.setLessonData(str_DataToSend2);

where will this go and where would i check to see if the page has been completed . if page was completed then I will use this

var str_DataToRetrieve = tracking.getLessonData();
document.getElementById('txt_sport1').value = str_DataToRetrieve;

var str_DataToRetrieve2 = tracking.getLessonData();
document.getElementById('txt_sport2').value = str_DataToRetrieve2;


I guess my problem is i am not seeing where will I put the above code at.
here is my navigation.htm
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
        <title>Navigation Frame</title>
        <script language="javascript">
            var pageStructure_ary = ["page1.htm", "page2.htm", "page3.htm"];
            var pageQuestion_ary = [0,1,0];

            var currentPage_int = 0;

            var subFolder_str = "";
            var tracking = parent;

            // These are global variables used any time a setInterval is executed in this navigation code.
            // It's a bit of an overkill, but the "var" is the interval; the "str" is the name of function
            // to execute when the interval is completed; the "obj" is the object to execute the function.
            var navigationInterval_var = '';
            var navigationInterval_obj = '';
            var navigationInterval_str = '';


            function nextPage()
            {
                if(currentPage_int+1 < pageStructure_ary.length)
                {
                    currentPage_int++;
                    tracking.content.location.href = subFolder_str + pageStructure_ary[currentPage_int];
                }
                checkButtonStates();
            }

            function previousPage()
            {
                if(currentPage_int > 0)
                {
                    currentPage_int--;
                    tracking.content.location.href = subFolder_str + pageStructure_ary[currentPage_int];
                }
                checkButtonStates();
            }

            function exitPage()
            {
                tracking.sendTrackingData();
                tracking.sendExitData();
                navigationInterval_obj = tracking;
                navigationInterval_str = 'setBrowserClosed';
                navigationInterval_var = setInterval(waitForEmptyQueue, 100);
            }

            function checkButtonStates()
            {
                if(currentPage_int == 0)
                {
                    Previous.disabled = true;
                } else {
                    Previous.disabled = false;
                }

                if(currentPage_int + 1 >= pageStructure_ary.length)
                {
                    Next.disabled = true;
                    // Since we are at the last page - call a function to indicate that.
                    // This is NOT used in all cases, but currently set's completion
                    // based on being at last page
                    setLastPage(true);
                } else {
                    Next.disabled = false;
                }
                tracking.setLessonLocation(currentPage_int);
            }

            function setLocation(location_var)
            {
                var tempLocation_var = '';
                if(typeof(location_var) != "undefined")
                {
                    tempLocation_var = location_var;
                }
                tracking.setLessonLocation(tempLocation_var);
            }

            function getCurrentPage(loadPage_bln)
            {
                var tempCurrentPage_int = tracking.getLessonLocation();
                if(tempCurrentPage_int > 0)
                {
                    currentPage_int = tempCurrentPage_int;
                } else {
                    currentPage_int = 0;
                }

                if(loadPage_bln)
                {
                    tracking.content.location.href = subFolder_str + pageStructure_ary[currentPage_int];
                }

                checkButtonStates();
            }

            function setLastPage(isLastPage_bln)
            {
                // AEC: Behavior of the last page is determined by the content.  In this example, the
                // last page set's the "completion" status.  The status is "incomplete" until the last
                // page is reached.  A better alternative is to set completion based on viewing *all*
                // pages in the array pageStructureArray.  See example that includes a Flash Interaction
                // for this concept.

                if(typeof(isLastPage_bln) != 'undefined')
                {
                    if(isLastPage_bln)
                    {
                        tracking.setScoreRaw('100');
                        tracking.setLessonStatus('completed');
                    } else {
                        tracking.setLessonStatus('incomplete');
                    }
                } else {
                    // This function shouldn't be called for any other reason, but we'll ignore for now
                }
            }

            function waitForEmptyQueue()
            {
                if(tracking.checkQueue() == 0)
                {
                    // Queue is empty
                    clearInterval(navigationInterval_var);
                    if(typeof(navigationInterval_str) != 'undefined' && navigationInterval_str != '')
                    {
                        if(typeof(navigationInterval_obj) == 'undefined' || navigationInterval_obj == '')
                        {
                            executeFunction_obj = this;
                        }
                        navigationInterval_obj[navigationInterval_str]();
                    }
                    navigationInterval_obj = '';
                    navigationInterval_str = '';
                }
            }

        </script>
    </head>

    <body onLoad="getCurrentPage(true)">
        <center>
            <input type="button" name="Previous" id="Previous" value="&lt; Previous" onClick = "previousPage()" />

            <input type="button" name="Exit" id="Exit" value="    Exit    " onClick = "exitPage()" />

            <input type="button" name="Next" id="Next" value="    Next &gt;   " onClick="nextPage()" />
        </center>
    </body>
</html>

Thanks for your help

Last edited by **_goal2090_** (2012-08-08 22:17:28)

Offline

#6 2012-08-09 10:04:49

**_AChemey_**

Re: HTML/Javascript Content for Use In Connect Pro ()

The best way to see this is with a full package:

http://achemeyna1.adobeconnect.com/p17z … wnload=zip


Otherwise, here is the code for page2.htm as I see it.

<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
    <title>Page 2</title>
    <style type="text/css">
        <!--
        body {
            background-image: url(images/Photography.jpg);
            background-repeat: no-repeat;
            background-position:center

        }
        .style4 {
            font-size: 24px;
            font-weight: bold;
        }
        .style5 {font-size: 24px}
        -->
    </style>
    <script language="JavaScript">
        var tracking = parent;

        function sendDataToLMS()
        {
            var dataSend_str = '';
            dataSend_str += 'txt_sport1=' + document.getElementById('txt_sport1').value + '\r\n';
            dataSend_str += 'txt_sport2=' + document.getElementById('txt_sport2').value;
            tracking.setLessonStatus('incomplete');
            tracking.setLessonData(dataSend_str);
            tracking.sendTrackingData();
        }

        function getDataFromLMS()
        {
            var dataReceive_str = tracking.getLessonData();
            var dataReceive_ary = dataReceive_str.split('\r\n');
            for(var dataReceiveItem_var in dataReceive_ary)
            {
                var dataReceiveItem_ary = dataReceive_ary[dataReceiveItem_var].split('=');
                document.getElementById(dataReceiveItem_ary[0]).value = dataReceiveItem_ary[1];
            }
        }
    </script>
</head>
<body bgcolor="#ffffff">
<div align="center">
  <p align="left">&nbsp;</p>
  <p align="left">&nbsp;</p>
  <table width="557" border="0" align="center">
    <tr>
      <td width="535"><span class="style4">The Shutter Release</span></td>
    </tr>
    <tr>
      <td>
          <table>
         <tr>
           <td> <input id="Text1" name="Text1" type="text" disabled="disabled" value="Sport1" text="Sport1"/></td>
            <td> <input id="txt_sport1" type="text" disable="false"/></td>
         </tr>
         <tr>
           <td> <input id="Text2" type="text" disabled="disabled" value="Sport2" text="Sport2"/></td>
            <td> <input id="txt_sport2" type="text" disable="false"/></td>
         </tr>

        </table>
     </td>
    </tr>
  </table>
  <input type="submit" name="sendDataToLMS" id="sendDataToLMS" value="Send Data To LMS" onclick="sendDataToLMS();" />
  <script language="JavaScript">
      getDataFromLMS();
  </script>
</body>
</html>

Offline

#7 2012-08-20 19:08:59

**_goal2090_**

Re: HTML/Javascript Content for Use In Connect Pro ()

Thak you AChemey for your help. Sorry for the delay , I was out of work for some emergency and Just got back. I am not sure how can I upload my zip file like what you did! (I am using  a full package)
the issue is page2.html is using the navigation.html page so i can't use this in page2

<input type="submit" name="sendDataToLMS" id="sendDataToLMS" value="Send Data To LMS" onclick="sendDataToLMS();" />
  <script language="JavaScript">
      getDataFromLMS();
  </script>

also i cannot see how do you do something like this
document.getElementById('txt_sport2').value = the value from LMS;
instead of this

document.getElementById(dataReceiveItem_ary[0]).value = dataReceiveItem_ary[1];


navigation.html
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
        <title>Navigation Frame</title>
        <script language="javascript">
            var pageStructure_ary = ["page1.htm", "page2.htm", "page3.htm"];
            var pageQuestion_ary = [0,1,0];

            var currentPage_int = 0;

            var subFolder_str = "";
            var tracking = parent;

            // These are global variables used any time a setInterval is executed in this navigation code.
            // It's a bit of an overkill, but the "var" is the interval; the "str" is the name of function
            // to execute when the interval is completed; the "obj" is the object to execute the function.
            var navigationInterval_var = '';
            var navigationInterval_obj = '';
            var navigationInterval_str = '';


            function nextPage()
            {
                if(currentPage_int+1 < pageStructure_ary.length)
                {
                    currentPage_int++;
                    tracking.content.location.href = subFolder_str + pageStructure_ary[currentPage_int];
                }
                checkButtonStates();
            }

            function previousPage()
            {
                if(currentPage_int > 0)
                {
                    currentPage_int--;
                    tracking.content.location.href = subFolder_str + pageStructure_ary[currentPage_int];
                }
                checkButtonStates();
            }

            function exitPage()
            {
                tracking.sendTrackingData();
                tracking.sendExitData();
                navigationInterval_obj = tracking;
                navigationInterval_str = 'setBrowserClosed';
                navigationInterval_var = setInterval(waitForEmptyQueue, 100);
            }

            function checkButtonStates()
            {
                if(currentPage_int == 0)
                {
                    Previous.disabled = true;
                } else {
                    Previous.disabled = false;
                }

                if(currentPage_int + 1 >= pageStructure_ary.length)
                {
                    Next.disabled = true;
                    // Since we are at the last page - call a function to indicate that.
                    // This is NOT used in all cases, but currently set's completion
                    // based on being at last page
                    setLastPage(true);
                } else {
                    Next.disabled = false;
                }
                tracking.setLessonLocation(currentPage_int);
            }

            function setLocation(location_var)
            {
                var tempLocation_var = '';
                if(typeof(location_var) != "undefined")
                {
                    tempLocation_var = location_var;
                }
                tracking.setLessonLocation(tempLocation_var);
            }

            function getCurrentPage(loadPage_bln)
            {
                var tempCurrentPage_int = tracking.getLessonLocation();
                if(tempCurrentPage_int > 0)
                {
                    currentPage_int = tempCurrentPage_int;
                } else {
                    currentPage_int = 0;
                }

                if(loadPage_bln)
                {
                    tracking.content.location.href = subFolder_str + pageStructure_ary[currentPage_int];
                }

                checkButtonStates();
            }

            function setLastPage(isLastPage_bln)
            {
                // AEC: Behavior of the last page is determined by the content.  In this example, the
                // last page set's the "completion" status.  The status is "incomplete" until the last
                // page is reached.  A better alternative is to set completion based on viewing *all*
                // pages in the array pageStructureArray.  See example that includes a Flash Interaction
                // for this concept.

                if(typeof(isLastPage_bln) != 'undefined')
                {
                    if(isLastPage_bln)
                    {
                        tracking.setScoreRaw('100');
                        tracking.setLessonStatus('completed');
                    } else {
                        tracking.setLessonStatus('incomplete');
                    }
                } else {
                    // This function shouldn't be called for any other reason, but we'll ignore for now
                }
            }

            function waitForEmptyQueue()
            {
                if(tracking.checkQueue() == 0)
                {
                    // Queue is empty
                    clearInterval(navigationInterval_var);
                    if(typeof(navigationInterval_str) != 'undefined' && navigationInterval_str != '')
                    {
                        if(typeof(navigationInterval_obj) == 'undefined' || navigationInterval_obj == '')
                        {
                            executeFunction_obj = this;
                        }
                        navigationInterval_obj[navigationInterval_str]();
                    }
                    navigationInterval_obj = '';
                    navigationInterval_str = '';
                }
            }

        </script>
    </head>

    <body onLoad="getCurrentPage(true)">
        <center>
            <input type="button" name="Previous" id="Previous" value="&lt; Previous" onClick = "previousPage()" />

            <input type="button" name="Exit" id="Exit" value="    Exit    " onClick = "exitPage()" />

            <input type="button" name="Next" id="Next" value="    Next &gt;   " onClick="nextPage()" />
        </center>
    </body>
</html>
---------------------------------------------------------------------------------------------------------------

page1.html
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Page 1</title>
<style type="text/css">
<!--
body {
    background-image: url(images/Photography.jpg);
    background-repeat: no-repeat;
    background-position:center

}
.style4 {
    font-size: 24px;
    font-weight: bold;
}
.style5 {font-size: 24px}
-->
</style></head>
<body bgcolor="#ffffff">
<div align="center">
  <p align="left">&nbsp;</p>
  <p align="left">&nbsp;</p>
  <table width="557" border="0" align="center">
    <tr>
      <td width="535"><span class="style4">Welcome to Photography 101</span></td>
    </tr>
    <tr>
      <td><span class="style5"> This is a brief course on using a 35mm camera. By the end of this course, you'll be lucky if you can even take a picture that can be developed, let alone worrying about shutter speed, lighting, appropriate film, focus, angles and all that other stuff that a real course would teach you. This course is a brief demo, only.</span></td>
    </tr>
  </table>
</body>
</html>
---------------------------------------------------------------------------------------------------------
page2.html
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
    <title>Page 2</title>
    <style type="text/css">
        <!--
        body {
            background-image: url(images/Photography.jpg);
            background-repeat: no-repeat;
            background-position:center

        }
        .style4 {
            font-size: 24px;
            font-weight: bold;
        }
        .style5 {font-size: 24px}
        -->
    </style>
    <script language="JavaScript">
        var tracking = parent;

        function sendDataToLMS()
        {
            var dataSend_str = '';
            dataSend_str += 'txt_sport1=' + document.getElementById('txt_sport1').value + '\r\n';
            dataSend_str += 'txt_sport2=' + document.getElementById('txt_sport2').value;
            tracking.setLessonStatus('incomplete');
            tracking.setLessonData(dataSend_str);
            tracking.sendTrackingData();
        }

        function getDataFromLMS()
        {
            var dataReceive_str = tracking.getLessonData();
            var dataReceive_ary = dataReceive_str.split('\r\n');
            for(var dataReceiveItem_var in dataReceive_ary)
            {
                var dataReceiveItem_ary = dataReceive_ary[dataReceiveItem_var].split('=');
                document.getElementById(dataReceiveItem_ary[0]).value = dataReceiveItem_ary[1];
               
            }

        }
    </script>
</head>
<body bgcolor="#ffffff">
<div align="center">
  <p align="left">&nbsp;</p>
  <p align="left">&nbsp;</p>
  <table width="557" border="0" align="center">
    <tr>
      <td width="535"><span class="style4">The Shutter Release</span></td>
    </tr>
    <tr>
      <td>
          <table>
         <tr>
           <td> <input id="Text1" name="Text1" type="text" disabled="disabled" value="Sport1" text="Sport1"/></td>
            <td> <input id="txt_sport1" type="text" disable="false"/></td>
         </tr>
         <tr>
           <td> <input id="Text2" type="text" disabled="disabled" value="Sport2" text="Sport2"/></td>
            <td> <input id="txt_sport2" type="text" disable="false"/></td>
         </tr>

        </table>
     </td>
    </tr>
  </table>
  </body>
</html>
----------------------------------------------------------------------------------------------------
page3.html
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Page 3</title>
<style type="text/css">
<!--
body {
    background-image: url(images/Photography.jpg);
    background-repeat: no-repeat;
    background-position:center

}
.style4 {
    font-size: 24px;
    font-weight: bold;
}
.style5 {font-size: 24px}
-->
</style></head>
<body bgcolor="#ffffff">
<div align="center">
  <p align="left">&nbsp;</p>
  <p align="left">&nbsp;</p>
  <table width="557" border="0" align="center">
    <tr>
      <td width="535"><span class="style4">Thank You!</span></td>
    </tr>
    <tr>
      <td><span class="style5"> You have now completed this course.</span></td>
    </tr>
  </table>
</body>
</html>
Thanks again for everything

Last edited by **_goal2090_** (2012-08-20 19:20:34)

Offline

#8 2012-08-22 20:23:54

**_goal2090_**

Re: HTML/Javascript Content for Use In Connect Pro ()

anyone :)!!!
I am just trying to figure out how to send the data if I am using navigation.html (i just change Sample: Multiple Page Example 2  from http://www.connectusers.com/tutorials/2 … /index.php  ).
Note: dont care about the flash file.
i have page1,page2,page3
page2.html
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
    <title>Page 2</title>
    <style type="text/css">
        <!--
        body {
            background-image: url(images/Photography.jpg);
            background-repeat: no-repeat;
            background-position:center

        }
        .style4 {
            font-size: 24px;
            font-weight: bold;
        }
        .style5 {font-size: 24px}
        -->
    </style>
    <script language="JavaScript">
        var tracking = parent;

        function sendDataToLMS()
        {
            var dataSend_str = '';
            dataSend_str += 'txt_sport1=' + document.getElementById('txt_sport1').value + '\r\n';
            dataSend_str += 'txt_sport2=' + document.getElementById('txt_sport2').value;
            tracking.setLessonStatus('incomplete');
            tracking.setLessonData(dataSend_str);
            tracking.sendTrackingData();
        }

        function getDataFromLMS()
        {
            var dataReceive_str = tracking.getLessonData();
            var dataReceive_ary = dataReceive_str.split('\r\n');
            for(var dataReceiveItem_var in dataReceive_ary)
            {
                var dataReceiveItem_ary = dataReceive_ary[dataReceiveItem_var].split('=');
                document.getElementById(dataReceiveItem_ary[0]).value = dataReceiveItem_ary[1];
               
            }

        }
    </script>
</head>
<body bgcolor="#ffffff">
<div align="center">
  <p align="left">&nbsp;</p>
  <p align="left">&nbsp;</p>
  <table width="557" border="0" align="center">
    <tr>
      <td width="535"><span class="style4">The Shutter Release</span></td>
    </tr>
    <tr>
      <td>
          <table>
         <tr>
           <td> <input id="Text1" name="Text1" type="text" disabled="disabled" value="Sport1" text="Sport1"/></td>
            <td> <input id="txt_sport1" type="text" disable="false"/></td>
         </tr>
         <tr>
           <td> <input id="Text2" type="text" disabled="disabled" value="Sport2" text="Sport2"/></td>
            <td> <input id="txt_sport2" type="text" disable="false"/></td>
         </tr>

        </table>
     </td>
    </tr>
  </table>
  </body>
</html>
how would call sendDataToLMS() if I am using the button next from naviation.html

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
        <title>Navigation Frame</title>
        <script language="javascript">
            var pageStructure_ary = ["page1.htm", "page2.htm", "page3.htm"];
            var pageQuestion_ary = [0,1,0];

            var currentPage_int = 0;

            var subFolder_str = "";
            var tracking = parent;

            // These are global variables used any time a setInterval is executed in this navigation code.
            // It's a bit of an overkill, but the "var" is the interval; the "str" is the name of function
            // to execute when the interval is completed; the "obj" is the object to execute the function.
            var navigationInterval_var = '';
            var navigationInterval_obj = '';
            var navigationInterval_str = '';


            function nextPage()
            {
                if(currentPage_int+1 < pageStructure_ary.length)
                {
                    currentPage_int++;
                    tracking.content.location.href = subFolder_str + pageStructure_ary[currentPage_int];
                }
                checkButtonStates();
            }

            function previousPage()
            {
                if(currentPage_int > 0)
                {
                    currentPage_int--;
                    tracking.content.location.href = subFolder_str + pageStructure_ary[currentPage_int];
                }
                checkButtonStates();
            }

            function exitPage()
            {
                tracking.sendTrackingData();
                tracking.sendExitData();
                navigationInterval_obj = tracking;
                navigationInterval_str = 'setBrowserClosed';
                navigationInterval_var = setInterval(waitForEmptyQueue, 100);
            }

            function checkButtonStates()
            {
                if(currentPage_int == 0)
                {
                    Previous.disabled = true;
                } else {
                    Previous.disabled = false;
                }

                if(currentPage_int + 1 >= pageStructure_ary.length)
                {
                    Next.disabled = true;
                    // Since we are at the last page - call a function to indicate that.
                    // This is NOT used in all cases, but currently set's completion
                    // based on being at last page
                    setLastPage(true);
                } else {
                    Next.disabled = false;
                }
                tracking.setLessonLocation(currentPage_int);
            }

            function setLocation(location_var)
            {
                var tempLocation_var = '';
                if(typeof(location_var) != "undefined")
                {
                    tempLocation_var = location_var;
                }
                tracking.setLessonLocation(tempLocation_var);
            }

            function getCurrentPage(loadPage_bln)
            {
                var tempCurrentPage_int = tracking.getLessonLocation();
                if(tempCurrentPage_int > 0)
                {
                    currentPage_int = tempCurrentPage_int;
                } else {
                    currentPage_int = 0;
                }

                if(loadPage_bln)
                {
                    tracking.content.location.href = subFolder_str + pageStructure_ary[currentPage_int];
                }

                checkButtonStates();
            }

            function setLastPage(isLastPage_bln)
            {
                // AEC: Behavior of the last page is determined by the content.  In this example, the
                // last page set's the "completion" status.  The status is "incomplete" until the last
                // page is reached.  A better alternative is to set completion based on viewing *all*
                // pages in the array pageStructureArray.  See example that includes a Flash Interaction
                // for this concept.

                if(typeof(isLastPage_bln) != 'undefined')
                {
                    if(isLastPage_bln)
                    {
                        tracking.setScoreRaw('100');
                        tracking.setLessonStatus('completed');
                    } else {
                        tracking.setLessonStatus('incomplete');
                    }
                } else {
                    // This function shouldn't be called for any other reason, but we'll ignore for now
                }
            }

            function waitForEmptyQueue()
            {
                if(tracking.checkQueue() == 0)
                {
                    // Queue is empty
                    clearInterval(navigationInterval_var);
                    if(typeof(navigationInterval_str) != 'undefined' && navigationInterval_str != '')
                    {
                        if(typeof(navigationInterval_obj) == 'undefined' || navigationInterval_obj == '')
                        {
                            executeFunction_obj = this;
                        }
                        navigationInterval_obj[navigationInterval_str]();
                    }
                    navigationInterval_obj = '';
                    navigationInterval_str = '';
                }
            }

        </script>
    </head>

    <body onLoad="getCurrentPage(true)">
        <center>
            <input type="button" name="Previous" id="Previous" value="&lt; Previous" onClick = "previousPage()" />

            <input type="button" name="Exit" id="Exit" value="    Exit    " onClick = "exitPage()" />

            <input type="button" name="Next" id="Next" value="    Next &gt;   " onClick="nextPage()" />
        </center>
    </body>
</html>

Offline

#9 2012-08-23 09:36:17

**_AChemey_**

Re: HTML/Javascript Content for Use In Connect Pro ()

Goal2090,

Did you look at the full example u linked to in one of my responses? You should understand what I'm doing there (it should work).  I'm on vacation, so if you don't hear back from me until Monday, you'll understand.  Reach out to me directly:  Andrew AT LearningConsulting DOT com

Regards,

Andrew

Offline

#10 2012-08-28 11:30:44

**_goal2090_**

Re: HTML/Javascript Content for Use In Connect Pro ()

Hey Andrew, I sent you an e-mail and just wanted to follow up with you

Offline

Board footer