# 练习题 (Quiz) 结构化数据

## 如何添加结构化数据

1. 添加必要属性。根据您使用的格式，了解在网页上的什么位置插入结构化数据
2. 遵循指南
3. 使用富媒体搜索结果测试验证您的代码，并修复所有严重错误。此外，您还可以考虑修正该工具中可能会标记的任何非严重问题，因为这些这样有助于提升结构化数据的质量（不过，要使内容能够显示为富媒体搜索结果，并非必须这么做）。
5. 为了让 Google 随时了解日后发生的更改，我们建议您提交站点地图Search Console Sitemap API 可以帮助您自动执行此操作。

## 示例

### 仅包含一个问题的测验

<html>
<script type="application/ld+json">
{
"@context": "https://schema.org/",
"@type": "Quiz",
"hasPart": {
"@type": "Question",
"typicalAgeRange": "7-12",
"educationalAlignment": [
{
"@type": "AlignmentObject",
"alignmentType": "educationalSubject",
"targetName": "Mathematics"
},
{
"@type": "AlignmentObject",
"alignmentType": "educationalSubject",
"targetName": "Algebra"
},
{
"@type": "AlignmentObject",
"alignmentType": "educationalLevel",
"targetName": "Grade 5 » Number and Operations—Fractions » Apply and extend previous understandings of multiplication and division. » 3",
"educationalFramework": "Common Core",
"targetUrl": "https://www.corestandards.org/Math/Content/5/NF/B/3/"
}
],
"@type": "Thing",
"name": "Fractions"
},
"educationalLevel": "intermediate",
"eduQuestionType": "Multiple choice",
"learningResourceType": "Practice problem",
"assesses": "Multiplying fractions by whole numbers",
"name": "Choose the model",
"comment": {
"@type": "Comment",
"text": "This is a hint about the question."
},
"encodingFormat": "text/markdown",
"text": "Which model represents the product $$2 * \\frac{2}{3}$$?",
{
"position": 0,
"encodingFormat": "text/html",
"text": "<img src=\"www.test.com/practice-problems-fractions/…image2.png\" alt=\"Answer 2\" />",
"comment": {
"@type": "Comment",
}
}
],
"position": 1,
"encodingFormat": "text/html",
"text": "<img src=\"www.test.com/practice-problems-fractions/…image1.png\" alt=\"Answer 1\" />",
"comment": {
"@type": "Comment",
},
"@type": "Comment",
"text": "This is a full explanation on how this answer was achieved."
}
}
}
}
</script>
<body>
</body>
</html>

### 仅包含一个问题且问题属于多选题类型的测验

<html>
<script type="application/ld+json">
{
"@context": "https://schema.org/",
"@type": "Quiz",
"name": "Quiz about laws of physics",
"@type": "Thing",
"name": "Laws of Physics And Applications"
},
"educationalLevel": "intermediate",
"assesses": "Laws of physics",
"hasPart": {
"@type": "Question",
"eduQuestionType": "Checkbox",
"learningResourceType": "Practice problem",
"name": "Laws of Physics And Applications",
"typicalAgeRange": "12-15",
"text": "Identify laws of Physics. (Select all valid answers)",
{
"position": 0,
"comment": {
"@type": "Comment",
"text": "This is a hint"
}
},
{
"position": 2,
"text": "EUA law",
"comment": {
"@type": "Comment",
"text": "This is a hint"
}
}
],
{
"position": 1,
"text": "Newton's law",
"comment": {
"@type": "Comment",
"text": "This is a hint"
},
"@type": "Comment",
"text": "This is a full explanation on how this answer was achieved."
}
},
{
"position": 3,
"text": "Ohm's law",
"comment": {
"@type": "Comment",
"text": "This is a hint"
},
"@type": "Comment",
"text": "This is a full explanation on how this answer was achieved."
}
}
]
}
}
</script>
<body>
</body>
</html>

### 包含多个问题的测验

