/oauth-grade

Announce private personal grading that can be accessed through a Google account

Primary LanguageJavaScriptMIT LicenseMIT

OAuth Grade

Announce private personal grading that can be accessed through a Google account

screenshot

Usage

  1. Nav to Google API Console and acquire an OAuth 2.0 client ID
  • Only auth/userinfo.email scope is mandatory
  1. Rename src/credential.example.js to src/credential.js with the following content
export default {
  GOOGLE_CLIENT_ID: "Client ID from step1",
  GOOGLE_CLIENT_SECRET: "Client secret from step1",
  SESSION_SECRET: "Secret to store sessions",
};
  1. Rename src/config.example.js to src/config.js with the following content
export default {
  title: "The title of the website",
  grade_path: "The path to the CSV file to read which stores the scores",
  google_callback_url: "https://{your_domain}/auth/google/callback",
};
  1. Make sure the CSV file is in the path mentioned above. And the format should be (without spacing)
student_id,      score_title1, score_title2,...
[leave blank],   percentage1,  percentage2,...
your_student_id, score1,       score2...
  1. Install and launch the application
npm install
npm start

Or via docker-compose

docker-compose up -d --build

The compose script will mount two volumes. One is for the persistent sessions after the restart. The other is for storing grades to read.
You can update scores without restarting the application.

License

  • MIT
  • Author: Yung-Hsiang Hu @ 2022