Google Classroom API: Upload file to "class drive folder" but ensure only teacher can see it - google-classroom

I am using the Google Classroom API to allow students to take tests using our system and send the overall grades back up. That is all working fine.
What I want to do is to create a spreadsheet of the breakdown of student results from our system and upload that either as a CSV or create a Google Spreadsheet. This spreadsheet should only be visible to the teacher(s) of the course.
Is it possible to create a Google Spreadsheet / Drive file which is only visible to the teacher. I was thinking to put it in the course driveFolder but it's not clear to me what the permissions are of that folder. For example, the entire folder could be shared with students and so obviously I don't want to put the results there as they shouldn't be visible to students.
Another possibility might be to upload it to the teachers own drive account, but, that doesn't seem ideal either.
My absolute preference would be to attach it to the "courseWork" item in some teacher-only-visible way, but, it doesn't look like that's an option.
Anyway, sorry for the slightly wooly question, but, if you're doing something like this and have a suggestion I'd love to hear it.

The property teacherFolder from the course resource refers to:
a DriveFolder that is shared with all teachers of the course.
This folder is created when the course itself is created, and by default it is shared with course teachers but not with students, so I think it would be the perfect place to store the spreadsheet. Storing data that is only shared with teachers is this folder's purpose, anyway.
Update: Prevent editors from changing access permissions:
In order to avoid the risk of a folder being shared, the owner of the folder can prevent editors from changing access permissions and sharing the folder with other accounts. Just click the Share button and, in Advanced options, check the Prevent editors from changing access and adding new people box, as explained here.
Of course, the folder owner can still invite new people and change these settings, so I'd suggest you to transfer ownership to a safe account that you are sure 100% won't try to share this folder with students.
Reference:
Classroom API: Courses
Restrict sharing options on Drive files

Related

open drive picker with a known fileId selected

