Giter VIP home page Giter VIP logo

education-website's Introduction

education-website

網址 : https://tzutzu858.tw/english_vic



幫朋友做的小網站,最先只是要讓他的學生計算一下成績,所以目前沒有什麼特別的想法,現在就慢慢做慢慢增加功能,不太確定未來要不要做成 app (因為實用性不太高還要特地下載 app 似乎有點麻煩)。


預計功能

  1. 登入後可以增加/刪除/跳上一句/跳下一句/每日一句英文(完成)
  2. 登入後更改計算成績的比例(完成)
  3. 登入後回覆及刪除英文問題的留言
  4. 修正單字翻譯功能
  5. 學生可以查到自己的所有小考成績(但這樣就要做學生登入功能,不然看別人成績看得很開心)

API

{
    "ok": true,
    "username": "aa"
}

每日英文

{
    "ok": true,
    "dailyEnglish": [
        {
            "id": 3,
            "zh": "浪費時間就是掠奪自己。",
            "en": "Wasting time is robbing oneself."
        }
    ]
}
  • 上一句下一句更換英文句子,https://tzutzu858.tw/json/api_update_daily_englich.php : 程式碼
    主要是更改紀錄英文句子 id 的那張資料表,所以先拿到紀錄英文句子那張資料表拿到 id 再做更新 ,還要拿英文句子資料表的最後一句 id ,sql 句是 SELECT * FROM table ORDER BY id DESC LIMIT 0 , 1 ,這樣就可以拿到最後一句的 id ,要拿的原因是如果更改過後的 id 比最後一句的 id 還大那就直接 die(); , 並且用 do while 做檢查 id 是否有效,用 num_rows 來做判斷 ,不是 0 才跳出迴圈,這樣就確保更改過後的 id 是有效的,此時才真正去更新紀錄英文句子 id 的那張資料表
    POST 帶上 username、unm。
    unm 是讓前端加 1 或減 1 來表示上一句或下一句
    回傳
{
    "ok": true,
    "dailyEnglishID": [
        {
            "id": 2
        }
    ]
}
{
    "ok": true,
    "dailyEnglish": [
        {
            "id": 9,
            "zh": "蘋果",
            "en": "apple"
        }
    ]
}
  • 刪除英文句子 https://tzutzu858.tw/json/api_delete_english_sentence.php : 程式碼
    使用軟刪除,所以實際是 UPDATE ,UPDATE table SET is_deleted=1 WHERE username = ? AND id =?,UPDATE is_deleted=1 後再更改紀錄 id 那張資料表,預計更新成被刪除的下一句,但要判斷下一句的 id 是否也是 is_deleted=1 , 因此也是用 do while 做檢查,一直到如果檢查已經是最後一筆的 id ,便迴圈改成檢查更新被刪除的上一句,這樣來確認 id 是否有效沒有被刪除。
    POST 帶上 username、id。
    回傳的 id 是檢查後沒有被刪除的 id
{
    "ok": true,
    "dailyEnglishID": [
        {
            "id": 3
        }
    ]
}


成績計算

{
    "ok": true,
    "calculation": [
        {
            "id": 1,
            "title": "L1~L9 Worksheets, Assignment & Tests on Google Classroom (上課講義、作業、測驗、每一課各占3%,九課共27%)",
            "percent": 27
        },
        {
            "id": 3,
            "title": "1st Midterm 第一次期中考",
            "percent": 20
        },
        {
            "id": 4,
            "title": "2nd Midterm 第二次期中考",
            "percent": 20
        },
  
  
    ]
}

卡卡日誌 :

  • 串 Google Translation API 尚未成功,因為想要用 client libraries 的方式但又不太懂,目前先用 Cambridge Dictionary 的免費搜尋框 擋著,不想用 AJAX 串 API 是因為這樣那份有放金鑰的 JavaScript 就不能擺來這了,所以先做其他部分, client libraries 再慢慢研究。

education-website's People

Contributors

tzutzu858 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.