Add classes to abstract Users and Courses
Can refuse a question (email the author) Can modify question before validation
This commit is contained in:
parent
6e9554e2f2
commit
42fec70edf
14 changed files with 667 additions and 401 deletions
|
|
@ -1,117 +1,101 @@
|
|||
<!DOCTYPE html>
|
||||
|
||||
<script language="javascript">
|
||||
var nbAnswer = 1;
|
||||
<!DOCTYPE html><html>
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<link rel="Stylesheet" href="style.css">
|
||||
<title>Every Questions (BETA)</title>
|
||||
<script type="text/javascript">
|
||||
function add()
|
||||
{
|
||||
var element = document.createElement("input");
|
||||
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");
|
||||
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);
|
||||
var foo = document.getElementById("answerList");
|
||||
foo.appendChild(element);
|
||||
}
|
||||
</script>
|
||||
</head>
|
||||
|
||||
|
||||
<body>
|
||||
<header>
|
||||
<a href="http://www.h2g2.com" target="_blank">
|
||||
<img src="marvin-robot_normal.png" alt="" id="banner"/>
|
||||
</a>
|
||||
<h1>Nemubot Questions (BETA)</h1>
|
||||
</header>
|
||||
<?php
|
||||
|
||||
include("Question.class.php");
|
||||
include("QuestionsFile.class.php");
|
||||
|
||||
|
||||
$id = $_GET['id'];
|
||||
|
||||
$fileQ = new QuestionsFile("questions.xml");
|
||||
$question = $fileQ->get_question($id);
|
||||
?>
|
||||
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf8" />
|
||||
<link rel="Stylesheet" href="style.css" />
|
||||
<title>Every AskWeb (BETA)</title>
|
||||
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<header>
|
||||
<div id="main_title">
|
||||
<a href="http://www.h2g2.com" target="_blank">
|
||||
<img src="marvin-robot_normal.png" alt="" id="banner"/>
|
||||
</a>
|
||||
<h1>Nemubot AskWeb (BETA)</h1>
|
||||
</div>
|
||||
</header>
|
||||
|
||||
<section id="introduction">
|
||||
<article>
|
||||
<h2>Dernière chance pour changer d'avis</h2>
|
||||
Voici le rappel de votre question :<br/><br/>
|
||||
<?php $question->print_test(); ?>
|
||||
|
||||
Vous avez la possibilité de modifier votre question avant de la
|
||||
faire valider. Faites vous plaisir.<br/>
|
||||
<h2>Dernière chance pour changer d'avis</h2>
|
||||
<p>
|
||||
<strong>Cours concerné :</strong> <?php echo $question->getCourse()->getName(); ?><br><br>
|
||||
<strong>Question posée :</strong> <?php echo $question->getQuestion(); ?><br><br>
|
||||
<strong>Réponses valides exhaustives :</strong>
|
||||
</p>
|
||||
<?php
|
||||
echo "<ul>";
|
||||
foreach($question->getAnswer() as $a)
|
||||
echo "<li>".$a."</li>";
|
||||
echo "</ul>";
|
||||
?>
|
||||
<p>
|
||||
Vous avez la possibilité de modifier votre question avant de la
|
||||
faire valider.<br>
|
||||
Faites vous plaisir.
|
||||
</p>
|
||||
</article>
|
||||
|
||||
<article>
|
||||
<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() ?> />
|
||||
|
||||
<label for="course">De quelle matière s'agit-il ?</label><br/>
|
||||
|
||||
<article>
|
||||
<h2>Modifier la question ...</h2>
|
||||
<form method="post" action="questions.php">
|
||||
<input type="hidden" name="id" value=<?php echo $question->getId(); ?>>
|
||||
<input type="hidden" name="email" value=<?php echo $question->get_writer()->getEmail(); ?>>
|
||||
<label for="course">De quelle matière s'agit-il ?</label><br>
|
||||
<select name="course" id="course">
|
||||
<?php
|
||||
include_once("Course.class.php");
|
||||
$cs = Course::getCourses();
|
||||
$qc = $question->getCourse();
|
||||
|
||||
<optgroup label="Cours communs">
|
||||
<option value="SGBD">SGBD</option>
|
||||
<option value="CompressionDeDonnées">
|
||||
Compression de données</option>
|
||||
<option value="ProtocolesDeLiaisons">
|
||||
Protocoles De Liaisons</option>
|
||||
<option value="TYLA">TYLA</option>
|
||||
<option value="ActiveDirectory">
|
||||
Active Directory</option>
|
||||
<option value="GrapheFlotReseau">
|
||||
Graphes Flots Reseaux</option>
|
||||
</optgroup>
|
||||
foreach($cs as $c)
|
||||
{
|
||||
if ($qc->getId() == $c->getId())
|
||||
print '<option selected="selected" value="'.$c->getId().'">'.$c->getName().'</option>';
|
||||
else
|
||||
print '<option value="'.$c->getId().'">'.$c->getName().'</option>';
|
||||
}
|
||||
|
||||
<optgroup label="Electif">
|
||||
<option value="RXAN">RXAN</option>
|
||||
</optgroup>
|
||||
|
||||
<optgroup label="TDA">
|
||||
<option value="TYLA">TYLA</option>
|
||||
<option value="CCMP">CCMP</option>
|
||||
<option value="SLPS">SLPS</option>
|
||||
<option value="FMPS">FMPS</option>
|
||||
</optgroup>
|
||||
|
||||
<optgroup label="MTM">
|
||||
<option value="ITIL">ITIL</option>
|
||||
<option value="Qualite">Qualité</option>
|
||||
</optgroup>
|
||||
|
||||
<optgroup label="Autre">
|
||||
<option value="Autre" selected>Autre</option>
|
||||
</optgroup>
|
||||
?>
|
||||
</select>
|
||||
|
||||
<p id="questionPart">
|
||||
<label id="q" for="question">
|
||||
Quelle est votre question ? </label><br/>
|
||||
<textarea id="question" name="question"
|
||||
rows="3" cols="70"><?php echo $question->getQuestion()?>
|
||||
</textarea>
|
||||
<label id="q" for="question">Quelle est votre question ? </label><br>
|
||||
<textarea id="question" name="question" rows="3" cols="70"><?php echo nl2br(htmlentities($question->getQuestion())); ?></textarea>
|
||||
</p>
|
||||
<p id="answerList">
|
||||
<label for="answer">Quelle est la réponse ? </label><br/>
|
||||
<input id="answer" name="answer0" type="text" />
|
||||
<label for="answer">Quelle est la réponse ?</label><br>
|
||||
<?php
|
||||
$max = 1;
|
||||
foreach($question->getAnswer() as $k => $a)
|
||||
{
|
||||
echo '<input type="text" name="answer'.$k.'" value="'.$a.'">';
|
||||
if ($max < $k)
|
||||
$max = $k;
|
||||
}
|
||||
print '<script type="text/javascript">var nbAnswer = '.($max+1).';</script>';
|
||||
?>
|
||||
</p>
|
||||
|
||||
<p>
|
||||
|
|
@ -121,26 +105,23 @@ $question = $fileQ->get_question($id);
|
|||
<p>
|
||||
<input type="submit" name="send" value="Envoyer" />
|
||||
</p>
|
||||
|
||||
</form>
|
||||
|
||||
|
||||
</article>
|
||||
|
||||
<article>
|
||||
<h2>... Ou la confirmer telle quelle</h2>
|
||||
|
||||
Si la question vous semble corect, vous pouvez directement
|
||||
la confirmer ici:<br/>
|
||||
|
||||
<a href=<?php echo "http://".$_SERVER["SERVER_NAME"]
|
||||
. dirname($_SERVER["REQUEST_URI"])."/confirmation.php?id="
|
||||
. $question->getId() ?>>Confirmer la question</a>
|
||||
|
||||
|
||||
</article>
|
||||
</form>
|
||||
</article>
|
||||
<article>
|
||||
<h2>... ou la confirmer telle quelle !</h2>
|
||||
<p>
|
||||
Si la question vous semble corect, vous pouvez directement
|
||||
la confirmer ici :<br>
|
||||
</p>
|
||||
<form method="post"
|
||||
class="validation"
|
||||
action="confirmation.php">
|
||||
<input type="hidden" name="id" value="<?php echo $question->getId() ?>">
|
||||
<input type="submit" value="Je confirme">
|
||||
</form>
|
||||
<span style="clear: both; display: block;"></span>
|
||||
</article>
|
||||
</section>
|
||||
|
||||
<?php include('footer.html') ?>
|
||||
</body>
|
||||
<?php include('footer.html') ?>
|
||||
</body>
|
||||
</html>
|
||||
|
|
|
|||
Reference in a new issue