progress.html 11.2 KB
Newer Older
1 2
<%inherit file="/main.html" />
<%namespace name='static' file='/static_content.html'/>
3 4 5
<%!
from django.utils.translation import ugettext as _
from django.core.urlresolvers import reverse
6
from util.date_utils import get_time_display, DEFAULT_SHORT_DATE_FORMAT
7 8 9
from django.conf import settings
from django.utils.http import urlquote_plus
%>
10
<%block name="bodyclass">view-in-course view-progress</%block>
11

12
<%block name="headextra">
13 14
<%static:css group='style-course-vendor'/>
<%static:css group='style-course'/>
15 16
</%block>

17

18
<%namespace name="progress_graph" file="/courseware/progress_graph.js"/>
19

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

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

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
      % if staff_access and studio_url is not None:
        <div class="wrap-instructor-info">
43
          <a class="instructor-info-action studio-view" href="${studio_url | h}">${_("View Grading in studio")}</a>
44 45
        </div>
      % endif
46

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

51 52 53 54 55 56 57 58 59 60 61
      %if show_generate_cert_btn:
      <div class="wrapper-msg wrapper-auto-cert">
        <div id="errors-info" class="errors-info"></div>
        %if passed:
        <div class="auto-cert-message" id="course-success">
          <div class="has-actions">
              <% post_url = reverse('generate_user_cert', args=[unicode(course.id)]) %>
              % if is_downloadable:
              <div class="msg-content">
                <h2 class="title">${_("Your certificate is available")}</h2>
                <p class="copy">
62
                  ${_("You can keep working for a higher grade, or request your certificate now.")}
63 64 65 66
                </p>
              </div>
              <div class="msg-actions">
                %if show_cert_web_view and cert_web_view_url:
67
                <a class="btn" href="${cert_web_view_url | h}" target="_blank" title="${_('View certificate in a new browser window or tab.')}">
68 69 70
                  ${_("View Certificate")}
                </a>
                %elif download_url:
71
                <a class="btn" href="${download_url | h}" target="_blank" title="${_('PDF will open in a new browser window or tab.')}">
72 73
                  ${_("Download Your Certificate")}
                </a>
74
                %endif
75 76 77
              </div>
              %elif is_generating:
              <div class="msg-content">
78
                ## Translators: This message appears to users when the system is processessing course certificates, which can take a few hours.
79 80 81 82 83 84 85 86 87 88
                <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">
89
                <button class="btn generate_certs" data-endpoint="${post_url | h}" id="btn_generate_cert">${_('Request Certificate')}</button>
90 91 92
              </div>
              %endif
          </div>
93 94
        </div>
        %endif
95 96
      </div>
      %endif
97

Calen Pennington committed
98
      %if not course.disable_progress_graph:
99
        <div class="grade-detail-graph" id="grade-detail-graph" aria-hidden="true"></div>
100
      %endif
101

Will Daly committed
102
      % if credit_course_requirements:
103 104 105 106 107
        <section class="credit-eligibility">
            <div class="credit-eligibility-container">
                <div class="eligibility-heading">
                    <h2>${_("Requirements for Course Credit")}</h2>
                </div>
108
                %if credit_course_requirements['eligibility_status'] == 'not_eligible':
109
                    <span class="eligibility_msg">${_("{student_name}, you are no longer eligible for credit in this course.").format(student_name=student.profile.name) | h}</span>
110
                %elif credit_course_requirements['eligibility_status'] == 'eligible':
111
                    <span class="eligibility_msg">${_("{student_name}, you have met the requirements for credit in this course.").format(student_name=student.profile.name) | h}
112 113 114
                        ${_("{a_start}Go to your dashboard{a_end} to purchase course credit.").format(
		             a_start=u"<a href={url}>".format(url=reverse('dashboard')),
			     a_end="</a>"
115
		      )}
116
                    </span>
117
                %elif credit_course_requirements['eligibility_status'] == 'partial_eligible':
118
                    <span>${_("{student_name}, you have not yet met the requirements for credit.").format(student_name=student.profile.name) | h}</span>
119
                %endif
120 121
                <a href="${settings.CREDIT_HELP_LINK_URL | h}" class="credit-help"><i class="fa fa-question"></i><span class="sr">${_("Information about course credit requirements")}</span></a><br>
                <div class="requirement-container" data-eligible="${credit_course_requirements['eligibility_status'] | h}">
122 123
                %for requirement in credit_course_requirements['requirements']:
                    <div class="requirement">
124
                        <div class="requirement-name">
