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

Make contrib/groups/* safer and more well-documented #34

Open
2 of 4 tasks
sshine opened this issue Sep 20, 2017 · 2 comments
Open
2 of 4 tasks

Make contrib/groups/* safer and more well-documented #34

sshine opened this issue Sep 20, 2017 · 2 comments
Assignees

Comments

@sshine
Copy link
Contributor

sshine commented Sep 20, 2017

  • The documentation for contrib/groups/create-groups.py isn't accurate wrt. number of arguments.

  • check-groups.py should assert that the group.txts it finds are actually plaintext files and not RTF documents or pictures of kittens.

  • create-groups.py fails when two individuals both upload a group.txt that put them in the same group:

      (staffeli) ~/Courses/ap17/ap-e2017-grading $ create-groups.py subs/1/ 'Assignment 1 Groups' subs/1/groups.txt    
      Traceback (most recent call last):
        File "/home/simon/Courses/ap17/staffeli/contrib/groups/create-groups.py", line 62, in <module>
          sys.exit(create(*sys.argv[1:]))
        File "/home/simon/Courses/ap17/staffeli/contrib/groups/create-groups.py", line 51, in create
          assert len(subpaths) == 1
      AssertionError
    

    Either the documentation should be clear about what to when check-groups.py fails in various ways, or the script should handle the situation gracefully, e.g. by detecting that groups (abc123 def456) and (def456 abc123) are the same and only create one group for them.

  • It would be neat if the script had a "dry run" parameter that doesn't create groups but fetches the ones that are created and performs the filesystem operations with them. Currently this isn't possible because canvas.create_group() (used here) both creates a group on Canvas and returns the group's properties. If there were a canvas.get_groups(), that'd be neat.

@sshine sshine self-assigned this Sep 20, 2017
@sshine sshine changed the title Make contrib/groups/* more safer and more well-documented Make contrib/groups/* safer and more well-documented Sep 20, 2017
@sshine
Copy link
Contributor Author

sshine commented Sep 20, 2017

Actually, these tools should probably be polished and re-incorporated into the staffeli tool.

Why not, @oleks and @nqpz?

sshine added a commit that referenced this issue Sep 29, 2017
- Turn this into a library (`if __name__ == "__main__"`).
- Script still assumes that groups were not created on Canvas. If they were from a previous run, comment out the call to create_groups_on_canvas(). I don't think it actually creates those groups a second time, but running takes a bit longer since it makes an API call for each group it creates. Trying to create groups that already exist and are partly or wholly filled is a bug, though.
- Throw with an informative message when multiple directories match a KU ID. Reasons could be: 'subs/' given when 'subs/N/' expected.
- Throw with an informative message when two group members both upload files. This could be handled more gracefully by creating a group directory and symlink both submissions into it, rather than symlink the group directory directly to one of the submissions.
- Filter empty submission directories based on their content (.staffeli.yml, group.txt) rather than their file count. This fixes a bug where the 'silent' partner uploads a group.txt for good measure and this script thinks there are two submitters.
@sshine
Copy link
Contributor Author

sshine commented Sep 29, 2017

See comments for previous commit. create-groups.py should work again for this tutorial. I'll improve further on it in my attempt to make it a part of the staffeli tool, which is currently my third-priority.

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

1 participant