Skip to content

Commit

Permalink
gwt: Drop using deprecated getResults service call.
Browse files Browse the repository at this point in the history
  • Loading branch information
calin-iorgulescu committed Jan 20, 2015
1 parent 53b4bd7 commit e1440b6
Showing 1 changed file with 15 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@ public class HTTPService {
public static String GET_USER_RESULTS_URL = VMCHECKER_SERVICES_URL + "getUserResults";
public static String GET_UPLOADED_MD5_URL = VMCHECKER_SERVICES_URL + "getUploadedMd5";
public static String GET_ALL_RESULTS_URL = VMCHECKER_SERVICES_URL + "getAllGrades";
public static String GET_RESULTS_URL = VMCHECKER_SERVICES_URL + "getResults";
public static String GET_STORAGE_FILE_LIST_URL = VMCHECKER_SERVICES_URL + "getStorageDirContents";
public static String PERFORM_AUTHENTICATION_URL = VMCHECKER_SERVICES_URL + "login";
public static String LOGOUT_URL = VMCHECKER_SERVICES_URL + "logout";
Expand Down Expand Up @@ -72,16 +71,6 @@ public void getAssignments(String courseId, final AsyncCallback<Assignment[]> ca
delegate.sendRequest(callback, new AssignmentsListDecoder(), params);
}

public void getResults(String courseId, String assignmentId,
final AsyncCallback<EvaluationResult[]> callback) {
Delegate<EvaluationResult[]> delegate =
new Delegate<EvaluationResult[]>(eventBus, GET_RESULTS_URL, true, true);
HashMap<String, String> params = new HashMap<String, String>();
params.put("courseId", courseId);
params.put("assignmentId", assignmentId);
delegate.sendRequest(callback, new ResultDecoder(), params);
}

public void getUploadedMd5(String courseId, String assignmentId,
final AsyncCallback<Md5Status> callback) {
Delegate<Md5Status> delegate =
Expand All @@ -102,6 +91,21 @@ public void getStorageDirContents(String courseId, String assignmentId,
delegate.sendRequest(callback, new FileListDecoder(), params);
}

/*
* getResults() and getUserResults() call the same service: GET_USER_RESULTS.
* However, getResults() doesn't send the user as a parameter, thus getting information
* about the current user.
*/
public void getResults(String courseId, String assignmentId,
final AsyncCallback<EvaluationResult[]> callback) {
Delegate<EvaluationResult[]> delegate =
new Delegate<EvaluationResult[]>(eventBus, GET_USER_RESULTS_URL, true, true);
HashMap<String, String> params = new HashMap<String, String>();
params.put("courseId", courseId);
params.put("assignmentId", assignmentId);
delegate.sendRequest(callback, new ResultDecoder(), params);
}

public void getUserResults(String courseId, String assignmentId, String username,
final AsyncCallback<EvaluationResult[]> callback) {
Delegate<EvaluationResult[]> delegate =
Expand Down

0 comments on commit e1440b6

Please sign in to comment.