{
  "$type": "com.atproto.lexicon.schema",
  "defs": {
    "main": {
      "description": "Final rankings for a completed quiz",
      "key": "tid",
      "record": {
        "properties": {
          "quizBegin": {
            "description": "Reference to the quizBegin record",
            "ref": "com.atproto.repo.strongRef",
            "type": "ref"
          },
          "results": {
            "description": "Ordered list of team results (by ranking)",
            "items": {
              "ref": "#teamResult",
              "type": "ref"
            },
            "maxLength": 100,
            "minLength": 1,
            "type": "array"
          }
        },
        "required": [
          "quizBegin",
          "results"
        ],
        "type": "object"
      },
      "type": "record"
    },
    "teamResult": {
      "description": "A team's final result",
      "properties": {
        "teamScore": {
          "description": "Reference to the team's detailed score record",
          "ref": "com.atproto.repo.strongRef",
          "type": "ref"
        },
        "totalScore": {
          "description": "Team's total score",
          "minimum": 0,
          "type": "integer"
        }
      },
      "required": [
        "teamScore",
        "totalScore"
      ],
      "type": "object"
    }
  },
  "id": "pub.quizzy.quizScore",
  "lexicon": 1
}
