Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
E
edx-proctoring
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
OpenEdx
edx-proctoring
Commits
d58d6895
Commit
d58d6895
authored
Aug 26, 2015
by
Hasnain
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
avoid multiple clicks by unbinding the click event
parent
617db2b2
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
21 additions
and
6 deletions
+21
-6
edx_proctoring/templates/proctoring/seq_proctored_exam_entrance.html
+21
-6
No files found.
edx_proctoring/templates/proctoring/seq_proctored_exam_entrance.html
View file @
d58d6895
...
...
@@ -25,7 +25,7 @@
{% endblocktrans %}
</p>
<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>
<i
class=
"fa fa-arrow-circle-right
"
></i>
</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
>
<span><i
class=
"fa fa-unlock"
></i></span>
...
...
@@ -44,12 +44,22 @@
{% include 'proctoring/seq_proctored_exam_footer.html' %}
<script
type=
"text/javascript"
>
$
(
'.start-timed-exam'
).
click
(
var
selector
=
$
(
'.start-timed-exam'
);
selector
.
click
(
function
(
event
)
{
var
action_url
=
$
(
this
).
data
(
'ajax-url'
);
var
exam_id
=
$
(
this
).
data
(
'exam-id'
);
var
attempt_proctored
=
$
(
this
).
data
(
'attempt-proctored'
);
var
start_immediately
=
$
(
this
).
data
(
'start-immediately'
);
var
action_url
=
selector
.
data
(
'ajax-url'
);
var
exam_id
=
selector
.
data
(
'exam-id'
);
var
attempt_proctored
=
selector
.
data
(
'attempt-proctored'
);
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
)
{
var
msg
=
gettext
(
...
...
@@ -72,6 +82,11 @@
"start_clock"
:
start_immediately
},
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
location
.
reload
();
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment