跳到主要内容

GAC011 计算机 II:网页开发

GAC 计算机知识点 2

本主题的视频课程 打开视频页面
21:50

计算II:设计、构建和解释一个网站

一个学校交通网站可以帮助同学了解主要结果并审查研究方法。一个有用的页面需要有明确的目的和可读性……

英文讲解 · 可切换中英文字幕

2.1

这个模块讲什么,如何评分

English

GAC011 is where you build and publish a real website. Six units take you from a design on paper through HTML, CSS and JavaScript to a launched site and a plan for promoting it.

Everything is assessed on what you produce: a storyboard 分镜脚本 and design, the site itself, and a social media strategy 社交媒体策略, plus coursework. There is no written exam.

The GAC011 path from a design on paper, the storyboard, through HTML structure, CSS style and layout and JavaScript behaviour to a launched site and a promotion plan with a social media strategy; it is assessed on what you produce, and GAC017 later adds a back end and a database
Six units from a paper design to a launched, promoted site
  • Design counts as much as code. The module's outcomes name aesthetics, layout, navigation and usability alongside the scripting.
  • ⚠ The site you design here is the thing GAC017 gives a back end and a database. A weak plan now costs time in the next module.

You can run every example in this module in the site's own code playground, and the HTML, CSS and JavaScript references there go deeper than these notes do.

词汇 训练
English 中文 拼音
storyboard/ˈstɔːribɔːd/ 分镜脚本 fēn jìng jiǎo běn
social media strategy/ˈsəʊʃl ˈmiːdiːə ˈstrætədʒi/ 社交媒体策略 shè jiāo méi tǐ cè lüè
2.1

网站设计

教学大纲

GAC011计算II:网页开发(二级)单元1/6。本模块授课约40学时,加20小时自主学习,由教学中心评估并由ACT审核——无外部考试。

模块目标: 完成本模块后,学生应能够运用网页开发语言知识来设计和创建基础网站。他们还将开始编写代码,以在网站上创建基础动态内容。此外,他们还将制定利用社交媒体推广网站的策略。

本单元旨在实现的模块成果:

学习目标 GAC011.1: 运用布局和组织的审美与形式概念设计有效网站,通过视觉组件实现有效传达。

学习目标 GAC011.3: 将导航、可用性和书面内容的最佳实践融入设计中,创建使用户易于获取所需信息的网站。

来源:Cambridge International 教学大纲

English
  • Start on paper. A wireframe 线框图 shows structure without colour, which is the only way to argue about structure.
  • Information architecture 信息架构 is what goes where: the pages, and the path a visitor takes between them.
  • Visual hierarchy 视觉层次 tells the eye what matters — through size, weight, spacing and contrast, not through decoration.
  • Design for the audience, and say who they are before you choose anything.
词汇 训练
English 中文 拼音
wireframe/ˈwaɪəfreɪm/ 线框图 xiàn kuāng tú
Information architecture/ˌɪnfəˈmeɪʃn ˈɑːkɪtektʃə/ 信息架构 xìn xī jià gòu
Visual hierarchy/ˈvɪʒuːəl ˈhaɪərɑːki/ 视觉层次 shì jué céng cì
2.2

用 HTML 创建网站

教学大纲

GAC011计算II:网页开发(二级)单元2/6。本模块授课约40学时,加20小时自主学习,由教学中心评估并由ACT审核——无外部考试。

本单元旨在实现的模块成果:

学习目标 GAC011.2: 使用脚本语言创建并发布网站,以添加交互式组件。

来源:Cambridge International 教学大纲

English
  • HTML 超文本标记语言 marks up meaning, not appearance. A heading is <h1> because it is a heading.
  • An element 元素 usually has an opening tag, content and a closing tag; void elements such as <img> have no content or closing tag. An attribute 属性 goes in the opening tag.
  • Semantic elements 语义化元素 — <header>, <nav>, <main>, <article>, <footer> — tell a browser, a search engine and a screen reader what a region is.
  • Every image needs alt text 替代文本. It is what a blind visitor hears and what a search engine reads.
