Uniqueness should be enforced for student responses (Student responses appear randomly when grading)
Description
Attachments
is depended on by
is related to
relates to
Activity
Stephen Marquard July 26, 2013 at 3:54 AM
Re-uploaded the attachments on request because they seem to have got nuked. They are also at http://source.cet.uct.ac.za/svn/sakai/scripts/trunk/VULA-1475/

Joshua Swink March 21, 2013 at 2:18 PM
I am in the process of removing duplicates from our database, but the question of what to do when there are multiple non-null SUBMITTEDDATE values remains unresolved. I'm using the sam_clean_duplicate_responses.plsql script as a guide. It doesn't touch the items with multiple non-null submitteddate values. (The sam_clean.sql attachment doesn't download for me - I just get a 0-length file.) What's the recommendation for culling duplicates in this situation?
Stephen Marquard June 4, 2012 at 8:55 AM
Re running in production, yes (well, we did, and no side-effects have surfaced since then).

Cynthia Gast June 4, 2012 at 8:08 AM
Stephen:
Thank you for submitting the MySQL scripts. Are you comfortable that they can be run on Production?
UVa has discovered we need to remove hundreds of duplicate records in order for the 2.8.x unique constraint upgrade script to succeed. We are preparing to upgrade to 2.8.1 (from 2.7.1) in two weeks.
Thanks very much,
Cindy @ UVa
Cynthia Gast
cmw6s@virginia.edu
Stephen Marquard January 26, 2012 at 5:52 AM
For anyone need to remove duplicate records on mysql, attached are the scripts we used, derived from the plsql script (though with some changes).
To execute, at a mysql prompt:
source sam_make_tables.sql
source sam_clean.sql
call sam_clean()
This is a slow operation and depending on the size of SAM_ITEMGRADING_T may need a lot of free disk space in the location used for mysql tmp files (e.g. /tmp).
Problem report: instructor grades an assignment, sees four blank responses for student. Instructor clears cache and reloads and this time sees four different responses from the student as blank. Instructor is confused and loses confidence in system.
Database view: There are two rows in
SAM_ITEMGRADING_T
for each question the student responded to. Display code appears to not expect multiple rows to exist for a student response.Should a unique index exist on the combination of PUBLISHEDITEMID,AGENTID, PUBLISHEDANSWERID,ASSESSMENTGRADINGID?
Query to see if your database has duplicates:
I see hundreds and hundreds of duplicates with this query. There seems to always be a null entry followed by an authentic entry.