With the Question Editor API, you can use the CKE (rich text editor) Plugin Underlined Indicator - a feature for adding underlined indicators to text in passages.
Try out the plugin in the demo.
The Underlined Indicator is designed to be used with a text passage. It allows part of a text passage to be underlined, and have a indicator, e.g. "Q1" placed below. This indicator can then be be referred to by a Questions stimulus, in order to ask questions specific to the part of the underlined text.
- Can contain any characters, and must be between one and three characters in length.
- Can be applied to a single character, or multiple sentences spanning several lines (wrapping is supported).
An example is below:
The primary use case is only for "normal" text. This text may also contain an inline style.
The following is not supported:
- Other block style formats like H1,
- Widgets e.g. Math, or
- Embedded images or videos.
Adding an Underlined Indicator
When adding an Underlined Indicator, the following occurs:
- The highlighted text, or the word the cursor is in, is underlined and your indicator is added to the bottom left of the text,
- The line spacing is doubled for the entire field, and
- In the edit panel of Author API, when clicking on the underlined text or the indicator, a popover will appear. This allows you to edit or remove the indicator.
To add an Underlined Indicator:
- Target some text, using one of the ways below:
- Highlight a single word,
- Highlight multiple words,
- Highlight part of a word, or
- Place the cursor at the start, middle, or end of a word.
- Then click on the Underlined Indicator button on the CKEditor toolbar, indicated below (red outline):
Removing an Underlined Indicator
When removing an Underlined Indicator, the following occurs:
- The highlighted text should have the Underlined Indicator removed, and
- The double line spacing is removed from the field if there are no other indicators.
To remove an Underlined Indicator, use one of the ways below:
- Click on the word or the indicator to bring up the popover, then click "Remove":
- Place cursor at end of word and press the backspace key,
- Place cursor at start of word and press the delete key,
- Highlight part or all of the indicator, then click the "Remove Format" button, or
- Highlight some text, including the indicator, and type to overwrite (i.e. replacing it).
Editing an Underlined Indicator
Editing the indicator value
- Click on the word or the indicator to bring up the popover, then click "Edit":
- Place cursor at the start, middle or end of the word, then click on the Underlined Indicator button on the CKE bar,
- Highlight the existing word, then click the Underlined Indicator button on the CKE bar, or
- Highlight the existing word, then click the word, to bring up the popover, then click "Edit".
Editing the text the indicator is applied toTo extend the selection:
- Highlight the new text.
- Click the indicator button on the CKE toolbar.
- Enter the same indicator.
- Click "OK". The old indicator will be removed and replaced.
- Highlight a part of the existing indicated text.
- Click the "Remove Format" button on the CKE toolbar.
- The indicator will stay, but it will be removed from that part of the text.