词汇 训练
English 中文 拼音
HTML/ˌeɪtʃ tiː em ˈel/ 超文本标记语言 chāo wén běn biāo jì yǔ yán
element/ˈelɪmənt/ 元素 yuán sù
attribute/ˈætrɪbjuːt/ 属性 shǔ xìng
Semantic elements/səˈmæntɪk ˈelɪmənts/ 语义化元素 yǔ yì huà yuán sù
alt text/ɒlt tekst/ 替代文本 tì dài wén běn
2.3

用 CSS 美化网站

教学大纲

这是 GAC011 计算机 II:网页开发(二级)课程中 6 个单元的第 3 单元。该模块教学时长约为 40 学时,外加 20 小时自学,由教学中心进行评估并由 ACT 进行调节——没有外部考试。

本单元旨在实现的模块成果:

学习目标 GAC011.1: 运用版式和组织的布局美学及形式概念设计有效的网站,利用视觉组件实现有效传达。

学习目标 GAC011.2: 使用脚本语言创建并发布网站,以添加交互式组件。

来源:Cambridge International 教学大纲

English
  • CSS 层叠样式表 controls appearance, and keeping it out of the HTML is the whole point of the separation.
  • A selector 选择器 chooses elements; a declaration 声明 sets a property to a value.
  • The box model 盒模型 explains layout: content, then padding, then border, then margin.
  • Responsive design 响应式设计 makes one page work on a phone and a laptop, usually with flexible widths and a media query 媒体查询.
Nested boxes showing the CSS box model: content inside padding, inside a border, inside a dashed margin, each labelled.
The box model from the inside out: content, padding, border, margin

Worked example. A card that is too wide on a phone.

The fix is not a fixed pixel width. Set max-width so the card never exceeds the screen, let it shrink below that, and add a media query only for the change that a smaller screen genuinely needs, such as stacking two columns into one.

Designing the flexible case first, and treating the media query as the exception, is what "responsive" means.

探索

同一宽度,两种盒模型

$W_{content-box}=W+2P+2B$

用本课的320像素卡片比较内容宽度与外部宽度。

词汇 训练
English 中文 拼音
CSS/ˌsiː es ˈes/ 层叠样式表 céng dié yàng shì biǎo
selector/sɪˈlektə/ 选择器 xuǎn zé qì
declaration/ˌdekləˈreɪʃn/ 声明 shēng míng
box model/bɒks ˈmɒdl/ 盒模型 hé mó xíng
Responsive design/rɪˈspɒnsɪv dɪˈzaɪn/ 响应式设计 xiǎng yìng shì shè jì
media query/ˈmiːdiːə ˈkwɪərɪ/ 媒体查询 méi tǐ chá xún
2.4

用 JavaScript 添加交互

教学大纲

GAC011 计算 II:Web 开发(二级) 6 个单元中的第 4 个单元。该模块授课时间约为 40 学时,另加 20 学时自主学习,在教学中心进行考核并由 ACT 审核——无外部考试。

本单元旨在实现的模块成果:

学习目标 GAC011.2: 使用脚本语言创建并发布网站,以添加交互式组件。

来源:Cambridge International 教学大纲

English
  • JavaScript runs in the browser and changes the page after it has loaded.
  • The DOM 文档对象模型 is the page as a tree of objects your code can read and change.
  • An event 事件 — a click, a submit, a key press — triggers a function 函数 you wrote.
  • Keep it small at this level: validate a form, toggle a menu, filter a list. A site that fails when JavaScript fails is a design error, not a coding one.
词汇 训练
English 中文 拼音
DOM/dɒm/ 文档对象模型 wén dàng duì xiàng mó xíng
event/ɪˈvent/ 事件 shì jiàn
function/ˈfʌŋkʃn/ 函数 hán shù
2.5

发布你的网站

教学大纲

GAC011计算II:网页开发(二级)单元5/6。本模块授课约40学时,加20小时自主学习,由教学中心评估并由ACT审核——无外部考试。

本单元旨在实现的模块成果:

学习目标 GAC011.3: 将导航、可用性和书面内容的最佳实践融入设计中,创建使用户易于获取所需信息的网站。

学习目标 GAC011.4: 利用网站补充在其他媒介中开展的学术工作。

来源:Cambridge International 教学大纲

