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

[Feature Request] Google Classroom Support #85

Closed
IronKane2 opened this issue Sep 6, 2018 · 21 comments
Closed

[Feature Request] Google Classroom Support #85

IronKane2 opened this issue Sep 6, 2018 · 21 comments
Assignees

Comments

@IronKane2
Copy link

I was hoping/wondering if there is any plan to include Classroom in the suite?

@scrthq
Copy link
Member

scrthq commented Sep 6, 2018

hey @IronKane2 - I can definitely add it in! I don't have Classroom personally, so it hasn't been on my radar.

What would be some of your most-wanted Classroom features to manage with PSGSuite so I can focus on those first?

@scrthq scrthq self-assigned this Sep 6, 2018
@scrthq
Copy link
Member

scrthq commented Sep 6, 2018

Here's the REST API documentation to give you an example of what's available: https://developers.google.com/classroom/reference/rest/

@IronKane2
Copy link
Author

I'll refer to the GAM page https://github.com/jay0lee/GAM/wiki/Managing-Google-Classroom
But managing courses and participants. Being able to replicate our rosters from our SIS database as I'm already doing (now with PSGSuite!) for account creation, will make me a star at our district.

@scrthq
Copy link
Member

scrthq commented Sep 6, 2018

I got you covered! I'll keep you updated here on progress. Busy next few days but should be able to hopefully get you course and participant functionality by the end of the weekend!

@scrthq scrthq changed the title Google Classroom [Feature Request] Google Classroom Support Sep 6, 2018
@scrthq
Copy link
Member

scrthq commented Sep 10, 2018

@IronKane2 - alright, the Classroom API is kinda large, lol. Started work on it tonight once I had a second, but it may take a bit to deploy something useful. I'll keep you updated though!

@IronKane2
Copy link
Author

Thanks for your hard work

@scrthq
Copy link
Member

scrthq commented Sep 21, 2018

@IronKane2 - Progress, slowly but surely! Classroom Course management functions done, you can follow along with the progress here: https://github.com/scrthq/PSGSuite/tree/feature/add_Classroom_support/PSGSuite/Public/Classroom

If at any point you want to test any of the functions added, you can clone the repo at that branch and import the module directly from there:

git clone -b feature/add_Classroom_support git@github.com:scrthq/PSGSuite.git
Set-Location PSGSuite
Import-Module .\PSGSuite\PSGSuite.psd1 -Force

Current functions added:

  • Get-GSClassroomCourse
  • New-GSClassroomCourse
  • Remove-GSClassroomCourse
  • Update-GSClassroomCourse

@scrthq
Copy link
Member

scrthq commented Sep 24, 2018

Update to functions created:

  • Add-GSCourseParticipant
  • Get-GSClassroomUserProfile
  • Get-GSCourse
  • Get-GSCourseAlias
  • Get-GSCourseParticipant
  • New-GSCourse
  • New-GSCourseAlias
  • Remove-GSCourse
  • Remove-GSCourseAlias
  • Remove-GSCourseParticipant
  • Update-GSCourse

Just need to wrap up invitation and guardian functions then should be good to publish. Going to estimate 2.14.0 will be published by mid-week with the Classroom functions.

Disclaimer: I currently do not have access to a G Suite Education account, so these functions are somewhat untested in real life. I'm working on getting access to a G Suite Education account for testing, but nothing tangible quite yet. Once published, any feedback you have on these would be greatly appreciated! Please do some small scale testing with any of the functions you plan on using once it's released and let me know if everything works as expected or if you hit any odd errors. The wiki should also be updated with the function help contents for each if you want to check it out now.

@IronKane2
Copy link
Author

This is great news. I'll be happy to give feedback.

@scrthq
Copy link
Member

scrthq commented Sep 28, 2018

@IronKane2:

  • Deploying v2.14.0 now!
    • Added Google Classroom support with the following functions:
      • Add-GSCourseParticipant
      • Confirm-GSCourseInvitation
      • Get-GSClassroomUserProfile
      • Get-GSCourse
      • Get-GSCourseAlias
      • Get-GSCourseInvitation
      • Get-GSCourseParticipant
      • Get-GSStudentGuardian
      • Get-GSStudentGuardianInvitation
      • New-GSCourse
      • New-GSCourseAlias
      • New-GSCourseInvitation
      • New-GSStudentGuardianInvitation
      • Remove-GSCourse
      • Remove-GSCourseAlias
      • Remove-GSCourseInvitation
      • Remove-GSCourseParticipant
      • Remove-GSStudentGuardian
      • Update-GSCourse

@scrthq
Copy link
Member

scrthq commented Sep 28, 2018

The only items missing from the Classroom API are:

  • Announcements (let me know if you need/want this)
  • CourseWork (same)
  • Registrations (this appears to need Cloud Pub/Sub, so no current plans to add this, but let me know if this is something useful)

Aside from that, there should pretty much be feature parity with GAM outside of sync functions (planning to add those later via a single catch-all Invoke-GSSync function to allow synchronization between groups, OU's, Classroom students, etc).

@IronKane2
Copy link
Author

Thanks again for your hard work. I've updated the module, but when I execute get-gscourse I get this:
New-GoogleService : Cannot find an overload for "ClassroomService" and the argument count: "1".
At line:64 char:20

  •     $service = New-GoogleService @serviceParams
    
  •                ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    
    • CategoryInfo : InvalidOperation: (:) [New-GoogleService], MethodException
    • FullyQualifiedErrorId : ConstructorInvokedThrowException,New-GoogleService

get-gscourse : You cannot call a method on a null-valued expression.
At line:1 char:1

  • get-gscourse
  •   + CategoryInfo          : NotSpecified: (:) [Write-Error], WriteErrorException
      + FullyQualifiedErrorId : Microsoft.PowerShell.Commands.WriteErrorException,Get-GSCourse
    
    

Is there something more that I needed to do before using the new cmdlets?

@scrthq
Copy link
Member

scrthq commented Oct 1, 2018

so the really odd part about that one is that I was getting that too intermittently while developing it. The Classroom service is the only one that I've seen that with.

I'll check it out and see if I can figure out why it's doing that, but you should be able to get past it by closing out any PowerShell sessions you have then reopening. In certain situations, I needed a full reboot tbh. Really strange considering it would only throw that error sometimes.

@scrthq scrthq reopened this Oct 1, 2018
@IronKane2
Copy link
Author

IronKane2 commented Oct 1, 2018

I tried the full reboot. Here's the current error:

Get-GSCourse : Exception calling "Execute" with "0" argument(s): "Object reference not set to an instance of an object."
At line:1 char:1
+ Get-GSCourse
+ ~~~~~~~~~~~~
    + CategoryInfo          : NotSpecified: (:) [Write-Error], WriteErrorException
    + FullyQualifiedErrorId : Microsoft.PowerShell.Commands.WriteErrorException,Get-GSCourse

@scrthq
Copy link
Member

scrthq commented Oct 1, 2018

can you try Get-GSCourse -CourseStates ACTIVE?

@scrthq
Copy link
Member

scrthq commented Oct 1, 2018

Also worth noting that the Initial Setup docs have been updated with Classroom specific info, in case you haven't enabled the Classroom API for your Developers Console project and/or updated the scopes for your API Client

Scopes to add: https://github.com/scrthq/PSGSuite/wiki/Initial-Setup#adding-api-client-access-in-admin-console

@IronKane2
Copy link
Author

Thanks, the information about updating Initial Setup did the trick.

@scrthq
Copy link
Member

scrthq commented Oct 1, 2018

awesome! so I'm assuming you're getting data back? any ongoing issues if so? let me know!

@scrthq scrthq added the bug label Oct 1, 2018
@IronKane2
Copy link
Author

I execute this --> Get-GSCourseParticipant -CourseId 16451869665
and get this -->
Add-Member : Cannot add a member with the name "CourseId" because a member with that name already exists. To overwrite the member anyway, add the Force parameter to your command.
At line:136 char:60

  • ... .Teachers | Add-Member -MemberType NoteProperty -Name CourseId -Value ...
  •             ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    
    • CategoryInfo : InvalidOperation: (Google.Apis.Classroom.v1.Data.Teacher:PSObject) [Add-Member], InvalidOperationException
    • FullyQualifiedErrorId : MemberAlreadyExists,Microsoft.PowerShell.Commands.AddMemberCommand

Why "Add-Member"? I was just looking for a list.

@scrthq scrthq changed the title [Feature Request] Google Classroom Support [Bugs] Google Classroom Function Issues Oct 1, 2018
@scrthq
Copy link
Member

scrthq commented Oct 1, 2018

@IronKane2 Using Add-Member is handy for some list functions that don't return some key properties back with the results (listing group members is a prime example of this), so I tend to use Add-Member to ensure that certain properties accompany the results so if you decide to list participants for multiple course ID's, you'd be able to identify which course each participant belonged to from the resulting array of participants.

That all being said, it's obvious that it's not needed in this case, so I'll get that pulled out ASAP!

Thanks for the feedback, keep it coming! 😄

@scrthq scrthq changed the title [Bugs] Google Classroom Function Issues [Feature Request] Google Classroom Support Oct 2, 2018
@scrthq scrthq removed the bug label Oct 2, 2018
@scrthq
Copy link
Member

scrthq commented Oct 2, 2018

FYI @IronKane2 - Opened up Issue #87 to track these bug fixes since support for Google Classroom functions was already rolled out

@scrthq scrthq closed this as completed Oct 2, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants