{
  "schemaVersion": 1,
  "id": "authoring-worked-examples",
  "engine": "equation-editor-v1",
  "metadata": {
    "title": "Authoring worked examples",
    "deckAuthor": "Formula Cards"
  },
  "decks": [
    {
      "id": "examples",
      "kind": "computation",
      "shortName": "EX",
      "title": "Worked examples",
      "subtitle": "Three supported patterns",
      "description": "Download, import, practice, and adapt these examples.",
      "cards": [
        "fraction-power",
        "projection",
        "expand-square"
      ]
    }
  ],
  "cards": [
    {
      "id": "fraction-power",
      "type": "equation",
      "title": "Fraction and power",
      "prompt": "For real $a,b$, write $x$ as half the sum of $a^2$ and $b$.",
      "learningVersion": 1,
      "editor": {
        "palette": [
          {
            "tool": "x",
            "label": "x"
          },
          {
            "tool": "a",
            "label": "a"
          },
          {
            "tool": "b",
            "label": "b"
          }
        ],
        "operations": [
          "=",
          "+",
          "fraction",
          "power",
          "square"
        ],
        "digits": [
          "0",
          "1",
          "2"
        ],
        "initialAnswerVisible": false
      },
      "answers": [
        {
          "kind": "row",
          "children": [
            {
              "kind": "symbol",
              "text": "x"
            },
            {
              "kind": "symbol",
              "text": "="
            },
            {
              "kind": "fraction",
              "top": {
                "kind": "row",
                "children": [
                  {
                    "kind": "power",
                    "base": {
                      "kind": "row",
                      "children": [
                        {
                          "kind": "symbol",
                          "text": "a"
                        }
                      ]
                    },
                    "exponent": {
                      "kind": "row",
                      "children": [
                        {
                          "kind": "symbol",
                          "text": "2"
                        }
                      ]
                    }
                  },
                  {
                    "kind": "symbol",
                    "text": "+"
                  },
                  {
                    "kind": "symbol",
                    "text": "b"
                  }
                ]
              },
              "bottom": {
                "kind": "row",
                "children": [
                  {
                    "kind": "symbol",
                    "text": "2"
                  }
                ]
              }
            }
          ]
        }
      ],
      "explanation": {
        "kind": "proof",
        "proof": {
          "intro": "A small authoring example; not attributed to a lecturer.",
          "steps": [
            {
              "equation": {
                "kind": "row",
                "children": [
                  {
                    "kind": "symbol",
                    "text": "x"
                  },
                  {
                    "kind": "symbol",
                    "text": "="
                  },
                  {
                    "kind": "fraction",
                    "top": {
                      "kind": "row",
                      "children": [
                        {
                          "kind": "power",
                          "base": {
                            "kind": "row",
                            "children": [
                              {
                                "kind": "symbol",
                                "text": "a"
                              }
                            ]
                          },
                          "exponent": {
                            "kind": "row",
                            "children": [
                              {
                                "kind": "symbol",
                                "text": "2"
                              }
                            ]
                          }
                        },
                        {
                          "kind": "symbol",
                          "text": "+"
                        },
                        {
                          "kind": "symbol",
                          "text": "b"
                        }
                      ]
                    },
                    "bottom": {
                      "kind": "row",
                      "children": [
                        {
                          "kind": "symbol",
                          "text": "2"
                        }
                      ]
                    }
                  }
                ]
              },
              "text": "Read the prompt assumptions together with this answer."
            }
          ]
        }
      },
      "grading": {
        "symbolTypes": {},
        "scalarProducts": true,
        "implicitArguments": {},
        "nonnegative": [],
        "positive": [],
        "nonzero": [],
        "equalityChain": false
      }
    },
    {
      "id": "projection",
      "type": "equation",
      "title": "Vector projection",
      "prompt": "For real Euclidean vectors $v,w$ with $w\\ne0$, express the orthogonal projection $p$ of $v$ onto the line spanned by $w$.",
      "learningVersion": 1,
      "editor": {
        "palette": [
          {
            "tool": "p",
            "label": "p"
          },
          {
            "tool": "v",
            "label": "v"
          },
          {
            "tool": "w",
            "label": "w"
          }
        ],
        "operations": [
          "=",
          "fraction",
          "⟨",
          "⟩",
          ","
        ],
        "digits": [
          "0",
          "1",
          "2"
        ],
        "initialAnswerVisible": false
      },
      "answers": [
        {
          "kind": "row",
          "children": [
            {
              "kind": "symbol",
              "text": "p"
            },
            {
              "kind": "symbol",
              "text": "="
            },
            {
              "kind": "fraction",
              "top": {
                "kind": "row",
                "children": [
                  {
                    "kind": "symbol",
                    "text": "⟨"
                  },
                  {
                    "kind": "symbol",
                    "text": "v"
                  },
                  {
                    "kind": "symbol",
                    "text": ","
                  },
                  {
                    "kind": "symbol",
                    "text": "w"
                  },
                  {
                    "kind": "symbol",
                    "text": "⟩"
                  }
                ]
              },
              "bottom": {
                "kind": "row",
                "children": [
                  {
                    "kind": "symbol",
                    "text": "⟨"
                  },
                  {
                    "kind": "symbol",
                    "text": "w"
                  },
                  {
                    "kind": "symbol",
                    "text": ","
                  },
                  {
                    "kind": "symbol",
                    "text": "w"
                  },
                  {
                    "kind": "symbol",
                    "text": "⟩"
                  }
                ]
              }
            },
            {
              "kind": "symbol",
              "text": "w"
            }
          ]
        }
      ],
      "explanation": {
        "kind": "proof",
        "proof": {
          "intro": "A small authoring example; not attributed to a lecturer.",
          "steps": [
            {
              "equation": {
                "kind": "row",
                "children": [
                  {
                    "kind": "symbol",
                    "text": "p"
                  },
                  {
                    "kind": "symbol",
                    "text": "="
                  },
                  {
                    "kind": "fraction",
                    "top": {
                      "kind": "row",
                      "children": [
                        {
                          "kind": "symbol",
                          "text": "⟨"
                        },
                        {
                          "kind": "symbol",
                          "text": "v"
                        },
                        {
                          "kind": "symbol",
                          "text": ","
                        },
                        {
                          "kind": "symbol",
                          "text": "w"
                        },
                        {
                          "kind": "symbol",
                          "text": "⟩"
                        }
                      ]
                    },
                    "bottom": {
                      "kind": "row",
                      "children": [
                        {
                          "kind": "symbol",
                          "text": "⟨"
                        },
                        {
                          "kind": "symbol",
                          "text": "w"
                        },
                        {
                          "kind": "symbol",
                          "text": ","
                        },
                        {
                          "kind": "symbol",
                          "text": "w"
                        },
                        {
                          "kind": "symbol",
                          "text": "⟩"
                        }
                      ]
                    }
                  },
                  {
                    "kind": "symbol",
                    "text": "w"
                  }
                ]
              },
              "text": "Read the prompt assumptions together with this answer."
            }
          ]
        }
      },
      "grading": {
        "symbolTypes": {
          "p": "vector",
          "v": "vector",
          "w": "vector"
        },
        "scalarProducts": true,
        "implicitArguments": {},
        "nonnegative": [],
        "positive": [],
        "nonzero": [],
        "equalityChain": false
      }
    },
    {
      "id": "expand-square",
      "type": "equation",
      "title": "A required equality chain",
      "prompt": "For real $a,b$, expand $(a+b)^2$. Include the intermediate product $(a+b)(a+b)$ before the expanded polynomial.",
      "learningVersion": 1,
      "editor": {
        "palette": [
          {
            "tool": "a",
            "label": "a"
          },
          {
            "tool": "b",
            "label": "b"
          }
        ],
        "operations": [
          "=",
          "+",
          "(",
          ")",
          "power",
          "square"
        ],
        "digits": [
          "0",
          "1",
          "2"
        ],
        "initialAnswerVisible": true
      },
      "answers": [
        {
          "kind": "row",
          "children": [
            {
              "kind": "power",
              "base": {
                "kind": "row",
                "children": [
                  {
                    "kind": "row",
                    "children": [
                      {
                        "kind": "symbol",
                        "text": "("
                      },
                      {
                        "kind": "symbol",
                        "text": "a"
                      },
                      {
                        "kind": "symbol",
                        "text": "+"
                      },
                      {
                        "kind": "symbol",
                        "text": "b"
                      },
                      {
                        "kind": "symbol",
                        "text": ")"
                      }
                    ]
                  }
                ]
              },
              "exponent": {
                "kind": "row",
                "children": [
                  {
                    "kind": "symbol",
                    "text": "2"
                  }
                ]
              }
            },
            {
              "kind": "symbol",
              "text": "="
            },
            {
              "kind": "row",
              "children": [
                {
                  "kind": "symbol",
                  "text": "("
                },
                {
                  "kind": "symbol",
                  "text": "a"
                },
                {
                  "kind": "symbol",
                  "text": "+"
                },
                {
                  "kind": "symbol",
                  "text": "b"
                },
                {
                  "kind": "symbol",
                  "text": ")"
                },
                {
                  "kind": "symbol",
                  "text": "("
                },
                {
                  "kind": "symbol",
                  "text": "a"
                },
                {
                  "kind": "symbol",
                  "text": "+"
                },
                {
                  "kind": "symbol",
                  "text": "b"
                },
                {
                  "kind": "symbol",
                  "text": ")"
                }
              ]
            },
            {
              "kind": "symbol",
              "text": "="
            },
            {
              "kind": "row",
              "children": [
                {
                  "kind": "power",
                  "base": {
                    "kind": "row",
                    "children": [
                      {
                        "kind": "symbol",
                        "text": "a"
                      }
                    ]
                  },
                  "exponent": {
                    "kind": "row",
                    "children": [
                      {
                        "kind": "symbol",
                        "text": "2"
                      }
                    ]
                  }
                },
                {
                  "kind": "symbol",
                  "text": "+"
                },
                {
                  "kind": "symbol",
                  "text": "2"
                },
                {
                  "kind": "symbol",
                  "text": "a"
                },
                {
                  "kind": "symbol",
                  "text": "b"
                },
                {
                  "kind": "symbol",
                  "text": "+"
                },
                {
                  "kind": "power",
                  "base": {
                    "kind": "row",
                    "children": [
                      {
                        "kind": "symbol",
                        "text": "b"
                      }
                    ]
                  },
                  "exponent": {
                    "kind": "row",
                    "children": [
                      {
                        "kind": "symbol",
                        "text": "2"
                      }
                    ]
                  }
                }
              ]
            }
          ]
        }
      ],
      "sequence": [
        {
          "kind": "row",
          "children": [
            {
              "kind": "power",
              "base": {
                "kind": "row",
                "children": [
                  {
                    "kind": "row",
                    "children": [
                      {
                        "kind": "symbol",
                        "text": "("
                      },
                      {
                        "kind": "symbol",
                        "text": "a"
                      },
                      {
                        "kind": "symbol",
                        "text": "+"
                      },
                      {
                        "kind": "symbol",
                        "text": "b"
                      },
                      {
                        "kind": "symbol",
                        "text": ")"
                      }
                    ]
                  }
                ]
              },
              "exponent": {
                "kind": "row",
                "children": [
                  {
                    "kind": "symbol",
                    "text": "2"
                  }
                ]
              }
            },
            {
              "kind": "symbol",
              "text": "="
            },
            {
              "kind": "row",
              "children": [
                {
                  "kind": "symbol",
                  "text": "("
                },
                {
                  "kind": "symbol",
                  "text": "a"
                },
                {
                  "kind": "symbol",
                  "text": "+"
                },
                {
                  "kind": "symbol",
                  "text": "b"
                },
                {
                  "kind": "symbol",
                  "text": ")"
                },
                {
                  "kind": "symbol",
                  "text": "("
                },
                {
                  "kind": "symbol",
                  "text": "a"
                },
                {
                  "kind": "symbol",
                  "text": "+"
                },
                {
                  "kind": "symbol",
                  "text": "b"
                },
                {
                  "kind": "symbol",
                  "text": ")"
                }
              ]
            },
            {
              "kind": "symbol",
              "text": "="
            },
            {
              "kind": "row",
              "children": [
                {
                  "kind": "power",
                  "base": {
                    "kind": "row",
                    "children": [
                      {
                        "kind": "symbol",
                        "text": "a"
                      }
                    ]
                  },
                  "exponent": {
                    "kind": "row",
                    "children": [
                      {
                        "kind": "symbol",
                        "text": "2"
                      }
                    ]
                  }
                },
                {
                  "kind": "symbol",
                  "text": "+"
                },
                {
                  "kind": "symbol",
                  "text": "2"
                },
                {
                  "kind": "symbol",
                  "text": "a"
                },
                {
                  "kind": "symbol",
                  "text": "b"
                },
                {
                  "kind": "symbol",
                  "text": "+"
                },
                {
                  "kind": "power",
                  "base": {
                    "kind": "row",
                    "children": [
                      {
                        "kind": "symbol",
                        "text": "b"
                      }
                    ]
                  },
                  "exponent": {
                    "kind": "row",
                    "children": [
                      {
                        "kind": "symbol",
                        "text": "2"
                      }
                    ]
                  }
                }
              ]
            }
          ]
        }
      ],
      "explanation": {
        "kind": "proof",
        "proof": {
          "intro": "A small authoring example; not attributed to a lecturer.",
          "steps": [
            {
              "equation": {
                "kind": "row",
                "children": [
                  {
                    "kind": "power",
                    "base": {
                      "kind": "row",
                      "children": [
                        {
                          "kind": "row",
                          "children": [
                            {
                              "kind": "symbol",
                              "text": "("
                            },
                            {
                              "kind": "symbol",
                              "text": "a"
                            },
                            {
                              "kind": "symbol",
                              "text": "+"
                            },
                            {
                              "kind": "symbol",
                              "text": "b"
                            },
                            {
                              "kind": "symbol",
                              "text": ")"
                            }
                          ]
                        }
                      ]
                    },
                    "exponent": {
                      "kind": "row",
                      "children": [
                        {
                          "kind": "symbol",
                          "text": "2"
                        }
                      ]
                    }
                  },
                  {
                    "kind": "symbol",
                    "text": "="
                  },
                  {
                    "kind": "row",
                    "children": [
                      {
                        "kind": "symbol",
                        "text": "("
                      },
                      {
                        "kind": "symbol",
                        "text": "a"
                      },
                      {
                        "kind": "symbol",
                        "text": "+"
                      },
                      {
                        "kind": "symbol",
                        "text": "b"
                      },
                      {
                        "kind": "symbol",
                        "text": ")"
                      },
                      {
                        "kind": "symbol",
                        "text": "("
                      },
                      {
                        "kind": "symbol",
                        "text": "a"
                      },
                      {
                        "kind": "symbol",
                        "text": "+"
                      },
                      {
                        "kind": "symbol",
                        "text": "b"
                      },
                      {
                        "kind": "symbol",
                        "text": ")"
                      }
                    ]
                  },
                  {
                    "kind": "symbol",
                    "text": "="
                  },
                  {
                    "kind": "row",
                    "children": [
                      {
                        "kind": "power",
                        "base": {
                          "kind": "row",
                          "children": [
                            {
                              "kind": "symbol",
                              "text": "a"
                            }
                          ]
                        },
                        "exponent": {
                          "kind": "row",
                          "children": [
                            {
                              "kind": "symbol",
                              "text": "2"
                            }
                          ]
                        }
                      },
                      {
                        "kind": "symbol",
                        "text": "+"
                      },
                      {
                        "kind": "symbol",
                        "text": "2"
                      },
                      {
                        "kind": "symbol",
                        "text": "a"
                      },
                      {
                        "kind": "symbol",
                        "text": "b"
                      },
                      {
                        "kind": "symbol",
                        "text": "+"
                      },
                      {
                        "kind": "power",
                        "base": {
                          "kind": "row",
                          "children": [
                            {
                              "kind": "symbol",
                              "text": "b"
                            }
                          ]
                        },
                        "exponent": {
                          "kind": "row",
                          "children": [
                            {
                              "kind": "symbol",
                              "text": "2"
                            }
                          ]
                        }
                      }
                    ]
                  }
                ]
              },
              "text": "Read the prompt assumptions together with this answer."
            }
          ]
        }
      },
      "grading": {
        "symbolTypes": {},
        "scalarProducts": true,
        "implicitArguments": {},
        "nonnegative": [],
        "positive": [],
        "nonzero": [],
        "equalityChain": true
      }
    }
  ]
}
