{"id":13305836,"url":"https://github.com/berkeley-cdss/grade-uploader","last_synced_at":"2026-02-04T12:07:58.419Z","repository":{"id":30797506,"uuid":"34354567","full_name":"berkeley-cdss/grade-uploader","owner":"berkeley-cdss","description":"Tool to easily upload CSV grades to canvas","archived":false,"fork":false,"pushed_at":"2017-05-15T21:59:09.000Z","size":20,"stargazers_count":1,"open_issues_count":5,"forks_count":0,"subscribers_count":5,"default_branch":"master","last_synced_at":"2024-08-07T06:51:31.338Z","etag":null,"topics":["canvas","csv","gradescope","javascript"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/berkeley-cdss.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2015-04-21T22:04:10.000Z","updated_at":"2024-08-07T06:51:31.338Z","dependencies_parsed_at":"2022-08-29T06:51:52.959Z","dependency_job_id":null,"html_url":"https://github.com/berkeley-cdss/grade-uploader","commit_stats":null,"previous_names":["berkeley-cdss/grade-uploader"],"tags_count":null,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/berkeley-cdss%2Fgrade-uploader","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/berkeley-cdss%2Fgrade-uploader/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/berkeley-cdss%2Fgrade-uploader/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/berkeley-cdss%2Fgrade-uploader/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/berkeley-cdss","download_url":"https://codeload.github.com/berkeley-cdss/grade-uploader/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":242868472,"owners_count":20198484,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["canvas","csv","gradescope","javascript"],"created_at":"2024-07-29T17:54:36.654Z","updated_at":"2026-02-04T12:07:58.413Z","avatar_url":"https://github.com/berkeley-cdss.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Canvas Grade Uploader\n\nA simple tool to handle grade uploading to [Canvas], a learning management system.\n\n[Canvas]: http://instructure.com\n\n## Installation\nThe grade uploader works well as a command line tool. If you're using it this way be sure to use the `-g` option:\n\n```\nnpm install -g canvas-grade-uploader\n```\n\n## Usage\nThere are two use cases:\n\n1. Command line tool:\n\t```\n\t$ grade-uploader\n\tusage: grade-uploader [-h] [-v] -c COURSE_ID -a ASSIGNMENT_ID -f FILE [-u URL] -t TOKEN [-uid {\"\",sis_login_id,sis_user_id}]\n\t```\n\t```\n\t$ grade-uploader -t ABCED...123 -c 1268501 -a 7148451 -f ~/Desktop/Midterm_scores.csv\n\t```\n\t* When using the command line, you can optionally define `CANVAS_TOKEN` in your environment. This will be used if no `-t` option is provided.\n\t* e.g. `export CANVAS_TOKEN='ABCEDF...'`\n\n2. As a module:\n\t```\n\tvar postGrades = require('canvas-grade-uploader');\n\n\tpostGrades(options, data, callback); // See below for options\n\t```\n\n**NOTE** The module interface is currently a work in progress. Breaking changes to this interface will be semver-minor, at least until it's fully stable.\n\n## Configuration\nThe grade uploader uploads grades to a specific Canvas assignment. To do this a few details are required. The command line help will walk you through most of them.\n\nCanvas assignment and course IDs are easily obtained from the URL of the assignments page.\n\nFor example:\n\n```\nhttps://bcourses.berkeley.edu/courses/1268501/assignments/7148451\n```\n\n* URL: `https://bcourses.berkeley.edu/`\n* Course ID: `1268501`\n* Assignment ID: `7148451`\n\n### Getting a Canvas Token\nCanvas authenticates users with OAuth Tokens. You can generate a token for yourself by visiting your personal settings page. There is Canvas [documentation][docs] about generating your own token.\n\nThe short version is: Visit this page.\n`https:/\u003ccanvas-instance\u003e/profile/settings`\n\n[docs]: https://guides.instructure.com/m/4214/l/40399-how-do-i-obtain-an-api-access-token-for-an-account\n\n## CSV Format\nThis tool was built to speed up working with [Gradescope](https://gradescope.com)\n\nThe CSV file requires the following values:\n\n* \"SID\" -- This is the unique user ID for each student.\n* \"Total Score\" -- This is the score that each user will receive.\n* Optional \"Name\" -- The name column currently isn't used, but might be for debugging in the future. (Really, it's much much nicer to deal with names over IDs when possible.)\n\n## Default Values\nCurrently, there are a couple default values which as \"Berkeley-specific\". If this tool gets enough use, I'll gladly change them…\n\n* URL, `-u` defaults to: `https://bcourses.berkeley.edu`\n* User ID format, `-sid` defaults to: `sis_user_id`. This parameter controls how Canvas interprets user IDs. See [this][sid-id].\n\n(In the future, I'd consider supporting some means of having user-default parameters, so please submit a PR if you'd like!)\n\n[sid-id]: http://bjc.link/canvassisid\n\n## Programatic Options and Callback Formats\nUsing this as a module requires 3 parameters:\n\n* `options`: A JS object, with keys that mirror the command line arguments. _Note_: in this form, the only defaults that are applied are the CSV column names. The file parameter is not required.\n\t```\n\t{\n\t  course_id: '1268501',\n\t  assignment_id: '7148451',\n\t  url: 'https://bcourses.berkeley.edu/',\n\t  token: '\u003ctoken\u003e',\n\t  user_id_format: 'sis_user_id'\n\t}\n\t```\n* `data`: This is the CSV data, as a string.\n* `callback`: This is called with a string, updating the progress of uploading grades. Note that it will be called quite a few times in the process uploading grades.\n\t* **WARNING** This will be updated to have a signature like `(err, resp)` very soon.\n\n\n## Tips\n* If you want to test things, use `http://\u003cdomain\u003e.beta.instructure.com/`\n\t* Instructure's beta instances have a separate DB that is supposed to be purged and refreshed every few weeks.\n\t* (This only applies if you're using a hosted Canvas instance.)\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fberkeley-cdss%2Fgrade-uploader","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fberkeley-cdss%2Fgrade-uploader","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fberkeley-cdss%2Fgrade-uploader/lists"}