Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
P
Pariksha
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Roshan Rabinarayan
Pariksha
Commits
8dd9b52e
Commit
8dd9b52e
authored
Nov 15, 2020
by
Samarth Joshi
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
BugFix: Quiz doesnot notify event if user Alt+Tabs in fullscreen
parent
118a5df6
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
31 additions
and
2 deletions
+31
-2
quiz/templates/index.html
quiz/templates/index.html
+31
-2
No files found.
quiz/templates/index.html
View file @
8dd9b52e
...
@@ -20,6 +20,16 @@
...
@@ -20,6 +20,16 @@
return
false
;
return
false
;
}
}
document
.
addEventListener
(
'
contextmenu
'
,
event
=>
event
.
preventDefault
());
document
.
addEventListener
(
'
contextmenu
'
,
event
=>
event
.
preventDefault
());
var
isTabActive
;
window
.
onfocus
=
function
()
{
isTabActive
=
true
;
};
window
.
onblur
=
function
()
{
isTabActive
=
false
;
};
</script>
</script>
</head>
</head>
<body>
<body>
...
@@ -148,7 +158,26 @@
...
@@ -148,7 +158,26 @@
return
false
;
return
false
;
}
}
}
}
var
vis
=
(
function
(){
var
stateKey
,
eventKey
,
keys
=
{
hidden
:
"
visibilitychange
"
,
webkitHidden
:
"
webkitvisibilitychange
"
,
mozHidden
:
"
mozvisibilitychange
"
,
msHidden
:
"
msvisibilitychange
"
};
for
(
stateKey
in
keys
)
{
if
(
stateKey
in
document
)
{
eventKey
=
keys
[
stateKey
];
break
;
}
}
return
function
(
c
)
{
if
(
c
)
document
.
addEventListener
(
eventKey
,
c
);
return
!
document
[
stateKey
];
}
})();
var
heartbeat
=
setInterval
(
function
()
{
var
heartbeat
=
setInterval
(
function
()
{
var
currfs
=
get_fs
();
var
currfs
=
get_fs
();
var
flag
=
false
;
var
flag
=
false
;
if
(
currfs
!=
prevfs
)
{
if
(
currfs
!=
prevfs
)
{
...
@@ -161,8 +190,8 @@
...
@@ -161,8 +190,8 @@
{
{
question
:
selected_questions
,
question
:
selected_questions
,
quiz
:
quizId
,
quiz
:
quizId
,
fullscreen
:
currfs
,
fullscreen
:
(
currfs
&&
isTabActive
)
,
log
:
flag
log
:
flag
,
},
},
function
(
data
,
status
){
function
(
data
,
status
){
console
.
log
(
"
Heartbeat sent!
"
);
console
.
log
(
"
Heartbeat sent!
"
);
...
...
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