Moodle

Required fields explanation should move to top of form

Details

  • Type: Improvement Improvement
  • Status: Open Open
  • Priority: Minor Minor
  • Resolution: Unresolved
  • Affects Version/s: 1.9.2
  • Fix Version/s: None
  • Component/s: Forms Library
  • Labels:
    None
  • Affected Branches:
    MOODLE_19_STABLE

Description

We had some usability testing done on openlearn (http://openlearn.open.ac.uk) and they suggested that the text which explains the red * for required form fields should be listed at the top of the form rather than (or perhaps as well as) at the bottom.

  1. requirednote.txt
    24/Jul/08 12:22 PM
    1 kB
    Jamie Pratt
  2. usabilitypatch.txt
    23/Jul/08 8:40 PM
    1 kB
    James Brisland

Issue Links

Activity

Hide
Jenny Gray added a comment -

Attaching this to the GSoc Usability issues work as something they might want to pick up.

Show
Jenny Gray added a comment - Attaching this to the GSoc Usability issues work as something they might want to pick up.
Hide
James Brisland added a comment -

I have created a patch for this issue.

File changed is lib/pear/HTML/QuickForm/Renderer/Tableless.php

Show
James Brisland added a comment - I have created a patch for this issue. File changed is lib/pear/HTML/QuickForm/Renderer/Tableless.php
Hide
Jamie Pratt added a comment -

Hi,

Thanks for the patch.

In general we have avoided modifying the pear code itself and confined our modifications to classes that subclass the pear classes.

I attach another patch which modifies lib/formslib.php instead of the pear files.

But still there is a problem with this patch. I don't know why this is being done :

+ $requiredNote = $form->getRequiredNote();
+ // replace default required note by DOM/XHTML optimized note
+ if ($requiredNote == '<span style="font-size:80%; color:#ff0000;">*</span><span style="font-size:80%;"> denotes required field</span>') { + $requiredNote = '<span class="required">*</span> denotes required field'; + }

If you want to change the default html for the required note we should modify the form class in lib/formslib.php where it is set in the constructor.

Show
Jamie Pratt added a comment - Hi, Thanks for the patch. In general we have avoided modifying the pear code itself and confined our modifications to classes that subclass the pear classes. I attach another patch which modifies lib/formslib.php instead of the pear files. But still there is a problem with this patch. I don't know why this is being done : + $requiredNote = $form->getRequiredNote(); + // replace default required note by DOM/XHTML optimized note + if ($requiredNote == '<span style="font-size:80%; color:#ff0000;">*</span><span style="font-size:80%;"> denotes required field</span>') { + $requiredNote = '<span class="required">*</span> denotes required field'; + } If you want to change the default html for the required note we should modify the form class in lib/formslib.php where it is set in the constructor.
Hide
Jamie Pratt added a comment -

Attaching requirednote.txt

Show
Jamie Pratt added a comment - Attaching requirednote.txt
Hide
Jenny Gray added a comment -

OK I quite understand about not wanting to change the pear libraries, that makes a lot of sense. Your patch is better.

The reason for the HTML mangling is simply that that's what the pear code does. Take a look at function finishForm in the Tableless.php file. James' patch is just a direct copy. Though why they want to do that is a mystery!

Show
Jenny Gray added a comment - OK I quite understand about not wanting to change the pear libraries, that makes a lot of sense. Your patch is better. The reason for the HTML mangling is simply that that's what the pear code does. Take a look at function finishForm in the Tableless.php file. James' patch is just a direct copy. Though why they want to do that is a mystery!

People

Vote (2)
Watch (3)

Dates

  • Created:
    Updated: