quiz editing: MDL-17417 added logging for random question creating
This commit is contained in:
@@ -32,9 +32,16 @@
|
||||
//TODO: process if returns false?
|
||||
$newquestioninfo=quiz_process_randomquestion_formdata($qcobject);
|
||||
if($newquestioninfo){
|
||||
redirect($CFG->wwwroot."/mod/quiz/edit.php?cmid=$cmid&addonpage=$newquestioninfo->addonpage&addrandom=1&categoryid=$newquestioninfo->newrandomcategory&randomcount=1&sesskey=".sesskey());
|
||||
$newrandomcategory=$newquestioninfo->newrandomcategory;
|
||||
if (!$newrandomcategory){
|
||||
print_r($newquestioninfo);
|
||||
print_error("cannotcreatecategory");
|
||||
}else{
|
||||
add_to_log($quiz->course, 'quiz', 'addcategory',
|
||||
"view.php?id=$cm->id", "$newrandomcategory", $cm->id);
|
||||
redirect($CFG->wwwroot."/mod/quiz/edit.php?cmid=$cmid&addonpage=$newquestioninfo->addonpage&addrandom=1&categoryid=$newquestioninfo->newrandomcategory&randomcount=1&sesskey=".sesskey());
|
||||
}
|
||||
}
|
||||
|
||||
//these params are only passed from page request to request while we stay on this page
|
||||
//otherwise they would go in question_edit_setup
|
||||
$quiz_page = optional_param('quiz_page', 0, PARAM_SEQUENCE);
|
||||
|
||||
@@ -249,6 +249,9 @@ if($newquestioninfo){
|
||||
if (!$newrandomcategory){
|
||||
print_r($newquestioninfo);
|
||||
print_error("cannotcreatecategory");
|
||||
}else{
|
||||
add_to_log($quiz->course, 'quiz', 'addcategory',
|
||||
"view.php?id=$cm->id", "$newrandomcategory", $cm->id);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user