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
edx
edx-proctoring
Commits
82b6ddb7
Commit
82b6ddb7
authored
Sep 02, 2015
by
chrisndodge
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #126 from edx/hasnain-naveed/PHX-133-avoid-multiple-click
PHX-133/avoid multiple click
parents
db8efa82
9fc8672b
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
153 additions
and
63 deletions
+153
-63
edx_proctoring/templates/proctoring/seq_proctored_exam_entrance.html
+60
-29
edx_proctoring/templates/proctoring/seq_proctored_practice_exam_entrance.html
+50
-19
edx_proctoring/templates/proctoring/seq_timed_exam_entrance.html
+43
-15
No files found.
edx_proctoring/templates/proctoring/seq_proctored_exam_entrance.html
View file @
82b6ddb7
...
@@ -25,7 +25,7 @@
...
@@ -25,7 +25,7 @@
{% endblocktrans %}
{% endblocktrans %}
</p>
</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>
<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>
...
@@ -38,44 +38,75 @@
...
@@ -38,44 +38,75 @@
even if you achieve a passing grade.
even if you achieve a passing grade.
{% endblocktrans %}
{% endblocktrans %}
</p>
</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=
false
data-start-immediately=
true
></i>
<i
class=
"fa fa-arrow-circle-right
"
></i>
</button>
</button>
</div>
</div>
{% 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
(
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'
);
if
(
!
attempt_proctored
)
{
var
inProcess
=
false
;
var
msg
=
gettext
(
"Are you sure you want to take this exam without proctoring? "
+
var
disableClickEvent
=
function
()
{
"You will no longer be eligible to use this course for academic credit."
inProcess
=
true
;
);
$
(
'body'
).
css
(
'cursor'
,
'wait'
);
if
(
!
confirm
(
msg
))
{
$
(
'.start-timed-exam'
).
css
(
'cursor'
,
'wait'
);
return
;
};
var
enableClickEvent
=
function
()
{
inProcess
=
false
;
$
(
'body'
).
css
(
'cursor'
,
'auto'
);
$
(
'.start-timed-exam'
).
css
(
'cursor'
,
'auto'
);
};
$
(
'.start-timed-exam'
).
click
(
function
()
{
if
(
!
inProcess
)
{
disableClickEvent
();
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'
);
if
(
!
attempt_proctored
)
{
var
msg
=
gettext
(
"Are you sure you want to take this exam without proctoring? "
+
"You will no longer be eligible to use this course for academic credit."
);
if
(
!
confirm
(
msg
))
{
enableClickEvent
();
return
;
}
}
}
}
if
(
typeof
action_url
===
"undefined"
)
{
if
(
typeof
action_url
===
"undefined"
)
{
enableClickEvent
();
return
false
;
}
var
self
=
$
(
this
);
$
.
post
(
action_url
,
{
"exam_id"
:
exam_id
,
"attempt_proctored"
:
attempt_proctored
,
"start_clock"
:
start_immediately
},
function
(
data
)
{
// reload the page, because we've unlocked it
location
.
reload
();
}
).
fail
(
function
(){
enableClickEvent
();
var
msg
=
gettext
(
"There has been a problem starting your exam.
\
n
\
n"
+
"Possible reasons are that your account has not been fully activated,
\
n"
+
"you have are experiencing a network connection problem, or there has been
\
n"
+
"a service disruption. Please check these and try again."
);
alert
(
msg
);
});
}
else
{
return
false
;
return
false
;
}
}
$
.
post
(
action_url
,
{
"exam_id"
:
exam_id
,
"attempt_proctored"
:
attempt_proctored
,
"start_clock"
:
start_immediately
},
function
(
data
)
{
// reload the page, because we've unlocked it
location
.
reload
();
}
);
}
}
);
);
</script>
</script>
edx_proctoring/templates/proctoring/seq_proctored_practice_exam_entrance.html
View file @
82b6ddb7
...
@@ -28,27 +28,58 @@
...
@@ -28,27 +28,58 @@
{% 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
(
function
(
event
)
{
var
inProcess
=
false
;
var
action_url
=
$
(
this
).
data
(
'ajax-url'
);
var
exam_id
=
$
(
this
).
data
(
'exam-id'
);
var
disableClickEvent
=
function
()
{
var
attempt_proctored
=
$
(
this
).
data
(
'attempt-proctored'
);
inProcess
=
true
;
var
start_immediately
=
$
(
this
).
data
(
'start-immediately'
);
$
(
'body'
).
css
(
'cursor'
,
'wait'
);
if
(
typeof
action_url
===
"undefined"
)
{
$
(
'.start-timed-exam'
).
css
(
'cursor'
,
'wait'
);
};
var
enableClickEvent
=
function
()
{
inProcess
=
false
;
$
(
'body'
).
css
(
'cursor'
,
'auto'
);
$
(
'.start-timed-exam'
).
css
(
'cursor'
,
'auto'
);
};
$
(
'.start-timed-exam'
).
click
(
function
()
{
if
(
!
inProcess
)
{
disableClickEvent
();
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'
);
if
(
typeof
action_url
===
"undefined"
)
{
enableClickEvent
();
return
false
;
}
var
self
=
$
(
this
);
$
.
post
(
action_url
,
{
"exam_id"
:
exam_id
,
"attempt_proctored"
:
attempt_proctored
,
"start_clock"
:
start_immediately
},
function
(
data
)
{
// reload the page, because we've unlocked it
location
.
reload
();
}
).
fail
(
function
(){
enableClickEvent
();
var
msg
=
gettext
(
"There has been a problem starting your exam.
\
n
\
n"
+
"Possible reasons are that your account has not been fully activated,
\
n"
+
"you have are experiencing a network connection problem, or there has been
\
n"
+
"a service disruption. Please check these and try again."
);
alert
(
msg
);
});
}
else
{
return
false
;
return
false
;
}
}
$
.
post
(
action_url
,
{
"exam_id"
:
exam_id
,
"attempt_proctored"
:
attempt_proctored
,
"start_clock"
:
start_immediately
},
function
(
data
)
{
// reload the page, because we've unlocked it
location
.
reload
();
}
);
}
}
);
);
</script>
</script>
edx_proctoring/templates/proctoring/seq_timed_exam_entrance.html
View file @
82b6ddb7
...
@@ -24,22 +24,50 @@
...
@@ -24,22 +24,50 @@
{% include 'proctoring/seq_timed_exam_footer.html' %}
{% include 'proctoring/seq_timed_exam_footer.html' %}
<script
type=
"text/javascript"
>
<script
type=
"text/javascript"
>
$
(
'.start-timed-exam'
).
click
(
function
(
event
)
{
var
action_url
=
$
(
this
).
data
(
'ajax-url'
);
var
exam_id
=
$
(
this
).
data
(
'exam-id'
);
$
.
post
(
var
inProcess
=
false
;
action_url
,
{
var
disableClickEvent
=
function
()
{
"exam_id"
:
exam_id
,
inProcess
=
true
;
"start_clock"
:
true
$
(
'body'
).
css
(
'cursor'
,
'wait'
);
},
$
(
'.start-timed-exam'
).
css
(
'cursor'
,
'wait'
);
function
(
data
)
{
};
// reload the page, because we've unlocked it
location
.
reload
();
var
enableClickEvent
=
function
()
{
}
inProcess
=
false
;
);
$
(
'body'
).
css
(
'cursor'
,
'auto'
);
$
(
'.start-timed-exam'
).
css
(
'cursor'
,
'auto'
);
};
$
(
'.start-timed-exam'
).
click
(
function
()
{
if
(
!
inProcess
)
{
disableClickEvent
();
var
action_url
=
$
(
this
).
data
(
'ajax-url'
);
var
exam_id
=
$
(
this
).
data
(
'exam-id'
);
$
.
post
(
action_url
,
{
"exam_id"
:
exam_id
,
"start_clock"
:
true
},
function
(
data
)
{
// reload the page, because we've unlocked it
location
.
reload
();
}
).
fail
(
function
(){
enableClickEvent
();
var
msg
=
gettext
(
"There has been a problem starting your exam.
\
n
\
n"
+
"Possible reasons are that your account has not been fully activated,
\
n"
+
"you have are experiencing a network connection problem, or there has been
\
n"
+
"a service disruption. Please check these and try again."
);
alert
(
msg
);
});
}
else
{
return
false
;
}
}
}
);
);
</script>
</script>
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