setAccessibility - Methods - Assess API

Assess API Methods

setAccessibility()

Sets accessibility properties. It is obligatory to define show_accessibility (with both show_colourscheme and show_fontsize) in Assess API JSON to use this method.

Requires test:ready status before being used. This can be accomplished by either listening to the test:ready event using the on public method, or using the app readyListener.

Examples

// Via test:ready event
assessApp.on('test:ready', function () {
    assessApp.setAccessibility({
        "fontSize": 'xxlarge',
        "contrast": 'white-on-black'
    });
    assessApp.setAccessibility({
        "fontSize": 'small',
        "contrast": '1'
    });
});

// Via readyListener
assessApp = LearnosityAssess.init(initOptions, 'learnosity_assess', {
    readyListener: function () {
        LearnosityAssess.addAccessibilityPalettes([{
            "name": 'Example Palette',
            "colors": {
                // ...
            }
        }]);

        assessApp.setAccessibility({
            "fontSize": 'small',
            "contrast": 'Example Palette'
        });
    }
});

Arguments

  • options object

    • fontSize string

      Available options:

      • 'small'
      • 'normal'
      • 'large'
      • 'xlarge'
      • 'xxlarge'

    • contrast string

      Available options:

      • 'black-on-white'
      • 'rose-on-green'
      • 'yellow-on-blue'
      • 'black-on-rose'
      • 'light-gray-on-dark-gray'
      • 'white-on-black'

Return value

None (undefined).

Was this article helpful?

Did you arrive here by accident? If so, learn more about Learnosity.