hey tim. thank you very much for the fast answer.
unfortunately, this is a little time-consuming for our teachers.
would it be possible to hide the categorychooser while makecopy and move the question after saving directly to the topcategory of the current coursecontext?
I tried something in mydomain/question/question.php:
if i add the following code on line 242 it moves to the category id i added here:
/// Process the combination of usecurrentcat, categorymoveto and category form
/// fields, so the save_question method only has to consider $fromform->category
if (!empty($fromform->usecurrentcat)) {
// $fromform->category is the right category to save in.
// new code-----------------------------------------------------
if ($makecopy) {
$fromform->category = '259';
}
// end new code -------------------------------------------------
} else {
if (!empty($fromform->categorymoveto)) {
$fromform->category = $fromform->categorymoveto;
} else {
// $fromform->category is the right category to save in.
}
}
unfortunately, this is a little time-consuming for our teachers.
would it be possible to hide the categorychooser while makecopy and move the question after saving directly to the topcategory of the current coursecontext?
I tried something in mydomain/question/question.php:
if i add the following code on line 242 it moves to the category id i added here:
/// Process the combination of usecurrentcat, categorymoveto and category form
/// fields, so the save_question method only has to consider $fromform->category
if (!empty($fromform->usecurrentcat)) {
// $fromform->category is the right category to save in.
// new code-----------------------------------------------------
if ($makecopy) {
$fromform->category = '259';
}
// end new code -------------------------------------------------
} else {
if (!empty($fromform->categorymoveto)) {
$fromform->category = $fromform->categorymoveto;
} else {
// $fromform->category is the right category to save in.
}
}