练习题 (Quiz) 结构化数据

为帮助学生、老师和家长更轻松地在网上查找您的教育和学习资料,您可以使用结构化数据标记练习题。本指南介绍了如何在网页上实施此架构。添加结构化数据后,您的练习题将能以特殊形式显示在 Google 搜索结果中,并提供更好的用户体验。

Google 搜索中的练习题富媒体搜索结果

如何添加结构化数据

结构化数据是一种提供网页相关信息并对网页内容进行分类的标准化格式。如果您不熟悉结构化数据,可以详细了解结构化数据的运作方式

下面概述了如何构建、测试和发布结构化数据。如需获得向网页添加结构化数据的分步指南,请查看结构化数据 Codelab

  1. 添加必要属性。根据您使用的格式,了解在网页上的什么位置插入结构化数据
  2. 遵循指南
  3. 使用富媒体搜索结果测试验证您的代码,并修复所有严重错误。此外,您还可以考虑修正该工具中可能会标记的任何非严重问题,因为这些这样有助于提升结构化数据的质量(不过,要使内容能够显示为富媒体搜索结果,并非必须这么做)。
  4. 部署一些包含您的结构化数据的网页,然后使用网址检查工具测试 Google 看到的网页样貌。请确保您的网页可供 Google 访问,不会因 robots.txt 文件、noindex 标记或登录要求而被屏蔽。如果网页看起来没有问题,您可以请求 Google 重新抓取您的网址
  5. 为了让 Google 随时了解日后发生的更改,我们建议您提交站点地图Search Console Sitemap API 可以帮助您自动执行此操作。

功能可用性

练习题功能只能以英语提供,并已在所有可以使用 Google 搜索的国家/地区推出。该功能仅适用于数学和科学主题,支持单选题和多选题类型,并且桌面设备和移动设备均适用。

示例

仅包含一个问题的测验

下面是仅包含一个相关问题的测验示例。此问题只有一个正确答案。

<html>
  <head>
    <title>Quiz about fractions</title>
    <script type="application/ld+json">
    {
      "@context": "https://schema.org/",
      "@type": "Quiz",
      "name": "Quiz about fractions",
      "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/"
          }
        ],
        "about": {
          "@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}$$?",
        "suggestedAnswer": [
          {
            "@type": "Answer",
            "position": 0,
            "encodingFormat": "text/html",
            "text": "<img src=\"www.test.com/practice-problems-fractions/…image2.png\" alt=\"Answer 2\" />",
            "comment": {
              "@type": "Comment",
              "text": "This is a hint about the answer."
            }
          }
        ],
        "acceptedAnswer": {
          "@type": "Answer",
          "position": 1,
          "encodingFormat": "text/html",
          "text": "<img src=\"www.test.com/practice-problems-fractions/…image1.png\" alt=\"Answer 1\" />",
          "comment": {
            "@type": "Comment",
            "text": "This is a hint about the answer."
          },
          "answerExplanation": {
            "@type": "Comment",
            "text": "This is a full explanation on how this answer was achieved."
          }
        }
      }
    }
    </script>
  </head>
  <body>
  </body>
</html>

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

下面是仅包含一个相关问题的测验示例。此问题有多个正确答案。

<html>
  <head>
    <title>Quiz about laws of Physics</title>
    <script type="application/ld+json">
    {
      "@context": "https://schema.org/",
      "@type": "Quiz",
      "name": "Quiz about laws of physics",
      "about": {
        "@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)",
        "suggestedAnswer": [
          {
            "@type": "Answer",
            "position": 0,
            "text": "Nevada's Law",
            "comment": {
              "@type": "Comment",
              "text": "This is a hint"
            }
          },
          {
            "@type": "Answer",
            "position": 2,
            "text": "EUA law",
            "comment": {
              "@type": "Comment",
              "text": "This is a hint"
            }
          }
        ],
        "acceptedAnswer": [
          {
            "@type": "Answer",
            "position": 1,
            "text": "Newton's law",
            "comment": {
              "@type": "Comment",
              "text": "This is a hint"
            },
            "answerExplanation": {
              "@type": "Comment",
              "text": "This is a full explanation on how this answer was achieved."
            }
          },
          {
            "@type": "Answer",
            "position": 3,
            "text": "Ohm's law",
            "comment": {
              "@type": "Comment",
              "text": "This is a hint"
            },
            "answerExplanation": {
              "@type": "Comment",
              "text": "This is a full explanation on how this answer was achieved."
            }
          }
        ]
      }
    }
    </script>
  </head>
  <body>
  </body>
</html>

包含多个问题的测验

下面是一个包含多个问题及其备选答案的测验示例。

<html>
  <head>
    <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",
      "about": {
        "@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",
          "suggestedAnswer": [
            {
              "@type": "Answer",
              "position": 0,
              "encodingFormat": "text/markdown",
              "text": "$$0.5 \\frac{m}{s}$$",
              "comment": {
                "@type": "Comment",
                "text": "This is a hint"
              }
            },
            {
              "@type": "Answer",
              "position": 1,
              "encodingFormat": "text/markdown",
              "text": "$$-0.5 \\frac{m}{s}$$",
              "comment": {
                "@type": "Comment",
                "text": "This is a hint"
              }
            },
            {
              "@type": "Answer",
              "position": 3,
              "encodingFormat": "text/markdown",
              "text": "$$1.5 \\frac{m}{s}$$",
              "comment": {
                "@type": "Comment",
                "text": "This is a hint"
              }
            }
          ],
          "acceptedAnswer": {
            "@type": "Answer",
            "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."
          },
          "suggestedAnswer": [
            {
              "@type": "Answer",
              "position": 0,
              "text": "1",
              "encodingFormat": "text/html",
              "comment": {
                "@type": "Comment",
                "text": "This is a hint"
              }
            },
            {
              "@type": "Answer",
              "position": 2,
              "text": "3",
              "encodingFormat": "text/html",
              "comment": {
                "@type": "Comment",
                "text": "This is a hint"
              }
            },
            {
              "@type": "Answer",
              "position": 3,
              "text": "4",
              "encodingFormat": "text/html",
              "comment": {
                "@type": "Comment",
                "text": "This is a hint"
              }
            }
          ],
          "acceptedAnswer": {
            "@type": "Answer",
            "position": 1,
            "text": "2",
            "encodingFormat": "text/html",
            "comment": {
              "@type": "Comment",
              "text": "This is a hint"
            },
            "answerExplanation": {
              "@type": "Comment",
              "text": "This is a full explanation on how this answer was achieved."
            }
          }
        }
      ]
    }
    </script>
  </head>
  <body>
  </body>
</html>

指南

您的练习题必须遵循以下指南,才能显示在 Google 上的练习题功能中:

技术指南

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

内容指南

我们之所以制定这些练习题内容指南,是为了确保我们的用户能够找到所需的学习资源。如果我们发现任何内容违反这些政策,将采取适当措施,这可能包括采取人工处置措施并将您的网页从 Google 上的练习题功能中移除。

亵渎和粗俗的语言

我们不允许提供包含淫秽、亵渎或攻击性语言的练习题。

伪装成练习题的广告

我们不允许提供伪装成练习题的宣传内容,例如由联属计划等第三方发布的内容。

如果 Google 收到关于练习题内容可能违法的投诉,我们将根据搜索政策处理相应内容。

质量

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

标记教育标准

学习标准是指学生在各年级应当了解并且能够实现的学习目标。学习标准具有多种用途,例如链接到内容或组成学习进度的一部分。标记与在线学习资料关联的标准(位于 educationalAlignmenthasPart.educationalAlignment 字段下)后,当用户根据这些标准搜索学习内容时,Google 能够以最实用的方式为用户整理并显示相关信息。下面是此架构的简要概览:

下面列举了一些教育标准示例:

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

结构化数据类型定义

为了让您的内容能够显示为富媒体搜索结果,您必须为其添加必需的属性。您还可以添加建议的属性,以便向结构化数据添加更多信息,进而提供更好的用户体验。

Quiz

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

如需了解 Quiz 的完整定义,请访问 schema.org。

必需属性
about Thing

Quiz 背后的基本概念的嵌套信息。如果问题有 hasPart.about 属性,则此属性并非必要属性。

{
  "@type": "Quiz",
  "about": {
    "@type": "Thing"
  }
}
about.name Text

Quiz 背后的基本概念的嵌套信息。如果问题有 hasPart.about.name 属性,则此属性并非必要属性。此属性支持添加多个条目。

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

测验中具体练习题的嵌套信息。使用一个 hasPart 属性可表示单个练习题。

如需为单个测验添加多个练习题,请重复添加此属性。

{
  "@type": "Quiz",
  "hasPart": {
    "@type": "Question"
  }
}
hasPart.acceptedAnswer Answer

问题的正确答案。如果单个问题有多个正确答案,请重复添加此属性。

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

练习题的类型。Google 搜索呈现和检查正确和错误答案时,此属性不可或缺。对于每个问题,Google 可显示 2 个到 6 个答案。

请使用以下任一支持的值:

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

此学习资源的类型。使用以下固定值:Practice problem

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

问题的所有其他正确或错误答案。如需指定多个此类答案,请重复添加此属性及其嵌套属性。

{
  "@type": "Quiz",
  "hasPart": {
    "@type": "Question",
    "suggestedAnswer": {
      "@type": "Answer",
    }
  }
}
hasPart.suggestedAnswer.text Text

答案的内容。您可以使用 Markdown 或 HTML。了解如何在 HTML 或 Markdown 中对练习题进行编码

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

问题的内容。您可以使用 Markdown 或 HTML。了解如何在 HTML 或 Markdown 中对练习题进行编码

{
  "@type": "Quiz",
  "hasPart": {
    "@type": "Question",
    "text": "Which diagram represents the product $$3 *\frac{2}{3}$$?"
  }
}
建议属性
educationalAlignment AlignmentObject

测验与某个现有教育框架的对应关系。您可以重复添加此属性,将测验与某个学习领域、目标年级或教育标准相对应。 您可以直接在 Quiz 中添加教育框架对应关系,或者在 Question 中添加更具体的对应关系。

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

学习资源和测验的教育框架节点之间对应关系的类别。Google 搜索采用 LRMI 标准

重复添加 alignmentType 可指定学习领域及目标年级或教育标准。

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

如果存在其他领域和子领域,可以插入多个对象。如需指定概念,请改用 about 属性。

下面是如何同时指定 educationalSubjecteducationalLevel 的示例。

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

如需指定“共同核心州立标准”等标准,请使用 educationalAlignment.educationalFrameworkeducationalAlignment.targetUrl 属性。

