Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
M
MACAO Hugo
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
MACAO
MACAO Hugo
Commits
6fdc9db1
Commit
6fdc9db1
authored
1 month ago
by
David Rouquet
Browse files
Options
Downloads
Patches
Plain Diff
Ajout compComment pour survey
parent
147b5593
No related branches found
No related tags found
No related merge requests found
Pipeline
#2070
passed
1 month ago
Stage: test
Stage: deploy
Changes
1
Pipelines
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
macao/assets/quiz.js
+18
-1
18 additions, 1 deletion
macao/assets/quiz.js
with
18 additions
and
1 deletion
macao/assets/quiz.js
+
18
−
1
View file @
6fdc9db1
...
@@ -71,6 +71,15 @@ $(function () {
...
@@ -71,6 +71,15 @@ $(function () {
visibleIndex
:
0
,
visibleIndex
:
0
,
});
});
// Add compComment to the metadata
Survey
.
JsonObject
.
metaData
.
addProperty
(
"
question
"
,
{
name
:
"
compComment
"
,
type
:
"
text
"
,
category
:
"
general
"
,
default
:
""
,
visibleIndex
:
0
,
});
// Load survey model from JSON
// Load survey model from JSON
const
survey
=
new
Survey
.
Model
(
jsonStatic
);
const
survey
=
new
Survey
.
Model
(
jsonStatic
);
const
questions
=
survey
.
getAllQuestions
();
const
questions
=
survey
.
getAllQuestions
();
...
@@ -104,11 +113,19 @@ $(function () {
...
@@ -104,11 +113,19 @@ $(function () {
}
}
}
}
// Display compComment if present
if
(
options
.
question
.
compComment
)
{
const
compCommentElement
=
document
.
createElement
(
'
div
'
);
compCommentElement
.
className
=
'
comp-comment
'
;
compCommentElement
.
innerHTML
=
options
.
question
.
compComment
;
options
.
htmlElement
.
appendChild
(
compCommentElement
);
}
// Add "Corrigé" button if helpComment is present
// Add "Corrigé" button if helpComment is present
if
(
options
.
question
.
helpComment
)
{
if
(
options
.
question
.
helpComment
)
{
const
helpButton
=
document
.
createElement
(
'
button
'
);
const
helpButton
=
document
.
createElement
(
'
button
'
);
helpButton
.
innerHTML
=
'
Corrigé
'
;
helpButton
.
innerHTML
=
'
Corrigé
'
;
helpButton
.
className
=
'
sd-btn sd-btn--action nav-input
'
;
// Apply the specified class
helpButton
.
className
=
'
sd-btn sd-btn--action nav-input
'
;
helpButton
.
onclick
=
()
=>
toggleHelpComment
(
options
.
question
,
options
.
htmlElement
);
helpButton
.
onclick
=
()
=>
toggleHelpComment
(
options
.
question
,
options
.
htmlElement
);
options
.
htmlElement
.
appendChild
(
helpButton
);
options
.
htmlElement
.
appendChild
(
helpButton
);
}
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
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!
Save comment
Cancel
Please
register
or
sign in
to comment