fixed capitalization and quoting of attribute values

This commit is contained in:
gustav_delius 2004-09-12 17:34:35 +00:00
parent 41905731b7
commit d1290cec39
121 changed files with 1401 additions and 1401 deletions

View file

@ -1,27 +1,27 @@
<FORM name="theform" method="post" action="question.php">
<CENTER>
<INPUT type="hidden" name="nextwizardpage" value="<?php p($nextwizardpage)?>" />
<form name="theform" method="post" action="question.php">
<center>
<input type="hidden" name="nextwizardpage" value="<?php p($nextwizardpage)?>" />
<?php foreach ($calculatedmessages as $message) {formerr("$message<br/>");} ?>
<TABLE cellpadding=5>
<TR valign=top>
<TD align=right><P><B><?php print_string("category", "quiz") ?>:</B></P></TD>
<TD>
<table cellpadding="5">
<tr valign="top">
<td align="right"><p><b><?php print_string("category", "quiz") ?>:</b></p></td>
<td>
<?php quiz_category_select_menu($course->id, true, true, $question->category); ?>
</TD>
</TR>
<TR valign=top>
<TD align=right><P><B><?php print_string("questionname", "quiz") ?>:</B></P></TD>
<TD>
<INPUT type="text" name="name" size=50 value="<?php p($question->name) ?>" />
</td>
</tr>
<tr valign="top">
<td align="right"><p><b><?php print_string("questionname", "quiz") ?>:</b></p></td>
<td>
<input type="text" name="name" size="50" value="<?php p($question->name) ?>" />
<?php if (isset($err["name"])) formerr($err["name"]); ?>
</TD>
</TR>
<tr valign=top>
</td>
</tr>
<tr valign="top">
<td align="right"><p><b><?php print_string("question", "quiz") ?>:</b></p>
<br />
<br />
<br />
<p><font SIZE="1">
<p><font size="1">
<?php
if ($usehtmleditor) {
helpbutton("richtext", get_string("helprichtext"), "moodle", true, true);
@ -42,7 +42,7 @@
if ($usehtmleditor) { /// Trying this out for a while
echo '<input type="hidden" name="questiontextformat" value="'.FORMAT_HTML.'" />';
} else {
echo "<div align=right>";
echo "<div align=\"right\">";
print_string("formattexttype");
echo ":&nbsp;";
if (!isset($question->questiontextformat)) {
@ -55,93 +55,93 @@
?>
</td>
</tr>
<TR valign=top>
<TD align=right><P><B><?php print_string("imagedisplay", "quiz") ?>:</B></P></TD>
<TD>
<tr valign="top">
<td align="right"><p><b><?php print_string("imagedisplay", "quiz") ?>:</b></p></td>
<td>
<?php if (empty($images)) {
print_string("noimagesyet");
} else {
choose_from_menu($images, "image", "$question->image", get_string("none"),"","");
}
?>
</TD>
</TR>
</td>
</tr>
<TR valign=top>
<TD align=right><P><B><?php print_string("correctanswerformula", "quiz") ?>:</B></P></TD>
<TD>
<INPUT align="LEFT" type="text" id="formula0" name="answer[]" size="20" value="<?php p($answers[0]->answer) ?>" />&nbsp;&nbsp;
<INPUT type="hidden" name="fraction[]" value="1.0" />
</TD>
</TR>
<TR valign=top>
<TD align=right><P><B><?php print_string("tolerance", "quiz"); ?>:</B></P></TD>
<TD>
<INPUT align="LEFT" type="text" id=tolerance0" name="tolerance[]" size="15" value="<?php p($answers[0]->tolerance) ?>" />&plusmn;
</TD>
</TR>
<TR valign=top>
<TD align=right><P><B><?php print_string("tolerancetype", "quiz"); ?>:</B></P></TD>
<TD>
<tr valign="top">
<td align="right"><p><b><?php print_string("correctanswerformula", "quiz") ?>:</b></p></td>
<td>
<input align="LEFT" type="text" id="formula0" name="answer[]" size="20" value="<?php p($answers[0]->answer) ?>" />&nbsp;&nbsp;
<input type="hidden" name="fraction[]" value="1.0" />
</td>
</tr>
<tr valign="top">
<td align="right"><p><b><?php print_string("tolerance", "quiz"); ?>:</b></p></td>
<td>
<input align="LEFT" type="text" id="tolerance0" name="tolerance[]" size="15" value="<?php p($answers[0]->tolerance) ?>" />&plusmn;
</td>
</tr>
<tr valign="top">
<td align="right"><p><b><?php print_string("tolerancetype", "quiz"); ?>:</b></p></td>
<td>
<?php choose_from_menu($qtypeobj->tolerance_types(),
'tolerancetype[]', $answers[0]->tolerancetype, false); ?>
</TD>
</TR>
<TR valign=top>
<TD align=right><P><B><?php print_string("correctanswerlength", "quiz"); ?>:</B></P></TD>
<TD>
</td>
</tr>
<tr valign="top">
<td align="right"><p><b><?php print_string("correctanswerlength", "quiz"); ?>:</b></p></td>
<td>
<?php choose_from_menu(array('1' => '1', '2' => '2', '3' => '3',
'4' => '4', '5' => '5', '6' => '6',
'7' => '7', '8' => '8', '9' => '9',
'10' => '10'),
'correctanswerlength[]',
$answers[0]->correctanswerlength, false); ?>
</TD>
</TR>
<TR valign=top>
<TD align=right><P><B><?php print_string("feedback", "quiz") ?>:</B></P></TD>
<TD>
<textarea name="feedback[]" rows=2 cols=50 wrap="virtual"><?php p($answers[0]->feedback) ?></textarea>
</TD>
</TR>
<TR valign=top>
<TD align=right><P><B><?php print_string("unit", "quiz") ?>:</B></P></TD>
<TD>
<P><INPUT type="HIDDEN" name="multiplier[]" value="1.0" />
<INPUT align="LEFT" type="text" id="defaultunit" name="unit[]"
</td>
</tr>
<tr valign="top">
<td align="right"><p><b><?php print_string("feedback", "quiz") ?>:</b></p></td>
<td>
<textarea name="feedback[]" rows="2" cols="50" wrap="virtual"><?php p($answers[0]->feedback) ?></textarea>
</td>
</tr>
<tr valign="top">
<td align="right"><p><b><?php print_string("unit", "quiz") ?>:</b></p></td>
<td>
<p><input type="HIDDEN" name="multiplier[]" value="1.0" />
<input align="LEFT" type="text" id="defaultunit" name="unit[]"
size="5" value="<?php p($units[0]->unit) ?>" />
<B>(<?php print_string("optional", "quiz") ?>)</B></P>
</TD>
</TR>
<TR valign=top>
<b>(<?php print_string("optional", "quiz") ?>)</b></p>
</td>
</tr>
<tr valign="top">
<td></td>
<TD align=left><P><B><?php print_string("alternativeunits", "quiz") ?>:</B></P></TD>
<td align="left"><p><b><?php print_string("alternativeunits", "quiz") ?>:</b></p></td>
<td></td>
</TR>
<?PHP
</tr>
<?php
for ($i=1; $i<count($units); $i++) {
$unit=$units[$i];
?>
<TR valign=top>
<tr valign="top">
<td></td>
<TD align=left>
<P><B><?php print_string("multiplier", "quiz") ?>:</B>
<INPUT type="text" id="<?php p("multiplier$i") ?>" size="10"
<td align="left">
<p><b><?php print_string("multiplier", "quiz") ?>:</b>
<input type="text" id="<?php p("multiplier$i") ?>" size="10"
align="RIGHT" name="multiplier[]"
value="<?php p($unit->multiplier) ?>" />
<B>&nbsp;&nbsp;&nbsp;<?php print_string("unit", "quiz") ?>:</B>
<INPUT align="LEFT" type="text" id="<?php p("unit$i") ?>"
<b>&nbsp;&nbsp;&nbsp;<?php print_string("unit", "quiz") ?>:</b>
<input align="LEFT" type="text" id="<?php p("unit$i") ?>"
name="unit[]"
size="5" value="<?php p($unit->unit) ?>" /></P>
</TD>
</TR>
<?PHP
size="5" value="<?php p($unit->unit) ?>" /></p>
</td>
</tr>
<?php
} /// END for
?>
</TABLE>
</table>
<input type="hidden" name=id value="<?php p($question->id) ?>" />
<input type="hidden" name=qtype value="<?php p($question->qtype) ?>" />
<input type="hidden" name="id" value="<?php p($question->id) ?>" />
<input type="hidden" name="qtype" value="<?php p($question->qtype) ?>" />
<input type="submit" onClick="return determineMinAndMax();" value="<?php print_string("savechanges") ?>" />
</center>
</form>

View file

@ -1,4 +1,4 @@
<?PHP // $Id$
<?php // $Id$
// Get a handle to the question type we are dealing with here
$qtypeobj = $QUIZ_QTYPES[CALCULATED];

View file

@ -1,4 +1,4 @@
<?PHP // $Id$
<?php // $Id$
///////////////////////////////
/// CALCULATED HELPER CLASS ///

View file

@ -1,4 +1,4 @@
<?PHP // $Id$
<?php // $Id$
/////////////////
/// CALCULATED ///
@ -43,12 +43,12 @@ class quiz_calculated_qtype extends quiz_dataset_dependent_questiontype {
? 'decimals'
: 'significantfigures'), 'quiz', $i);
}
return '<INPUT TYPE="submit" onClick="'
return '<input type="submit" onClick="'
. "document.addform.regenerateddefid.value='$datasetdef->id'; return true;"
.'" VALUE="'. get_string('generatevalue', 'quiz') . '"/><br/>'
. '<INPUT TYPE="text" SIZE="3" NAME="calcmin[]" '
. " VALUE=\"$regs[2]\"/> &amp; <INPUT NAME=\"calcmax[]\" "
. ' TYPE="text" SIZE="3" VALUE="' . $regs[3] .'"/> '
.'" value="'. get_string('generatevalue', 'quiz') . '"/><br/>'
. '<input type="text" size="3" name="calcmin[]" '
. " value=\"$regs[2]\"/> &amp; <input name=\"calcmax[]\" "
. ' type="text" size="3" value="' . $regs[3] .'"/> '
. choose_from_menu($lengthoptions, 'calclength[]',
$regs[4], // Selected
'', '', '', true) . '<br/>'

View file

@ -1,4 +1,4 @@
<?PHP // $Id$
<?php // $Id$
///////////////////////////////////////////////////////////////
/// ABSTRACT SUPERCLASS FOR QUSTION TYPES THAT USE DATASETS ///
@ -360,9 +360,9 @@ class quiz_dataset_dependent_questiontype extends quiz_default_questiontype {
$value = $item->value;
} else {
$icon = "<IMG SRC=\"$CFG->wwwroot/pix/f/"
$icon = "<img src=\"$CFG->wwwroot/pix/f/"
. mimeinfo('icon', $item->value)
. '" HEIGHT="16" WIDTH="16" BORDER="0" ALT="File" />';
. '" height="16" width="16" border="0" alt="File" />';
if (substr(strtolower($item->value), 0, 7)=='http://') {
$link = $item->value;

View file

@ -1,4 +1,4 @@
<?PHP // $Id$
<?php // $Id$
/////////////////////////////////////////////////////////////////////
///// This page offers a way to define category level datasets /////
@ -32,7 +32,7 @@
$strquestions = get_string("questions", "quiz");
print_header_simple("$strdefinedataset", "$strdefinedataset",
"<A HREF=\"../../edit.php\">$streditingquiz</A> -> $strdefinedataset");
"<a href=\"../../edit.php\">$streditingquiz</a> -> $strdefinedataset");
if ($form = data_submitted()) { /// Filename
@ -74,7 +74,7 @@
echo "<input type=\"hidden\" name=\"question\" value=\"$question\" />";
}
echo "<table cellpadding=5>";
echo "<table cellpadding=\"5\">";
$definitions = get_records('quiz_dataset_definitions',
'category',
@ -86,7 +86,7 @@
$definition = NULL;
}
echo "<tr><td align=right>";
echo "<tr><td align=\"right\">";
print_string("itemdefinition", "quiz");
echo ":</td><td>";
echo "<input name=\"name[]\" type=\"text\" size=\"20\" value=\"$definition->name\" />";
@ -96,7 +96,7 @@
echo "</td></tr>\n";
}
echo "<tr><td align=\"CENTER\" colspan=\"3\"><input type=submit value=\"".get_string("continue")."\" /></td></tr>";
echo "<tr><td align=\"CENTER\" colspan=\"3\"><input type=\"submit\" value=\"".get_string("continue")."\" /></td></tr>";
echo "</table>";
echo "</form>";
print_simple_box_end();

View file

@ -1,4 +1,4 @@
<?PHP // $Id$
<?php // $Id$
// Allows a teacher to create, edit and delete datasets
@ -124,17 +124,17 @@
$columns = array();
if ($maxnumber == $number) {
$columns[] =
"<INPUT TYPE=\"hidden\" name=\"numbertodelete\" value=\"$number\"/>
<INPUT TYPE=\"submit\" name=\"deletebutton\" value=\"$strdelete\"/>";
"<input type=\"hidden\" name=\"numbertodelete\" value=\"$number\"/>
<input type=\"submit\" name=\"deletebutton\" value=\"$strdelete\"/>";
} else {
$columns[] = '';
}
$columns[] = $number;
foreach ($datasetdefs as $datasetdef) {
$columns[] =
'<INPUT TYPE="hidden" name="itemid[]" value="'. $datasetdef->items[$number]->id .'"/>'
. "<INPUT TYPE=\"hidden\" name=\"number[]\" value=\"$number\"/>
<INPUT TYPE=\"hidden\" name=\"definition[]\" value=\"$datasetdef->id\"/>"
'<input type="hidden" name="itemid[]" value="'. $datasetdef->items[$number]->id .'"/>'
. "<input type=\"hidden\" name=\"number[]\" value=\"$number\"/>
<input type=\"hidden\" name=\"definition[]\" value=\"$datasetdef->id\"/>"
. // Set $data:
($data[$datasetdef->name] = $datasetdef->items[$number]->value) ;
@ -156,16 +156,16 @@
$force = '';
$reuse = ' checked="checked" ';
}
$forceregeneration = '<br/><INPUT type="radio" name="forceregeneration" '
$forceregeneration = '<br/><input type="radio" name="forceregeneration" '
. $reuse . ' value="0"/>' . $strreuseifpossible
. '<br/><INPUT type="radio" name="forceregeneration" value="1" '
. '<br/><input type="radio" name="forceregeneration" value="1" '
. $force . ' />' . $strforceregeneration;
} else {
$forceregeneration = '';
}
$addline = array('<INPUT TYPE="hidden" name="numbertoadd" value="'
$addline = array('<input type="hidden" name="numbertoadd" value="'
. ($maxnumber+1)
. "\"/><INPUT TYPE=\"submit\" name=\"addbutton\" value=\"$stradd\"/>"
. "\"/><input type=\"submit\" name=\"addbutton\" value=\"$stradd\"/>"
. $forceregeneration
, $maxnumber+1);
foreach ($datasetdefs as $datasetdef) {
@ -229,10 +229,10 @@
}
$addline[] =
'<INPUT TYPE="hidden" name="itemid[]" value="'.$itemid.'"/>'
. "<INPUT TYPE=\"hidden\" name=\"definition[]\" value=\"$datasetdef->id\"/>"
'<input type="hidden" name="itemid[]" value="'.$itemid.'"/>'
. "<input type=\"hidden\" name=\"definition[]\" value=\"$datasetdef->id\"/>"
. ( 2 != $datasetdef->type
? '<INPUT TYPE="text" size="20" name="value[]" value="'
? '<input type="text" size="20" name="value[]" value="'
. $itemvalue
. '"/>'
: choose_from_menu($coursefiles, 'value[]',
@ -251,23 +251,23 @@
// Print form for adding one more dataset
$addtable->align = $table->align;
$addtable->data = array($addline);
echo "<FORM NAME=\"addform\" METHOD=\"post\" ACTION=\"question.php\">
<INPUT TYPE=\"hidden\" NAME=\"regenerateddefid\" VALUE=\"0\"/>
<INPUT TYPE=\"hidden\" NAME=\"id\" VALUE=\"$question->id\"/>
<INPUT TYPE=\"hidden\" NAME=\"editdatasets\" VALUE=\"1\"/>";
echo "<form name=\"addform\" method=\"post\" action=\"question.php\">
<input type=\"hidden\" name=\"regenerateddefid\" value=\"0\"/>
<input type=\"hidden\" name=\"id\" value=\"$question->id\"/>
<input type=\"hidden\" name=\"editdatasets\" value=\"1\"/>";
print_table($addtable);
echo '</FORM>';
echo '</form>';
// Print form with current datasets
if ($table->data) {
echo "<FORM METHOD=\"post\" ACTION=\"question.php\">
<INPUT TYPE=\"hidden\" NAME=\"id\" VALUE=\"$question->id\"/>
<INPUT TYPE=\"hidden\" NAME=\"editdatasets\" VALUE=\"1\"/>";
echo "<form method=\"post\" action=\"question.php\">
<input type=\"hidden\" name=\"id\" value=\"$question->id\"/>
<input type=\"hidden\" name=\"editdatasets\" value=\"1\"/>";
print_table($table);
echo '</FORM>';
echo '</form>';
}
echo "<center><BR><BR><FORM METHOD=\"get\" ACTION=\"edit.php\"><INPUT TYPE=\"hidden\" NAME=\"question\" VALUE=\"$question->id\"/><INPUT TYPE=submit NAME=backtoquiz VALUE=\"$strbacktoquiz\"></FORM></center>\n";
echo "<center><br><br><form method=\"get\" action=\"edit.php\"><input type=\"hidden\" name=\"question\" value=\"$question->id\"/><input type=\"submit\" name=\"backtoquiz\" value=\"$strbacktoquiz\"></form></center>\n";
print_footer();

View file

@ -1,58 +1,58 @@
<FORM name="theform" method="post" action="question.php">
<CENTER>
<INPUT type="hidden" name="nextwizardpage" value="calculated.html"/>
<TABLE cellpadding=5>
<form name="theform" method="post" action="question.php">
<center>
<input type="hidden" name="nextwizardpage" value="calculated.html"/>
<table cellpadding="5">
<?php if (!empty($datasets)) { ?>
<TR valign="top">
<TD align="right"><B><?php print_string("wildcard", "quiz") ?> </B></TD>
<TD align="right">{<?php foreach($datasets as $name => $tmp){break;} p($name) ?>}</TD>
<TD><B> - <?php print_string("substitutedby", "quiz") ?></B></TD>
<TD align="left"><?php echo array_shift($datasets) ?></TD>
</TR>
<tr valign="top">
<td align="right"><b><?php print_string("wildcard", "quiz") ?> </b></td>
<td align="right">{<?php foreach($datasets as $name => $tmp){break;} p($name) ?>}</td>
<td><b> - <?php print_string("substitutedby", "quiz") ?></b></td>
<td align="left"><?php echo array_shift($datasets) ?></td>
</tr>
<?php foreach ($datasets as $name => $menu) { ?>
<TR valign="top">
<TD/>
<TD align="right">{<?php p($name) ?>}</TD>
<TD/>
<TD align="left"><?php echo $menu ?>
</TR>
<tr valign="top">
<td/>
<td align="right">{<?php p($name) ?>}</td>
<td/>
<td align="left"><?php echo $menu ?>
</tr>
<?php }
} else { ?>
<TR>
<TD colspan="4"><?php print_string('nopossibledatasets', 'quiz') ?>
<INPUT type="hidden" name="dataset[]" value="0"/>
</TD>
</TR>
<tr>
<td colspan="4"><?php print_string('nopossibledatasets', 'quiz') ?>
<input type="hidden" name="dataset[]" value="0"/>
</td>
</tr>
<?php } ?>
<TR valign=top>
<TD/>
<TD/>
<TD/>
<TD>
<INPUT type="hidden" name="name" value="<?php p($question->name) ?>" />
<INPUT type="hidden" name="questiontext" value="<?php p($question->questiontext) ?>" />
<INPUT type="hidden" name="questiontextformat" value="<?php p($question->questiontextformat) ?>" />
<INPUT type="hidden" name="image" value="<?php p($question->image) ?>" />
<tr valign="top">
<td/>
<td/>
<td/>
<td>
<input type="hidden" name="name" value="<?php p($question->name) ?>" />
<input type="hidden" name="questiontext" value="<?php p($question->questiontext) ?>" />
<input type="hidden" name="questiontextformat" value="<?php p($question->questiontextformat) ?>" />
<input type="hidden" name="image" value="<?php p($question->image) ?>" />
<?php foreach ($answers as $answer) { ?>
<INPUT type="hidden" name="answer[]" value="<?php p($answer->answer) ?>" />
<INPUT type="hidden" name="fraction[]" value="<?php p($answer->fraction) ?>" />
<INPUT type="hidden" name="feedback[]" value="<?php p($answer->feedback) ?>" />
<INPUT type="hidden" name="tolerance[]" value="<?php p($answer->tolerance) ?>" />
<INPUT type="hidden" name="tolerancetype[]" value="<?php p($answer->tolerancetype) ?>" />
<INPUT type="hidden" name="correctanswerlength[]" value="<?php p($answer->correctanswerlength) ?>" />
<input type="hidden" name="answer[]" value="<?php p($answer->answer) ?>" />
<input type="hidden" name="fraction[]" value="<?php p($answer->fraction) ?>" />
<input type="hidden" name="feedback[]" value="<?php p($answer->feedback) ?>" />
<input type="hidden" name="tolerance[]" value="<?php p($answer->tolerance) ?>" />
<input type="hidden" name="tolerancetype[]" value="<?php p($answer->tolerancetype) ?>" />
<input type="hidden" name="correctanswerlength[]" value="<?php p($answer->correctanswerlength) ?>" />
<?php } ?>
<?php foreach ($units as $unit) { ?>
<INPUT type="hidden" name="multiplier[]" value="<?php p($unit->multiplier) ?>" />
<INPUT type="hidden" name="unit[]" value="<?php p($unit->unit) ?>" />
<input type="hidden" name="multiplier[]" value="<?php p($unit->multiplier) ?>" />
<input type="hidden" name="unit[]" value="<?php p($unit->unit) ?>" />
<?php } ?>
</TD>
</TR>
</TABLE>
</td>
</tr>
</table>
<INPUT type="hidden" name=id value="<?php p($question->id) ?>" />
<INPUT type="hidden" name=qtype value="<?php p($question->qtype) ?>" />
<INPUT type="hidden" name="category" value="<?php p($question->category) ?>" />
<INPUT type="submit" value="<?php print_string("savechanges") ?>" />
</CENTER>
</FORM>
<input type="hidden" name="id" value="<?php p($question->id) ?>" />
<input type="hidden" name="qtype" value="<?php p($question->qtype) ?>" />
<input type="hidden" name="category" value="<?php p($question->category) ?>" />
<input type="submit" value="<?php print_string("savechanges") ?>" />
</center>
</form>

View file

@ -1,36 +1,36 @@
<FORM name="theform" method="post" action="question.php">
<form name="theform" method="post" action="question.php">
<CENTER>
<center>
<TABLE cellpadding=5>
<table cellpadding="5">
<TR valign=top>
<tr valign="top">
<TD align=right><P><B><?php print_string("category", "quiz") ?>:</B></P></TD>
<td align="right"><p><b><?php print_string("category", "quiz") ?>:</b></p></td>
<TD>
<td>
<?php quiz_category_select_menu($course->id, true, true, $question->category); ?>
</TD>
</td>
</TR>
</tr>
<TR valign=top>
<tr valign="top">
<TD align=right><P><B><?php print_string("questionname", "quiz") ?>:</B></P></TD>
<td align="right"><p><b><?php print_string("questionname", "quiz") ?>:</b></p></td>
<TD>
<td>
<INPUT type="text" name="name" size=40 value="<?php p($question->name) ?>" />
<input type="text" name="name" size="40" value="<?php p($question->name) ?>" />
<?php if (isset($err["name"])) formerr($err["name"]); ?>
</TD>
</td>
</TR>
</tr>
<tr valign=top>
<tr valign="top">
<td align="right"><p><b><?php print_string("question", "quiz") ?>:</b></p>
@ -40,7 +40,7 @@
<br />
<p><font SIZE="1">
<p><font size="1">
<?php
@ -82,7 +82,7 @@
} else {
echo "<div align=right>";
echo "<div align=\"right\">";
print_string("formattexttype");
@ -108,11 +108,11 @@
</tr>
<TR valign=top>
<tr valign="top">
<TD align=right><P><B><?php print_string("imagedisplay", "quiz") ?>:</B></P></TD>
<td align="right"><p><b><?php print_string("imagedisplay", "quiz") ?>:</b></p></td>
<TD>
<td>
<?php if (empty($images)) {
@ -126,25 +126,25 @@
?>
</TD>
</td>
</TR>
</tr>
</TABLE>
</table>
<INPUT type="hidden" name=id value="<?php p($question->id) ?>" />
<input type="hidden" name="id" value="<?php p($question->id) ?>" />
<INPUT type="hidden" name=qtype value="<?php p($question->qtype) ?>" />
<input type="hidden" name="qtype" value="<?php p($question->qtype) ?>" />
<INPUT type="hidden" name=defaultgrade value="0" />
<input type="hidden" name="defaultgrade" value="0" />
<INPUT type="submit" value="<?php print_string("savechanges") ?>" />
<input type="submit" value="<?php print_string("savechanges") ?>" />
</CENTER>
</center>
</FORM>
</form>

View file

@ -1,4 +1,4 @@
<?PHP // $Id$
<?php // $Id$
print_heading_with_help(get_string("editingdescription", "quiz"), "description", "quiz");
require("description.html");

View file

@ -1,4 +1,4 @@
<?PHP // $Id$
<?php // $Id$
///////////////////
/// DESCRIPTION ///

View file

@ -1,4 +1,4 @@
<?PHP // $Id$
<?php // $Id$
if (!empty($question->id)) {
$options = get_record("quiz_match", "question", $question->id);
@ -7,7 +7,7 @@
}
}
if (empty($subquestions) and empty($subanswers)) {
for ($i=0; $i<QUIZ_MAX_NUMBER_ANSWERS; $i++) {
for ($i=0; $i<quiz_MAX_NUMBER_ANSWERS; $i++) {
$subquestions[] = ""; // Make question slots, default as blank
$subanswers[] = ""; // Make answer slots, default as blank
}

View file

@ -1,36 +1,36 @@
<FORM name="theform" method="post" action="question.php">
<form name="theform" method="post" action="question.php">
<CENTER>
<center>
<TABLE cellpadding=5>
<table cellpadding="5">
<TR valign=top>
<tr valign="top">
<TD align=right><P><B><?php print_string("category", "quiz") ?>:</B></P></TD>
<td align="right"><p><b><?php print_string("category", "quiz") ?>:</b></p></td>
<TD>
<td>
<?php quiz_category_select_menu($course->id, true, true, $question->category); ?>
</TD>
</td>
</TR>
</tr>
<TR valign=top>
<tr valign="top">
<TD align=right><P><B><?php print_string("questionname", "quiz") ?>:</B></P></TD>
<td align="right"><p><b><?php print_string("questionname", "quiz") ?>:</b></p></td>
<TD>
<td>
<INPUT type="text" name="name" size=40 value="<?php p($question->name) ?>" />
<input type="text" name="name" size="40" value="<?php p($question->name) ?>" />
<?php if (isset($err["name"])) formerr($err["name"]); ?>
</TD>
</td>
</TR>
</tr>
<tr valign=top>
<tr valign="top">
<td align="right"><p><b><?php print_string("question", "quiz") ?>:</b></p>
@ -40,7 +40,7 @@
<br />
<p><font SIZE="1">
<p><font size="1">
<?php
@ -82,7 +82,7 @@
} else {
echo "<div align=right>";
echo "<div align=\"right\">";
print_string("formattexttype");
@ -108,11 +108,11 @@
</tr>
<TR valign=top>
<tr valign="top">
<TD align=right><P><B><?php print_string("imagedisplay", "quiz") ?>:</B></P></TD>
<td align="right"><p><b><?php print_string("imagedisplay", "quiz") ?>:</b></p></td>
<TD>
<td>
<?php if (empty($images)) {
@ -126,25 +126,25 @@
?>
</TD>
</td>
</TR>
</tr>
<TR valign=top>
<tr valign="top">
<TD align=right><P><B><?php print_string("choices", "quiz") ?></B>:</P></TD>
<td align="right"><p><b><?php print_string("choices", "quiz") ?></b>:</p></td>
<TD><P><?php print_string("filloutthreequestions", "quiz") ?></P>
<td><p><?php print_string("filloutthreequestions", "quiz") ?></p>
</TD>
</td>
</TR>
</tr>
<?PHP
<?php
for ($i=1; $i<=QUIZ_MAX_NUMBER_ANSWERS; $i++) {
@ -152,27 +152,27 @@
<TR valign=top>
<tr valign="top">
<TD align=right><P><B><?php echo get_string("question", "quiz")." $i"; ?> :</B></P></TD>
<td align="right"><p><b><?php echo get_string("question", "quiz")." $i"; ?> :</b></p></td>
<TD>
<td>
<textarea name="subquestions[]" rows=5 cols=50><?php p($subquestions[$i-1]) ?></textarea>
<textarea name="subquestions[]" rows="5" cols="50"><?php p($subquestions[$i-1]) ?></textarea>
<br />
<?php echo get_string("matchanswer", "quiz")." $i"; ?>&nbsp;&nbsp;
<INPUT type="text" name="subanswers[]" size=50 value="<?php p($subanswers[$i-1]) ?>" />
<input type="text" name="subanswers[]" size="50" value="<?php p($subanswers[$i-1]) ?>" />
</TD>
</td>
</TR>
</tr>
<?PHP
<?php
}
@ -180,19 +180,19 @@
</TABLE>
</table>
<INPUT type="hidden" name=id value="<?php p($question->id) ?>" />
<input type="hidden" name="id" value="<?php p($question->id) ?>" />
<INPUT type="hidden" name=qtype value="<?php p($question->qtype) ?>" />
<input type="hidden" name="qtype" value="<?php p($question->qtype) ?>" />
<INPUT type="submit" value="<?php print_string("savechanges") ?>" />
<input type="submit" value="<?php print_string("savechanges") ?>" />
</CENTER>
</center>
</FORM>
</form>

View file

@ -1,4 +1,4 @@
<?PHP // $Id$
<?php // $Id$
/////////////
/// MATCH ///

View file

@ -1,4 +1,4 @@
<?PHP // $Id$
<?php // $Id$
if ($question->questiontext and $question->id) {
$answers = quiz_get_answers($question);

View file

@ -1,46 +1,46 @@
<FORM name="theform" method="post" action="question.php">
<form name="theform" method="post" action="question.php">
<CENTER>
<center>
<TABLE cellpadding=5>
<table cellpadding="5">
<TR valign=top>
<tr valign="top">
<TD align=right><P><B><?php print_string("category", "quiz") ?>:</B></P></TD>
<td align="right"><p><b><?php print_string("category", "quiz") ?>:</b></p></td>
<TD>
<td>
<?php quiz_category_select_menu($course->id, true, true, $question->category); ?>
</TD>
</td>
</TR>
</tr>
<TR valign=top>
<tr valign="top">
<TD align=right><P><B><?php print_string("questionname", "quiz") ?>:</B></P></TD>
<td align="right"><p><b><?php print_string("questionname", "quiz") ?>:</b></p></td>
<TD>
<td>
<INPUT type="text" name="name" size=40 value="<?php p($question->name) ?>" />
<input type="text" name="name" size="40" value="<?php p($question->name) ?>" />
<?php if (isset($err["name"])) formerr($err["name"]); ?>
</TD>
</td>
</TR>
</tr>
<TR valign=top>
<tr valign="top">
<TD align=right><P><B><?php print_string("question", "quiz") ?>:</B></P></TD>
<td align="right"><p><b><?php print_string("question", "quiz") ?>:</b></p></td>
<TD>
<td>
<?php if (isset($err["questiontext"])) {
formerr($err["questiontext"]);
echo "<BR />";
echo "<br />";
}
@ -58,15 +58,15 @@
?>
</TD>
</td>
</TR>
</tr>
<TR valign=top>
<tr valign="top">
<TD align=right><P><B><?php print_string("imagedisplay", "quiz") ?>:</B></P></TD>
<td align="right"><p><b><?php print_string("imagedisplay", "quiz") ?>:</b></p></td>
<TD>
<td>
<?php if (empty($images)) {
@ -80,24 +80,24 @@
?>
</TD>
</td>
</TR>
</tr>
</TABLE>
</table>
<INPUT type="hidden" name=id value="<?php p($question->id) ?>" />
<input type="hidden" name="id" value="<?php p($question->id) ?>" />
<INPUT type="hidden" name=qtype value="<?php p($question->qtype) ?>" />
<input type="hidden" name="qtype" value="<?php p($question->qtype) ?>" />
<INPUT type="hidden" name=defaultgrade value="<?php p($question->defaultgrade) ?>" />
<input type="hidden" name="defaultgrade" value="<?php p($question->defaultgrade) ?>" />
<INPUT type="submit" value="<?php print_string("savechanges") ?>" />
<input type="submit" value="<?php print_string("savechanges") ?>" />
</CENTER>
</center>
</FORM>
</form>

View file

@ -1,4 +1,4 @@
<?PHP // $Id$
<?php // $Id$
///////////////////
/// MULTIANSWER /// (Embedded - cloze)

View file

@ -8,7 +8,7 @@
if (!empty($options->answers)) {
$answersraw = get_records_list("quiz_answers", "id", $options->answers);
}
for ($i=0; $i<QUIZ_MAX_NUMBER_ANSWERS; $i++) {
for ($i=0; $i<quiz_MAX_NUMBER_ANSWERS; $i++) {
$answers[] = ""; // Make answer slots, default as blank
}
if (!empty($answersraw)) {

View file

@ -1,36 +1,36 @@
<FORM name="theform" method="post" action="question.php">
<form name="theform" method="post" action="question.php">
<CENTER>
<center>
<TABLE cellpadding=5>
<table cellpadding="5">
<TR valign=top>
<tr valign="top">
<TD align=right><P><B><?php print_string("category", "quiz") ?>:</B></P></TD>
<td align="right"><p><b><?php print_string("category", "quiz") ?>:</b></p></td>
<TD>
<td>
<?php quiz_category_select_menu($course->id, true, true, $question->category); ?>
</TD>
</td>
</TR>
</tr>
<TR valign=top>
<tr valign="top">
<TD align=right><P><B><?php print_string("questionname", "quiz") ?>:</B></P></TD>
<td align="right"><p><b><?php print_string("questionname", "quiz") ?>:</b></p></td>
<TD>
<td>
<INPUT type="text" name="name" size=40 value="<?php p($question->name) ?>" />
<input type="text" name="name" size="40" value="<?php p($question->name) ?>" />
<?php if (isset($err["name"])) formerr($err["name"]); ?>
</TD>
</td>
</TR>
</tr>
<tr valign=top>
<tr valign="top">
<td align="right"><p><b><?php print_string("question", "quiz") ?>:</b></p>
@ -40,7 +40,7 @@
<br />
<p><font SIZE="1">
<p><font size="1">
<?php
@ -82,7 +82,7 @@
} else {
echo "<div align=right>";
echo "<div align=\"right\">";
print_string("formattexttype");
@ -108,11 +108,11 @@
</tr>
<TR valign=top>
<tr valign="top">
<TD align=right><P><B><?php print_string("imagedisplay", "quiz") ?>:</B></P></TD>
<td align="right"><p><b><?php print_string("imagedisplay", "quiz") ?>:</b></p></td>
<TD>
<td>
<?php if (empty($images)) {
@ -126,15 +126,15 @@
?>
</TD>
</td>
</TR>
</tr>
<TR valign=top>
<tr valign="top">
<TD align=right><P><B><?php print_string("answerhowmany", "quiz") ?>:</B></P></TD>
<td align="right"><p><b><?php print_string("answerhowmany", "quiz") ?>:</b></p></td>
<TD>
<td>
<?php
@ -148,25 +148,25 @@
?>
</TD>
</td>
</TR>
</tr>
<TR valign=top>
<tr valign="top">
<TD align=right><P><B><?php print_string("choices", "quiz") ?></B>:</P></TD>
<td align="right"><p><b><?php print_string("choices", "quiz") ?></b>:</p></td>
<TD><P><?php print_string("fillouttwochoices", "quiz") ?></P>
<td><p><?php print_string("fillouttwochoices", "quiz") ?></p>
</TD>
</td>
</TR>
</tr>
<?PHP
<?php
for ($i=1; $i<=QUIZ_MAX_NUMBER_ANSWERS; $i++) {
@ -182,13 +182,13 @@
?>
<TR valign=top>
<tr valign="top">
<TD align=right><P><B><?php echo get_string("choice", "quiz")." $i"; ?>:</B></P></TD>
<td align="right"><p><b><?php echo get_string("choice", "quiz")." $i"; ?>:</b></p></td>
<TD>
<td>
<INPUT type="text" name="answer[]" size=50 maxlength=255 value="<?php p($answers[$i-1]->answer) ?>" />&nbsp;&nbsp;
<input type="text" name="answer[]" size="50" maxlength="255" value="<?php p($answers[$i-1]->answer) ?>" />&nbsp;&nbsp;
<?php print_string("grade");
@ -196,31 +196,31 @@
choose_from_menu($gradeoptionsfull, "fraction[]", $answers[$i-1]->fraction, ""); ?>
<BR>
<br>
</TD>
</td>
</TR>
</tr>
<TR valign=top>
<tr valign="top">
<TD align=right><P><B><?php print_string("feedback", "quiz") ?>:</B></P></TD>
<td align="right"><p><b><?php print_string("feedback", "quiz") ?>:</b></p></td>
<TD>
<td>
<textarea name="feedback[]" rows=2 cols=50 wrap="virtual"><?php p($answers[$i-1]->feedback) ?></textarea>
<textarea name="feedback[]" rows="2" cols="50" wrap="virtual"><?php p($answers[$i-1]->feedback) ?></textarea>
</TD>
</td>
</TR>
</tr>
<TR valign=top>
<tr valign="top">
<TD colspan=2>&nbsp;</TD>
<td colspan="2">&nbsp;</td>
</TR>
</tr>
@ -230,19 +230,19 @@
?>
</TABLE>
</table>
<INPUT type="hidden" name=id value="<?php p($question->id) ?>" />
<input type="hidden" name="id" value="<?php p($question->id) ?>" />
<INPUT type="hidden" name=qtype value="<?php p($question->qtype) ?>" />
<input type="hidden" name="qtype" value="<?php p($question->qtype) ?>" />
<INPUT type="submit" value="<?php print_string("savechanges") ?>" />
<input type="submit" value="<?php print_string("savechanges") ?>" />
</CENTER>
</center>
</FORM>
</form>

View file

@ -1,4 +1,4 @@
<?PHP // $Id$
<?php // $Id$
///////////////////
/// MULTICHOICE ///

View file

@ -1,4 +1,4 @@
<?PHP // $Id$
<?php // $Id$
// This will only support one answer of the type NUMERICAL
// However, lib.php has support for multiple answers

View file

@ -1,25 +1,25 @@
<FORM name="theform" method="post" action="question.php">
<CENTER>
<TABLE cellpadding=5>
<TR valign=top>
<TD align=right><P><B><?php print_string("category", "quiz") ?>:</B></P></TD>
<TD>
<form name="theform" method="post" action="question.php">
<center>
<table cellpadding="5">
<tr valign="top">
<td align="right"><p><b><?php print_string("category", "quiz") ?>:</b></p></td>
<td>
<?php quiz_category_select_menu($course->id, true, true, $question->category); ?>
</TD>
</TR>
<TR valign=top>
<TD align=right><P><B><?php print_string("questionname", "quiz") ?>:</B></P></TD>
<TD>
<INPUT type="text" name="name" size=50 value="<?php p($question->name) ?>" />
</td>
</tr>
<tr valign="top">
<td align="right"><p><b><?php print_string("questionname", "quiz") ?>:</b></p></td>
<td>
<input type="text" name="name" size="50" value="<?php p($question->name) ?>" />
<?php if (isset($err["name"])) formerr($err["name"]); ?>
</TD>
</TR>
<tr valign=top>
</td>
</tr>
<tr valign="top">
<td align="right"><p><b><?php print_string("question", "quiz") ?>:</b></p>
<br />
<br />
<br />
<p><font SIZE="1">
<p><font size="1">
<?php
if ($usehtmleditor) {
helpbutton("richtext", get_string("helprichtext"), "moodle", true, true);
@ -40,7 +40,7 @@
if ($usehtmleditor) {
echo '<input type="hidden" name="questiontextformat" value="'.FORMAT_HTML.'" />';
} else {
echo "<div align=right>";
echo "<div align=\"right\">";
print_string("formattexttype");
echo ":&nbsp;";
if (!isset($question->questiontextformat)) {
@ -53,20 +53,20 @@
?>
</td>
</tr>
<TR valign=top>
<TD align=right><P><B><?php print_string("imagedisplay", "quiz") ?>:</B></P></TD>
<TD>
<tr valign="top">
<td align="right"><p><b><?php print_string("imagedisplay", "quiz") ?>:</b></p></td>
<td>
<?php if (empty($images)) {
print_string("noimagesyet");
} else {
choose_from_menu($images, "image", "$question->image", get_string("none"),"","");
}
?>
</TD>
</TR>
</td>
</tr>
<TR valign=top>
<TD align=right><P><B><?php print_string("correctanswer", "quiz") ?>:</B></P></TD>
<tr valign="top">
<td align="right"><p><b><?php print_string("correctanswer", "quiz") ?>:</b></p></td>
<?php
// Even thou the rest of the module can handle up to six numerical answers,
// this form will limit the number of numerical answers to one only.
@ -77,69 +77,69 @@
$acceptederror = "";
}
?>
<TD>
<INPUT align="LEFT" type="text" id="correct0" name="answer[]" size="20" value="<?php p($answers[0]->answer) ?>" />&nbsp;&nbsp;
</TD>
</TR>
<TR valign=top>
<TD align=right><P><B><?php print_string("acceptederror", "quiz"); ?>:</B></P></TD>
<TD>
<INPUT align="LEFT" type="text" id="acceptederror0" name="acceptederror[]" size="15" value="<?php p($acceptederror) ?>" />&plusmn;
<td>
<input align="LEFT" type="text" id="correct0" name="answer[]" size="20" value="<?php p($answers[0]->answer) ?>" />&nbsp;&nbsp;
</td>
</tr>
<tr valign="top">
<td align="right"><p><b><?php print_string("acceptederror", "quiz"); ?>:</b></p></td>
<td>
<input align="LEFT" type="text" id="acceptederror0" name="acceptederror[]" size="15" value="<?php p($acceptederror) ?>" />&plusmn;
<!-- Values max and min will be determined when the form is submitted -->
<INPUT type="HIDDEN" id="min0" name="min[]" value="" />
<INPUT type="HIDDEN" id="max0" name="max[]" value="" />
<INPUT type="HIDDEN" name="fraction[]" value="1" />
<BR/>
</TD>
</TR>
<TR valign=top>
<TD align=right><P><B><?php print_string("feedback", "quiz") ?>:</B></P></TD>
<TD>
<textarea name="feedback[]" rows=2 cols=50 wrap="virtual"><?php p($answers[0]->feedback) ?></textarea>
</TD>
</TR>
<TR valign=top>
<TD align=right><P><B><?php print_string("unit", "quiz") ?>:</B></P></TD>
<TD>
<P><INPUT type="HIDDEN" name="multiplier[]" value="1.0" />
<INPUT align="LEFT" type="text" id="defaultunit" name="unit[]"
<input type="HIDDEN" id="min0" name="min[]" value="" />
<input type="HIDDEN" id="max0" name="max[]" value="" />
<input type="HIDDEN" name="fraction[]" value="1" />
<br/>
</td>
</tr>
<tr valign="top">
<td align="right"><p><b><?php print_string("feedback", "quiz") ?>:</b></p></td>
<td>
<textarea name="feedback[]" rows="2" cols="50" wrap="virtual"><?php p($answers[0]->feedback) ?></textarea>
</td>
</tr>
<tr valign="top">
<td align="right"><p><b><?php print_string("unit", "quiz") ?>:</b></p></td>
<td>
<p><input type="HIDDEN" name="multiplier[]" value="1.0" />
<input align="LEFT" type="text" id="defaultunit" name="unit[]"
size="5" value="<?php p($units[0]->unit) ?>" />
<B>(<?php print_string("optional", "quiz") ?>)</B></P>
</TD>
</TR>
<TR valign=top>
<b>(<?php print_string("optional", "quiz") ?>)</b></p>
</td>
</tr>
<tr valign="top">
<td></td>
<TD align=left><P><B><?php print_string("alternativeunits", "quiz") ?>:</B></P></TD>
<td align="left"><p><b><?php print_string("alternativeunits", "quiz") ?>:</b></p></td>
<td></td>
</TR>
<?PHP
</tr>
<?php
for ($i=1; $i<count($units); $i++) {
$unit=$units[$i];
?>
<TR valign=top>
<tr valign="top">
<td></td>
<TD align=left>
<P><B><?php print_string("multiplier", "quiz") ?>:</B>
<INPUT type="text" id="<?php p("multiplier$i") ?>" size="10"
<td align="left">
<p><b><?php print_string("multiplier", "quiz") ?>:</b>
<input type="text" id="<?php p("multiplier$i") ?>" size="10"
align="RIGHT" name="multiplier[]"
value="<?php p($unit->multiplier) ?>" />
<B>&nbsp;&nbsp;&nbsp;<?php print_string("unit", "quiz") ?>:</B>
<INPUT align="LEFT" type="text" id="<?php p("unit$i") ?>"
<b>&nbsp;&nbsp;&nbsp;<?php print_string("unit", "quiz") ?>:</b>
<input align="LEFT" type="text" id="<?php p("unit$i") ?>"
name="unit[]"
size="5" value="<?php p($unit->unit) ?>" /></P>
</TD>
</TR>
<?PHP
size="5" value="<?php p($unit->unit) ?>" /></p>
</td>
</tr>
<?php
} /// END for
?>
</TABLE>
</table>
<INPUT type="hidden" name=id value="<?php p($question->id) ?>" />
<INPUT type="hidden" name=qtype value="<?php p($question->qtype) ?>" />
<INPUT type="submit" onClick="return determineMinAndMax();" value="<?php print_string("savechanges") ?>" />
</CENTER>
</FORM>
<SCRIPT language="JAVASCRIPT">
<input type="hidden" name="id" value="<?php p($question->id) ?>" />
<input type="hidden" name="qtype" value="<?php p($question->qtype) ?>" />
<input type="submit" onClick="return determineMinAndMax();" value="<?php print_string("savechanges") ?>" />
</center>
</form>
<script language="JAVASCRIPT">
function determineMinAndMax() {
// This client-side script will determine the values for min and max
// based on the input for answer and acceptederror.
@ -174,4 +174,4 @@ function determineMinAndMax() {
}
}
}
</SCRIPT>
</script>

View file

@ -1,4 +1,4 @@
<?PHP // $Id$
<?php // $Id$
/////////////////
/// NUMERICAL ///

View file

@ -1,4 +1,4 @@
<?PHP // $Id$
<?php // $Id$
print_heading_with_help(get_string("editingrandom", "quiz"), "random", "quiz");
require("random.html");

View file

@ -1,4 +1,4 @@
<?PHP // $Id$
<?php // $Id$
//////////////
/// RANDOM ///

View file

@ -4,11 +4,11 @@
<table cellpadding=5>
<table cellpadding="5">
<tr valign=top>
<tr valign="top">
<td align=right><P><B><?php print_string("category", "quiz") ?>:</B></P></TD>
<td align="right"><p><b><?php print_string("category", "quiz") ?>:</b></p></td>
<td>
@ -18,9 +18,9 @@
</tr>
<tr valign=top>
<tr valign="top">
<td align=right><P><B><?php print_string("questionname", "quiz") ?>:</B></P></TD>
<td align="right"><p><b><?php print_string("questionname", "quiz") ?>:</b></p></td>
<td>
@ -30,7 +30,7 @@
} ?>
<input type="text" name="name" size=40 value="<?php p($question->name) ?>" />
<input type="text" name="name" size="40" value="<?php p($question->name) ?>" />
<?php if (isset($err["name"])) formerr($err["name"]); ?>
@ -42,13 +42,13 @@
<input type="hidden" name=questiontext value="---" />
<input type="hidden" name="questiontext" value="---" />
<input type="hidden" name=id value="<?php p($question->id) ?>" />
<input type="hidden" name="id" value="<?php p($question->id) ?>" />
<input type="hidden" name=qtype value="<?php p($question->qtype) ?>" />
<input type="hidden" name="qtype" value="<?php p($question->qtype) ?>" />
<input type="submit" value="<?php print_string("savechanges") ?>" />

View file

@ -1,4 +1,4 @@
<?PHP // $Id$
<?php // $Id$
if (!empty($question->id)) {
$options = get_record("quiz_randomsamatch", "question", $question->id);
} else {

View file

@ -1,4 +1,4 @@
<?PHP // $Id$
<?php // $Id$
/////////////////////
/// RANDOMSAMATCH ///

View file

@ -1,30 +1,30 @@
<FORM name="theform" method="post" action="question.php">
<form name="theform" method="post" action="question.php">
<CENTER>
<center>
<TABLE cellpadding=5>
<table cellpadding="5">
<TR valign=top>
<tr valign="top">
<TD align=right><P><B><?php print_string("category", "quiz") ?>:</B></P></TD>
<td align="right"><p><b><?php print_string("category", "quiz") ?>:</b></p></td>
<TD>
<td>
<?PHP echo $categories[$question->category]; ?>
<?php echo $categories[$question->category]; ?>
<input type="hidden" name="category" value="<?PHP echo "$question->category"; ?>" />
<input type="hidden" name="category" value="<?php echo "$question->category"; ?>" />
</TD>
</td>
</TR>
</tr>
<TR valign=top>
<tr valign="top">
<TD align=right><P><B><?php print_string("questionname", "quiz") ?>:</B></P></TD>
<td align="right"><p><b><?php print_string("questionname", "quiz") ?>:</b></p></td>
<TD>
<td>
<?PHP
<?php
if (empty($question->name)) {
@ -34,21 +34,21 @@
?>
<INPUT type="text" name="name" size=40 value="<?php p($question->name) ?>" />
<input type="text" name="name" size="40" value="<?php p($question->name) ?>" />
<?php if (isset($err["name"])) formerr($err["name"]); ?>
</TD>
</td>
</TR>
</tr>
<tr valign=top>
<tr valign="top">
<td align=right><p><b><?php print_string("introduction", "quiz") ?>:</b></p>
<td align="right"><p><b><?php print_string("introduction", "quiz") ?>:</b></p>
<br />
<p><font SIZE="1">
<p><font size="1">
<?php
@ -96,7 +96,7 @@
} else {
echo "<div align=right>";
echo "<div align="right">";
print_string("formattexttype");
@ -122,11 +122,11 @@
</tr>
<TR valign=top>
<tr valign="top">
<TD align=right><P><B><?php print_string("randomsamatchnumber", "quiz") ?>:</B></P></TD>
<td align="right"><p><b><?php print_string("randomsamatchnumber", "quiz") ?>:</b></p></td>
<TD>
<td>
<?php
@ -160,23 +160,23 @@
?>
</TD>
</td>
</TR>
</tr>
</TABLE>
</table>
<INPUT type="hidden" name=id value="<?php p($question->id) ?>" />
<input type="hidden" name="id" value="<?php p($question->id) ?>" />
<INPUT type="hidden" name=qtype value="<?php p($question->qtype) ?>" />
<input type="hidden" name="qtype" value="<?php p($question->qtype) ?>" />
<INPUT type="submit" value="<?php print_string("savechanges") ?>" />
<input type="submit" value="<?php print_string("savechanges") ?>" />
</CENTER>
</center>
</FORM>
</form>

View file

@ -1,4 +1,4 @@
<?PHP // $Id$
<?php // $Id$
if (!empty($question->id)) {
$options = get_record("quiz_shortanswer", "question", $question->id);
} else {
@ -7,7 +7,7 @@
if (!empty($options->answers)) {
$answersraw = get_records_list("quiz_answers", "id", $options->answers);
}
for ($i=0; $i<QUIZ_MAX_NUMBER_ANSWERS; $i++) {
for ($i=0; $i<quiz_MAX_NUMBER_ANSWERS; $i++) {
$answers[] = ""; // Make answer slots, default as blank
}
if (!empty($answersraw)) {

View file

@ -1,4 +1,4 @@
<?PHP // $Id$
<?php // $Id$
///////////////////
/// SHORTANSWER ///

View file

@ -1,36 +1,36 @@
<FORM name="theform" method="post" action="question.php">
<form name="theform" method="post" action="question.php">
<CENTER>
<center>
<TABLE cellpadding=5>
<table cellpadding="5">
<TR valign=top>
<tr valign="top">
<TD align=right><P><B><?php print_string("category", "quiz") ?>:</B></P></TD>
<td align="right"><p><b><?php print_string("category", "quiz") ?>:</b></p></td>
<TD>
<td>
<?php quiz_category_select_menu($course->id, true, true, $question->category); ?>
</TD>
</td>
</TR>
</tr>
<TR valign=top>
<tr valign="top">
<TD align=right><P><B><?php print_string("questionname", "quiz") ?>:</B></P></TD>
<td align="right"><p><b><?php print_string("questionname", "quiz") ?>:</b></p></td>
<TD>
<td>
<INPUT type="text" name="name" size=50 value="<?php p($question->name) ?>" />
<input type="text" name="name" size="50" value="<?php p($question->name) ?>" />
<?php if (isset($err["name"])) formerr($err["name"]); ?>
</TD>
</td>
</TR>
</tr>
<tr valign=top>
<tr valign="top">
<td align="right"><p><b><?php print_string("question", "quiz") ?>:</b></p>
@ -40,7 +40,7 @@
<br />
<p><font SIZE="1">
<p><font size="1">
<?php
@ -82,7 +82,7 @@
} else {
echo "<div align=right>";
echo "<div align=\"right\">";
print_string("formattexttype");
@ -108,11 +108,11 @@
</tr>
<TR valign=top>
<tr valign="top">
<TD align=right><P><B><?php print_string("imagedisplay", "quiz") ?>:</B></P></TD>
<td align="right"><p><b><?php print_string("imagedisplay", "quiz") ?>:</b></p></td>
<TD>
<td>
<?php if (empty($images)) {
@ -126,15 +126,15 @@
?>
</TD>
</td>
</TR>
</tr>
<TR valign=top>
<tr valign="top">
<TD align=right><P><B><?php print_string("casesensitive", "quiz") ?>:</B></P></TD>
<td align="right"><p><b><?php print_string("casesensitive", "quiz") ?>:</b></p></td>
<TD>
<td>
<?php
@ -148,25 +148,25 @@
?>
</TD>
</td>
</TR>
</tr>
<TR valign=top>
<tr valign="top">
<TD align=right><P><B><?php print_string("correctanswers", "quiz") ?></B>:</P></TD>
<td align="right"><p><b><?php print_string("correctanswers", "quiz") ?></b>:</p></td>
<TD>
<td>
<P><?php print_string("filloutoneanswer", "quiz") ?></P>
<p><?php print_string("filloutoneanswer", "quiz") ?></p>
</TD>
</td>
<?PHP
<?php
for ($i=1; $i<=QUIZ_MAX_NUMBER_ANSWERS; $i++) {
@ -174,13 +174,13 @@
<TR valign=top>
<tr valign="top">
<TD align=right><P><B><?php echo get_string("answer", "quiz")." $i"; ?>:</B></P></TD>
<td align="right"><p><b><?php echo get_string("answer", "quiz")." $i"; ?>:</b></p></td>
<TD>
<td>
<INPUT type="text" name="answer[]" size=50 value="<?php p($answers[$i-1]->answer) ?>" />&nbsp;&nbsp;
<input type="text" name="answer[]" size="50" value="<?php p($answers[$i-1]->answer) ?>" />&nbsp;&nbsp;
<?php print_string("grade");
@ -188,35 +188,35 @@
choose_from_menu($gradeoptions, "fraction[]", $answers[$i-1]->fraction,""); ?>
<BR>
<br>
</TD>
</td>
</TR>
</tr>
<TR valign=top>
<tr valign="top">
<TD align=right><P><B><?php print_string("feedback", "quiz") ?>:</B></P></TD>
<td align="right"><p><b><?php print_string("feedback", "quiz") ?>:</b></p></td>
<TD>
<td>
<textarea name="feedback[]" rows=2 cols=50 wrap="virtual"><?php p($answers[$i-1]->feedback) ?></textarea>
<textarea name="feedback[]" rows="2" cols="50" wrap="virtual"><?php p($answers[$i-1]->feedback) ?></textarea>
</TD>
</td>
</TR>
</tr>
<TR valign=top>
<tr valign="top">
<TD colspan=2>&nbsp;</TD>
<td colspan="2">&nbsp;</td>
</TR>
</tr>
<?PHP
<?php
}
@ -224,19 +224,19 @@
</TABLE>
</table>
<INPUT type="hidden" name=id value="<?php p($question->id) ?>" />
<input type="hidden" name="id" value="<?php p($question->id) ?>" />
<INPUT type="hidden" name=qtype value="<?php p($question->qtype) ?>" />
<input type="hidden" name="qtype" value="<?php p($question->qtype) ?>" />
<INPUT type="submit" value="<?php print_string("savechanges") ?>" />
<input type="submit" value="<?php print_string("savechanges") ?>" />
</CENTER>
</center>
</FORM>
</form>

View file

@ -1,4 +1,4 @@
<?PHP // $Id$
<?php // $Id$
if (!empty($question->id)) {
$options = get_record("quiz_truefalse", "question", "$question->id");

View file

@ -1,4 +1,4 @@
<?PHP // $Id$
<?php // $Id$
/////////////////
/// TRUEFALSE ///
@ -142,7 +142,7 @@ class quiz_truefalse_qtype extends quiz_default_questiontype {
echo "<input $truechecked type=\"radio\" $readonly $inputname value=\"$true->id\" />$true->answer";
echo "</td><td $falsecorrect>";
echo "<input $falsechecked type=\"radio\" $readonly $inputname value=\"$false->id\" />$false->answer";
echo "</td></tr></table><br clear=\"all\">";// changed from CLEAR=ALL jm
echo "</td></tr></table><br clear=\"all\">";// changed from clear=ALL jm
if ($quiz->feedback && isset($answers[$nameprefix])
&& $feedback = $answers[$nameprefix]->feedback) {
quiz_print_comment(

View file

@ -1,36 +1,36 @@
<FORM name="theform" method="post" action="question.php">
<form name="theform" method="post" action="question.php">
<CENTER>
<center>
<TABLE cellpadding=5>
<table cellpadding="5">
<TR valign=top>
<tr valign="top">
<TD align=right><P><B><?php print_string("category", "quiz") ?>:</B></P></TD>
<td align="right"><p><b><?php print_string("category", "quiz") ?>:</b></p></td>
<TD>
<td>
<?php quiz_category_select_menu($course->id, true, true, $question->category); ?>
</TD>
</td>
</TR>
</tr>
<TR valign=top>
<tr valign="top">
<TD align=right><P><B><?php print_string("questionname", "quiz") ?>:</B></P></TD>
<td align="right"><p><b><?php print_string("questionname", "quiz") ?>:</b></p></td>
<TD>
<td>
<INPUT type="text" name="name" size=50 value="<?php p($question->name) ?>" />
<input type="text" name="name" size="50" value="<?php p($question->name) ?>" />
<?php if (isset($err["name"])) formerr($err["name"]); ?>
</TD>
</td>
</TR>
</tr>
<tr valign=top>
<tr valign="top">
<td align="right"><p><b><?php print_string("question", "quiz") ?>:</b></p>
@ -40,7 +40,7 @@
<br />
<p><font SIZE="1">
<p><font size="1">
<?php
@ -82,7 +82,7 @@
} else {
echo "<div align=right>";
echo "<div align=\"right\">";
print_string("formattexttype");
@ -108,11 +108,11 @@
</tr>
<TR valign=top>
<tr valign="top">
<TD align=right><P><B><?php print_string("imagedisplay", "quiz") ?>:</B></P></TD>
<td align="right"><p><b><?php print_string("imagedisplay", "quiz") ?>:</b></p></td>
<TD>
<td>
<?php if (empty($images)) {
@ -126,17 +126,17 @@
?>
</TD>
</td>
</TR>
</tr>
<TR valign=top>
<tr valign="top">
<TD align=right><P><B><?php print_string("correctanswer", "quiz") ?>:</B></P></TD>
<td align="right"><p><b><?php print_string("correctanswer", "quiz") ?>:</b></p></td>
<TD>
<td>
<?php $menu[0] = get_string("false", "quiz");
@ -144,49 +144,49 @@
choose_from_menu($menu, "answer", "$question->answer", ""); ?>
<BR>
<br>
</TD>
</td>
</TR>
</tr>
<TR valign=top>
<tr valign="top">
<TD align=right><P><B><?php print_string("feedback", "quiz") ?> (<?php print_string("true", "quiz") ?>):</B></P></TD>
<td align="right"><p><b><?php print_string("feedback", "quiz") ?> (<?php print_string("true", "quiz") ?>):</b></p></td>
<TD>
<td>
<textarea name="feedbacktrue" rows=2 cols=50 wrap="virtual"><?php p($true->feedback) ?></textarea>
<textarea name="feedbacktrue" rows="2" cols="50" wrap="virtual"><?php p($true->feedback) ?></textarea>
</TD>
</td>
</TR>
</tr>
<TR valign=top>
<tr valign="top">
<TD align=right><P><B><?php print_string("feedback", "quiz") ?> (<?php print_string("false", "quiz") ?>):</B></P></TD>
<td align="right"><p><b><?php print_string("feedback", "quiz") ?> (<?php print_string("false", "quiz") ?>):</b></p></td>
<TD>
<td>
<textarea name="feedbackfalse" rows=2 cols=50 wrap="virtual"><?php p($false->feedback) ?></textarea>
<textarea name="feedbackfalse" rows="2" cols="50" wrap="virtual"><?php p($false->feedback) ?></textarea>
</TD>
</td>
</TR>
</tr>
</TABLE>
</table>
<INPUT type="hidden" name=id value="<?php p($question->id) ?>" />
<input type="hidden" name="id" value="<?php p($question->id) ?>" />
<INPUT type="hidden" name=qtype value="<?php p($question->qtype) ?>" />
<input type="hidden" name="qtype" value="<?php p($question->qtype) ?>" />
<INPUT type="submit" value="<?php print_string("savechanges") ?>" />
<input type="submit" value="<?php print_string("savechanges") ?>" />
</CENTER>
</center>
</FORM>
</form>