From d6cda0c62c38927146e5e3f44cfae8708ea32ea6 Mon Sep 17 00:00:00 2001
From: Benjamin Auder <benjamin.auder@somewhere>
Date: Sat, 27 Jan 2018 19:48:36 +0100
Subject: [PATCH] Fix buttons styling in exam page

---
 public/javascripts/assessment.js  | 11 +++++------
 public/stylesheets/assessment.css |  2 +-
 2 files changed, 6 insertions(+), 7 deletions(-)

diff --git a/public/javascripts/assessment.js b/public/javascripts/assessment.js
index 1db80a0..05b4d58 100644
--- a/public/javascripts/assessment.js
+++ b/public/javascripts/assessment.js
@@ -246,6 +246,8 @@ let V = new Vue({
 		},
 	},
 	mounted: function() {
+		if (assessment.mode == "open")
+			return; //no security needed in open mode
 		window.addEventListener("keydown", e => {
 			// If F12 or ctrl+shift (ways to access devtools)
 			if (e.keyCode == 123 || (e.ctrlKey && e.shiftKey))
@@ -266,12 +268,9 @@ let V = new Vue({
 		Object.defineProperty(div, "id", {
 			get: () => {
 				clearInterval(devtoolsLoop);
-				if (assessment.mode != "open")
-				{
-					if (this.stage == 2)
-						this.endAssessment();
-					document.location.href = "/nodevtools";
-				}
+				if (this.stage == 2)
+					this.endAssessment();
+				document.location.href = "/nodevtools";
 			}
 		});
 	},
diff --git a/public/stylesheets/assessment.css b/public/stylesheets/assessment.css
index 3187907..1511857 100644
--- a/public/stylesheets/assessment.css
+++ b/public/stylesheets/assessment.css
@@ -9,7 +9,7 @@ a#rightButton {
 	padding: 15px 0;
 }
 
-.question button {
+#assessment button {
 	display: block;
 	margin: 0 auto 15px auto;
 }
-- 
2.44.0