use of com.instructure.canvasapi2.models.Submission in project instructure-android by instructure.
the class SubmissionManager method postSubmissionAttachmentsSynchronous.
@Nullable
public static Submission postSubmissionAttachmentsSynchronous(long courseId, long assignmentId, List<Long> attachmentsIds) {
if (isTesting() || mTesting) {
// TODO
} else {
RestBuilder adapter = new RestBuilder();
RestParams params = new RestParams.Builder().build();
return SubmissionAPI.postSubmissionAttachmentsSynchronous(courseId, assignmentId, attachmentsIds, adapter, params);
}
return null;
}
use of com.instructure.canvasapi2.models.Submission in project instructure-android by instructure.
the class SubmissionManager method postSubmissionGrade.
public static void postSubmissionGrade(long courseId, long assignmentId, long userId, String score, boolean isExcused, boolean forceNetwork, @NonNull StatusCallback<Submission> callback) {
if (isTesting() | mTesting) {
// SubmissionManager_Test.postSubmissionGrade(courseId, assignmentId, userId, score, callback);
} else {
RestBuilder adapter = new RestBuilder(callback);
RestParams params = new RestParams.Builder().withForceReadFromNetwork(forceNetwork).withPerPageQueryParam(false).withShouldIgnoreToken(false).build();
SubmissionAPI.postSubmissionGrade(courseId, assignmentId, userId, score, isExcused, adapter, callback, params);
}
}
use of com.instructure.canvasapi2.models.Submission in project instructure-android by instructure.
the class AssignmentManager_Test method getAllSubmissionsForAssignment.
public static void getAllSubmissionsForAssignment(long courseId, long assignmentId, StatusCallback<List<Submission>> callback) {
// TODO:
Response httpResponse = new Response.Builder().request(new Request.Builder().url("https://test.com").build()).code(200).message("todo").protocol(Protocol.HTTP_1_0).body(ResponseBody.create(MediaType.parse("application/json"), "todo".getBytes())).addHeader("content-type", "application/json").build();
List<Submission> submissions = new ArrayList<>();
retrofit2.Response<List<Submission>> response = retrofit2.Response.success(submissions, httpResponse);
callback.onResponse(response, new LinkHeaders(), ApiType.CACHE);
}
Aggregations