cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
wayne_smith
Community Member

Distribute Individual Files to Students Privately?

Jump to solution

Colleagues,

I'd like to distribute some personalized information to each student at the end of the semester.  Right now, it's just a customized analysis of each student's performance.  This year, I'd like to add a blockcert (e.g., Learning Machines) too, probably a JSON file with some metadata.

Is there a relatively easy way via Canvas to distribute *individual, unique* files to a student?  Each file needs to be private and confidential to each student.  My responses and comments to assignments are unique and private (such as in SpeedGrader), but the rest of Canvas is generally set up to distribute the same files to all students (and publicly).

I've used non-Canvas SMTP in the past, but frankly, that's a legacy approach and increasingly difficult (or occasionally unreliable) due to anti-SPAM interventions on both the part of the student and/or SMTP provider.  I could use a simple private-key method and use that unique key as the password to a .pdf file, but that doesn't seem like the solution either (for various reasons).

I'm generally comfortable with the Canvas API, so I can use that approach too.

Has anyone else done this, or have any ideas?

Best,

Wayne

1 Solution

Eleanor,

My solution is just to write a small script in R that accesses the current Canvas data in r, combines it with the student's email address, and send each individual student's .pdf individuals (with short breaks so as to not set off any SPAM tripwires).

Canvas' efforts appear to be in other directions.

Best,

Wayne

View solution in original post

19 Replies
kona
Community Coach
Community Coach

 @wayne_smith , greetings! A low-tech way to do this would be to just create an assignment - worth zero points - and then go to Speedgrader and upload the file for each student in the Comment area. Or, you could even just message this information to each student through email. As for a high-tech way to do this, I'm sharing this with the Canvas Developers‌ group to see if they can help provide some suggestions.

Kona

Kona,

I have five classes each semester. The largest is 160 students. Where in the API is the endpoint for uploading a file (or even uploading a response emulating SpeedGrader) for a single student?

Wayne

 @wayne_smith ,

The Submissions Comments API allows you to upload a file in preparation for attaching it to a submission comment. The comment itself is created using the Grade or comment on a submission endpoint of the Submissions API. That workflow mimics the behavior of leaving a submission comment with an attachment within SpeedGrader.

James
Community Champion

You may also be able to use the grade or comment on multiple submissions endpoint. I haven't used it myself, but it looks like the file_ids for the attachments are keyed to the student_id, so you could do the most, if not all, of the entire class at one time.

James,

And in the intervening step of uploading a file that will ultimately be attached to a Submission or Assignment, that file isn't visible to any other students, right?

Wayne

0 Kudos

I have not tested this, but I believe that to be correct. It is accomplishing the same thing that SpeedGrader submission comment does and when I upload a file there, I cannot find that file in my files and submission comment attachments do not show up in the student's files either. There is no reason to suspect that it would be accessible to other students ever or even the student it's intended for until you attach the message, and lots of reasons to expect that it will not be.

The POST that starts the upload contains the user_id that the file belongs to.

POST /api/v1/courses/:course_id/assignments/:assignment_id/submissions/:user_id/comments/files

That makes it sound like from the very get-go, you're specifying who the recipient is going to be.

The only reason I'm not 100% certain is because the documentation is a little fuzzy. The submission API says if you want to submit a comment, then as that student and references self as the user_id. Most non-admin types do not have permissions to masquerade as a user. I tried starting the process and used the user_id of a student. I didn't finish the process to find out.

Kona,

Ok. Thanks for your help. Now I'm in cost-benefit land. Doing this via SMTP is less than 20 scripting lines, and 1/3 of that is handling SMTP Authentication.

Again, thanks.

Wayne

0 Kudos

I'm not sure, but I'm guessing  @James ‌ might know!

0 Kudos
James
Community Champion

Wayne seems to have a pretty good handle on things. It is a lot of extra work and is something I've thought about doing in the past, but my classes where I was going to do it had 3 to 10 students and it was easier to send individual messages than write code to do it.

