]> git.mjollnir.org Git - moodle.git/commitdiff
Putting the "Save as new question" button back.
authorgustav_delius <gustav_delius>
Wed, 22 Mar 2006 22:37:27 +0000 (22:37 +0000)
committergustav_delius <gustav_delius>
Wed, 22 Mar 2006 22:37:27 +0000 (22:37 +0000)
question/question.php
question/questiontypes/questiontype.php

index 87e30673a3db002f9542f2b445102e774e00930a..63f8fad38e99beec007128c67a9e18751bc34433 100644 (file)
         } else {
             // use the old code which simply overwrites old versions
             // 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);
             $replaceinquiz = 'all';
         }
index d246d0d1d76564fc14b411c9e44c9f027dea0606..a84b45f42521f813b6bad6b0225eeaf789ab7140 100644 (file)
@@ -966,8 +966,7 @@ class default_questiontype {
               <td colspan="2" align="center">
               <input type="submit" '.$submitscript.' value="'.get_string('savechanges').'" /> ';
         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").'" />
               <input type="hidden" name="sesskey" value="'.$USER->sesskey.'" />