{"id":26614,"student_id":10,"content":"{\"html\":\"\u003c!DOCTYPE html\u003e\\n\u003chtml\u003e\\n\u003chead\u003e\\n\\t\u003ctitle\u003eDocument\u003c/title\u003e\\n \u003clink rel=\\\"stylesheet\\\" href=\\\"https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/css/bootstrap.min.css\\\"\\\"\u003e\\n \u003cscript src=\\\"https://code.jquery.com/jquery-3.2.1.min.js\\\"\u003e\u003c/script\u003e\\n \u003cscript src=\\\"https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.12.9/umd/popper.min.js\\\"\u003e\u003c/script\u003e\\n \u003cscript src=\\\"https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/js/bootstrap.min.js\\\"\u003e\u003c/script\u003e\\n \u003clink rel=\\\"stylesheet\\\" href=\\\"https://use.fontawesome.com/releases/v5.0.10/css/all.css\\\" integrity=\\\"sha384-+d0P83n9kaQMCwj8F4RJB66tzIwOKmrdb46+porD/OvrJ+37WqIM7UoBtwHO6Nlg\\\" crossorigin=\\\"anonymous\\\"\u003e\\n\u003c/head\u003e\\n\u003cbody\u003e\\n \u003cdiv class=\\\"p-5 text-white js-levels\\\"\u003e\u003c/div\u003e\\n \u003cdiv class=\\\"quiz-box p-5 text-center js-quiz\\\"\u003e\\n \u003ci class=\\\"fas fa-times js-back-to-levels\\\"\u003e\u003c/i\u003e \\n \u003csmall class=\\\"js-progess\\\"\u003e\u003c/small\u003e \\n \u003cp class=\\\"h1 p-3 js-question\\\"\u003e???\u003c/p\u003e\\n \u003cbutton class=\\\"btn btn-dark btn-block js-option-a js-option\\\"\u003e?\u003c/button\u003e\\n \u003cbutton class=\\\"btn btn-dark btn-block js-option-b js-option\\\"\u003e?\u003c/button\u003e\\n \u003cbutton class=\\\"btn btn-dark btn-block js-option-c js-option\\\"\u003e?\u003c/button\u003e\\n \u003cbutton class=\\\"btn btn-dark btn-block js-option-d js-option\\\"\u003e?\u003c/button\u003e\\n \u003cbutton class=\\\"btn btn-warning btn-block js-next-q\\\"\u003e下一題\u003c/button\u003e\\n \u003c/div\u003e\\n\u003c/body\u003e\\n\u003c/html\u003e\",\"css\":\"body {\\n background-color: #333;\\n color: #fff;\\n}\\n\\n.level-card {\\n box-shadow: 0px 0px 10px rgba(0, 0, 0, .5);\\n margin: auto;\\n transition: transform .2s;\\n cursor: pointer;\\n}\\n\\n.level-card:hover {\\n transform: scale(1.05);\\n box-shadow: 0px 0px 20px rgba(0, 0, 0, .5);\\n}\\n\\n.word-list {\\n display: none;\\n width: 100vw;\\n height: 100vh;\\n position: fixed;\\n top: 0;\\n left: 0;\\n}\\n\\n.word-list .center {\\n position: absolute;\\n top: 50%;\\n left: 50%;\\n transform: translate(-50%, -50%)\\n}\\n\\n.fa-angle-left {\\n position: absolute;\\n top: 50%;\\n left: 10%;\\n font-size: 4rem;\\n}\\n\\n.fa-angle-right {\\n position: absolute;\\n top: 50%;\\n right: 10%;\\n font-size: 4rem; \\n}\\n\\n.fa-times {\\n position: absolute;\\n top: 10%;\\n left: 10%; \\n}\\n\\n.fa-edit {\\n position: absolute;\\n top: 10%;\\n right: 10%; \\n}\\n\\n.quiz-box {\\n display: none;\\n}\",\"js\":\"var achievement = DB.table('achievement');\\nvar level;\\nvar dict = [];\\nvar idx = 0;\\nvar order = [];\\nvar answer;\\nvar answerButton;\\nvar error = 0;\\n\\nfor (var i=1; i\u003c=20; i++) {\\n var html = `\\n \u003cdiv class=\\\"rounded level-card p-3 m-2 text-center bg-dark js-levels-item\\\" level=\\\"${i}\\\"\u003e\\n \u003ch4\u003eLevel ${i}\u003c/h4\u003e\\n \u003ci class=\\\"fas fa-star\\\"\u003e\u003c/i\u003e\\n \u003ci class=\\\"fas fa-star\\\"\u003e\u003c/i\u003e\\n \u003ci class=\\\"fas fa-star\\\"\u003e\u003c/i\u003e\\n \u003ci class=\\\"fas fa-star\\\"\u003e\u003c/i\u003e\\n \u003ci class=\\\"fas fa-star\\\"\u003e\u003c/i\u003e\\n \u003c/div\u003e\\n `;\\n $('.js-levels').append(html)\\n}\\n\\n$('.js-levels-item').click(function () {\\n $('.js-levels').hide();\\n $('.js-quiz').show();\\n});\\n\\n$('.js-back-to-levels').click(function () {\\n $('.js-levels').show();\\n $('.js-quiz').hide();\\n});\\n\\n$('.js-levels-item').click(function () {\\n level = $(this).attr('level');\\n $.get(`https://orangeappletw.github.io/jsa-words/level_${level}.json`, function (data) {\\n dict = data;\\n randomQ();\\n }); \\n});\\n\\nfunction randomQ () {\\n order = [];\\n for (var i=0; i\u003cdict.length; i++) {\\n order.push(i);\\n }\\n for (var i=0; i\u003c1000; i++) {\\n var rand1 = Math.floor(Math.random()*order.length);\\n var rand2 = Math.floor(Math.random()*order.length);\\n var tmp = order[rand1];\\n order[rand1] = order[rand2];\\n order[rand2] = tmp;\\n }\\n error = 0;\\n question();\\n}\\n\\nfunction question() {\\n var a = randomWord();\\n var b = randomWord();\\n var c = randomWord();\\n var d = randomWord();\\n $('.js-option-a').text(a.zh);\\n $('.js-option-b').text(b.zh);\\n $('.js-option-c').text(c.zh);\\n $('.js-option-d').text(d.zh);\\n\\n var rand = Math.floor(Math.random()*4);\\n answerButton = $('.js-option').eq(rand);\\n \\n answer = dict[order.pop()];\\n answerButton.text(answer.zh);\\n $('.js-question').text(answer.en);\\n $('.js-option').prop('disabled', false);\\n $('.js-progess').text(`還剩下${order.length}題`);\\n}\\n\\nfunction randomWord() {\\n var rand = Math.random()*dict.length;\\n rand = Math.floor(rand);\\n return dict[rand];\\n}\\n\\n$('.js-next-q').click(function () {\\n $(this).hide();\\n question();\\n $('.js-option').removeClass('btn-success btn-danger').addClass('btn-dark');\\n});\\n\\n$('.js-option').click(function () {\\n $('.js-next-q').show();\\n if (answer.zh != $(this).text()) {\\n $(this).removeClass('btn-dark').addClass('btn-danger');\\n error++;\\n }\\n answerButton.removeClass('btn-dark').addClass('btn-success');\\n $('.js-option').prop('disabled', true);\\n\\n if (order.length == 0) {\\n alert((dict.length - error) + '/' + dict.length);\\n var rate = Math.floor((dict.length - error)*100/dict.length);\\n achievement.insert({level: level, rate: rate});\\n $('.js-back-to-levels').click();\\n updateLevel();\\n }\\n});\\n\\nfunction updateLevel () {\\n achievement.find({}, function (data) {\\n for (var i=0; i\u003cdata.length; i++) {\\n var card = $('.level-card')[data[i].level - 1];\\n var star = Math.floor(data[i].rate/20);\\n var stars = $(card).children('.fa-star');\\n for (var x=0; x\u003cstar; x++) {\\n $(stars[x]).addClass('text-warning');\\n }\\n }\\n })\\n}\\nupdateLevel();\"}","created_at":"2018-04-17T10:39:43.085+08:00","updated_at":"2019-11-09T09:56:18.547+08:00","name":"英文單字王 v2","language":"web","screenshot":{"url":"https://cdn1.koding.school/uploads/project/screenshot/26614/b8d0acec59970776d7cf3813a1698547.jpg"},"parent_id":24410,"plugin":"","description":null,"note":null,"status":"public","like_student_ids":[],"is_featured":false,"views":552,"hashid":"zpesrw55","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
到這台電腦