prova a mettere così:
Codice PHP:
$tipo=array("a",$risp1,$risp2,$risp3,$risp4);
for ($l=1;$l<=4;$l++){
if ($l==$esatta){
$tipo[$l]="<span style='color:green;font-weight:bold'>$tipo[$l]</span>";
}
else{
$esito[$t]= "[b]Domanda $t: $domanda[/b]
a. $tipo[1]
b. $tipo[2]
c. $tipo[3]
d. $tipo[4]
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
";
}
}
do{
$t++;
if($esatta==$risposte[$t]){
$esito[$t]= "[b]Domanda $t: $domanda[/b]
a. $tipo[1]
b. $tipo[2]
c. $tipo[3]
d. $tipo[4]
Esito: <span style='color:green'>esatta</span>
Risposta esatta: <span style='color:blue'>$esatta</span>
[b]Spiegazione:[/b]
$descrizione
";
$v++;
}
}
while($t==11);