mirror of
https://github.com/moodle/moodle.git
synced 2025-01-22 08:11:26 +01:00
157 lines
5.0 KiB
HTML
157 lines
5.0 KiB
HTML
<?PHP
|
|
if (empty($form->name)) {
|
|
$form->name = "";
|
|
}
|
|
if (empty($form->text)) {
|
|
$form->text = "";
|
|
}
|
|
if (empty($form->format)) {
|
|
$form->format = "";
|
|
}
|
|
if (empty($form->answer1)) {
|
|
$form->answer1 = get_string("yes");
|
|
}
|
|
if (empty($form->answer2)) {
|
|
$form->answer2 = get_string("no");
|
|
}
|
|
if (empty($form->answer3)) {
|
|
$form->answer3 = "";
|
|
}
|
|
if (empty($form->answer4)) {
|
|
$form->answer4 = "";
|
|
}
|
|
if (empty($form->answer5)) {
|
|
$form->answer5 = "";
|
|
}
|
|
if (empty($form->answer6)) {
|
|
$form->answer6 = "";
|
|
}
|
|
if (empty($form->publish)) {
|
|
$form->publish = "";
|
|
}
|
|
|
|
if ($usehtmleditor = can_use_richtext_editor()) {
|
|
$defaultformat = FORMAT_HTML;
|
|
$onsubmit = "onsubmit=\"copyrichtext(document.form.text);\"";
|
|
} else {
|
|
$defaultformat = FORMAT_MOODLE;
|
|
$onsubmit = "";
|
|
}
|
|
|
|
?>
|
|
<form name="form" method="post" <?=$onsubmit ?> action="<?=$ME ?>">
|
|
|
|
<table cellpadding=5>
|
|
|
|
<tr valign=top>
|
|
<td align=right><P><B><? print_string("choicename","choice") ?>:</B></P></TD>
|
|
<td>
|
|
<input type="text" name="name" size=30 value="<? p($form->name) ?>">
|
|
</td>
|
|
</tr>
|
|
|
|
<tr valign=top>
|
|
<td align=right><P><B><? print_string("choicetext","choice") ?>:</B></P>
|
|
<font SIZE="1">
|
|
<? helpbutton("writing", get_string("helpwriting"), "moodle", true, true) ?><br \>
|
|
<? helpbutton("questions", get_string("helpquestions"), "moodle", true, true) ?><br \>
|
|
<? if ($usehtmleditor) { ?>
|
|
<? helpbutton("richtext", get_string("helprichtext"), "moodle", true, true) ?>
|
|
<? } else { ?>
|
|
<? helpbutton("text", get_string("helptext"), "moodle", true, true) ?>
|
|
<? } ?><br \>
|
|
</font>
|
|
</td>
|
|
<td>
|
|
<?
|
|
print_textarea($usehtmleditor, 20, 60, 680, 400, "text", $form->text);
|
|
|
|
echo "<P align=right>";
|
|
print_string("formattexttype");
|
|
echo ": ";
|
|
if (!$form->format) {
|
|
$form->format = $defaultformat;
|
|
}
|
|
choose_from_menu(format_text_menu(), "format", $form->format, "");
|
|
helpbutton("textformat", get_string("formattexttype"));
|
|
echo "</P>";
|
|
?>
|
|
</td>
|
|
</tr>
|
|
|
|
<tr valign=top>
|
|
<td align=right><P><B><? print_string("choice","choice","1") ?>:</B></P></TD>
|
|
<td>
|
|
<input type="text" name="answer1" size=60 value="<? p($form->answer1) ?>">
|
|
<? helpbutton("options", get_string("modulenameplural", "choice"), "choice") ?>
|
|
</td>
|
|
</tr>
|
|
|
|
<tr valign=top>
|
|
<td align=right><P><B><? print_string("choice","choice","2") ?>:</B></P></TD>
|
|
<td>
|
|
<input type="text" name="answer2" size=60 value="<? p($form->answer2) ?>">
|
|
<? helpbutton("options", get_string("modulenameplural", "choice"), "choice") ?>
|
|
</td>
|
|
</tr>
|
|
|
|
<tr valign=top>
|
|
<td align=right><P><B><? print_string("choice","choice","3") ?>:</B></P></TD>
|
|
<td>
|
|
<input type="text" name="answer3" size=60 value="<? p($form->answer3) ?>">
|
|
<? helpbutton("options", get_string("modulenameplural", "choice"), "choice") ?>
|
|
</td>
|
|
</tr>
|
|
<tr valign=top>
|
|
<td align=right><P><B><? print_string("choice","choice","4") ?>:</B></P></TD>
|
|
<td>
|
|
<input type="text" name="answer4" size=60 value="<? p($form->answer4) ?>">
|
|
<? helpbutton("options", get_string("modulenameplural", "choice"), "choice") ?>
|
|
</td>
|
|
</tr>
|
|
<tr valign=top>
|
|
<td align=right><P><B><? print_string("choice","choice","5") ?>:</B></P></TD>
|
|
<td>
|
|
<input type="text" name="answer5" size=60 value="<? p($form->answer5) ?>">
|
|
<? helpbutton("options", get_string("modulenameplural", "choice"), "choice") ?>
|
|
</td>
|
|
</tr>
|
|
<tr valign=top>
|
|
<td align=right><P><B><? print_string("choice","choice","6") ?>:</B></P></TD>
|
|
<td>
|
|
<input type="text" name="answer6" size=60 value="<? p($form->answer6) ?>">
|
|
<? helpbutton("options", get_string("modulenameplural", "choice"), "choice") ?>
|
|
</td>
|
|
</tr>
|
|
<tr valign=top>
|
|
<td align=right><P><B><? print_string("publish","choice") ?>:</b></p></td>
|
|
<td>
|
|
<?
|
|
require("$CFG->dirroot/mod/choice/lib.php");
|
|
choose_from_menu($CHOICE_PUBLISH, "publish", "$form->publish", "");
|
|
?>
|
|
<br \>
|
|
</td>
|
|
</tr>
|
|
|
|
</table>
|
|
|
|
<CENTER>
|
|
<input type="hidden" name=course value="<? p($form->course) ?>">
|
|
<input type="hidden" name=coursemodule value="<? p($form->coursemodule) ?>">
|
|
<input type="hidden" name=section value="<? p($form->section) ?>">
|
|
<input type="hidden" name=module value="<? p($form->module) ?>">
|
|
<input type="hidden" name=modulename value="<? p($form->modulename) ?>">
|
|
<input type="hidden" name=instance value="<? p($form->instance) ?>">
|
|
<input type="hidden" name=mode value="<? p($form->mode) ?>">
|
|
<input type="submit" value="<? print_string("savechanges") ?>">
|
|
<input type="submit" name=cancel value="<? print_string("cancel") ?>">
|
|
</CENTER>
|
|
</FORM>
|
|
|
|
<?PHP
|
|
if ($usehtmleditor) {
|
|
print_richedit_javascript("form", "text", "yes");
|
|
}
|
|
?>
|