From e73ed2eca8e7abd27586a20c5d0c30893fbac2c9 Mon Sep 17 00:00:00 2001
From: Malte Neugebauer <malte.neugebauer@hs-bochum.de>
Date: Fri, 16 Sep 2022 11:04:35 +0200
Subject: [PATCH] Added license information inside script-file, updated
 troubleshooting

---
 README.md        | 17 +++++++++++++----
 script/alquiz.js | 24 ++++++++++++++++++++++++
 2 files changed, 37 insertions(+), 4 deletions(-)

diff --git a/README.md b/README.md
index 86e816e..6c6ec96 100644
--- a/README.md
+++ b/README.md
@@ -11,10 +11,19 @@ A moodle-based training area for maths aiming to prepare students for their stud
 - Navigate to the course administration and pick the restore-option.
 - Pick the `*.mbz`-file of this repository for restoring. It contains is a moodle-course-backup-file. Perform the restore in your newly created moodle-course.
 - The course you imported contains a single activity: The training area. Check it out in the dashboard of your course.
-- Be free to edit the quiz as you like and import it into other courses of your moodle-system. 
+- Be free to edit the quiz as you like and import it into other courses of your moodle-system.
 
 ## Troubleshooting
 
-### Training Area Looks Messy
-It may appear that for security reasons, your moodle-system can't fetch the script `alquiz.js` from `https://marvin.hs-bochum.de/~mneugebauer/alquiz.js`. If so, download the script from this repository and move it to a place on your own server. Afterwards you have to change the `<script src="...">`-url in the beginning of each question.
-The same may appear for images used in the trigonometry-questions and the avatar-icon(s). Downlaod them from this repository (`img`-directory), move them to your server and change the urls in the regarding questions.
\ No newline at end of file
+### Ressources won't load
+It may appear that for security reasons, your moodle-system can't fetch the script `alquiz.js` from `https://marvin.hs-bochum.de/~mneugebauer/alquiz.js`. In this case the training area exists in your moodle-system, but will behave like any other test-element in moodle. For example, the maths-worlds-cluster and the endboss-symbols in the navigation bar (see screenshot above) won't appear. If so, download the script from this repository and move it to a place on your own server. Afterwards you have to change the `<script src="...">`-url in the beginning of each(!) question.
+The same may appear for images used in the trigonometry-questions and the avatar-icon(s). Downlaod them from this repository (`img`-directory), move them to your server and change the urls in the regarding questions.
+
+### Training area looks messy or does not work properly
+The script-file `alquiz.js` adds additional CSS-styling information to the loaded page. These stylings are optimized for the moodle-system of Hochschule Bochum. It may not fit to the stylings of your moodle-system. This may cause troubles for up to two cases:
+1. If this only relates to the desgin of the training area, you have to identify the two lines, where `alquiz.js` adds the styling information to the page and adapt them to your moodle-system. To do so, search for `document.createElement("style");` and edit the related variable declaration `.innerHTML = "..."`.
+1. If this also applies to the functionality of the training area (e. g. the question feedback is not shown in the speech bubble above the question, but below the question), you have to adapt any `querySelector`, `querySelectorAll` and `getElementById` function in `alquiz.js` to operate correctly with your moodle-system.
+
+
+## License
+See the [LICENSE](./LICENSE)-file for license rights and limitations (MIT).
\ No newline at end of file
diff --git a/script/alquiz.js b/script/alquiz.js
index a572fd6..d8fef2e 100644
--- a/script/alquiz.js
+++ b/script/alquiz.js
@@ -1,3 +1,27 @@
+/*
+MIT License
+
+Copyright (c) 2022 Malte Neugebauer, Hochschule Bochum
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all
+copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+SOFTWARE.
+*/
+
 ///START AL QUIZ SCRIPT///
 class QuestionGroup {
     constructor(id, description, Questions, nextGroup) {
-- 
GitLab