diff --git a/lms/djangoapps/open_ended_grading/peer_grading_service.py b/lms/djangoapps/open_ended_grading/peer_grading_service.py index cd4a94f26d..70d0721b3b 100644 --- a/lms/djangoapps/open_ended_grading/peer_grading_service.py +++ b/lms/djangoapps/open_ended_grading/peer_grading_service.py @@ -65,6 +65,7 @@ class PeerGradingService(GradingService): return response +_service = None def peer_grading_service(): """ Return a peer grading service instance--if settings.MOCK_PEER_GRADING is True, diff --git a/lms/static/coffee/src/peer_grading/peer_grading_problem.coffee b/lms/static/coffee/src/peer_grading/peer_grading_problem.coffee index 5b7aef18c7..7c0921cc98 100644 --- a/lms/static/coffee/src/peer_grading/peer_grading_problem.coffee +++ b/lms/static/coffee/src/peer_grading/peer_grading_problem.coffee @@ -18,14 +18,27 @@ class PeerGradingProblemBackend success: true calibrated: false else if cmd == 'show_calibration_essay' + #response = + # success: false + # error: "There was an error" response = success: true submission_id: 1 submission_key: 'abcd' - student_response: 'I am a fake response' + student_response: 'I am a fake calibration response' prompt: 'Answer this question' rubric: 'This is a rubric.' max_score: 4 + else if cmd == 'get_next_submission' + response = + success: true + submission_id: 1 + submission_key: 'abcd' + student_response: 'I am a fake student response' + prompt: 'Answer this question' + rubric: 'This is a rubric.' + max_score: 4 + return response @@ -48,35 +61,51 @@ class PeerGradingProblem @submission_container = $('.submission-container') @prompt_container = $('.prompt-container') @rubric_container = $('.rubric-container') + @instructions_panel = $('.instructions-panel') + @content_panel = $('.content-panel') @error_container = $('.error-container') + @submission_key_input = $("input[name='submission-key']") + @essay_id_input = $("input[name='essay-id']") + + @score_selection_container = $('.score-selection-container') + @score = null + + @submit_button = $('.submit-button') + @action_button = $('.action-button') + + @action_button.click -> document.location.reload(true) + @is_calibrated_check() + ########## + # + # Ajax calls to the backend + # + ########## is_calibrated_check: () => - @backend.post('is_student_calibrated', {}, @calibration_check_callback) + @backend.post('is_student_calibrated', {location: @location}, @calibration_check_callback) - - fetch_calibration_essay: ()=> + fetch_calibration_essay: () => @backend.post('show_calibration_essay', {location: @location}, @render_calibration) - render_calibration: (response) => - if response.success - #TODO: fill this in + fetch_submission_essay: () => + @backend.post('get_next_submission', {location: @location}, @render_submission) - @submission_container.html("