<%!
from django.utils.translation import ugettext as _
from django.utils.translation import ungettext
from random import randint
%>
<form class="rubric-template" id="inputtype_${id}" xmlns="http://www.w3.org/1999/html">
    <div class="visibility-control visibility-control-rubric">
        <div class="inner">
        </div>
        <span class="section-header section-header-rubric">${_("Rubric")}</span>
    </div>
    <p>${_("Select the criteria you feel best represents this submission in each category.")}</p>
    <div class="rubric">
        % for i in range(len(categories)):
        <% category = categories[i] %>
        <% m = randint(0,1000) %>
            <span class="rubric-category" tabindex="${i}">${category['description']}</span>
            <ul class="rubric-list">
                % for j in range(len(category['options'])):
                <% option = category['options'][j] %>
                    %if option['selected']:
                        <li class="selected-grade rubric-list-item">
                    %else:
                        <li class="rubric-list-item">
                    % endif
                    <label class="rubric-label" for="score-${i}-${j}-${m}">
                        <span class="wrapper-score-selection"><input type="radio" class="score-selection" data-category="${i}" name="score-selection-${i}" id="score-${i}-${j}-${m}" value="${option['points']}"/></span>
                        <span class="wrappable">${ungettext(
                            "{num} point: {text}",
                            "{num} points: {text}",
                            option['points']
                        ).format(
                            num=option['points'],
                            text=option['text']
                        )}</span>
                    </label>
                    </li>
                % endfor
            </ul>
        % endfor
    </div>
</form>
