Skip to content

Commit e1c1c9b

Browse files
committed
Courses and exercises
1 parent fdc2b5b commit e1c1c9b

File tree

57 files changed

+128
-1112
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

57 files changed

+128
-1112
lines changed

tmc-plugin/src/fi/helsinki/cs/tmc/actions/AbstractExerciseSensitiveAction.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
11
package fi.helsinki.cs.tmc.actions;
22

3-
import fi.helsinki.cs.tmc.data.Exercise;
3+
import fi.helsinki.cs.tmc.core.domain.Exercise;
44
import fi.helsinki.cs.tmc.events.TmcEventBus;
55
import fi.helsinki.cs.tmc.events.TmcEventListener;
66
import fi.helsinki.cs.tmc.model.CourseDb;
77
import fi.helsinki.cs.tmc.model.ProjectMediator;
8+
89
import java.util.ArrayList;
910
import java.util.Collection;
1011
import java.util.Iterator;

tmc-plugin/src/fi/helsinki/cs/tmc/actions/CheckForNewExercisesOrUpdates.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
package fi.helsinki.cs.tmc.actions;
22

3+
import fi.helsinki.cs.tmc.core.domain.Course;
34
import fi.helsinki.cs.tmc.core.holders.TmcSettingsHolder;
45
import fi.helsinki.cs.tmc.coreimpl.TmcCoreSettingsImpl;
5-
import fi.helsinki.cs.tmc.data.Course;
66
import fi.helsinki.cs.tmc.data.CourseListUtils;
77
import fi.helsinki.cs.tmc.events.TmcEvent;
88
import fi.helsinki.cs.tmc.events.TmcEventBus;

tmc-plugin/src/fi/helsinki/cs/tmc/actions/CheckForNewReviews.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,14 @@
11
package fi.helsinki.cs.tmc.actions;
22

3-
import fi.helsinki.cs.tmc.data.Course;
3+
import fi.helsinki.cs.tmc.core.domain.Course;
44
import fi.helsinki.cs.tmc.data.Review;
55
import fi.helsinki.cs.tmc.model.CourseDb;
66
import fi.helsinki.cs.tmc.model.ReviewDb;
77
import fi.helsinki.cs.tmc.model.ServerAccess;
88
import fi.helsinki.cs.tmc.ui.ConvenientDialogDisplayer;
99
import fi.helsinki.cs.tmc.utilities.BgTask;
1010
import fi.helsinki.cs.tmc.utilities.BgTaskListener;
11+
1112
import java.awt.event.ActionEvent;
1213
import java.awt.event.ActionListener;
1314
import java.util.List;

tmc-plugin/src/fi/helsinki/cs/tmc/actions/CheckForUnopenedExercises.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
package fi.helsinki.cs.tmc.actions;
22

3+
import fi.helsinki.cs.tmc.core.domain.Exercise;
34
import fi.helsinki.cs.tmc.core.holders.TmcSettingsHolder;
45
import fi.helsinki.cs.tmc.coreimpl.TmcCoreSettingsImpl;
5-
import fi.helsinki.cs.tmc.data.Exercise;
66
import fi.helsinki.cs.tmc.model.CourseDb;
77
import fi.helsinki.cs.tmc.model.ProjectMediator;
88
import fi.helsinki.cs.tmc.model.TmcProjectInfo;

tmc-plugin/src/fi/helsinki/cs/tmc/actions/DownloadCompletedExercises.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
package fi.helsinki.cs.tmc.actions;
22

3-
import fi.helsinki.cs.tmc.data.Course;
4-
import fi.helsinki.cs.tmc.data.Exercise;
3+
import fi.helsinki.cs.tmc.core.domain.Course;
4+
import fi.helsinki.cs.tmc.core.domain.Exercise;
55
import fi.helsinki.cs.tmc.events.TmcEvent;
66
import fi.helsinki.cs.tmc.events.TmcEventBus;
77
import fi.helsinki.cs.tmc.model.CourseDb;

tmc-plugin/src/fi/helsinki/cs/tmc/actions/DownloadExercisesAction.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
package fi.helsinki.cs.tmc.actions;
22

3-
import fi.helsinki.cs.tmc.data.Exercise;
3+
import fi.helsinki.cs.tmc.core.domain.Exercise;
44
import fi.helsinki.cs.tmc.events.TmcEvent;
55
import fi.helsinki.cs.tmc.events.TmcEventBus;
66
import fi.helsinki.cs.tmc.model.CourseDb;

tmc-plugin/src/fi/helsinki/cs/tmc/actions/DownloadSolutionAction.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
package fi.helsinki.cs.tmc.actions;
22

