Evaluation Library API: Result Objects

From MemberWiki

Jump to: navigation, search

Accessibility Home | Downloads | Evaluation Library Objects and APIs | Rule Format | Issue Tracker

Evaluation Library API: Evaluation Objects | Result Objects | Information and Summary Objects

Contents

Overview

The Result objects are those objects produced by performing an evaluation of a web page; they do not exist until after the evaluation. They include:


EvaluationResult object

EvaluationResult JSDoc documentation

An object that contains:

  • An array of RuleResult objects
  • Methods for retrieving RuleResult objects filtered by rule groups such as Rule Category and WCAG Guideline
  • Information about the all the rule results, including summary information


EvaluationResult methods

Method Returns Arguments Description
getDate String none Returns a string representing the date and time of the evaluation
getEvaluationTitle String none Returns a string representing the title defined when the evaluation (e.g. of Ruleset Object) method was called
getEvaluationURL String none Returns a string representing the URL defined when the evaluation (e.g. of Ruleset Object) method was called
getRuleResultsAll RuleGroupResult none Returns a RuleGroupResult object with all rule results
getRuleResultsByCategory RuleGroupResult rule_category_id (Number, required parameter):
  • OpenAjax.a11y.RULE_CATEGORIES.ALL
  • OpenAjax.a11y.RULE_CATEGORIES.LANDMARKS
  • OpenAjax.a11y.RULE_CATEGORIES.HEADINGS
  • OpenAjax.a11y.RULE_CATEGORIES.STYLES_READABILITY
  • OpenAjax.a11y.RULE_CATEGORIES.IMAGES
  • OpenAjax.a11y.RULE_CATEGORIES.LINKS
  • OpenAjax.a11y.RULE_CATEGORIES.TABLES
  • OpenAjax.a11y.RULE_CATEGORIES.FORMS
  • OpenAjax.a11y.RULE_CATEGORIES.WIDGETS_SCRIPTS
  • OpenAjax.a11y.RULE_CATEGORIES.AUDIO_VIDEO
  • OpenAjax.a11y.RULE_CATEGORIES.KEYBOARD_SUPPORT
  • OpenAjax.a11y.RULE_CATEGORIES.TIMING
  • OpenAjax.a11y.RULE_CATEGORIES.SITE_NAVIGATION
RuleGroupResult object containing information about the rule results associated with the specified rule category
getRuleResultsByGuideline RuleGroupResult wcag_guideline_id (Number):
  • OpenAjax.a11y.WCAG20_GUIDELINES.ALL
  • OpenAjax.a11y.WCAG20_GUIDELINES.G_1_1
  • OpenAjax.a11y.WCAG20_GUIDELINES.G_1_2
  • OpenAjax.a11y.WCAG20_GUIDELINES.G_1_3
  • OpenAjax.a11y.WCAG20_GUIDELINES.G_1_4
  • OpenAjax.a11y.WCAG20_GUIDELINES.G_2_1
  • OpenAjax.a11y.WCAG20_GUIDELINES.G_2_2
  • OpenAjax.a11y.WCAG20_GUIDELINES.G_2_3
  • OpenAjax.a11y.WCAG20_GUIDELINES.G_2_4
  • OpenAjax.a11y.WCAG20_GUIDELINES.G_3_1
  • OpenAjax.a11y.WCAG20_GUIDELINES.G_3_2
  • OpenAjax.a11y.WCAG20_GUIDELINES.G_3_3
  • OpenAjax.a11y.WCAG20_GUIDELINES.G_4_1


RuleGroupResult object containing information about the rule results associated with the specified WCAG guideline
getRuleResult RuleResult rule_id (String) Returns the RuleResult object for a specific rule id (e.g used in rule testsuites)
getRuleset Ruleset none Returns the Ruleset Object used to create this EvaluationResult
toJSON String include_element_results (Boolean):
  • true: include element results with rule results
  • false: include only element summary results with rule results
Returns a JSON formatted string of the rule and element results


RuleGroupResult object

RuleGroupResult JSDoc documentation

An object that contains:

  • an array of RuleResult objects
  • information about the group of rule results, including summary information


RuleGroupResult methods

Method Returns Arguments Description
getRuleResultsArray Array of RuleResult none Returns a list of RuleResult objects associated with the rule grouping
getRuleResultsSummary RuleResultsSummary none Returns a RuleResultsSummary object that contains counts of violations, warnings, manual checks, passed and not applicable rule results
hasRuleResults Boolean none Returns a boolean:
  • true: if the RuleGroupResult has RuleResults
  • false: if the RuleGroupResult does not have RuleResults
