Differences
This shows you the differences between two versions of the page.
| Both sides previous revision Previous revision Next revision | Previous revision | ||
| students:value-calculator-chinese-quiz [2024/01/26 00:13] – steve.wang | students:value-calculator-chinese-quiz [2024/01/27 01:44] (current) – steve.wang | ||
|---|---|---|---|
| Line 1: | Line 1: | ||
| ====== 人價值計算機 ====== | ====== 人價值計算機 ====== | ||
| - | |||
| < | < | ||
| <meta charset=" | <meta charset=" | ||
| Line 9: | Line 8: | ||
| /* Changed background color from black to grey, change font color to light grey, change font from default to this.*/ | /* Changed background color from black to grey, change font color to light grey, change font from default to this.*/ | ||
| html, body { | html, body { | ||
| + | | ||
| width: 94%; | width: 94%; | ||
| height: 90%; | height: 90%; | ||
| /* overflow: auto;*/ | /* overflow: auto;*/ | ||
| background-color: | background-color: | ||
| - | color: | + | color: |
| | | ||
| transition: opacity 0.2s; | transition: opacity 0.2s; | ||
| Line 22: | Line 22: | ||
| # | # | ||
| background-color: | background-color: | ||
| - | color: | + | color: |
| } | } | ||
| #tBox{ | #tBox{ | ||
| width: 99.5%; | width: 99.5%; | ||
| + | height: 30%; | ||
| font-size: 600%; | font-size: 600%; | ||
| - | color: | + | color: |
| background-color: | background-color: | ||
| border-style: | border-style: | ||
| Line 48: | Line 49: | ||
| width: 18%; | width: 18%; | ||
| padding: | padding: | ||
| - | color: | + | color: |
| font-size: | font-size: | ||
| border-style: | border-style: | ||
| Line 207: | Line 208: | ||
| <div class=" | <div class=" | ||
| <div class=" | <div class=" | ||
| - | <div class=" | + | <div class=" |
| <div class=" | <div class=" | ||
| <div class=" | <div class=" | ||
| - | <div class=" | + | <div class=" |
| <div class=" | <div class=" | ||
| <div class=" | <div class=" | ||
| - | <div class=" | + | <div class=" |
| - | <div class=" | + | <div class=" |
| - | <div id=' | + | <div id=' |
| - | <div class=" | + | <div class=" |
| </ | </ | ||
| <!-- Number pad from w3 schools : https:// | <!-- Number pad from w3 schools : https:// | ||
| <!-- https:// | <!-- https:// | ||
| < | < | ||
| - | | + | |
| // -- value-calculator.js | // -- value-calculator.js | ||
| // -------------------------------------------------------------------------- | // -------------------------------------------------------------------------- | ||
| - | // Code made using Github Copilot and Google Bard | + | // Code made using Github Copilot and Google Bard |
| // Translation helped by Google Translate | // Translation helped by Google Translate | ||
| Line 232: | Line 233: | ||
| let referrerFrom = " | let referrerFrom = " | ||
| let referrerTo = " | let referrerTo = " | ||
| - | |||
| - | |||
| // let resultsPageLink = ' | // let resultsPageLink = ' | ||
| let resultsPageLink = ' | let resultsPageLink = ' | ||
| Line 368: | Line 367: | ||
| return currentQ.join(' | return currentQ.join(' | ||
| } | } | ||
| - | | + | |
| function changeInstructions(type){ | function changeInstructions(type){ | ||
| if (language === ' | if (language === ' | ||
| Line 748: | Line 747: | ||
| // //Each answer is based on 0 to 5 except P is 0 - 5, | // //Each answer is based on 0 to 5 except P is 0 - 5, | ||
| - | //A function that creates a ruler like thing that shows the value of the person. | + | //A function that creates a ruler like thing that shows the value of the person. |
| function showResults () { | function showResults () { | ||
| let results = document.getElementById(' | let results = document.getElementById(' | ||
| Line 1004: | Line 1003: | ||
| } | } | ||
| //Idea for using & character for passing information inspired by bardAI | //Idea for using & character for passing information inspired by bardAI | ||
| - | |||
| function createLinkWithData (link){ | function createLinkWithData (link){ | ||
| let outputLink = link | let outputLink = link | ||
| answers.forEach(x => { | answers.forEach(x => { | ||
| - | outputLink += '&' | + | outputLink += '&' |
| }) | }) | ||
| // | // | ||
| return outputLink | return outputLink | ||
| } | } | ||
| + | |||
| function configureStylingForDokuWiki (){ | function configureStylingForDokuWiki (){ | ||
| Line 1031: | Line 1030: | ||
| }, 50) | }, 50) | ||
| } | } | ||
| - | |||
| function checkReferrer (){ | function checkReferrer (){ | ||
| if (document.referrer !== referrerFrom){ | if (document.referrer !== referrerFrom){ | ||
| Line 1044: | Line 1042: | ||
| } | } | ||
| } | } | ||
| - | |||
| window.addEventListener(' | window.addEventListener(' | ||
| if (mode === ' | if (mode === ' | ||
| - | configureStylingForDokuWiki() | + | let copy = document.getElementsByClassName(' |
| + | let navbar = document.getElementsByClassName(" | ||
| + | let newBody = document.createElement(' | ||
| + | newBody.appendChild(copy) | ||
| + | newBody.appendChild(navbar) | ||
| + | document.body.remove() | ||
| + | document.documentElement.appendChild(newBody) | ||
| + | copy.style.top = ' | ||
| + | document.documentElement.style.boxSizing = ' | ||
| + | document.body.style.marginTop = ' | ||
| + | // configureStylingForDokuWiki() | ||
| checkReferrer() | checkReferrer() | ||
| } | } | ||
| Line 1054: | Line 1061: | ||
| | | ||
| }) | }) | ||
| - | value_calculator.style.color = ' | + | |
| + | document.getElementById(' | ||
| question.style.color = ' | question.style.color = ' | ||
| instructions.style.color = ' | instructions.style.color = ' | ||
| - | |||
| </ | </ | ||
| <br> | <br> | ||
| Line 1064: | Line 1071: | ||
| </ | </ | ||
| </ | </ | ||
| - | |||