Skip to content

Commit

Permalink
Protective Behaviors quiz style fixes - plain quiz conflicts
Browse files Browse the repository at this point in the history
We need to address this issue:
    ccnmtl/django-quizblock#35
so we don't have to deal with these problems!
  • Loading branch information
nikolas committed Feb 24, 2015
1 parent f1f5b30 commit 3afec0c
Show file tree
Hide file tree
Showing 3 changed files with 46 additions and 6 deletions.
2 changes: 2 additions & 0 deletions media/css/main.css
Original file line number Diff line number Diff line change
Expand Up @@ -339,10 +339,12 @@ footer.footer {
text-align: center;
}

.protective-behaviors ol,
.protective-behaviors-results ul {
padding-left: 0;
}

.protective-behaviors ol li,
.protective-behaviors-results ul li {
list-style: none;
font-weight: bold;
Expand Down
34 changes: 34 additions & 0 deletions worth2/templates/quizblock/single_choice.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,39 @@
{% if 'likert' in question.quiz.pageblock.css_extra %}
{% include 'quizblock/likert.html' %}
{% else %}
{% if 'protective-behaviors' in question.quiz.pageblock.css_extra %}
<ol>
{% for answer in question.answer_set.all %}
{% if block.rhetorical %}
<li class="{{answer.css_extra}}">
<label>
<input name="question{{question.id}}" value="{{answer.label}}"
type="radio">
{{answer.label}}
</label>
</li>
{% else %}
<li class="{{answer.css_extra}}">
{% if response %}
{% ifequal response.value answer.value %}
<span class="yours {% if response.is_correct %}correct{% else %}incorrect{% endif %}"
>{{answer.label}}</span>
{% else %}
{{answer.label}}
{% endifequal %}
{% else %}
<label>
<input name="pageblock-{{block.pageblock.id}}-question{{question.id}}"
value="{{answer.value}}" type="radio">
{{answer.label}}
</label>
{% endif %}
</li>
{% endif %}
{% endfor %}
</ol>
<div class="clearfix"></div>
{% else %}
<ol class="caseanswercontainer" type="A">
{% for answer in question.answer_set.all %}
{% if block.rhetorical %}
Expand All @@ -27,6 +60,7 @@
</ol>
<div class="clearfix"></div>
{% endif %}
{% endif %}

<div class="avatar-block">
<img src="{% avatar_url user %}">
Expand Down
16 changes: 10 additions & 6 deletions worth2/templates/quizblock/single_choice_show_answer.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,10 @@
{% load quizresults %}

<div class="casesanswerdisplay">
{% if block.rhetorical %}
{% if 'protective-behaviors' in question.quiz.pageblock.css_extra %}
<p>{{question.explanation|markdown}}</p>
{% else %}
{% if block.rhetorical %}
<a href="#q{{question.id}}" class="moretoggle">Show answer &gt;&gt;</a>
<div id="q{{question.id}}" class="toggleable" style="display: none">
<p>
Expand All @@ -12,15 +15,16 @@
{{question.explanation|markdown}}
</p>
</div>
{% else %}
{% else %}
<div class="casequestionresult">
{% is_user_correct request.user question as is_correct %}
{% if is_correct %}
<div class="correct">That's Correct</div>
<div class="correct">That's Correct</div>
{% else %}
<div class="incorrect">That's Incorrect</div>
<div class="incorrect">That's Incorrect</div>
{% endif %}
</div>
<p>{{question.explanation|markdown}}</p>
{% endif %}
</div>
{% endif %}
{% endif %}
</div>

0 comments on commit 3afec0c

Please sign in to comment.