Commit 9f8e172b by Arthur Barrett

show the status mark next to the submitted tag instead of at the bottom of the problem.

parent 25fb2103
...@@ -980,7 +980,7 @@ class AnnotationInput(InputTypeBase): ...@@ -980,7 +980,7 @@ class AnnotationInput(InputTypeBase):
self.comment_prompt = xml.findtext('./comment_prompt', 'Type a commentary below:') self.comment_prompt = xml.findtext('./comment_prompt', 'Type a commentary below:')
self.tag_prompt = xml.findtext('./tag_prompt', 'Select one or more tags:') self.tag_prompt = xml.findtext('./tag_prompt', 'Select one or more tags:')
self.options = self._find_options() self.options = self._find_options()
self.return_to_annotation = True self.return_to_annotation = True # return only works in conjunction with annotatable xmodule
# Need to provide a value that JSON can parse if there is no # Need to provide a value that JSON can parse if there is no
# student-supplied value yet. # student-supplied value yet.
......
...@@ -19,11 +19,23 @@ ...@@ -19,11 +19,23 @@
<div class="block">${tag_prompt}</div> <div class="block">${tag_prompt}</div>
<ul class="tags"> <ul class="tags">
% for option in options: % for option in options:
<li><span class="tag <li>
% if option['id'] in options_value: % if all([c == 'correct' for c in option['choice'], status]):
selected <span class="status correct" id="status_${id}"></span>
% endif % elif all([c == 'partial' for c in option['choice'], status]):
" data-id="${option['id']}">${option['description']}</span></li> <span class="status partially_correct" id="status_${id}">P</span>
% elif all([c == 'incorrect' for c in option['choice'], status]):
<span class="status incorrect" id="status_${id}"></span>
% endif
<span class="tag
% if option['id'] in options_value:
selected
% endif
" data-id="${option['id']}">
${option['description']}
</span>
</li>
% endfor % endfor
</ul> </ul>
...@@ -42,12 +54,6 @@ ...@@ -42,12 +54,6 @@
% if status == 'unsubmitted': % if status == 'unsubmitted':
<span class="unanswered" style="display:inline-block;" id="status_${id}"></span> <span class="unanswered" style="display:inline-block;" id="status_${id}"></span>
% elif status == 'correct':
<span class="correct" id="status_${id}"></span>
% elif status == 'partial':
<span class="partially_correct" id="status_${id}">Partially Correct</span>
% elif status == 'incorrect':
<span class="incorrect" id="status_${id}"></span>
% elif status == 'incomplete': % elif status == 'incomplete':
<span class="incorrect" id="status_${id}"></span> <span class="incorrect" id="status_${id}"></span>
% endif % endif
......
...@@ -842,16 +842,22 @@ section.problem { ...@@ -842,16 +842,22 @@ section.problem {
margin-left: 1em; margin-left: 1em;
li { li {
display: block; display: block;
margin: 1em 0 0 1.5em; margin: 1em 0 0 0;
span { position: relative;
cursor: pointer; .tag {
display: inline-block; display: inline-block;
padding: .25em .5em; cursor: pointer;
border: 1px solid rgb(102,102,102); border: 1px solid rgb(102,102,102);
margin-left: 40px;
&.selected { &.selected {
background-color: $yellow; background-color: $yellow;
} }
} }
.status {
position: absolute;
left: 0;
}
.tag, .status { padding: .25em .5em; }
} }
} }
textarea.comment { width: 100%; } textarea.comment { width: 100%; }
......
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