MDL-58412 mod_feedback: Always set gonextpage when moving forward

In some cases the last page will be omitted in a feedback (for example
when using dependent questions).
Because of that the save process will be launched in a page that is not
the last.
This commit is contained in:
Juan Leyva
2017-03-28 10:05:56 +02:00
parent 1b0b4ab25f
commit 592306c60b
+3 -2
View File
@@ -649,11 +649,12 @@ class mod_feedback_external extends external_api {
$_POST['courseid'] = $course->id;
$_POST['gopage'] = $params['page'];
$_POST['_qf__mod_feedback_complete_form'] = 1;
// Determine where to go, backwards or forward.
if (!$params['goprevious']) {
$_POST['gonextpage'] = 1; // Even if we are saving values we need this set.
if ($feedbackcompletion->get_next_page($params['page'], false) === null) {
$_POST['savevalues'] = 1; // If there is no next page, it means we are finishing the feedback.
} else {
$_POST['gonextpage'] = 1; // If we are not going to previous page or finishing we are going forward.
}
}