Commit 617bdc26 by ichuang

fixed courseware.views.quickedit to create StudentModule state if not pre-existing

parent 7791c7a9
......@@ -340,6 +340,17 @@ def quickedit(request, id=None, qetemplate='quickedit.html',coursename=None):
xml,
id,
state=None)
# create empty student state for this problem, if not previously existing
s = StudentModule.objects.filter(student=request.user,
module_id=id)
if len(s) == 0 or s is None:
smod=StudentModule(student=request.user,
module_type = 'problem',
module_id=id,
state=instance.get_state())
smod.save()
lcp = instance.lcp
pxml = lcp.tree
pxmls = etree.tostring(pxml,pretty_print=True)
......
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