From b64d707d16c3d226de82a8b67963b721e34f7631 Mon Sep 17 00:00:00 2001 From: "Chen, Tai-Lin" Date: Fri, 2 Aug 2024 10:22:42 +0800 Subject: [PATCH] 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: |