Remove legend, start to edit rubric
This commit is contained in:
@@ -207,6 +207,20 @@ div.combined-rubric-container {
|
||||
font-size: .9em;
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
label.choicegroup_correct {
|
||||
&:before {
|
||||
margin-right: 15px;
|
||||
content: url('../images/correct-icon.png');
|
||||
}
|
||||
}
|
||||
|
||||
label.choicegroup_incorrect {
|
||||
&:before {
|
||||
margin-right: 15px;
|
||||
content: url('../images/incorrect-icon.png');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
div.result-container {
|
||||
|
||||
@@ -55,7 +55,6 @@ class @Rubric
|
||||
data = {location: location, selection: target_selection, category: category}
|
||||
Logger.log 'rubric_select', data
|
||||
|
||||
|
||||
# finds the scores for each rubric category
|
||||
@get_score_list: () =>
|
||||
# find the number of categories:
|
||||
@@ -97,7 +96,6 @@ class @CombinedOpenEnded
|
||||
submit_evaluation_sel: '.submit-evaluation-button'
|
||||
result_container_sel: 'div.result-container'
|
||||
combined_rubric_sel: '.combined-rubric-container'
|
||||
legend_sel: '.legend-container'
|
||||
open_ended_child_sel: 'section.open-ended-child'
|
||||
error_sel: '.error'
|
||||
answer_area_sel: 'textarea.answer'
|
||||
@@ -114,6 +112,8 @@ class @CombinedOpenEnded
|
||||
sub_id_sel: 'input.submission_id'
|
||||
grader_id_sel: 'input.grader_id'
|
||||
grader_status_sel: '.grader-status'
|
||||
info_rubric_elements_sel: '.rubric-elements-info'
|
||||
rubric_collapse_sel: '.rubric-collapse'
|
||||
|
||||
constructor: (el) ->
|
||||
@el=el
|
||||
@@ -194,10 +194,6 @@ class @CombinedOpenEnded
|
||||
else if @task_number==1 and @child_state!='initial'
|
||||
@prompt_hide()
|
||||
|
||||
if @child_state!="initial"
|
||||
@show_legend_current()
|
||||
@legend_container= @$(@legend_sel)
|
||||
|
||||
@find_assessment_elements()
|
||||
@find_hint_elements()
|
||||
|
||||
@@ -240,7 +236,10 @@ class @CombinedOpenEnded
|
||||
$.postWithPrefix "#{@ajax_url}/get_combined_rubric", data, (response) =>
|
||||
if response.success
|
||||
@combined_rubric_container.after(response.html).remove()
|
||||
@combined_rubric_container= $(@combined_rubric_sel)
|
||||
@combined_rubric_container= @$(@combined_rubric_sel)
|
||||
@toggle_rubric("")
|
||||
@rubric_collapse = @$(@rubric_collapse_sel)
|
||||
@rubric_collapse.click @toggle_rubric
|
||||
|
||||
show_status_current: () =>
|
||||
data = {}
|
||||
@@ -249,13 +248,6 @@ class @CombinedOpenEnded
|
||||
@status_container.after(response.html).remove()
|
||||
@status_container= $(@status_container_sel)
|
||||
|
||||
show_legend_current: () =>
|
||||
data = {}
|
||||
$.postWithPrefix "#{@ajax_url}/get_legend", data, (response) =>
|
||||
if response.success
|
||||
@legend_container.after(response.html).remove()
|
||||
@legend_container= $(@legend_sel)
|
||||
|
||||
get_last_response: () =>
|
||||
data = {}
|
||||
$.postWithPrefix "#{@ajax_url}/get_last_response", data, (response) =>
|
||||
@@ -302,7 +294,6 @@ class @CombinedOpenEnded
|
||||
@reset_button.hide()
|
||||
@next_problem_button.hide()
|
||||
@hide_file_upload()
|
||||
@legend_container.show()
|
||||
@hint_area.attr('disabled', false)
|
||||
if @task_number>1 or @child_state!='initial'
|
||||
@show_status_current()
|
||||
@@ -325,7 +316,6 @@ class @CombinedOpenEnded
|
||||
@submit_button.prop('value', 'Submit')
|
||||
@submit_button.click @save_answer
|
||||
@setup_file_upload()
|
||||
@legend_container.hide()
|
||||
else if @child_state == 'assessing'
|
||||
@answer_area.attr("disabled", true)
|
||||
@replace_text_inputs()
|
||||
@@ -338,7 +328,6 @@ class @CombinedOpenEnded
|
||||
if @task_number==1 and @task_count==1
|
||||
@grader_status = @$(@grader_status_sel)
|
||||
@grader_status.html("<p>Response submitted for scoring.</p>")
|
||||
@legend_container.hide()
|
||||
else if @child_state == 'post_assessment'
|
||||
if @child_type=="openended"
|
||||
@skip_button.show()
|
||||
@@ -568,7 +557,7 @@ class @CombinedOpenEnded
|
||||
reload: ->
|
||||
location.reload()
|
||||
|
||||
collapse_question: () =>
|
||||
collapse_question: (event) =>
|
||||
@prompt_container.slideToggle()
|
||||
@prompt_container.toggleClass('open')
|
||||
if @question_header.text() == "(Hide)"
|
||||
@@ -578,6 +567,7 @@ class @CombinedOpenEnded
|
||||
Logger.log 'oe_show_question', {location: @location}
|
||||
new_text = "(Hide)"
|
||||
@question_header.text(new_text)
|
||||
return false
|
||||
|
||||
prompt_show: () =>
|
||||
if @prompt_container.is(":hidden")==true
|
||||
@@ -628,3 +618,8 @@ class @CombinedOpenEnded
|
||||
@$(@file_upload_preview_sel)[0].height = height_px/scale_factor
|
||||
@$(@file_upload_preview_sel).show()
|
||||
reader.readAsDataURL(@$(@file_upload_box_sel)[0].files[0])
|
||||
|
||||
toggle_rubric: (event) =>
|
||||
info_rubric_elements = @$(@info_rubric_elements_sel)
|
||||
info_rubric_elements.slideToggle()
|
||||
return false
|
||||
|
||||
@@ -208,6 +208,7 @@ class CombinedOpenEndedRubric(object):
|
||||
feedback_types)
|
||||
rubric_categories = self.extract_categories(rubric_xml)
|
||||
max_scores = map((lambda cat: cat['options'][-1]['points']), rubric_categories)
|
||||
actual_scores = []
|
||||
max_score = max(max_scores)
|
||||
for i in xrange(0, len(rubric_categories)):
|
||||
category = rubric_categories[i]
|
||||
@@ -217,9 +218,18 @@ class CombinedOpenEndedRubric(object):
|
||||
if tuple[1] == i and tuple[2] == j:
|
||||
for grader_type in tuple[3]:
|
||||
rubric_categories[i]['options'][j]['grader_types'].append(grader_type)
|
||||
if len(actual_scores)<=i:
|
||||
actual_scores.append([j])
|
||||
else:
|
||||
actual_scores[i] += [j]
|
||||
|
||||
actual_scores = [sum(i)/len(i) for i in actual_scores]
|
||||
correct = [int(a>.66) for a in actual_scores]
|
||||
|
||||
html = self.system.render_template('{0}/open_ended_combined_rubric.html'.format(self.TEMPLATE_DIR),
|
||||
{'categories': rubric_categories,
|
||||
'max_scores': max_scores,
|
||||
'correct' : correct,
|
||||
'has_score': True,
|
||||
'view_only': True,
|
||||
'max_score': max_score,
|
||||
|
||||
@@ -58,7 +58,7 @@ class OpenEndedChild(object):
|
||||
'assessing': 'In progress',
|
||||
'post_assessment': 'Done',
|
||||
'done': 'Done',
|
||||
}
|
||||
}
|
||||
|
||||
def __init__(self, system, location, definition, descriptor, static_data,
|
||||
instance_state=None, shared_state=None, **kwargs):
|
||||
@@ -229,7 +229,7 @@ class OpenEndedChild(object):
|
||||
'max_score': self._max_score,
|
||||
'child_attempts': self.child_attempts,
|
||||
'child_created': False,
|
||||
}
|
||||
}
|
||||
return json.dumps(state)
|
||||
|
||||
def _allow_reset(self):
|
||||
@@ -485,4 +485,4 @@ class OpenEndedChild(object):
|
||||
else:
|
||||
eta_string = ""
|
||||
|
||||
return eta_string
|
||||
return eta_string
|
||||
@@ -1,4 +1,4 @@
|
||||
<div class="${class_name}">
|
||||
<h4>${task_name}</h4>
|
||||
<h4>${task_name}</h4><a class="rubric-collapse" href="#">(Show)</a>
|
||||
${results | n}
|
||||
</div>
|
||||
|
||||
@@ -7,18 +7,19 @@
|
||||
<% option = category['options'][j] %>
|
||||
<li class="rubric-list-item">
|
||||
<div class="rubric-label">
|
||||
%for grader_type in category['options'][j]['grader_types']:
|
||||
% if grader_type in grader_type_image_dict:
|
||||
<% grader_image = grader_type_image_dict[grader_type] %>
|
||||
% if grader_type in human_grader_types:
|
||||
<% human_title = human_grader_types[grader_type] %>
|
||||
% else:
|
||||
<% human_title = grader_type %>
|
||||
% endif
|
||||
<img src="${grader_image}" title="${human_title}"/>
|
||||
% endif
|
||||
%endfor
|
||||
${option['points']} points : ${option['text']}
|
||||
%if len(category['options'][j]['grader_types'])>0:
|
||||
%if correct[i]==1:
|
||||
<label class="choicegroup_correct">
|
||||
%else:
|
||||
<label class="choicegroup_incorrect">
|
||||
%endif
|
||||
${option['points']} points : ${option['text']}
|
||||
</label>
|
||||
%else:
|
||||
<label class="rubric-elements-info">
|
||||
${option['points']} points : ${option['text']}
|
||||
</label>
|
||||
%endif
|
||||
</div>
|
||||
</li>
|
||||
% endfor
|
||||
|
||||
Reference in New Issue
Block a user