bzr branch
http://gegoxaren.bato24.eu/bzr/lenasys/trunk
|
1
by Henrik G.
First seed of Lenasys ... Needs to be Organized Further |
1 |
<?php
|
2 |
addBackLink(array("courseName"=>$_POST['courseName'], "quizNr"=>$_POST['quizNr'],"listQuizzesLink"=>"", "listQuizzesSubmit"=>"")); |
|
3 |
echo "<h2>Add or edit variants of quiz ".$_POST['quizNr']." in ".$_POST['courseName']."</h2>"; |
|
4 |
echo "<form name='addEditVariantToQuizForm' action='.' method='post'>"; |
|
5 |
||
6 |
echo "<label for='newQVarNr'>Variant nr:</label>"; |
|
7 |
echo "<input type='text' name='newQVarNr' "; |
|
8 |
if(isset($_POST['qVarNr'])) echo "value='".$_POST['qVarNr']."'"; |
|
9 |
echo " />"; |
|
10 |
||
11 |
echo "<label for='correctAnswer'>Correct answer:</label>"; |
|
12 |
echo "<input type='text' name='correctAnswer' "; |
|
13 |
if(isset($_POST['correctAnswer'])) echo "value='".$_POST['correctAnswer']."'"; |
|
14 |
echo " />"; |
|
15 |
||
16 |
if(isset($_POST['qVarNr'])) echo "<input type='hidden' name='qVarNr' value='".$_POST['qVarNr']."' />"; |
|
17 |
echo "<input type='hidden' name='quizNr' value='".$_POST['quizNr']."' />"; |
|
18 |
echo "<input type='hidden' name='courseName' value='".$_POST['courseName']."' />"; |
|
19 |
echo "<input type='hidden' name='listVariantsForSelectedQuiz' />"; |
|
20 |
echo "<input type='hidden' name='listQuizzesLink' />"; |
|
21 |
echo "<input type='submit' name='editVariantOfQuizFormSubmit' value='Save changes' />"; |
|
22 |
echo "<input type='submit' name='addVariantToQuizFormSubmit' value='Add as new' />"; |
|
23 |
echo "</form>"; |
|
24 |
||
25 |
//echo "<h2>Variants of quiz nr ".$_POST['quizNr']." for ".$_POST['courseName']."</h2>";
|
|
26 |
echo "<table class='dataTable'>"; |
|
27 |
echo "<caption>Quiz nr ".$_POST['quizNr']." for ".$_POST['courseName']." variants</caption>"; |
|
28 |
if(count($quizVariants)>0){ |
|
29 |
foreach($quizVariants[0] as $columnName=>$data){ |
|
30 |
echo "<th>".$columnName."</th>"; |
|
31 |
}
|
|
32 |
echo "</tr>"; |
|
33 |
foreach($quizVariants as $row){ |
|
34 |
echo "<tr>"; |
|
35 |
foreach($row as $key=>$data){ |
|
36 |
if($key!="quizURI") echo "<td>".$data."</td>"; |
|
37 |
//echo "<td>".$data."</td>";
|
|
38 |
}
|
|
39 |
echo "<td> |
|
40 |
<form name='testVariantOfQuizForm' action='quiz/quizLoader.php' method='post' target='_blank' >
|
|
41 |
<label>With answer:<input type='checkbox' name='withAnswer' id='withAnswer' /></label>
|
|
42 |
<input type='hidden' name='courseName' value='".$_POST['courseName']."' /> |
|
43 |
<input type='hidden' name='quizNr' value='".$_POST['quizNr']."' /> |
|
44 |
<input type='hidden' name='answerString' value='".$row['correctAnswer']."' /> |
|
45 |
<input type='hidden' name='qVarNr' value='".$row['qVarNr']."' /> |
|
46 |
<input type='hidden' name='quizURI' value='".$row['quizURI']."' /> |
|
47 |
<input type='submit' name='testVariantToQuizFormSubmit' value='Test' />
|
|
48 |
</form>
|
|
49 |
</td>"; |
|
50 |
echo "<td> |
|
51 |
<form name='editVariantOfQuizForm' action='.' method='post'>
|
|
52 |
<input type='hidden' name='courseName' value='".$_POST['courseName']."' /> |
|
53 |
<input type='hidden' name='quizNr' value='".$_POST['quizNr']."' /> |
|
54 |
<input type='hidden' name='correctAnswer' value='".$row['correctAnswer']."' /> |
|
55 |
<input type='hidden' name='qVarNr' value='".$row['qVarNr']."' /> |
|
56 |
<input type='hidden' name='listVariantsForSelectedQuiz' />
|
|
57 |
<input type='hidden' name='listQuizzesLink' />
|
|
58 |
<input type='submit' name='editVariantToQuizFormSubmit' value='Edit' />
|
|
59 |
</form>
|
|
60 |
</td>"; |
|
61 |
echo "<td> |
|
62 |
<form name='deleteVariantOfQuizForm' action='.' method='post'>
|
|
63 |
<input type='hidden' name='courseName' value='".$_POST['courseName']."' /> |
|
64 |
<input type='hidden' name='quizNr' value='".$_POST['quizNr']."' /> |
|
65 |
<input type='hidden' name='correctAnswer' value='".$row['correctAnswer']."' /> |
|
66 |
<input type='hidden' name='qVarNr' value='".$row['qVarNr']."' /> |
|
67 |
<input type='hidden' name='listVariantsForSelectedQuiz' />
|
|
68 |
<input type='hidden' name='listQuizzesLink' />
|
|
69 |
<input type='submit' name='deleteVariantOfQuizSubmit' value='Delete' class='confirm' />
|
|
70 |
</form>
|
|
71 |
</td>"; |
|
72 |
echo "<td> |
|
73 |
<form name='viewObjectsForVariantForm' action='.' method='post'>
|
|
74 |
<input type='hidden' name='courseName' value='".$_POST['courseName']."' /> |
|
75 |
<input type='hidden' name='quizNr' value='".$_POST['quizNr']."' /> |
|
76 |
<input type='hidden' name='qVarNr' value='".$row['qVarNr']."' /> |
|
77 |
<input type='hidden' name='listVariantsForSelectedQuiz' />
|
|
78 |
<input type='hidden' name='listQuizzesLink' />
|
|
79 |
<input type='hidden' name='listVariantObjects' />
|
|
80 |
<input type='submit' name='viewObjectsForVariantSubmit' value='Data objects' />
|
|
81 |
</form>
|
|
82 |
</td>"; |
|
83 |
echo "</tr>"; |
|
84 |
}
|
|
85 |
} else { |
|
86 |
echo "<tr><td>No variants found for this quiz.</td></tr>"; |
|
87 |
}
|
|
88 |
echo "</table>"; |
|
89 |
?>
|