Commit c6c77c0c by Vik Paruchuri

Simple status display

parent 0e2355c2
...@@ -168,7 +168,7 @@ class CombinedOpenEndedModule(XModule): ...@@ -168,7 +168,7 @@ class CombinedOpenEndedModule(XModule):
'state' : self.state, 'state' : self.state,
'task_count' : len(self.task_xml), 'task_count' : len(self.task_xml),
'task_number' : self.current_task_number+1, 'task_number' : self.current_task_number+1,
'status' : "temporary status." 'status' : self.get_status(),
} }
html = self.system.render_template('combined_open_ended.html', context) html = self.system.render_template('combined_open_ended.html', context)
...@@ -194,8 +194,9 @@ class CombinedOpenEndedModule(XModule): ...@@ -194,8 +194,9 @@ class CombinedOpenEndedModule(XModule):
task=children['modules'][task_type](self.system, self.location, task_parsed_xml, task_descriptor, instance_state=task_state) task=children['modules'][task_type](self.system, self.location, task_parsed_xml, task_descriptor, instance_state=task_state)
last_response=task.latest_answer() last_response=task.latest_answer()
last_score = task.latest_score() last_score = task.latest_score()
last_post_response = task.latest_post_response() last_post_assessment = task.latest_post_assessment()
last_response_dict={'response' : last_response, 'score' : last_score, 'post_response' : post_response, 'type' : task_type} max_score = task.max_score()
last_response_dict={'response' : last_response, 'score' : last_score, 'post_assessment' : last_post_assessment, 'type' : task_type, 'max_score' : max_score}
return last_response_dict return last_response_dict
...@@ -273,7 +274,6 @@ class CombinedOpenEndedModule(XModule): ...@@ -273,7 +274,6 @@ class CombinedOpenEndedModule(XModule):
self.setup_next_task() self.setup_next_task()
return {'success': True} return {'success': True}
def get_instance_state(self): def get_instance_state(self):
""" """
Get the current score and state Get the current score and state
...@@ -293,10 +293,13 @@ class CombinedOpenEndedModule(XModule): ...@@ -293,10 +293,13 @@ class CombinedOpenEndedModule(XModule):
status=[] status=[]
for i in xrange(0,self.current_task_number): for i in xrange(0,self.current_task_number):
task_data = self.get_last_response(i) task_data = self.get_last_response(i)
task_data.update({'task_number' : i+1})
status.append(task_data) status.append(task_data)
context = {'status_list' : status} context = {'status_list' : status}
status_html = self.system.render_template("combined_open_ended_status.html", context) status_html = self.system.render_template("combined_open_ended_status.html", context)
return status_html
class CombinedOpenEndedDescriptor(XmlDescriptor, EditingDescriptor): class CombinedOpenEndedDescriptor(XmlDescriptor, EditingDescriptor):
""" """
Module for adding self assessment questions to courses Module for adding self assessment questions to courses
......
...@@ -243,9 +243,5 @@ class OpenEndedChild(): ...@@ -243,9 +243,5 @@ class OpenEndedChild():
def handle_ajax(self): def handle_ajax(self):
pass pass
def type(self):
pass
<section id="combined-open-ended-status" class="combined-open-ended-status"> <section id="combined-open-ended-status" class="combined-open-ended-status">
%for status in status_list:
<statusitem>
Step ${status['task_number']} : ${status['score']} / ${status['max_score']}
%if status['type']=="openended":
${status['post_assessment']}
%endif
</statusitem>
%endfor
</section> </section>
\ No newline at end of file
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