diff --git a/quiz.js b/quiz.js index b8e01075632f60cec5ca3f16257f7c54f0016ca9..059998330796119f7d2c783e53989c5e768d1285 100644 --- a/quiz.js +++ b/quiz.js @@ -7,12 +7,12 @@ * http://creativecommons.org/publicdomain/zero/1.0/. */ "use strict"; -const version = "$Id: quiz.js,v 1.25 2024/01/21 13:54:30 oj14ozun Exp oj14ozun $"; +const version = "$Id: quiz.js,v 1.26 2024/01/21 19:33:05 oj14ozun Exp oj14ozun $"; const js_version = document.getElementById("js-version"); js_version.innerText = version; -const gitlab_base = "https://gitlab.cs.fau.de/oj14ozun/sp-quiz"; +const gitlab_base = "https://gitlab.cs.fau.de/oj14ozun/sp-quiz"; // optionally set this to false const answers = document.getElementById("answers"); const text = document.getElementById("text"); @@ -187,10 +187,12 @@ function next() { let usp = new URLSearchParams(url.search); usp.set("show", q.id); url.search = usp.toString(); - - let title = `Problem mit der Frage: "${text.innerText}"`; - let desc = `(Erkläre das Problem hier.)\n\nSiehe <${url.toString()}>.`; - report.href = `${gitlab_base}/issues/new?issue[title]=${encodeURIComponent(title)}&issue[description]=${encodeURIComponent(desc)}`; + + if (gitlab_base) { + let title = `Problem mit der Frage: "${text.innerText}"`; + let desc = `(Erkläre das Problem hier.)\n\nSiehe <${url.toString()}>.`; + report.href = `${gitlab_base}/issues/new?issue[title]=${encodeURIComponent(title)}&issue[description]=${encodeURIComponent(desc)}`; + } // update permalink perma.href = "?" + usp.toString();