Attaching Documents to an Assignment

Topics: Developer Forum
Nov 14, 2007 at 4:02 PM
We are currently trying out the SLK within our classrooms. Beacuse most of the work done by students is in office documents, the main complaint I am getting is the lack of ability to attach these documents to the assignment.

No problem I think.......

I have started to amend the Lobby.aspx & Lobby.aspx.cs to enable attachments.

My intended solution is to create a customise list containing 3 fields:

Title, AssignmentID & LearnerAssignmentID.

When a file is attached to an assignment an entry in the customised list is created with the attachment(s) stored against it.

So far so good.

I have been able to upload attachments to the assignment. When you the learner looks at the assigment they see a list of their attachments and can click on them to display them.

I now want to provide a delete attachment function. This is where I have got stuck.

When I add the attachments to the assignment to be displayed, I have also included a linkbutton which when clicked should delete the attachment. Unfortunately the click event is never reached.

Is anyone able to give me some advice?

Can provide source code or more detail if necessary....
Coordinator
Nov 14, 2007 at 8:21 PM
This sounds very interesting, Drooke. It also sounds very similar to Use any file as an assignment, do you agree? If so, do you want to take ownership of that work item?

I don't have the bandwidth to look at the source code right now, but if you provide a patch others may be able to take a look.


drooke wrote:
We are currently trying out the SLK within our classrooms. Beacuse most of the work done by students is in office documents, the main complaint I am getting is the lack of ability to attach these documents to the assignment.

No problem I think.......

I have started to amend the Lobby.aspx & Lobby.aspx.cs to enable attachments.

My intended solution is to create a customise list containing 3 fields:

Title, AssignmentID & LearnerAssignmentID.

When a file is attached to an assignment an entry in the customised list is created with the attachment(s) stored against it.

So far so good.

I have been able to upload attachments to the assignment. When you the learner looks at the assigment they see a list of their attachments and can click on them to display them.

I now want to provide a delete attachment function. This is where I have got stuck.

When I add the attachments to the assignment to be displayed, I have also included a linkbutton which when clicked should delete the attachment. Unfortunately the click event is never reached.

Is anyone able to give me some advice?

Can provide source code or more detail if necessary....

Nov 14, 2007 at 9:19 PM
Sure. I am willing to take control.

Will leave the attachment deleting for the time being.

If anyone has any requests/ideas please let me know, and I will see if I can accomodate.
Nov 20, 2007 at 1:31 PM
Hi Jay,

What would be the best way to provide a "Patch"?
Coordinator
Nov 21, 2007 at 11:17 AM
I've written down step by step instructions in Checking In.



drooke wrote:
Hi Jay,

What would be the best way to provide a "Patch"?

Nov 21, 2007 at 2:12 PM
Thanks....
I have followed the instructions.... But...

When I run "cpc makepatch ." I get the following Exception

Unhandled exception:
System.UnauthorizedAccessException: Access to the path 'C:\Dev\SLK' is denied.
at System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath)
at System.IO.FileStream.Init(String path, FileMode mode, FileAccess access, Int32 rights, Boolean useRights, FileShare share, Int32 bufferSize, FileOptions options, SECURITY_ATTRIBUTES secAttrs, String msgPath, Boolean bFromProxy)
at System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access, FileShare share, Int32 bufferSize, FileOptions options)
at System.IO.StreamWriter.CreateFile(String path, Boolean append)
at System.IO.StreamWriter..ctor(String path, Boolean append, Encoding encoding, Int32 bufferSize)
at System.IO.StreamWriter..ctor(String path, Boolean append, Encoding encoding)
at System.IO.File.WriteAllText(String path, String contents, Encoding encoding)
at CodePlex.TfsLibrary.Utility.FileSystem.WriteAllText(String path, String contents)
at CodePlex.CodePlexClientLibrary.MakePatchPresenter.MakePatch(String directory, String patchFilename)
at CodePlex.CodePlexClientLibrary.MakePatchCommand.Execute()
at CodePlex.CodePlexClientLibrary.ApplicationBase`1.Run(DependencyContainer container)
at CodePlex.CodePlexClientLibrary.ApplicationBase`1.Run()

Have check the permissions and "Everyone" has full access.

What have I done wrong?
Nov 21, 2007 at 2:49 PM
Have had some help and corrected what I did wrong. Have now uploaded the patch.

Many thanks for your help.
Jun 18, 2008 at 10:52 PM
Hey, Drooke. I tried to apply patch with Tortoise and cpc. Neither of them worked. On top of which changeset is the patch applied? or is there the whole source code of your revision available?