?
This commit is contained in:
parent
f3af3ffc25
commit
9034baa2b3
@ -1,5 +1,23 @@
|
|||||||
<!DOCTYPE html>
|
<!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
|
<?php
|
||||||
|
|
||||||
include("Question.class.php");
|
include("Question.class.php");
|
||||||
@ -41,12 +59,11 @@ $question = $fileQ->get_question($id);
|
|||||||
</article>
|
</article>
|
||||||
|
|
||||||
<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">
|
<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/>
|
<label for="course">De quelle matière s'agit-il ?</label><br/>
|
||||||
|
|
||||||
<select name="course" id="course">
|
<select name="course" id="course">
|
||||||
@ -104,6 +121,9 @@ $question = $fileQ->get_question($id);
|
|||||||
<input type="submit" name="send" value="Envoyer" />
|
<input type="submit" name="send" value="Envoyer" />
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
|
</form>
|
||||||
|
|
||||||
|
|
||||||
</article>
|
</article>
|
||||||
|
|
||||||
<article>
|
<article>
|
||||||
|
@ -27,6 +27,7 @@ if (isset ($_POST['send']))
|
|||||||
}
|
}
|
||||||
|
|
||||||
//Check we have at least a question and an answer
|
//Check we have at least a question and an answer
|
||||||
|
/*
|
||||||
if (empty($question))
|
if (empty($question))
|
||||||
die("Veuillez indiquer une question !");
|
die("Veuillez indiquer une question !");
|
||||||
else if (count($answers) <= 0)
|
else if (count($answers) <= 0)
|
||||||
@ -40,6 +41,9 @@ if (isset ($_POST['send']))
|
|||||||
$quest->setQuestion($question);
|
$quest->setQuestion($question);
|
||||||
$quest->setAnswer($answers);
|
$quest->setAnswer($answers);
|
||||||
|
|
||||||
// Is this enought to change the xml ?
|
|
||||||
$file->save();
|
$file->save();
|
||||||
|
echo "File saved";
|
||||||
|
|
||||||
|
header("Location: ./confirmation.php?id=" . $quest->getId());
|
||||||
|
*/
|
||||||
?>
|
?>
|
Reference in New Issue
Block a user