Commit a1552654 by Victor Shnayder

minor whitespace + comment fixes

parent 6cc19639
...@@ -68,7 +68,7 @@ class CorrectMap(object): ...@@ -68,7 +68,7 @@ class CorrectMap(object):
correct_map is saved by LMS as a plaintext JSON dump of the correctmap dict. This correct_map is saved by LMS as a plaintext JSON dump of the correctmap dict. This
means that when the definition of CorrectMap (e.g. its properties) are altered, means that when the definition of CorrectMap (e.g. its properties) are altered,
an existing correct_map dict not coincide with the newest CorrectMap format as an existing correct_map dict will not coincide with the newest CorrectMap format as
defined by self.set. defined by self.set.
For graceful migration, feed the contents of each correct map to self.set, rather than For graceful migration, feed the contents of each correct map to self.set, rather than
......
...@@ -149,6 +149,7 @@ class LoncapaResponse(object): ...@@ -149,6 +149,7 @@ class LoncapaResponse(object):
# for convenience # for convenience
self.answer_id = self.answer_ids[0] self.answer_id = self.answer_ids[0]
# map input_id -> maxpoints
self.maxpoints = dict() self.maxpoints = dict()
for inputfield in self.inputfields: for inputfield in self.inputfields:
# By default, each answerfield is worth 1 point # By default, each answerfield is worth 1 point
...@@ -280,17 +281,14 @@ class LoncapaResponse(object): ...@@ -280,17 +281,14 @@ class LoncapaResponse(object):
(correctness, npoints, msg) for each answer_id. (correctness, npoints, msg) for each answer_id.
Arguments: Arguments:
- student_answers : dict of (answer_id,answer) where answer = student input (string) - student_answers : dict of (answer_id, answer) where answer = student input (string)
- old_cmap : previous CorrectMap (may be empty); useful for analyzing or
recording history of responses
''' '''
pass pass
@abc.abstractmethod @abc.abstractmethod
def get_answers(self): def get_answers(self):
''' '''
Return a dict of (answer_id,answer_text) for each answer for this question. Return a dict of (answer_id, answer_text) for each answer for this question.
''' '''
pass pass
......
...@@ -538,15 +538,9 @@ class CapaModule(XModule): ...@@ -538,15 +538,9 @@ class CapaModule(XModule):
lcp_id = self.lcp.problem_id lcp_id = self.lcp.problem_id
correct_map = self.lcp.grade_answers(answers) correct_map = self.lcp.grade_answers(answers)
except StudentInputError as inst: except StudentInputError as inst:
# TODO (vshnayder): why is this line here?
#self.lcp = LoncapaProblem(self.definition['data'],
# id=lcp_id, state=old_state, system=self.system)
log.exception("StudentInputError in capa_module:problem_check") log.exception("StudentInputError in capa_module:problem_check")
return {'success': inst.message} return {'success': inst.message}
except Exception, err: except Exception, err:
# TODO: why is this line here?
#self.lcp = LoncapaProblem(self.definition['data'],
# id=lcp_id, state=old_state, system=self.system)
if self.system.DEBUG: if self.system.DEBUG:
msg = "Error checking problem: " + str(err) msg = "Error checking problem: " + str(err)
msg += '\nTraceback:\n' + traceback.format_exc() msg += '\nTraceback:\n' + traceback.format_exc()
......
...@@ -337,7 +337,7 @@ def xqueue_callback(request, course_id, userid, id, dispatch): ...@@ -337,7 +337,7 @@ def xqueue_callback(request, course_id, userid, id, dispatch):
''' '''
# Test xqueue package, which we expect to be: # Test xqueue package, which we expect to be:
# xpackage = {'xqueue_header': json.dumps({'lms_key':'secretkey',...}), # xpackage = {'xqueue_header': json.dumps({'lms_key':'secretkey',...}),
# 'xqueue_body' : 'Message from grader} # 'xqueue_body' : 'Message from grader'}
get = request.POST.copy() get = request.POST.copy()
for key in ['xqueue_header', 'xqueue_body']: for key in ['xqueue_header', 'xqueue_body']:
if not get.has_key(key): if not get.has_key(key):
...@@ -372,7 +372,8 @@ def xqueue_callback(request, course_id, userid, id, dispatch): ...@@ -372,7 +372,8 @@ def xqueue_callback(request, course_id, userid, id, dispatch):
# We go through the "AJAX" path # We go through the "AJAX" path
# So far, the only dispatch from xqueue will be 'score_update' # So far, the only dispatch from xqueue will be 'score_update'
try: try:
ajax_return = instance.handle_ajax(dispatch, get) # Can ignore the "ajax" return in 'xqueue_callback' # Can ignore the return value--not used for xqueue_callback
instance.handle_ajax(dispatch, get)
except: except:
log.exception("error processing ajax call") log.exception("error processing ajax call")
raise raise
......
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