From a8449f8c71df80c9e798f3ec81953e7cabbe8830 Mon Sep 17 00:00:00 2001 From: moodler Date: Mon, 23 Aug 2004 12:29:29 +0000 Subject: [PATCH] MOre tolerant of empty fields, and fixed heading --- mod/quiz/edit.php | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/mod/quiz/edit.php b/mod/quiz/edit.php index 1422210cc3..a52da9bb40 100644 --- a/mod/quiz/edit.php +++ b/mod/quiz/edit.php @@ -15,8 +15,14 @@ if ($modform and !empty($modform->course)) { // form submitted from mod.html - if (empty($modform->name) or empty($modform->intro)) { - error(get_string("filloutallfields"), $_SERVER["HTTP_REFERER"]); + $modform->name = trim($modform->name); + + if (empty($modform->name)) { + if (empty($modform->intro)) { + $modform->name = get_string('modulename', 'quiz'); + } else { + $modform->name = strip_tags($modform->intro); + } } $SESSION->modform = $modform; // Save the form in the current session @@ -164,7 +170,7 @@ $strediting = get_string(isset($modform->instance) ? "editingquiz" : "editquestions", "quiz"); $strheading = empty($modform->name) ? $strediting : $modform->name; - print_header_simple("$strediting", "$strheading", + print_header_simple($strediting, '', "wwwroot/mod/quiz/index.php?id=$course->id\">$strquizzes -> $strediting"); // Print basic page layout. -- 2.39.5