From 90076c39e6c46cf17d87c8d46c57786a5f32702b Mon Sep 17 00:00:00 2001 From: Diana Huang Date: Wed, 5 Dec 2012 09:25:05 -0500 Subject: [PATCH 1/2] add in some new mock responses for our staff grading API --- .../coffee/src/staff_grading/staff_grading.coffee | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/lms/static/coffee/src/staff_grading/staff_grading.coffee b/lms/static/coffee/src/staff_grading/staff_grading.coffee index 161fb33b7c..be7837ec93 100644 --- a/lms/static/coffee/src/staff_grading/staff_grading.coffee +++ b/lms/static/coffee/src/staff_grading/staff_grading.coffee @@ -18,10 +18,15 @@ class StaffGradingBackend mock: (cmd, data) -> # Return a mock response to cmd and data + # should take a problem id as an argument if cmd == 'get_next' @mock_cnt++ response = success: true + problem_name: 'Problem 1' + num_left: 3 + num_total: 5 + prompt: 'This is a fake prompt' submission: 'submission! ' + @mock_cnt rubric: 'A rubric! ' + @mock_cnt submission_id: @mock_cnt @@ -32,6 +37,16 @@ class StaffGradingBackend console.log("eval: #{data.score} pts, Feedback: #{data.feedback}") response = @mock('get_next', {}) + # get_probblem_list + # sends in a course_id and a grader_id + # should get back a list of problem_ids, problem_names, num_left, num_total + else if cmd == 'get_problem_list' + response = + success: true + problem_list: [ + {problem_id: 1, problem_name: "Problem 1", num_left: 3, num_total: 5} + {problem_id: 2, problem_name: "Problem 2", num_left: 1, num_total: 5} + ] else response = success: false From 5ebde2a93e1f72008c89c2971c1cd95d82e8e316 Mon Sep 17 00:00:00 2001 From: Diana Huang Date: Wed, 5 Dec 2012 09:42:30 -0500 Subject: [PATCH 2/2] fix comment --- lms/static/coffee/src/staff_grading/staff_grading.coffee | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lms/static/coffee/src/staff_grading/staff_grading.coffee b/lms/static/coffee/src/staff_grading/staff_grading.coffee index 7e8f39acac..f4831e35c4 100644 --- a/lms/static/coffee/src/staff_grading/staff_grading.coffee +++ b/lms/static/coffee/src/staff_grading/staff_grading.coffee @@ -18,7 +18,7 @@ class StaffGradingBackend mock: (cmd, data) -> # Return a mock response to cmd and data - # TODO: needs (optional?) arg for problem location + # should take a location as an argument if cmd == 'get_next' @mock_cnt++ response =