to the build-individual-panels.xsl file, ADD
<xsl:template match="self-test" mode="build-individual-panels" >
<script type='text/javascript'>
<![CDATA[
<!--
function replaceSpan]]><xsl:value-of select='@span'/><![CDATA[(displayedText,spanNumber){
var newSpan = document.createElement("span");
var newText = document.createTextNode(displayedText);
newSpan.appendChild(newText);
var para = document.getElementById("area"+spanNumber);
var spanElm = document.getElementsByTagName("span")[spanNumber];
var replaced = para.replaceChild(newSpan,spanElm);
}
var testtext = "<form><center><u>]]><xsl:value-of select='@question'/><![CDATA[</u></center>";
testtext += "<input type='radio' name='c' value='' onClick='replaceSpan]]><xsl:value-of select='@span'/><![CDATA[("]]><xsl:value-of select='@answer1'/><![CDATA[","]]><xsl:value-of select='@span'/><![CDATA[")' />]]><xsl:value-of select='@choice1'/><![CDATA[<br/>";
testtext += "<input type='radio' name='c' value='' onClick='replaceSpan]]><xsl:value-of select='@span'/><![CDATA[("]]><xsl:value-of select='@answer2'/><![CDATA[","]]><xsl:value-of select='@span'/><![CDATA[")' />]]><xsl:value-of select='@choice2'/><![CDATA[<br/>";
testtext += "<input type='radio' name='c' value='' onClick='replaceSpan]]><xsl:value-of select='@span'/><![CDATA[("]]><xsl:value-of select='@answer3'/><![CDATA[","]]><xsl:value-of select='@span'/><![CDATA[")' />]]><xsl:value-of select='@choice3'/><![CDATA[<br/>";
testtext += "<input type='radio' name='c' value='' onClick='replaceSpan]]><xsl:value-of select='@span'/><![CDATA[("]]><xsl:value-of select='@answer4'/><![CDATA[","]]><xsl:value-of select='@span'/><![CDATA[")' />]]><xsl:value-of select='@choice4'/><![CDATA[<br/>";
testtext += "<center><table><tr><td><font color='#ff0000'>";
testtext += "<div id='area]]><xsl:value-of select='@span'/><![CDATA['><span></span></div></font></td></tr></table></center></form>";
document.write(testtext);
// -->
]]>
</script>
</xsl:template>
The complexities involved with parsing CDATA, Javascript, and Entities are beyond the scope of this discussion.
Avoid the "white-space" problems involved with copying the above code and Cut and Paste from the zipped Text files. The above xsl:template code for the build-individual-panels.xsl file is included in the File Modifications folder