Class ResultsHelper
- java.lang.Object
-
- uk.ac.warwick.dcs.sherlock.module.web.data.results.ResultsHelper
-
public class ResultsHelper extends java.lang.Object
Functions used by multiple classes involved with displaying the analysis results to the user
-
-
Field Summary
Fields Modifier and Type Field Description static java.util.List<java.lang.String>
colours
Array of colours for the get colour method
-
Constructor Summary
Constructors Constructor Description ResultsHelper()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static java.lang.String
getColour(int id)
Fetches a colour code for a match from the colour list above, or randomly generates one if the index is out of boundsstatic int
getScoreGroup(float score)
All scores are grouped into 10 groups: 0-10, 10-20, 20-30, 30-40, 40-50, 50-60, 60-70, 70-80, 80-90 or 90-100 Get the group this score belongs to.static ISubmission
getSubmission(WorkspaceWrapper workspaceWrapper, long submissionid)
Tries to find the submission in the workspace supplied.static java.lang.String
randomColour()
Generates a random HEX colour code (e.g.
-
-
-
Method Detail
-
getSubmission
public static ISubmission getSubmission(WorkspaceWrapper workspaceWrapper, long submissionid) throws SubmissionNotFound
Tries to find the submission in the workspace supplied.- Parameters:
workspaceWrapper
- the wrapper class of the workspace to searchsubmissionid
- the id of the submission to find- Returns:
- the ISubmission object of the submission
- Throws:
SubmissionNotFound
- if the submission was not found in the workspace supplied
-
getColour
public static java.lang.String getColour(int id)
Fetches a colour code for a match from the colour list above, or randomly generates one if the index is out of bounds- Parameters:
id
- the id/index of the match- Returns:
- the hex colour code
-
randomColour
public static java.lang.String randomColour()
Generates a random HEX colour code (e.g. "#ffffff")- Returns:
- the colour code
-
getScoreGroup
public static int getScoreGroup(float score)
All scores are grouped into 10 groups: 0-10, 10-20, 20-30, 30-40, 40-50, 50-60, 60-70, 70-80, 80-90 or 90-100 Get the group this score belongs to.- Parameters:
score
- the score to find the group of- Returns:
- the score group
-
-