progress.html 5.17 KB
Newer Older
1
<%! from django.utils.translation import ugettext as _ %>
2 3
<%inherit file="/main.html" />
<%namespace name='static' file='/static_content.html'/>
4 5

<%block name="headextra">
6 7
<%static:css group='style-course-vendor'/>
<%static:css group='style-course'/>
8 9
</%block>

10
<%namespace name="progress_graph" file="/courseware/progress_graph.js"/>
11

12
<%block name="pagetitle">${_("{course_number} Progress").format(course_number=course.display_number_with_default) | h}</%block>
13
<%block name="nav_skip">#course-info-progress</%block>
14 15 16 17 18

<%!
    from django.core.urlresolvers import reverse
%>

19
<%!
20
from util.date_utils import get_time_display
21 22
from django.conf import settings
%>
23

24 25 26 27 28
<%block name="js_extra">
<script type="text/javascript" src="${static.url('js/vendor/flot/jquery.flot.js')}"></script>
<script type="text/javascript" src="${static.url('js/vendor/flot/jquery.flot.stack.js')}"></script>
<script type="text/javascript" src="${static.url('js/vendor/flot/jquery.flot.symbol.js')}"></script>
<script>
29
  ${progress_graph.body(grade_summary, course.grade_cutoffs, "grade-detail-graph", not course.no_grade, not course.no_grade)}
30 31 32
</script>
</%block>

33
<%include file="/dashboard/_dashboard_prompt_midcourse_reverify.html" />
34

35
<%include file="/courseware/course_navigation.html" args="active_page='progress'" />
36

37
<div class="container">
38 39
  <div class="profile-wrapper">

40
    <div class="course-info" id="course-info-progress" aria-label="${_('Course Progress')}">
41 42 43 44 45
      % if staff_access and studio_url is not None:
        <div class="wrap-instructor-info">
          <a class="instructor-info-action studio-view" href="${studio_url}">${_("View Grading in studio")}</a>
        </div>
      % endif
46

47
      <header>
48
        <h1>${_("Course Progress for Student '{username}' ({email})").format(username=student.username, email=student.email)}</h1>
49 50
      </header>

51
      %if settings.FEATURES.get("SHOW_PROGRESS_SUCCESS_BUTTON"):
52
        <%
53
          SUCCESS_BUTTON_URL = settings.PROGRESS_SUCCESS_BUTTON_URL.format(
54
            course_id=course.id.to_deprecated_string(), student_id=student.id)
55 56 57 58 59
          nonzero_cutoffs = [cutoff for cutoff in course.grade_cutoffs.values() if cutoff > 0]
          success_cutoff = min(nonzero_cutoffs) if nonzero_cutoffs else None
        %>
        %if success_cutoff and grade_summary['percent'] > success_cutoff:
          <div id="course-success">
60 61
            <a href="${SUCCESS_BUTTON_URL}">
              ${settings.PROGRESS_SUCCESS_BUTTON_TEXT_OVERRIDE or _("Download your certificate")}
62 63 64 65 66
            </a>
          </div>
        %endif
      %endif

Calen Pennington committed
67
      %if not course.disable_progress_graph:
68
        <div id="grade-detail-graph" aria-hidden="true"></div>
69
      %endif
70

71
      <div class="chapters">
72 73
        %for chapter in courseware_summary:
        %if not chapter['display_name'] == "hidden":
74
        <section>
75 76
          <h2>${ chapter['display_name'] }</h2>

77
          <div class="sections">
78
            %for section in chapter['sections']:
79
            <div>
80 81 82 83 84 85
              <%
              earned = section['section_total'].earned
              total = section['section_total'].possible
              percentageString = "{0:.0%}".format( float(earned)/total) if earned > 0 and total > 0 else ""
              %>

86
              <h3><a href="${reverse('courseware_section', kwargs=dict(course_id=course.id.to_deprecated_string(), chapter=chapter['url_name'], section=section['url_name']))}">
87 88
                ${ section['display_name'] }
                %if total > 0 or earned > 0:
89
                  <span class="sr">
David Baumgold committed
90
                    ${_("{earned:.3n} of {total:.3n} possible points").format( earned = float(earned), total = float(total) )}
91
                  </span>
92
                %endif
93
                </a>
94 95 96 97
                %if total > 0 or earned > 0:
                  <span> ${"({0:.3n}/{1:.3n}) {2}".format( float(earned), float(total), percentageString )}</span>
                %endif
              </h3>
98 99 100
              <p>
                ${section['format']}

cahrens committed
101
                %if section.get('due') is not None:
102
                  <%
103
                      formatted_string = get_time_display(section['due'], course.due_date_display_format, coerce_tz=settings.TIME_ZONE_DISPLAYED_FOR_DEADLINES)
David Baumgold committed
104
                      due_date = '' if len(formatted_string)==0 else _(u'due {date}').format(date=formatted_string)
105
                  %>
106
                  <em>
107
                  ${due_date}
108 109 110 111
                  </em>
                %endif
              </p>

112
              <div class="scores">
113
                %if len(section['scores']) > 0:
David Baumgold committed
114
                  <h3> ${ _("Problem Scores: ") if section['graded'] else _("Practice Scores: ")} </h3>
115 116 117 118 119
                  <ol>
                    %for score in section['scores']:
                    <li>${"{0:.3n}/{1:.3n}".format(float(score.earned),float(score.possible))}</li>
                    %endfor
                  </ol>
120
                %else:
121
                  <h3 class="no-scores"> ${_("No problem scores in this section")} </h3>
122
                %endif
123
              </div>
124

125

126
            </div> <!--End section-->
127
            %endfor
128 129
          </div> <!--End sections-->
        </section> <!--End chapter-->
130 131
        %endif
        %endfor
132
      </div> <!--End chapters-->
133

134
    </div>
135
  </div>
136
</div>