getEvaluationResult EvaluationResult none Returns the EvaluationResult Object used to create this RuleGroupResult Object
getImplementationScore Number none Returns a number between 0-100 indicating the level of implementation of rule requirements
getImplementationValue Number none Returns a constant that can is used to represent the level of implementation based on the implementation score and wether there are manual check results:
  • OpenAjax.a11y.IMPLEMENTATION_VALUE.UNDEFINED
  • OpenAjax.a11y.IMPLEMENTATION_VALUE.NOT_APPLICABLE
  • OpenAjax.a11y.IMPLEMENTATION_VALUE.NOT_IMPLEMENTED
  • OpenAjax.a11y.IMPLEMENTATION_VALUE.PARTIAL_IMPLEMENTATION
  • OpenAjax.a11y.IMPLEMENTATION_VALUE.ALMOST_COMPLETE
  • OpenAjax.a11y.IMPLEMENTATION_VALUE.COMPLETE
  • OpenAjax.a11y.IMPLEMENTATION_VALUE.COMPLETE_WITH_MANUAL_CHECKS
  • OpenAjax.a11y.IMPLEMENTATION_VALUE.MANUAL_CHECKS_ONLY
getImplementationValueNLS String none Returns a NLS string that can is used to represent the level of implementation based on the implementation score and wether there are manual check results:
  • "Undefined"
  • "Not applicable"
  • "Not implemented"
  • "Partial implementation"
  • "Almost complete"
  • "Complete"
  • "Complete with manual checks"
  • "Manual checks only"
getRuleGroupInfo RuleGroupInfo none Returns a RuleGroupInfo object with information about the group of rules
hasRules Boolean none Returns true if there is at least one rule in the group


RuleResult object

RuleResult JSDoc documentation

An object that contains:

  • A rule result value
  • A rule result message
  • Information about the associated rule
  • An array of element results
  • Summary information on element results


RuleResult methods

Method Returns Arguments Description
getResultValue Number none Returns a constant that represents the rule result:
  • OpenAjax.a11y.RULE_RESULT_VALUE.VIOLATION
  • OpenAjax.a11y.RULE_RESULT_VALUE.WARNING
  • OpenAjax.a11y.RULE_RESULT_VALUE.MANUAL_CHECK
  • OpenAjax.a11y.RULE_RESULT_VALUE.PASSED
  • OpenAjax.a11y.RULE_RESULT_VALUE.NOT_APPLICABLE
getResultValueNLS String none Returns a string that represents the rule result:
  • 'V'
  • 'W'
  • 'MC'
  • 'P'
  • 'n/a'
getResultMessage String none Returns a string with rule result message
getResultMessagesArray String none Returns an array of strings with rule result messages
getImplementationScore Number none Returns a number between 0-100 indicating the level of implementation of element results that passed, violations and warnings (e.g. 0 means no elements passed and 100 means all element results passed)
getImplementationValue Number none Returns a constant that can is used to represent the level of implementation based on the implementation score and wether there are manual check results:
  • OpenAjax.a11y.IMPLEMENTATION.MANUAL_CHECKS_ONLY
  • OpenAjax.a11y.IMPLEMENTATION.COMPLETE_WITH_MANUAL_CHECKS
  • OpenAjax.a11y.IMPLEMENTATION.COMPLETE
  • OpenAjax.a11y.IMPLEMENTATION.ALMOST_COMPLETE
  • OpenAjax.a11y.IMPLEMENTATION.PARTIAL_IMPLEMENTATION
  • OpenAjax.a11y.IMPLEMENTATION.NOT_IMPLEMENTED
getImplementationValueNLS String none Returns a string that can is used to represent the level of implementation based on the implementation score and wether there are manual check results:
  • 'Manual Checks Only'
  • 'Complete with Manual Checks'
  • 'Complete'
  • 'Almost Complete'
  • 'Partial Implementation'
  • 'Not Implemented'


RuleResult methods related to ElementResult objects

Method Returns Arguments Description
getElementResultsSummary ElementResultsSummary none Returns an ElementsResultsSummary object that contains count information on element results
getElementResultsArray Array of ElementResult none Returns a list of ElementResult objects identifying the documents target resources applying to the rule and the results of the evaluation
hasElementResults Boolean none Returns:
  • true: if there are any element results
  • false: no element results
hasHiddenElements Boolean none Returns:
  • true: if there are any element results with a element result value of hidden
  • false: no elements results with element result value of hidden
getPrimaryLabel String none Returns the label for the primary ElementInfo object.

This can be used to set a column header for primary element information

NOTE: An empty string means no primary property was defined for the rule and therefore no label, this is often the case for rules with scope of Page or Website


RuleResult methods related to Rule object

Method Returns Arguments Description
getRule Rule none Returns a reference to the Rule object
getRuleDefinition String none Returns a string with rule definition based if the rule was required or recommended in the ruleset

(NOTE: adds in isRuleRequired to the getRuleDefinition method of the Rule Object)

getRuleSummary String none Returns a string with rule summary based if the rule was required or recommended in the ruleset

