Unable to go to previous page with Skip Logic enabled when required questions on page unanswered

Unable to go to previous page with Skip Logic enabled when required questions on page unanswered

by Bob Puffer -
Number of replies: 3

Confused. In mod/questionnaire/questionnaire_class.php function print_survey() around line 593 (on my version) I read:

            if ($caninsertresponse) {

                $formdata->rid = $this->response_insert($this->survey->id, $formdata->sec, $formdata->rid, $quser);

                // Prevent navigation to previous page if required questions are empty or not correct (and NOT skip logic mode).

                $msg = $this->response_check_format($formdata->sec, $formdata);

            }

When I follow the trail of code through response_check() there is never a time when skip logic mode is checked so this is certainly why we can't go to previous page when required questions remain unanswered on the current page. This makes for a potentially unfriendly user experience.

Average of ratings: -
In reply to Bob Puffer

Re: Unable to go to previous page with Skip Logic enabled when required questions on page unanswered

by Joseph Rézeau -
Picture of Core developers Picture of Particularly helpful Moodlers Picture of Plugin developers Picture of Testers Picture of Translators

Hi Bob. I suppose you are talking about Questionnaire 2.5.

1.- What has not changed with the new "skip logic" feature is that it is not possible for a respondent to navigate back (or forward) from a page which contains an un-answered required question.

2.- What is new with the "skip logic" feature is that I have created an exception to that former rule, as follows. If a page contains one (or more) un-answered required question(s) AND that page is the child of a parent (located on a previous page), it is possible to navigate back to that previous "parent page" without answering any required questions first. The rationale for this "exception" is that, upon arriving on a child page, and viewing the questions asked on that page, a respondent may realize that they made a "wrong" choice on the previous parent page and wish to go back and change their choice. In that situation, it would not be sensible to require of the respondent that they answered questions that they might not encounter again, should they change their choice on the parent question page.

3.- On the contrary, coming back to the rule explained in #1, when a respondent is viewing a page with a required question that is not a child of a previous question, they it makes sense to force them to answer the required question before navigating back to the previous page, since, whatever they do then, they will always come back to that page containing the required question.

4.- However, for the sake of simplification, a better option might be to ALWAYS allow a respondent to navigate back to previous pages without forcing them to answer required questions. I will study this and, if there are no adverse opinions expressed nor any unwanted behaviours of the programme, I will implement that option.

Joseph

In reply to Joseph Rézeau

Re: Unable to go to previous page with Skip Logic enabled when required questions on page unanswered

by Bob Puffer -

Thank you Joseph.  #4 seems friendliest.

In reply to Bob Puffer

Re: Unable to go to previous page with Skip Logic enabled when required questions on page unanswered

by Joseph Rézeau -
Picture of Core developers Picture of Particularly helpful Moodlers Picture of Plugin developers Picture of Testers Picture of Translators

I am delaying that option, pending the fixing of a little problem I have discovered with navigating back in a questionnaire with conditional branching.

Joseph

EDIT.- Fixed in the github repository for 2.5 and 2.6. See CONTRIB-4779 and related CONTRIB-4778.