Student projects/Automatic accessibility checking/Core
From MoodleDocs
UML
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()
- Get Source - PHP function validate_page()
Code Outline
functions.validate.php
- Function validate_curl ($request)
- Variable $request is populated by Function validate_cache.
- Returns an open CURL connection.
- Variable $request is populated by Function validate_cache.
- Function validate_cache ($url)
- Variable $url is populated by Function validate_request.
- Returns the cached result from W3
- Variable $url is populated by Function validate_request.
- Function validate_page ($uri)
- Variable $uri is populated by Function validate_request.
- Returns the html source of the current page.
- Variable $uri is populated by Function validate_request.
- Function validate_request ($page_uri)
- Variable $page_uri is populated by the Ajax call.
- Prints the error report directly to the error tracker.
- Variable $page_uri is populated by the Ajax call.
- 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.
- Variable $page_uri is populated by the Ajax call. Variable $display is set to 1.
- 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.
- Variable $page_uri is populated by the Ajax call. Variable $display is set to 1.
ajax_php_validate.js
- Function GetXmlHttpObject ()
- no parameters
- Creates an Ajax connection.
- no parameters
- Function showValidate (str)
- Variable str is populated by the ajax call.
- Creates the ajax call to the proxy. Calls stateChanged when it is ready.
- Variable str is populated by the ajax call.
- Function stateChanged ()
- no parameters
- Prints the report to the error tracker.
- no parameters