bonjour,
je voudrai savoir comment peut on récupéré les valeurs avec un dragndrop, car la moi pas comprendre....
merci pour vos réponses
je voudrai savoir comment peut on récupéré les valeurs avec un dragndrop, car la moi pas comprendre....
<?php
$reponses = array(
'chx' => array(
'reponse' => 'co',
'mot' => 'un',
'image' => 'img/colis.gif',
'phrase' => 'lis'
) ,
'chx_1' => array(
'reponse' => 'ca',
'mot' => 'un',
'image' => 'img/cafe.gif',
'phrase' => 'fe'
) ,
'chx_2' => array(
'reponse' => 'ki',
'mot' => 'un',
'image' => 'img/kiwi.gif',
'phrase' => 'wi'
) ,
'chx_3' => array(
'reponse' => 'qui',
'mot' => 'une é',
'image' => 'img/equipe.gif',
'phrase' => 'pe'
) ,
'chx_4' => array(
'reponse' => 'cu',
'mot' => 'une',
'image' => 'img/cuisine.gif',
'phrase' => 'isine'
) ,
'chx_5' => array(
'reponse' => 'que',
'mot' => 'un cas',
'image' => 'img/casque.gif',
'phrase' => ''
) ,
'chx_6' => array(
'reponse' => 'quette',
'mot' => 'de la mo',
'image' => 'img/moquette.gif',
'phrase' => ''
)
);
$choix = array(
'co' => 'co',
'ca' => 'ca',
'ki' => 'ki',
'qui' => 'qui',
'cu' => 'cu',
'que' => 'que',
'quette' => 'quette'
);
echo '<div style="display:inline;">';
foreach($choix as $key => $value)
{
echo '<form class="form_exercices_ou_result" action="correction_c_k_p.php" method="POST" />';
echo '<input type="text" name="'.$key.'" value="'.$value.'" class="dropndrag" id="text_" draggable="true" ondragstart="drag(event)" />';
}
echo '</div>';
foreach($reponses as $cle => $reponse)
{
echo '<article class="content_img">';
echo '<figure style="height:80px;margin-top:.1em;display:block;">';
echo '<img style="margin:0 0 0 -.5em;" src="' . $reponse['image'] . '" alt="' . $reponse['mot'] . '' . $reponse['phrase'] . '" width:"74" height="74" />';
echo '</figure>';
echo '<p>' . $reponse['mot'] . '</p><div style="display:inline-block;width:3em;height:20px;" id="text_" ondrop="drop(event)" ondragover="allowDrop(event)"><input type="hidden" name="'.$cle.'" value="" /></div><p style="margin:0;"> ' . $reponse['phrase'] . '</p>';
echo '</article>';
}
echo '<p class="correction_center"><input type="submit" name="correction" value="correction"/></p>';
echo '</form>';
?>
merci pour vos réponses