cgkineo / adapt-definitions

Glossary - Popup word definitions
GNU General Public License v3.0
2 stars 1 forks source link

Feature request: Singular definitions defined at course level #8

Open guywillis opened 2 days ago

guywillis commented 2 days ago

Subject of the enhancement

Add a configuration option to the definition items to allow for course (global) level definition without the definition applying to every instance of the word.

This would be useful for the Authoring Tool to remove the need for inline styling to apply a definition to a term that is used throughout the course.

e.g.

{
    "words": [
        "Adapt Framework"
    ],
    "definition": "This is a piece of software which</br>allows you to create e-learning.",
    "_applyToFirstWordOnly": true
},
{
    "words": [
        "the",
        "a"
    ],
    "definition": "Excellent word this one",
    "_applyToFirstWordOnly": false
}

The definition for Adapt Framework would only appear the first time this word is used in the course content whereas the definition for the and a would appear throughout the course whenever those words are used.

Your environment

oliverfoster commented 2 days ago

First as in: the first time it's rendered or the first menu/page it appears on in the content order?

:: user initially visits page 2 :: user initially visits page 1

guywillis commented 2 days ago

Good question and point.

I had initially thought first instance sequentially via the JSON but that, as you have quite rightly identified, leaves a potential issue if the course is consumed in a non-sequential order.

Ideally, it would be first instance it's rendered on screen to the user.