Search in sources :

Example 66 with CanvasContext

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

the class QuizManager method getDetailedQuiz.

public static void getDetailedQuiz(final CanvasContext canvasContext, long quizId, final boolean forceNetwork, final StatusCallback<Quiz> callback) {
    final RestBuilder adapter = new RestBuilder(callback);
    final RestParams params = new RestParams.Builder().withPerPageQueryParam(true).withShouldIgnoreToken(false).withForceReadFromNetwork(forceNetwork).build();
    QuizAPI.getDetailedQuiz(canvasContext, quizId, adapter, params, callback);
}
Also used : RestParams(com.instructure.canvasapi2.builders.RestParams) RestBuilder(com.instructure.canvasapi2.builders.RestBuilder) RestBuilder(com.instructure.canvasapi2.builders.RestBuilder)

Example 67 with CanvasContext

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

the class QuizManager method postQuizSubmit.

public static void postQuizSubmit(CanvasContext canvasContext, QuizSubmission quizSubmission, boolean forceNetwork, final StatusCallback<QuizSubmissionResponse> callback) {
    final RestBuilder adapter = new RestBuilder(callback);
    final RestParams params = new RestParams.Builder().withPerPageQueryParam(true).withShouldIgnoreToken(false).withForceReadFromNetwork(forceNetwork).build();
    QuizAPI.postQuizSubmit(canvasContext, quizSubmission, adapter, params, callback);
}
Also used : RestParams(com.instructure.canvasapi2.builders.RestParams) RestBuilder(com.instructure.canvasapi2.builders.RestBuilder) RestBuilder(com.instructure.canvasapi2.builders.RestBuilder)

Example 68 with CanvasContext

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

the class QuizManager method getQuizSubmissions.

public static void getQuizSubmissions(CanvasContext canvasContext, long quizId, final boolean forceNetwork, StatusCallback<QuizSubmissionResponse> callback) {
    if (isTesting() || mTesting) {
        QuizManager_Test.getQuizSubmissions(callback);
    } else {
        RestBuilder adapter = new RestBuilder(callback);
        RestParams params = new RestParams.Builder().withPerPageQueryParam(true).withShouldIgnoreToken(false).withForceReadFromNetwork(forceNetwork).build();
        QuizAPI.getQuizSubmissions(canvasContext, quizId, adapter, callback, params);
    }
}
Also used : RestParams(com.instructure.canvasapi2.builders.RestParams) RestBuilder(com.instructure.canvasapi2.builders.RestBuilder) RestBuilder(com.instructure.canvasapi2.builders.RestBuilder)

Example 69 with CanvasContext

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

the class QuizManager method submitQuiz.

public static void submitQuiz(CanvasContext canvasContext, QuizSubmission quizSubmission, final boolean forceNetwork, final StatusCallback<QuizSubmissionResponse> callback) {
    final RestBuilder adapter = new RestBuilder(callback);
    final RestParams params = new RestParams.Builder().withPerPageQueryParam(true).withShouldIgnoreToken(false).withForceReadFromNetwork(forceNetwork).build();
    QuizAPI.submitQuiz(canvasContext, quizSubmission, adapter, params, callback);
}
Also used : RestParams(com.instructure.canvasapi2.builders.RestParams) RestBuilder(com.instructure.canvasapi2.builders.RestBuilder) RestBuilder(com.instructure.canvasapi2.builders.RestBuilder)

Example 70 with CanvasContext

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

the class SubmissionManager method postTextSubmission.

public static void postTextSubmission(CanvasContext canvasContext, long assignmentId, String text, StatusCallback<Submission> callback) {
    if (isTesting() || mTesting) {
    // TODO
    } else {
        RestBuilder adapter = new RestBuilder(callback);
        RestParams params = new RestParams.Builder().withCanvasContext(canvasContext).build();
        SubmissionAPI.postTextSubmission(canvasContext.getId(), assignmentId, text, adapter, params, callback);
    }
}
Also used : RestParams(com.instructure.canvasapi2.builders.RestParams) RestBuilder(com.instructure.canvasapi2.builders.RestBuilder) RestBuilder(com.instructure.canvasapi2.builders.RestBuilder)

Aggregations

RestBuilder (com.instructure.canvasapi2.builders.RestBuilder)60 RestParams (com.instructure.canvasapi2.builders.RestParams)55 CanvasContext (com.instructure.canvasapi2.models.CanvasContext)19 StatusCallback (com.instructure.canvasapi2.StatusCallback)8 LinkHeaders (com.instructure.canvasapi2.utils.LinkHeaders)7 List (java.util.List)7 ApiType (com.instructure.canvasapi2.utils.ApiType)6 ExhaustiveListCallback (com.instructure.canvasapi2.utils.ExhaustiveListCallback)6 DiscussionTopicHeader (com.instructure.canvasapi2.models.DiscussionTopicHeader)5 FileFolder (com.instructure.canvasapi2.models.FileFolder)5 ArrayList (java.util.ArrayList)5 NotNull (org.jetbrains.annotations.NotNull)5 NonNull (android.support.annotation.NonNull)4 View (android.view.View)4 TextView (android.widget.TextView)4 UpdateFileFolder (com.instructure.canvasapi2.models.UpdateFileFolder)4 Bundle (android.os.Bundle)3 ImageView (android.widget.ImageView)3 BindView (butterknife.BindView)3 Course (com.instructure.canvasapi2.models.Course)3