<HTML>
<HEAD>
<!-- Including The jQuery Library -->
<script src="http://code.jquery.com/jquery-1.6.3.min.js"></script>
<SCRIPT>
if (ques = quesraw)
ans = ansraw;
function checkAns() {
var selection = document.multchoice.ans;
for (i=0; i<selection.length; i++)
if (selection[i].checked == true)
if (selection[i].value == ansval)
alert("Correct");
else
alert("fail");
}
document.getElementById('file').addEventListener('change', readFile, false);
function readFile (evt) {
var files = evt.target.files;
var file = files[0];
var reader = new FileReader();
reader.onload = function() {
console.log(this.result);
}
reader.readAsText(file)
}
</SCRIPT>
</HEAD>
<BODY>
<input type="file" id="file" />
<script>
document.write(file);
</script>
<div id="text"></div>
<Div id = "Question">
<form name="multchoice" method="post">
<p>This is a statement, but we need a question? </p>
<class = "a"> <input type="radio" name="ans" id="ans1" value="a"/>Wrong <br /></class>
<class = "b"> <input type="radio" name="ans" id="ans2" value="b"/>Wrong <br /></class>
<class = "c"> <input type="radio" name="ans" id="ans3" value="c"/>Wrong <br /></class>
<class = "d"> <input type="radio" name="ans" id="ans4" value="d"/>Right <br /></class>
<br>
<input type="submit" value="Submit" onclick="checkAns()" />
</form>
</Div>
</BODY>
</HTML>