{
  "@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

某个现有教育框架的节点名称。例如,“Grade 8: Expressions and Equations”。

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

特定教育框架的网址。例如,共同核心州立标准 8 年级数学标准的网址。

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

测验的难度级别。下面列举了一些支持的示例值:

  • beginner
  • intermediate
  • advanced
{
  "@type": "Quiz",
  "educationalLevel": "beginner"
}
hasPart.about Thing

问题背后的基本概念的嵌套信息。如果未针对 Quiz 指定 about 属性,则必须指定 hasPart.about。此属性支持添加多个条目。

{
  "@type": "Quiz",
  "hasPart": {
    "@type": "Question",
    "about": {
      "@type": "Thing"
    }
  }
}
hasPart.about.name Text

问题背后的基本概念的标题。如果未针对 Quiz 指定 about.name 属性,则必须指定 hasPart.about.name

{
  "@type": "Quiz",
  "hasPart": {
    "@type": "Question",
    "about": {
      "@type": "Thing",
      "name": "Fractions"
    }
  }
}
hasPart.acceptedAnswer.answerExplanation Comment

关于如何实现相应答案中所述结果的完整说明。通常,仅针对正确答案使用该属性。在该属性中,可使用 hasPart.suggestedAnswer.comment.text 属性指定说明的内容。

{
  "@type": "Quiz",
  "hasPart": {
    "@type": "Question",
    "acceptedAnswer": {
      "@type": "Answer",
      "answerExplanation": {
        "@type": "Comment"
       }
    }
  }
}
hasPart.acceptedAnswer.answerExplanation.text Text

建议答案的说明性内容。如需更改内容格式(HTML 或 Markdown),请使用 encodingFormat。了解如何在 HTML 或 Markdown 中对练习题进行编码

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

关于答案的提示或说明,可用于帮助理解答案正确或错误的原因。可在该属性中使用 hasPart.acceptedAnswer.comment.text 属性指定提示内容。

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

建议答案的提示或说明内容。如需更改内容格式(HTML 或 Markdown),请使用 encodingFormat。了解如何在 HTML 或 Markdown 中对练习题进行编码

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

向用户显示相应答案时的位置。

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

求解问题所需的技能。填写此属性可使练习题更容易被用户发现。

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

关于问题的提示或说明,可用于帮助解答问题。在该属性中,可使用 hasPart.comment.text 属性指定提示内容。

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

问题的提示或说明内容。如需更改内容格式(HTML 或 Markdown),请使用 encodingFormat。了解如何在 HTML 或 Markdown 中对练习题进行编码

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

问题与某个现有教育框架的对应关系。此属性会覆盖在 Quiz 对象中添加的教育框架对应关系。

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

学习资源和问题的教育框架节点之间对应关系的类别。Google 搜索采用 LRMI 标准

重复添加 alignmentType 可指定学习领域及目标年级或教育标准。

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

如果存在其他领域和子领域,可以插入多个对象。如需指定概念,请改用 hasPart.about 属性。

下面是如何同时指定 educationalSubjecteducationalLevel 的示例。

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

如需指定“共同核心州立标准”等标准,请使用 hasPart.educationalAlignment.educationalFrameworkhasPart.educationalAlignment.targetUrl 属性。

{
  "@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

某个现有教育框架的节点名称。例如,“Grade 8: Expressions and Equations”。

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

适用于相应问题的特定教育框架的网址。 例如,共同核心州立标准 8 年级数学标准的网址。

hasPart.educationalLevel Text

问题的难度级别,以文本形式显示。下面列举了一些支持的示例值:

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

问题的概述。不要添加问题的完整内容;请改用 hasPart.text

{
  "@type": "Quiz",
  "hasPart": {
    "@type": "Question",
    "name": "Question about fractions"
  }
}
hasPart.suggestedAnswer.comment Comment

关于答案的提示或说明,可用于帮助理解答案正确或错误的原因。可在该属性中使用 hasPart.suggestedAnswer.comment.text 属性指定提示内容。

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

建议答案的提示或说明内容。如需更改内容格式(HTML 或 Markdown),请使用 encodingFormat。了解如何在 HTML 或 Markdown 中对练习题进行编码

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

文本属性编码所用的 MIME 格式。如果未指定 encodingFormat,则默认值为 text/html。请使用以下某个值:

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

了解如何在 HTML 或 Markdown 中对练习题进行编码

hasPart.suggestedAnswer.position Integer

向用户显示相应答案时的位置。

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

问题通常面向的年龄段。例如,7-1218-

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

测验的标题。

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

测验通常面向的年龄段。例如,7-1218-

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

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

QuestionAnswerComment 进行编码时,Google 搜索支持 Markdown(CommonMark 变种)和 HTML。我们仅允许使用以下这组结构:

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

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

如何指定格式

如需指定要使用的编码格式,请使用 encodingFormat 属性,并将 HTML 格式对应的值设置为 "text/html",或将 Markdown 格式对应的值设置为 "text/markdown"

下面是设为 Markdown 格式的问题示例:

{
  "@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"
  ..
  ..
}

如果未指定 encodingFormat,则系统会假定格式为 "text/html"

公式

如需指定公式,请使用 LaTex 格式。您必须使用双美元符号 ($$) to embed formulas. For example:

"<p>Please solve: $$2x^2 = 18$$</p>"
    )。

Troubleshooting

If you're having trouble implementing or debugging structured data, here are some resources that may help you.

  • If you're using a content management system (CMS) or someone else is taking care of your site, ask them to help you. Make sure to forward any Search Console message that details the issue to them.
  • Google does not guarantee that features that consume structured data will show up in search results. For a list of common reasons why Google may not show your content in a rich result, see the General Structured Data Guidelines.
  • You might have an error in your structured data. Check the list of structured data errors and the Unparsable structured data report.
  • If you received a structured data manual action against your page, the structured data on the page will be ignored (although the page can still appear in Google Search results). To fix structured data issues, use the Manual Actions report.
  • Review the guidelines again to identify if your content isn't compliant with the guidelines. The problem can be caused by either spammy content or spammy markup usage. However, the issue may not be a syntax issue, and so the Rich Results Test won't be able to identify these issues.
  • Troubleshoot missing rich results / drop in total rich results.
  • Allow time for re-crawling and re-indexing. Remember that it may take several days after publishing a page for Google to find and crawl it. For general questions about crawling and indexing, check the Google Search crawling and indexing FAQ.
  • Post a question in the Google Search Central forum.