forked from nus-cs2103-AY2223S2/tp
-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #101 from chunzkok/v1.2b-WrapUp
Link Assignments to Student to show live updates to the Assignment system
- Loading branch information
Showing
8 changed files
with
144 additions
and
24 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
package taa.model.student; | ||
|
||
import java.util.ArrayList; | ||
import java.util.List; | ||
|
||
import taa.assignment.Submission; | ||
|
||
/** | ||
* A list of Submissions belonging to a Student. | ||
*/ | ||
public class Submissions { | ||
private List<Submission> submissions; | ||
|
||
public Submissions() { | ||
this.submissions = new ArrayList<>(); | ||
} | ||
|
||
/** | ||
* @param submissions A list containing Submissions. | ||
*/ | ||
public Submissions(List<Submission> submissions) { | ||
this.submissions = submissions; | ||
} | ||
|
||
/** | ||
* Adds a submission. | ||
*/ | ||
public void addSubmission(Submission submission) { | ||
this.submissions.add(submission); | ||
} | ||
|
||
/** | ||
* Removes a submission. | ||
*/ | ||
public void deleteSubmission(Submission submission) { | ||
this.submissions.remove(submission); | ||
} | ||
|
||
/** | ||
* Returns the latest submission. | ||
*/ | ||
public Submission getLatestSubmission() { | ||
Submission latestSubmission = null; | ||
for (Submission submission : this.submissions) { | ||
if (latestSubmission == null || submission.compareTo(latestSubmission) > 0) { | ||
latestSubmission = submission; | ||
} | ||
} | ||
return latestSubmission; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters