Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature 7 - Course enrolment and course creation #15

Closed
wants to merge 4 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions .idea/misc.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

66 changes: 51 additions & 15 deletions src/main/java/entities/Course.java
Original file line number Diff line number Diff line change
@@ -1,34 +1,70 @@
package entities;

import java.util.List;
import java.util.ArrayList;

/**
* entity layer
*/
public class Course {
/*
/**
class for Course entity with private instance variables
uses StudentUser, InstructorUser, and Task entity classes
using StudentUser, InstructorUser, and Task entities
*/
public String courseName;
public String courseInstructor;
public List<String> students; // will be storing the IDs of students
private int numStudents;
public List<String> tasks; // will be storing the tasks IDs
public Boolean publish;
private String courseName;
private String courseInstructor;
private ArrayList<String> students; // stores the IDs of students enrolled in the course
private ArrayList<String> tasks; // stores the IDs of the course's tasks
private Boolean published;

/**
* Creates a new Course with a course name and a list of tasks
* Creates a new Course with a course name, instructor, and a list of tasks
* @param courseName the name of the course
* @param courseInstructor the name of the course instructor
* @param tasks the tasks corresponding to the course
*/
public Course(String courseName, List<String> tasks) {
public Course(String courseName, String courseInstructor, ArrayList<String> tasks) {
this.courseName = courseName;
this.courseInstructor = courseInstructor;
this.tasks = tasks;
this.courseInstructor = "pgries";
this.students = new ArrayList<>(numStudents);
this.numStudents = 0;
this.publish = false; // course creation, default set to not yet published
this.students = new ArrayList<String>();
this.published = false; // course creation, default set to not yet published
}

/**
all getters
*/
public String getCourseName() {
return courseName;
}
public String getCourseInstructor() {
return courseInstructor;
}
public ArrayList<String> getStudents() {
return new ArrayList<String>(this.students);
}
public ArrayList<String> getTasks() {
return new ArrayList<String>(this.tasks);
}
public Boolean getPublished() {
return published;
}

/**
all setters
*/
public void setCourseName(String courseName) {
this.courseName = courseName;
}
public void setCourseInstructor(String courseInstructor) {
this.courseInstructor = courseInstructor;
}
public void setStudents(ArrayList<String> students) {
this.students = new ArrayList<String>(students);
}
public void setTasks(ArrayList<String> tasks) {
this.tasks = new ArrayList<String>(tasks);
}
public void setPublished(Boolean published) {
this.published = published;
}
}