Code Monkey home page Code Monkey logo

autograder's Introduction

Introduction

In fall 2019 Math10A with Prof. Stankova at Berkeley, GSIs need to input the scores of T/F homework questions as well as the midtem/final exams of their student into a gradesheet by hand. This program is designed to do the work semi-automatically.

How to Use

Prepare your gradesheet

Download autograder.py. Put your gradesheet in the same folder as autograder.py and rename it as Gradesheet.xlsx (case sensitive). If your gradesheet is in xls format, you should save it as a xlsx file and use the xlsx one. Also, make sure you write down your section number in cell Q1 (like "Section # 210") in both sheets of Gradesheet.xlsx.

Prepare your data sheet

Suppose we want to upload the T/F questions scores for HW1, HW2, and HW3.

  1. Create a empty xlsx named HW1.xlsx(case sensitive) in the same folder as autograder.py.

  2. On bCourses -> WebWork -> student progress -> HW1, select all the data like below and copy them. Select Data

  3. Select the cell A1 in HW1.xlsx and paste the data there, so that the scores are in column B, the section numbers are in column F, and the SIDs are in column G. Paste Data

  4. Do the same thing for HW2 and HW3.

Run autograder

To run the code, you should have python package openpyxl installed. If not, you can install it by

pip install openpyxl

The code is done in Python 3, but it should also work well in Python 2.7 with some slight changes for grammar issues.

Now you have autograder.py, Gradesheet.xlsx, HW1.xlsx, HW2.xlsx, HW3.xlsx in the same folder. Run

python autograder.py

and you will see something like

************** HW1 **************

reading row: 
575       

Updating cells in Gradesheet...

*** section 2XX ***

updating 1234567890: 9 -> 10, 
updating 1234567891: 6 -> 7, 
updating 1234567892: 9 -> 9, 
updating 1234567894: # WARNING: not in the gradesheet.


HW1 Finished: 3 updated in total.

*** section 2XY ***

updating 2234567890: 0 -> 0,
updating 2234567890: 9 -> 10,

HW1 Finished: 2 updated in total.

The work is done.

How does it work

The program will find the scores and SIDs of the stduents in your sections in HW1.xlsx, take the ceil integer of their socres, find the correct location according to the SID in Gradesheet.xlsx and add this integer score to the existed score there. So it is recommended to run the program after you have input the scores of the handwritten homework.

For Midterms and Final

I also made some naive modification to make the code work for the midterms and finals. To use, you need to instead copy the data in GradeScope, paste it to Mid1.xlsx, and make sure all the emails are in column B and all the scores are in column C.

Also, you need to modify the following code in autograder.py. This should be easy if you know some basic regex replacement.

# for exams only, modify this for your sections
sec1_emails = ['modify this for your sections']  # a list of emails in your first section ("first" mean the first worksheet in the gradesheet), e.g. ['[email protected]', '[email protected]', ...]. You can get the email list on Calcentral, and then apply a regex replacement
sec1_sids = ['modify this for your sections']  # a list of corresponding sid in your first section. sids and emails should match in order. Should be easy to get by a regex replacement "\n" -> ", "
sec2_emails = ['modify this for your sections']  # a list of sid in your second section
sec2_sids = ['modify this for your sections']  # a list of sid in your second section. sids and emails should match in order.
section_No = ['modify this for your sections'] # first and second section number, e.g. [209, 210]


exam = False    # use this when uploading hw grades
# exam = True     # use this when uploading exam grades

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.