Commit 943c0ff8 by Vik Paruchuri

Display results separately from submission logic

parent 3620fd93
...@@ -215,7 +215,7 @@ class CombinedOpenEndedModule(XModule): ...@@ -215,7 +215,7 @@ class CombinedOpenEndedModule(XModule):
last_post_assessment = task.latest_post_assessment() last_post_assessment = task.latest_post_assessment()
last_post_feedback="" last_post_feedback=""
if task_type=="openended": if task_type=="openended":
last_post_assessment = task.latest_post_assessment(short_feedback=True) last_post_assessment = task.latest_post_assessment(short_feedback=False)
last_post_evaluation = task.format_feedback_with_evaluation(last_post_assessment) last_post_evaluation = task.format_feedback_with_evaluation(last_post_assessment)
last_post_assessment = last_post_evaluation last_post_assessment = last_post_evaluation
max_score = task.max_score() max_score = task.max_score()
...@@ -249,12 +249,12 @@ class CombinedOpenEndedModule(XModule): ...@@ -249,12 +249,12 @@ class CombinedOpenEndedModule(XModule):
return return_html return return_html
def get_results(self, get): def get_results(self, get):
task_number=get['task_number'] task_number=int(get['task_number'])
self.update_task_states() self.update_task_states()
response_dict=self.get_last_response(task_number) response_dict=self.get_last_response(task_number)
context = {'results' : response_dict['post_assessment']} context = {'results' : response_dict['post_assessment']}
html = render_to_string('combined_open_ended_results.html', context) html = render_to_string('combined_open_ended_results.html', context)
return html return {'html' : html, 'success' : True}
def handle_ajax(self, dispatch, get): def handle_ajax(self, dispatch, get):
""" """
......
...@@ -30,6 +30,7 @@ section.combined-open-ended { ...@@ -30,6 +30,7 @@ section.combined-open-ended {
{ {
float:left; float:left;
width: 53%; width: 53%;
padding-bottom: 20px;
} }
.result-container .result-container
...@@ -49,7 +50,7 @@ section.combined-open-ended { ...@@ -49,7 +50,7 @@ section.combined-open-ended {
} }
} }
section.open-ended-child, section.combined-open-ended-status { section.combined-open-ended-status {
.statusitem { .statusitem {
background-color: #FAFAFA; background-color: #FAFAFA;
...@@ -66,9 +67,11 @@ section.open-ended-child, section.combined-open-ended-status { ...@@ -66,9 +67,11 @@ section.open-ended-child, section.combined-open-ended-status {
font-size: 1em; font-size: 1em;
padding-top: 10px; padding-top: 10px;
} }
}
div.result-container {
.evaluation { .evaluation {
p { p {
margin-bottom: 1px; margin-bottom: 1px;
} }
...@@ -84,7 +87,7 @@ section.open-ended-child, section.combined-open-ended-status { ...@@ -84,7 +87,7 @@ section.open-ended-child, section.combined-open-ended-status {
header { header {
text-align: right; text-align: right;
a { a {
font-size: .7em; font-size: .85em;
} }
} }
} }
...@@ -97,7 +100,7 @@ section.open-ended-child, section.combined-open-ended-status { ...@@ -97,7 +100,7 @@ section.open-ended-child, section.combined-open-ended-status {
&:first-child { &:first-child {
margin-left: 0px; margin-left: 0px;
} }
display:block; display:inline;
margin-left: 0px; margin-left: 0px;
label { label {
......
...@@ -62,6 +62,7 @@ class @CombinedOpenEnded ...@@ -62,6 +62,7 @@ class @CombinedOpenEnded
$.postWithPrefix "#{@ajax_url}/get_results", data, (response) => $.postWithPrefix "#{@ajax_url}/get_results", data, (response) =>
if response.success if response.success
@results_container.after(response.html).remove() @results_container.after(response.html).remove()
@results_container = $('.result-container')
@Collapsible.setCollapsibles(@results_container) @Collapsible.setCollapsibles(@results_container)
else else
@errors_area.html(response.error) @errors_area.html(response.error)
......
<div class="result-container"> <div class="result-container">
<h4>Results</h4><br/>
${results | n} ${results | n}
</div> </div>
\ No newline at end of file
...@@ -28,8 +28,4 @@ ...@@ -28,8 +28,4 @@
<div class="open-ended-action"></div> <div class="open-ended-action"></div>
<span id="answer_${id}"></span> <span id="answer_${id}"></span>
<div class="external-grader-message">
${msg|n}
</div>
</section> </section>
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