Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Paul-Elliot Anglès d'Auriac
class-panic
Commits
21ed42ce
Commit
21ed42ce
authored
Oct 02, 2018
by
Paul-Elliot Anglès d'Auriac
Browse files
support MathJax
parent
cb04a202
Changes
5
Hide whitespace changes
Inline
Side-by-side
models/room.js
View file @
21ed42ce
...
...
@@ -56,7 +56,7 @@ exports.listOfCourse = function (courseID, callback) {
function
(
room
)
{
return
function
(
callback
)
{
bdd
.
query
(
'
SELECT COUNT(*) as number FROM poll WHERE `roomID` = ?
'
,
[
room
.
id
],
function
(
err
,
ans
)
{
bdd
.
query
(
'
SELECT
pseudo
as owner FROM users WHERE `id` = ?
'
,
[
room
.
ownerID
],
function
(
err
,
ans1
)
{
bdd
.
query
(
'
SELECT
fullName
as owner FROM users WHERE `id` = ?
'
,
[
room
.
ownerID
],
function
(
err
,
ans1
)
{
room
.
number
=
ans
[
0
].
number
;
room
.
owner
=
ans1
[
0
].
owner
;
callback
();
...
...
public/javascripts/admin.js
View file @
21ed42ce
...
...
@@ -62,6 +62,7 @@ socketAdmin.on('newStats', function (newStats) {
else
stat
.
response2
=
document
.
querySelector
(
"
#r
"
+
stat
.
response
).
innerHTML
;
li
.
innerHTML
=
'
<div style="display:flex; justify-content: space-between;color:
'
+
color
+
'
;">
'
+
/*stat.pseudo*/
stat
.
fullName
+
'
: <span>
'
+
stat
.
response2
+
'
</span></div>
'
MathJax
.
Hub
.
Queue
([
"
Typeset
"
,
MathJax
.
Hub
,
li
]);
ul
.
appendChild
(
li
);
});
document
.
querySelector
(
"
#stats ul
"
).
innerHTML
=
ul
.
innerHTML
;
...
...
public/javascripts/student.js
View file @
21ed42ce
...
...
@@ -17,7 +17,9 @@ socket.on('connect', () => {
socket
.
on
(
'
newQuestion
'
,
function
(
reponse
)
{
// console.log(reponse);
document
.
querySelector
(
"
#question
"
).
textContent
=
reponse
.
enonce
;
enonce
=
document
.
querySelector
(
"
#question
"
);
enonce
.
textContent
=
reponse
.
enonce
;
MathJax
.
Hub
.
Queue
([
"
Typeset
"
,
MathJax
.
Hub
,
enonce
]);
wrapper
=
document
.
querySelector
(
"
#wrapperAnswer
"
);
while
(
wrapper
.
firstChild
)
{
wrapper
.
removeChild
(
wrapper
.
firstChild
);
...
...
@@ -32,6 +34,7 @@ socket.on('newQuestion', function (reponse) {
chooseAnswer
(
index
);
});
elem
.
textContent
=
rep
.
reponse
;
MathJax
.
Hub
.
Queue
([
"
Typeset
"
,
MathJax
.
Hub
,
elem
]);
wrapper
.
appendChild
(
elem
);
});
});
...
...
views/play.ejs
View file @
21ed42ce
...
...
@@ -5,6 +5,9 @@
<title>
title
</title>
<link
rel=
"stylesheet"
href=
"/stylesheets/css_reset.css"
>
<link
rel=
"stylesheet"
href=
"/stylesheets/play_student.css"
>
<script
type=
"text/javascript"
async
src=
"https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.5/MathJax.js?config=TeX-MML-AM_CHTML"
>
</script>
</head>
<body>
<div
id=
"question"
onclick=
"chooseAnswer(-1)"
></div>
...
...
views/play_admin.ejs
View file @
21ed42ce
...
...
@@ -6,6 +6,9 @@
<link
rel=
"stylesheet"
href=
"/stylesheets/css_reset.css"
>
<link
rel=
"stylesheet"
href=
"/stylesheets/play_student.css"
>
<link
rel=
"stylesheet"
href=
"/stylesheets/play_admin.css"
>
<script
type=
"text/javascript"
async
src=
"https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.5/MathJax.js?config=TeX-MML-AM_CHTML"
>
</script>
</head>
<body>
<div
id=
"answerContainer"
>
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new 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