<html>
<title>Quiz about displacement, velocity and time</title>
<script type="application/ld+json">
{
"@context": "https://schema.org/",
"@type": "Quiz",
"typicalAgeRange": "7-12",
"educationalLevel": "intermediate",
"assesses": "Velocity and speed",
"educationalAlignment": [
{
"@type": "AlignmentObject",
"alignmentType": "educationalSubject",
"targetName": "Science"
},
{
"@type": "AlignmentObject",
"alignmentType": "educationalSubject",
"targetName": "Physics"
}
],
"name": "Quiz about displacement, velocity and time",
"@type": "Thing",
"name": "Displacement, velocity, and time"
},
"hasPart": [
{
"@type": "Question",
"eduQuestionType": "Multiple choice",
"learningResourceType": "Practice problem",
"name": "Average velocity and average speed from graphs",
"text": "A bug crawls on a wall. What is the average velocity of the bug between the times $$t = 1s$$ and $$t = 10s$$?",
"comment": {
"@type": "Comment",
"text": "This is a hint about the question."
},
"encodingFormat": "text/markdown",
{
"position": 0,
"encodingFormat": "text/markdown",
"text": "$$0.5 \\frac{m}{s}$$",
"comment": {
"@type": "Comment",
"text": "This is a hint"
}
},
{
"position": 1,
"encodingFormat": "text/markdown",
"text": "$$-0.5 \\frac{m}{s}$$",
"comment": {
"@type": "Comment",
"text": "This is a hint"
}
},
{
"position": 3,
"encodingFormat": "text/markdown",
"text": "$$1.5 \\frac{m}{s}$$",
"comment": {
"@type": "Comment",
"text": "This is a hint"
}
}
],
"position": 2,
"encodingFormat": "text/markdown",
"text": "$$0 \\frac{m}{s}$$",
"comment": {
"@type": "Comment",
"text": "This is a hint"
}
}
},
{
"@type": "Question",
"eduQuestionType": "Multiple choice",
"learningResourceType": "Practice problem",
"name": "Average velocity and average speed from graphs",
"text": "A swimmer motion is shown on the following graph of position x vs. time t. What is the average speed?",
"encodingFormat": "text/markdown",
"comment": {
"@type": "Comment",
"text": "This is a hint about the question."
},
{
"position": 0,
"text": "1",
"encodingFormat": "text/html",
"comment": {
"@type": "Comment",
"text": "This is a hint"
}
},
{
"position": 2,
"text": "3",
"encodingFormat": "text/html",
"comment": {
"@type": "Comment",
"text": "This is a hint"
}
},
{
"position": 3,
"text": "4",
"encodingFormat": "text/html",
"comment": {
"@type": "Comment",
"text": "This is a hint"
}
}
],
"position": 1,
"text": "2",
"encodingFormat": "text/html",
"comment": {
"@type": "Comment",
"text": "This is a hint"
},
"@type": "Comment",
"text": "This is a full explanation on how this answer was achieved."
}
}
}
]
}
</script>
<body>
</body>
</html>

## 指南

### 技术指南

• 尽可能将结构化数据放在最详细的叶级页中。请勿向不含练习题的网页添加此结构化数据。
• 为您希望呈现为富媒体搜索结果的每个练习题分别添加一个 Quiz 属性。 结构化数据必须显示在练习题所在的网页中，用户可在该网页上与练习题互动。
• 您的网页应包含所有必需的结构化数据属性
• 您必须为每个主题至少标记两个练习题（例如，为“二次方程”概念标记两个练习题）。请重点标记您希望能够显示在练习题富媒体搜索结果中的概念和练习题。它们可以位于不同的网页上。
• 网站上的练习题必须可供用户访问，即并非仅以数据文件或 PDF 格式提供。
• 如果同一个练习题在您的网站上有多个托管在不同网址的副本，请对每个网页副本使用规范网址
• 对于纯文本的练习题：
• 问题不得超过 320 个字符。
• 单选题的每个备选答案不得超过 70 个字符。
• 对于包含文本和图片的练习题：
• 问题不得超过 160 个字符。
• 图片高度上限为 200 像素。
• 虚假陈述：我们不允许提供企图欺骗或误导用户的练习题。这包括错误地标记与问题无关的主题。

### 内容指南

#### 质量

• 通过此功能呈现练习题内容时，您将对练习题的准确性和质量负责。在质量审核流程中，如果我们发现一定数量的不准确数据，则根据不准确的程度，可能会从该功能中移除部分或全部练习题，直到问题得到解决为止。这适用于以下各项的准确性：
• 标记的概念与所询问的问题的相关性
• 问题、备选答案、提示以及答案说明格式和准确性
• 答案顺序正确（例如，请不要将“以上都不是”作为第一个选项）
• 图片或公式在与问题相关性方面的质量和准确性
• 数学符号的呈现和分隔符的添加

