home *** CD-ROM | disk | FTP | other *** search
- function ShowAnswer( n )
- {
- var i;
- var prob;
- var doc;
- var correct = new Array(nFields);
- var swap;
- var fld;
- var pos;
-
- prob = order[currProblem]; // save chosen problem in temp. var for ease of reference
-
- top.problemFrame.document.open();
- doc = top.problemFrame.document;
-
- doc.writeln("<html><head></head><body bgcolor='#ffffff'>");
- doc.writeln("Here is the correct answer:");
-
- doc.writeln("<hr>");
-
- pos = 0;
- fld = 0;
- i = spanish[prob].indexOf("_");
- correct = choiceWords[answer.charAt(2*order[currProblem])].split(',');
- while (i >= 0 && pos < spanish[prob].length)
- {
- doc.write(spanish[prob].substring(pos, i));
- doc.write("<font color='#009900'>" + correct[fld] + "</font>");
- fld++;
- pos = i + 1;
- i = spanish[prob].indexOf("_", pos);
- }
- doc.writeln(spanish[prob].substring(pos), "<br>");
- doc.writeln(english[prob], "<p>");
-
- doc.writeln("<a href='javascript:top.PlayAnswer();'>Hear answer</a><p>");
-
- top.naviFrame.location.href = (currProblem == nProblems-1 ) ?
- "vbutnX.htm" : "vbutnN.htm";
- doc.writeln("</body></html>");
- doc.close();
- }
-