Education Q&A Schema Framework

Use conditional-logic schema generation to keep Education Q&A markup aligned with real page state and avoid stale or invalid static templates.

When To Use It

Google Search CentralEducation Q&A documentation

Use on education flashcard pages: each question has one accepted answer and every question is visible on the page. For a single question with user-submitted answers, use QAPage markup instead.

Key Implementation Documentation Highlights

  • Availability is limited: the Education Q&A carousel shows only for education-related searches, on desktop and mobile, in English (all regions), Portuguese (all regions), Spanish (Mexico only) and Vietnamese (all regions). It applies to flashcard pages marked up with Quiz.
  • Required on Quiz: hasPart, one nested Question per flashcard. Repeat hasPart for multiple flashcards.
  • Required on each Question: eduQuestionType with the fixed value Flashcard, text (the full question) and acceptedAnswer, exactly one Answer carrying the full answer text.
  • Recommended on Quiz: about, a Thing whose name is the underlying concept (for example Cell transport; several names are allowed), and educationalAlignment, an AlignmentObject with alignmentType (educationalSubject or educationalLevel) and targetName (for example Grade 7: Cell Structure). Repeat it for multiple alignments.
  • Add markup to the most detailed leaf page possible and never to pages without questions. The page needs at least one accurate education question and answer pair, and the Q&A content guidelines apply: violations can lead to a manual action.
  • Use the Rich Results Test and URL Inspection to validate rendering, eligibility, and crawlability.

Rules the framework enforces before it emits markup:

  • Every question must use Flashcard for eduQuestionType. A multiple choice or checkbox question in the set suppresses the whole Quiz instead of emitting an ineligible one.
  • Each Question gets exactly one acceptedAnswer. A card with several answers, or with no question or answer text, suppresses the markup.
  • Questions must be immediately visible on the page, not only inside a PDF or other file; the framework emits nothing when they are not.
  • The page must be indexable and self-canonical; alignment entries with an unknown alignmentType or an empty targetName are dropped.

Template Approach

const pageData = {
  concept: "Cell transport",
  question: "What is the process by which molecules move from high to low concentration?",
  answer: "Diffusion"
};

const staticTemplate = {
  "@context": "https://schema.org",
  "@type": "Quiz",
  "about": { "@type": "Thing", "name": pageData.concept },
  "hasPart": [
    {
      "@type": "Question",
      "eduQuestionType": "Flashcard",
      "text": pageData.question,
      "acceptedAnswer": { "@type": "Answer", "text": pageData.answer }
    }
  ]
};

Conditional-logic Framework

function isAbsoluteUrl(value) {
  if (typeof value !== "string") return false;
  try {
    const url = new URL(value);
    return url.protocol === "https:" || url.protocol === "http:";
  } catch {
    return false;
  }
}

function cleanText(value) {
  return typeof value === "string" ? value.replace(/\s+/g, " ").trim() : "";
}

function compact(value) {
  if (Array.isArray(value)) {
    const items = value.map(compact).filter((item) => item !== undefined);
    return items.length ? items : undefined;
  }
  if (value && typeof value === "object") {
    const out = {};
    for (const [key, item] of Object.entries(value)) {
      const kept = compact(item);
      if (kept !== undefined) out[key] = kept;
    }
    return Object.keys(out).length ? out : undefined;
  }
  if (value === null || value === undefined || value === "") return undefined;
  return value;
}

const ALIGNMENT_TYPES = ["educationalSubject", "educationalLevel"];

function buildFlashcard(card) {
  const question = cleanText(card.question);
  // exactly one accepted answer per Question: arrays of several are not eligible
  const answer = Array.isArray(card.answer) ? null : cleanText(card.answer);
  if (!question || !answer) return null;
  return {
    "@type": "Question",
    "eduQuestionType": "Flashcard",
    "text": question,
    "acceptedAnswer": { "@type": "Answer", "text": answer }
  };
}

function buildQuizSchema(source) {
  // page gates: indexable, self-canonical, questions visible on the page (not only in a PDF)
  if (source.indexable === false) return null;
  if (!isAbsoluteUrl(source.url)) return null;
  if (source.canonicalUrl && source.canonicalUrl !== source.url) return null;
  if (source.questionsVisible !== true) return null;

  const cards = source.flashcards || [];
  if (!cards.length) return null;
  // every question must be a Flashcard; multiple choice or checkbox questions make the Quiz ineligible
  if (cards.some((card) => card.format && card.format !== "flashcard")) return null;

  const hasPart = cards.map(buildFlashcard);
  if (hasPart.some((question) => question === null)) return null;

  const schema = {
    "@context": "https://schema.org",
    "@type": "Quiz",
    "about": (source.concepts || []).length
      ? { "@type": "Thing", "name": source.concepts.length === 1 ? source.concepts[0] : source.concepts }
      : null,
    "educationalAlignment": (source.alignments || [])
      .filter((a) => ALIGNMENT_TYPES.includes(a.type) && cleanText(a.targetName))
      .map((a) => ({
        "@type": "AlignmentObject",
        "alignmentType": a.type,
        "targetName": cleanText(a.targetName)
      })),
    "hasPart": hasPart
  };

  return compact(schema);
}

// Usage:
// buildQuizSchema({
//   url: "https://www.example.com/biology/cell-transport-flashcards",
//   canonicalUrl: "https://www.example.com/biology/cell-transport-flashcards",
//   indexable: true,
//   questionsVisible: true,
//   concepts: ["Cell transport"],
//   alignments: [
//     { type: "educationalSubject", targetName: "Biology" },
//     { type: "educationalLevel", targetName: "Grade 7: Cell Structure" }
//   ],
//   flashcards: [
//     { format: "flashcard", question: "What is the process by which molecules move from high to low concentration?", answer: "Diffusion" },
//     { format: "flashcard", question: "Which organelle controls what enters and leaves the cell?", answer: "The cell membrane" }
//   ]
// });

The Output As An Entity Graph

The conditional-logic output above, parsed in your browser and drawn as the graph a crawler builds from it. Every nested object is a node and the property that holds it is the edge. Tap a node to inspect its properties, or drag to rearrange.

Why Conditional Logic Is Better Than Static Templates

  • Builds every flashcard from the same records that render the visible cards, so question and answer text cannot drift from the page.
  • Stamps Flashcard in code and refuses mixed sets, so a stray multiple choice item never makes the page ineligible.
  • Adds about and educationalAlignment only when the content model has them, instead of shipping empty or invented values.
  • Suppresses markup on PDF-only, noindex, or canonicalized pages without a separate template.

Property Reference

What Google's Education Q&A documentation requires and recommends, property by property. These are the same rules the SchemaCDN validator checks. Each name links to its schema.org definition.

Availability: Education Q&A carousel shows only for education-related searches, on desktop and mobile.

Education Q&A properties in Google's documentation
PropertyGoogleExpectsNotes
hasPartRequiredQuestion, can repeatQuiz requires hasPart with at least one flashcard Question.
hasPart.acceptedAnswerRequiredAnswerQuestion requires exactly one acceptedAnswer.
hasPart.eduQuestionTypeRequiredTextEduQuestionType must be 'Flashcard'. One of: Flashcard.
hasPart.textRequiredTextQuestion requires text: the full flashcard question.
aboutRecommendedThingThe underlying concept of the quiz.
about.nameRecommendedText, can repeatThe name of the underlying concept behind the Quiz, e.g. 'Cell transport'. Multiple entries allowed.
educationalAlignmentRecommendedAlignmentObject, can repeatEducationalSubject and/or educationalLevel.
educationalAlignment.alignmentTypeRecommendedTextAlignmentType should be educationalSubject or educationalLevel. One of: educationalSubject, educationalLevel.
educationalAlignment.targetNameRecommendedTextFor the educational framework node.

Explore Other Schema Framework Pages

