This is a lower-level API. Lower-level APIs are not recommended for most projects, and may not be available on all plans. See our page on recommended deployment patterns for more information.
Public Method Assess API

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?