Putting the "Save as new question" button back.

This commit is contained in:
gustav_delius 2006-03-22 22:37:27 +00:00
parent 6dfc23760f
commit 76de2cdf1a
2 changed files with 6 additions and 2 deletions

View File

@ -274,6 +274,11 @@
} else { } else {
// use the old code which simply overwrites old versions // use the old code which simply overwrites old versions
// it is also used for creating new questions // it is also used for creating new questions
if (isset($form->makecopy)) {
$question->hidden = 0; // explicitly requested copies should be unhidden
$question->id = 0; // This will prompt save_question to create a new question
}
$question = $QTYPES[$qtype]->save_question($question, $form, $course); $question = $QTYPES[$qtype]->save_question($question, $form, $course);
$replaceinquiz = 'all'; $replaceinquiz = 'all';
} }

View File

@ -966,8 +966,7 @@ class default_questiontype {
<td colspan="2" align="center"> <td colspan="2" align="center">
<input type="submit" '.$submitscript.' value="'.get_string('savechanges').'" /> '; <input type="submit" '.$submitscript.' value="'.get_string('savechanges').'" /> ';
if ($question->id) { if ($question->id) {
// Switched off until bug 3445 is fixed echo '<input type="submit" name="makecopy" '.$submitscript.' value="'.get_string("makecopy", "quiz").'" /> ';
// echo '<input type="submit" name="makecopy" '.$submitscript.' value="'.get_string("makecopy", "quiz").'" /> ';
} }
echo '<input type="submit" name="cancel" value="'.get_string("cancel").'" /> echo '<input type="submit" name="cancel" value="'.get_string("cancel").'" />
<input type="hidden" name="sesskey" value="'.$USER->sesskey.'" /> <input type="hidden" name="sesskey" value="'.$USER->sesskey.'" />