Would it be possible to add an option to remove (clear) all responses from an
ongoing survey ?

something along the lines of

function survey_delete_responses() {
$nid = arg(1);
// Are you sure ?
$res = db_query ("DELETE * from survey_responses where nid = $nid");

}

p

Comments

shane’s picture

I would love to see this as well. It's odd that this wasn't a standard feature out of the gate? It'd be nice to be able to select a bunch of survey responses with check boxes, and then select button that says "delete selected". Also, if viewing an individual survey response, have a single button that says "delete response". Also have a button that says "delete all responses".

This module already rocks! Thanks!

seanr’s picture

Has anyone done this? I think this is a critical need. Unbelievable that it wasn't part of the mdoule from the first version.

Coyote’s picture

Yup. Can't use this module without the ability to delete spurious survey entries or test entries.

tomski’s picture

Component: Code » Documentation

There is a way to delete survey responses by going through mysql. My site is hosted, and I have access to mysql through a phpmyadmin, there I access my database, and then click on the table survey_responses. When I ask to show the responses, you have a list of the responses, the rid number indicates the order in absolute terms. You can ask sql to flush the whole thing or you can select the responses you want to eliminate (the only problem is that beyond the absolute order 1-2-3 etc. I did not find anything else to identify them correctely, but I am not at all a programmer or an expert of mysql, so you may come up with other suggestions). This of course just a temporary turn around, but it can be useful to get rid of the test surveys for example.

wpd’s picture

Component: Documentation » Code

housekeeping: correcting component

bermin’s picture

Well, it is August now. Anyone come up with an ingenious idea how to do this?

baserunner’s picture

this would be very good.

but alternativeley would it be possible to make something like "delete if exported"

So in case you have exported the responses to excel for further treatment, that those responses get deleted in drupal...or at least transfered somehow to a exported table

mcantelon’s picture

Title: delete responses » Patch for purging survey data
Version: master » 4.7.x-1.x-dev
Component: Code » Miscellaneous

I've created a patch, for the Jan 11 version of the survey module, that allows purging of survey data: http://drupal.org/node/116610

geodaniel’s picture

Status: Active » Closed (duplicate)

Marking this as duplicate as there is a recent patch on the other issue