Some general comments.

  • People often try to force Canvas to do things when it's easier another way. Communication inside Canvas was one area they were considering overhauling when I talked with some of the product managers back in April 2017 and admittedly it is one of the more challenging areas
  • SMTP goes to your email, where other people may have access and you cannot tell for sure that a student has received a message. Libraries exist for doing this and the code will be much smaller and the development time will be much less.
  • A submission comment goes into Canvas, where students have to login, but I'm still amazed how many students think it's okay to share their login information with their family, friends, or significant other, so it's probably no more secure than email. Making it a submission comment keeps it inside the LMS and allows for students to respond. That creates a trail and makes it easier to organize as it's associated with a course and an assignment. Submission comments get sent out to students as a notification, and for most people that includes email and that includes the attachment. There's still no guarantee that they've read it since that might happen in email. There are clues all over Canvas that the feedback is available, so it has a higher likelihood of getting read (unless your students don't check their submission comments, which is more common than people think).
0 Kudos

James,

Yes. All excellent comments. I think a summative, detailed performance narrative (areas of success and achievement, but also, areas of improvement beyond what's just in the GradeBook) might go into Canvas (via API automation), but for the longer term (especially for BlockChain-based, granular certifications) something outside of legacy Canvas (but perhaps not double-legacy email) may be the best architecture.

Thanks to all. I wish I could attend an Instructure-con and discuss this roadmap with others, but, alas, that is likely not possible for me in the short-term.

Again, thanks.

Wayne

Wayne, if you made any progress on this since your last message I'd be extremely interested to hear about it. I had pretty much the exact same question as you (but all I want to distribute is the personalized performance information via a PDF), and my search took me to this post. 

My solution right now involves mail merging links to files on a Google Drive to get around the problems involved in sending and receiving attachments, which works but I don't love it. And my classes are getting ever bigger, so I hate doing anything by hand!

Thanks,

Eleanor

0 Kudos

Eleanor,

My solution is just to write a small script in R that accesses the current Canvas data in r, combines it with the student's email address, and send each individual student's .pdf individuals (with short breaks so as to not set off any SPAM tripwires).

Canvas' efforts appear to be in other directions.

Best,

Wayne

Thanks for your reply Wayne. I use R to generate my students' reports so I will probably also work towards automating the emails in R rather than integrating with Canvas.

I did discover the existence of the rcanvas package which seems like it would make interacting with APIs easier, so leaving the link here in case it's of use to anyone else reading this thread. Personally, I am going to abandon this line of thought for now, in the acceptance that I am supposed to be teaching this semester rather than learning to be a web developer.

Thanks again

Eleanor

0 Kudos

James,

Ok. So it would appear that the process of submitting a file or two to each student, even if there are multiple steps involving the Submissions Comments, can indeed be fully automated. Is that correct?

Wayne

0 Kudos

Yes, it can be automated.

The file_ids[] is an array, so you can attach more than one file to a submission comment through the API.

0 Kudos

Wayne, could you please give more details on how to automate the process? Thank you!

0 Kudos

GD,

I haven't automated it yet, but I've thought through the pseudocode a bit. I think I'll have to use Python (even if I control it via R with Reticulate). I can automated uploading multiple files, but I'm not sure how to set the permissions or directories--it has to work for 160 a section and the file for each student I generate has specific, detailed score and grade information. I can't afford to get it wrong.

So, no. I haven't done it yet, and now, Canvas hasn't helped (other than changing the APIs---sigh).

Wayne

0 Kudos

This worked brilliantly, thanks for the suggestion!

0 Kudos
TJ_Syr_EDU
New Member

Ended up at this link looking for uploading per student private documents to an LMS. But I guess we are still in the legacy-email solution land, eh?

Below is the email solution I have used. Just in case if it helps anyone else. For a small-medium class this works ok. But for 300+ students, I would prefer to have the files uploaded to their LMS.

===============

  • All the files to be sent were placed in single new folder, with nothing else in it.
  • Then, all the files corresponding to a student were renamed with their campus email handle and an "_" appended to the front of the filenames.
    • There are Excel-VBA solutions to do this.
  • After that, this following VBA code was run from MS-Word (could be done via MS-Excel/etc.)
Public Sub SendFilesFromFolder()

  Dim Files As VBA.Collection
  Dim File As Scripting.File
  Dim Mail As Outlook.MailItem
  Dim Atts As Outlook.Attachments
  
  m_Send = "......\Project-Grades\PerEachStudentPDFs"
  
  Dim Folder As Scripting.Folder
  Dim Fso As Scripting.FileSystemObject
  Dim Files2Search As Scripting.Files
  Dim List As VBA.Collection
  
  Set List = New VBA.Collection
  Set Fso = New Scripting.FileSystemObject
  Set Folder = Fso.GetFolder(m_Send)
  Set Files2Search = Folder.Files
  
  For Each File In Files2Search
    If (File.Attributes Or Hidden) <> File.Attributes Then
      List.Add File
    End If
  Next
  
  Set Files = List
  
  'Set Files = GetFiles
  If Files.Count Then
    For Each File In Files
      Set Mail = Application.CreateItem(olMailItem)
      With Mail
        .Display
      End With
        MySig = Mail.HTMLBody
        With Mail
        .Attachments.Add File.Path
        .To = Left(File.Name, InStr(1, File.Name, "_") - 1) & "@abc.edu" 
        .Subject = "Course XYZ  : Project Grade"  
        .HTMLBody = "<p style=""font-family: Calibri, sans-serif; font-size:105%;"">" & _
        		"Attached is the electronic copy of the grade details for your " & _
				"XYZ Semester Project. " & "<br>" _
				& "<br> </p>" & MySig
        .Display
        End With
        Set Mail = Nothing
    Next
  End If
  
End Sub
0 Kudos