Style fix - "extra white-space in function declaration"

"Note there is no space between the function name and the following (brackets)." – http://docs.moodle.org/dev/Codi
ng_style#Functions_and_Methods
Style fix: Always use braces on if/else.

"Always use braces (even if the block is one line and PHP doesn't require it)."
http://docs.moodle.org/dev/Coding_style#If_.2F_else
Style fix: All lines now less than 180 characters.

Line length over the limit: "Aim for 132 characters if it is convenient, it is not recommended to use more than 180
characters."
http://docs.moodle.org/dev/Coding_style#Maximum_Line_Length
Style fix: only a single space between control statements and brackets, no elseif

"Put a space before and after the control statement in brackets..."
http://docs.moodle.org/dev/Coding_style#Control_statements
 (note the examples for correct "if, else and else if" style)
Style Fix: SQL indenting

Incorrect SQL query style. Keep return fields on the same line as the initial SELECT and use normal line length rules
for optional slitting across multiple lines
https://tracker.moodle.org/browse/MDLSITE-1914?focusedCommentId=176949&page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#comment-176949
Style fix: no spaces after function names in calls.

"Don't leave spaces between the function name and the opening parenthesis for the arguments."
http://docs.moodle.org/dev/Coding_style#Functions_and_methods_2
Style fix: Calls to inbuilt PHP functions must be lowercase

expected "imagecolorallocate" but found "ImageColorAllocate"
Style fix: Missing parameter type for @param tag

http://docs.moodle.org/dev/Coding_style#.40param
Style fix: Missing @throws PHPDoc comment tag which must be used when a function or method throws an exception

http://docs.moodle.org/dev/Coding_style#.40throws
Style fix: "If there are multiple possible return types, list them pipe-delimited without spaces"

http://docs.moodle.org/dev/Coding_style#.40return
Style fix: Replaced tabs with spaces.

Tabs found in whitespace. "Use an indent of 4 spaces with no tab characters."
http://docs.moodle.org/dev/Coding_style#Indentation
Style fix: "Inline comments must use the "// " (2 slashes + whitespace) style,
laid out neatly so that it fits among the code and lines up with it."

http://docs.moodle.org/dev/Coding_style#Inline_comments
Style fix: Indentation is 4 spaces, not 2.

http://docs.moodle.org/dev/Coding_style#Indentation
Style fix: Removed trailing white-space.

Whitespace found at the end of line (be mindful of adding new lines that only contain whitespace):
Now using the renderer for for output and inline styles have been moved to styles.css.
Now using get_string() for all language strings.
Now using the html_table class to render the question scoring info.
Reworked viewreport.php SQL to move score subqueries out of the join clause.

These fields need to be in the query directly and can't be moved to per-record
SELECTs during output since they affect ordering of results.
Now displaying the best score rather than the most precise score in the overview.

The only reason it would make sense for people to take a quiz multiple times is to
try to get a better score. Therefore, show the best score in the overview if
multiple attempts are allowed.
Removed bogus comma between firstname and lastname from main overview report