Forum Discussion
Print Results WITHOUT questions and Answers
The code is too different to use that method. Storyline code is below. Any HTML wizards out there?
Results
var g_arrMonths = new Array()
// Enter the month names below
g_arrMonths[0] = "January"
g_arrMonths[1] = "February"
g_arrMonths[2] = "March"
g_arrMonths[3] = "April"
g_arrMonths[4] = "May"
g_arrMonths[5] = "June"
g_arrMonths[6] = "July"
g_arrMonths[7] = "August"
g_arrMonths[8] = "September"
g_arrMonths[9] = "October"
g_arrMonths[10] = "November"
g_arrMonths[11] = "December"
// Enter the column headers
var g_strDateTime = "Date / Time"
var g_strStudentScore = "Student Score"
var g_strPassingScore = "Passing Score"
var g_strResult1 = "Result"
var g_strQuestion = "Question"
var g_strCorrectAns = "Correct Answer"
var g_strResult2 = "Result"
var g_strStudentAns = "Student Answer"
var g_strPointsAwarded = "Points Awarded"
var g_strNeutral = "Neutral"
var g_strCorrect = "Correct"
var g_strIncorrect = "Incorrect"
TABLE.SUMMARY {
width: 600px;
margin-left: auto;
margin-right: auto;
border-width: 1px;
}
TABLE.QUESTIONS {
width: 100%;
margin-left: auto;
margin-right: auto;
border-width: 1px;
}
TD {
font-size:10pt;
font-family:arial;
text-align: center;
width: 12.5%;
}
TH {
font-size:12pt;
font-family:arial;
}
.CORRECT {
font-size:10pt;
font-family:arial;
color: #008800;
}
.INCORRECT {
font-size:10pt;
font-family:arial;
color: #880000;
}
.NEUTRAL {
font-size:10pt;
font-family:arial;
color: #000088;
}
.QUESTION {
font-size:10pt;
font-family:arial;
text-align: left;
width: 46.25%;
}
.NUMBER {
font-size:10pt;
font-family:arial;
text-align: center;
width: 3.75%;
}
.DATE {
font-size:10pt;
font-family:arial;
text-align: center;
}
.DATETIME {
font-size:10pt;
font-family:arial;
margin-top: 0;
margin-bottom: 0;
}
.SUMMARY {
font-size:10pt;
font-family:arial;
text-align: center;
}
H1 {
font-size:14pt;
font-family:arial;
text-align: center;
}
H2 {
font-size:14pt;
font-family:arial;
text-align: center;
}
H3 {
font-size:12pt;
font-family:arial;
text-align: center;
}
var g_oContentResults = window.opener.g_oContentResults;
var g_listQuizzes = window.opener.g_listQuizzes;
var g_oPrintOptions = window.opener.g_oPrintOptions;
function WriteQuizResults(strQuizId)
{
var oQuiz = g_listQuizzes[strQuizId];
document.write("
" + oQuiz.strQuizName + "
"); document.write("| # | ");" + g_strQuestion + " | ");" + g_strCorrectAns + " | ");" + g_strStudentAns + " | ");" + g_strResult2 + " | ");" + g_strPointsAwarded + " | ");
|---|
function AddItem(oQuestion)
{
var strResult = g_strIncorrect;
var strClass = "INCORRECT";
var strCorrectResponse = " ";
var strUserResponse = " ";
if (oQuestion.strCorrectResponse)
{
strCorrectResponse = oQuestion.strCorrectResponse;
strCorrectResponse = strCorrectResponse.replace(/\|#\|/g,", ");
}
if (oQuestion.strUserResponse)
{
strUserResponse = oQuestion.strUserResponse;
strUserResponse = strUserResponse.replace(/\|#\|/g,", ");
}
document.write("
");document.write("" + oQuestion.nQuestionNumber + "");
document.write("" + oQuestion.strDescription + "");
document.write("" + strCorrectResponse + "");
document.write("" + strUserResponse + "");
if (oQuestion.strStatus == "correct")
{
strResult = g_strCorrect;
strClass = "CORRECT"
}
else if (oQuestion.strStatus == "neutral")
{
strResult = g_strNeutral
strClass = "NEUTRAL"
}
document.write("
" + strResult + "");document.write("" + oQuestion.nPoints + "");
document.write("");}
function FormatDate(dtmDate)
{
var strResult = "";
var nHours = dtmDate.getHours();
var strAM = "am";
var nMinutes = dtmDate.getMinutes();
var strMinutes = "" + nMinutes;
if (nMinutes
{
strMinutes = "0" + nMinutes;
}
if (nHours == 12)
{
strAM = "pm";
}
if (nHours > 12)
{
nHours -= 12;
strAM = "pm";
}
strResult += "
"
strResult += g_arrMonths[dtmDate.getMonth()] + " ";
strResult += dtmDate.getDate() + ", ";
strResult += dtmDate.getFullYear() + " ";
strResult += "
"
strResult += nHours + ":";
strResult += strMinutes + " ";
strResult += strAM;
strResult += "
var strTitle = g_listQuizzes[g_oPrintOptions.strMainQuizId].strQuizName;
document.write("
" + strTitle + "
"); if (g_oPrintOptions.strName) { if (g_oPrintOptions.strName.length > 0) { document.write("" + g_oPrintOptions.strName + "
"); } }document.write("
"); document.write("| " + g_strDateTime + " | ");" + g_strStudentScore + " | ");" + g_strPassingScore + " | ");" + g_strResult1 + " | ");
|---|---|---|---|
| " + FormatDate(g_oContentResults.dtmFinished) + " | ");" + g_listQuizzes[g_oPrintOptions.strMainQuizId].nPtScore + " | ");" + g_listQuizzes[g_oPrintOptions.strMainQuizId].nPassingScore + " | ");" + strCapResult + " | ");
if (g_oPrintOptions.bShowQuizReview)
{
var arrQuizzes = g_oPrintOptions.arrQuizzes;
// for (strQuizId in g_listQuizzes)
for (var i = 0; i
{
WriteQuizResults(arrQuizzes[i]);
}
}
Related Content
- 9 months ago