[Building Sakai] Assignment2: Getting userid associated with an attachment

David Wafula davidwaf at gmail.com
Tue Nov 13 00:14:56 PST 2012


hi all,
Any pointers here...the SQL stmt in my earlier post above is not returning
accurate results...i mean, when i run it, the attachment_reference is all
wrong.

Thanks.


On Sun, Nov 11, 2012 at 4:56 PM, David Wafula <davidwaf at gmail.com> wrote:

> Hello all,
> I couldn't figure out how to find a user who submitted an attachment, when
> all i have is an assignmentId.
>
> Assignment2 assign = assignmentLogic.getAssignmentById(assignmentId);
> Using assign.getSubmissionsSet() returns Set<SubmissionAttachment>,
> SubmissionAttachment doesn't seem to have any reference to userid.
>
> In the end, i went direct into DB:
>
> "SELECT ATTACHMENT_REFERENCE,USER_ID "
>                             + "from A2_SUBMISSION_T
> subm,A2_SUBMISSION_ATTACH_T attach "
>                             + "where
> subm.SUBMISSION_ID=attach.SUBMISSION_ATTACH_ID and ASSIGNMENT_ID="+assignId;
>
> Would have preferred to use API .
>
> This is assignment2 1.1-SNAPSHOT in Sakai 2.8.0.
> Thanks
> --
> David Wafula
>



-- 
David Wafula
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://collab.sakaiproject.org/pipermail/sakai-dev/attachments/20121113/d56427ef/attachment.html 


More information about the sakai-dev mailing list