Note: You are currently viewing documentation for Moodle 1.9. Up-to-date documentation for the latest stable version is available here: Student projects/Automatic accessibility checking/Core.

Student projects/Automatic accessibility checking/Core

From MoodleDocs

UML

Current UML Image

Abstract flow:

  • Send Request - Ajax call showValidate()
    • Get Source - PHP function validate_page()
      • Die (If unable to grab source)
    • Submit Source - PHP function validate_cache()
      • Die (If unable to communicate with the validation server)
    • Retrieve Errors - PHP function validate_request()
      • Die (If unable to read errors)
    • Display Errors - PHP function validate_request()

Code Outline

functions.validate.php

  • Function validate_curl ($request)
    • Variable $request is populated by Function validate_cache.
      • Returns an open CURL connection.
  • Function validate_cache ($url)
    • Variable $url is populated by Function validate_request.
      • Returns the cached result from W3
  • Function validate_page ($uri)
    • Variable $uri is populated by Function validate_request.
      • Returns the html source of the current page.
  • Function validate_request ($page_uri)
    • Variable $page_uri is populated by the Ajax call.
      • Prints the error report directly to the error tracker.
  • Function the_warnings ($page_uri, $display = null)
    • Variable $page_uri is populated by the Ajax call. Variable $display is set to 1.
      • Prints the number of warnings to the error tracker.
  • Function the_errors ($page_uri, $display = null)
    • Variable $page_uri is populated by the Ajax call. Variable $display is set to 1.
      • Prints the number of errors to the error tracker.

ajax_php_validate.js

  • Function GetXmlHttpObject ()
    • no parameters
      • Creates an Ajax connection.
  • Function showValidate (str)
    • Variable str is populated by the ajax call.
      • Creates the ajax call to the proxy. Calls stateChanged when it is ready.
  • Function stateChanged ()
    • no parameters
      • Prints the report to the error tracker.