Skip to content

Commit

Permalink
MDL-27143 question bank: questions not saved when deleting a category.
Browse files Browse the repository at this point in the history
Based on a fix by Nikhil Gupta.

Conflicts:

	lib/questionlib.php
  • Loading branch information
timhunt committed Dec 9, 2011
1 parent bdfd90b commit 38e32f6
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 5 deletions.
6 changes: 2 additions & 4 deletions lib/questionlib.php
Original file line number Diff line number Diff line change
Expand Up @@ -752,8 +752,7 @@ function question_delete_course_category($category, $newcategory, $feedback=true
/**
* Enter description here...
*
* @global object
* @param string $questionids list of questionids
* @param array $questionids of question ids
* @param object $newcontext the context to create the saved category in.
* @param string $oldplace a textual description of the think being deleted, e.g. from get_context_name
* @param object $newcategory
Expand Down Expand Up @@ -836,8 +835,7 @@ function question_delete_activity($cm, $feedback=true) {
* acutally moving questions and associated data. However, callers of this function also have to
* do other work, which is why you should not call this method directly from outside the questionbank.
*
* @global object
* @param string $questionids a comma-separated list of question ids.
* @param array $questionids of question ids.
* @param integer $newcategoryid the id of the category to move to.
*/
function question_move_questions_to_category($questionids, $newcategoryid) {
Expand Down
2 changes: 1 addition & 1 deletion question/category_class.php
Original file line number Diff line number Diff line change
Expand Up @@ -334,7 +334,7 @@ public function move_questions($oldcat, $newcat){
global $DB;
$questionids = $DB->get_records_select_menu('question',
'category = ? AND (parent = 0 OR parent = id)', array($oldcat), '', 'id,1');
question_move_questions_to_category($questionids, $newcat);
question_move_questions_to_category(array_keys($questionids), $newcat);
}

/**
Expand Down

0 comments on commit 38e32f6

Please sign in to comment.