diff --git a/html/test_13.02.20/test_13.02.20_V2/IT2, 2-timarsprøve_ Påskerenn 13 februar 2020.pdf b/html/test_13.02.20/test_13.02.20_V2/IT2, 2-timarsprøve_ Påskerenn 13 februar 2020.pdf new file mode 100644 index 0000000..3d0e337 Binary files /dev/null and b/html/test_13.02.20/test_13.02.20_V2/IT2, 2-timarsprøve_ Påskerenn 13 februar 2020.pdf differ diff --git a/html/test_13.02.20/test_13.02.20_V2/index.html b/html/test_13.02.20/test_13.02.20_V2/index.html new file mode 100644 index 0000000..040759f --- /dev/null +++ b/html/test_13.02.20/test_13.02.20_V2/index.html @@ -0,0 +1,21 @@ + + + + + + + Test + + + + + + +

Test

+ +
+
+
+ + + \ No newline at end of file diff --git a/html/test_13.02.20/test_13.02.20_V2/oppgaver/.keep b/html/test_13.02.20/test_13.02.20_V2/oppgaver/.keep new file mode 100644 index 0000000..e69de29 diff --git a/html/test_13.02.20/test_13.02.20_V2/oppgaver/oppgave1/images/easter-154509.svg b/html/test_13.02.20/test_13.02.20_V2/oppgaver/oppgave1/images/easter-154509.svg new file mode 100644 index 0000000..03ce8b2 --- /dev/null +++ b/html/test_13.02.20/test_13.02.20_V2/oppgaver/oppgave1/images/easter-154509.svg @@ -0,0 +1,1866 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/html/test_13.02.20/test_13.02.20_V2/oppgaver/oppgave1/oppgave.html b/html/test_13.02.20/test_13.02.20_V2/oppgaver/oppgave1/oppgave.html new file mode 100644 index 0000000..61ca0cc --- /dev/null +++ b/html/test_13.02.20/test_13.02.20_V2/oppgaver/oppgave1/oppgave.html @@ -0,0 +1,68 @@ + + + + + + + Oppgave 1 + + + + + +

Påskerennet 2020 - Olastøl, Hardanger

+ +
+ +
+ +
+ +

Legg til deltaker

+ +
+
+ + + + + +
+
+ +
+
+ + + + + + + + + +
+
+
+ +
+ + + + + + + + + +
NavnAlderResultat 1Resultat 2Resultat 3Resultatsum
+
+ +
+ +


