Código PHP:
<?php if($preguntas["opcion1"] != "subtitulo"){
if($preguntas['correcta'] == $preguntas['respuesta']){
$correcta = 1;
} else {
$correcta = 0;
}
?>
<div id="preg_ind">
<div class="preg_cont"><?php echo $preguntas['preg_preg']; ?></div>
<div class="option<?php if($preguntas['respuesta'] == 1) {
if($preguntas['correcta'] == 1) { $preg1 = true; ?> correcta<?php } else { ?> incorrecta<?php } } ?>"><input type="radio" name="<?php if($correcta == 1){ } else {?>pregunta<?php echo $preguntas['id_preg']; } ?>" value="1"<?php if($preguntas['respuesta'] == 1){ ?> checked<?php } if($correcta == 1){ ?> disabled<?php } ?>> <?php echo $preguntas["opcion1"]; ?></div>
<div class="option<?php if($preguntas['respuesta'] == 2) {
if($preguntas['correcta'] == 2) { $preg2 = true; ?> correcta<?php } else { ?> incorrecta<?php } } ?>"><input type="radio" name="<?php if($correcta == 1){ } else {?>pregunta<?php echo $preguntas['id_preg']; } ?>" value="2"<?php if($preguntas['respuesta'] == 2){ ?> checked<?php } if($correcta == 1){ ?> disabled<?php } ?>> <?php echo $preguntas["opcion2"]; ?></div>
<div class="option<?php if($preguntas['respuesta'] == 3) {
if($preguntas['correcta'] == 3) { $preg3 = true; ?> correcta<?php } else { ?> incorrecta<?php } } ?>"><input type="radio" name="<?php if($correcta == 1){ } else {?>pregunta<?php echo $preguntas['id_preg']; } ?>" value="3"<?php if($preguntas['respuesta'] == 3){ ?> checked<?php } if($correcta == 1){ ?> disabled<?php } ?>> <?php echo $preguntas["opcion3"]; ?></div>
<div class="option<?php if($preguntas['respuesta'] == 4) {
if($preguntas['correcta'] == 4) { $preg4 = true; ?> correcta<?php } else { ?> incorrecta<?php } } ?>"><input type="radio" name="<?php if($correcta == 1){ } else {?>pregunta<?php echo $preguntas['id_preg']; } ?>" value="4"<?php if($preguntas['respuesta'] == 4){ ?> checked<?php } if($correcta == 1){ ?> disabled<?php } ?>> <?php echo $preguntas["opcion4"]; ?></div>
<?php if($correcta == 1){ ?><input type="hidden" name="pregunta<?php echo $preguntas['id_preg']; ?>" value="<?php echo $preguntas['respuesta']; ?>" /><?php } else { } ?>
</div>
<?php
++$num;
} else { ?>
<h3 class="sub_estudio"><?php echo $preguntas['preg_preg']; ?></h3>
<?php
} ?>