Gradebook Worksheet
The Story So Far
On Friday, you began your gradebook - working to be able to import or export the data from a given format, to a robust 3NF SQL database.
Today you are going to create an interface so that people - you or others - can get the data they need without having to write queries of their own.
Part 1
You should finish Part 1 before starting on part 2.
Part 2
Graded Assignment: Create (and upload a
.zip
of) an executable module folder which can:
- Edit your student data:
- Import data from a provided filename csv, appending to the file
- Export data to a provided filename csv
- Delete data from files by a list of student IDs
- Change a specific student attribute by student id, attribute name, and new value; printing a confirmation message if successful, or error if the student/column does not exist
- Edit your student gradebook:
- Import data from a provided filename csv, updating the rows if they exist
- Export data to a provided filename csv
- Perform Calculations:
- Compute Student Grade in A,A-,... by (studentid, course name):
- 30% HW, 30% Quiz, 40% Exam.
- On the Purdue standard scale
- Printing the value to the console
- Compute Course Grades: as 1 table by (course name):
- export table (studentid, letter grade)
- 30% HW, 30% Quiz, 40% Exam.
- On the Purdue standard scale
- Printing the values to the console
- Compute Student GPA by student_id, printing to the console
- Compute Student Grade in A,A-,... by (studentid, course name):
Try to do as much as you can reasonably do within SQL, especially aggregating rows; However, don't be afraid to do the final arithmetic or comparison in python - the point is that these tools are more powerful when used together.
Your module directory should contain four files:
- a
gradebook.py
file containing all the called functionality, and a testing__main__
block.
Don't worry too much about tests on the database functions - they can be cumbersome to write, and this is just an exercise.
Feel free to do them if you want, but I won't be grading them. - an
__init__.py
file which runsfrom .gradebook import *
(this doesn't have an effect on the inside of the module, but allows you to import these functions from your module directly in other code instead of from the subpathmodulename.gradebook
.) - a
__main__.py
file which imports your tools from.gradebook
, parses the input, and passes it to the appropriate command and output.
Note the relative filepath import which starts with a .
- this allows python files to reference files in the same directory, instead of using the Python path search.
When you are done, zip
up your directory and upload it. Note that python
can actually execute .zip
files as modules!