/redcap-choice-columns

REDCap external module for the action tag @CHOICE-COLUMNS=? used to specify the number of columns a radio or checkbox field's choices are displayed in.

Primary LanguagePHPGNU General Public License v3.0GPL-3.0


REDCap External Module: Choice Columns

Luke Stevens, Murdoch Children's Research Institute https://www.mcri.edu.au

https://github.com/lsgs/redcap-choice-columns


Summary

Tag radio or checkbox fields with the action tag @CHOICE-COLUMNS=? to specify the number of columns the choices will be displayed in.

Notes:

  • The tag is ignored for fields other than radio and checkbox.
  • The tag is ignored for radio and checkbox fields that are part of a matrix.
  • Enhanced radio buttons and checkboxes are supported.
  • Specify an integer in the range 1-99 for the number of columns. Any other value will cause the tag to be ignored and the field display default behaviour.
  • Piping into the action tag is supported, but only on page load. It is not dynamic within a page (i.e. is similar to other tags like @HIDECHOICE and @IF).

Alignment

Vertical vs. Horizontal

  • Horizontal: Choices will be displayed in columns with choices listed across then down.
  • Vertical: Choices will be displayed in columns with choices listed down then across.

Note: down then across filling for fields with vertical alignment means that the specified column count may not be fully filled.

Left vs. Right

  • Left: Recommended. Choices occupy the full width of the form container, with the field label above.
  • Right: Choices occupy space to the right of the field label. Usually unsuitable with higher column counts.

Multi-Language Management

The module is designed to support re-rendering following language changes, including between left-to-right and right-to-left languages.

LV Alignment

L-T-R < - > R-T-L
Choice1 Choice4 4eciohC 1eciohC
Choice2 Choice5 5eciohC 2eciohC
Choice3 3eciohC

LH Alignment

L-T-R < - > R-T-L
Choice1 Choice2 2eciohC 1eciohC
Choice3 Choice4 4eciohC 3eciohC
Choice5 5eciohC

Example and Screenshots

https://redcap.link/em-choice-columns

example0

example1

example2

example3