From cdc44a1bfbb91a4c62f46f6d0618b87edbb8fba0 Mon Sep 17 00:00:00 2001 From: Patrick Donelan Date: Tue, 9 Jun 2009 03:26:24 +0000 Subject: [PATCH] Made Survey Preview a little less brutal --- lib/WebGUI/Asset/Wobject/Survey.pm | 6 +++--- www/extras/wobject/Survey/editsurvey/object.js | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/WebGUI/Asset/Wobject/Survey.pm b/lib/WebGUI/Asset/Wobject/Survey.pm index 9f1ed3a99..1199880df 100644 --- a/lib/WebGUI/Asset/Wobject/Survey.pm +++ b/lib/WebGUI/Asset/Wobject/Survey.pm @@ -791,7 +791,7 @@ point. This is useful for user-testing large Survey instances where you don't wa to waste your time clicking through all of the initial questions to get to the one you want to look at. -Note that calling this method will delete any existing survey responses for the +Note that calling this method will delete any in-progress survey responses for the current user (although only survey builders can call this method so that shouldn't be a problem). @@ -811,8 +811,8 @@ sub www_jumpTo { $self->session->log->debug("www_jumpTo: $id"); - # Remove existing responses for current user - $self->session->db->write( 'delete from Survey_response where assetId = ? and userId = ?', + # Remove any in-progress responses for current user + $self->session->db->write( 'delete from Survey_response where assetId = ? and userId = ? and isComplete = 0', [ $self->getId, $self->session->user->userId() ] ); # Break the $id down into sIndex and qIndex diff --git a/www/extras/wobject/Survey/editsurvey/object.js b/www/extras/wobject/Survey/editsurvey/object.js index 152a7d588..af896db70 100644 --- a/www/extras/wobject/Survey/editsurvey/object.js +++ b/www/extras/wobject/Survey/editsurvey/object.js @@ -108,7 +108,7 @@ Survey.ObjectTemplate = (function(){ alert('Sorry, preview is only supported for Sections and Questions, not Answers'); } else { - var msg = 'This will delete any Survey responses you have made under this ' + + var msg = 'This will delete any in-progress Survey responses you have made under this ' + 'user account and redirect you to the Take Survey page starting at the selected item. ' + "\n\nAre you sure you want to continue?"; if (confirm(msg)) {