{"id":233801,"student_id":12205,"content":"{\"html\":\"\u003c!DOCTYPE html\u003e\\r\\n\u003chtml\u003e\\r\\n\u003chead\u003e\\r\\n \u003ctitle\u003eDocument\u003c/title\u003e\\r\\n \u003cscript src=\\\"https://code.jquery.com/jquery-3.3.1.min.js\\\"\u003e\u003c/script\u003e\\r\\n\u003c/head\u003e\\r\\n\u003cbody\u003e\\r\\n \u003cdiv id=\\\"bar\\\"\u003e\u003c/div\u003e\\r\\n \u003ch2 id=\\\"level\\\"\u003e Level: ? \u003c/h2\u003e\\r\\n \u003ch1 id=\\\"formula\\\"\u003e? + ? = ?\u003c/h1\u003e\\r\\n \u003cbutton id=\\\"btn-yes\\\"\u003eO\u003c/button\u003e\\r\\n \u003cbutton id=\\\"btn-no\\\"\u003eX\u003c/button\u003e\\r\\n \u003ch2 id=\\\"gameover\\\"\u003eGameOver\u003c/h2\u003e\\r\\n \u003cbutton id=\\\"btn-restart\\\"\u003erestart\u003c/button\u003e\\r\\n\u003c/body\u003e\\r\\n\u003c/html\u003e\\r\\n\\r\\n\",\"css\":\"body {\\r\\n text-align: center;\\r\\n color: #555555;\\r\\n font-family: Arial;\\r\\n}\\r\\n\\r\\nh1 {\\r\\n font-size: 4rem;\\r\\n}\\r\\n\\r\\n#gameover {\\r\\n color: #ec6d67;\\r\\n display: none;\\r\\n}\\r\\n\\r\\n#bar {\\r\\n width: 100%;\\r\\n height: 10px;\\r\\n background-color: #f1c40f;\\r\\n margin-bottom: 60px;\\r\\n}\\r\\n\\r\\nbutton {\\r\\n padding: .5rem 1.5rem;\\r\\n font-size: 2rem;\\r\\n font-weight: bold;\\r\\n outline: none;\\r\\n cursor: pointer;\\r\\n}\\r\\n\\r\\n#btn-yes {\\r\\n color: #2cbeff;\\r\\n border: 3px solid #2cbeff;\\r\\n}\\r\\n\\r\\n#btn-yes:hover {\\r\\n color: #fff;\\r\\n background-color: #2cbeff;\\r\\n}\\r\\n\\r\\n#btn-no {\\r\\n color: #ec6d67;\\r\\n border: 3px solid #ec6d67;\\r\\n}\\r\\n\\r\\n#btn-no:hover {\\r\\n color: #fff;\\r\\n background-color: #ec6d67;\\r\\n}\\r\\n\\r\\n#btn-restart {\\r\\n color: #000000;\\r\\n border: 3px solid #000000;\\r\\n}\\r\\n\\r\\n#btn-restart:hover {\\r\\n color: #fff;\\r\\n background-color: #000000;\\r\\n}\\r\\n\\r\\n\",\"js\":\"var level = 0;\\nvar correct = true;\\nvar timer = 0;\\n\\nstart();\\nfunction start() {\\n $('#btn-restart').hide();\\n level++;\\n $(\\\"#level\\\").text(\\\"level:\\\"+level);\\n var a = Math.floor(Math.random()*10);\\n var b = Math.floor(Math.random()*10);\\n var answer = a+b;\\n correct = Math.random() \u003e 0.5;\\n if (correct == false) {\\n answer += Math.ceil(Math.random()*5)\\n }\\n\\n\\n $(\\\"#formula\\\").text(a+\\\"+\\\"+b+\\\"=\\\"+ answer);\\n timer = 0;\\n}\\n\\nfunction gameOver() {\\n $(\\\"button\\\").hide();\\n $(\\\"#gameover\\\").show();\\n clearInterval(id);\\n $('#btn-restart').show();\\n $(\\\"#btn-restart\\\").click(function() {\\n var level = 0;\\n var correct = true;\\n var timer = 0;\\n $(\\\"button\\\").show();\\n $(\\\"#gameover\\\").hide();\\n start();\\n function start() {\\n $('#btn-restart').hide();\\n level++;\\n $(\\\"#level\\\").text(\\\"level:\\\"+level);\\n var a = Math.floor(Math.random()*10);\\n var b = Math.floor(Math.random()*10);\\n var answer = a+b;\\n correct = Math.random() \u003e 0.5;\\n if (correct == false) {\\n answer += Math.ceil(Math.random()*5)\\n }\\n\\n\\n $(\\\"#formula\\\").text(a+\\\"+\\\"+b+\\\"=\\\"+ answer);\\n timer = 0;\\n }\\n\\n function gameOver() {\\n $(\\\"button\\\").hide();\\n $(\\\"#gameover\\\").show();\\n clearInterval(id);\\n $('#btn-restart').show();\\n $(\\\"#btn-restart\\\").click(function() {})\\n }\\n\\n $(\\\"#btn-yes\\\").click(function() {\\n if (correct == true) {\\n start();\\n } else {\\n gameOver();\\n }\\n })\\n $(\\\"#btn-no\\\").click(function() {\\n if (correct == false) {\\n start();\\n } else {\\n gameOver();\\n }\\n })\\n var id = setInterval(function() {\\n timer += 0.1;\\n //console.log(timer);\\n $(\\\"#bar\\\").css(\\\"width\\\", timer + \\\"%\\\");\\n if (timer \u003e 100) {\\n gameOver();\\n }\\n })\\n })\\n}\\n\\n$(\\\"#btn-yes\\\").click(function() {\\n if (correct == true) {\\n start();\\n } else {\\n gameOver();\\n }\\n})\\n$(\\\"#btn-no\\\").click(function() {\\n if (correct == false) {\\n start();\\n } else {\\n gameOver();\\n }\\n})\\nvar id = setInterval(function() {\\n timer += 0.1;\\n //console.log(timer);\\n $(\\\"#bar\\\").css(\\\"width\\\", timer + \\\"%\\\");\\n if (timer \u003e 100) {\\n gameOver();\\n }\\n})\"}","created_at":"2021-03-10T20:16:13.802+08:00","updated_at":"2021-03-17T20:14:20.622+08:00","name":"算數炸彈 副本","language":"web","screenshot":{"url":"https://cdn8.koding.school/uploads/project/screenshot/233801/2279cad636e66d4df4d627bca9eb2991.jpg"},"parent_id":87375,"plugin":"","description":null,"note":null,"status":"public","like_student_ids":[],"is_featured":false,"views":47,"hashid":"2pds9pvym","is_content_changed":false,"review_status":"unsubmitted","submitted_at":null,"reviewed_at":null,"advise":null,"is_deleted":false}
[{"id":4219907,"file_name":"koding.png","project_id":233801,"asset_id":107444,"created_at":"2021-03-10T20:16:13.807+08:00","updated_at":"2021-03-10T20:16:13.807+08:00"}]
橘蘋學習平台
橘蘋學習平台
我的作品
檢視專案頁
匯出
複製
匯入
刪除
下載 Android APP (APK)
截圖
前往網站頁面
1:1:1
1:1
full
用手機掃描下方 QRCode 進行安裝
或您也可以
下載 APK
到這台電腦
用手機掃描下方 QRCode 進行安裝
或您也可以
下載 APK
到這台電腦