click here for details... Sakai Executive Director Position Search now open
Issue Details (XML | Word | Printable)

Key: SAK-16223
Type: Bug Bug
Status: Closed Closed
Resolution: Fixed
Priority: Critical Critical
Assignee: Zhen Qian
Reporter: Ray Davis
Votes: 0
Watchers: 7
Operations

If you were logged in you would be able to see more operations.
Sakai

Assignments upload parser assumes that a user's display ID and EID are identical

Created: 28-Apr-2009 13:59   Updated: 27-Oct-2009 15:18
Component/s: Assignments
Affects Version/s: 2.5.0, 2.5.2, 2.5.3, 2.5.4, 2.5.5, 2.6.0
Fix Version/s: 2.5.6, 2.6.1, 2.7.0

Time Tracking:
Not Specified

2.6.x Status: Closed
2.5.x Status: Closed
2.4.x Status: None


 Description  « Hide
In our local deployments, when instructors use "Upload All" and a ZIP file to provide comments or feedback to officially enrolled students, those changes never show up.

This is due to a long-standing user-directory integration bug in AssignmentAction's doUpload_all_upload method:

Hashtable submissionTable = new Hashtable();
...
submissionTable.put(users[0].getDisplayId(), new UploadGradeWrapper(....));
...
if (submissionTable.containsKey(userEid)) ...

The code incorrectly assumes that a student's display ID is the same as the student's EID.


 All   Comments   Work Log   Change History   Subversion Commits   git Commits      Sort Order: Ascending order - Click to sort in descending order
Ray Davis added a comment - 28-Apr-2009 14:17
The student's EID is embedded in the downloaded folder name:

"DAVIS, Ray(94853905)/comments.txt"

But the code uses the display ID when setting up the hashtable.

My guess as to the best way to resolve this would be to have the downloaded folder embed the display ID instead:

* The display ID is meant to be more understandable to end users than the EID.
* The student's display ID is shown in the Assignments and Gradebook UIs.
* A visible file structure that's been downloaded to the user's desktop could be considered part of the UI.

Ray Davis added a comment - 28-Apr-2009 16:36
Unfortunately for my suggestion, the encoding and the decoding of the ZIP archive structure aren't centralized in shared code. Instead, the archive is created by the Assignment component (BaseAssignmentService) but parsed in the Assignment web application (AssignmentAction). This isn't ideal from a maintenance point of view, but it also presents a practical issue: for us (and possibly some other schools such as Capetown), the choice of display ID is influenced by ToolManager.getCurrentPlacement(), and this is null in the AssignmentService context.

Stephen Marquard added a comment - 29-Apr-2009 06:28
The context should be available through other means that ToolManager.getCurrentPlacement() however - an assignment is associated with a context. So the service code shouldn't need to depend on a tool placement to work correctly.

Zhen Qian added a comment - 29-Apr-2009 07:41
The getDisplayId() of User class doesn't take any parameter. How should the service/application pass in the context information?

I notice the changes in "SAK-10868 context sensitive methods for retrieving display name". How about adding a function of getDisplayId(String context) into User interface?

It is easier to pass in context information, e.g. from assignment.getContext(), instead of ToolManager.getCurrentPlacement()

Thanks,

- Zhen


Ray Davis added a comment - 29-Apr-2009 09:13
Stephen, to rephrase Zhen's comment, it's true that the AssignmentService code can figure out the correct site context from the assignment object. But the provider code which ends up implementing "user.getDisplayId()" doesn't know from assignment objects, so any translation from assignment-to-context has to be done by Assignment-savvy code.

IMO, handling the URL which downloads the ZIP file of assignments is just as much part of the web layer as handling the URL which uploads the ZIP file, and the request should therefore be going through the Assignments tool with all the usual authorization contexts being set. But I don't know the code well and that may be more refactoring than anyone wants to take on at this time.

It's a shame that there's not better support for pushing and popping site contexts from Sakai services -- PortalSiteHelperImpl ends up basically copying-and-pasting code from ToolComponent to get around the "protected" state of setCurrentPlacement -- but that's *also* more change than anyone likely wants to take on.

Zhen, the only problem with the approach taken by the SAK-10868 Announcement patch is that it depends on a ContextualUserDisplayService being deployed. Still, that may be the most practical option if it's too much hassle to relocate the ZIP download. Locally, UC Berkeley would just have to change our user provider code to implement the new interface.

Zhen Qian added a comment - 29-Apr-2009 20:55
r61515. Checked in Ray's fixes into trunk.

Thanks!

Angela Joyce Henry added a comment - 17-Aug-2009 21:54
QA ENVIRONMENT
Sakai QA Network qa2-us (svn tags/sakai-2.6.0-rc06) using Oracle9i - Built: 07/01/09 09:22 - Sakai sakai-2.6.0-rc06 - Server pomegranate (IE 8.x, XP Home SP3)

QA SUMMARY
As instructor, created assignment
As student, submitted assignment
As instructor:
   ** Downladed All into zip file
   ** Extracted files, added grades and comments
   ** Zipped modified file
   ** Uploaded All back into Sakai

QA RESULT: FAIL - ISSUE NOT CLOSED
Grades were updated, but new comments still could not be found, either by the instructor or the student

Zhen Qian added a comment - 21-Aug-2009 09:35
Angela:

I think your reported upload problem is related to XP. See last comment in SAK-14493:

"Using the Windows XP built-in ZIP functionality (Send To -> Compressed Folder), it matters *where* you create the ZIP. If you create the ZIP from the full folder (bulk_download), the upload will not work (but the grades.csv does work!). If you create the ZIP from the assignment folder (one folder in), it will work correctly."

Could you please try upload again based on above suggestions? Or another OS?

Zhen Qian added a comment - 21-Aug-2009 09:40
merged into 2-6-x in r65983
merged into 2-5-x in r65984