---
title: "Import Tex Exercises"
method: POST
path: "/admin/holiday-courses/subchapitres/{sub_chapitre_id}/import-tex-exercises"
tags: ["Admin - Holiday Courses"]
---

# Import Tex Exercises

`POST /admin/holiday-courses/subchapitres/{sub_chapitre_id}/import-tex-exercises`

## Request

- Base URL: `https://api.excellence-ai.com` (the document declares no server; this is the origin it was published from)
- URL: `https://api.excellence-ai.com/admin/holiday-courses/subchapitres/{sub_chapitre_id}/import-tex-exercises`
- Auth: OAuth 2 (password, token URL `api/login`)

Import exercises from LaTeX content using AI to parse, generate solutions and hints.

This endpoint:
1. Uses AI to parse the LaTeX content into structured exercises with difficulty levels
2. For each extracted exercise, generates solutions and hints using AI
3. Creates HolidayCourseExercise documents in the database
4. Links them to the specified sub-chapitre
5. Returns a summary of the import operation

## Path parameters

- `sub_chapitre_id` string, required: The ID of the holiday course sub-chapitre

## Request body

- TexImportRequest: Request model for importing exercises from LaTeX content
  - `tex_content` string, required

## Response `200`

Successful Response

- TexImportResponse: Response model for LaTeX import operation
  - `status` string, required
  - `message` string, required
  - `created_exercises_count` integer
  - `processed_exercises` ProcessedExercise[]
    - `statement` string, required
    - `difficulty` 'easy' | 'medium' | 'hard', required
    - `title` string, nullable
    - `solution` string, required
    - `hints1` string, nullable
    - `hints2` string, nullable
    - `hints3` string, nullable
    - `created_exercise_id` string, required
  - `errors` string[]

## Other responses

- `422`: Validation Error

---

[API](https://skmtc.dev/excellence-ai/apis/excellence-learning.md) - [All operations](https://skmtc.dev/excellence-ai/apis/excellence-learning/llms.txt) - [OpenAPI document](https://skmtc.dev/excellence-ai/apis/excellence-learning/revisions/379e4a57dee8?raw)