3+
import fi.helsinki.cs.tmc.core.domain.Exercise;
34
import fi.helsinki.cs.tmc.core.holders.TmcSettingsHolder;
45
import fi.helsinki.cs.tmc.coreimpl.TmcCoreSettingsImpl;
5-
import fi.helsinki.cs.tmc.data.Exercise;
66
import fi.helsinki.cs.tmc.events.TmcEvent;
77
import fi.helsinki.cs.tmc.events.TmcEventBus;
88
import fi.helsinki.cs.tmc.model.CourseDb;

tmc-plugin/src/fi/helsinki/cs/tmc/actions/PastebinAction.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
package fi.helsinki.cs.tmc.actions;
22

3+
import fi.helsinki.cs.tmc.core.domain.Exercise;
34
import fi.helsinki.cs.tmc.core.holders.TmcSettingsHolder;
45
import fi.helsinki.cs.tmc.coreimpl.TmcCoreSettingsImpl;
5-
import fi.helsinki.cs.tmc.data.Exercise;
66
import fi.helsinki.cs.tmc.events.TmcEvent;
77
import fi.helsinki.cs.tmc.events.TmcEventBus;
88
import fi.helsinki.cs.tmc.model.CourseDb;

tmc-plugin/src/fi/helsinki/cs/tmc/actions/RefreshCoursesAction.java

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,22 @@
11
package fi.helsinki.cs.tmc.actions;
22

3+
import fi.helsinki.cs.tmc.core.TmcCore;
4+
import fi.helsinki.cs.tmc.core.domain.Course;
5+
import fi.helsinki.cs.tmc.core.domain.ProgressObserver;
36
import fi.helsinki.cs.tmc.core.holders.TmcSettingsHolder;
47
import fi.helsinki.cs.tmc.coreimpl.TmcCoreSettingsImpl;
5-
import fi.helsinki.cs.tmc.data.Course;
8+
69
import fi.helsinki.cs.tmc.data.CourseListUtils;
710
import fi.helsinki.cs.tmc.model.CourseDb;
811
import fi.helsinki.cs.tmc.model.ServerAccess;
912
import fi.helsinki.cs.tmc.utilities.BgTaskListener;
1013
import fi.helsinki.cs.tmc.ui.ConvenientDialogDisplayer;
1114
import fi.helsinki.cs.tmc.utilities.BgTask;
1215
import fi.helsinki.cs.tmc.utilities.BgTaskListenerList;
13-
import fi.helsinki.cs.tmc.utilities.CancellableCallable;
1416

1517
import java.util.ArrayList;
1618
import java.util.List;
19+
import java.util.concurrent.Callable;
1720
import java.util.logging.Level;
1821
import java.util.logging.Logger;
1922

@@ -53,15 +56,15 @@ public RefreshCoursesAction addListener(BgTaskListener<List<Course>> listener) {
5356
}
5457

5558
public void run() {
56-
CancellableCallable<List<Course>> courseListTask = serverAccess.getDownloadingCourseListTask();
59+
Callable<List<Course>> courseListTask = TmcCore.get().listCourses(ProgressObserver.NULL_OBSERVER);
5760

5861
BgTask.start("Refreshing course list", courseListTask, new BgTaskListener<List<Course>>() {
5962

6063
@Override
6164
public void bgTaskReady(final List<Course> courses) {
6265
Course currentCourseStub = CourseListUtils.getCourseByName(courses, courseDb.getCurrentCourseName());
6366
if (currentCourseStub != null) {
64-
CancellableCallable<Course> currentCourseTask = serverAccess.getFullCourseInfoTask(currentCourseStub);
67+
Callable<Course> currentCourseTask = TmcCore.get().getCourseDetails(ProgressObserver.NULL_OBSERVER, currentCourseStub);
6568

6669
BgTask.start("Loading course", currentCourseTask, new BgTaskListener<Course>() {
6770
@Override

tmc-plugin/src/fi/helsinki/cs/tmc/actions/RequestReviewAction.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
package fi.helsinki.cs.tmc.actions;
22

3+
import fi.helsinki.cs.tmc.core.domain.Exercise;
34
import fi.helsinki.cs.tmc.core.holders.TmcSettingsHolder;
45
import fi.helsinki.cs.tmc.coreimpl.TmcCoreSettingsImpl;
56

67
import com.google.gson.Gson;
78

8-
import fi.helsinki.cs.tmc.data.Exercise;
99
import fi.helsinki.cs.tmc.events.TmcEvent;
1010
import fi.helsinki.cs.tmc.events.TmcEventBus;
1111
import fi.helsinki.cs.tmc.model.CourseDb;

0 commit comments

Comments
 (0)