(NOTE: adds in isRuleRequired to the getRuleSummary method of the Rule Object)

getRuleScope Number none Returns:

A constant representing the rule scope:

  • OpenAjax.a11y.RULE_SCOPE.ELEMENT
  • OpenAjax.a11y.RULE_SCOPE.PAGE
  • OpenAjax.a11y.RULE_SCOPE.WEBSITE
getRuleScopeNLS String none Returns:

A constant representing the rule scope:

  • "Element"
  • "Page"
  • "Website"
getWCAG20Level Number none Returns:

Returns a constant representing the WCAG 2.0 level

  • OpenAjax.a11y.WCAG20_LEVEL.A
  • OpenAjax.a11y.WCAG20_LEVEL.AA
  • OpenAjax.a11y.WCAG20_LEVEL.AA
getWCAG20LevelNLS String none Returns:

Returns a constant representing the WCAG 2.0 level

  • "A"
  • "AA"
  • "AAA"
isRuleRequired Boolean none Returns:
  • true: if the rule is required by the ruleset
  • false: if the rule is recommended in the ruleset
isRuleRequiredNLS String none Returns:
  • "Yes": if the rule is required by the ruleset
  • "No": if the rule is recommended in the ruleset


ElementResult object

ElementResult JSDoc documentation

An object that contains:

  • An element result value
  • An element result message
  • Tag name and/or attribute information used to identify the element
  • A reference to the live DOM node in the web page
  • The ordinal position of the element in the DOM
  • Important information about the element used by the rule evaluation method
  • The primary element information needed for understanding the accessibility of the element for this rule
  • An array of RelatedElementsInfo objects (each with information such as headers for a table cell, elements referenced by ARIA-LABELLEDBY, ...)


ElementResult methods

Method Returns Arguments Description
getResultValue Number none Returns a constant that represents the element result:
  • OpenAjax.a11y.ELEMENT_RESULT_VALUE.VIOLATION
  • OpenAjax.a11y.ELEMENT_RESULT_VALUE.WARNING
  • OpenAjax.a11y.ELEMENT_RESULT_VALUE.MANUAL_CHECK
  • OpenAjax.a11y.ELEMENT_RESULT_VALUE.PASSED
  • OpenAjax.a11y.ELEMENT_RESULT_VALUE.HIDDEN
getResultMessage String none Returns a string describing the element result
getElementIdentifier String none Returns a string with two types of information:
  • properties that were used to identify the target resource, such as tag name, attribute name, event type
  • potentially important attribute values or properties such as URL, filename, accessible name...
getElementInfoPrimary ElementInfo none Returns an ElementInfo Object that has information on the most important element attribute (e.g. role value) or property (e.g. accessible name and/or description)

NOTE: If no primary property is defined the ElementInfo properties will be empty strings


getElementInfoSecondaryArray Array of ElementInfo none Returns a array of ElementInfo Objects that have information attributes (e.g. role value) or properties (e.g. accessible name and/or description) important evaluating the rule, the array can be empty

NOTE(1): excludes ElementInfo Object identified in getElementInfoPrimary method NOTE(2): If no secondary properties are defined the array will be empty

getOrdinalPosition Number none Returns a number related to the document position of the element related to the other element results (e.g. can be used to sort list by document order of the elements)
getDOMElement DOMElement none Returns the DOM element object that include the DOM node reference. tag name and computed style information (e.g. can be used for highlighting the element or as a reference to browser based DOM for inspection tools)
getRelatedElementsArray Array of RelatedElements none Returns an Array of RelatedElements objects that are used to identify other important elements related to this element results and the relationship, examples include:
  • elements referenced by aria-labelledby
  • elements references by aria-desccribedby
  • LABEL elements referring to a control element using FOR attribute
  • Table header cells referenced using the HEADERS attribute
  • Table header cells referenced using table header algorithm


ElementResult methods related to RuleResult object

Method Returns Arguments Description
getRuleResult RuleResult none Reference to the rule result object the element result is part of


ElementResult methods related to Rule object

Method Returns Arguments Description
getRule Rule none Reference to the rule object the element results is associated with


DOMElement object

The DOMElement is a rich object with many properties. Here we document only a selected few of these:

DOMElement properties (selected)

Property Type Description
node Object Reference to the live DOM node
tag_name String HTML tag name of the element
computed_style Object Reference to an object with computed style properties, including is_visible_onscreen


RelatedElements object

RelatedElementsInfo JSDoc documentation

An object that contains:

  • The name of the relationship
  • An array of RelatedElementInfo objects


RelatedElements methods

Methods Type Description
getRelatedElements Array of RelatedElementInfo Returns an array of RelatedElementInfo objects containing the elements with the relationship
getTitle String Returns a title that describes the relationship (e.g. labeling elements, data table headers,..)