Package: assigner
Assignerautomatically creates a number of repositories within a GitLab group (or user).
The repositories represent homework assignments being assigned to a list of students.The repositories are created as private with the instructor (the one runningAssigner) as owner and each student as a Developer.
By doing this, students do not need group permission (which would allow them to see other students’ repos), but instead are given individual permissions on their repositories within the group.The student repositories that are created receive some initial content from some base repo, a link to which must be provided toAssigneras an argument.The list of students is retrieved from either a default YAML file or a specified one. See_config.example.ymlfor an example YAML configuration file.InstallationAssigner can be installed withpip:pip install assigner.(You may need to runpip3 install assignerif your operating system uses python 2 as the default python.)CommandsCheck out thetutorialfor a walkthrough of how to use Assigner’s features!initCreates a new configuration file, interactively prompting for required values.helpWhat it says on the tin.new <assignment>Creates a new base repository for an assignment so that you can add the instructions, sample code, etc.assign <assignment>Creates homework repositories for an assignment for each student in the roster.open <assignment>Adds each student in the roster to their respective homework repositories as Developers so they can pull/commit/push their work.get <assignment> [<path>]Creates a folder for the assignment in the CWD (or<path>, if specified) and clones each students’ repository into subfolders or fetches their changes if their repository is already cloned.commit <assignment> <message> [<path>]Commits changes to files in student repositories located in the CWD or<path>.push <assignment> [<path>]Pushes new commits to student repositories to GitLab.scoreScore student assignments and push grades to Canvas.lock <assignment>Sets each student to Reporter status on their homework repository so they cannot push changes, etc.unlock <assignment>Sets each student to Developer status on their homework repository.archive <assignment>Archives student repositories, disallowing pushes and hiding the repository from the project listing on GitLab.unarchive <assignment>Restores archived student repositories to their previous state.protect <branch>Protect a repo branch (prevent force pushes).unprotect <branch>Unprotect a repo branch.status <assignment>Shows the status of student homework repositories, as well as the last commit author and timestamp for each repository.rosterManages the course roster.canvasLists Canvas courses or imports students from a Canvas course to the roster.import <file> <section>Imports students from a CSV file to the roster.set <key> <value>Sets<key>to<value>in the config.SSHYour GitLab account must have an SSH key set up in order to push the assignment to the students’ repos.Configuration FileAssignerwill create a_config.ymlfile in the current directory that will persist your GitLab private token and other settings.
You can use a different config file by specifying the--configoption.Assignerneeds you to set a few config keys before it will work.
The easiest way to do this is by runningassigner initand entering the information it prompts you for.
Alternatively, you can create yor own, following the template in_config.example.yml.You can change configuration settings by either manually editing the config or through using thesetsubcommand.Importing from Canvas via the Canvas APIThe Canvas API can be used to retrieve the list of students for each course section.
You can use thecanvas listcommand to list your course sections, and make note of the ID of the course you would like to import students from. Then you can use thecanvas importcommand with the appropriate course ID to import the students from the course section into your configuration file.Importing from Joe’SS via CSV fileJoe’SS offers a button to download a table of all the students in a section.
For whatever reason, the developers at Oracle decided that this button should give you an HTML table in a file namedpg.xls(or something like that).
You can download this file, open in LibreOffice (or some other piece of software that tramples your freedom), and save as a.csvfile.
Theimportcommand can read the resulting.csvand import your students’ data for you.Extra HelpIf you are particularly baffled, you can pass the-hor--helpflag to anyAssignercommand for more details on what it offers.
For example,get--helpwill get you help withget.Generating Access TokensGitLab TokenTo generate an access token for GitLab, log onto the GitLab website (e.g.https://git-classes.mst.edu/), and go to yourProfile Settings. Go to theAccess Tokentab, then add a personal access token using the form on the page. Leave the expiry date empty to create a token that never expires, and select theapicheckbox to allow API access using your token. Make sure you copy the generated token, since you won’t be able to retrieve it afterwards.Canvas TokenTo generate an API token for Canvas, log onto your Canvas account (e.g.https://canvas.mst.edu/), and click onAccountat the top left corner of the page, then go toSettings. From there scroll down toApproved Integrationsand click theNew Access Tokenbutton, then use the form to create a new API token. Make sure you copy the generated token, since you won’t be able to retrieve it afterwards.Reporting BugsAssigner tries to be as user-friendly and bug-free as possible.
If you encounter behavior that is confusing, seems wrong, or used to work but doesn’t anymore, pleasefile a bug report.
Please checkCONTRIBUTING.mdto see what info we’d like to see in bug reports and advice on contributing patches if you want to fix or improve things yourself.CreditsTy MorrowMike WiselyNatasha JarusIslam ElnabarawyBilly RhoadesJosh Essman