use of com.instructure.canvasapi2.models.Quiz in project instructure-android by instructure.
the class QuizManager method getQuizzes.
public static void getQuizzes(long courseId, final boolean forceNetwork, StatusCallback<List<Quiz>> callback) {
if (isTesting() || mTesting) {
QuizManager_Test.getQuizesQuestions(callback);
} else {
RestBuilder adapter = new RestBuilder(callback);
RestParams params = new RestParams.Builder().withPerPageQueryParam(true).withShouldIgnoreToken(false).withForceReadFromNetwork(forceNetwork).build();
QuizAPI.getQuizzes(courseId, adapter, callback, params);
}
}
use of com.instructure.canvasapi2.models.Quiz in project instructure-android by instructure.
the class QuizManager method getQuiz.
public static void getQuiz(long courseId, long quizId, final boolean forceNetwork, StatusCallback<Quiz> callback) {
if (isTesting() || mTesting) {
QuizManager_Test.getQuiz(callback);
} else {
RestBuilder adapter = new RestBuilder(callback);
RestParams params = new RestParams.Builder().withPerPageQueryParam(false).withShouldIgnoreToken(false).withForceReadFromNetwork(forceNetwork).build();
QuizAPI.getQuiz(courseId, quizId, adapter, callback, params);
}
}
use of com.instructure.canvasapi2.models.Quiz in project instructure-android by instructure.
the class QuizManager method editQuiz.
public static void editQuiz(long courseId, long quizId, QuizPostBody body, final StatusCallback<Quiz> callback) {
if (isTesting() || mTesting) {
QuizManager_Test.editQuiz(body, callback);
} else {
RestBuilder adapter = new RestBuilder(callback);
RestParams params = new RestParams.Builder().withPerPageQueryParam(false).withShouldIgnoreToken(false).build();
QuizPostBodyWrapper bodyWrapper = new QuizPostBodyWrapper();
bodyWrapper.setQuiz(body);
QuizAPI.editQuiz(courseId, quizId, bodyWrapper, adapter, callback, params);
}
}
use of com.instructure.canvasapi2.models.Quiz in project instructure-android by instructure.
the class QuizAPI method getFirstPageQuizzes.
public static void getFirstPageQuizzes(long contextId, boolean forceNetwork, @NonNull RestBuilder adapter, @NonNull StatusCallback<List<Quiz>> callback) {
RestParams params = new RestParams.Builder().withShouldIgnoreToken(false).withPerPageQueryParam(true).withForceReadFromNetwork(forceNetwork).build();
callback.addCall(adapter.build(QuizInterface.class, params).getFirstPageQuizzes(contextId)).enqueue(callback);
}
use of com.instructure.canvasapi2.models.Quiz in project instructure-android by instructure.
the class QuizAPI method getNextPageQuizzes.
public static void getNextPageQuizzes(boolean forceNetwork, String nextUrl, RestBuilder adapter, @NonNull StatusCallback<List<Quiz>> callback) {
RestParams params = new RestParams.Builder().withShouldIgnoreToken(false).withPerPageQueryParam(true).withForceReadFromNetwork(forceNetwork).build();
callback.addCall(adapter.build(QuizInterface.class, params).getNextPageQuizzes(nextUrl)).enqueue(callback);
}
Aggregations