Class GitLabSubmission
- All Implemented Interfaces:
Comparable<VilleSubmissionFields>
,GitLabSubmissionFields
,VilleSubmissionFields
- Direct Known Subclasses:
MyOwnGitlabSubmission
,MyOwnVilleGitLabSubmission
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 integergetGitLabLink()
must start with"https://"
after trimminggetAiDisclosure()
andgetGroupWork()
are returned as-is
This class is appropriate for use with GitLab submission boxes in ViLLe's default format.
-
Field Summary
Fields inherited from class studentrepoloader.model.villecsv.impl.VilleSubmission
villeCsvRow
-
Constructor Summary
ConstructorsConstructorDescriptionGitLabSubmission
(String[] villeCsvRow, ViLLeCsvFile source) Constructs a newDefaultGitLabSubmission
from a full row of CSV fields, along with its parentViLLeCsvFile
for contextual reference. -
Method Summary
Methods inherited from class studentrepoloader.model.villecsv.impl.VilleSubmission
getFirstName, getLastName, getParentFolderName, getStudentId, getTime, getUser, getViLLeCsvFile, getVilleCsvRow, toString
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface studentrepoloader.model.villecsv.mapper.GitLabSubmissionFields
expectedHostPrefix, getRepoUrl
Methods inherited from interface studentrepoloader.model.villecsv.mapper.VilleSubmissionFields
compareTo, getFirstName, getFolderName, getID, getLastName, getParentFolderName, getStudentId, getTime, getUser
-
Constructor Details
-
GitLabSubmission
Constructs a newDefaultGitLabSubmission
from a full row of CSV fields, along with its parentViLLeCsvFile
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 fromViLLeCsvFile#getEntries()
(excluding header line).source
- The originatingViLLeCsvFile
, 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
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 interfaceGitLabSubmissionFields
- Returns:
- string representation of the score
- Throws:
IllegalArgumentException
- if the value is not a valid integer
-
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 interfaceGitLabSubmissionFields
- Returns:
- raw input string as entered found in the CSV-file
-
getAiDisclosure
Returns the AI usage disclosure text from column 7.This may be empty, multiline, or informal text.
- Specified by:
getAiDisclosure
in interfaceGitLabSubmissionFields
- Returns:
- raw disclosure 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 interfaceGitLabSubmissionFields
- Returns:
- raw group work description
-
equals
-
hashCode
-