removed php notice and fixed line endings
This commit is contained in:
@@ -1,248 +1,134 @@
|
||||
<?php
|
||||
if (!isset($options->single)) {
|
||||
$options->single = 1;
|
||||
}
|
||||
?>
|
||||
<form name="theform" method="post" action="question.php">
|
||||
|
||||
<center>
|
||||
|
||||
<table cellpadding="5">
|
||||
|
||||
<tr valign="top">
|
||||
|
||||
<tr valign="top">
|
||||
<td align="right"><b><?php print_string("category", "quiz") ?>:</b></td>
|
||||
|
||||
<td>
|
||||
|
||||
<?php quiz_category_select_menu($course->id, true, true, $question->category); ?>
|
||||
|
||||
<?php quiz_category_select_menu($course->id, true, true, $question->category); ?>
|
||||
</td>
|
||||
|
||||
</tr>
|
||||
|
||||
<tr valign="top">
|
||||
|
||||
</tr>
|
||||
|
||||
<tr valign="top">
|
||||
<td align="right"><b><?php print_string("questionname", "quiz") ?>:</b></td>
|
||||
|
||||
<td>
|
||||
|
||||
<input type="text" name="name" size="40" value="<?php p($question->name) ?>" alt="<?php print_string("questionname", "quiz") ?>" />
|
||||
|
||||
<?php if (isset($err["name"])) formerr($err["name"]); ?>
|
||||
|
||||
<input type="text" name="name" size="40" value="<?php p($question->name) ?>" alt="<?php print_string("questionname", "quiz") ?>" />
|
||||
<?php if (isset($err["name"])) formerr($err["name"]); ?>
|
||||
</td>
|
||||
|
||||
</tr>
|
||||
|
||||
<tr valign="top">
|
||||
|
||||
</tr>
|
||||
|
||||
<tr valign="top">
|
||||
<td align="right"><b><?php print_string("question", "quiz") ?>:</b>
|
||||
|
||||
<br />
|
||||
|
||||
<br />
|
||||
|
||||
<br />
|
||||
|
||||
<font size="1">
|
||||
|
||||
<?php
|
||||
|
||||
<br /><br /><br /><font size="1">
|
||||
<?php
|
||||
if ($usehtmleditor) {
|
||||
|
||||
helpbutton("richtext", get_string("helprichtext"), "moodle", true, true);
|
||||
|
||||
} else {
|
||||
|
||||
helpbutton("text", get_string("helptext"), "moodle", true, true);
|
||||
|
||||
}
|
||||
|
||||
?>
|
||||
|
||||
</font>
|
||||
|
||||
?>
|
||||
</font>
|
||||
</td>
|
||||
|
||||
<td>
|
||||
|
||||
<?php if (isset($err["questiontext"])) {
|
||||
|
||||
formerr($err["questiontext"]);
|
||||
|
||||
echo "<br />";
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
print_textarea($usehtmleditor, 15, 60, 630, 300, "questiontext", $question->questiontext);
|
||||
|
||||
|
||||
|
||||
if ($usehtmleditor) {
|
||||
|
||||
echo '<input type="hidden" name="questiontextformat" value="'.FORMAT_HTML.'" />';
|
||||
|
||||
} else {
|
||||
|
||||
echo "<div align=\"right\">";
|
||||
|
||||
print_string("formattexttype");
|
||||
|
||||
echo ": ";
|
||||
|
||||
if (!isset($question->questiontextformat)) {
|
||||
|
||||
$question->questiontextformat = FORMAT_MOODLE;
|
||||
|
||||
}
|
||||
|
||||
choose_from_menu(format_text_menu(), "questiontextformat", $question->questiontextformat, "");
|
||||
|
||||
helpbutton("textformat", get_string("helpformatting"));
|
||||
|
||||
echo "</div>";
|
||||
|
||||
}
|
||||
|
||||
?>
|
||||
|
||||
<?php
|
||||
if (isset($err["questiontext"])) {
|
||||
formerr($err["questiontext"]);
|
||||
echo "<br />";
|
||||
}
|
||||
print_textarea($usehtmleditor, 15, 60, 630, 300, "questiontext", $question->questiontext);
|
||||
if ($usehtmleditor) {
|
||||
echo '<input type="hidden" name="questiontextformat" value="'.FORMAT_HTML.'" />';
|
||||
} else {
|
||||
echo "<div align=\"right\">";
|
||||
print_string("formattexttype");
|
||||
echo ": ";
|
||||
if (!isset($question->questiontextformat)) {
|
||||
$question->questiontextformat = FORMAT_MOODLE;
|
||||
}
|
||||
choose_from_menu(format_text_menu(), "questiontextformat", $question->questiontextformat, "");
|
||||
helpbutton("textformat", get_string("helpformatting"));
|
||||
echo "</div>";
|
||||
}
|
||||
?>
|
||||
</td>
|
||||
|
||||
</tr>
|
||||
|
||||
<tr valign="top">
|
||||
|
||||
</tr>
|
||||
|
||||
<tr valign="top">
|
||||
<td align="right"><b><?php print_string("imagedisplay", "quiz") ?>:</b></td>
|
||||
|
||||
<td>
|
||||
|
||||
<?php if (empty($images)) {
|
||||
|
||||
print_string("noimagesyet");
|
||||
|
||||
} else {
|
||||
|
||||
choose_from_menu($images, "image", "$question->image", get_string("none"),"","");
|
||||
|
||||
}
|
||||
|
||||
?>
|
||||
|
||||
<?php
|
||||
if (empty($images)) {
|
||||
print_string("noimagesyet");
|
||||
} else {
|
||||
choose_from_menu($images, "image", "$question->image", get_string("none"),"","");
|
||||
}
|
||||
?>
|
||||
</td>
|
||||
|
||||
</tr>
|
||||
|
||||
<tr valign="top">
|
||||
|
||||
</tr>
|
||||
|
||||
<tr valign="top">
|
||||
<td align="right"><b><?php print_string("answerhowmany", "quiz") ?>:</b></td>
|
||||
|
||||
<td>
|
||||
|
||||
<?php
|
||||
|
||||
$menu[0] = get_string("answersingleno", "quiz");
|
||||
|
||||
$menu[1] = get_string("answersingleyes", "quiz");
|
||||
|
||||
choose_from_menu($menu, "single", "$options->single", "");
|
||||
|
||||
unset($menu);
|
||||
|
||||
?>
|
||||
|
||||
<?php
|
||||
$menu[0] = get_string("answersingleno", "quiz");
|
||||
$menu[1] = get_string("answersingleyes", "quiz");
|
||||
choose_from_menu($menu, "single", "$options->single", "");
|
||||
unset($menu);
|
||||
?>
|
||||
</td>
|
||||
|
||||
</tr>
|
||||
|
||||
|
||||
|
||||
<tr valign="top">
|
||||
|
||||
</tr>
|
||||
|
||||
<tr valign="top">
|
||||
<td align="right"><b><?php print_string("choices", "quiz") ?></b>:</td>
|
||||
|
||||
<td><?php print_string("fillouttwochoices", "quiz") ?>
|
||||
|
||||
</td>
|
||||
|
||||
</tr>
|
||||
|
||||
|
||||
|
||||
<?php
|
||||
|
||||
for ($i=1; $i<=QUIZ_MAX_NUMBER_ANSWERS; $i++) {
|
||||
|
||||
if (!isset($answers[$i-1]->fraction)) {
|
||||
|
||||
$answers[$i-1]->answer = '';
|
||||
|
||||
$answers[$i-1]->fraction = 0;
|
||||
|
||||
$answers[$i-1]->feedback = '';
|
||||
|
||||
}
|
||||
|
||||
?>
|
||||
|
||||
<tr valign="top">
|
||||
|
||||
<td align="right"><b><?php echo get_string("choice", "quiz")." $i"; ?>:</b></td>
|
||||
|
||||
<td>
|
||||
|
||||
<input type="text" name="answer[]" size="50" maxlength="255" value="<?php p($answers[$i-1]->answer) ?>" alt="<?php echo get_string("choice", "quiz")." $i"; ?>"/>
|
||||
|
||||
<?php print_string("grade");
|
||||
|
||||
echo ": ";
|
||||
|
||||
choose_from_menu($gradeoptionsfull, "fraction[]", $answers[$i-1]->fraction, ""); ?>
|
||||
|
||||
<br />
|
||||
|
||||
</td>
|
||||
|
||||
</tr>
|
||||
|
||||
<tr valign="top">
|
||||
|
||||
<td align="right"><b><?php print_string("feedback", "quiz") ?>:</b></td>
|
||||
|
||||
<td>
|
||||
|
||||
<textarea name="feedback[]" rows="2" cols="50"><?php p($answers[$i-1]->feedback) ?></textarea>
|
||||
|
||||
</td>
|
||||
|
||||
</tr>
|
||||
|
||||
|
||||
|
||||
<tr valign="top">
|
||||
|
||||
<td colspan="2"> </td>
|
||||
|
||||
</tr>
|
||||
|
||||
|
||||
<td><?php print_string("fillouttwochoices", "quiz") ?></td>
|
||||
</tr>
|
||||
|
||||
<?php
|
||||
for ($i=1; $i<=QUIZ_MAX_NUMBER_ANSWERS; $i++) {
|
||||
if (!isset($answers[$i-1]->fraction)) {
|
||||
$answers[$i-1]->answer = '';
|
||||
$answers[$i-1]->fraction = 0;
|
||||
$answers[$i-1]->feedback = '';
|
||||
}
|
||||
?>
|
||||
|
||||
<tr valign="top">
|
||||
<td align="right"><b><?php echo get_string("choice", "quiz")." $i"; ?>:</b></td>
|
||||
<td>
|
||||
<input type="text" name="answer[]" size="50" maxlength="255" value="<?php p($answers[$i-1]->answer) ?>" alt="<?php echo get_string("choice", "quiz")." $i"; ?>"/>
|
||||
<?php
|
||||
print_string("grade");
|
||||
echo ": ";
|
||||
choose_from_menu($gradeoptionsfull, "fraction[]", $answers[$i-1]->fraction, "");
|
||||
?>
|
||||
<br />
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr valign="top">
|
||||
<td align="right"><b><?php print_string("feedback", "quiz") ?>:</b></td>
|
||||
<td>
|
||||
<textarea name="feedback[]" rows="2" cols="50"><?php p($answers[$i-1]->feedback) ?></textarea>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr valign="top">
|
||||
<td colspan="2"> </td>
|
||||
</tr>
|
||||
|
||||
<?php
|
||||
} /// End of loop, printing answers
|
||||
|
||||
?>
|
||||
|
||||
</table>
|
||||
|
||||
|
||||
|
||||
<input type="hidden" name="id" value="<?php p($question->id) ?>" />
|
||||
|
||||
<input type="hidden" name="qtype" value="<?php p($question->qtype) ?>" />
|
||||
|
||||
<input type="submit" value="<?php print_string("savechanges") ?>" />
|
||||
|
||||
|
||||
|
||||
</center>
|
||||
|
||||
</form>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user