English
  • Hosting 托管 puts your files on a server; a domain name 域名 points visitors at them.
  • Test before you launch: every link, on a phone, on a browser that is not yours.
  • Accessibility 无障碍 is not optional — contrast, alt text, keyboard navigation, and text that resizes.
  • ⚠ Check what you are allowed to publish. An image or a font on your site needs a licence that permits it, exactly as a quotation in an essay needs a citation.
词汇 训练
English 中文 拼音
Hosting/ˈhəʊstɪŋ/ 托管 tuō guǎn
domain name/dəˈmeɪn neɪm/ 域名 yù míng
Accessibility/ækˌsesəˈbɪlɪti/ 无障碍 wú zhàng ài
2.6

社交媒体营销

教学大纲

GAC011计算II:网页开发(二级)单元6/6。本模块授课约40学时,加20小时自主学习,由教学中心评估并由ACT审核——无外部考试。

本单元旨在实现的模块成果:

学习目标 GAC011.5: 利用社交媒体推广或查找网站。

来源:Cambridge International 教学大纲

English
  • Decide the audience and the objective before choosing a platform. "Be on social media" is not an objective.
  • A content plan 内容计划 says what you will post, how often, and who writes it.
  • Metrics 指标 must connect to the objective: reach, engagement, and click-through to your site are different things, and only one of them is traffic.
  • Measure, then change one thing. Changing everything at once teaches you nothing about which change worked.
词汇 训练
English 中文 拼音
content plan/ˈkɒntent plæn/ 内容计划 nèi róng jì huà
Metrics/ˈmetrɪks/ 指标 zhǐ biāo
附加说明 PDF

A website should help its intended reader

一份学校交通报告可能包含详细的方法和表格。其网站可为同学提供简短概览。该页面应帮助他们找到主要结果、检查方法并获取经批准的完整报告。

这些单独的笔记增加了实用的GAC011工作。将其旁边的原始讲义保留在原处。遵循当前中心的简报要求,包括所需工具、深度和提交证据。

原始实践简报。 使用虚构的交通数据为同学构建一个可读的页面。添加导航、表格和类别筛选器。规划该页面如何支持报告和简短演讲。不收集真实反馈。本地预览仅为练习,并非公开发布。

绘制一个包含标题、引言、章节链接、发现、方法和页脚的线框图。为每个区域赋予明确的目的。访问者不应猜测按钮是改变当前页面还是打开另一份文档。使用有意义的文本(如“方法和局限性”),而不是“点击此处”。

Build a complete HTML page

字符编码 字符编码告诉浏览器如何读取文件的文本。UTF-8支持多种书写系统。视口设置有助于移动浏览器使用设备宽度。描述性标题有助于人们在标签中识别该页面。

将以下完整示例保存为transport.html。在浏览器中打开该文件。它无需库、账户或网络请求即可运行。内置样式块使此第一个练习保持在一个文件中。后续项目可将这些样式移至单独的CSS文件并在head中链接它。

