Commit eed6f5a1 by Muhammad Hasnain Naveed

Merge pull request #121 from edx/hassnain/revert-master-to-f7ba83a3-new1

reverting commits
parents a87bc461 f8c3d078
...@@ -5,20 +5,6 @@ var edx = edx || {}; ...@@ -5,20 +5,6 @@ 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) {
...@@ -28,14 +14,6 @@ var edx = edx || {}; ...@@ -28,14 +14,6 @@ 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,10 +8,7 @@ var edx = edx || {}; ...@@ -8,10 +8,7 @@ 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;
...@@ -46,17 +43,6 @@ var edx = edx || {}; ...@@ -46,17 +43,6 @@ 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
...@@ -81,9 +67,6 @@ var edx = edx || {}; ...@@ -81,9 +67,6 @@ 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();
...@@ -109,10 +92,6 @@ var edx = edx || {}; ...@@ -109,10 +92,6 @@ 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 exam-attempts-content"> <section class="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("Time Limit") %> </th> <th class="attempt-allowed-time"><%- gettext("Allowed Time (Minutes)") %> </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){ %>
<%= getExamAttemptStatus(proctored_exam_attempt.status) %> <%= proctored_exam_attempt.status %>
<% } else { %> <% } else { %>
N/A N/A
<% } %> <% } %>
......
...@@ -25,7 +25,7 @@ ...@@ -25,7 +25,7 @@
{% endblocktrans %} {% endblocktrans %}
</p> </p>
<i class="fa fa-arrow-circle-right"></i> <i class="fa fa-arrow-circle-right start-timed-exam" data-ajax-url="{{enter_exam_endpoint}}" data-exam-id="{{exam_id}}" data-attempt-proctored=true data-start-immediately=false></i>
</button> </button>
<button class="gated-sequence start-timed-exam" data-ajax-url="{{enter_exam_endpoint}}" data-exam-id="{{exam_id}}" data-attempt-proctored=false data-start-immediately=true> <button class="gated-sequence start-timed-exam" data-ajax-url="{{enter_exam_endpoint}}" data-exam-id="{{exam_id}}" data-attempt-proctored=false data-start-immediately=true>
<span><i class="fa fa-unlock"></i></span> <span><i class="fa fa-unlock"></i></span>
...@@ -44,22 +44,12 @@ ...@@ -44,22 +44,12 @@
{% include 'proctoring/seq_proctored_exam_footer.html' %} {% include 'proctoring/seq_proctored_exam_footer.html' %}
<script type="text/javascript"> <script type="text/javascript">
$('.start-timed-exam').click(
var selector = $('.start-timed-exam');
selector.click(
function(event) { function(event) {
var action_url = $(this).data('ajax-url');
var action_url = selector.data('ajax-url'); var exam_id = $(this).data('exam-id');
var exam_id = selector.data('exam-id'); var attempt_proctored = $(this).data('attempt-proctored');
var attempt_proctored = selector.data('attempt-proctored'); var start_immediately = $(this).data('start-immediately');
var start_immediately = selector.data('start-immediately');
// unbind the click event to prevent the multiple calls
selector.unbind('click');
// adding class for moving cursor and to change the color of button
selector.parent().addClass('disable-proctored-exam-btn');
if (!attempt_proctored) { if (!attempt_proctored) {
var msg = gettext( var msg = gettext(
...@@ -82,11 +72,6 @@ ...@@ -82,11 +72,6 @@
"start_clock": start_immediately "start_clock": start_immediately
}, },
function(data) { function(data) {
// remove the class and bind the click event
selector.parent().removeClass('disable-proctored-exam-btn');
selector.bind('click');
// reload the page, because we've unlocked it // reload the page, because we've unlocked it
location.reload(); location.reload();
} }
......
# Django/Framework Packages # Django/Framework Packages
django>=1.4.12,<=1.4.22 django>=1.4.12,<=1.4.22
django-model-utils==2.3.1 django-model-utils==1.4.0
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.3', version='0.6.2',
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