moodle/mod/survey/details.php

81 lines
3.2 KiB
PHP
Raw Normal View History

<?php // $Id$
2001-11-22 06:23:56 +00:00
require_once("../../config.php");
2001-11-22 06:23:56 +00:00
if ($form = data_submitted($destination)) {
2001-11-22 06:23:56 +00:00
if (! $course = get_record("course", "id", $form->course)) {
error("This course doesn't exist");
}
require_login($course->id);
if (!isteacher($course->id)) {
error("You can't modify this course!");
}
2002-08-12 17:54:13 +00:00
$streditingasurvey = get_string("editingasurvey", "survey");
2004-02-20 16:03:05 +00:00
$strsurveys = get_string("modulenameplural", "survey");
2002-08-12 17:54:13 +00:00
print_header_simple("$streditingasurvey", "",
"<a href=\"index.php?id=$course->id\">$strsurveys</a>".
2004-02-20 16:03:05 +00:00
" -> $form->name ($streditingasurvey)");
2002-08-12 17:54:13 +00:00
if (!$form->name or !$form->template) {
error(get_string("filloutallfields"), $_SERVER["HTTP_REFERER"]);
2002-08-12 17:54:13 +00:00
}
2001-11-22 06:23:56 +00:00
print_simple_box_start("center", "", "$THEME->cellheading");
?>
<form name="form" method="post" action="<?php p($form->destination)?>">
<table cellpadding="5" align="center">
<tr><td align="right" nowrap="nowrap"><b><?php print_string("name") ?>:</b></td>
<td><?php p($form->name) ?></a></td></tr>
2001-11-22 06:23:56 +00:00
<tr valign="top">
<td align="right" nowrap="nowrap">
<b><?php print_string("introtext", "survey") ?>:</b><br />
2003-05-20 08:01:40 +00:00
<font size="1">
<?php helpbutton("writing", get_string("helpwriting"), "moodle", true, true) ?> <br />
<?php helpbutton("text", get_string("helptext"), "moodle", true, true) ?> <br />
<?php emoticonhelpbutton("form", "intro"); ?> <br />
2002-12-23 05:57:05 +00:00
</font>
2003-05-20 08:01:40 +00:00
</td>
<td>
<textarea name="intro" rows="20" cols="50" wrap="virtual"><?php
2001-11-22 06:23:56 +00:00
if ($form->intro) {
p($form->intro);
} else {
$form->intro = get_field("survey", "intro", "id", $form->template);
$form->intro = get_string($form->intro, "survey");
p($form->intro);
2001-11-22 06:23:56 +00:00
}
2003-05-20 08:01:40 +00:00
?></textarea>
</td>
</tr>
</table>
<input type="hidden" name="name" value="<?php p($form->name) ?>" />
<input type="hidden" name="template" value="<?php p($form->template) ?>" />
2001-11-22 06:23:56 +00:00
<input type="hidden" name="course" value="<?php p($form->course) ?>" />
2005-01-22 18:53:44 +00:00
<input type="hidden" name="sesskey" value="<?php p($form->sesskey) ?>" />
<input type="hidden" name="coursemodule" value="<?php p($form->coursemodule) ?>" />
2005-01-22 18:53:44 +00:00
<input type="hidden" name="section" value="<?php p($form->section) ?>" />
<input type="hidden" name="module" value="<?php p($form->module) ?>" />
<input type="hidden" name="modulename" value="<?php p($form->modulename) ?>" />
<input type="hidden" name="instance" value="<?php p($form->instance) ?>" />
<input type="hidden" name="mode" value="<?php p($form->mode) ?>" />
2003-05-20 08:01:40 +00:00
<center>
2004-09-12 14:41:49 +00:00
<input type="submit" value="<?php print_string("savechanges") ?>" />
2003-05-20 08:01:40 +00:00
</center>
</form>
<?php
2001-11-22 06:23:56 +00:00
print_simple_box_end();
print_footer($course);
2002-08-12 17:54:13 +00:00
} else {
error("You can't use this page like that!");
2001-11-22 06:23:56 +00:00
}
?>