@talway
The URL you provided is incorrectly formed. I'm going to hope that's just a typo. The page2 should be page=2, except that the number varies and should be obtained from the next Link header that is returned when you make the API call. It should not be hard-coded into the URL. The per_page=100 is commonly found as Canvas normally defaults to only 10 results; it's an attempt to reduce the amount of pagination.
We have a similar setup, including the use of a quiz as the checkpoint assignment. It doesn't matter whether it's a quiz or an assignment. You still use the submissions API and the assignment ID, not the quiz ID.
I don't use PowerShell, but the line you're asking about doesn't have anything to do with PowerShell.
I also limit the call so that it only returns the students who have a graded quiz. Actually, I get it once with graded and once with submitted, I never get the notice about submitted showing up. I think I put that in there in case there was a delay with the grading -- but that delay just doesn't happen much if at all in the years we've been using this.
Then we remove the enrollment from the course once they have completed the orientation. This keeps the list of submissions short and quicker to obtain. Another option that is available now, but I don't remember it being available when we started, was the graded_since parameter. It allows you to get just the recent changes. Still, we don't want the students to be left in the orientation, we move them to a student resources / FAQ course that is the same without the quizzes.
Here is some documentation from the API.
My request looks something like this (line breaks supplied for readability). Replace ${variable_name} by however you do variables in PowerShell
/api/v1/courses/${course_id}/students/submissions
?student_ids[]=all
&assignment_ids[]=${assignment_id}
&workflow_state=graded
&per_page=25
I use per_page=25 because we run this every 20 minutes and so there are rarely more than a couple and I have pagination set up to handle if there are. You can specify per_page=100, but the requests feel like they take longer with 100 specified, even if there are still only just a couple to fetch.
One note about the pagination on the multiple assignment endpoint -- it does not use the page= parameter at all. It uses a bookmark, so you'll really need to follow the next link header -- or take actions (like we do with removing the accounts) to make sure that your list of students is always less than the per_page setting (which maxes at 100 for many/most things, so don't think you can get around it by specifying 1000 or some other arbitrarily large number). If the pagination issue still confuses you, you might start with this thread from Canvas Developers group: Handling Pagination
This discussion post is outdated and has been archived. Please use the Community question forums and official documentation for the most current and accurate information.