+
+
+ + + \ No newline at end of file diff --git a/html/test_13.02.20/test_13.02.20_V2/oppgaver/oppgave1/oppgave.js b/html/test_13.02.20/test_13.02.20_V2/oppgaver/oppgave1/oppgave.js new file mode 100644 index 0000000..04d2259 --- /dev/null +++ b/html/test_13.02.20/test_13.02.20_V2/oppgaver/oppgave1/oppgave.js @@ -0,0 +1,167 @@ + +/* Hardcoded participant list */ +let participants = [ + { + name: "Harald", + age: "33", + results: [undefined, undefined, undefined], + resultSum: 0 + }, { + name: "Borghild", + age: "25", + results: [undefined, undefined, undefined], + resultSum: 0 + }, { + name: "Ola", + age: "12", + results: [undefined, undefined, undefined], + resultSum: 0 + }, { + name: "Knut", + age: "62", + results: [undefined, undefined, undefined], + resultSum: 0 + }, { + name: "Lise", + age: "46", + results: [undefined, undefined, undefined], + resultSum: 0 + } +] + +/* Add HTML DOM reference variables */ +const graphicsBox = document.getElementById("graphics"); + +const addParticipantForm = document.getElementById("addParticipantForm"); +const nameRegistrationInput = document.getElementById("nameRegistration"); +const ageRegistrationInput = document.getElementById("ageRegistration"); +const addParticipantButton = document.getElementById("addParticipant"); + +const updateResultsForm = document.getElementById("updateResultsForm"); +const nameSelector = document.getElementById("nameSelector"); +const activity1Input = document.getElementById("activity1"); +const activity2Input = document.getElementById("activity2"); +const activity3Input = document.getElementById("activity3"); +const updateResultsButton = document.getElementById("updateResults"); + +const participantTable = document.getElementById("participants"); +const participantTableHeaders = participantTable.innerHTML; + +const printResultsButton = document.getElementById("printResultsButton"); +const resultTable = document.getElementById("results"); + +/* Add event listeners */ +addParticipantForm.addEventListener("submit", addParticipant, false); +updateResultsForm.addEventListener("submit", updateResults, false); +printResultsButton.addEventListener("click", printResults, false); +nameSelector.addEventListener("change", updateSelector, false); + + +/* Init HTML */ +updateParticipants(); + +/* Oppdaterer HTML og selector med ny deltakerliste og score */ +function updateParticipants() { + + /* Reset inner HTML data */ + participantTable.innerHTML = participantTableHeaders; + nameSelector.innerHTML = ""; + + for (participant in participants) { + + + /* Update HTML table from participant array */ + let newTable = + `` + + `${participants[participant].name}` + + `${participants[participant].age}`; + + for (result in participants[participant].results) { + if (participants[participant].results[result] != undefined) { + newTable += `${participants[participant].results[result]}`; + } + } + + /* Add sum to object and add to table if all 3 results exist */ + if (!participants[participant].results.includes(undefined)) { + participants[participant].sum = participants[participant].results.reduce((a, b) => parseInt(a) + parseInt(b), 0); + newTable += `${participants[participant].sum}`; + } + + newTable += ``; + participantTable.innerHTML += newTable; + + /* Update selector */ + nameSelector.innerHTML += `` + + } + updateSelector(); +} + +/* Legger til deltaker og kjører updateParticipants */ +function addParticipant(evt) { + evt.preventDefault(); + + participants = [...participants, { + name: nameRegistrationInput.value, + age: ageRegistrationInput.value, + results: [undefined, undefined, undefined], + resultSum: 0 + }] + + updateParticipants(); + +} + +/* Redigerer poenglisten til den gjeldende deltakeren og kjører updateParticipants */ +function updateResults(evt) { + evt.preventDefault(); + + const participantNum = nameSelector.value; + participants[participantNum].results[0] = activity1Input.value; + participants[participantNum].results[1] = activity2Input.value; + participants[participantNum].results[2] = activity3Input.value; + + updateParticipants(); + +} + +/* Oppdaterer poengvelgerne etter valgt deltaker */ +function updateSelector() { + const participant = participants[nameSelector.value]; + activity1Input.value = (participant.results[0] == undefined) ? "" : participant.results[0]; //Cant set number to undefined -> Set "" + activity2Input.value = (participant.results[1] == undefined) ? "" : participant.results[1]; + activity3Input.value = (participant.results[2] == undefined) ? "" : participant.results[2]; +} + +/* Printer ut resultater */ +function printResults() { + + /* Remove participants without full score */ + let resultParticipants = participants.filter((participant) => participant.sum > 0); + + /* Sort participants by result */ + resultParticipants.sort((a, b) => b.sum-a.sum); + + /* Add to HTML result table*/ + resultTable.innerHTML = "" + + "Plassering" + + "Navn" + + "Aktivitet 1" + + "Aktivitet 2" + + "Aktivitet 3" + + "Total Poengsum" + + "" + + for (participant in resultParticipants) { + resultTable.innerHTML += `` + + `${parseInt(participant) + 1}` + + `${resultParticipants[participant].name}` + + `${resultParticipants[participant].results[0]}` + + `${resultParticipants[participant].results[1]}` + + `${resultParticipants[participant].results[2]}` + + `${resultParticipants[participant].sum}` + + ``; + } + +} \ No newline at end of file diff --git a/html/test_13.02.20/test_13.02.20_V2/resources/css/.keep b/html/test_13.02.20/test_13.02.20_V2/resources/css/.keep new file mode 100644 index 0000000..e69de29 diff --git a/html/test_13.02.20/test_13.02.20_V2/resources/css/main.css b/html/test_13.02.20/test_13.02.20_V2/resources/css/main.css new file mode 100644 index 0000000..5e3a25d --- /dev/null +++ b/html/test_13.02.20/test_13.02.20_V2/resources/css/main.css @@ -0,0 +1,131 @@ +body { + background-color: #282828; + color: white; + margin: 0px; + padding: 0px; + margin-right: 2%; + margin-left: 8%; + margin-top: 5%; + font-family: museo-sans-rounded, sans-serif; + font-weight: 300; + font-style: normal; +} + +button { + background-color: #787878; + padding: 15px; + display: inline-block; + border: 2px solid white; + border-radius: 15px; + color: white; + font-size: 16pt; +} +button:hover { + background-color: #505050; +} +button:focus { + outline: 0; +} + +h1 { + color: #2883d0; + text-align: center; + background-color: #3c3c3c; + padding: 15px; + margin-left: 10%; + margin-right: 10%; + border-radius: 15px; +} + +h2 { + color: #91e22c; +} + +a { + color: #66D9EF; +} +a:hover { + color: #A6E22E; +} + +input[type=color] { + width: 4em; + height: 2em; + background-color: #787878; +} + +table { + width: 100%; +} + +td, th { + border: 1px solid white; + padding: 8px; +} + +th { + text-align: left; + background-color: #4CAF50; +} + +tr:nth-child(even) { + background-color: #00000033; +} +tr:hover { + background-color: rgba(255, 255, 255, 0.281); +} + +.center { + background-color: #505050; + margin: auto; + margin-bottom: 10%; + width: 70%; + padding: 5%; + height: max-content; + border-radius: 15px; +} +.center * { + margin: auto; +} + +.inline { + margin: 15px; +} +.inline * { + display: inline-block; +} + +.leftalign * { + margin: 15px; + text-align: left; +} + +.textboxGrid { + display: grid; + justify-content: space-evenly; + align-content: space-evenly; + grid-template-columns: repeat(3, 1fr); + grid-column-gap: auto; + grid-row-gap: 20px; +} +.textboxGrid * { + size: 100%; + padding: 40px 80px; + background-color: #787878; +} +.textboxGrid .linkElement { + border: 1px solid black; +} +.textboxGrid .linkElement:hover { + background-color: #505050; + cursor: pointer; +} +.textboxGrid .linkElement a:hover { + text-decoration: underline; + color: #66D9EF; +} +.textboxGrid .linkElement * { + margin: 0px; + padding: 0px; + background-color: transparent; +} diff --git a/html/test_13.02.20/test_13.02.20_V2/resources/js/linkConnector.js b/html/test_13.02.20/test_13.02.20_V2/resources/js/linkConnector.js new file mode 100644 index 0000000..5e37d04 --- /dev/null +++ b/html/test_13.02.20/test_13.02.20_V2/resources/js/linkConnector.js @@ -0,0 +1,28 @@ +const taskArray = tasks.tasks; +const grid = document.getElementsByClassName("textboxGrid")[0]; + +for (i=0; i