This commit is contained in:
Bertrand 2012-06-16 21:39:58 +02:00
parent f3af3ffc25
commit 9034baa2b3
2 changed files with 28 additions and 4 deletions

View File

@ -1,5 +1,23 @@
<!DOCTYPE html>
<script language="javascript">
var nbAnswer = 1;
function add()
{
var element = document.createElement("input");
element.setAttribute("type", "text");
element.setAttribute("id", "answer");
element.setAttribute("name", "answer" + nbAnswer);
nbAnswer++;
element.setAttribute("placeholder", "Nouvelle réponse");
var foo = document.getElementById("answerList");
foo.appendChild(element);
}
</script>
<?php
include("Question.class.php");
@ -41,12 +59,11 @@ $question = $fileQ->get_question($id);
</article>
<article>
<h2>Modifier la question...</h2>
<h2>Modifier la question... (cette partie ne fonctionn pas ...</h2>
<form id="formulaire" method="post" action="validateChangeQuestion.php">
<input type="hidden" name="id" id="id" value=<?php echo $question->getId() ?> />
<input type="hidden" name="id" id="id" value=<?php echo $question->getId() ?> />
<section id="Form">
<label for="course">De quelle matière s'agit-il ?</label><br/>
<select name="course" id="course">
@ -104,6 +121,9 @@ $question = $fileQ->get_question($id);
<input type="submit" name="send" value="Envoyer" />
</p>
</form>
</article>
<article>

View File

@ -27,6 +27,7 @@ if (isset ($_POST['send']))
}
//Check we have at least a question and an answer
/*
if (empty($question))
die("Veuillez indiquer une question !");
else if (count($answers) <= 0)
@ -40,6 +41,9 @@ if (isset ($_POST['send']))
$quest->setQuestion($question);
$quest->setAnswer($answers);
// Is this enought to change the xml ?
$file->save();
echo "File saved";
header("Location: ./confirmation.php?id=" . $quest->getId());
*/
?>