Search in sources :

Example 1 with QuizQuestion

use of com.instructure.canvasapi2.models.QuizQuestion in project instructure-android by instructure.

the class QuizManager_Test method getQuizQuestions.

public static void getQuizQuestions(long courseId, long quizId, StatusCallback<List<QuizQuestion>> callback) {
    // TODO:
    Response response = new Response.Builder().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<QuizQuestion> quizQuestions = new ArrayList<>();
    retrofit2.Response<List<QuizQuestion>> response1 = retrofit2.Response.success(quizQuestions, response);
    callback.onResponse(response1, new LinkHeaders(), ApiType.CACHE);
}
Also used : QuizSubmissionResponse(com.instructure.canvasapi2.models.QuizSubmissionResponse) Response(okhttp3.Response) QuizSubmissionQuestionResponse(com.instructure.canvasapi2.models.QuizSubmissionQuestionResponse) LinkHeaders(com.instructure.canvasapi2.utils.LinkHeaders) QuizQuestion(com.instructure.canvasapi2.models.QuizQuestion) ArrayList(java.util.ArrayList) ArrayList(java.util.ArrayList) List(java.util.List)

Example 2 with QuizQuestion

use of com.instructure.canvasapi2.models.QuizQuestion in project instructure-android by instructure.

the class QuizManager method getQuizQuestions.

public static void getQuizQuestions(long courseId, long quizId, StatusCallback<List<QuizQuestion>> callback) {
    if (isTesting() || mTesting) {
        QuizManager_Test.getQuizQuestions(courseId, quizId, callback);
    } else {
        RestBuilder adapter = new RestBuilder(callback);
        RestParams params = new RestParams.Builder().withPerPageQueryParam(true).withShouldIgnoreToken(false).build();
        QuizAPI.getQuizQuestions(courseId, quizId, adapter, callback, params);
    }
}
Also used : RestParams(com.instructure.canvasapi2.builders.RestParams) RestBuilder(com.instructure.canvasapi2.builders.RestBuilder)

Aggregations

RestBuilder (com.instructure.canvasapi2.builders.RestBuilder)1 RestParams (com.instructure.canvasapi2.builders.RestParams)1 QuizQuestion (com.instructure.canvasapi2.models.QuizQuestion)1 QuizSubmissionQuestionResponse (com.instructure.canvasapi2.models.QuizSubmissionQuestionResponse)1 QuizSubmissionResponse (com.instructure.canvasapi2.models.QuizSubmissionResponse)1 LinkHeaders (com.instructure.canvasapi2.utils.LinkHeaders)1 ArrayList (java.util.ArrayList)1 List (java.util.List)1 Response (okhttp3.Response)1