use of com.instructure.canvasapi2.models.CanvasContext in project instructure-android by instructure.
the class SubmissionManager method postUrlSubmission.
public static void postUrlSubmission(CanvasContext canvasContext, long assignmentId, String url, boolean isLti, StatusCallback<Submission> callback) {
if (isTesting() || mTesting) {
// TODO
} else {
RestBuilder adapter = new RestBuilder(callback);
RestParams params = new RestParams.Builder().withCanvasContext(canvasContext).build();
String type = isLti ? "basic_lti_launch" : "online_url";
SubmissionAPI.postUrlSubmission(canvasContext.getId(), assignmentId, type, url, adapter, params, callback);
}
}
use of com.instructure.canvasapi2.models.CanvasContext in project instructure-android by instructure.
the class SubmissionManager method postMediaSubmission.
public static void postMediaSubmission(CanvasContext canvasContext, long assignmentId, String submissionType, String mediaId, String mediaType, StatusCallback<Submission> callback) {
if (isTesting() || mTesting) {
// TODO
} else {
RestBuilder adapter = new RestBuilder(callback);
RestParams params = new RestParams.Builder().withCanvasContext(canvasContext).build();
SubmissionAPI.postMediaSubmission(canvasContext.getId(), assignmentId, submissionType, mediaId, mediaType, adapter, params, callback);
}
}
use of com.instructure.canvasapi2.models.CanvasContext in project instructure-android by instructure.
the class TabManager method getTabs.
public static void getTabs(CanvasContext canvasContext, StatusCallback<List<Tab>> callback, boolean forceNetwork) {
if (isTesting() || mTesting) {
// TODO: Add testing
// TabManager_Test.getTabs(callback, courseId)
} else {
RestBuilder adapter = new RestBuilder(callback);
RestParams params = new RestParams.Builder().withCanvasContext(canvasContext).withForceReadFromNetwork(forceNetwork).withShouldIgnoreToken(false).build();
TabAPI.getTabs(canvasContext.getId(), adapter, callback, params);
}
}
use of com.instructure.canvasapi2.models.CanvasContext in project instructure-android by instructure.
the class UserManager method getPeopleList.
public static void getPeopleList(CanvasContext canvasContext, StatusCallback<List<User>> callback, boolean forceNetwork) {
if (isTesting() || mTesting) {
RestBuilder adapter = new RestBuilder(callback);
RestParams params = new RestParams.Builder().withForceReadFromNetwork(forceNetwork).build();
UserManager_Test.getPeopleList(adapter, params, canvasContext.getId(), callback);
} else {
RestBuilder adapter = new RestBuilder(callback);
RestParams params = new RestParams.Builder().withCanvasContext(canvasContext).withPerPageQueryParam(false).withForceReadFromNetwork(forceNetwork).build();
UserAPI.getPeopleList(adapter, params, canvasContext.getId(), callback);
}
}
use of com.instructure.canvasapi2.models.CanvasContext in project instructure-android by instructure.
the class UserManager method getFirstPagePeopleList.
public static void getFirstPagePeopleList(@NonNull CanvasContext canvasContext, boolean forceNetwork, @NonNull StatusCallback<List<User>> callback) {
if (isTesting() || mTesting) {
// TODO
} else {
final RestParams params = new RestParams.Builder().withForceReadFromNetwork(forceNetwork).withPerPageQueryParam(true).withShouldIgnoreToken(false).withCanvasContext(canvasContext).build();
final RestBuilder adapter = new RestBuilder(callback);
UserAPI.getFirstPagePeopleList(adapter, params, canvasContext.getId(), callback);
}
}
Aggregations