Commit 55fda26f by Vik Paruchuri

Fix tests, fix xqueue error, minor polish

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