This Pull request covers the tasks mentioned in application.md:
Add missing APIs mentioned here and get the automated tests to pass
GET /principal/assignments
GET /principal/teachers
POST /principal/assignments/grade
Add tests for grading API
Added Decorator and Sever test cases.
Please be aware that intentional bugs have been incorporated into the application, leading to test failures. Kindly address and rectify these issues as part of the assignment.
Rectify bugs and make code running.
All tests should pass
Get the test coverage to 94% or above
There are certain SQL tests present inside tests/SQL/. You have to write SQL in following files:
count_grade_A_assignments_by_teacher_with_max_grading.sql
-- Write query to find the number of grade A's given by the teacher who has graded the most assignments
SELECT COUNT(*) AS count_grade_a
FROM assignments AS assg
JOIN teachers AS t ON assg.teacher_id = t.id
WHERE assg.grade = 'A'
GROUP BY t.id
ORDER BY count_grade_a DESC
LIMIT 1;
number_of_graded_assignments_for_each_student.sql
-- Write query to get number of graded assignments for each student:
SELECT student_id, COUNT(*) AS num_graded_assignments
FROM assignments
WHERE state = 'GRADED'
GROUP BY student_id;
Optionally, Dockerize your application by creating a Dockerfile and a docker-compose.yml file, providing clear documentation on building and running the application with Docker, to stand out in your submission
FROM python:3.10
## Set the FLASK_APP environment variable
ENV FLASK_APP=core/server.py
ENV FLASK_RUN_HOST=0.0.0.0
WORKDIR /app
COPY requirements.txt .
RUN pip install --no-cache-dir -r requirements.txt
## Remove the core/store.sqlite3 file
RUN rm -f core/store.sqlite3
## Run the Flask db upgrade command
RUN flask db upgrade -d core/migrations/
COPY . .
EXPOSE 5000
CMD ["bash", "run.sh"]
This Pull request covers the tasks mentioned in application.md:
Add missing APIs mentioned here and get the automated tests to pass
Add tests for grading API Added Decorator and Sever test cases.
Please be aware that intentional bugs have been incorporated into the application, leading to test failures. Kindly address and rectify these issues as part of the assignment. Rectify bugs and make code running.
All tests should pass
number_of_graded_assignments_for_each_student.sql
Run following command to build
Once the build is complete, start the Docker container using the following command
Go to localhost:5000 for seeing running app.