In my webapp it can happen that a user imported an owned drive file through a copy-pasted link. At that point I already know the fileId from the link, but I need to ask the user to go through the picker in order to make that file available within the app (I'm using drive.file scope only).
I tried using the View.setQuery(string) api, but I'm not sure it can help.
Is it possible to set a query for a specific fileId? Is there some other way to achieve it?

Delete all content on Yammer

We used to use Yammer a while back and now we're getting back on it. Problem is that most people who used it previously have left and the content left over is irrelevant today. Is there a way through an API or something to delete all content and posts on our Yammer network?
Your help is appreciated.
There are APIs which will let you delete messages (https://developer.yammer.com/docs/messagesid), but customers tend to just start using Yammer again. The old content disappears off the bottom. In many cases there are nuggets of info that get turned in up searches later which prove to be useful. if you want additional API help it may be best to open Support Requests with Microsoft for assistance. The main support site is available, but you can open requests through the O365 Admin Portal.
A bit old but still a relevant question. My organisation wanted to do this and the advice from Microsoft Premier support was:
Verified admin can choose to use the "Remove users" option under Network Admin portal. The option of "Permanently remove this user and messages" lets you remove the user and all the messages they posted (*note: This cannot be reversed).
As an alternative, for bulk deletion, the Bulk update feature, data export along with the Rest API endpoints should help achieve this. And before starting to delete the content ensure to set the data retention policy as "Hard Delete".
• For deleting the users/files/messages/notes, use the export files' (messages.csv, files.csv and Pages.csv) which have the API URLs in it which can be called from within a powershell script for example. One will have to format and make a post request through powershell. Herewith I attached an sample script just for your reference.
(it is regarding user deletion but similar call applies)
messages.csv api_url https://developer.yammer.com/docs/messagesid
files.csv file_api_url https://developer.yammer.com/docs/uploaded_filesid
Pages.csv page_api_url https://developer.yammer.com/docs/uploaded_notesid
• For managing and removing yammer users – you could delete the users using bulk update feature.
You could get users list by performing an export: Network Admin > Export Users and Export all users. Then perform a "Bulk Update Users" with the above spreadsheet saved as a .csv file. Note that you'll need two columns in this spreadsheet. The first should be titled 'Action' and the second should be titled 'Email Address' (both without the quotes). Under action, you'll want to put 'Suspend' on every line and you'll have your users' email addresses from step 6 under 'Email Address'.
Go to Network Admin > Bulk Update Users and import that .csv file there (there's a sample Bulk Update file for reference at the page itself – it has more columns than you'll need, so just pay attention to the first two).

Joomla 3.x - how do I have students (we register them) access one area, and public (self registration) another area?

Apologies for what is I suspect an easy question for many - I am very new to Joomla. I am building a website for my wife on Joomla 3.x (Noteworthymusictuition.co.uk). I already have an area for her music students, in which they log in and can access teaching material not available to the public. We register them.
I want to create an area of 'free downloads' for members of the public to self-register and automatically go to an area for them to download material. They need to be able to log in again after registration. To build up a newsletter group, I want to capture the registrations and store them for subsequent emails.
I do struggle to understand the ACL in Joomla, but if I try and set up a registration form for the public to use, I have to enable self registration in the admin and that affects the existing student login.
I hope that's enough detail! I was wondering whether I need an extension to enable multiple levels, such as Access Manager Pro? But on the other hand, what I'm asking for doesn't really sound like rocket science!
Many thanks!
By the way, I have never done any programming in Joomla - apart from occasional HTML editing.
Anthony
If you choose the 'self' registration option that doesn't stop you creating users as you do now. As long as you set the user up correctly they should be able to log in without issue.
New users would have the option to create an account and would be activated via a confirmation email.
You need to create at least one new user group though. For example, a 'download' group which has access to the additional material. Then, if you use a decent component (http://www.joomlatools.com/extensions/docman/ - see access control new tab) you will be able to control access to documents and downloads by specifying which groups are able to see download links etc.
Hope that helps a bit!

Realtime drive javascript example not working - Google API

I set up the Realtime drive example shown here: https://developers.google.com/drive/realtime/realtime-quickstart
On this site: http://shuub.com
But the thing is, that when I access the link from a different browser (logged in a different Google account), it won't load the file.
All I need is to edit some plain text with another user, without needing to access a google account, it doesn't even need to be saved after closing the site. Is it possible?
Thanks for reading.
But the thing is, that when I access the link from a different browser
(logged in a different Google account), it won't load the file.
Probably you need to share the file with the other user first.
Open Google Drive in your Browser. If you did not modify the example code, your file should be located in the root folder. It's probably named "New Realtime Quickstart File". Right-click on the file and share it with the other user by adding his account to the list and granting all permissions.
All I need is to edit some plain text with another user, without
needing to access a google account, it doesn't even need to be saved
after closing the site. Is it possible?
The website you have linked is not reachable so I don't know what you want to do exactly.
Probably you could also use other and (in that use case without saving and login) simpler techniques like Mozillas TogetherJS (you can try it on jsfiddle.net) or you could use a tool like Etherpad.

Sandboxing and security-scoped bookmarks

I'm writing an app which tracks disk usage. For that I let the user select drives (represented as URLs starting with /volume). I save the info using core data. Now I'd like to implement sandboxing and I'm not exactly sure how I'd proceed. There's no out-of-the-box entitlement that gives me access to this path. From what I understand, I'd need to...
Let the user select a specific path (drive) which enables access to those files outside the application directory
In order to make these selected paths persist across app launches, I need to create security-scoped bookmarks.
I think I can save those as NSData in Core Data objects (binary type)
Upon app launch, "resolve" those security scoped bookmarks again to re-gain access.
Does this make sense? Am I missing something here? Any tips/hints you can provide?
Your outline is correct.
To have the user select a drive you can create an NSOpenPanel which starts at /Volumes. You can use a delegate to only allow selection of items within that directory, so even if the user navigates away they won't be able to select anything else. Customise the various messages in the dialog so it becomes a "Select Volume" dialog.
Alternatively you could put up an NSOpenPanel for /Volumes itself - have your user grant you access to that directory. If you do that once and then save a bookmark your user shouldn't be hit by a lot of annoying open dialogs. Once you've got access to /Volumes your app can allow selection of a subset of volumes if it needs to.
Caveat: while gaining access to the whole directory is possible, if you intend to put your app in the App Store you might find that Apple sees you as asking for too much from your users. You might want to start with read-only access to the directory and if they kick that back fall back to selecting individual disks - just be prepared.
You can also store the bookmarks in a plist (within your container) or user defaults, you'll need to decide if those suit better than Core Data.
HTH

Resources