He quitado todo lo que he sabido para que mas o menos funcione.
Código HTML:
<body>
<script language="javascript">
cantidadPreguntas = 4
function muestraComentario(n){
for(i=1;i<(cantidadPreguntas+1);i++)
document.getElementById("resp["+i+"]").style.display = "none";
radioArray = document.getElementsByTagName("radio");
document.getElementById("resp["+ n +"]").style.display = "inline";
}
</script>
<form name="correct">
<table>
<tr><td>
Which of the following statements is NOT a fallacy concerning the notion of
‘grammar’?
</td>
</tr>
<tr>
<td>
<input name="rad1" type="radio" value="You’re right!"
onClick="muestraComentario(1)">
The grammar of any natural language is a set of rules which generate an infinite set
of sentences. <span id="resp[1]" style="color:red;display:none;">You’re right!</td>
</tr>
<tr>
<td>
<input name="rad1" type="radio" value="Sorry! Your response is incorrect. Please try
again." onClick="muestraComentario(2)">
Some people know the grammar of their language very well whereas some other people
make more mistakes and, therefore, do not know the grammar of their language very well.
<span id="resp[2]" style="color:red;display:none;">Sorry! Your response is incorrect. Please
try again.
</td>
</tr>
<tr>
<td>
<input name="rad1" type="radio" value="Sorry! Your response is incorrect. Please try
again." onClick="muestraComentario(3)">
The grammar of English is simpler than the grammar of German. <span id="resp[3]"
style="color:red;display:none;">Sorry! Your response is incorrect. Please try again.</td>
</tr>
</table>
<br>
<table>
<tr>
<td>2 .How many interrelated components of language there exist?</td>
</tr>
<tr>
<td>
<input name="rad2" type="radio" value="You’re right!"
onClick="muestraComentario(4)">6 components <span id="resp[4]"
style="color:red;display:none;">You’re right!</span></td>
</tr>
<tr>
<td>
<input name="rad2" type="radio" value="Sorry! Your response is incorrect. Please try
again" onClick="muestraComentario(5)">5 components <span id="resp[5]"
style="color:red;display:none;">Sorry! Your response is incorrect. Please try again</span>
</td>
</tr>
<tr>
<td>
<input name="rad2" type="radio" value="Sorry! Your response is incorrect. Please try
again" onClick="muestraComentario(6)">
7 components <span id="resp[6]" style="color:red;display:none;">Sorry! Your
responseis incorrect. Please try again</span>
</td>
</tr>
<tr>
</tr>
</table>
<br>
</form>