Issue Details (XML | Word | Printable)

Key: MDL-12256
Type: Sub-task Sub-task
Status: Resolved Resolved
Resolution: Fixed
Priority: Major Major
Assignee: Nick Freear
Reporter: Nick Freear
Votes: 0
Watchers: 1
Operations

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

Course AJAX has very poor accessibility - ALT text,

Created: 19/Nov/07 11:04 PM   Updated: 22/Nov/07 11:11 PM
Return to search
Component/s: Accessibility, AJAX, Course
Affects Version/s: 1.8, 1.9, 2.0
Fix Version/s: 1.9, 2.0

File Attachments: 1. File patch-MDL-lib-ajax-course-41.diff (16 kB)


Participants: Martin Dougiamas and Nick Freear
Security Level: None
Resolved date: 20/Nov/07
Affected Branches: MOODLE_18_STABLE, MOODLE_19_STABLE, MOODLE_20_STABLE
Fixed Branches: MOODLE_19_STABLE, MOODLE_20_STABLE


 Description  « Hide
A lot of very basic accessibility and usability errors - developers may assume that users of assistive technology would have the "AJAX and Javascript" user profile setting set to "no", but users may not know about this "advanced" setting, and in any case their seems to have been lazy development.

Was this a Google Summer of Code project? - these ad hoc developers need to gain basic accessibility awareness, and their work needs serious code review (http://docs.moodle.org/en/Student_projects/AJAX_course_format).

Problems include ('buttons' here means an image and container with a Javascript event):
 1. A bug in lib/ajax/ajaxcourse.js main_class.prototype.mk_button function - the second FOR loop should test "c<imgAttributes.length" NOT "c<attributes.length" (nothing to do with accessibility),
 2. None of the buttons created in section_classes.js or block_classes.js have ALT text. Some have a TITLE, but this is inconsistent.
 3. Where possible the ALT text needs to be specific - for example "Move section N". (the container TITLE can be just "Move" - awkward for IE).
 4. The ALT text for the show/hide buttons should toggle between "Show ..." and "Hide ..."
 5. I think the Javascript is removing the images from the non-AJAX course format buttons, but keeping the links - BAD - the whole link needs removing.
 6. For the buttons, the container is sometimes an 'a' anchor, sometimes a DIV - need consistency - should it be an <input type="image" .../> ?

The attached patch address items 1-4 (do 5 separately). A new parameter 'text' is added to the main_class.prototype.mk_button method. Tested in Firefox and IE 6.

I'd like to get quick feedback, then commit to HEAD and 1.9 branches.

 All   Comments   Change History   Version Control      Sort Order: Ascending order - Click to sort in descending order
Nick Freear added a comment - 19/Nov/07 11:20 PM
The patch affects 5 files:
-lang/en_utf8/moodle.php - 2 new strings, 'hidesection', 'movesection'.
-lib/ajax/ajaxcourse.js - modifies mk_button method (minor edit to main_class.prototype.getString).
-lib/ajax/ajaxlib.js - use more language strings.
-lib/ajax/block_classes.js
-lib/ajax/section_classes.js

Nick Freear made changes - 19/Nov/07 11:32 PM
Field Original Value New Value
Status Open [ 1 ] In Progress [ 3 ]
Nick Freear committed 1 file to 'Moodle CVS' - 20/Nov/07 12:25 AM
Initial fix for MDL-12256, "Course AJAX has very poor accessibility - ALT text" - test, imgAttributes.length NOT attributes.length.
MODIFY lib/ajax/ajaxcourse.js   Rev. 1.10    (+2 -2 lines)
Nick Freear committed 1 file to 'Moodle CVS' on branch 'MOODLE_19_STABLE' - 20/Nov/07 12:26 AM
Initial fix for MDL-12256, "Course AJAX has very poor accessibility - ALT text" - test, imgAttributes.length NOT attributes.length. Merged.
MODIFY lib/ajax/ajaxcourse.js   Rev. 1.9.6.1    (+2 -2 lines)
Nick Freear added a comment - 20/Nov/07 01:15 AM
I've committed the one-line fix for item 1 above to HEAD, 1.9 and 1.8 branches, tagged MERGED. I'm about to commit the rest to HEAD.

Martin, can I merge these changes to 1.9 branch? thanks Nick


Nick Freear committed 1 file to 'Moodle CVS' on branch 'MOODLE_18_STABLE' - 20/Nov/07 02:11 AM
Initial fix for MDL-12256, "Course AJAX has very poor accessibility - ALT text" - test, imgAttributes.length NOT attributes.length. Merged.
MODIFY lib/ajax/ajaxcourse.js   Rev. 1.8.2.1    (+2 -2 lines)
Nick Freear committed 1 file to 'Moodle CVS' - 20/Nov/07 02:21 AM
Fixes for bug MDL-12256, "Course AJAX has very poor accessibility - ALT text".
MODIFY lang/en_utf8/moodle.php   Rev. 1.150    (+3 -1 lines)
Nick Freear committed 4 files to 'Moodle CVS' - 20/Nov/07 02:22 AM
Fixes for bug MDL-12256, "Course AJAX has very poor accessibility - ALT text" (includes white-space cleanup).
MODIFY lib/ajax/section_classes.js   Rev. 1.37    (+42 -27 lines)
MODIFY lib/ajax/block_classes.js   Rev. 1.18    (+9 -4 lines)
MODIFY lib/ajax/ajaxlib.php   Rev. 1.41    (+7 -0 lines)
MODIFY lib/ajax/ajaxcourse.js   Rev. 1.11    (+13 -8 lines)
martignoni committed 1 file to 'Lang CVS' - 20/Nov/07 05:42 AM
Fixes for bug MDL-12256, "Course AJAX has very poor accessibility - ALT text".
MODIFY fr_utf8/moodle.php   Rev. 1.181    (+3 -1 lines)
Martin Dougiamas added a comment - 20/Nov/07 08:38 AM
Great, thanks! Definitely OK to commit to HEAD any time.

Porting to 1.9 needs to be done carefully - remember that HEAD is now tableless and being tested that way ... 1.9 still currently uses tables.


Mitsuhiro Yoshida committed 3 files to 'Lang CVS' - 20/Nov/07 01:52 PM
Translated new strings for "Course AJAX" ALT text MDL-12256.
Brsushed up a translated string for search.
MODIFY ja_utf8/README   Rev. 1.573    (+1 -1 lines)
MODIFY ja_utf8/moodle.php   Rev. 1.257    (+2 -0 lines)
MODIFY ja_utf8/search.php   Rev. 1.4    (+2 -2 lines)
Nick Freear added a comment - 20/Nov/07 10:40 PM - edited
Thanks. Understood - I'm being careful!
I have tested on 1.9 branch and HEAD, in IE 6, IE 7, Firefox (Opera and Safari - course AJAX doesn't work) with help from a colleague, and I'm happy that the weeks and topics course pages look and work the same as before, with AJAX enabled (or not).

I have added a hack to fix Internet Explorer tooltips to use the image TITLE, not the ALT attribute (the ALT text is unnecessarily specific for sighted users - eg. "Hide section 1").

(Note, item 5 in the original bug report is not and issue - I hadn't updated section_classes.js for Ann's patch, MDL-9306.)

Everything now committed to HEAD and 1.9 branch, tagged merged.


Nick Freear made changes - 20/Nov/07 10:40 PM
Status In Progress [ 3 ] Resolved [ 5 ]
Resolution Fixed [ 1 ]
Nick Freear committed 5 files to 'Moodle CVS' on branch 'MOODLE_19_STABLE' - 20/Nov/07 11:24 PM
Fixes for bug MDL-12256, "Course AJAX has very poor accessibility - ALT text" (includes white-space cleanup). Merged (+ hacks for IE).
MODIFY lib/ajax/ajaxlib.php   Rev. 1.40.6.1    (+7 -0 lines)
MODIFY lib/ajax/block_classes.js   Rev. 1.17.6.1    (+9 -4 lines)
MODIFY lib/ajax/section_classes.js   Rev. 1.35.2.1    (+44 -27 lines)
MODIFY lang/en_utf8/moodle.php   Rev. 1.141.2.8    (+3 -1 lines)
MODIFY lib/ajax/ajaxcourse.js   Rev. 1.9.6.2    (+25 -9 lines)
Nick Freear committed 2 files to 'Moodle CVS' - 20/Nov/07 11:37 PM
Follow up for MDL-12256, "Course AJAX has very poor accessibility - ALT text" - IE tooltip/ title hack.
MODIFY lib/ajax/section_classes.js   Rev. 1.38    (+3 -1 lines)
MODIFY lib/ajax/ajaxcourse.js   Rev. 1.12    (+14 -2 lines)
Nick Freear made changes - 21/Nov/07 07:32 PM
Link This issue blocks MDL-12298 [ MDL-12298 ]
Nick Freear made changes - 21/Nov/07 07:35 PM
Parent MDL-12298 [ 23539 ]
Issue Type Bug [ 1 ] Sub-task [ 5 ]
Nick Freear made changes - 21/Nov/07 09:11 PM
Link This issue blocks MDL-12298 [ MDL-12298 ]
Nick Freear added a comment - 22/Nov/07 11:11 PM
(OU Bug # 4186.)