ho messo così
Codice PHP:
do{
$r++;
switch ($risposte[$r]) {
case '1':
$result="<span style='color:red;font-weight:bold'>$tipo[1]</span>
$tipo[2]
$tipo[3]
$tipo[4]
";
break;
case '2':
$result="$tipo[1]
<span style='color:red;font-weight:bold'>$tipo[2]</span>
$tipo[3]
$tipo[4]
";
break;
case '3':
$result="$tipo[1]
$tipo[2]
<span style='color:red;font-weight:bold'>$tipo[3]</span>
$tipo[4]
";
break;
case '4':
$result="$tipo[1]
$tipo[2]
$tipo[3]
<span style='color:red;font-weight:bold'>$tipo[4]</span>";
break;
default:
$result="$tipo[1]
$tipo[2]
$tipo[3]
$tipo[4]";
break;
}
}
while($r==11);
do{
$t++;
if($esatta==$risposte[$t]){
$esito[$t]= "[b]Domanda $t: $domanda[/b]
$tipo[1]
$tipo[2]
$tipo[3]
$tipo[4]
Esito: <span style='color:green'>esatta</span>
Risposta esatta: <span style='color:blue'>$esatta</span>
[b]Spiegazione:[/b]
$descrizione
";
$v++;
}
else{
$esito[$t]= "[b]Domanda $t: $domanda[/b]
$result
Esito: <span style='color:red'>errata</span>
Hai risposto: <span style='color:blue'>$risposte[$t]</span>
Risposta esatta: <span style='color:blue'>$esatta</span>
[b]Spiegazione:[/b]
$descrizione
";
}
}
while($t==11);
sembra funzionare...ora faccio qualche prova...