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

8

9
<%block name="headextra">
10 11
<%static:css group='style-course-vendor'/>
<%static:css group='style-course'/>
12 13
</%block>

14

15
<%namespace name="progress_graph" file="/courseware/progress_graph.js"/>
16

17
<%block name="pagetitle">${_("{course_number} Progress").format(course_number=course.display_number_with_default) | h}</%block>
18
<%block name="nav_skip">#course-info-progress</%block>
19 20 21 22 23

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

24
<%!
25
from util.date_utils import get_time_display
26
from django.conf import settings
27
from django.utils.http import urlquote_plus
28
%>
29

30 31 32 33
<%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>
34
<script type="text/javascript" src="${static.url('js/courseware/certificates_api.js')}"></script>
35
<script>
36
  ${progress_graph.body(grade_summary, course.grade_cutoffs, "grade-detail-graph", not course.no_grade, not course.no_grade)}
37 38 39
</script>
</%block>

40
<%include file="/dashboard/_dashboard_prompt_midcourse_reverify.html" />
41

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

44
<div class="container">
45 46
  <div class="profile-wrapper">

47
    <div class="course-info" id="course-info-progress" aria-label="${_('Course Progress')}">
48 49 50 51 52
      % 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
53

54 55
      <header class="progress-certificates">
        <h1 class="progress-certificates-title">${_("Course Progress for Student '{username}' ({email})").format(username=student.username, email=student.email)}</h1>
56 57
      </header>

58 59 60 61 62 63 64
        %if show_generate_cert_btn:
        <div class="wrapper-msg wrapper-auto-cert">
            <div id="errors-info" class="errors-info"></div>

            <div class="auto-cert-message" id="course-success">
                <div class="has-actions">
                %if passed:
65

66
                    % if is_downloadable and download_url:
67 68

                    <% post_url = reverse('generate_user_cert', args=[unicode(course.id)]) %>
69 70
                    <div class="msg-content">
                        <h2 class="title">${_("Your certificate is available")}</h2>
71 72 73 74
                        <p class="copy">${_(
                            "You can now download your certificate as a PDF. If you keep working and receive a higher grade,you can request an {link_start} updated certificate {link_end}.").format(
                            link_start=u"<a class='generate_certs' href='#' data-endpoint={}>".format(post_url) ,link_end=u"</a>")}
                        </p>
75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92
                    </div>
                    <div class="msg-actions">
                        <a class="btn" href="${download_url}" target="_blank" title="${_('PDF will open in a new browser window or tab.')}">
                            ${_("Download Your Certificate")}
                        </a>
                    </div>
                    %elif is_generating:
                    <div class="msg-content">
                        <h2 class="title">${_("We're working on it...")}</h2>
                        <p class="copy">${_("We're creating your certificate. You can keep working in your courses and a link to it will appear here and on your Dashboard when it is ready.")}</p>
                    </div>
                    <div class="msg-actions"></div>
                    %else:
                    <div class="msg-content">
                        <h2 class="title">${_("Congratulations, you qualified for a certificate!")}</h2>
                        <p class="copy">${_("You can keep working for a higher grade, or request your certificate now.")}</p>
                    </div>
                    <div class="msg-actions">
93
                        <button class="btn generate_certs" data-endpoint="${reverse('generate_user_cert', args=[unicode(course.id)])}" id="btn_generate_cert">${_('Request Certificate')}</button>
94 95 96
                    </div>
                    %endif
                </div>
97
                %endif
98 99 100
            </div>
        </div>
        %endif
101

Calen Pennington committed
102
      %if not course.disable_progress_graph:
103
        <div class="grade-detail-graph" id="grade-detail-graph" aria-hidden="true"></div>
104
      %endif
105

106
      <div class="chapters">
107 108
        %for chapter in courseware_summary:
        %if not chapter['display_name'] == "hidden":
109
        <section>
110 111
          <h2>${ chapter['display_name'] }</h2>

112
          <div class="sections">
113
            %for section in chapter['sections']:
114
            <div>
115 116 117 118 119 120
              <%
              earned = section['section_total'].earned
              total = section['section_total'].possible
              percentageString = "{0:.0%}".format( float(earned)/total) if earned > 0 and total > 0 else ""
              %>

121
              <h3><a href="${reverse('courseware_section', kwargs=dict(course_id=course.id.to_deprecated_string(), chapter=chapter['url_name'], section=section['url_name']))}">
122 123
                ${ section['display_name'] }
                %if total > 0 or earned > 0:
124
                  <span class="sr">
David Baumgold committed
125
                    ${_("{earned:.3n} of {total:.3n} possible points").format( earned = float(earned), total = float(total) )}
126
                  </span>
127
                %endif
128
                </a>
129 130 131 132
                %if total > 0 or earned > 0:
                  <span> ${"({0:.3n}/{1:.3n}) {2}".format( float(earned), float(total), percentageString )}</span>
                %endif
              </h3>
133 134 135
              <p>
                ${section['format']}

cahrens committed
136
                %if section.get('due') is not None:
137
                  <%
138
                      formatted_string = get_time_display(section['due'], course.due_date_display_format, coerce_tz=settings.TIME_ZONE_DISPLAYED_FOR_DEADLINES)
David Baumgold committed
139
                      due_date = '' if len(formatted_string)==0 else _(u'due {date}').format(date=formatted_string)
140
                  %>
141
                  <em>
142
                  ${due_date}
143 144 145 146
                  </em>
                %endif
              </p>

147
              <div class="scores">
148
                %if len(section['scores']) > 0:
David Baumgold committed
149
                  <h3> ${ _("Problem Scores: ") if section['graded'] else _("Practice Scores: ")} </h3>
150 151 152 153 154
                  <ol>
                    %for score in section['scores']:
                    <li>${"{0:.3n}/{1:.3n}".format(float(score.earned),float(score.possible))}</li>
                    %endfor
                  </ol>
155
                %else:
156
                  <h3 class="no-scores"> ${_("No problem scores in this section")} </h3>
157
                %endif
158
              </div>
159

160

161
            </div> <!--End section-->
162
            %endfor
163 164
          </div> <!--End sections-->
        </section> <!--End chapter-->
165 166
        %endif
        %endfor
167
      </div> <!--End chapters-->
168

169
    </div>
170
  </div>
171
</div>
172