A flash-based quiz is created using a commercial tool (Quizmaker by Articulate). A Quizmaker generated java script records the results of the quiz. The task is to export the results at the close of the quiz so that a called web page can import the data and display the results. The called web page will be in the same folder as the quiz and results.
## Deliverables
Deliverables:
1. Javascript code to add to [login to view URL] to export the results
2. Javascript code to read in the results in the called web page
3. Sample webpage displaying results
Limits:
I do not want to use a database (e.g. MySQL, SQLite). I'm assuming something like XML will be used.
Provided to developer:
A complete example quiz that includes the Quizmaker generated [login to view URL] (launched with [login to view URL] using iFrame)
[login to view URL] (a blank web page that will be called at the close of the quiz)
URL to live, working site with example quiz on request
For reference, excerpts from [login to view URL]:
// Results Screen vars
var g_strPlayer = "chico";
var g_arrResults = new Array();
var g_oQuizResults = new Object();
[login to view URL] = new Object();
var g_bUseFSCommand = (!Opera && !isLinux && !isMac);
function CloseWindow() {[login to view URL]();}
function player_DoFSCommand(command, args)
{
args = String(args);
command = String(command);
var arrArgs = [login to view URL](g_strDelim);
switch (command)
{
case "CC_StoreQuestionResult":
StoreQuestionResult(parseFloat(arrArgs[0]), arrArgs[1], arrArgs[2], arrArgs[3], arrArgs[4] ,arrArgs[5], arrArgs[6], arrArgs[7], arrArgs[8], arrArgs[9]);
break;
case "CC_StoreQuizResult":
[login to view URL] = new Date();
[login to view URL] = arrArgs[0];
[login to view URL] = arrArgs[1];
[login to view URL] = arrArgs[2];
[login to view URL] = arrArgs[3];
[login to view URL] = arrArgs[4];
[login to view URL] = arrArgs[5];
[login to view URL] = arrArgs[6];
[login to view URL] = arrArgs[7];
break;
default:
// alert(command);
break;
}
}
function QuestionResult(nQuestionNum, strQuestion, strResult, strCorrectResponse, strStudentResponse, nPoints, strInteractionId, strObjectiveId, strType, strLatency)
{
if (nPoints < 0) {nPoints = 0;}
if (strCorrectResponse == "") {strCorrectResponse = " ";}
[login to view URL] = nQuestionNum
[login to view URL] = strQuestion;
[login to view URL] = strCorrectResponse;
[login to view URL] = strStudentResponse;
[login to view URL] = strResult;
[login to view URL] = nPoints;
[login to view URL] = false;
[login to view URL] = new Date();
[login to view URL] = strInteractionId;
[login to view URL] = strObjectiveId;
[login to view URL] = strType;
[login to view URL] = strLatency;
}
function StoreQuestionResult(nQuestionNum, strQuestion, strResult, strCorrectResponse, strStudentResponse, nPoints, strInteractionId, strObjectiveId, strType, strLatency)
{
var oQuestionResult = new QuestionResult(nQuestionNum, strQuestion, strResult, strCorrectResponse, strStudentResponse, nPoints, strInteractionId, strObjectiveId, strType, strLatency);
var nIndex = [login to view URL];
// Lets see if we have answered the question before
for (var i = 0; i < [login to view URL]; i++)
{
if (g_arrResults[i].nQuestionNum == [login to view URL] && strQuestion == g_arrResults[i].strQuestion)
{
nIndex = i;
break;
}
}
g_arrResults[nIndex] = oQuestionResult;
}
var g_bCloseExecuted = false;
function DoOnClose()
{
if (!g_bCloseExecuted)
{
g_bCloseExecuted = true;
if (g_bAOSupport)
{PostResultsOnUnload()}
}
}