Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Enhancement] Accept autograder.io group JSON format #11

Open
aposp opened this issue Feb 12, 2021 · 2 comments
Open

[Enhancement] Accept autograder.io group JSON format #11

aposp opened this issue Feb 12, 2021 · 2 comments

Comments

@aposp
Copy link

aposp commented Feb 12, 2021

autograder.io stores its groups in the following format (an array of dicts each with a member_names array of emails):

[
  {
    "pk": #,
    "project": 908,
    "extended_due_date": null,
    "member_names": [
      "[email protected]",
      "[email protected]"
    ],
    "members": [
      {
        "pk": #,
        "username": "[email protected]",
        "first_name": "Student",
        "last_name": "One",
        "email": "",
        "is_superuser": false
      },
      {
        "pk": #,
        "username": "[email protected]",
        "first_name": "Student",
        "last_name": "Two",
        "email": "",
        "is_superuser": false
      }
    ],
    "bonus_submissions_remaining": 0,
    "late_days_used": {},
    "num_submissions": 2,
    "num_submits_towards_limit": 0,
    "created_at": "2021-02-08T22:07:44.864043Z",
    "last_modified": "2021-02-08T22:07:44.863853Z"
  },
  {
    "pk": #,
    "project": 908,
    "extended_due_date": null,
    "member_names": [
      "[email protected]"
    ],
    "members": [
      {
        "pk": #,
        "username": "[email protected]",
        "first_name": "Student",
        "last_name": "Three",
        "email": "",
        "is_superuser": false
      }
    ],
    "bonus_submissions_remaining": 0,
    "late_days_used": {},
    "num_submissions": 2,
    "num_submits_towards_limit": 2,
    "created_at": "2021-02-11T16:53:11.332152Z",
    "last_modified": "2021-02-11T16:53:11.331933Z"
  }
]

This is incompatible with the queue's group upload format. Considering the autograder doesn't actually expose this info (you have to go to the dev console and open up the HTTP requests) it's probably more likely for the queue to accept a new format.

@CarsonHoffman
Copy link
Owner

CarsonHoffman commented Feb 12, 2021

Is the use-case here to directly connect the Autograder to the queue (i.e. does it have some outgoing webhook-type system?), or is there a third-party pulling the data from the Autograder and uploading it to the queue? I ask because I think the easiest solution in the latter case would be to use jq (or something similar) to transform the data:

$ cat example_data.json | jq '[.[] | .member_names]'
[
  [
    "[email protected]",
    "[email protected]"
  ],
  [
    "[email protected]"
  ]
]

@aposp
Copy link
Author

aposp commented Feb 12, 2021

The latter - 280 has the Project Czar manually move the groups over.

Didn't know about jq, that's much easier than the python program I just started writing. The easiest solution is to just add this command to the Project Czar handbook for the staff member to use. Knowing this I don't see this issue as high priority.

On the other hand, 280 is not the only course to use this queue and autograder.io, so I still think there's benefit to adding this compatibility in the long-term.

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

No branches or pull requests

2 participants