STEP GUIDE · Solution

這個步驟要做什麼、改哪裡、怎麼看結果

這一步聚焦 TASK-03;下方只比較「Checkpoint 2 → Solution」的真實異動。

01

三項 Task 進度

TASK-01已完成

預檢 Production URL 格式

預計修改:script.js

完成後:拒絕 example.com、localhost 與非 HTTPS 網址

TASK-02已完成

預檢 commit、問題描述與手機勾選

預計修改:script.js

完成後:拒絕空白或過短 commit,並列出待修格式

TASK-03本步驟處理

安全產生期末展示草稿

預計修改:script.js

完成後:以 textContent 與 createElement 產生草稿,明列仍待人工驗收

02

HTML、CSS、JavaScript 與文件實際異動

展開檔案卡查看必要差異;只有程式碼區可以橫向捲動。

HTML本步驟無異動

檔案:index.html

修改前

前一步與本步驟沒有實質差異。

修改後

本步驟不需修改此語言。
CSS本步驟無異動

檔案:style.css

修改前

前一步與本步驟沒有實質差異。

修改後

本步驟不需修改此語言。
JavaScript本步驟有異動

檔案:script.js

修改前

  return document.createDocumentFragment();
  const { errors } = collectEvidence();
  status.textContent = errors.length
    ? errors.join(";")
    : "格式預檢通過;請交由教師或同儕開啟 URL、比對 commit 並操作手機版";

修改後

function appendLabeledText(parent, label, value) {
  const paragraph = document.createElement("p");
  const strong = document.createElement("strong");
  strong.textContent = label;
  paragraph.append(strong, document.createTextNode(value));
  parent.append(paragraph);
}
  const fragment = document.createDocumentFragment();
  const title = document.createElement("h2");
  title.textContent = "我的 60 秒展示草稿";
  fragment.append(title);
  appendLabeledText(fragment, "問題:", evidence.problem);
  appendLabeledText(fragment, "做法:", "完成前端作品、版本提交與 Netlify production deploy。");
  const result = document.createElement("p");
  const resultLabel = document.createElement("strong");
  const link = document.createElement("a");
  resultLabel.textContent = "成果:";
  link.href = evidence.url;
  link.textContent = evidence.url;
  link.target = "_blank";
  link.rel = "noopener noreferrer";
  result.append(resultLabel, link, document.createTextNode(`,commit ${evidence.commit};手機操作為學生自我勾選。`));
  fragment.append(result);
  const review = document.createElement("p");
  review.textContent = "待人工驗收:教師或同儕需實際開啟網址、比對 commit history,並觀看手機操作。";
  fragment.append(review);
  return fragment;
  status.className = "";
  const { evidence, errors } = collectEvidence();
  if (errors.length) {
    status.textContent = errors.join(";");
    status.className = "error";
    return;
  }
  status.textContent = "格式預檢通過;尚待教師或同儕人工驗收";
  showcase.append(buildShowcase(evidence));
README/其他文件本練習未使用

檔案:README.md

修改前

本練習沒有這個檔案。

修改後

本步驟不需修改此語言。
03

怎麼看到結果

  1. 準備

    先準備真實 Netlify Production URL、commit 與手機檢查證據;沒有部署證據時只能做格式預檢。

  2. 操作

    產生展示草稿並用 DevTools Elements 確認以安全文字節點呈現;正式網址仍需部署後由教師或同儕人工開啟驗收。

  3. 預期

    以 textContent 與 createElement 產生草稿,明列仍待人工驗收

Solution TASK-03

安全產生期末展示草稿

完成後可見:以 textContent 與 createElement 產生草稿,明列仍待人工驗收

只做格式預檢,仍需人工驗收

Production 證據格式預檢

尚未執行格式預檢