/*
 * Copyright 2015 Ryan Gilera.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package com.github.daytron.revworks.model;

import java.io.File;
import java.time.LocalDateTime;

/**
 * Coursework model class for coursework table.
 *
 * @author Ryan Gilera
 */
@SuppressWarnings("serial")
public class Coursework {

    private final int id;
    private final String title;
    private final LocalDateTime dateSubmitted;
    private final String fileExtension;
    private final File courseworkFile;
    private final ClassTable classTable;
    private final StudentUser studentUser;

    public Coursework(int id, String title, LocalDateTime dateSubmitted,
            File courseworkFile, String fileExtension, ClassTable classTable, 
            StudentUser studentUser) {
        this.id = id;
        this.title = title;
        this.dateSubmitted = dateSubmitted;
        this.fileExtension = fileExtension;
        this.courseworkFile = courseworkFile;
        this.classTable = classTable;
        this.studentUser = studentUser;
    }

    public ClassTable getClassTable() {
        return classTable;
    }

    public int getId() {
        return id;
    }

    public String getTitle() {
        return title;
    }

    public LocalDateTime getDateSubmitted() {
        return dateSubmitted;
    }

    public StudentUser getStudentUser() {
        return studentUser;
    }

    public File getCourseworkFile() {
        return courseworkFile;
    }

    public String getFileExtension() {
        return fileExtension;
    }

}

@@ -686,16 +686,67 @@
 ateTime;
+%0Aimport java.util.ArrayList;%0Aimport java.util.List;
 %0A%0A/**%0A *
@@ -1143,16 +1143,56 @@
 entUser;
+%0A    private List%3CReview%3E listOfReviews;
 %0A%0A    pu
@@ -1630,32 +1630,329 @@
  = studentUser;%0A
+        %0A        // Initially set to empty when coursework module view is launched%0A        // Then set it with new set of Review objects only when user %0A        // decides to open a particular coursework, this way it saves up %0A        // resources.%0A        this.listOfReviews = new ArrayList%3C%3E();%0A
     %7D%0A%0A    publi
@@ -2439,10 +2439,210 @@
 %0A    %7D%0A%0A
+    public List%3CReview%3E getListOfReviews() %7B%0A        return listOfReviews;%0A    %7D%0A%0A    public void setListOfReviews(List%3CReview%3E listOfReviews) %7B%0A        this.listOfReviews = listOfReviews;%0A    %7D%0A    %0A
 %7D%0A

Modify coursework to include list of reviews.