## 标记教育标准

• 共同核心州立标准
• 德州基础知识与技能 (TEKS)
• 弗吉尼亚州学习标准 (SOL)
• 不列颠哥伦比亚省课堂成就标准
• 艾伯塔省学习课程
• 澳大利亚课程（澳大利亚课程、评估和报告管理局 [ACARA]）
• 维多利亚州课程 (F-10)
• 英国国家课程

## 结构化数据类型定义

### Quiz

Quiz 是一个或多个练习题的组合，这些练习题通常关乎相同的概念或科目。

{
"@type": "Quiz",
"@type": "Thing"
}
}

{
"@type": "Quiz",
"@type": "Thing",
"name": "Fractions"
}
}
hasPart Question

{
"@type": "Quiz",
"hasPart": {
"@type": "Question"
}
}

{
"@type": "Quiz",
"hasPart": {
"@type": "Question",
}
}
}
hasPart.eduQuestionType Text

• Multiple choice：只有一个正确答案。备选答案显示为一组单选按钮，用户只能选择其中一个。
• Checkbox：有多个正确答案。备选答案显示为一组复选框对应的选项，用户可以勾选所有适用项。
{
"@type": "Quiz",
"hasPart": {
"@type": "Question",
"eduQuestionType": "Multiple choice"
}
}
hasPart.learningResourceType Text

{
"@type": "Quiz",
"hasPart": {
"@type": "Question",
"learningResourceType": "Practice problem"
}
}

{
"@type": "Quiz",
"hasPart": {
"@type": "Question",
}
}
}

{
"@type": "Quiz",
"hasPart": {
"@type": "Question",
"text": "$$x = 1$$"
}
}
}
hasPart.text Text

{
"@type": "Quiz",
"hasPart": {
"@type": "Question",
"text": "Which diagram represents the product $$3 *\frac{2}{3}$$?"
}
}

educationalAlignment AlignmentObject

{
"@type": "Quiz",
"educationalAlignment": []
}
educationalAlignment.alignmentType Text

• 如需指定测验的学习领域，请将 alignmentType 设置为 educationalSubject
• 如需指定测验的目标年级或教育标准，请将 alignmentType 设置为 educationalLevel

{
"@type": "Quiz",
"educationalAlignment": [
{
"@type": "AlignmentObject",
"alignmentType": "educationalSubject",
"targetName": "Mathematics"
},
{
"@type": "AlignmentObject",
"alignmentType": "educationalLevel",
}
]
}

{
"@type": "Quiz",
"educationalAlignment: [
{
"@type": "AlignmentObject",
"alignmentType": "educationalLevel",
"educationalFramework": "Common Core",
"targetName": "Grade 8: Expressions and Equations",
"targetUrl": "https://www.corestandards.org/Math/Content/8/EE/A/2/"
}
]
}
educationalAlignment.educationalFramework Text

educationalAlignment.targetName Text

{
"@type": "Quiz",
"educationalAlignment: [
{
"@type": "AlignmentObject",
"targetName": "Grade 8: Expressions and Equations"
}
]
}
educationalAlignment.targetUrl URL

{
"@type": "Quiz",
"educationalAlignment: [
{
"@type": "AlignmentObject",
"targetUrl": "https://www.corestandards.org/Math/Content/8/EE/A/2/"
}
]
}
educationalLevel Text

• beginner
• intermediate
{
"@type": "Quiz",
"educationalLevel": "beginner"
}

{
"@type": "Quiz",
"hasPart": {
"@type": "Question",
"@type": "Thing"
}
}
}

{
"@type": "Quiz",
"hasPart": {
"@type": "Question",
"@type": "Thing",
"name": "Fractions"
}
}
}

{
"@type": "Quiz",
"hasPart": {
"@type": "Question",
"@type": "Comment"
}
}
}
}

{
"@type": "Quiz",
"hasPart": {
"@type": "Question",
"@type": "Comment",
"text": "*In order to get to this result..*",
"encodingFormat": "text/markdown"
}
}
}
}

{
"@type": "Quiz",
"hasPart": {
"@type": "Question",
"comment": {
"@type": "Comment"
}
}
}
}

