Skip to content

Commit

Permalink
MDL-12286 - 'Save as new question' button ignores the setting in the …
Browse files Browse the repository at this point in the history
…'Save in category' dropdown. Merged from MOODLE_19_STABLE.
  • Loading branch information
tjhunt committed Nov 20, 2007
1 parent 71e1975 commit 75082bd
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion question/type/questiontype.php
Expand Up @@ -285,8 +285,17 @@ function save_question($question, $form, $course) {
error('Could not update question!');
}
} else { // Question is a new one
if (isset($form->categorymoveto)){
// Doing save as new question, and we have move rights.
list($question->category, $notused) = explode(',', $form->categorymoveto);
//don't need to test add permission of category we are moving question to.
//Only categories that we have permission to add
//a question to will get through the form cleaning code for the select box.
} else {
// Really a new question.
list($question->category, $notused) = explode(',', $form->category);
}
// Set the unique code
list($question->category,$notused) = explode(',', $form->category);
$question->stamp = make_unique_id_code();
$question->createdby = $USER->id;
$question->modifiedby = $USER->id;
Expand Down

0 comments on commit 75082bd

Please sign in to comment.