On assessment contains file upload questions, the remove link doesn't work .
From the student view, when you try to remove the uploaded file by clicking remove link, after the remove confirm page, the file still shows on the assessment page. From the database, the record of that intended removed file is still in the DB table, SAM_MEDIA_T.
Steps to reproduce the problem:
1. Create and publish a new assessment with one question of type 'File Upload'
2. As a student, take the assessment and respond to the question by clicking 'Choose File', selecting a file, then clicking 'Upload'.
3. Attempt to remove that file by clicking the 'Remove' link next to the file name, then clicking the 'Remove' button on the confirmation screen. The file should still show when the browser returns you to the question page.
4. Repeat step 3, the browser should take a lot longer to respond. You should eventually get sent back to the question page where the file still persists.
The problem is in AssessmentGradingFacadeQuesries.java,
function removeMediaById(Long mediaId, Long itemGradingId),
There is no commit statement to commit the change. It assumes that auto-commit is true, the change will be auto-committed to the DB when the connection is closed. But this is not always the case.
the fix should be: