{"id":93541,"student_id":10,"content":"{\"html\":\"\u003c!DOCTYPE html\u003e\\n\u003chtml\u003e\\n\u003chead\u003e\\n\\t\u003ctitle\u003eDocument\u003c/title\u003e\\n\\t\u003cscript src=\\\"https://code.jquery.com/jquery-3.4.1.min.js\\\"\u003e\u003c/script\u003e\\n\u003c/head\u003e\\n\u003cbody\u003e\\n \\n \u003cdiv id=\\\"buttons\\\"\u003e\\n \u003cbutton id=\\\"a\\\"\u003e\u003c/button\u003e\\n \u003cbutton id=\\\"b\\\"\u003e\u003c/button\u003e\\n \u003cbutton id=\\\"c\\\"\u003e\u003c/button\u003e\\n \u003cbutton id=\\\"d\\\"\u003e\u003c/button\u003e\\n \u003c/div\u003e\\n \\n \u003cbutton id=\\\"start\\\"\u003estart\u003c/button\u003e\\n \\n \u003cul\u003e\u003c/ul\u003e\\n\u003c/body\u003e\\n\u003c/html\u003e\",\"css\":\"#bar {\\n position: fixed;\\n top: 0;\\n left: 0;\\n height: 20px;\\n background-color: orange;\\n}\\n\\nbutton {\\n font-size: 3rem;\\n}\",\"js\":\"var record = DB.table('record');\\nvar colors = ['red', 'green', 'blue', 'orange', 'purple', 'yellow', 'black'];\\nvar answer;\\nvar level = 1;\\nvar id;\\n\\n$('#start').click(start);\\n$('#a, #b, #c, #d').click(check);\\n\\n\\nfunction start () {\\n $('#start').hide();\\n next();\\n id = setTimeout(gameover, 30000);\\n}\\n\\nfunction next () {\\n wrongAnswer('#a');\\n wrongAnswer('#b');\\n wrongAnswer('#c');\\n wrongAnswer('#d');\\n\\n var rand = Math.floor(Math.random()*4);\\n answer = ['a', 'b', 'c', 'd'][rand];\\n var color = $('#' + answer).text();\\n $('#' + answer).css('color', color);\\n\\n level++;\\n}\\n\\nfunction wrongAnswer (buttonId) {\\n var rand1 = Math.floor(Math.random()*7);\\n var rand2 = Math.ceil(Math.random()*6) + rand1;\\n var text = colors[rand1];\\n var color = colors[rand2%7];\\n $(buttonId).text(text);\\n $(buttonId).css('color', color);\\n}\\n\\nfunction check () {\\n var id = $(this).attr('id');\\n if (id == answer) {\\n next();\\n } else {\\n gameover();\\n }\\n}\\n\\nfunction gameover () {\\n $('button').attr('disabled', true);\\n record.create({ level: level, name: USER_NAME });\\n record.find({}, function (data) {\\n for (var i=0; i\u003cdata.length; i++) {\\n var d = data[i];\\n $('ul').append(`\u003cli\u003e${d.name} - ${d.level}\u003c/li\u003e`);\\n } \\n });\\n clearTimeout(id);\\n}\\n\"}","created_at":"2019-09-04T10:44:11.862+08:00","updated_at":"2020-11-16T14:25:54.701+08:00","name":"顏色單字大考驗","language":"web","screenshot":{"url":"https://cdn4.koding.school/uploads/project/screenshot/93541/afc4ec8c8fde6111dc250f3aa4484a0d.jpg"},"parent_id":3,"plugin":"","description":null,"note":null,"status":"public","like_student_ids":[],"is_featured":false,"views":278,"hashid":"36ys3ddr","is_content_changed":false,"review_status":"unsubmitted","submitted_at":null,"reviewed_at":null,"advise":null,"is_deleted":false}
[]
橘蘋學習平台
橘蘋學習平台
我的作品
檢視專案頁
匯出
複製
匯入
刪除
下載 Android APP (APK)
截圖
前往網站頁面
1:1:1
1:1
full
用手機掃描下方 QRCode 進行安裝
或您也可以
下載 APK
到這台電腦
用手機掃描下方 QRCode 進行安裝
或您也可以
下載 APK
到這台電腦