Spaces:
Sleeping
Sleeping
Download example_big_project/question_objective.txt from DhyandevP/CodeEvaluator: direct link, hf CLI and curl.
- Browser
- Download file 985 Bytes
-
https://huggingface.co/spaces/DhyandevP/CodeEvaluator/resolve/main/example_big_project/question_objective.txt
- Command line
-
hf download hf://spaces/DhyandevP/CodeEvaluator/example_big_project/question_objective.txt
-
curl -L -o question_objective.txt https://huggingface.co/spaces/DhyandevP/CodeEvaluator/resolve/main/example_big_project/question_objective.txt
985 Bytes
| Problem: Build a Flask REST API for managing a Task List (To-Do list). The project must be structured across multiple files. | |
| Input: HTTP JSON requests to the following endpoints: | |
| - GET /tasks : Retrieve all tasks. | |
| - POST /tasks : Create a new task. Request body should be JSON: {"title": "Task title", "description": "Task description"}. | |
| - PUT /tasks/<task_id>/complete : Mark a task as completed. | |
| Output: JSON responses containing the task objects and appropriate HTTP status codes (200 for success, 201 for creation, 400 for bad request, 404 for not found). | |
| Constraints: The application must use a modular structure (e.g., separate routing and business logic into different files like `main.py` and `utils.py`). Data can be stored in-memory using a Python list or dictionary. | |
| Edge Cases to Check: | |
| 1. Missing "title" in the POST request body (must return 400 Bad Request). | |
| 2. Attempting to complete a task (PUT) with an invalid or non-existent `task_id` (must return 404 Not Found). | |