bonjour,
je recuperre la valeur des inputs suivant
echo'<p style="text-align:center;width:100px;font-size:1.2em;"><input class="checkbox" style="margin:10px 0 0 0;" type="radio" name="' . $cle . '" value="' . $reponse['lettre'] . '" /><img style="margin-left:-25px; margin-top:25px;" src="'. $reponse['reponse'] .'" width="30px" height="30px" /></p>';
echo'<p style="text-align:center;width:100px;font-size:1.2em"><input class="checkbox" style="margin:10px 0 0 0;" type="radio" name="' . $cle . '" value="' . $reponse['lettre1'] . '" /><img style="margin-left:-25px; margin-top:25px;" src="'. $reponse['reponse1'] .'" width="30px" height="30px" /></p>';
echo'<p style="text-align:center;width:100px;font-size:1.2em"><input class="checkbox" style="margin:10px 0 0 0;" type="radio" name="' . $cle . '" value="' . $reponse['lettre2'] . '" /><img style="margin-left:-25px; margin-top:25px;" src="'. $reponse['reponse2'] .'" width="30px" height="30px" /></p>';
sur la page correction qui elle doit comparer les bonnes et mauvaises réponses, mais rien a faire
echo'<div style="display:inline-block;width:450px;min-height:350px;border-right:1px solid #000;">';
if (isset($_POST['correction']))
{
foreach($reponses as $cle => $reponse){
$clic = trim($_POST[$cle]);
echo '<button class="button_audio" onclick="playVid(\'son_1'.$cle.'\')" type="button" value="' . $reponse['mp3'] . '"></button>';
echo '<audio id="son_1'.$cle.'">';
echo '<source src="' . $reponse['mp3'] .'" type="audio/mp3">';
echo '<p>Votre navigateur ne supporte pas le format audio.</p>';
echo '</audio>';
foreach($choix as $key => $value){
if(($clic == $reponse['lettre'] AND $reponse['lettre'] != $z) OR ($clic == $reponse['lettre1'] AND $reponse['lettre1'] != $z) OR ($clic == $reponse['lettre2'] AND $reponse['lettre2'] != $z)){
$point[$cle] = htmlspecialchars($clic);
echo'<p style="font-size:1.2em;padding:0 20px;">'.$reponse['chiffre'].'</p>';
echo'<p style="text-align:center;width:100px;font-size:1.2em;"><input class="checkbox" style="margin:10px 0 0 0;" type="radio" name="' . $cle . '" value="' . $reponse['lettre'] . '" /><img style="margin-left:-25px; margin-top:25px;" src="'. $reponse['reponse'] .'" width="30px" height="30px" /></p>';
echo'<p style="text-align:center;width:100px;font-size:1.2em"><input class="checkbox" style="margin:10px 0 0 0;" type="radio" name="' . $cle . '" value="' . $reponse['lettre1'] . '" /><img style="margin-left:-25px; margin-top:25px;" src="'. $reponse['reponse1'] .'" width="30px" height="30px" /></p>';
echo'<p style="text-align:center;width:100px;font-size:1.2em"><input class="checkbox" style="margin:10px 0 0 0;" type="radio" name="' . $cle . '" value="' . $reponse['lettre2'] . '" /><img style="margin-left:-25px; margin-top:25px;" src="'. $reponse['reponse2'] .'" width="30px" height="30px" /></p>';
echo'<p style="color:green;font-size:1.2em;"><b>'. $point[$cle].'</b></p>';
echo'<figure style="display:inline-block;margin-top:1em;">';
echo'<img src="../img/ok1.jpg" alt="reponse bonne" width:"55" height="55" /></figure><br />';
}else if(($clic != $reponse['lettre'] AND $reponse['lettre'] != $z) OR ($clic != $reponse['lettre1'] AND $reponse['lettre1'] != $z) OR ($clic != $reponse['lettre2'] AND $reponse['lettre'] != $z)){
$errors[$cle] = htmlspecialchars($clic);
echo'<p style="font-size:1.2em;padding:0 20px;">'.$reponse['chiffre'].'</p>';
echo'<p style="text-align:center;width:100px;font-size:1.2em;"><input class="checkbox" style="margin:10px 0 0 0;" type="radio" name="' . $cle . '" value="' . $reponse['lettre'] . '" /><img style="margin-left:-25px; margin-top:25px;" src="'. $reponse['reponse'] .'" width="30px" height="30px" /></p>';
echo'<p style="text-align:center;width:100px;font-size:1.2em"><input class="checkbox" style="margin:10px 0 0 0;" type="radio" name="' . $cle . '" value="' . $reponse['lettre1'] . '" /><img style="margin-left:-25px; margin-top:25px;" src="'. $reponse['reponse1'] .'" width="30px" height="30px" /></p>';
echo'<p style="text-align:center;width:100px;font-size:1.2em"><input class="checkbox" style="margin:10px 0 0 0;" type="radio" name="' . $cle . '" value="' . $reponse['lettre2'] . '" /><img style="margin-left:-25px; margin-top:25px;" src="'. $reponse['reponse2'] .'" width="30px" height="30px" /></p>';
echo'<p style="color:red;font-size:1.2em;"><b>'. $errors[$cle].'</b></p>';
echo'<figure style="display:inline-block;">';
echo'<img src="../img/ok.jpg" alt="reponse fausse" width:"55" height="55" /></figure><br />';
break;
}
}
}
echo'</div>'; si bonne réponse j'affiche un rond vert plus la valeur et si mauvaises réponse j'affiche un rond rouge avec la valeur, mais sans succès.
merci pour votre réponse
Afficher la suite