Commit a87bc461 by Hasnain

Merge remote-tracking branch 'origin/master' into phx-133-proctoring-option-multiple_clicks

parents d58d6895 f7ba83a3
...@@ -5,6 +5,20 @@ var edx = edx || {}; ...@@ -5,6 +5,20 @@ var edx = edx || {};
edx.instructor_dashboard = edx.instructor_dashboard || {}; edx.instructor_dashboard = edx.instructor_dashboard || {};
edx.instructor_dashboard.proctoring = edx.instructor_dashboard.proctoring || {}; edx.instructor_dashboard.proctoring = edx.instructor_dashboard.proctoring || {};
var examStatusReadableFormat = {
eligible: gettext('Eligible'),
created: gettext('Created'),
ready_to_start: gettext('Ready to start'),
started: gettext('Started'),
ready_to_submit: gettext('Ready to submit'),
declined: gettext('Declined'),
timed_out: gettext('Timed out'),
submitted: gettext('Submitted'),
verified: gettext('Verified'),
rejected: gettext('Rejected'),
not_reviewed: gettext('Not reviewed'),
error: gettext('Error')
};
var viewHelper = { var viewHelper = {
getDateFormat: function(date) { getDateFormat: function(date) {
if (date) { if (date) {
...@@ -14,6 +28,14 @@ var edx = edx || {}; ...@@ -14,6 +28,14 @@ var edx = edx || {};
return '---'; return '---';
} }
},
getExamAttemptStatus: function(status) {
if (status in examStatusReadableFormat) {
return examStatusReadableFormat[status]
}
else {
return status
}
} }
}; };
edx.instructor_dashboard.proctoring.ProctoredExamAttemptView = Backbone.View.extend({ edx.instructor_dashboard.proctoring.ProctoredExamAttemptView = Backbone.View.extend({
......
...@@ -8,7 +8,10 @@ var edx = edx || {}; ...@@ -8,7 +8,10 @@ var edx = edx || {};
edx.coursware.proctored_exam.ProctoredExamView = Backbone.View.extend({ edx.coursware.proctored_exam.ProctoredExamView = Backbone.View.extend({
initialize: function (options) { initialize: function (options) {
_.bindAll(this, "detectScroll");
this.$el = options.el; this.$el = options.el;
this.timerBarTopPosition = this.$el.position().top;
this.courseNavBarMarginTop = this.timerBarTopPosition - 3;
this.model = options.model; this.model = options.model;
this.templateId = options.proctored_template; this.templateId = options.proctored_template;
this.template = null; this.template = null;
...@@ -43,6 +46,17 @@ var edx = edx || {}; ...@@ -43,6 +46,17 @@ var edx = edx || {};
/* will call into the rendering */ /* will call into the rendering */
this.model.fetch(); this.model.fetch();
}, },
detectScroll: function(event) {
if ($(event.currentTarget).scrollTop() > this.timerBarTopPosition) {
$(".proctored_exam_status").addClass('is-fixed');
$(".wrapper-course-material").css('margin-top', this.courseNavBarMarginTop + 'px');
}
else {
$(".proctored_exam_status").removeClass('is-fixed');
$(".wrapper-course-material").css('margin-top', '0');
}
},
modelChanged: function () { modelChanged: function () {
// if we are a proctored exam, then we need to alert user that he/she // if we are a proctored exam, then we need to alert user that he/she
// should not be navigating around the courseware // should not be navigating around the courseware
...@@ -67,6 +81,9 @@ var edx = edx || {}; ...@@ -67,6 +81,9 @@ var edx = edx || {};
this.model.get('time_remaining_seconds') > 0 && this.model.get('time_remaining_seconds') > 0 &&
this.model.get('attempt_status') !== 'error' this.model.get('attempt_status') !== 'error'
) { ) {
// add callback on scroll event
$(window).bind('scroll', this.detectScroll);
var html = this.template(this.model.toJSON()); var html = this.template(this.model.toJSON());
this.$el.html(html); this.$el.html(html);
this.$el.show(); this.$el.show();
...@@ -92,6 +109,10 @@ var edx = edx || {}; ...@@ -92,6 +109,10 @@ var edx = edx || {};
}); });
}); });
} }
else {
// remove callback on scroll event
$(window).unbind('scroll', this.detectScroll);
}
} }
return this; return this;
}, },
......
<div class="wrapper-content wrapper"> <div class="wrapper-content wrapper">
<% var is_proctored_attempts = proctored_exam_attempts.length !== 0 %> <% var is_proctored_attempts = proctored_exam_attempts.length !== 0 %>
<section class="content"> <section class="content exam-attempts-content">
<div class="top-header"> <div class="top-header">
<div class='search-attempts'> <div class='search-attempts'>
<input type="text" id="search_attempt_id" placeholder="e.g johndoe or john.doe@gmail.com" <input type="text" id="search_attempt_id" placeholder="e.g johndoe or john.doe@gmail.com"
...@@ -81,7 +81,7 @@ ...@@ -81,7 +81,7 @@
<tr class="exam-attempt-headings"> <tr class="exam-attempt-headings">
<th class="username"><%- gettext("Username") %></th> <th class="username"><%- gettext("Username") %></th>
<th class="exam-name"><%- gettext("Exam Name") %></th> <th class="exam-name"><%- gettext("Exam Name") %></th>
<th class="attempt-allowed-time"><%- gettext("Allowed Time (Minutes)") %> </th> <th class="attempt-allowed-time"><%- gettext("Time Limit") %> </th>
<th class="attempt-started-at"><%- gettext("Started At") %></th> <th class="attempt-started-at"><%- gettext("Started At") %></th>
<th class="attempt-completed-at"><%- gettext("Completed At") %> </th> <th class="attempt-completed-at"><%- gettext("Completed At") %> </th>
<th class="attempt-status"><%- gettext("Status") %> </th> <th class="attempt-status"><%- gettext("Status") %> </th>
...@@ -103,7 +103,7 @@ ...@@ -103,7 +103,7 @@
<td> <%= getDateFormat(proctored_exam_attempt.completed_at) %></td> <td> <%= getDateFormat(proctored_exam_attempt.completed_at) %></td>
<td> <td>
<% if (proctored_exam_attempt.status){ %> <% if (proctored_exam_attempt.status){ %>
<%= proctored_exam_attempt.status %> <%= getExamAttemptStatus(proctored_exam_attempt.status) %>
<% } else { %> <% } else { %>
N/A N/A
<% } %> <% } %>
......
# Django/Framework Packages # Django/Framework Packages
django>=1.4.12,<=1.4.22 django>=1.4.12,<=1.4.22
django-model-utils==1.4.0 django-model-utils==2.3.1
South>=0.7.6 South>=0.7.6
djangorestframework>=2.3.5,<=2.3.14 djangorestframework>=2.3.5,<=2.3.14
django-ipware==1.1.0
pytz>=2012h pytz>=2012h
pycrypto>=2.6 pycrypto>=2.6
# Empty so that we will use the versions of dependencies installed in edx-platform.
# See local_requirements.txt for the requirements needed for local development.
# Third Party
-e git+https://github.com/un33k/django-ipware.git@42cb1bb1dc680a60c6452e8bb2b843c2a0382c90#egg=django-ipware
...@@ -34,7 +34,7 @@ def load_requirements(*requirements_paths): ...@@ -34,7 +34,7 @@ def load_requirements(*requirements_paths):
setup( setup(
name='edx-proctoring', name='edx-proctoring',
version='0.6.2', version='0.6.3',
description='Proctoring subsystem for Open edX', description='Proctoring subsystem for Open edX',
long_description=open('README.md').read(), long_description=open('README.md').read(),
author='edX', author='edX',
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment