Details
-
Bug
-
Status: Closed
-
Major
-
Resolution: Duplicate
-
3.1.3
-
None
-
None
-
Microsoft SQL
-
MOODLE_31_STABLE
-
-
Description
Hi Marina,
Just pointing out a small in feedback activities, Students are not able to submit their responses if there is a multiple choice rated question left unanswered (the question is marked as non-compulsory) and not selected option is hidden.
By debugging the code i noticed for above case non-compulsory multiple choice does not save in mdl_feedback_valuetmp table.
And function get_last_completed_page() mark this item as incomplete and form never will submit.
i have small patch for this in the get_last_completed_page() to check if item is not required then mark as complete.
Current Code
classes\completion.php line 270
protected function get_last_completed_page() {
|
$completed = [];
|
$incompleted = [];
|
$pages = $this->get_pages();
|
foreach ($pages as $pageidx => $pageitems) {
|
foreach ($pageitems as $item) {
|
if ($item->hasvalue) {
|
if ($this->get_values_tmp($item) !== null) {
|
$completed[$pageidx] = true;
|
} else {
|
$incompleted[$pageidx] = true;
|
}
|
}
|
}
|
}
|
.....
|
Patch:
protected function get_last_completed_page() {
|
$completed = [];
|
$incompleted = [];
|
$pages = $this->get_pages();
|
foreach ($pages as $pageidx => $pageitems) {
|
foreach ($pageitems as $item) {
|
if ($item->hasvalue) {
|
if ($this->get_values_tmp($item) !== null {color:red}*|| $item->required == 0*{color}) {
|
$completed[$pageidx] = true;
|
} else {
|
$incompleted[$pageidx] = true;
|
}
|
}
|
}
|
}
|
......
|
I will add the patch to github for your review.
Attachments
Issue Links
- duplicates
-
MDL-56912 Feedback: Non required question types don't submit if empty
-
- Closed
-