{
"@type": "Quiz",
"hasPart": {
"@type": "Question",
"comment": {
"@type": "Comment",
"text": "<p>This is a hint</p>"
}
}
}
}

{
"@type": "Quiz",
"hasPart": {
"@type": "Question",
"position": "2"
}
}
}
hasPart.assesses DefinedTermText

{
"@type": "Quiz",
"hasPart": {
"@type": "Question",
"assesses": "Multiplying fractions by whole numbers"
}
}
hasPart.comment Comment

{
"@type": "Quiz",
"hasPart": {
"@type": "Question",
"comment": {
"@type": "Comment"
}
}
}
hasPart.comment.text Text

{
"@type": "Quiz",
"hasPart": {
"@type": "Question",
"comment": {
"@type": "Comment",
"text": "<p>This is a hint</p>"
}
}
}
hasPart.educationalAlignment AlignmentObject

{
"@type": "Quiz",
"hasPart": {
"@type": "Question",
"educationalAlignment": []
}
hasPart.educationalAlignment.alignmentType Text

• 如需指定问题的学习领域，请将 alignmentType 设置为 educationalSubject
• 如需指定问题的目标年级或教育标准，请将 alignmentType 设置为 educationalLevel

{
"@type": "Quiz",
"hasPart": {
"@type": "Question",
"educationalAlignment": [
{
"@type": "AlignmentObject",
"alignmentType": "educationalSubject",
"targetName": "Mathematics"
},
{
"@type": "AlignmentObject",
"alignmentType": "educationalLevel",
}
]
}
}

{
"@type": "Quiz",
"hasPart": {
"@type": "Question",
"educationalAlignment: [
{
"@type": "AlignmentObject",
"alignmentType": "educationalLevel",
"educationalFramework": "Common Core",
"targetName": "Grade 8: Expressions and Equations",
"targetUrl": "https://www.corestandards.org/Math/Content/8/EE/A/2/"
}
]
}
}
hasPart.educationalAlignment.educationalFramework Text

hasPart.educationalAlignment.targetName Text

{
"@type": "Quiz",
"hasPart": {
"@type": "Question",
"educationalAlignment: [
{
"@type": "AlignmentObject",
"alignmentType": "educationalLevel",
"targetName": "Grade 8: Expressions and Equations"
}
]
}
}
hasPart.educationalAlignment.targetUrl URL

hasPart.educationalLevel Text

• beginner
• intermediate
{
"@type": "Quiz",
"hasPart": {
"@type": "Question",
"educationalLevel": "beginner"
}
}
hasPart.name Text

{
"@type": "Quiz",
"hasPart": {
"@type": "Question",
}
}

{
"@type": "Quiz",
"hasPart": {
"@type": "Question",
"comment": {
"@type": "Comment"
}
}
}
}

{
"@type": "Quiz",
"hasPart": {
"@type": "Question",
"comment": {
"@type": "Comment",
"text": "<p>This is a hint</p>"
}
}
}
}

• text/markdown
• text/html
{
"@type": "Quiz",
"hasPart": {
"@type": "Question",
"encodingFormat": "text/html"
}
}
}

{
"@type": "Quiz",
"hasPart": {
"@type": "Question",
"position": "0"
}
}
}
hasPart.typicalAgeRange Text

{
"@type": "Quiz",
"hasPart": {
"@type": "Question",
"typicalAgeRange": "7-12"
}
}
name Text

{
"@type": "Quiz",
"name": "Negative exponents review"
}
typicalAgeRange Text

{
"@type": "Quiz",
"typicalAgeRange": "7-12"
}

## 在 HTML 或 Markdown 中对练习题进行编码

• 标头
• 换行符
• 列表（有序和无序）
• 段落
• 粗体
• 斜体
• 图片
• LaTex 格式的公式

CSS 或 JavaScript 会被忽略。Google 不会显示包含不受支持的 HTML 标记的问题。

### 如何指定格式

{
"@type": "Question",
"name": "Average velocity and average speed from graphs",
"text": "What is the average velocity [..] between the times $$t = 4s$$ and $$t = 10s$$?",
"encodingFormat": "text/markdown"
..
..
}

)。

## 问题排查

• 如果您使用了内容管理系统 (CMS) 或其他人负责管理您的网站，请向其寻求帮助。请务必向其转发列明问题细节的任何 Search Console 消息。