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
1b4341c9
Commit
1b4341c9
authored
Aug 19, 2015
by
Muhammad Shoaib
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
moved the scroll event in the proctored_exam_view. js file
parent
49cc3eff
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
20 additions
and
12 deletions
+20
-12
edx_proctoring/static/proctoring/js/proctored_app.js
+0
-12
edx_proctoring/static/proctoring/js/views/proctored_exam_view.js
+20
-0
No files found.
edx_proctoring/static/proctoring/js/proctored_app.js
View file @
1b4341c9
...
@@ -5,16 +5,4 @@ $(function() {
...
@@ -5,16 +5,4 @@ $(function() {
model
:
new
ProctoredExamModel
()
model
:
new
ProctoredExamModel
()
});
});
proctored_exam_view
.
render
();
proctored_exam_view
.
render
();
// show the timer bar when the window scrolls.
$
(
window
).
scroll
(
function
()
{
if
(
$
(
this
).
scrollTop
()
>
60
){
$
(
".proctored_exam_status"
).
addClass
(
'fixed'
);
$
(
".wrapper-course-material"
).
css
(
'margin-top'
,
'58px'
);
}
else
{
$
(
".proctored_exam_status"
).
removeClass
(
'fixed'
);
$
(
".wrapper-course-material"
).
css
(
'margin-top'
,
'0'
);
}
});
});
});
edx_proctoring/static/proctoring/js/views/proctored_exam_view.js
View file @
1b4341c9
...
@@ -8,7 +8,9 @@ var edx = edx || {};
...
@@ -8,7 +8,9 @@ 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
.
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 +45,17 @@ var edx = edx || {};
...
@@ -43,6 +45,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
(
'fixed'
);
$
(
".wrapper-course-material"
).
css
(
'margin-top'
,
'58px'
);
}
else
{
$
(
".proctored_exam_status"
).
removeClass
(
'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 +80,9 @@ var edx = edx || {};
...
@@ -67,6 +80,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 +108,10 @@ var edx = edx || {};
...
@@ -92,6 +108,10 @@ var edx = edx || {};
});
});
//$('.proctored-exam-action-stop').css('cursor', 'pointer');
//$('.proctored-exam-action-stop').css('cursor', 'pointer');
}
}
else
{
// remove callback on scroll event
$
(
window
).
unbind
(
'scroll'
,
this
.
detectScroll
);
}
}
}
return
this
;
return
this
;
},
},
...
...
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