Commit 55fda26f by Vik Paruchuri

Fix tests, fix xqueue error, minor polish

parent 6bdbbb62
......@@ -83,7 +83,7 @@
<div class="col">
<pre><code>
[tasks]
(Self), ({0-1}AI), ({1-3}Peer)
(Self), ({2-5}AI), ({4-5}Peer)
[tasks]
</code></pre>
</div>
......
class @OpenEndedMarkdownEditingDescriptor extends XModule.Descriptor
# TODO really, these templates should come from or also feed the cheatsheet
@rubricTemplate : "[rubric]\n+ Color Identification\n- Incorrect\n- Correct\n + Grammar\n- Poor\n- Acceptable\n- Superb \n[rubric]\n"
@tasksTemplate: "[tasks]\n(Self), ({0-1}AI), ({1-3}Peer)\n[tasks]\n"
@tasksTemplate: "[tasks]\n(Self), ({2-5}AI), ({4-5}Peer)\n[tasks]\n"
@promptTemplate: "[prompt]\nWhy is the sky blue?\n[prompt]\n"
constructor: (element) ->
......
......@@ -168,7 +168,10 @@ class OpenEndedModule(openendedchild.OpenEndedChild):
#This is a student_facing_error
return {'success': False, 'msg': "There was an error saving your feedback. Please contact course staff."}
qinterface = system.xqueue['interface']
xqueue = system.get('xqueue')
if xqueue is None:
return {'success': False, 'msg': "Couldn't submit feedback."}
qinterface = xqueue['interface']
qtime = datetime.strftime(datetime.now(), xqueue_interface.dateformat)
anonymous_student_id = system.anonymous_student_id
queuekey = xqueue_interface.make_hashkey(str(system.seed) + qtime +
......@@ -176,7 +179,7 @@ class OpenEndedModule(openendedchild.OpenEndedChild):
str(len(self.child_history)))
xheader = xqueue_interface.make_xheader(
lms_callback_url=system.xqueue['construct_callback'](),
lms_callback_url=xqueue['construct_callback'](),
lms_key=queuekey,
queue_name=self.message_queue_name
)
......@@ -219,7 +222,10 @@ class OpenEndedModule(openendedchild.OpenEndedChild):
# Prepare xqueue request
#------------------------------------------------------------
qinterface = system.xqueue['interface']
xqueue = system.get('xqueue')
if xqueue is None:
return False
qinterface = xqueue['interface']
qtime = datetime.strftime(datetime.now(), xqueue_interface.dateformat)
anonymous_student_id = system.anonymous_student_id
......@@ -230,7 +236,7 @@ class OpenEndedModule(openendedchild.OpenEndedChild):
str(len(self.child_history)))
xheader = xqueue_interface.make_xheader(
lms_callback_url=system.xqueue['construct_callback'](),
lms_callback_url=xqueue['construct_callback'](),
lms_key=queuekey,
queue_name=self.queue_name
)
......
......@@ -218,8 +218,8 @@ def get_module_for_descriptor(user, request, descriptor, model_data_cache, cours
#this first checks to see if the descriptor is the correct one, and only sends settings if it is
#Get descriptor metadata fields indicating needs for various settings
needs_open_ended_interface = descriptor.needs_open_ended_interface
needs_s3_interface = descriptor.needs_s3_interface
needs_open_ended_interface = hasattr(descriptor, "needs_open_ended_interface") and descriptor.needs_open_ended_interface
needs_s3_interface = hasattr(descriptor, "needs_s3_interface") and descriptor.needs_s3_interface
#Initialize interfaces to None
open_ended_grading_interface = None
......
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