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

    • Bug
    • Status: Closed
    • Major
    • Resolution: Duplicate
    • 3.1.3
    • None
    • Feedback
    • None
    • Microsoft SQL
    • MOODLE_31_STABLE
    • Show
      https://github.com/mjamil4it/moodle
    • 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.

    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

              Unassigned Unassigned
              mjamil4it Mudasser Jamil
              Amaia Anabitarte, Carlos Escobedo, Laurent David, Mikel Martín Corrales, Sabina Abellan, Sara Arjona (@sarjona)
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: