<%! from django.utils.translation import ugettext as _ %>
<% num_results = len(results) %>
% for (i,result) in enumerate(results):
    % if 'task_name' in result and 'result' in result:
        <div class="combined-rubric-container"
        %if i>0:
            data-status="hidden" data-number="${i}">
        % else:
            data-status="shown" data-number="${i}">
        % endif
            <div class="visibility-control visibility-control-rubric">
                <div class="inner">
                </div>
                <span class="section-header section-header-rubric">${_("Submitted Rubric")}</span>
            </div>
            <div class="oe-tools rubric-header">
                <span class="oe-tools-label"></span>
                <button class="rubric-collapse" href="#">${_("Toggle Full Rubric")}</button>
                <span class="oe-tools-scores">
                    <span class="oe-tools-scores-label"></span>
                    % if num_results>1:
                        <button href="#" alt="Previous" class="rubric-button rubric-previous-button"
                            % if i == 0:
                                disabled="true"
                            % endif
                        ><i class="icon fa fa-chevron-left"></i></button>
                    % endif
                    ## Translators: an example of what this string will look
                    ## like is: "Scored rubric from grader 1", where
                    ## "Scored rubric" replaces {result_of_task} and
                    ## "1" replaces {number}.
                    ## This string appears when a user is viewing one of
                    ## their graded rubrics for an openended response problem.
                    ## the number distinguishes between the different
                    ## graded rubrics the user might have received
                    ${_("{result_of_task} from grader {number}").format(result_of_task = result['task_name'], number = i + 1)}
                    % if num_results>1:
                        <button href="#" alt="Next" class="rubric-button rubric-next-button"
                            % if (i+1) >= num_results:
                                disabled="true"
                            % endif
                        ><i class="fa-chevron-right"></i></button>
                    % endif
                </span>
            </div>
            ${result['result'] | n}
            % if result.get('feedback'):
                <div class="written-feedback">
                    ${result['feedback'] | n}
                </div>
            %endif
        </div>
    %endif

% endfor