125
                            ${_(requirement['display_name']) | h}
126
                            %if requirement['namespace'] == 'grade':
127
                                <span>${int(requirement['criteria']['min_grade'] * 100) | h}%</span>
128 129
                            %endif
                        </div>
130 131 132 133 134
                        <div class="requirement-status">
                            %if requirement['status']:
                                %if requirement['status'] == 'submitted':
                                    <span class="requirement-submitted">${_("Verification Submitted")}</span>
                                %elif requirement['status'] == 'failed':
135
                                    <i class="fa fa-times" aria-hidden="true"></i>
136
                                    <span>${_("Verification Failed" )}</span>
137 138 139
                                %elif requirement['status'] == 'declined':
                                    <i class="fa fa-times" aria-hidden="true"></i>
                                    <span>${_("Verification Declined" )}</span>
140
                                %elif requirement['status'] == 'satisfied':
141
                                    <i class="fa fa-check" aria-hidden="true"></i>
142
                                    % if requirement['namespace'] == 'grade' and 'final_grade' in requirement['reason']:
143
                                    <span>${int(requirement['reason']['final_grade'] * 100) | h}%</span>
144
                                    % else:
145
                                    <span>${_("Completed")} ${get_time_display(requirement['status_date'], DEFAULT_SHORT_DATE_FORMAT, settings.TIME_ZONE)}</span>
146
                                    % endif
147
                                %endif
148 149 150
                            %else:
                                <span class="not-achieve">${_("Upcoming")}</span>
                            %endif
151
                        </div>
152
                    </div>
153
                %endfor
154
                 </div>
155
                <button class="detail-collapse" aria-live="polite"><i class="fa fa-caret-up" aria-hidden="true"></i>
156
                    <span class="requirement-detail">${_("Less")}</span>
157 158 159 160 161
                </button>
            </div>
        </section>
      %endif

162
      <div class="chapters">
163 164
        %for chapter in courseware_summary:
        %if not chapter['display_name'] == "hidden":
165
        <section>
166
          <h2>${ chapter['display_name'] | h}</h2>
167

168
          <div class="sections">
169
            %for section in chapter['sections']:
170
            <div>
171 172 173 174 175 176
              <%
              earned = section['section_total'].earned
              total = section['section_total'].possible
              percentageString = "{0:.0%}".format( float(earned)/total) if earned > 0 and total > 0 else ""
              %>

177 178
              <h3><a href="${reverse('courseware_section', kwargs=dict(course_id=course.id.to_deprecated_string(), chapter=chapter['url_name'], section=section['url_name'])) | h}">
                ${ section['display_name'] | h}
179
                %if total > 0 or earned > 0:
180
                  <span class="sr">
181
                    ${_("{earned} of {total} possible points").format(earned='{:.3n}'.format(float(earned)), total='{:.3n}'.format(float(total))) | h}
182
                  </span>
183
                %endif
184
                </a>
185
                %if total > 0 or earned > 0:
186
                  <span> ${"({0:.3n}/{1:.3n}) {2}".format( float(earned), float(total), percentageString ) | h}</span>
187 188
                %endif
              </h3>
189
              <p>
190
                ${section['format'] | h}
191

cahrens committed
192
                %if section.get('due') is not None:
193
                  <%
194
                      formatted_string = get_time_display(section['due'], course.due_date_display_format, coerce_tz=settings.TIME_ZONE_DISPLAYED_FOR_DEADLINES)
David Baumgold committed
195
                      due_date = '' if len(formatted_string)==0 else _(u'due {date}').format(date=formatted_string)
196
                  %>
197
                  <em>
198
                  ${due_date | h}
199 200 201 202
                  </em>
                %endif
              </p>

203
              <div class="scores">
204
                %if len(section['scores']) > 0:
David Baumgold committed
205
                  <h3> ${ _("Problem Scores: ") if section['graded'] else _("Practice Scores: ")} </h3>
206 207
                  <ol>
                    %for score in section['scores']:
208
                    <li>${"{0:.3n}/{1:.3n}".format(float(score.earned),float(score.possible)) | h}</li>
209 210
                    %endfor
                  </ol>
211
                %else:
212
                  <h3 class="no-scores"> ${_("No problem scores in this section")} </h3>
213
                %endif
214
              </div>
215

216

217
            </div> <!--End section-->
218
            %endfor
219 220
          </div> <!--End sections-->
        </section> <!--End chapter-->
221 222
        %endif
        %endfor
223
      </div> <!--End chapters-->
224

225
    </div>
226
  </div>
227
</div>
228