Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
S
Survey-Quizgets
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
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
MACAO
Survey-Quizgets
Commits
7cb614e4
Commit
7cb614e4
authored
11 months ago
by
Eliott Sammier
Browse files
Options
Downloads
Patches
Plain Diff
Fix CSS for gaps, add "Check answers" button
parent
2ebb94be
Branches
Branches containing commit
No related tags found
No related merge requests found
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
src/index.html
+1
-0
1 addition, 0 deletions
src/index.html
src/index.js
+14
-1
14 additions, 1 deletion
src/index.js
src/style.css
+15
-0
15 additions, 0 deletions
src/style.css
with
30 additions
and
1 deletion
src/index.html
+
1
−
0
View file @
7cb614e4
...
@@ -4,6 +4,7 @@
...
@@ -4,6 +4,7 @@
<meta
charset=
"UTF-8"
>
<meta
charset=
"UTF-8"
>
<title>
Survey-Quizgets example
</title>
<title>
Survey-Quizgets example
</title>
<link
rel=
"shortcut icon"
href=
"data:image/x-icon;,"
type=
"image/x-icon"
>
<link
rel=
"stylesheet"
href=
"style.css"
>
<link
rel=
"stylesheet"
href=
"style.css"
>
<!-- SurveyJS & dependencies-->
<!-- SurveyJS & dependencies-->
<script
defer
src=
"https://cdnjs.cloudflare.com/ajax/libs/jquery/3.5.1/jquery.min.js"
<script
defer
src=
"https://cdnjs.cloudflare.com/ajax/libs/jquery/3.5.1/jquery.min.js"
...
...
This diff is collapsed.
Click to expand it.
src/index.js
+
14
−
1
View file @
7cb614e4
...
@@ -9,6 +9,19 @@ function main() {
...
@@ -9,6 +9,19 @@ function main() {
let
survey
=
new
Survey
.
Model
(
json
);
let
survey
=
new
Survey
.
Model
(
json
);
// Add "Check answers" button
survey
.
addNavigationItem
({
id
:
"
sv-nav-check
"
,
title
:
"
Check
"
,
action
:
()
=>
{
survey
.
currentPage
.
questions
.
forEach
((
question
)
=>
{
console
.
log
(
"
%o: correct = %o
\n\t
value = %o
\n\t
correctAnswer = %o
"
,
question
.
name
,
question
.
isAnswerCorrect
(),
question
.
value
,
question
.
correctAnswer
);
});
},
css
:
"
nav-button
"
,
innerCss
:
"
sd-btn sd-btn--action nav-input
"
});
// Inflate the survey in the page
// Inflate the survey in the page
$
(
"
#surveyContainer
"
).
Survey
({
model
:
survey
});
$
(
"
#surveyContainer
"
).
Survey
({
model
:
survey
});
}
}
\ No newline at end of file
This diff is collapsed.
Click to expand it.
src/style.css
0 → 100644
+
15
−
0
View file @
7cb614e4
/* Hide "Complete survey" button */
#sv-nav-complete
{
display
:
none
;
}
/* Tweak SurveyJS' default style for our custom widgets */
p
#gapfill-container
{
white-space
:
pre-wrap
;
line-height
:
3em
;
}
select
.sd-dropdown.inline-dropdown
{
display
:
inline-block
;
width
:
fit-content
;
padding
:
8px
;
}
\ No newline at end of file
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