Uploaded image for project: 'Moodle'
  1. Moodle
  2. MDL-57355

Students are unable to submit in feedback activities if there is a multiple choice rated question left un-finished

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Duplicate
    • Affects Version/s: 3.1.3
    • Fix Version/s: None
    • Component/s: Feedback
    • Labels:
      None
    • Database:
      Microsoft SQL
    • Testing Instructions:
      Hide

      create non-compulsory multi choice with no selected option should be hidden. try to submit the form, it wouldn't let you until you click one option from non-compulsory multi choice.

      Show
      create non-compulsory multi choice with no selected option should be hidden. try to submit the form, it wouldn't let you until you click one option from non-compulsory multi choice.
    • Workaround:
      Show
      https://github.com/mjamil4it/moodle
    • Affected Branches:
      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

            Activity

              People

              • Assignee:
                Unassigned
                Reporter:
                mjamil4it Mudasser Jamil
                Participants:
                Component watchers:
                Amaia Anabitarte, Carlos Escobedo, Ferran Recio, Sara Arjona (@sarjona), Víctor Déniz Falcón
              • Votes:
                0 Vote for this issue
                Watchers:
                2 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: