From ccb7e51ef853d27808794795dc80f1a6a06fcd58 Mon Sep 17 00:00:00 2001 From: luca0N! Date: Sun, 30 May 2021 23:28:18 -0300 Subject: [PATCH 01/10] Add project information and LibreJS license on index page --- index.html | 29 +++++++++++++++++++++++++++++ session.html | 2 +- 2 files changed, 30 insertions(+), 1 deletion(-) diff --git a/index.html b/index.html index 711f0c9..cc5932e 100644 --- a/index.html +++ b/index.html @@ -26,6 +26,33 @@ Privacy Rating + +

Privacy Rating


@@ -35,5 +62,7 @@

This service does not track you, and your answers are not sent to our servers. If you don't want to trust this instance, you can self-host it yourself.

Once you are ready to start, click on the button below.

+
+

Released under the GNU General Public License version 3 or later, by luca0N!

diff --git a/session.html b/session.html index f78fb27..c974474 100644 --- a/session.html +++ b/session.html @@ -91,6 +91,6 @@ Windows -->
-

Released under the GNU General Public License version 3 or later, by luca0N!

+

Released under the GNU General Public License version 3 or later, by luca0N!

From fd377ba8c0b0779b467bb73e9a5124fa25e93e64 Mon Sep 17 00:00:00 2001 From: luca0N! Date: Sun, 30 May 2021 23:34:18 -0300 Subject: [PATCH 02/10] Add meta tag to make pages resposive --- index.html | 4 ++-- session.html | 2 ++ 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/index.html b/index.html index cc5932e..427a73b 100644 --- a/index.html +++ b/index.html @@ -26,8 +26,8 @@ Privacy Rating - - From e253939fb0914e5937973d60407c39d292cc3950 Mon Sep 17 00:00:00 2001 From: luca0N! Date: Wed, 2 Jun 2021 18:08:25 -0300 Subject: [PATCH 03/10] Updated style --- index.html | 20 ++++---- res/Stairway-js.css | 39 ++++++++++++++-- res/js/main.js | 3 +- session.html | 110 ++++++++++++++++++++++---------------------- 4 files changed, 105 insertions(+), 67 deletions(-) diff --git a/index.html b/index.html index 427a73b..508d94a 100644 --- a/index.html +++ b/index.html @@ -55,14 +55,16 @@ -

Privacy Rating


-

It looks like your browser is configured to block JavaScript. We're sorry, but this page requires JavaScript in order to function.

-

Privacy Rating displays a form containing a few questions which are used to show a privacy grade based on your technology tasks, ranging from excellent (Grade S) to very bad (Grade F).

-

Privacy Rating attemps to warn you about bad software, services and practices in order to protect your privacy online.

-

This service does not track you, and your answers are not sent to our servers. If you don't want to trust this instance, you can self-host it yourself.

-

Once you are ready to start, click on the button below.

- -
-

Released under the GNU General Public License version 3 or later, by luca0N!

+
+

Privacy Rating


+

It looks like your browser is configured to block JavaScript. We're sorry, but this page requires JavaScript in order to function.

+

Privacy Rating displays a form containing a few questions which are used to show a privacy grade based on your technology tasks, ranging from excellent (Grade S) to very bad (Grade F).

+

Privacy Rating attemps to warn you about bad software, services and practices in order to protect your privacy online.

+

This service does not track you, and your answers are not sent to our servers. If you don't want to trust this instance, you can self-host it yourself.

+

Once you are ready to start, click on the button below.

+ +
+

Released under the GNU General Public License version 3 or later, by luca0N!

+
diff --git a/res/Stairway-js.css b/res/Stairway-js.css index dba8adf..239a3da 100644 --- a/res/Stairway-js.css +++ b/res/Stairway-js.css @@ -27,6 +27,16 @@ html { body { margin-left: 15%; margin-right: 15%; + margin-top: 0; + margin-bottom: 0; + + background-color: #bfc0cd; +} + +.content { + background-color: #fff; + padding: 24px; + box-shadow: 0 0 32px #0004; } #results { @@ -104,7 +114,12 @@ body { margin-top: 32px; margin-bottom: 32px; padding: 15px; - border-style: dashed; + background-color: #feffea; + box-shadow: 0 0 12px #0004; +} + +.section-question:hover { + box-shadow: 0 0 24px #0008; } #warning { @@ -127,7 +142,24 @@ body { .section-report { margin-top: 12px; padding: 15px; - border: solid; + box-shadow: 0 0 12px #0004; +} + +.section-report-good { + background-color: #aaffaa; +} +.section-report-warning { + background-color: #ffa; +} +.section-report-bad { + background-color: #ffd79f; +} +.section-report-critical { + background-color: #fcc; +} + +.advisory { + font-weight: bold; } .report-title { @@ -144,8 +176,9 @@ body { } .report-warning { background-color: yellow; -} + .report-bad { + color: white; background-color: orange; } .report-critical { diff --git a/res/js/main.js b/res/js/main.js index 52efd40..26b5bad 100644 --- a/res/js/main.js +++ b/res/js/main.js @@ -160,7 +160,7 @@ function setUpStrings(){ let report = quiz.reports[choices[x][y]]; let reportEl = document.createElement('div'); - reportEl.className = 'section-report'; + reportEl.className = 'section-report section-report-' + report.type; let title = document.createElement('p'); title.className = 'report-title'; @@ -194,6 +194,7 @@ function setUpStrings(){ if (report.advisory != null && report.advisory != undefined){ let p = document.createElement('p'); p.innerText = report.advisory; + p.className = 'advisory'; reportEl.appendChild(p); } diff --git a/session.html b/session.html index b0e5cb0..b62064e 100644 --- a/session.html +++ b/session.html @@ -28,7 +28,7 @@ - + @@ -36,63 +36,65 @@ -

Privacy Rating


-

It looks like your browser is configured to block JavaScript. We're sorry, but this page requires JavaScript in order to function.

-

Loading quiz...

+
+

Privacy Rating


+

It looks like your browser is configured to block JavaScript. We're sorry, but this page requires JavaScript in order to function.

+

Loading quiz...

-

Unknown quiz

-

Unknown author

-
-

Your privacy grade is:

- Grade S - Grade A - Grade B - Grade C - Grade D - Grade E - Grade F +

Unknown quiz

+

Unknown author

+
+

Your privacy grade is:

+ Grade S + Grade A + Grade B + Grade C + Grade D + Grade E + Grade F -

-

Oh no, looks like you got a bad grade! Unfortunately, many popular services do not respect your privacy, and you're likely using some of them.

-

But you can increase your privacy grade. Do not be discouraged from performing good privacy practices because you can increase it drastically with little to no effort.

-

Your Privacy Report

- The good, bad and ugly -
-
- +
+

Warning This is a warning report

+

This is the report description.

+

Advisory: this is the report advisory.

+
+
+

Bad This is a bad report

+

This is the report description.

+

Advisory: this is the report advisory.

+
+
+

Critical This is a critical report

+

This is the report description.

+

Advisory: this is the report advisory.

+
--> +
+
+ +
+

Released under the GNU General Public License version 3 or later, by luca0N!

-
- -
-

Released under the GNU General Public License version 3 or later, by luca0N!

From 4cf98ca23da466e7358975db02a70aae39ac79ea Mon Sep 17 00:00:00 2001 From: luca0N! Date: Wed, 2 Jun 2021 18:28:18 -0300 Subject: [PATCH 04/10] Fixed missing "}" --- res/Stairway-js.css | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/res/Stairway-js.css b/res/Stairway-js.css index 239a3da..bdefd2b 100644 --- a/res/Stairway-js.css +++ b/res/Stairway-js.css @@ -176,7 +176,7 @@ body { } .report-warning { background-color: yellow; - +} .report-bad { color: white; background-color: orange; From d61a0fdce846bfaed3373b037dce12053c80fa36 Mon Sep 17 00:00:00 2001 From: luca0N! Date: Wed, 2 Jun 2021 19:10:25 -0300 Subject: [PATCH 05/10] Add custom grade message Remove hardcoded grade message and add support for custom grade messages. --- res/js/main.js | 19 +++++++++++++++++++ session.html | 4 ++-- 2 files changed, 21 insertions(+), 2 deletions(-) diff --git a/res/js/main.js b/res/js/main.js index 26b5bad..6e6b927 100644 --- a/res/js/main.js +++ b/res/js/main.js @@ -201,6 +201,25 @@ function setUpStrings(){ reports.appendChild(reportEl); } + // Set the grade message (if it exists. + let gme = document.getElementById('grade-message'); // Grade Message Element + + // Check if this quiz contains custom grade messages. + if (quiz.gradeMessages != undefined && quiz.gradeMessages != null){ + let gmt, gmto = quiz.gradeMessages['grade-' + grade]; + + // Check if there is a grade message for the current grade. + if (gmto !== undefined && gmto !== null){ + gmt = gmto.split('\n'); + for (let i = 0; i < gmt.length; i++){ + let line = gmt[i]; + let p = document.createElement('p'); + p.innerText = line; + gme.appendChild(p); + } + } + } + // Hide quiz and then show the results. quizEl.style['display'] = 'none'; document.getElementById('results').style['display'] = 'unset'; diff --git a/session.html b/session.html index b62064e..13768d4 100644 --- a/session.html +++ b/session.html @@ -54,8 +54,8 @@ Grade F
-

Oh no, looks like you got a bad grade! Unfortunately, many popular services do not respect your privacy, and you're likely using some of them.

-

But you can increase your privacy grade. Do not be discouraged from performing good privacy practices because you can increase it drastically with little to no effort.

+
+

Your Privacy Report

The good, bad and ugly
From 4c5567a979a026378cd46c360baeb8c6474a5143 Mon Sep 17 00:00:00 2001 From: luca0N! Date: Wed, 2 Jun 2021 19:14:41 -0300 Subject: [PATCH 06/10] Add quiz ownership disclaimer --- index.html | 3 ++- session.html | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/index.html b/index.html index 508d94a..d070503 100644 --- a/index.html +++ b/index.html @@ -64,7 +64,8 @@

Once you are ready to start, click on the button below.


-

Released under the GNU General Public License version 3 or later, by luca0N!

+

Stairway.js is released under the GNU General Public License version 3 or later, by luca0N!

+

luca0N! does not endorse all quizzes created for Stairway.js and may not own copyrights on the current quiz.

diff --git a/session.html b/session.html index 13768d4..0877b54 100644 --- a/session.html +++ b/session.html @@ -94,7 +94,8 @@ Windows
-->
-

Released under the GNU General Public License version 3 or later, by luca0N!

+

Stairway.js isreleased under the GNU General Public License version 3 or later, by luca0N!

+

luca0N! does not endorse all quizzes created for Stairway.js and may not own copyrights on the current quiz.

From 0abc865113ffd1ce16d890890a24e11d6d780144 Mon Sep 17 00:00:00 2001 From: luca0N! Date: Wed, 2 Jun 2021 19:25:57 -0300 Subject: [PATCH 07/10] Fix software license typo --- session.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/session.html b/session.html index 0877b54..bc36a28 100644 --- a/session.html +++ b/session.html @@ -94,7 +94,7 @@ Windows -->
-

Stairway.js isreleased under the GNU General Public License version 3 or later, by luca0N!

+

Stairway.js is released under the GNU General Public License version 3 or later, by luca0N!

luca0N! does not endorse all quizzes created for Stairway.js and may not own copyrights on the current quiz.

From 4379bbd6e552a9c8e4112482daed2f70f314c9a8 Mon Sep 17 00:00:00 2001 From: luca0N! Date: Wed, 2 Jun 2021 19:26:41 -0300 Subject: [PATCH 08/10] Add sample quiz JSON file --- res/js/main.js | 3 +- sample.en.json | 98 ++++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 100 insertions(+), 1 deletion(-) create mode 100644 sample.en.json diff --git a/res/js/main.js b/res/js/main.js index 6e6b927..f4c4784 100644 --- a/res/js/main.js +++ b/res/js/main.js @@ -41,7 +41,8 @@ function setUpStrings(){ let warning = document.getElementById('warning'); warning.style['display'] = 'unset'; // Get JSON file which contains all of the challenges required. - sendGetRequest('privacy-quiz.en.json', function(text){ + // FIXME: remove hardcoded quiz name. + sendGetRequest('sample.en.json', function(text){ quiz = JSON.parse(text); // Set up UI elements based on quiz metadata. diff --git a/sample.en.json b/sample.en.json new file mode 100644 index 0000000..80bb646 --- /dev/null +++ b/sample.en.json @@ -0,0 +1,98 @@ +{ + "title": "Sample Quiz", + "originalTimestamp": 1622672119, + "timestamp": -1, + + "author": "luca0N!", + "contributors": [ + "luca0N!" + ], + "publisher": "luca0N!", + + "license": "CC0", + "version": "v0.0-dev", + "revision": 1, + "format": "qrstd-1.0", + + "globalSettings": { + "section.multiple.points.max": 10, + "section.multiple.points.min": -10 + }, + + "threshold":{ + "s.min": 10, + "a.min": 8, + "b.min": 4, + "c.min": 0, + "d.min": -3, + "e.min": -14, + "f.min": -24 + }, + "gradeMessages":{ + "grade-s": "Congratulations! Your grade is Grade S.", + "grade-a": "Congratulations! Your grade is Grade A.", + "grade-b": "Congratulations! Your grade is Grade B.", + "grade-c": "Your grade is Grade C.", + "grade-d": "Your grade is Grade D.", + "grade-e": "Your grade is Grade E.", + "grade-f": "Your grade is Grade F." + }, + + "contents":[ + { + "title": "This is a question with checkboxes.", + "type": "multiple", + "choices": [ + "Choice 1 (Good)", + "Choice 2 (Warning)", + "Choice 3 (Bad)", + "Choice 4 (Critical)" + ], + "ids": [ + "choice-good", "choice-warning", "choice-bad", "choice-critical" + ] + }, + { + "title": "This is another question, but with radio buttons instead of checkboxes.", + "type": "single", + "choices": [ + "Choice 1 (Good)", + "Choice 2 (Warning)", + "Choice 3 (Bad)", + "Choice 4 (Critical)" + ], + "ids": [ + "choice-good", "choice-warning", "choice-bad", "choice-critical" + ] + } + ], + "reports":{ + "choice-good": { + "title": "You have picked a good choice", + "type": "good", + "points": 5, + "description": "This is the report description." + }, + "choice-warning": { + "title": "You have picked a choice associated with a warning report", + "type": "warning", + "points": 0, + "description": "This is the report description.\nLine breaks will split paragraphs.", + "advisory": "This is the report advisory. Advisories are optional and can be used with all report types. Advisories are recommended for all report types, except good reports." + }, + "choice-bad": { + "title": "You have picked a bad choice", + "type": "bad", + "points": -5, + "description": "This is the report description.", + "advisory": "This is the report advisory. Advisories are optional and can be used with all report types. Advisories are recommended for all report types, except good reports." + }, + "choice-critical": { + "title": "You have picked a very bad choice", + "type": "critical", + "points": -8, + "description": "This is the report description.", + "advisory": "This is the report advisory. Advisories are optional and can be used with all report types. Advisories are recommended for all report types, except good reports." + } + } +} From d3b2da856e1879fe526281a1b505c87a8f7ecaf2 Mon Sep 17 00:00:00 2001 From: luca0N! Date: Wed, 2 Jun 2021 19:30:53 -0300 Subject: [PATCH 09/10] Change titles and messages Change "Privacy Quiz" to "Stairway Quiz". --- index.html | 11 +++++------ session.html | 38 ++++---------------------------------- 2 files changed, 9 insertions(+), 40 deletions(-) diff --git a/index.html b/index.html index d070503..8256952 100644 --- a/index.html +++ b/index.html @@ -24,7 +24,7 @@ - Privacy Rating + Stairway Quiz