ModusOperandi Math Verifier

ModusOperandi Math Verifier · GPT-Aktionen

Math LaTeX Analysis

  • POST /analyse_math/Receive validation of a solved math exercise. Upload an image url with solved maths.
Ursprüngliches API-Schema
{
  "openapi": "3.0.0",
  "info": {
    "title": "Math LaTeX Analysis",
    "version": "1.0.0"
  },
  "servers": [
    {
      "url": "https://api.modusoperandiapi.de"
    }
  ],
  "paths": {
    "/analyse_math/": {
      "post": {
        "operationId": "analyseMath",
        "summary": "Receive validation of a solved math exercise. Upload an image url with solved maths.",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "latex": {
                    "type": "string",
                    "format": "url",
                    "description": "The LaTeX of the math",
                    "example": "\\left. \\begin{array} { l }{ 3 \\cdot 4 ^ { x } + 6 \\cdot 2 ^ { x } = 24 } \\\\ { 3 \\cdot ( 2 ^ { 2 } ) ^ { x } + 6 \\cdot 2 ^ { x } = 24 } \\\\ { 3 \\cdot 2 ^ { 2 x } + 6 \\cdot 2 ^ { x } = 24 } \\\\ { 3 \\cdot ( 2 ^ { x } ) ^ { 2 } + 6 \\cdot 2 ^ { x } = 24 } \\\\ { 3 \\cdot ( t ) ^ { 2 } + 6 \\cdot t = 24 } \\\\ { 3 t ^ { 2 } + 6 t = 24 } \\\\ { 3 t ^ { 2 } + 6 t - 24 = 0 } \\end{array} \\right."
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "latex": {
                      "type": "string",
                      "description": "The generated LaTeX string",
                      "example": "\\left. \\begin{array} { l }{ 3 \\cdot 4 ^ { x } + 6 \\cdot 2 ^ { x } = 24 } \\\\ { 3 \\cdot ( 2 ^ { 2 } ) ^ { x } + 6 \\cdot 2 ^ { x } = 24 } \\\\ { 3 \\cdot 2 ^ { 2 x } + 6 \\cdot 2 ^ { x } = 24 } \\\\ { 3 \\cdot ( 2 ^ { x } ) ^ { 2 } + 6 \\cdot 2 ^ { x } = 24 } \\\\ { 3 \\cdot ( t ) ^ { 2 } + 6 \\cdot t = 24 } \\\\ { 3 t ^ { 2 } + 6 t = 24 } \\\\ { 3 t ^ { 2 } + 6 t - 24 = 0 } \\end{array} \\right."
                    },
                    "analysis_results": {
                      "type": "object",
                      "properties": {
                        "analysed_latex": {
                          "type": "array",
                          "description": "Validated list for every step taken in the math exercise.",
                          "items": {
                            "type": "object",
                            "properties": {
                              "expr": {
                                "type": "string",
                                "description": "The first line of the expression that was sent for analytics in LaTeX format.",
                                "example": "\\( 5 x ^ { 2 } - 125 x  =  0 \\)"
                              },
                              "expr_coloured": {
                                "type": "string",
                                "description": "Will only show up in lines with an error. The analyzed expression in LaTeX format, with specific red colored wrong parts of the line.",
                                "example": ""
                              },
                              "hints": {
                                "type": "array",
                                "description": "List of hints related to the analyzed line of the expression.",
                                "items": {
                                  "type": "string",
                                  "example": "multiplication_rhs_{\\frac{1}{5}}_wrong_{125}_mul_{\\frac{1}{5}}_not_{17}"
                                }
                              },
                              "buzzwords": {
                                "type": "array",
                                "description": "List of buzzwords related to the analyzed line of the expression.",
                                "items": {
                                  "type": "string",
                                  "example": ""
                                }
                              },
                              "confirm": {
                                "type": "string",
                                "description": "Feedback on the verified line of the expression, if it is true, false or a consequential error, based on the previous line.",
                                "example": "true"
                              }
                            }
                          }
                        },
                        "buzzwords": {
                          "type": "array",
                          "description": "List of buzzwords related to the analyzed problem.",
                          "items": {
                            "type": "string",
                            "example": "equation"
                          }
                        },
                        "error": {
                          "type": "string",
                          "description": "Error message if the expression is not valid.",
                          "example": ""
                        },
                        "problem_type": {
                          "type": "string",
                          "description": "The type of the analyzed problem.",
                          "example": "equation"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string",
                      "description": "Description of the error that occurred",
                      "example": "Missing or invalid expression"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string",
                      "description": "Description of the error that occurred",
                      "example": "Invalid ApiKey"
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string",
                      "description": "Description of the error that occurred",
                      "example": "Internal server error occurred"
                    }
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}