Class SubmissionResultsData


  • public class SubmissionResultsData
    extends java.lang.Object
    Stores all the data for the compare submissions page or the submission report page
    • Constructor Detail

      • SubmissionResultsData

        public SubmissionResultsData​(IJob job,
                                     ISubmission submission)
                              throws MapperException
        Initialise the report data object
        Parameters:
        job - the job getting the results from
        submission - the submission to report
        Throws:
        MapperException - thrown if the FileMapper isn't initialised correctly
      • SubmissionResultsData

        public SubmissionResultsData​(IJob job,
                                     ISubmission submission1,
                                     ISubmission submission2)
                              throws MapperException
        Initialise the comparison data object
        Parameters:
        job - the job getting the results from
        submission1 - the first submission to compare
        submission2 - the second submission to compare
        Throws:
        MapperException - thrown if the FileMapper isn't initialised correctly
    • Method Detail

      • getSummary

        public java.lang.String getSummary()
        Get the summary for the report, replacing line breaks with html line breaks
        Returns:
        the summary
      • getSubmission1

        public ISubmission getSubmission1()
        Get the first submission
        Returns:
        the submission
      • getSubmission2

        public ISubmission getSubmission2()
        Get the second submission
        Returns:
        the submission
      • getMatches

        public java.util.Map<java.lang.String,​java.util.List<FileMatch>> getMatches()
        Get the list of matches
        Returns:
        the list
      • getSubmissions

        public java.util.List<SubmissionScore> getSubmissions()
        Gets the list of submissions linked to this one
        Returns:
        the list
      • getScore

        public float getScore()
        Get the first submission's score
        Returns:
        the score
      • getScoreGroup

        public int getScoreGroup()
        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.
        Returns:
        the score group
      • getMapJSON

        public java.lang.String getMapJSON()
        Get the file mapper as a JSON string
        Returns:
        the JSON object as a string
      • getMatchesJSON

        public java.lang.String getMatchesJSON()
        Get the list of matches as a JSON string
        Returns:
        the JSON list as a string
      • getMatchedFiles

        public java.util.Map<ISubmission,​java.util.SortedMap<java.lang.Long,​ISourceFile>> getMatchedFiles()
        Returns:
      • getHighlightedLines

        public java.lang.String getHighlightedLines​(long fileId)
        Get the list of plagiarised line numbers converted to a comma separated list for a specific file in the map e.g. if lines 2-10 are mapped to a match, this would return "2,3,4,5,6,7,8,9,10"
        Parameters:
        fileId - the id of the file to get the highlighted lines for
        Returns:
        the comma separated list, or an empty list if the file isn't found