Skip to content
This repository has been archived by the owner on Jun 1, 2024. It is now read-only.

give better message to user after uploading a roster #107

Open
hcientist opened this issue Mar 11, 2024 · 3 comments
Open

give better message to user after uploading a roster #107

hcientist opened this issue Mar 11, 2024 · 3 comments
Assignees

Comments

@hcientist
Copy link
Contributor

hcientist commented Mar 11, 2024

the api endpoint for uploading a CSV roster looks something like below. Right now there's very little feedback to the teacher. Since this response lets them know about 3 categories, it might be nice to display those 3 in a nice way:

  1. existing users that were added to their class
  2. new users created (and added to this class)
  3. invalid (users who were note added to this course, and why)
{
	"users": {
		"invalid": [
			{
				"name": "Bingo Heeler",
				"username": "bheeler",
				"password": "bingo",
				"grade": "6",
				"reason": "Wrong password"
			}
		],
		"existing": [
			{
				"id": 6,
				"username": "bluey",
				"name": "Bluey Heeler",
				"url": "http://localhost:8000/api/users/bluey/",
				"grade": "2",
				"instrument": null,
				"external_id": "",
				"groups": [

				]
			}
		],
		"created": [

		]
	},
	"enrollments": {
		"existing": [
			{
				"id": 9,
				"course": {
					"id": 4,
					"name": "Test NEA Creates",
					"start_date": "2024-03-11",
					"end_date": "2024-05-31",
					"url": "http://localhost:8000/api/courses/test-nea-creates/",
					"slug": "test-nea-creates",
					"owner": {
						"id": 3,
						"username": "demoalden",
						"name": "Alden Snell",
						"url": "http://localhost:8000/api/users/demoalden/",
						"grade": "",
						"instrument": 20,
						"external_id": "",
						"groups": [
							"Teacher"
						]
					}
				},
				"instrument": {
					"id": 18,
					"name": "Oboe",
					"transposition": "Concert Pitch TC"
				},
				"role": "Student",
				"user": {
					"id": 6,
					"username": "bluey",
					"name": "Bluey Heeler",
					"url": "http://localhost:8000/api/users/bluey/",
					"grade": "2",
					"instrument": null,
					"external_id": "",
					"groups": [

					]
				}
			}
		],
		"created": [

		]
	}
}
@hcientist
Copy link
Contributor Author

Suggested approach

  1. run the code locally
  2. upload a starting roster (no errors you know of, novel students)
  3. confirm that many students are enrolled in the course

also test

  1. upload same roster to same course
  2. upload same roster to different course
  3. upload roster with some of those people and some new people?

@hcientist
Copy link
Contributor Author

what if you upload a roster and there's already a user by that <name? username? password?> that has nothing to do with you?

@williamjedrzejczak
Copy link
Contributor

  • have dev tools open (network, console, etc.),
  • will most likely have less things going on when run locally

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants