Moodle
  1. Moodle
  2. MDL-10027

Survey complains that I have not completed the survey when I have.

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 1.8
    • Fix Version/s: 1.8.2, 1.9
    • Component/s: Survey
    • Labels:
      None
    • Environment:
      I know this happens in IE 6 and 7. I have not tested other browsers.
    • Database:
      MySQL, Microsoft SQL
    • Affected Branches:
      MOODLE_18_STABLE
    • Fixed Branches:
      MOODLE_18_STABLE, MOODLE_19_STABLE
    • Rank:
      29434

      Description

      When you complete a survey that includes radio buttons, it seems to have a javascript problem that causes it to think you haven't selected an option. I selected "almost always" for everything and it said I had some still unanswered. I looked a little at the code and noticed that the array sizes for the radio groups are not consistent. They should all be 6 but some are 7. I suspect it has something to do with naming of the input tags in those radio groups. The naming convention looks like q1 (question 1) and each of it's options are q11 (question 1, option 1), q12 (question 1, option 2), and so on... It is suspicious that the problem starts happening on question 11. Suddenly the array sizes are 7 instead of 6, so I think that perhaps a fix needs to be made to the inputs and on the back end to pick them up properly. If I had more time, I would look into it myself. The bottom line is that it is the checkform function tries the following code:

      if(q11[5].checked == true) error = true;

      ...and it fails because for some reason, by selecting almost always on that field puts statement to true and q11.length is 7 instead of 6.

        Activity

        Hide
        Martin Dougiamas added a comment -

        Fixed in CVS (using a patch from Christopher Holmes).

        Thanks!

        Show
        Martin Dougiamas added a comment - Fixed in CVS (using a patch from Christopher Holmes). Thanks!

          People

          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: