Why Gemfury? Push, build, and install  RubyGems npm packages Python packages Maven artifacts PHP packages Go Modules Debian packages RPM packages NuGet packages

Repository URL to install this package:

Details    
fun-apps / templates / problem_stats / choice_question.html
Size: Mime:
## mako

<%! from django.utils.translation import ugettext as _ %>
<%! from course_dashboard.problem_stats.utils import percentage %>

<%inherit file="base.html" />
<%block name="answers_distribution">
    
<style>
 #choice-question-table td {
     padding : 10px;
 }
 
 #choice-question-table {
     margin : 10px;
 }
 
 #content .correct_answer {
     color : green;
 }

 #content #choice-question-table .badge {
     background-color : #3392e3;
 }

</style>

<table id='choice-question-table' class='table-bordered'>
    % for index, choice in enumerate(question_tree.iter('choice')):
        <tr>
            <td>
                <span class="badge pull-left">${index + 1} </span>
            </td>
            <td class="list-group-item ${"correct_answer" if choice.get('correct') == 'true' else ''}">
                ${choice.text}
            </td>
        </tr>
    % endfor
</table>

<table id='choice-question-table' class='table-bordered'>
    % for answer, count in student_answers.iteritems():
        <tr>
            <td> 
                % for choice in answer:
                    <span class="badge"> ${choice} </span>
                % endfor
            </td>
            <td>${count}</td>
            <td> ${percentage(count, total_answers)}%</td>
        </tr>
    % endfor
        <tr>
            <td>${_("Blank answers")}</td>
            <td> ${blank_answers}</td>
            <td>${percentage(blank_answers, total_answers)}% </td>
        </tr>
        <tr>
            <td>${_("Total")}</td>
            <td> ${total_answers}</td>
            <td>100%</td>
        </tr>
</table>

</%block>