BackBackNextNext
SST and AJAX
With browsers equal to or later than IE 6.0 and Firefox 1.5, it is possible to have more interactions between the browser and the server. To take advantage of these, SST now includes a third component called rdgextra or rdgextra.exe.
  1. Under Testing & Tracking > Course-wide setup.. there is an LMS-pack called ReadyGo Server Side Testing; track pages; at start load last page that takes advantage of the rdgextra module.
  1. The rdgextra module can be used to store each page visited by the learner including their time on the page. This data is stored separately for each course in a file named course_namehst.csv, where course_name is replaced by the internal storage name for the course.

    When the student launches the course, the previous history file can be accessed to find out what their last visited page was. This page is then loaded into the main course area automatically.
  1. A course author can add the following code to provide a report to the student on their current course. This code can be customized for multiple purposes, but it requires some JavaScript programming skills. The variables for sst_url and course_id need to be programmed.
    <!-- get reports using AJAX concepts -->
    <SCRIPT type="text/javascript">< !-- 
    var sst_url = "http://localhost/scripts/rdgsvtst.exe";
    var course_id = "tst1ab";
    // retrieve scores from rdgrpt server - display
    var req;
    function sstgetreport()
    {
       // Now we assemble request
       var catch1 = document.getElementById("catcher");
       var this_url=sst_url;
       this_url=this_url.replace(/rdgsvtst/,"rdgextra");
       var newAICC = "";
       newAICC +="action=streport&";
       newAICC +="course_id="+course_id+"&";
       newAICC += "this_url="+this_url+"&";
       if (typeof XMLHttpRequest != "undefined") {
         req = new XMLHttpRequest();
       } else if (window.ActiveXObject) {
         req = new ActiveXObject("Microsoft.XMLHTTP");
       }
       req.open("GET",this_url+"?"+newAICC, true);
       req.onreadystatechange = receiveinfo;
       req.send(null);
       return void(0);
    }
    function createData() {
      this.name = "";
      this.status = "";
      this.score1 = 0; /* first num right */
      this.total = 0; /* total points */
      this.score = 0;  /* best num right */
      this.mastery = 0; /* right needed for pass */
      this.type = 0;  /* type: 0=test, 1=survey, 2=self-assessment */
      return this;
    }
    var tests = new Array();
    var score1 = 0;
    var total1 = 0;
    var percent1 = 0;
    var last_name = "";
    var first_name = "";
    var certstatus = "";
    var certdate = "";
    var score = 0;
    var totalbest = 0;
    var percent = 0;
    var totalpts = 0;
    var iTstCnt;
    var iTst = 0;
    function format3(i) {
      if (i < 10) return String("00"+i);
      if (i < 100) return String("0"+i);
      return i;  
    }
    function receiveinfo()
    {
      var lastpage;
      var response = "";
      if (req.readyState == 4) {
        if (req.status == 200) {
          //alert(req.responseText);
          response = req.responseText;
          // parse name=value&name=value& pairs
          var iStart = 0;
          var iEnd = 0;
          var sTmp;
          var iCnt = 0;
          iTst = 0;
          var tstname = "test"+format3(iTst)+"_name";
          var certname = "cert"; // for status of cert
          var certdatename = "cert_date";
          var statusname = "test"+format3(0)+"_status";
          var score1name = "test"+format3(0)+"_score1";
          var scorename = "test"+format3(0)+"_score1";
          var totalname = "test"+format3(0)+"_total";
          var masteryname = "test"+format3(0)+"_mastery";
          var typename = "test"+format3(0)+"_type";
          var names = new Array();
          var vals = new Array();
          while (iEnd != -1) {
            iEnd = response.indexOf('&',iStart);
            if (iEnd != -1) {
    	  sTmp = response.substring(iStart, iEnd);
    	   // Figure out if line contains "=" 
    	   var i = sTmp.indexOf('=');
    	   if (i != -1)
    	     {
    	       i = sTmp.indexOf('=');
    	       names[iCnt] = RemBlanks(sTmp.substring(0, i).toLowerCase());
    	       vals[iCnt] = RemBlanks(sTmp.substring(i+1, sTmp.length));
                   //alert(names[iCnt]);
    	       if (names[iCnt] == tstname) {
                     tstgrp = new createData();
    	         tests[iTst] = tstgrp;
    		 tests[iTst].name = vals[iCnt];
                     statusname = "test"+format3(iTst)+"_status";
                     score1name = "test"+format3(iTst)+"_score1";
                     scorename = "test"+format3(iTst)+"_score";
                     totalname = "test"+format3(iTst)+"_total";
                     masteryname = "test"+format3(iTst)+"_mastery";
                     typename = "test"+format3(iTst)+"_type";
                     tstname = "test"+format3(iTst+1)+"_name"; // for next test
    	         iTst++;
    	       } else if (names[iCnt] == statusname) {
    	         tests[Number(iTst-1)].status = vals[iCnt];
    	       } else if (names[iCnt] == score1name) {
    	         tests[Number(iTst-1)].score1 = vals[iCnt];
    	       } else if (names[iCnt] == scorename) {
    	         tests[Number(iTst-1)].score = vals[iCnt];
    	       } else if (names[iCnt] == totalname) {
    	         tests[Number(iTst-1)].total = vals[iCnt];
    	       } else if (names[iCnt] == masteryname) {
    	         tests[Number(iTst-1)].mastery = vals[iCnt];
    	       } else if (names[iCnt] == typename) {
    	         tests[Number(iTst-1)].type = vals[iCnt];
    	       } else if (names[iCnt] == "last_name") {
    	         last_name = vals[iCnt];
    	       } else if (names[iCnt] == "first_name") {
    	         first_name = vals[iCnt];
    	       } else if (names[iCnt] == "cert") {
    	         certstatus = vals[iCnt];
    	       } else if (names[iCnt] == "cert_date") {
    	         certdate = vals[iCnt];
    	       } else if (names[iCnt] == "total1") {
    	         total1 = vals[iCnt];
    	       } else if (names[iCnt] == "score1") {
    	         score1 = vals[iCnt];
    	       } else if (names[iCnt] == "percent1") {
    	         percent1 = vals[iCnt];
    	       } else if (names[iCnt] == "score") {
    	         score = vals[iCnt];
    	       } else if (names[iCnt] == "totalbest") {
    	         totalbest = vals[iCnt];
    	       } else if (names[iCnt] == "percent") {
    	         percent = vals[iCnt];
    	       } else if (names[iCnt] == "totalpts") {
    	         totalpts = vals[iCnt];
                   }
    	       iCnt++;
                 }
            }
            iStart = iEnd+1;
          }
         iTstCnt = iTst;
         // Now output desired data 
         var obj1 = document.getElementById("results");
         if ((obj1) && (last_name.length > 0)) {
    	 var str = "Status for <b>"+first_name+" "+last_name.toUpperCase()+"</b><BR>\n";
           str += "<table width='60%'><tr><td><b>Test name</b></td><td><b>Status</b></td></tr>\n";
           for (iTst = 0; iTst < iTstCnt; iTst++) {
             str += "<tr><td>"+tests[iTst].name+"</td><td>"+tests[iTst].status+"</td></tr>\n";
           }
           str += "</table>";
           if (certstatus.length > 0) {
             str += "Certificate Status = "+certstatus+"<br>\n";
           }
           str += "Overall score = "+Math.round(percent)+" ("+Math.round(score)+"/"+Math.round(totalpts)+")<br>\n";
           obj1.innerHTML = str;
         }
        }
      }
    }
    sstgetreport();
    // -->
    </SCRIPT>
    <div id="results">
    </div>
    




  1. Security for the reports requires that the student be registered for the course. This is not tight security, but it is usually enough to prevent lazy users from seeing progress of other students. Accesses to reports are stored in a file named course_name_rcv.csv in the folder with the rest of the test results for that course.
BackBackNextNext
Configuring and Installing SST
Course Configuration
Serving
Installation
IIS
Administrator
Merchant Connect
Bookmark Page
Go to Bookmark