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.