[Using Sakai] Assignment attachments

Zhen Qian zqian at umich.edu
Mon Oct 19 20:39:12 PDT 2009


Sean:

My comments below:

On Mon, 19 Oct 2009 21:21:55 -0400, Sean Keesler
<sean.keesler at threecanoes.com> wrote:
> I have a question about the workings of Resources and assignments.
> 
> I know of an implementation that for some reason seems to have a lot
> of "lost" assignment submissions. Reportedly, the students are getting
> their receipts, but faculty are often not able to find the files. The
> IT group has taken a shine to going into Admin Workspace and using the
> Resources tool to drill down through the "attachments > {Class Name} >
> Assignments > {Name of file} > {Name of file}" to seek out these
> "missing assignments'.
> 
> Ignoring the fact that this shouldn't be necessary at all....

Assignments tool, along with many other tools (e.g. Announcement,
Syllabus), uses FilePicker and hence the addAttachmentResource() function
of ContentHostingService for uploading attachment resources. 

You can check BaseContentService for the implementation of the above
function. Basically the routine will create the attachment folder and
insert attachment at proper place. Every attachment added will get a unique
parent folder, with the url structure similar to the following:

/attachment/9e8b3ef2-0e5c-4aa0-9289-dd18079b3b56/Syllabus/e94d2485-4089-4eb3-b3a3-71568b0c614c/

In order to make attachment file lookup more easier, human-readable folder
names have been assigned to the folders, so the above folder path will look
like:

/attachment/SITE_NAME/Syllabus/ATTACHMENT_FILE_NAME/ATTACHMENT_FILE_NAME

This is just an interpretation of the attachment path. However, I don't
know why the last containing folder's display name should be as same as the
actual file name. Or whether this extra folder is necessary at all as you
suggested above.

> 
> There is one class that doesn't seem to have a folder in the
> "attachments" section of resources, even though students have turned
> in assignments in that class with file attachments.
> 
> Is that pretty normal? How is that supposed to work?

Has the site ever been renamed in the past and student submitted assignment
attachment when the site was still using the old name? According to the
addAttachmentResource, the "site title" section for the attachment url was
created with site name at that time, see below:

                ....
                String siteCollection = ATTACHMENTS_COLLECTION + siteId +
Entity.SEPARATOR;
		try
		{
			checkCollection(siteCollection);
		}
		catch (Exception e)
		{
			// add this collection
			ContentCollectionEdit siteEdit = addCollection(siteCollection);
			try
			{
				String siteTitle = m_siteService.getSite(site).getTitle();
				siteEdit.getPropertiesEdit().addProperty(ResourceProperties.PROP_DISPLAY_NAME,
siteTitle);
			}
			catch (Exception e1)
			{
				siteEdit.getPropertiesEdit().addProperty(ResourceProperties.PROP_DISPLAY_NAME,
site);
			}
			commitCollection(siteEdit);
		}
...

Thanks,

- Zhen


More information about the sakai-user mailing list