public String generateHtmlResults(ResultConfig config, int refreshDelay) {
if( config.resultType!=ResultType.CourseResult )
return "CN scores can only be computed on courses";
importCN();
Html html = new Html();
includeHeader(html, "result.css"); //$NON-NLS-1$
Vector<Result> results = buildResults(config);
for (Result result : results) {
double courseScore = computeCourseScore(result);
html.nl().tag("h2", "class=\"pool\"", result.getIdentifier()).nl(); //$NON-NLS-1$ //$NON-NLS-2$
html.open("table").nl(); //$NON-NLS-1$
for (RankedRunner data : result.getRanking()) {
RunnerResult r = data.getRunnerData().getResult();
writeHtml(
data.getRunnerData(),
Integer.toString(data.getRank()),
r.formatRacetime(),
Integer.toString((int) (courseScore / r.getRacetime())),
html);
}
html.close("table").nl(); //$NON-NLS-1$
}
return html.close();
}