Uploaded image for project: 'Moodle'
  1. Moodle
  2. MDL-20498

User pictures should not have 'generic' alt text

    XMLWordPrintable

    Details

    • Type: Improvement
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 2.0
    • Fix Version/s: None
    • Component/s: Accessibility
    • Labels:
      None
    • Affected Branches:
      MOODLE_20_STABLE

      Description

      Our accessibility tester complained that pictures have a generic alt text, which is not useful. Because the picture is often immediately followed/preceded by the user's name, screenreader users hear the name twice, which is annoying.

      The generic text is:

      'Picture of <user name>'

      Our tester suggests that in this case the image should have alt text set to empty string '' to indicate that the image is decorative and does not hold any additional meaning. (This of course presumes that there is nowhere in the system that uses pictures without text names, which I think is the case.)

      Sometimes there are alternative views put forward, so I didn't want to just commit this, however I am making this change to our local code and wanted to give you the opportunity to have it in moodle core.

      Here is a patch against moodle 2 (which i have not tested, since we're on 1.9, but it probably works):

      Index: lib/outputcomponents.php
      ===================================================================
      RCS file: /cvsroot/moodle/moodle/lib/outputcomponents.php,v
      retrieving revision 1.29
      diff -u -r1.29 outputcomponents.php
      — lib/outputcomponents.php 16 Sep 2009 09:29:37 -0000 1.29
      +++ lib/outputcomponents.php 8 Oct 2009 11:48:05 -0000
      @@ -1930,7 +1930,8 @@
      if (!empty($this->user->imagealt))

      { $this->image->alt = $this->user->imagealt; }

      else

      { - $this->image->alt = get_string('pictureof','',fullname($this->user)); + // No alt text when there is nothing useful (accessibility) + $this->image->alt = HTML_ATTR_EMPTY; }

      }

        Attachments

          Activity

            People

            • Assignee:
              moodle.com moodle.com
              Reporter:
              quen Sam Marshall
              Tester:
              Nobody
              Participants:
              Component watchers:
              Adrian Greeve, Mihail Geshoski, Peter Dias
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: