You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
System.out.println("----------------- END PARSING TEST ------------------\n");
60
78
}
61
79
62
-
publicstaticvoidtestCourse(Coursec){
63
-
if(c.getTitle() == null)
80
+
privatestaticinttestCourse(Coursec){
81
+
if(c.getTitle() == null) {
64
82
System.out.println("ERROR: Course 'title' must not be empty!");
83
+
return1;
84
+
}
65
85
66
-
if(c.getStartDate() == null)
86
+
if(c.getStartDate() == null) {
67
87
System.out.println("ERROR: Course 'startDate' must not be empty! (" + c.getTitle() + ")");
88
+
return1;
89
+
}
68
90
69
-
if(c.getEndDate() == null)
91
+
if(c.getEndDate() == null) {
70
92
System.out.println("ERROR: Course 'endDate' must not be empty! (" + c.getTitle() + ")");
93
+
return1;
94
+
}
95
+
96
+
return0;
71
97
}
72
98
73
-
publicstaticvoidtestAssignment(Assignmenta){
74
-
if(a.getTitle() == null)
75
-
System.out.println("ERROR: Assignment 'title' must not be empty! (" + a.getTitle() + ")");
99
+
privatestaticinttestAssignment(Assignmenta) {
76
100
77
-
if(a.getPublishDate() == null)
78
-
System.out.println("ERROR: Assignment 'publishDate' must not be empty! (" + a.getTitle() + ")");
101
+
if (a.getTitle() == null) {
102
+
System.out.println("ERROR: Assignment 'title' must not be empty! (Assignment " + a.getIndex() + " - " + a.getTitle() + ")");
103
+
return1;
104
+
}
79
105
80
-
if(a.getDueDate()== null)
81
-
System.out.println("ERROR: Assignment 'dueDate' must not be empty! (" + a.getTitle() + ")");
106
+
if (a.getPublishDate() == null) {
107
+
System.out.println("ERROR: Assignment 'publishDate' must not be empty! (Assignment " + a.getIndex() + " - " + a.getTitle() + ")");
108
+
return1;
109
+
}
110
+
111
+
if (a.getDueDate() == null) {
112
+
System.out.println("ERROR: Assignment 'dueDate' must not be empty! (Assignment " + a.getIndex() + " - " + a.getTitle() + ")");
113
+
return1;
114
+
}
115
+
116
+
return0;
82
117
}
83
118
84
-
publicstaticvoidtestExercise(Exercisee){
85
-
if(e.getType() == null) {
86
-
System.out.println("ERROR: Exercise 'type' must not be empty! (Exercise " + e.getIndex() + ")");
119
+
privatestaticinttestExercise(Exercisee) {
120
+
Assignmenta = e.getAssignment();
87
121
88
-
}else{
122
+
if (e.getType() == null) {
123
+
System.out.println("ERROR: Exercise 'type' must not be empty! (Assignment " + a.getIndex() + " / Exercise " + e.getIndex() + ")");
124
+
return1;
125
+
} else {
89
126
if ((e.getType() == ExerciseType.code || e.getType() == ExerciseType.codeSnippet) &&
90
-
e.getLanguage() == null)
91
-
System.out.println("ERROR: Exercise of type 'code' and 'codeSnippet' needs to provide a 'language'! (Exercise " + e.getIndex() + ")");
127
+
e.getLanguage() == null) {
128
+
System.out.println("ERROR: Exercise of type 'code' and 'codeSnippet' needs to provide a 'language'! (Assignment " + a.getIndex() + " / Exercise " + e.getIndex() + ")");
129
+
return1;
130
+
}
92
131
93
132
if ((e.getType() == ExerciseType.multipleChoice || e.getType() == ExerciseType.singleChoice) &&
94
-
e.getOptions() == null)
95
-
System.out.println("ERROR: Exercise of type 'singleChoice' and 'multipleChoice' must provide ¨options¨! (Exercise " + e.getIndex() + ")");
133
+
e.getOptions() == null) {
134
+
System.out.println("ERROR: Exercise of type 'singleChoice' and 'multipleChoice' must provide ¨options¨! (Assignment " + a.getIndex() + " / Exercise " + e.getIndex() + ")");
System.out.println("ERROR: Exercise of type 'singleChoice', 'multipleChoice' and 'text' must provide 'solutions'! (Exercise " + e.getIndex() + ")");
139
+
e.getSolutions() == null) {
140
+
System.out.println("ERROR: Exercise of type 'singleChoice', 'multipleChoice' and 'text' must provide 'solutions'! (Assignment " + a.getIndex() + " / Exercise " + e.getIndex() + ")");
0 commit comments