<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>School transport: practice report</title>
<style>
:root { --page: #ffffff; --text: #172033; --line: #637083; --link: #164db2; }
body.dark { --page: #080d17; --text: #e9eef7; --line: #8392a8; --link: #a8d2ff; }
* { box-sizing: border-box; }
body { margin: 0; background: var(--page); color: var(--text); font: 1.1rem/1.6 sans-serif; }
header, main, footer { max-width: 48rem; margin: auto; padding: 1rem; }
a { color: var(--link); }
nav { display: flex; flex-wrap: wrap; gap: 1rem; }
section { margin-block: 2rem; padding-block: 1rem; border-top: 1px solid var(--line); }
button, select { font: inherit; padding: .4rem; background: var(--page); color: var(--text); border: 1px solid var(--line); }
:focus-visible { outline: 3px solid var(--link); outline-offset: 3px; }
table { width: 100%; border-collapse: collapse; }
caption { text-align: left; margin-block: .5rem; }
th, td { text-align: left; padding: .5rem; border-bottom: 1px solid var(--line); }
[hidden] { display: none !important; }
</style>
</head>
<body>
<header>
<h1>School transport</h1>
<p>An original practice example. All counts are invented.</p>
<nav aria-label="Report sections">
<a href="#findings">Findings</a>
<a href="#method">Method and limits</a>
</nav>
<div id="controls" hidden>
<button id="theme" type="button">Use dark theme</button>
<label for="mode">Show transport category</label>
<select id="mode">
<option value="all">All categories</option>
<option value="walk">Walking</option>
<option value="bus">Bus</option>
<option value="cycle">Cycling</option>
</select>
</div>
</header>
<main>
<section id="findings" aria-labelledby="findings-title">
<h2 id="findings-title">Findings</h2>
<p>In this invented group of 36 responses, bus travel has the largest count.</p>
<table>
<caption>Practice counts, not research findings</caption>
<thead><tr><th scope="col">Main mode</th><th scope="col">Responses</th></tr></thead>
<tbody>
<tr data-mode="walk"><th scope="row">Walking</th><td>12</td></tr>
<tr data-mode="bus"><th scope="row">Bus</th><td>18</td></tr>
<tr data-mode="cycle"><th scope="row">Cycling</th><td>6</td></tr>
</tbody>
</table>
<p id="status" role="status">3 transport categories shown.</p>
</section>
<section id="method" aria-labelledby="method-title">
<h2 id="method-title">Method and limits</h2>
<p>Each invented response has one main mode. The counts sum to 36.</p>
<p>The table does not explain choices, travel distance or the whole school's habits.</p>
<p>This page is a short companion to a report and oral presentation. An actual project should link its approved report and sources here.</p>
</section>
</main>
<footer><p>GAC011 practice: no responses are collected or sent.</p></footer>
<script>
const controls = document.querySelector("#controls");
const mode = document.querySelector("#mode");
const rows = [...document.querySelectorAll("tbody tr")];
const status = document.querySelector("#status");
const theme = document.querySelector("#theme");
mode.addEventListener("change", () => {
  let shown = 0;
  rows.forEach(row => {
    row.hidden = mode.value !== "all" && row.dataset.mode !== mode.value;
    if (!row.hidden) shown += 1;
  });
  status.textContent = `${shown} transport ${shown === 1 ? "category" : "categories"} shown.`;
});
theme.addEventListener("click", () => {
  const dark = document.body.classList.toggle("dark");
  theme.textContent = dark ? "Use light theme" : "Use dark theme";
});
controls.hidden = false;
</script>
</body>
</html>

HTML提供了JavaScript运行前的可读内容。href="#method"链接指向具有id="method"的元素。ID在页面上必须唯一。错误的ID会破坏该链接,即使标签看起来正确。

表格的标题说明了数字的含义。列和行标题描述了单元格。虚构的值为12、18和6,给出了36个响应。公交车的数量最大。这些数量并不能告诉我们人们选择某种交通方式的原因。

Explain and adapt the CSS

一个CSS自定义属性 自定义属性存储可重用的值,例如颜色。示例使用了共享的页面、文本、边框和链接颜色。深色类同时更改这些值。在深色模式下,文本区域和控制使用相同的页面颜色。边框和间距用于分隔各部分。

通用box-sizing规则使指定尺寸包含内边距和边框。阅读区域随窗口增大,但在48rem处停止。当空间受限时,导航可以换行。灵活的宽度通常可以在不使用媒体查询的情况下解决第一个布局问题。

:focus-visible轮廓帮助键盘用户找到当前控件。不要因为可见就移除它。链接保留下划线。表格标题和足够的对比度有助于读者理解数据。实际图像需要与其用途相适应的文本:有意义的信息需要有用的描述;纯装饰性图像可以使用空的alt文本。

适配。 更改页面标题和引言以适用于另一个经批准的学术主题。保持清晰的标题顺序。尝试窄窗口和放大文本。如果稍后添加两列,决定它们应该在哪里堆叠并测试合适的媒体查询。不要添加固定宽度导致手机横向滚动。

Trace the JavaScript interaction

一个事件监听器 事件监听器在其事件发生时运行代码。示例监听选中的更改。mode.value给出选中值。每一行的data-mode属性在JavaScript中变为row.dataset.mode。

当选择了特定类别且该行不匹配时,该行被隐藏。选择all会使所有行可见。计数器在每个更改开始时从零开始。它每显示一个类别增加一次,而不是每个响应增加一次。因此选择公交车显示一个类别,而不是十八个类别。

追踪。 选择公交车。步行和骑行变得隐藏。公交车保持可见,状态显示“显示1个交通类别”。选择所有类别。隐藏条件对所有行为假,因此状态恢复到三个类别。

主题按钮添加或删除深色类。其标签描述下一个操作。更新textContent会更改文本;不会将该文本视为HTML。状态区域可以向辅助软件宣布更改后的计数。使用中心提供的工具检查实际行为。

渐进增强 渐进增强意味着在有额外功能之前,有用的基本内容即可工作。示例直到附加了它们的监听器才显示交互控件。没有JavaScript,完整的表格、方法和章节链接仍然有效。筛选器更改视图,而不改变底层计数或研究限制。

Check, publish and maintain the site

在任何授权发布之前,记录实用检查的结果。打开每个链接,使用键盘,放大文本并尝试手机大小的布局。检查两种主题以及第二个浏览器或设备。验证如果可选脚本不可用,完整内容是否仍然有效。阅读错误而不是隐藏它们。

相对路径 相对路径指从另一个位置描述的文件位置。对于作为report.pdf保存在你页面旁边的一份经批准报告,HTML链接可以使用href="report.pdf"。使用有意义的标签并标识PDF。仅在拥有实际报告时才添加它;不要留下损坏的示例链接。检查主机上的文件名及大小写。

一个静态网站 静态网站可以托管已存储的HTML、CSS、脚本和图片。浏览器仍可以运行交互式JavaScript。域名 域名是人们使用的地址;托管服务提供传输文件的服务。仅有一个域名并不会上传你的网站。

使用您所在中心的批准发布流程。检查媒体许可,并删除私人草稿或参与者信息。一起上传所需文件。打开实际的公共URL,并在该处验证路径、显示效果和控件。本地预览成功并不代表正式发布成功。

保留可编辑的源文件和已知可用的副本。修订时,请检查更改及其受影响的链接。记录版本和日期。仅修正本地文件并不会更新托管副本,直到经批准的发布流程将其交付为止。

Connect the website to academic work and promotion

网站应补充您的报告和演讲。其概览应提供明确的问题、一个有用的结果以及研究的局限性。完整报告包含详细的证据和参考文献。演讲中的幻灯片可以展示页面地址或已批准的二维码。请检查链接是否指向预期的版本。不要声称实践计数是真实的研究发现。

对于推广,首先定义受众和目标。例如:在项目周期间帮助同学找到已批准的报告。规划一条符合规定的帖子,包含简短准确的描述、有意义的链接文本和指定负责人。遵守中心规则和平台要求。规划帖子并不等同于实际进行了推广。

展示次数 展示次数 count 在平台定义下显示。曝光量通常指平台定义下的独立账户数。两者均不代表阅读报告的实际人数。点击率 点击率 needs a stated numerator and denominator。

虚构示例。 帖子A获得400次展示和20次链接点击。帖子B获得250次展示和25次链接点击。使用链接点击除以展示次数计算,A的值为$20/400=5\%$,B的值为$25/250=10\%$。尽管B的展示次数较少,但其链接点击数更多。

这些数字不能证明B的文案导致了差异。发布时间、受众和重复点击可能不同。链接点击也不能证明报告已加载或被阅读。请选择一项更改,记录其上下文,并比较与目标相符的指标。将不必要的个人追踪排除在任务之外。

Practice and explained answers

问题。 1。方法(Method)链接指向哪个元素?2。筛选器对“骑行”(Cycling)应显示什么内容?3。筛选是否改变了原始总数36?4。不使用JavaScript时,哪些内容仍然可用?5。为什么仅购买域名不足以启动项目?6。帖子C有600次展示和24次链接点击。求其比率。7。B较高的比率是否证明其文案更好?8。列举完成网站任务的证据。

解释答案。 1。ID为method的元素;片段和ID必须匹配。2。仅显示“骑行”的行,包含六条响应和一个类别。3。否;它改变可见行,而非原始数据集。4。文本、完整表格、方法和章节链接;可选控件保持隐藏。5。文件仍需经批准的托管和交付,然后在实际URL处进行检查。6。$24/600=4\%$。7。否;其他差异和测量限制仍然存在。8。展示您的计划、来源、工作页面、检查及所需的发布、学术和推广证据。

该知识点的互动课程

逐步完成,配合即时检查练习。

登录或创建账户

IGCSE, A-Level & AP