{"id":25171224,"url":"https://github.com/basemax/quiztestapigo","last_synced_at":"2025-05-05T20:40:38.221Z","repository":{"id":229693816,"uuid":"675021687","full_name":"BaseMax/QuizTestAPIGo","owner":"BaseMax","description":"This project is a Quiz Test RESTful API implemented in Go programming language. It allows users to create quizzes, take quizzes, and view quiz results. The API is designed to be simple, efficient, and easy to use.","archived":false,"fork":false,"pushed_at":"2025-04-22T08:22:41.000Z","size":123,"stargazers_count":3,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-05-04T21:45:49.806Z","etag":null,"topics":["api-quiz","go","go-api","go-mongo","go-mongodb","golang","mongo","mongodb","quiz-api","quizapp","restful"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/BaseMax.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-08-05T14:13:33.000Z","updated_at":"2025-04-22T08:22:39.000Z","dependencies_parsed_at":"2024-06-19T11:24:35.211Z","dependency_job_id":"fb041c42-2a14-45c8-9eac-8d3d1cb7086f","html_url":"https://github.com/BaseMax/QuizTestAPIGo","commit_stats":null,"previous_names":["basemax/quiztestapigo"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BaseMax%2FQuizTestAPIGo","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BaseMax%2FQuizTestAPIGo/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BaseMax%2FQuizTestAPIGo/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BaseMax%2FQuizTestAPIGo/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/BaseMax","download_url":"https://codeload.github.com/BaseMax/QuizTestAPIGo/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252572851,"owners_count":21770099,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["api-quiz","go","go-api","go-mongo","go-mongodb","golang","mongo","mongodb","quiz-api","quizapp","restful"],"created_at":"2025-02-09T09:19:36.752Z","updated_at":"2025-05-05T20:40:38.201Z","avatar_url":"https://github.com/BaseMax.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Quiz Test RESTful API in Go\n\nThis project is a Quiz Test RESTful API implemented in Go programming language. It allows users to create quizzes, take quizzes, and view quiz results. The API is designed to be simple, efficient, and easy to use.\n\n## Getting Started\n\nTo get started with the Quiz Test RESTful API, follow the instructions below:\n\n- Go programming language (version 1.15 or higher)\n- MongoDB (Make sure it's installed and running on your system)\n\n## Installation\n\nClone this repository to your local machine.\n\n```bash\ngit clone https://github.com/BaseMax/QuizTestAPIGo.git\n```\n\nChange into the project directory.\n\n```bash\ncd QuizTestAPIGo\n```\n\nInstall the required dependencies.\n```bash\ngo get ./...\n```\n\nRename the `.env.example` file to `.env` and update the configuration with your MongoDB connection details and any other required settings.\n\n## Running the API\n\nTo run the API server, execute the following command:\n\n```go\ngo run main.go\n```\n\nBy default, the server will run on localhost:8080.\n\n## API Endpoints\n\nThe following endpoints are available in the Quiz Test API:\n\n- **POST** `/api/quizzes` - Create a new quiz.\n- **GET** `/api/quizzes/{id}` - Retrieve a specific quiz by ID.\n- **GET** `/api/quizzes` - Retrieve all quizzes.\n- **PUT** `/api/quizzes/{id}` - Update an existing quiz by ID.\n- **DELETE** `/api/quizzes/{id}` - Delete a quiz by ID.\n- **POST** `/api/quizzes/{id}/questions` - Add a new question to a specific quiz by ID.\n- **PUT** `/api/quizzes/{id}/questions/{questionID}` - Update a question within a specific quiz by ID and question ID.\n- **DELETE** `/api/quizzes/{id}/questions/{questionID}` - Delete a question within a specific quiz by ID and question ID.\n- **GET** `/api/quizzes/{id}/questions` - Retrieve all questions for a specific quiz by ID.\n- **POST** `/api/quizzes/{id}/submit` - Submit a quiz with answers.\n- **GET** `/api/results/{id}` - Retrieve the result of a submitted quiz by ID.\n- **GET** `/api/results` - Retrieve all submitted quiz results.\n- **GET** `/api/quizzes/{id}/results` - Retrieve all submitted results for a specific quiz by ID.\n- **POST** `/api/questions` - Create a new question.\n- **GET** `/api/questions/{id}` - Retrieve a specific question by ID.\n- **GET** `/api/questions` - Retrieve all questions.\n- **PUT** `/api/questions/{id}` - Update an existing question by ID.\n- **DELETE** `/api/questions/{id}` - Delete a question by ID.\n- **POST** `/api/questions/{id}/options` - Add a new option to a specific question by ID.\n- **PUT** `/api/questions/{id}/options/{optionID}` - Update an option within a specific question by ID and option ID.\n- **DELETE** `/api/questions/{id}/options/{optionID}` - Delete an option within a specific question by ID and option ID.\n- **GET** `/api/quizzes/{id}/questions/{questionID}` - Retrieve a specific question within a quiz by its ID.\n- **GET** `/api/quizzes/{id}/questions/{questionID}/options` - Retrieve all options for a specific question within a quiz by its ID.\n- **GET** `/api/quizzes/{id}/questions/{questionID}/options/{optionID}` - Retrieve a specific option for a specific question within a quiz by its ID and option ID.\n- **PUT** `/api/quizzes/{id}/questions/{questionID}/options/{optionID}` - Update an option within a specific question within a quiz by its ID and option ID.\n- **DELETE** `/api/quizzes/{id}/questions/{questionID}/options/{optionID}` - Delete an option within a specific question within a quiz by its ID and option ID.\n- **POST** `/api/results` - Submit quiz answers and get the result instantly (without storing the submission).\n- **GET** `/api/quizzes/{id}/results/statistics` - Retrieve statistics for a specific quiz, such as the number of times it has been taken and the average score.\n- **GET** `/api/quizzes/{id}/questions/random` - Retrieve a random question from a specific quiz.\n\n## API Documentation\n\nFor detailed information on each endpoint and their usage, you can access the API documentation through the following URL after running the server:\n\n```bash\nhttp://localhost:8080/swagger/index.html\n```\n\n## Database Structure\n\n```sql\nCREATE TABLE quizzes (\n    id INT PRIMARY KEY AUTO_INCREMENT,\n    title VARCHAR(255) NOT NULL,\n    description TEXT,\n    created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP,\n    updated_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP\n);\n\nCREATE TABLE questions (\n    id INT PRIMARY KEY AUTO_INCREMENT,\n    quiz_id INT NOT NULL,\n    question_text TEXT NOT NULL,\n    created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP,\n    updated_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,\n    FOREIGN KEY (quiz_id) REFERENCES quizzes (id) ON DELETE CASCADE\n);\n\nCREATE TABLE options (\n    id INT PRIMARY KEY AUTO_INCREMENT,\n    question_id INT NOT NULL,\n    option_text TEXT NOT NULL,\n    is_correct BOOLEAN DEFAULT FALSE,\n    created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP,\n    updated_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,\n    FOREIGN KEY (question_id) REFERENCES questions (id) ON DELETE CASCADE\n);\n\nCREATE TABLE participants (\n    id INT PRIMARY KEY AUTO_INCREMENT,\n    name VARCHAR(255) NOT NULL,\n    email VARCHAR(255) NOT NULL,\n    created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP,\n    updated_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP\n);\n\nCREATE TABLE quiz_results (\n    id INT PRIMARY KEY AUTO_INCREMENT,\n    quiz_id INT NOT NULL,\n    participant_id INT NOT NULL,\n    score INT NOT NULL,\n    submitted_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP,\n    FOREIGN KEY (quiz_id) REFERENCES quizzes (id) ON DELETE CASCADE,\n    FOREIGN KEY (participant_id) REFERENCES participants (id) ON DELETE CASCADE\n);\n\nCREATE TABLE quiz_result_details (\n    id INT PRIMARY KEY AUTO_INCREMENT,\n    quiz_result_id INT NOT NULL,\n    question_id INT NOT NULL,\n    selected_option_id INT NOT NULL,\n    FOREIGN KEY (quiz_result_id) REFERENCES quiz_results (id) ON DELETE CASCADE,\n    FOREIGN KEY (question_id) REFERENCES questions (id) ON DELETE CASCADE,\n    FOREIGN KEY (selected_option_id) REFERENCES options (id) ON DELETE CASCADE\n);\n```\n\n## Contributing\n\nContributions to this project are welcome. If you find any bugs or have any new features to add, feel free to submit a pull request. Please ensure that your changes follow the coding conventions and include appropriate tests.\n\n## License\n\nThis project is licensed under the GPL-3.0 License.\n\nCopyright 2023, Max Base\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbasemax%2Fquiztestapigo","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbasemax%2Fquiztestapigo","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbasemax%2Fquiztestapigo/lists"}