Commit 3f407816 by Arthur Barrett

adjusted "incorrect" icon placement when no annotation options submitted.

parent 43044950
...@@ -1025,7 +1025,8 @@ class AnnotationInput(InputTypeBase): ...@@ -1025,7 +1025,8 @@ class AnnotationInput(InputTypeBase):
return { return {
'options_value': options_value, 'options_value': options_value,
'comment_value': comment_value 'has_options_value': len(options_value) > 0, # for convenience
'comment_value': comment_value,
} }
def _extra_context(self): def _extra_context(self):
......
...@@ -20,12 +20,14 @@ ...@@ -20,12 +20,14 @@
<ul class="tags"> <ul class="tags">
% for option in options: % for option in options:
<li> <li>
% if all([c == 'correct' for c in option['choice'], status]): % if has_options_value:
<span class="tag-status correct" id="status_${id}"></span> % if all([c == 'correct' for c in option['choice'], status]):
% elif all([c == 'partially-correct' for c in option['choice'], status]): <span class="tag-status correct" id="status_${id}"></span>
<span class="tag-status partially-correct" id="status_${id}"></span> % elif all([c == 'partially-correct' for c in option['choice'], status]):
% elif all([c == 'incorrect' for c in option['choice'], status]): <span class="tag-status partially-correct" id="status_${id}"></span>
<span class="tag-status incorrect" id="status_${id}"></span> % elif all([c == 'incorrect' for c in option['choice'], status]):
<span class="tag-status incorrect" id="status_${id}"></span>
% endif
% endif % endif
<span class="tag <span class="tag
...@@ -50,14 +52,15 @@ ...@@ -50,14 +52,15 @@
<input type="hidden" class="value" name="input_${id}" id="input_${id}" value="${value|h}" /> <input type="hidden" class="value" name="input_${id}" id="input_${id}" value="${value|h}" />
% endif % endif
<p id="answer_${id}" class="answer answer-annotation"></p>
% 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 == 'incomplete': % elif status == 'incomplete':
<span class="incorrect" id="status_${id}"></span> <span class="incorrect" id="status_${id}"></span>
% elif status == 'incorrect' and not has_options_value:
<span class="incorrect" id="status_${id}"></span>
% endif % endif
<p id="answer_${id}" class="answer answer-annotation"></p>
</div> </div>
</form> </form>
......
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