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

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 runs from .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 subpath modulename.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!

Department of Mathematics, Purdue University
150 N. University Street, West Lafayette, IN 47907-2067
Phone: (765) 494-1901 - FAX: (765) 494-0548
Contact the Webmaster for technical and content concerns about this webpage.
Copyright© 2018, Purdue University, all rights reserved.
West Lafayette, IN 47907 USA, 765-494-4600
An equal access/equal opportunity university
Accessibility issues? Contact the Web Editor (webeditor@math.purdue.edu).