Note:

If you want to create a new page for developers, you should create it on the Moodle Developer Resource site.

Question editing form improvements: Difference between revisions

From MoodleDocs
No edit summary
m (Added logic)
Line 1: Line 1:
==Introduction==
Many question type editing forms are long and unwieldy. The biggest improvements we made were  
Many question type editing forms are long and unwieldy. The biggest improvements we made were  
#Expandable Sections
#Expandable Sections
Line 33: Line 34:
Fig 3. Required section collapsed
Fig 3. Required section collapsed
[[File:Required-collapsed.jpg]]
[[File:Required-collapsed.jpg]]
This section contains a required field so a * appear after its title.
This section contains a required field so a * appears after its title.


Fig 4. Required section expanded
Fig 4. Required section expanded
[[File:Required-expanded.jpg]]
[[File:Required-expanded.jpg]]
Expanding the section reveals the required field.
Expanding the section reveals the required field.
===Logic===
We could collapse all sections when the form loads but this wouldn't be very helpful. So we've added some additional logic to set the form up for easy editing straight away.
#Default to expanded: By default each section is expanded
#Remembers visibility preference: The last visibility setting of each section is remembered from one form to the next. So if answers section was collapsed last time you used a question editing form it will be collapsed for the next question editing form.
#General section always expanded. Regardless of previous user choice it will always load expanded
#Combined feedback section default to collapsed. If no user preference is recorded will load collapsed.


==Group similar fields==
==Group similar fields==
==Expandable html editors==
==Expandable html editors==
  Ability to collapse and expand the editor of html text entry fields.
  Ability to collapse and expand the editor of html text entry fields.

Revision as of 15:32, 2 December 2011

Introduction

Many question type editing forms are long and unwieldy. The biggest improvements we made were

  1. Expandable Sections
  2. Group similar fields.
  3. Expandable html editors

Combined with smaller tweaks the forms are now much easier to understand and use.

Expandable Sections

This is the ability for the user to collapse and expand form sections.

Summary

Each form is broken down into logical sections including:

  1. General
  2. Answers
  3. Units
  4. Multiple tries

To simplify the form it helps to think of breaking it down into sections and focusing on one section at a time. This is what expandable sections allow. Each section of the form can now be collapsed or expanded exactly the same way this happens to blocks.

To the left of each section title a + or - icon controls the visibility of that particular section. The icon used indicates what will happen when it is clicked. - indicates the section will collapse. + indicates it will expand.

Fig 1. All sections collapsed Toggles-collapsed.jpg With all sections collapsed it's possible to see on one page all sections in the form and gauge its complexity.

Fig 2. Sections expanded Toggles-expanded.jpg You can expand only the sections you want to see. The answers section often takes up one or two screens. So it's collapsed here.

Required Sections

Collapsing a section can hide required form fields. So required sections are marked with *

Fig 3. Required section collapsed Required-collapsed.jpg This section contains a required field so a * appears after its title.

Fig 4. Required section expanded Required-expanded.jpg Expanding the section reveals the required field.

Logic

We could collapse all sections when the form loads but this wouldn't be very helpful. So we've added some additional logic to set the form up for easy editing straight away.

  1. Default to expanded: By default each section is expanded
  2. Remembers visibility preference: The last visibility setting of each section is remembered from one form to the next. So if answers section was collapsed last time you used a question editing form it will be collapsed for the next question editing form.
  3. General section always expanded. Regardless of previous user choice it will always load expanded
  4. Combined feedback section default to collapsed. If no user preference is recorded will load collapsed.

Group similar fields

Expandable html editors

Ability to collapse and expand the editor of html text entry fields.