Class GitLabSubmission

java.lang.Object
studentrepoloader.model.villecsv.impl.VilleSubmission
studentrepoloader.model.villecsv.impl.GitLabSubmission
All Implemented Interfaces:
Comparable<VilleSubmissionFields>, GitLabSubmissionFields, VilleSubmissionFields
Direct Known Subclasses:
MyOwnGitlabSubmission, MyOwnVilleGitLabSubmission

public class GitLabSubmission extends VilleSubmission implements GitLabSubmissionFields
Default implementation of GitLabSubmissionFields, extending the base fields defined in VilleSubmission.

This implementation assumes the input String[] contains the following nine fields, in this exact order:

 User$First name$Last name$Time$Student number or other id code$Score$
 Liitä linkki Gitlab-repositorioosi tähän.$
 Jos käytit tehtävän tai tehtävien teossa apuna AI-työkalua (esim. ChatGPT tai Copilot), liitä tähän käymäsi keskustelu tai linkki siihen.$
 Jos teit demotehtävät ryhmässä, kerro tähän keitä ryhmässä oli ja miten vastuu ryhmässä jakautui.$
 

The core fields (indices 0–4) are handled by DefaultVilleSubmission, including validation for email, name, and date formatting. This subclass adds additional validations:

  • getScore() must be an integer
  • getGitLabLink() must start with "https://" after trimming
  • getAiDisclosure() and getGroupWork() are returned as-is

This class is appropriate for use with GitLab submission boxes in ViLLe's default format.

  • Constructor Details

    • GitLabSubmission

      public GitLabSubmission(String[] villeCsvRow, ViLLeCsvFile source)
      Constructs a new DefaultGitLabSubmission from a full row of CSV fields, along with its parent ViLLeCsvFile for contextual reference.

      This constructor is required by the SubmissionMapper, which uses reflection to instantiate submissions. It must remain public and must accept exactly (String[], ViLLeCsvFile).

      The row must contain exactly 9 fields, following the standard GitLab submission task format exported by ViLLe.

      Parameters:
      villeCsvRow - Full CSV row from ViLLeCsvFile#getEntries() (excluding header line).
      source - The originating ViLLeCsvFile, which can be used to derive the clone target folder name.
      Throws:
      IllegalArgumentException - if the row is malformed or does not match expected structure.
  • Method Details

    • getScore

      public String getScore()
      Returns the numeric score from column 5.

      The value must be parseable as an integer. If parsing fails, an exception is thrown.

      Specified by:
      getScore in interface GitLabSubmissionFields
      Returns:
      string representation of the score
      Throws:
      IllegalArgumentException - if the value is not a valid integer
    • getGitLabLink

      public String getGitLabLink()
      Returns the raw GitLab link field from column 6 without any processing.

      This is the student's original input, which may include SSH links, UI URLs, extra text, or malformed content. This method does not perform any sanitation and is suitable for diagnostics or logging.

      Specified by:
      getGitLabLink in interface GitLabSubmissionFields
      Returns:
      raw input string as entered found in the CSV-file
    • getAiDisclosure

      public String getAiDisclosure()
      Returns the AI usage disclosure text from column 7.

      This may be empty, multiline, or informal text.

      Specified by:
      getAiDisclosure in interface GitLabSubmissionFields
      Returns:
      raw disclosure string
    • getGroupWork

      public String getGroupWork()
      Returns the student's group work description from column 8.

      This may be empty or multiline, depending on the submission.

      Specified by:
      getGroupWork in interface GitLabSubmissionFields
      Returns:
      raw group work description
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object