Employer Aggregate Rating Use on pages that publish employer rating aggregates from a clear and policy-compliant review source. EmployerAggregateRating Open Retired Estimated Salary Use for compensation insight pages that present transparent salary ranges for specific occupations and locations. Occupation Open Event Use for upcoming events with a real-world or virtual occurrence, schedule, and location context. Event Open Retired Fact Check Use for fact-checking pages that evaluate a specific claim with a transparent rating methodology. ClaimReview Open Retired Home Activities Use for virtual classes and activities where participation details and timing are clearly listed. Event Open Retired How-To Use for instructional content that teaches a process through ordered steps and actionable detail. HowTo Open Image Metadata Use on image pages and image hosts that expose ownership and licensing information to search engines. ImageObject Open Job Posting Use for active job listings that include role details, hiring entity, and location/salary context. JobPosting Open Retired Learning Video Use for educational videos where the learning objective and pedagogical structure are explicit. LearningResource Open Local Business Use for physical businesses serving local customers with publicly verifiable contact and location details. LocalBusiness Open Loyalty Program Use to publish a loyalty program and its tiers once at the organization level, so member prices and member shipping can reference them. MemberProgram Open Math Solvers Use for pages that solve mathematical expressions and present step-by-step computational guidance. MathSolver Open Merchant Listing Use on pages where a product can be bought, with price, availability, shipping and return details. Product Open Limited Movie Use for movie detail pages with canonical film information and transparent metadata attribution. Movie Open Organization Use for official organization pages to clarify brand identity and authoritative entity signals. Organization Open Retired Practice Problems Use for educational practice content that presents solvable problems and answer validation structure. Quiz Open Product Snippet Use for product pages where pricing, availability, and product identity are visible to users. Product Open Product Variants Use when one product comes in variants such as size or color, grouped with ProductGroup. ProductGroup Open Profile Page Use for creator or contributor profile pages where identity attributes and ownership are explicit. ProfilePage Open Q&A Use for pages where users submit questions and community or editorial answers are displayed. QAPage Open Recipe Use for recipe pages with complete ingredients, instructions, and preparation details. Recipe Open Return Policy Use to publish a merchant return policy once at the organization level, with offer-level overrides. MerchantReturnPolicy Open Review Snippet Use when a page publishes genuine reviews tied to a clearly identified product, service, or entity. Review Open Shipping Policy Use to publish shipping rates, delivery times and destinations once at the organization level. ShippingService Open Site Name Use on the home page so Google shows the preferred site name in search results. WebSite Open Retired Sitelinks Search Box Use on sites with a functioning internal search endpoint that can accept URL query parameters. WebSite Open Software App (Beta) Use for software product pages that describe platform support and application category clearly. SoftwareApplication Open Limited Speakable Use for news-style pages where specific text segments are appropriate for text-to-speech playback. SpeakableSpecification Open Subscription and Paywalled Content Use for pages with restricted sections so Google can distinguish free previews from protected content. CreativeWork Open Limited Vacation Rental Use for rental property detail pages where booking-relevant amenities and location signals are explicit. VacationRental Open Retired Vehicle Listing Use for inventory pages selling vehicles with standardized listing fields and offer information. Car Open Video Use for pages where a primary video is embedded and key media metadata is visible on-page. VideoObject Open Article Use for editorial pages where the visible content is a complete article with a clear byline and publication timestamps. Article Open Limited Book Actions Use when your page helps users read, preview, or purchase books through clearly described actions. Book Open Breadcrumb Use on pages that belong to a clear hierarchy and display navigational trail links users can follow. BreadcrumbList Open Carousel Use when a page lists multiple related entities in a scannable sequence that can be surfaced as cards. ItemList Open Course Use for educational offerings where curriculum details, provider identity, and delivery context are explicit. Course Open Dataset Use for dataset landing pages so datasets are discoverable in Google Dataset Search with license, creator and download details. Dataset Open Discussion Forum Use for forum and community threads where a primary post and subsequent replies are publicly visible. DiscussionForumPosting Open

Implement Education Q&A Schema Frameworks Correctly

Get implementation support for conditional schema architecture, validation, and deployment governance.