-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCourse.java
179 lines (157 loc) · 4.84 KB
/
Course.java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
/**
* This class is going to set up the courses
* @author word.exe
*/
import java.util.ArrayList;
import java.util.UUID;
public class Course {
private String courseName;
private java.util.UUID courseID;
private Author author;
private ArrayList<Module> modules;
private ArrayList<Comment> comments;
private Boolean isPrivate = true;
/**
* This is going to set up a new course
* @param courseName This is going to be the name of the course
* @param author This is going to be the author of the course
*/
public Course(String courseName, Author author) {
this.courseName = courseName;
this.author = author;
this.courseID = UUID.randomUUID();
this.modules = new ArrayList<Module>();
this.comments = new ArrayList<Comment>();
}
/**
* This is going to set up a specific course with the name author and id
* @param courseName This is going to be the name of the course
* @param author This is going to be the author of the course
* @param courseID This is going to be the ID of the course
*/
public Course(String courseName, Author author, UUID courseID) {
this.courseName = courseName;
this.author = author;
this.courseID = courseID;
this.modules = new ArrayList<Module>();
this.comments = new ArrayList<Comment>();
}
/**
* This is going to add modules to each course
* @param module the content inside the courses
*/
public void addModule(Module module) {
modules.add(module);
}
/**
* This is going to add modules to the index
* @param module The module is the content inside the courses
* @param moduleIndex the position at which the module is inside the index
*/
public void addModule(Module module, int moduleIndex) {
modules.add(moduleIndex, module);
}
/**
* This is going to allow a user to view the modules in the course
*/
public void viewModules() {
for(Module x: modules) {
System.out.println(x.getModuleName() + "\n");
}
}
/**
* This is going to allow the user to select a module
* @param moduleIndex this is the index position at which the module is located
*/
public void selectModule(int moduleIndex) {
modules.get(moduleIndex);
}
/**
* This is going to print the certificate of completion
* @return the return statement of congratulations
*/
public String printCertificate() {
return "return statement";
}
/**
* This is going to publish the course for users to use
*/
public void publish() {
isPrivate = false;
}
/**
* This is going to allow users to add comments on the bottom of lessons
* @param authorName This is going to show the name of the commenter
* @param commentContent This is going to show the content in the comment
*/
public void addComment(Comment comment) {
comments.add(comment);
}
/**
* This is going to get the course name
* @return the course name
*/
public String getCourseName() {
return this.courseName;
}
/**
* This is going to set the course name
* @param courseName the name of the course
*/
public void setCourseName(String courseName) {
this.courseName = courseName;
}
/**
* This is going to get the course ID
* @return the course ID
*/
public java.util.UUID getCourseID() {
return this.courseID;
}
/**
* This is going to get the author
* @return the author
*/
public Author getAuthor() {
return this.author;
}
/**
* This is going to get the modules
* @return the modules
*/
public ArrayList<Module> getModules() {
return this.modules;
}
/**
* This is going get the comments in the courses
* @return the comments made
*/
public ArrayList<Comment> getComments() {
return this.comments;
}
/**
* This is going to check if the course is private by true or false
* @return true or false based on if it is private
*/
public Boolean getIsPrivate() {
return this.isPrivate;
}
/**
* This is going to set if it is private
* @param isPrivate true or false value on if it is private or not in the course
*/
public void setIsPrivate(Boolean isPrivate) {
this.isPrivate = isPrivate;
}
@Override
public String toString() {
return "{" +
" courseName='" + getCourseName() + "'" +
", courseID='" + getCourseID() + "'" +
", author='" + getAuthor() + "'" +
", modules='" + getModules() + "'" +
", comments='" + getComments() + "'" +
", isPrivate='" + getIsPrivate() + "'" +
"}";
}
}