From 976dc6363cdcc672700cebbe429fcae0554783c6 Mon Sep 17 00:00:00 2001 From: "Chen, Tai-Lin" Date: Tue, 23 Jul 2024 10:29:50 +0800 Subject: [PATCH 01/12] fix: wrong answer in answer.sh --- quests/copy/answer.sh | 2 +- quests/move/answer.sh | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/quests/copy/answer.sh b/quests/copy/answer.sh index c8835c7..bef48aa 100644 --- a/quests/copy/answer.sh +++ b/quests/copy/answer.sh @@ -2,7 +2,7 @@ echo start ls cat hello.txt cat world.txt -echo continue +echo next cp hello.txt hello2.txt cat hello2.txt cp world.txt world2.txt diff --git a/quests/move/answer.sh b/quests/move/answer.sh index c55e8f2..a24458b 100644 --- a/quests/move/answer.sh +++ b/quests/move/answer.sh @@ -1,9 +1,9 @@ echo start -echo continue +echo next mv hello.txt notes ls ls notes -echo continue +echo next mv world.txt wow.txt ls mv notes docs From 6daa11bff741e1c0289a91ae8661a30359e17fc5 Mon Sep 17 00:00:00 2001 From: "Chen, Tai-Lin" Date: Tue, 23 Jul 2024 11:20:56 +0800 Subject: [PATCH 02/12] fix: start buttom languege issue --- quests/cast/game.yml | 4 ++-- quests/copy/game.yml | 4 ++-- quests/create/game.yml | 4 ++-- quests/explore/game.yml | 4 ++-- quests/get-started/game.yml | 4 ++-- quests/move/game.yml | 4 ++-- quests/path/game.yml | 4 ++-- quests/read/game.yml | 4 ++-- quests/remove/game.yml | 4 ++-- 9 files changed, 18 insertions(+), 18 deletions(-) diff --git a/quests/cast/game.yml b/quests/cast/game.yml index ce1c1e7..c181726 100644 --- a/quests/cast/game.yml +++ b/quests/cast/game.yml @@ -3,14 +3,14 @@ instruction: | 在這個關卡中,你將會學到: 1. 如何使用 `echo` 指令 - 按下中間的 `start` 按鈕來開始這個關卡。 + 按下中間的 `開始` 按鈕來開始這個關卡。 requirements: - get-started stages: - id: start - task: 按下 `start` 按鈕開始 + task: 按下 `開始` 按鈕開始 condition: command: - ^echo start$ diff --git a/quests/copy/game.yml b/quests/copy/game.yml index 3dad1bc..e2baf35 100644 --- a/quests/copy/game.yml +++ b/quests/copy/game.yml @@ -3,14 +3,14 @@ instruction: | 在這個關卡中,你將會學到: 1. 如何用 `cp` 指令複製檔案 - 按下中間的 `start` 按鈕來開始這個關卡。 + 按下中間的 `開始` 按鈕來開始這個關卡。 requirements: - create stages: - id: start - task: 按下 `start` 按鈕開始 + task: 按下 `開始` 按鈕開始 condition: command: - ^echo start$ diff --git a/quests/create/game.yml b/quests/create/game.yml index defd4f2..664d806 100644 --- a/quests/create/game.yml +++ b/quests/create/game.yml @@ -4,14 +4,14 @@ instruction: | 1. 如何使用 `touch` 建立檔案 2. 如何使用 `mkdir` 建立資料夾 - 按下中間的 `start` 按鈕來開始這個關卡。 + 按下中間的 `開始` 按鈕來開始這個關卡。 requirements: - read stages: - id: start - task: 按下 `start` 按鈕開始 + task: 按下 `開始` 按鈕開始 condition: command: - ^echo start$ diff --git a/quests/explore/game.yml b/quests/explore/game.yml index d02c7e0..c48cd89 100644 --- a/quests/explore/game.yml +++ b/quests/explore/game.yml @@ -4,14 +4,14 @@ instruction: | 1. 如何使用 `ls` 查看資料夾的內容 2. 如何使用 `cd` 在資料夾之間移動 - 按下中間的 `start` 按鈕來開始這個關卡。 + 按下中間的 `開始` 按鈕來開始這個關卡。 requirements: - get-started stages: - id: start - task: 按下 `start` 按鈕開始教程 + task: 按下 `開始` 按鈕開始教程 condition: command: - ^echo start$ diff --git a/quests/get-started/game.yml b/quests/get-started/game.yml index 399861a..054cb57 100644 --- a/quests/get-started/game.yml +++ b/quests/get-started/game.yml @@ -5,11 +5,11 @@ instruction: | 1. 如何使用這個網站 2. 如何使用終端機 - 按下中間的 `start` 按鈕來開始這個關卡。 + 按下中間的 `開始` 按鈕來開始這個關卡。 stages: - id: start - task: 按下 `start` 按鈕開始 + task: 按下 `開始` 按鈕開始 condition: command: - ^echo start$ diff --git a/quests/move/game.yml b/quests/move/game.yml index da2234a..6b07f3d 100644 --- a/quests/move/game.yml +++ b/quests/move/game.yml @@ -3,14 +3,14 @@ instruction: | 在這個關卡中,你將會學到: 1. 如何用 `mv` 移動檔案與資料夾 - 按下中間的 `start` 按鈕來開始這個關卡。 + 按下中間的 `開始` 按鈕來開始這個關卡。 requirements: - create stages: - id: start - task: 按下 `start` 按鈕開始 + task: 按下 `開始` 按鈕開始 condition: command: - ^echo start$ diff --git a/quests/path/game.yml b/quests/path/game.yml index 98c69cd..90ac9cb 100644 --- a/quests/path/game.yml +++ b/quests/path/game.yml @@ -4,7 +4,7 @@ instruction: | 1. 絕對路徑和相對路徑 2. 如何使用 `pwd` 顯示目前的路徑 - 按下中間的 `start` 按鈕來開始這個關卡。 + 按下中間的 `開始` 按鈕來開始這個關卡。 requirements: - cast @@ -12,7 +12,7 @@ requirements: stages: - id: start - task: 按下 `start` 按鈕開始教程 + task: 按下 `開始` 按鈕開始教程 condition: command: - ^echo start$ diff --git a/quests/read/game.yml b/quests/read/game.yml index d1b92c3..59e7e97 100644 --- a/quests/read/game.yml +++ b/quests/read/game.yml @@ -3,14 +3,14 @@ instruction: | 在這個關卡中,你將會學到: 1. 如何使用 `cat` 查看檔案的內容 - 按下中間的 `start` 按鈕來開始這個關卡。 + 按下中間的 `開始` 按鈕來開始這個關卡。 requirements: - path stages: - id: start - task: 按下 `start` 按鈕開始教程 + task: 按下 `開始` 按鈕開始教程 condition: command: - ^echo start$ diff --git a/quests/remove/game.yml b/quests/remove/game.yml index 89d179a..fac862b 100644 --- a/quests/remove/game.yml +++ b/quests/remove/game.yml @@ -6,7 +6,7 @@ instruction: | 3. 用 `rm -r` 刪除資料夾與它的所有檔案 現在資料夾裡有一些檔案與資料夾,請你使用 `ls` 跟 `cat` 來查看它們的內容。 - 按下中間的 `start` 按鈕來開始這個關卡。 + 按下中間的 `開始` 按鈕來開始這個關卡。 requirements: - copy @@ -14,7 +14,7 @@ requirements: stages: - id: start - task: 按下 `start` 按鈕開始 + task: 按下 `開始` 按鈕開始 condition: command: - ^echo start$ From 8180e9a0cf5225142699299bb341e8b68f592aa3 Mon Sep 17 00:00:00 2001 From: "Chen, Tai-Lin" Date: Tue, 23 Jul 2024 12:15:03 +0800 Subject: [PATCH 03/12] delete unused text --- quests/cast/game.yml | 2 -- quests/copy/game.yml | 2 -- quests/create/game.yml | 2 -- quests/explore/game.yml | 2 -- quests/get-started/game.yml | 2 -- quests/move/game.yml | 2 -- quests/path/game.yml | 2 -- quests/read/game.yml | 2 -- quests/remove/game.yml | 2 -- 9 files changed, 18 deletions(-) diff --git a/quests/cast/game.yml b/quests/cast/game.yml index c181726..1cda880 100644 --- a/quests/cast/game.yml +++ b/quests/cast/game.yml @@ -3,8 +3,6 @@ instruction: | 在這個關卡中,你將會學到: 1. 如何使用 `echo` 指令 - 按下中間的 `開始` 按鈕來開始這個關卡。 - requirements: - get-started diff --git a/quests/copy/game.yml b/quests/copy/game.yml index e2baf35..8d291a2 100644 --- a/quests/copy/game.yml +++ b/quests/copy/game.yml @@ -3,8 +3,6 @@ instruction: | 在這個關卡中,你將會學到: 1. 如何用 `cp` 指令複製檔案 - 按下中間的 `開始` 按鈕來開始這個關卡。 - requirements: - create diff --git a/quests/create/game.yml b/quests/create/game.yml index 664d806..6f6c93e 100644 --- a/quests/create/game.yml +++ b/quests/create/game.yml @@ -4,8 +4,6 @@ instruction: | 1. 如何使用 `touch` 建立檔案 2. 如何使用 `mkdir` 建立資料夾 - 按下中間的 `開始` 按鈕來開始這個關卡。 - requirements: - read diff --git a/quests/explore/game.yml b/quests/explore/game.yml index c48cd89..c8b92a0 100644 --- a/quests/explore/game.yml +++ b/quests/explore/game.yml @@ -4,8 +4,6 @@ instruction: | 1. 如何使用 `ls` 查看資料夾的內容 2. 如何使用 `cd` 在資料夾之間移動 - 按下中間的 `開始` 按鈕來開始這個關卡。 - requirements: - get-started diff --git a/quests/get-started/game.yml b/quests/get-started/game.yml index 054cb57..6e489da 100644 --- a/quests/get-started/game.yml +++ b/quests/get-started/game.yml @@ -5,8 +5,6 @@ instruction: | 1. 如何使用這個網站 2. 如何使用終端機 - 按下中間的 `開始` 按鈕來開始這個關卡。 - stages: - id: start task: 按下 `開始` 按鈕開始 diff --git a/quests/move/game.yml b/quests/move/game.yml index 6b07f3d..421776f 100644 --- a/quests/move/game.yml +++ b/quests/move/game.yml @@ -3,8 +3,6 @@ instruction: | 在這個關卡中,你將會學到: 1. 如何用 `mv` 移動檔案與資料夾 - 按下中間的 `開始` 按鈕來開始這個關卡。 - requirements: - create diff --git a/quests/path/game.yml b/quests/path/game.yml index 90ac9cb..923623e 100644 --- a/quests/path/game.yml +++ b/quests/path/game.yml @@ -4,8 +4,6 @@ instruction: | 1. 絕對路徑和相對路徑 2. 如何使用 `pwd` 顯示目前的路徑 - 按下中間的 `開始` 按鈕來開始這個關卡。 - requirements: - cast - explore diff --git a/quests/read/game.yml b/quests/read/game.yml index 59e7e97..525c494 100644 --- a/quests/read/game.yml +++ b/quests/read/game.yml @@ -3,8 +3,6 @@ instruction: | 在這個關卡中,你將會學到: 1. 如何使用 `cat` 查看檔案的內容 - 按下中間的 `開始` 按鈕來開始這個關卡。 - requirements: - path diff --git a/quests/remove/game.yml b/quests/remove/game.yml index fac862b..51eb6ed 100644 --- a/quests/remove/game.yml +++ b/quests/remove/game.yml @@ -6,8 +6,6 @@ instruction: | 3. 用 `rm -r` 刪除資料夾與它的所有檔案 現在資料夾裡有一些檔案與資料夾,請你使用 `ls` 跟 `cat` 來查看它們的內容。 - 按下中間的 `開始` 按鈕來開始這個關卡。 - requirements: - copy - move From 5605b271277357d78453fe133d8d93dec4654d13 Mon Sep 17 00:00:00 2001 From: "Chen, Tai-Lin" Date: Tue, 30 Jul 2024 23:43:23 +0800 Subject: [PATCH 04/12] modify quests' text --- quests/cast/game.yml | 2 +- quests/copy/game.yml | 2 +- quests/move/game.yml | 2 +- quests/remove/game.yml | 7 +++---- 4 files changed, 6 insertions(+), 7 deletions(-) diff --git a/quests/cast/game.yml b/quests/cast/game.yml index 1cda880..512b94e 100644 --- a/quests/cast/game.yml +++ b/quests/cast/game.yml @@ -1,7 +1,7 @@ title: 輸出文字 instruction: | 在這個關卡中,你將會學到: - 1. 如何使用 `echo` 指令 + 1. 如何使用 `echo` 在終端機上顯示文字。 requirements: - get-started diff --git a/quests/copy/game.yml b/quests/copy/game.yml index 8d291a2..28ff00b 100644 --- a/quests/copy/game.yml +++ b/quests/copy/game.yml @@ -1,7 +1,7 @@ title: 複製檔案 instruction: | 在這個關卡中,你將會學到: - 1. 如何用 `cp` 指令複製檔案 + 1. 如何使用 `cp` 複製檔案 requirements: - create diff --git a/quests/move/game.yml b/quests/move/game.yml index 421776f..25c82ab 100644 --- a/quests/move/game.yml +++ b/quests/move/game.yml @@ -1,7 +1,7 @@ title: 移動檔案 instruction: | 在這個關卡中,你將會學到: - 1. 如何用 `mv` 移動檔案與資料夾 + 1. 如何使用 `mv` 移動檔案與資料夾 requirements: - create diff --git a/quests/remove/game.yml b/quests/remove/game.yml index 51eb6ed..95447bf 100644 --- a/quests/remove/game.yml +++ b/quests/remove/game.yml @@ -1,10 +1,9 @@ title: 刪除檔案與資料夾 instruction: | 在這個關卡中,你將會學到: - 1. 用 `rm` 指令刪除檔案 - 2. 用 `rmdir` 與資料夾 - 3. 用 `rm -r` 刪除資料夾與它的所有檔案 - 現在資料夾裡有一些檔案與資料夾,請你使用 `ls` 跟 `cat` 來查看它們的內容。 + 1. 如何使用 `rm` 指令刪除檔案 + 2. 如何使用 `rmdir` 與資料夾 + 3. 如何使用 `rm -r` 刪除資料夾與它的所有檔案 requirements: - copy From 374501150474d36e6e05acdbbd3055136818e400 Mon Sep 17 00:00:00 2001 From: "Chen, Tai-Lin" Date: Thu, 1 Aug 2024 21:57:43 +0800 Subject: [PATCH 05/12] fix quest content --- quests/copy/game.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/quests/copy/game.yml b/quests/copy/game.yml index 28ff00b..df02412 100644 --- a/quests/copy/game.yml +++ b/quests/copy/game.yml @@ -44,7 +44,8 @@ stages: 請使用 `cd /home/commander` 來返回 `/home/commander` 資料夾。 responses: - type: narrative - content: 可以看到現在資料夾裡有 `hello.txt` 跟 `world.txt`。 + content: | + 可以看到現在資料夾裡有 `hello.txt` 跟 `world.txt`。 請使用 `cat` 來查看它們的內容。 看完之後,使用 `echo next` 來繼續吧! hints: From 21d08b8156c59682600b640d8db98d45f2b5d3dc Mon Sep 17 00:00:00 2001 From: "Chen, Tai-Lin" Date: Fri, 2 Aug 2024 00:28:59 +0800 Subject: [PATCH 06/12] quest: checkpoint01 --- quests/checkpoint-01/Dockerfile | 3 + quests/checkpoint-01/answer.sh | 7 ++ quests/checkpoint-01/game.yml | 110 +++++++++++++++++++ quests/checkpoint-01/home/folder01/file1.txt | 0 quests/checkpoint-01/home/folder02/file2.txt | 0 quests/checkpoint-01/home/folder03/file3.txt | 0 6 files changed, 120 insertions(+) create mode 100644 quests/checkpoint-01/Dockerfile create mode 100644 quests/checkpoint-01/answer.sh create mode 100644 quests/checkpoint-01/game.yml create mode 100644 quests/checkpoint-01/home/folder01/file1.txt create mode 100644 quests/checkpoint-01/home/folder02/file2.txt create mode 100644 quests/checkpoint-01/home/folder03/file3.txt diff --git a/quests/checkpoint-01/Dockerfile b/quests/checkpoint-01/Dockerfile new file mode 100644 index 0000000..2a8e341 --- /dev/null +++ b/quests/checkpoint-01/Dockerfile @@ -0,0 +1,3 @@ +FROM linuxodyssey/quest-base + +COPY home ${HOME} \ No newline at end of file diff --git a/quests/checkpoint-01/answer.sh b/quests/checkpoint-01/answer.sh new file mode 100644 index 0000000..cee7368 --- /dev/null +++ b/quests/checkpoint-01/answer.sh @@ -0,0 +1,7 @@ +echo start +echo next +ls +cd folder03 +pwd +cd ../folder02 +ls ../folder01 \ No newline at end of file diff --git a/quests/checkpoint-01/game.yml b/quests/checkpoint-01/game.yml new file mode 100644 index 0000000..84cc4d1 --- /dev/null +++ b/quests/checkpoint-01/game.yml @@ -0,0 +1,110 @@ +title: 測驗一 +instruction: | + 在這個關卡中,將會考驗你是否理解以下內容: + 1. `echo`:用來輸出文字 + 2. `ls`:用來查看資料夾的內容 + 3. `cd`:用來在資料夾之間移動 + 4. `pwd`:用來顯示目前的路徑 + +requirements: + - path + +stages: + - id: start + task: 按下 `開始` 按鈕開始 + condition: + command: + - ^echo start$ + responses: + - type: narrative + content: | + 這個關卡將會測試你是否理解之前的教學內容。 + 因此不會告訴你要輸入什麼指令。 + 請思考並應用正確的指令來完成任務。 + + 如果理解了,請讓終端機輸出 `next` 來繼續。 + + - id: next + task: 讓終端機輸出 `next` + requirements: + - start + condition: + output: + - ^next$ + responses: + - type: narrative + content: | + 現在請你查看目前資料夾的內容。 + + - id: ls-~ + task: 查看目前資料夾的內容 + requirements: + - next + condition: + pwd: + - ^/home/commander$ + command: + - ^ls$ + responses: + - type: narrative + content: | + 請進入 `folder03` 資料夾。 + + - id: cd-folder03 + task: 進入 `folder03` 資料夾 + requirements: + - ls-~ + condition: + pwd: + - ^/home/commander/folder03$ + responses: + - type: narrative + content: | + 請在終端機顯示目前的路徑。 + + - id: pwd-folder03 + task: 顯示目前的路徑 + requirements: + - cd-folder03 + condition: + command: + - ^pwd$ + output: + - ^/home/commander/folder03$ + responses: + - type: narrative + content: | + 現在請你進入 `folder02` 資料夾, + 並查看 `folder02` 資料夾的內容。 + + - id: ls-folder02 + task: 進入並查看 `folder02` 資料夾的內容 + requirements: + - pwd-folder03 + condition: + pwd: + - ^/home/commander/folder02$ + command: + - ^ls$ + responses: + - type: narrative + content: | + 最後,請你留在 `folder02` 資料夾, + 並查看 `folder01` 資料夾的內容。 + + - id: END + requirements: + - ls-folder02 + task: 留在 `folder02` 資料夾,查看 `folder01` 資料夾的內容。 + condition: + pwd: + - ^/home/commander/folder02$ + command: + - ^ls + output: + - ^file1$ + responses: + - type: narrative + content: | + 恭喜你通過了這個測驗! + 你可以繼續學習之後的教學內容了。 diff --git a/quests/checkpoint-01/home/folder01/file1.txt b/quests/checkpoint-01/home/folder01/file1.txt new file mode 100644 index 0000000..e69de29 diff --git a/quests/checkpoint-01/home/folder02/file2.txt b/quests/checkpoint-01/home/folder02/file2.txt new file mode 100644 index 0000000..e69de29 diff --git a/quests/checkpoint-01/home/folder03/file3.txt b/quests/checkpoint-01/home/folder03/file3.txt new file mode 100644 index 0000000..e69de29 From 124c5cc401a8b3ccb8556e1409e1527046aec0c2 Mon Sep 17 00:00:00 2001 From: "Chen, Tai-Lin" Date: Fri, 2 Aug 2024 01:05:38 +0800 Subject: [PATCH 07/12] quest: checkpoint-02 --- quests/checkpoint-02/Dockerfile | 3 + quests/checkpoint-02/answer.sh | 7 ++ quests/checkpoint-02/game.yml | 109 ++++++++++++++++++ quests/checkpoint-02/home/hello.txt | 1 + ...oultramicroscopicsilicovolcanoconiosis.txt | 1 + 5 files changed, 121 insertions(+) create mode 100644 quests/checkpoint-02/Dockerfile create mode 100644 quests/checkpoint-02/answer.sh create mode 100644 quests/checkpoint-02/game.yml create mode 100644 quests/checkpoint-02/home/hello.txt create mode 100644 quests/checkpoint-02/home/pneumonoultramicroscopicsilicovolcanoconiosis.txt diff --git a/quests/checkpoint-02/Dockerfile b/quests/checkpoint-02/Dockerfile new file mode 100644 index 0000000..2a8e341 --- /dev/null +++ b/quests/checkpoint-02/Dockerfile @@ -0,0 +1,3 @@ +FROM linuxodyssey/quest-base + +COPY home ${HOME} \ No newline at end of file diff --git a/quests/checkpoint-02/answer.sh b/quests/checkpoint-02/answer.sh new file mode 100644 index 0000000..314821b --- /dev/null +++ b/quests/checkpoint-02/answer.sh @@ -0,0 +1,7 @@ +echo start +echo next +ls +cat hello.txt +cat pneumonoultramicroscopicsilicovolcanoconiosis.txt +mkdir folder +touch folder/file.txt \ No newline at end of file diff --git a/quests/checkpoint-02/game.yml b/quests/checkpoint-02/game.yml new file mode 100644 index 0000000..6f983c1 --- /dev/null +++ b/quests/checkpoint-02/game.yml @@ -0,0 +1,109 @@ +title: 測驗二 +instruction: | + 在這個關卡中,將會考驗你是否理解以下內容: + 1. `cat`:用來查看檔案的內容 + 2. `touch`:用來建立檔案 + 3. `mkdir`:用來建立資料夾 + 4. 用 `tab` 鍵來自動補全 + 5. 之前測驗包含的內容 + + +requirements: + - create + +stages: + - id: start + task: 按下 `開始` 按鈕開始 + condition: + command: + - ^echo start$ + responses: + - type: narrative + content: | + 這個關卡將會測試你是否理解之前的教學內容。 + 因此不會告訴你要輸入什麼指令。 + 請思考並應用正確的指令來完成任務。 + + 如果理解了,請讓終端機輸出 `next` 來繼續。 + + - id: next + task: 讓終端機輸出 `next` + requirements: + - start + condition: + output: + - ^next$ + responses: + - type: narrative + content: | + 現在請你查看目前資料夾的內容。 + + - id: ls-~ + task: 查看目前資料夾的內容 + requirements: + - next + condition: + pwd: + - ^/home/commander$ + command: + - ^ls$ + responses: + - type: narrative + content: | + 請查看 `hello.txt` 檔案的內容。 + + - id: cat-hello.txt + task: 查看 `hello.txt` 檔案內容 + requirements: + - ls-~ + condition: + command: + - ^cat hello.txt$ + output: + - ^This is `hello.txt`$ + responses: + - type: narrative + content: | + 請查看另一個有著很長檔名的檔案內容。 + + - id: cat-long-filename + task: 查看另一個檔案的內容 + requirements: + - cat-hello.txt + condition: + command: + - ^cat pneumonoultramicroscopicsilicovolcanoconiosis.txt$ + output: + - ^A name that has been invented for a lung disease caused by breathing in very small pieces of ash or dust.$ + responses: + - type: narrative + content: | + 現在請你建立一個名稱為 `folder` 的資料夾。 + + - id: mkdir-folder + task: 建立名稱為 `folder` 的資料夾 + requirements: + - cat-long-filename + condition: + files: + - path: /home/commander/folder + type: folder + responses: + - type: narrative + content: | + 最後,請你在 `folder` 資料夾中, + 建立檔名為 `file.txt` 的檔案。 + + - id: END + requirements: + - mkdir-folder + task: 在 `folder` 中建立檔名為 `file.txt` 的檔案 + condition: + files: + - path: /home/commander/folder/file.txt + type: file + responses: + - type: narrative + content: | + 恭喜你通過了這個測驗! + 你可以繼續學習之後的教學內容了。 diff --git a/quests/checkpoint-02/home/hello.txt b/quests/checkpoint-02/home/hello.txt new file mode 100644 index 0000000..2bcb251 --- /dev/null +++ b/quests/checkpoint-02/home/hello.txt @@ -0,0 +1 @@ +This is `hello.txt` \ No newline at end of file diff --git a/quests/checkpoint-02/home/pneumonoultramicroscopicsilicovolcanoconiosis.txt b/quests/checkpoint-02/home/pneumonoultramicroscopicsilicovolcanoconiosis.txt new file mode 100644 index 0000000..7a114a0 --- /dev/null +++ b/quests/checkpoint-02/home/pneumonoultramicroscopicsilicovolcanoconiosis.txt @@ -0,0 +1 @@ +A name that has been invented for a lung disease caused by breathing in very small pieces of ash or dust. \ No newline at end of file From eddbda23d768cdc65dea60b9a0ddc4d5e5f75435 Mon Sep 17 00:00:00 2001 From: "Chen, Tai-Lin" Date: Fri, 2 Aug 2024 01:06:05 +0800 Subject: [PATCH 08/12] quest: fix content in remove --- quests/remove/game.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/quests/remove/game.yml b/quests/remove/game.yml index 95447bf..a6086ce 100644 --- a/quests/remove/game.yml +++ b/quests/remove/game.yml @@ -2,8 +2,8 @@ title: 刪除檔案與資料夾 instruction: | 在這個關卡中,你將會學到: 1. 如何使用 `rm` 指令刪除檔案 - 2. 如何使用 `rmdir` 與資料夾 - 3. 如何使用 `rm -r` 刪除資料夾與它的所有檔案 + 2. 如何使用 `rmdir` 刪除空資料夾 + 3. 如何使用 `rm -r` 刪除資料夾與其中的所有檔案 requirements: - copy From 7dcac306f9c9b5cd00312880a5892676a90b75c2 Mon Sep 17 00:00:00 2001 From: "Chen, Tai-Lin" Date: Fri, 2 Aug 2024 02:27:41 +0800 Subject: [PATCH 09/12] quest: checkpoint03 --- quests/checkpoint-03/Dockerfile | 3 + quests/checkpoint-03/answer.sh | 12 ++ quests/checkpoint-03/game.yml | 154 ++++++++++++++++++ quests/checkpoint-03/home/folder/hello.txt | 1 + .../checkpoint-03/home/trash_can/garbage.txt | 0 .../checkpoint-03/home/trash_can/rubbish.txt | 0 .../home/trash_can/secret/letter.txt | 1 + quests/checkpoint-03/home/trash_can/trash.txt | 0 8 files changed, 171 insertions(+) create mode 100644 quests/checkpoint-03/Dockerfile create mode 100644 quests/checkpoint-03/answer.sh create mode 100644 quests/checkpoint-03/game.yml create mode 100644 quests/checkpoint-03/home/folder/hello.txt create mode 100644 quests/checkpoint-03/home/trash_can/garbage.txt create mode 100644 quests/checkpoint-03/home/trash_can/rubbish.txt create mode 100644 quests/checkpoint-03/home/trash_can/secret/letter.txt create mode 100644 quests/checkpoint-03/home/trash_can/trash.txt diff --git a/quests/checkpoint-03/Dockerfile b/quests/checkpoint-03/Dockerfile new file mode 100644 index 0000000..2a8e341 --- /dev/null +++ b/quests/checkpoint-03/Dockerfile @@ -0,0 +1,3 @@ +FROM linuxodyssey/quest-base + +COPY home ${HOME} \ No newline at end of file diff --git a/quests/checkpoint-03/answer.sh b/quests/checkpoint-03/answer.sh new file mode 100644 index 0000000..3b39b6d --- /dev/null +++ b/quests/checkpoint-03/answer.sh @@ -0,0 +1,12 @@ +echo start +echo next +ls +cd folder +cp hello.txt world.txt +rm hello.txt +mv world.txt .. +cd .. +mv world.txt hello.txt +cat hello.txt +rmdir folder +rm -r trash_can \ No newline at end of file diff --git a/quests/checkpoint-03/game.yml b/quests/checkpoint-03/game.yml new file mode 100644 index 0000000..af714e2 --- /dev/null +++ b/quests/checkpoint-03/game.yml @@ -0,0 +1,154 @@ +title: 測驗三 +instruction: | + 在這個關卡中,將會考驗你是否理解以下內容: + 1. `cp`:用來複製檔案和資料夾 + 2. `mv`:用來移動檔案和資料夾或更改名稱 + 3. `rm`:用來刪除檔案和資料夾 + 4. `rmdir`:用來刪除空的資料夾 + 5. 透過選項讓指令達成不同的功能,例如 `rm -r` + 6. 之前測驗包含的內容 + + +requirements: + - remove + +stages: + - id: start + task: 按下 `開始` 按鈕開始 + condition: + command: + - ^echo start$ + responses: + - type: narrative + content: | + 這個關卡將會測試你是否理解之前的教學內容。 + 因此不會告訴你要輸入什麼指令。 + 請思考並應用正確的指令來完成任務。 + + 如果理解了,請讓終端機輸出 `next` 來繼續。 + + - id: next + task: 讓終端機輸出 `next` + requirements: + - start + condition: + output: + - ^next$ + responses: + - type: narrative + content: | + 現在請你查看目前資料夾的內容。 + + - id: ls-~ + task: 查看目前資料夾的內容 + requirements: + - next + condition: + pwd: + - ^/home/commander$ + command: + - ^ls$ + responses: + - type: narrative + content: | + 請複製 `folder` 資料夾中的檔案,並命名為 `world.txt`。 + + - id: cp-hello.txt-world.txt + task: 複製 `folder` 中的檔案並命名為 `world.txt` + requirements: + - ls-~ + condition: + command: + - ^cp \Shello.txt \Sworld.txt$ + files: + - path: /home/commander/folder/hello.txt + type: file + - path: /home/commander/folder/world.txt + type: file + responses: + - type: narrative + content: | + 請刪除 `hello.txt` 檔案。 + + - id: rm-hello.txt + task: 刪除 `hello.txt` + requirements: + - cp-hello.txt-world.txt + condition: + command: + - ^rm \Shello.txt$ + files: + - path: /home/commander/folder/hello.txt + type: file + exsits: false + responses: + - type: narrative + content: | + 現在請將 `world.txt` 移出 `folder` 資料夾。 + (移到 `commander` 資料夾中) + + - id: mv-world.txt-.. + task: 將 `world.txt` 移出 `folder` 資料夾 + requirements: + - rm-hello.txt + condition: + files: + - path: /home/commander/folder/world.txt + type: file + exsits: false + - path: /home/commander/world.txt + type: file + responses: + - type: narrative + content: | + 將 `world.txt` 的名稱改回 `hello.txt` , + 並查看檔案的內容。 + + - id: cat-hello.txt + task: 將 `world.txt` 的名稱改回 `hello.txt` 後查看檔案內容 + requirements: + - mv-world.txt-.. + condition: + output: + - ^cat hello.txt$ + files: + - path: /home/commander/world.txt + type: file + exsits: false + - path: /home/commander/hello.txt + type: file + output: + - ^This is `hello.txt`.$ + responses: + - type: narrative + content: | + 刪除 `folder` 資料夾。 + + - id: rmdir-folder + task: 刪除 `folder` 資料夾 + requirements: + - cat-hello.txt + condition: + files: + - path: /home/commander/folder + type: folder + exsits: false + responses: + - type: narrative + content: | + 刪除 `trash_can` 資料夾。 + + - id: END + requirements: + - rmdir-folder + task: 刪除 `trash_can` 資料夾 + condition: + files: + - path: /home/commander/trash_can + type: folder + exsits: false + responses: + - type: narrative + content: | + 恭喜你通過了這個測驗! + 你可以繼續學習之後的教學內容了。 diff --git a/quests/checkpoint-03/home/folder/hello.txt b/quests/checkpoint-03/home/folder/hello.txt new file mode 100644 index 0000000..2c20110 --- /dev/null +++ b/quests/checkpoint-03/home/folder/hello.txt @@ -0,0 +1 @@ +This is `hello.txt`. \ No newline at end of file diff --git a/quests/checkpoint-03/home/trash_can/garbage.txt b/quests/checkpoint-03/home/trash_can/garbage.txt new file mode 100644 index 0000000..e69de29 diff --git a/quests/checkpoint-03/home/trash_can/rubbish.txt b/quests/checkpoint-03/home/trash_can/rubbish.txt new file mode 100644 index 0000000..e69de29 diff --git a/quests/checkpoint-03/home/trash_can/secret/letter.txt b/quests/checkpoint-03/home/trash_can/secret/letter.txt new file mode 100644 index 0000000..03ddc28 --- /dev/null +++ b/quests/checkpoint-03/home/trash_can/secret/letter.txt @@ -0,0 +1 @@ +aHR0cHM6Ly9yZXVybC5jYy9YUjZZMDA= \ No newline at end of file diff --git a/quests/checkpoint-03/home/trash_can/trash.txt b/quests/checkpoint-03/home/trash_can/trash.txt new file mode 100644 index 0000000..e69de29 From b64d707d16c3d226de82a8b67963b721e34f7631 Mon Sep 17 00:00:00 2001 From: "Chen, Tai-Lin" Date: Fri, 2 Aug 2024 10:22:42 +0800 Subject: [PATCH 10/12] quest: fix checkpoints bug --- quests/checkpoint-01/game.yml | 4 +-- quests/checkpoint-02/game.yml | 7 ++--- quests/checkpoint-02/home/hello.txt | 2 +- ...oultramicroscopicsilicovolcanoconiosis.txt | 2 +- quests/checkpoint-03/Dockerfile | 3 +- quests/checkpoint-03/game.yml | 31 +++++++++---------- 6 files changed, 24 insertions(+), 25 deletions(-) diff --git a/quests/checkpoint-01/game.yml b/quests/checkpoint-01/game.yml index 84cc4d1..c59613a 100644 --- a/quests/checkpoint-01/game.yml +++ b/quests/checkpoint-01/game.yml @@ -22,7 +22,7 @@ stages: 因此不會告訴你要輸入什麼指令。 請思考並應用正確的指令來完成任務。 - 如果理解了,請讓終端機輸出 `next` 來繼續。 + 現在,請讓終端機輸出 `next` 來繼續。 - id: next task: 讓終端機輸出 `next` @@ -102,7 +102,7 @@ stages: command: - ^ls output: - - ^file1$ + - file1.txt responses: - type: narrative content: | diff --git a/quests/checkpoint-02/game.yml b/quests/checkpoint-02/game.yml index 6f983c1..ec1b49b 100644 --- a/quests/checkpoint-02/game.yml +++ b/quests/checkpoint-02/game.yml @@ -7,7 +7,6 @@ instruction: | 4. 用 `tab` 鍵來自動補全 5. 之前測驗包含的內容 - requirements: - create @@ -24,7 +23,7 @@ stages: 因此不會告訴你要輸入什麼指令。 請思考並應用正確的指令來完成任務。 - 如果理解了,請讓終端機輸出 `next` 來繼續。 + 現在,請讓終端機輸出 `next` 來繼續。 - id: next task: 讓終端機輸出 `next` @@ -52,7 +51,7 @@ stages: content: | 請查看 `hello.txt` 檔案的內容。 - - id: cat-hello.txt + - id: cat-hello task: 查看 `hello.txt` 檔案內容 requirements: - ls-~ @@ -69,7 +68,7 @@ stages: - id: cat-long-filename task: 查看另一個檔案的內容 requirements: - - cat-hello.txt + - cat-hello condition: command: - ^cat pneumonoultramicroscopicsilicovolcanoconiosis.txt$ diff --git a/quests/checkpoint-02/home/hello.txt b/quests/checkpoint-02/home/hello.txt index 2bcb251..3bd5213 100644 --- a/quests/checkpoint-02/home/hello.txt +++ b/quests/checkpoint-02/home/hello.txt @@ -1 +1 @@ -This is `hello.txt` \ No newline at end of file +This is `hello.txt`. diff --git a/quests/checkpoint-02/home/pneumonoultramicroscopicsilicovolcanoconiosis.txt b/quests/checkpoint-02/home/pneumonoultramicroscopicsilicovolcanoconiosis.txt index 7a114a0..7689edb 100644 --- a/quests/checkpoint-02/home/pneumonoultramicroscopicsilicovolcanoconiosis.txt +++ b/quests/checkpoint-02/home/pneumonoultramicroscopicsilicovolcanoconiosis.txt @@ -1 +1 @@ -A name that has been invented for a lung disease caused by breathing in very small pieces of ash or dust. \ No newline at end of file +A name that has been invented for a lung disease caused by breathing in very small pieces of ash or dust. diff --git a/quests/checkpoint-03/Dockerfile b/quests/checkpoint-03/Dockerfile index 2a8e341..d8b55a3 100644 --- a/quests/checkpoint-03/Dockerfile +++ b/quests/checkpoint-03/Dockerfile @@ -1,3 +1,4 @@ FROM linuxodyssey/quest-base -COPY home ${HOME} \ No newline at end of file +COPY home ${HOME} +RUN chmod +W /folder \ No newline at end of file diff --git a/quests/checkpoint-03/game.yml b/quests/checkpoint-03/game.yml index af714e2..46410a5 100644 --- a/quests/checkpoint-03/game.yml +++ b/quests/checkpoint-03/game.yml @@ -8,7 +8,6 @@ instruction: | 5. 透過選項讓指令達成不同的功能,例如 `rm -r` 6. 之前測驗包含的內容 - requirements: - remove @@ -25,7 +24,7 @@ stages: 因此不會告訴你要輸入什麼指令。 請思考並應用正確的指令來完成任務。 - 如果理解了,請讓終端機輸出 `next` 來繼續。 + 現在,請讓終端機輸出 `next` 來繼續。 - id: next task: 讓終端機輸出 `next` @@ -53,7 +52,7 @@ stages: content: | 請複製 `folder` 資料夾中的檔案,並命名為 `world.txt`。 - - id: cp-hello.txt-world.txt + - id: cp-hello-world task: 複製 `folder` 中的檔案並命名為 `world.txt` requirements: - ls-~ @@ -70,32 +69,32 @@ stages: content: | 請刪除 `hello.txt` 檔案。 - - id: rm-hello.txt + - id: rm-hello task: 刪除 `hello.txt` requirements: - - cp-hello.txt-world.txt + - cp-hello-world condition: command: - ^rm \Shello.txt$ files: - path: /home/commander/folder/hello.txt type: file - exsits: false + exists: false responses: - type: narrative content: | 現在請將 `world.txt` 移出 `folder` 資料夾。 (移到 `commander` 資料夾中) - - id: mv-world.txt-.. + - id: mv-world-.. task: 將 `world.txt` 移出 `folder` 資料夾 requirements: - - rm-hello.txt + - rm-hello condition: files: - path: /home/commander/folder/world.txt type: file - exsits: false + exists: false - path: /home/commander/world.txt type: file responses: @@ -104,17 +103,17 @@ stages: 將 `world.txt` 的名稱改回 `hello.txt` , 並查看檔案的內容。 - - id: cat-hello.txt + - id: cat-hello task: 將 `world.txt` 的名稱改回 `hello.txt` 後查看檔案內容 requirements: - - mv-world.txt-.. + - mv-world-.. condition: - output: + command: - ^cat hello.txt$ files: - path: /home/commander/world.txt type: file - exsits: false + exists: false - path: /home/commander/hello.txt type: file output: @@ -127,12 +126,12 @@ stages: - id: rmdir-folder task: 刪除 `folder` 資料夾 requirements: - - cat-hello.txt + - cat-hello condition: files: - path: /home/commander/folder type: folder - exsits: false + exists: false responses: - type: narrative content: | @@ -146,7 +145,7 @@ stages: files: - path: /home/commander/trash_can type: folder - exsits: false + exists: false responses: - type: narrative content: | From b73607fb8d407cbdbfb8de68f70ba8a01dc625c0 Mon Sep 17 00:00:00 2001 From: "Chen, Tai-Lin" Date: Fri, 2 Aug 2024 10:45:31 +0800 Subject: [PATCH 11/12] quest: fix checkpoint-02 bug --- quests/checkpoint-02/game.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/quests/checkpoint-02/game.yml b/quests/checkpoint-02/game.yml index ec1b49b..f630944 100644 --- a/quests/checkpoint-02/game.yml +++ b/quests/checkpoint-02/game.yml @@ -59,7 +59,7 @@ stages: command: - ^cat hello.txt$ output: - - ^This is `hello.txt`$ + - ^This is `hello.txt`.$ responses: - type: narrative content: | From dcf72d046c5a20ddce6f10addf084415bbc3d6a2 Mon Sep 17 00:00:00 2001 From: "Chen, Tai-Lin" Date: Fri, 2 Aug 2024 11:12:30 +0800 Subject: [PATCH 12/12] quest: fix checkpoint-03 --- quests/checkpoint-03/Dockerfile | 7 +++++-- quests/checkpoint-03/game.yml | 6 +++--- quests/checkpoint-03/home/folder/hello.txt | 2 +- quests/checkpoint-03/home/trash_can/secret/letter.txt | 2 +- 4 files changed, 10 insertions(+), 7 deletions(-) diff --git a/quests/checkpoint-03/Dockerfile b/quests/checkpoint-03/Dockerfile index d8b55a3..377fb37 100644 --- a/quests/checkpoint-03/Dockerfile +++ b/quests/checkpoint-03/Dockerfile @@ -1,4 +1,7 @@ FROM linuxodyssey/quest-base -COPY home ${HOME} -RUN chmod +W /folder \ No newline at end of file +USER root +COPY home . +RUN chown -R ${USERNAME}:${USERNAME} . + +USER ${USERNAME} \ No newline at end of file diff --git a/quests/checkpoint-03/game.yml b/quests/checkpoint-03/game.yml index 46410a5..1f1c858 100644 --- a/quests/checkpoint-03/game.yml +++ b/quests/checkpoint-03/game.yml @@ -50,7 +50,7 @@ stages: responses: - type: narrative content: | - 請複製 `folder` 資料夾中的檔案,並命名為 `world.txt`。 + 請複製 `folder` 資料夾中的檔案到 `folder` 中,並命名為 `world.txt` 。 - id: cp-hello-world task: 複製 `folder` 中的檔案並命名為 `world.txt` @@ -58,7 +58,7 @@ stages: - ls-~ condition: command: - - ^cp \Shello.txt \Sworld.txt$ + - ^cp .*hello.txt .*world.txt$ files: - path: /home/commander/folder/hello.txt type: file @@ -75,7 +75,7 @@ stages: - cp-hello-world condition: command: - - ^rm \Shello.txt$ + - ^rm .*hello.txt$ files: - path: /home/commander/folder/hello.txt type: file diff --git a/quests/checkpoint-03/home/folder/hello.txt b/quests/checkpoint-03/home/folder/hello.txt index 2c20110..3bd5213 100644 --- a/quests/checkpoint-03/home/folder/hello.txt +++ b/quests/checkpoint-03/home/folder/hello.txt @@ -1 +1 @@ -This is `hello.txt`. \ No newline at end of file +This is `hello.txt`. diff --git a/quests/checkpoint-03/home/trash_can/secret/letter.txt b/quests/checkpoint-03/home/trash_can/secret/letter.txt index 03ddc28..b95980b 100644 --- a/quests/checkpoint-03/home/trash_can/secret/letter.txt +++ b/quests/checkpoint-03/home/trash_can/secret/letter.txt @@ -1 +1 @@ -aHR0cHM6Ly9yZXVybC5jYy9YUjZZMDA= \ No newline at end of file +aHR0cHM6Ly9yZXVybC5jYy9YUjZZMDA=