Commit 3b3ee2bf by Victor Shnayder

Merge branch 'feature/victor/instructor-grading' of github.com:MITx/mitx into…

Merge branch 'feature/victor/instructor-grading' of github.com:MITx/mitx into feature/victor/instructor-grading
parents 7887f556 a498377a
...@@ -18,11 +18,15 @@ class StaffGradingBackend ...@@ -18,11 +18,15 @@ class StaffGradingBackend
mock: (cmd, data) -> mock: (cmd, data) ->
# Return a mock response to cmd and 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' if cmd == 'get_next'
@mock_cnt++ @mock_cnt++
response = response =
success: true success: true
problem_name: 'Problem 1'
num_left: 3
num_total: 5
prompt: 'This is a fake prompt'
submission: 'submission! ' + @mock_cnt submission: 'submission! ' + @mock_cnt
rubric: 'A rubric! ' + @mock_cnt rubric: 'A rubric! ' + @mock_cnt
submission_id: @mock_cnt submission_id: @mock_cnt
...@@ -33,20 +37,18 @@ class StaffGradingBackend ...@@ -33,20 +37,18 @@ class StaffGradingBackend
console.log("eval: #{data.score} pts, Feedback: #{data.feedback}") console.log("eval: #{data.score} pts, Feedback: #{data.feedback}")
response = response =
@mock('get_next', {}) @mock('get_next', {})
else if cmd == 'get_problems' # get_probblem_list
# this one didn't have a name in the LMS--lookup fail # sends in a course_id and a grader_id
p1 = {'location': 'i4x://MITx/3.091x/problem/open_ended_demo',\ # should get back a list of problem_ids, problem_names, num_left, num_total
'name': 'i4x://MITx/3.091x/problem/open_ended_demo',\ else if cmd == 'get_problem_list'
'num_graded': 10,\ response =
'num_to_grade': 90} success: true
problem_list: [
p2 = {'location': 'i4x://MITx/3.091x/problem/open_ended_demo2',\ {location: 'i4x://MITx/3.091x/problem/open_ended_demo', \
'name': 'Open ended demo',\ problem_name: "Problem 1", num_left: 3, num_total: 5},
'num_graded': 42,\ {location: 'i4x://MITx/3.091x/problem/open_ended_demo', \
'num_to_grade': 63} problem_name: "Problem 2", num_left: 1, num_total: 5}
]
response =
problems: [p1, p2]
else else
response = response =
success: false success: false
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment