use of com.instructure.canvasapi2.models.GradeableStudent in project instructure-android by instructure.
the class AssignmentAPI method getFirstPageGradeableStudentsForAssignment.
public static void getFirstPageGradeableStudentsForAssignment(long courseId, long assignmentId, @NonNull RestBuilder adapter, @NonNull StatusCallback<List<GradeableStudent>> callback) {
RestParams params = new RestParams.Builder().withShouldIgnoreToken(false).withPerPageQueryParam(true).build();
callback.addCall(adapter.build(AssignmentInterface.class, params).getFirstPageGradeableStudentsForAssignment(courseId, assignmentId)).enqueue(callback);
}
use of com.instructure.canvasapi2.models.GradeableStudent in project instructure-android by instructure.
the class AssignmentAPI method getNextPageGradeableStudents.
public static void getNextPageGradeableStudents(boolean forceNetwork, @NonNull String nextUrl, @NonNull RestBuilder adapter, @NonNull StatusCallback<List<GradeableStudent>> callback) {
RestParams params = new RestParams.Builder().withShouldIgnoreToken(false).withPerPageQueryParam(true).withForceReadFromNetwork(forceNetwork).build();
callback.addCall(adapter.build(AssignmentInterface.class, params).getNextPageGradeableStudents(nextUrl)).enqueue(callback);
}
use of com.instructure.canvasapi2.models.GradeableStudent in project instructure-android by instructure.
the class AssignmentManager method getAllGradeableStudentsForAssignment.
public static void getAllGradeableStudentsForAssignment(long courseId, long assignmentId, final boolean forceNetwork, StatusCallback<List<GradeableStudent>> callback) {
if (isTesting() || mTesting) {
AssignmentManager_Test.getAllGradeableStudentsForAssignment(courseId, assignmentId, callback);
} else {
final RestBuilder adapter = new RestBuilder(callback);
StatusCallback<List<GradeableStudent>> depaginatedCallback = new ExhaustiveListCallback<GradeableStudent>(callback) {
@Override
public void getNextPage(@NotNull StatusCallback<List<GradeableStudent>> callback, @NotNull String nextUrl, boolean isCached) {
AssignmentAPI.getNextPageGradeableStudents(forceNetwork, nextUrl, adapter, callback);
}
};
adapter.setStatusCallback(depaginatedCallback);
AssignmentAPI.getFirstPageGradeableStudentsForAssignment(courseId, assignmentId, adapter, depaginatedCallback);
}
}
use of com.instructure.canvasapi2.models.GradeableStudent in project instructure-android by instructure.
the class AssignmentManager_Test method getAllGradeableStudentsForAssignment.
public static void getAllGradeableStudentsForAssignment(long courseId, long assignmentId, StatusCallback<List<GradeableStudent>> 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<GradeableStudent> students = new ArrayList<>();
retrofit2.Response<List<GradeableStudent>> response = retrofit2.Response.success(students, httpResponse);
callback.onResponse(response, new LinkHeaders(), ApiType.CACHE);
}
Aggregations