Is there a way to delete responses from the survey? I don't see one. If not, that would be a useful feature to have.
| Comment | File | Size | Author |
|---|---|---|---|
| #1 | survey_delete_link.patch | 35.46 KB | nachenko |
Is there a way to delete responses from the survey? I don't see one. If not, that would be a useful feature to have.
| Comment | File | Size | Author |
|---|---|---|---|
| #1 | survey_delete_link.patch | 35.46 KB | nachenko |
Comments
Comment #1
nachenko commentedI added this feature. I'm still testing, but it seems it works. You can only delete one by one, from the "responses" menu. I've added a "delete" link.
It's dirty and ugly, but it works.
If you want to give it a try...
Comment #2
nachenko commentedSorry, I'm using Winmerge to create the patch file and this is doing whatever it wants. The patch file is valid but absurd. It's just like Winmerge suddenly thought both files are completely different.
Comment #3
wiredescape commentedFor my first exploration of Modules I thought I'd have a go at the Survey.module to see if I could improve on the delete functionality. I wanted the ability to perform a total purge of all responses or to delete individual responses. Both these delete methods would need to be related to a specific survey.
I started with the two patches that have been provided by mcantelon and nachenko.
My drupal and PHP skills are limited and I'm hoping to get some feedback and suggestions to improve what I have done so far. Help with rolling it into a patch would be great.
---------------------------------------------------------------------------------------
Purge All Responses
2008-Feb-14 update
Now working with no bugs that I can find.
Changes:
-Deletes all survey response records in both the 'survey_responses' and 'survey_fields' tables.
-Checks for and deletes orphan records in both tables. Because Drupal5 does not use database transactions, orphaned records can be created when a specific operation fails during multiple writes or deletes on multiple tables. To compensate for the lack of commit/rollback this function finds and deletes any orphans in either table.
---------------------------
I manually installed the survey_purge.patch by mcantelon. In testing I found that the original
survey_maintenance_purgefunction deleted responses from thesurvey_responsestable but orphaned related records in thesurvey_fieldstable. Trimmed out some redundant code and found that thedb_fetch_objectwas throwing errors that I could not solve. Seems to be 'talk' of problems with this function and PHP+5.2 so replaced it withdb_fetch_array.Is there anything you can suggest to improve the
survey_maintenance_purgefunction?-would like to see "Purge All" as a link on the list response page rather than a separate tab.
-testing?
-?
Plan to wrap it all into one patch.
Tested with Drupal 5.7 and mysql5.2
---------------------------------------------------------------------------------------
Delete Individual Responses
2008-Feb-14 update
Now working with no bugs that I can find.
Changes:
-Deletes survey response records in both the 'survey_responses' and 'survey_fields' tables.
--------------------------------------
Manually installed the survey_delete_link.patch from nachenko. Had to strip out the duplicate code lines. Also found that the original
survey_delete_link.patchfunction did not delete the related records in thesurvey_fieldstable. Added$result = db_query ('DELETE FROM {survey_fields} WHERE rid=%d', $rid);.What does it need?
-testing?
-?
Comment #4
wiredescape commentedTitle change
Comment #5
quicksketchSurvey module is no longer being maintained, use Webform module instead.
---Closing down issue queue of survey module---