It is now possible to base new questions on existing ones, see get_string('editingquestion', 'quiz');

This commit is contained in:
gustav_delius
2005-01-19 09:50:33 +00:00
parent 08bcdcbea2
commit ef0921d1ff
4 changed files with 17 additions and 3 deletions
+2
View File
@@ -53,6 +53,8 @@ $string['choices'] = 'Available choices';
$string['choosedatasetproperties'] = 'Choose dataset properties';
$string['close'] = 'Close preview';
$string['confirmstartattempt'] = 'The Quiz has a time limit. Are you sure that you wish to start?';
$string['copyingfrom'] = 'Creating a copy of the question \'$a\'';
$string['copyingquestion'] = 'Copying a question';
$string['correctanswer'] = 'Correct answer';
$string['correctanswerformula'] = 'Correct Answer Formula';
$string['correctanswerlength'] = 'Significant Figures';
+4 -1
View File
@@ -1197,6 +1197,7 @@ function quiz_print_cat_question_list($categoryid, $quizselected=true, $recurse=
$strquestionname = get_string("questionname", "quiz");
$strdelete = get_string("delete");
$stredit = get_string("edit");
$strcopy = get_string("copy");
$straddselectedtoquiz = get_string("addselectedtoquiz", "quiz");
$strtype = get_string("type", "quiz");
$strcreatemultiple = get_string("createmultiple", "quiz");
@@ -1296,7 +1297,9 @@ function quiz_print_cat_question_list($categoryid, $quizselected=true, $recurse=
echo "<a title=\"$strpreview\" href=\"#\" onClick=\"openpopup('/mod/quiz/preview.php?id=$question->id','$strpreview','scrollbars=yes,resizable=yes,width=700,height=480', false)\"><img
src=\"../../pix/t/preview.gif\" border=\"0\" alt=\"$strpreview\" /></a>&nbsp;";
echo "<a title=\"$stredit\" href=\"question.php?id=$question->id\"><img
src=\"../../pix/t/edit.gif\" border=\"0\" alt=\"$stredit\" /></a>";
src=\"../../pix/t/edit.gif\" border=\"0\" alt=\"$stredit\" /></a>&nbsp;";
echo "<a title=\"$strcopy\" href=\"question.php?id=$question->id&amp;copy=true\"><img
src=\"../../pix/t/copy.gif\" border=\"0\" alt=\"$strcopy\" /></a>";
echo "</td>\n";
}
echo "</tr>\n";
+11 -2
View File
@@ -9,6 +9,8 @@
optional_variable($qtype);
optional_variable($category);
optional_variable($copy, false); // true if a copy of the question should be created
if ($id) {
if (! $question = get_record("quiz_questions", "id", $id)) {
@@ -55,7 +57,7 @@
}
$strquizzes = get_string('modulenameplural', 'quiz');
$streditingquestion = get_string('editingquestion', 'quiz');
$streditingquestion = ($copy) ? get_string('copyingquestion', 'quiz') : get_string('editingquestion', 'quiz');
if (isset($SESSION->modform->instance)) {
$strediting = '<a href="edit.php">'.get_string('editingquiz', 'quiz').'</a> -> '.
$streditingquestion;
@@ -64,7 +66,7 @@
get_string("editquestions", "quiz").'</a> -> '.$streditingquestion;
}
print_header_simple("$streditingquestion", "$streditingquestion",
print_header_simple("$streditingquestion", "",
"<a href=\"$CFG->wwwroot/mod/quiz/index.php?id=$course->id\">$strquizzes</a>".
" -> ".$strediting);
@@ -177,6 +179,13 @@
} else {
$defaultformat = FORMAT_MOODLE;
}
if ($copy) {
print_heading(get_string('copyingfrom', 'quiz', $question->name));
// clear question id so that the data is saved to a new question
$question->id = '';
$question->name .= '_copy';
}
require('questiontypes/'.$QUIZ_QTYPES[$qtype]->name().'/editquestion.php');
BIN
View File
Binary file not shown.

After

Width:  |  Height:  |  Size: 869 B