Issue Details (XML | Word | Printable)

Key: MDL-10027
Type: Bug Bug
Status: Resolved Resolved
Resolution: Fixed
Priority: Major Major
Assignee: Martin Dougiamas
Reporter: Phillip Cross
Votes: 0
Watchers: 0
Operations

Add/Edit UI Mockup to this issue
If you were logged in you would be able to see more operations.
Moodle

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

Created: 06/Jun/07 05:43 AM   Updated: 25/Jun/07 05:22 PM
Return to search
Component/s: Survey
Affects Version/s: 1.8
Fix Version/s: 1.8.2, 1.9

Environment: I know this happens in IE 6 and 7. I have not tested other browsers.

Database: Microsoft SQL, MySQL
Participants: Martin Dougiamas and Phillip Cross
Security Level: None
Resolved date: 25/Jun/07
Affected Branches: MOODLE_18_STABLE
Fixed Branches: MOODLE_18_STABLE, MOODLE_19_STABLE


 Description  « Hide
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.

 All   Comments   Change History   Version Control      Sort Order: Ascending order - Click to sort in descending order
moodler committed 1 file to 'Moodle CVS' on branch 'MOODLE_18_STABLE' - 25/Jun/07 05:20 PM
Patch for JS problem in MDL-10027 (Chris Holmes did it)
MODIFY mod/survey/lib.php   Rev. 1.59.2.1    (+7 -7 lines)
moodler committed 1 file to 'Moodle CVS' - 25/Jun/07 05:21 PM
Patch from Chris Holmes for MDL-10027, merged from 1.8
MODIFY mod/survey/lib.php   Rev. 1.60    (+7 -7 lines)
Martin Dougiamas added a comment - 25/Jun/07 05:22 PM
Fixed in CVS (using a patch from Christopher Holmes).

Thanks!


Martin Dougiamas made changes - 25/Jun/07 05:22 PM
Field Original Value New Value
Status Open [ 1 ] Resolved [ 5 ]
Fix Version/s 1.9 [ 10190 ]
Fix Version/s 1.8.2 [ 10220 ]
Resolution Fixed [ 1 ]