Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
sp-quiz
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Monitor
Service Desk
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Philip Kaluđerčić
sp-quiz
Commits
c7630349
Commit
c7630349
authored
1 year ago
by
Philip Kaluđerčić
Browse files
Options
Downloads
Patches
Plain Diff
Update comment in shuf
parent
7b52e818
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
quiz.js
+2
-3
2 additions, 3 deletions
quiz.js
with
2 additions
and
3 deletions
quiz.js
+
2
−
3
View file @
c7630349
// This horrible file is distributed under the CC0 license. Consult
// ./LICENSE for more details.
// $Id: quiz.js,v 1.
2
2024/01/1
1
1
6
:1
9:30
oj14ozun Exp oj14ozun $
// $Id: quiz.js,v 1.
3
2024/01/1
2
1
0
:1
5:28
oj14ozun Exp oj14ozun $
"
use strict
"
;
...
...
@@ -27,8 +27,7 @@ var opts = []; // DOM objects of each answer
var
progress
=
JSON
.
parse
(
window
.
localStorage
.
getItem
(
"
progress
"
))
||
{};
function
shuf
(
arr
)
{
// shuffle option-order using Fisher–Yates shuffle
function
shuf
(
arr
)
{
// shuffle arr using Fisher–Yates shuffle
for
(
let
i
=
0
;
i
<
arr
.
length
-
1
;
i
++
)
{
const
j
=
Math
.
floor
(
Math
.
random
()
*
arr
.
length
);
const
tmp
=
arr
[
j
];
...
...
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