NickA02 / SOTestingEnv

This project aims to create a web-based coding platform specifically tailored for Science Olympiad programming events.
2 stars 0 forks source link

Serving Questions and Docs Files Backend #37

Closed NickA02 closed 2 weeks ago

NickA02 commented 2 weeks ago

Overview

This PR is all about how we are modeling our questions and documentation -- from their representation in our modeling, to our chosen file structure and naming conventions. You can see more fine details in the ReadMe, but I am also putting them below the Time Authentication region for your easy access. Also note: We implemented Markdown instead of HTML for ease of writing but that can be updated back easily!

Questions

We chose to package all document handling between the frontend and the backend into one API Request -- /questions/questions In the future, there may be a need to be more granular, but for now the MVP will send a QuestionsPublic model that holds both global documentation and a list of question models to the front end (The question models have their own documentation as well.)

Time Authentication

This API request is protected by a check to assure the team is accessing the questions within their time slot.

Important ReadMe info for this branch:

ES File Structure and Question formatting

General File Structure

The general ES file structure should maintained in the following format, and any deviation may cause some backend components to break:

es_files/
├─ questions/
│ ├─ q1/
│ │ ├─ prompt.md
│ │ ├─ doc_<title>.md
│ │ ├─ test_cases.py
│ │ ├─ demo_case.py
│ ├─ q2/
│ ├─ q3/
├─ teams/
│ ├─ unique_words_reset.csv
│ ├─ teams.csv
├─ global_docs/
│ ├─ <title>.md

teams Subdirectory Information

The teams subdirectory holds all data for interacting with the Team tables in the database. As of now, there are two important files:

File Description
teams.csv File containing a snapshot of the Team table in the database.
unique_words_reset.csv File containing a list of gradeschool level words for password generation

questions Subdirectory Information

The questions Subdirectory holds information for the test, where it's subdirectories, following the convention q#, represent questions and contain all relevant files.

File Description
prompt.md This Markdown file holds the question body.
doc_<title>.md Markdown files with the prefix doc_ are question specific/supplemental documentation.
test_cases.py This python file is for final submission grading by the ES.
demo_cases.py This python file is for validation testing by the students.

global_docs Subdirectoy Information

The global_docs subdirectory holds all documentation made available regardless of question. All Markdown file in this directory will be made available for reference during test time.