View Issue Details

This bug affects 1 person(s).
 6
IDProjectCategoryView StatusLast Update
04953Bug reportsConditionspublic2011-05-04 19:48
Reporterc_schmitz Assigned Tolemeur  
PrioritynormalSeverityminor 
Status closedResolutionfixed 
Product Version1.91RC3 
Fixed in Version1.91 
Summary04953: GSOC - Usability improvements when copying conditions
Description

I noticed a couple things that could be improved when using the 'Copy conditions' feature:

  • It would be great if I could select multiple questions I want to copy to without having to press SHIFT (I am pretty sure this is not possible with a listbox but maybe with another GUI representation) [DONE by lemeur]
  • When I am asked what conditions of the current questions to copy, it would make more sense if all conditions are preselected (because I think it is more likely to copy all then I am to copy only part of it) [DONE by lemeur]
  • When I forgot to select a condition or a destination question I am still able to submit the form and then an error message appeas. An check right before submit would save time and ressources by preventing the user to submit the form at all. [TODO by a GSoC applicant ?]
  • I don't think there is an additional confirmation dialog necessary when click the button copy a condition. NOthing is deleted so it should just do it. [DONE by lemeur]
TagsNo tags attached.
Attached Files
condition.patch (1,529 bytes)   
Index: conditionshandling.php
===================================================================
--- conditionshandling.php	(revision 9909)
+++ conditionshandling.php	(working copy)
@@ -426,10 +426,6 @@
         {
             $message .= $clang->gT("No condition selected to copy from","js").". ";
         }
-        if (!isset($copyconditionsto))
-        {
-            $message .= $clang->gT("No question selected to copy condition to","js").".";
-        }
         $conditionsoutput_action_error .= "<script type=\"text/javascript\">\n<!--\nalert('$message');\n//-->\n</script>\n";
     }
 }
@@ -1668,7 +1664,7 @@
         ."\t});\n"
         ."}\n"
         ."</script>\n";
-
+        
     }
     else
     {
Index: scripts/conditions.js
===================================================================
--- scripts/conditions.js	(revision 9909)
+++ scripts/conditions.js	(working copy)
@@ -1,3 +1,12 @@
+$('#copyconditions').submit(function() {
+    if (!$("#copytomultiselect option:selected").length)
+   {        
+       alert("Please select atleast one question for copying condition");
+           return false;
+      
+   }
+  }); 
+  
 function jquery_goodchars(e, goods)
 {
    var key, keychar;
@@ -23,7 +32,8 @@
 
 
 $(document).ready(function(){
-    $('#languagetabs').tabs();
+           
+$('#languagetabs').tabs();
     $('#radiototal,#radiogroup').change(
         function()
         {
@@ -51,6 +61,7 @@
         }
     )
   }
+ 
 );
 
 
condition.patch (1,529 bytes)   
conditionhandling.patch (2,427 bytes)   
Index: conditionshandling.php
===================================================================
--- conditionshandling.php	(revision 9911)
+++ conditionshandling.php	(working copy)
@@ -419,20 +419,7 @@
             $CopyConditionsMessage = "<div class='warningheader'>(".$clang->gT("No conditions could be copied (due to duplicates)").")</div>";
         }
     }
-    else
-    {
-        $message = $clang->gT("Did not copy questions","js").": ";
-        if (!isset($copyconditionsfrom))
-        {
-            $message .= $clang->gT("No condition selected to copy from","js").". ";
-        }
-        if (!isset($copyconditionsto))
-        {
-            $message .= $clang->gT("No question selected to copy condition to","js").".";
-        }
-        $conditionsoutput_action_error .= "<script type=\"text/javascript\">\n<!--\nalert('$message');\n//-->\n</script>\n";
     }
-}
 //END PROCESS ACTIONS
 
 
@@ -1371,6 +1358,7 @@
                         . "\t<input type='checkbox' name='aConditionFromScenario{$scenarionr['scenario']}' id='cbox{$rows['cid']}' value='{$rows['cid']}' checked='checked'/>\n"
                         . "</td>\n";
                     }
+                                                      
                     $conditionsoutput_main_content .= ""
                     ."<td valign='middle' align='right' width='40%'>\n"
                     ."\t<font size='1' face='verdana'>\n";
@@ -1655,7 +1643,10 @@
         ."<input type='hidden' name='gid' value='$gid' />\n"
         ."<input type='hidden' name='qid' value='$qid' />\n"
         ."</div>\n";
-
+        $conditionsoutput_main_content .= "<script type='text/javascript'> $('#copyconditions').submit(function() {
+        if (!$('input[@id=cbox{$rows['cid']}]:checked').length) { alert(\"".$clang->gT("Please select alteast one condition to copy from","js")."\");return false;  } 
+        if (!$('#copytomultiselect option:selected').length) { alert(\"".$clang->gT("Please select alteast one question to copy condition to","js")."\");return false;  }});                      ;</script>";
+                    
         $conditionsoutput_main_content .= "<script type=\"text/javascript\">\n"
         ."function prepareCopyconditions()\n"
         ."{\n"
@@ -1668,7 +1659,7 @@
         ."\t});\n"
         ."}\n"
         ."</script>\n";
-
+        
     }
     else
     {
conditionhandling.patch (2,427 bytes)   
Bug heat6
Complete LimeSurvey version number (& build)9785
I will donate to the project if issue is resolvedNo
Browser
Database type & version.
Server OS (if known).
Webserver software & version (if known).
PHP Version.

Users monitoring this issue

There are no users monitoring this issue.

Activities

c_schmitz

c_schmitz

2011-02-13 17:22

administrator   ~14182

Hi Thibault,

could you please take a look at these issues and maybe discuss these?

Carsten

lemeur

lemeur

2011-02-15 21:31

developer   ~14190

  • fix the mark-all checkbox beeing now broken ?
lemeur

lemeur

2011-02-15 22:46

developer   ~14191

mark-all checkbox fixed in 9793.

lemeur

lemeur

2011-02-15 23:36

developer   ~14192

points 1 and 2 implemented in rev 9796.

lemeur

lemeur

2011-03-08 18:56

developer   ~14347

Last edited: 2011-03-08 18:56

point 4 implemented in rev 9868 and 9869

lemeur

lemeur

2011-03-08 18:58

developer   ~14348

Last edited: 2011-03-20 07:52

point 3 requires more Jquery work... I think I'll be lazy on this one...

Another thing: it would be great to use the new "status messaging system" instead of displaying "XXX conditions were copied, others were duplicates..." directly in the page.

Does it accept HTML with Font colors ?
If yes how to use it ?

lemeur

lemeur

2011-03-20 07:53

developer   ~14470

I propose that a GSoC applicant have a look at point 3:

  • it will show his/her jQuery abilities

user7171

2011-03-25 21:16

  ~14538

Last edited: 2011-03-25 21:16

Patch uploaded, please review.

lemeur

lemeur

2011-03-26 08:14

developer   ~14547

@anishseth,

Your patch doesn't cope with the "No condition selected to copy from" case.
Moreover, it seems impossible to apply cleanly to the limesurvey current SVN branch, I guess you've used an older revision to build the patch.

TIA,
Thibault

user7171

2011-03-26 12:38

  ~14549

Hey Lemeur,

I have added the above said condition. I am on the current stable branch with rev 9911. Please review the patch, and if you are satisfied with the patch i will commit.

c_schmitz

c_schmitz

2011-03-29 20:24

administrator   ~14608

Anish, although the patch is basically fine, we should refrain from using inline JS code. Please move the code to a separate JS file (can also be an existing one, maybe conditions.js?). Whatever

user7171

2011-04-15 06:40

  ~14817

fixed and committed .

Issue History

Date Modified Username Field Change
2011-02-13 17:21 c_schmitz New Issue
2011-02-13 17:21 c_schmitz Status new => assigned
2011-02-13 17:21 c_schmitz Assigned To => lemeur
2011-02-13 17:22 c_schmitz Note Added: 14182
2011-02-15 21:31 lemeur Note Added: 14190
2011-02-15 22:46 lemeur Note Added: 14191
2011-02-15 23:36 lemeur Note Added: 14192
2011-03-08 18:56 lemeur Note Added: 14347
2011-03-08 18:56 lemeur Note Edited: 14347
2011-03-08 18:56 lemeur Note Edited: 14347
2011-03-08 18:58 lemeur Note Added: 14348
2011-03-08 18:58 lemeur Status assigned => feedback
2011-03-20 07:50 lemeur Summary Usability improvements when copying conditions => GSOC - Usability improvements when copying conditions
2011-03-20 07:50 lemeur Description Updated
2011-03-20 07:52 lemeur Note Edited: 14348
2011-03-20 07:53 lemeur Note Added: 14470
2011-03-20 07:53 lemeur Description Updated
2011-03-25 21:15 user7171 File Added: condition.patch
2011-03-25 21:16 user7171 Note Added: 14538
2011-03-25 21:16 user7171 Note Edited: 14538
2011-03-26 08:14 lemeur Note Added: 14547
2011-03-26 12:38 user7171 Note Added: 14549
2011-03-26 12:38 user7171 File Added: conditionhandling.patch
2011-03-26 17:41 Mazi Status feedback => assigned
2011-03-29 20:24 c_schmitz Note Added: 14608
2011-04-15 06:40 user7171 Note Added: 14817
2011-04-15 06:41 user7171 Status assigned => resolved
2011-04-15 06:41 user7171 Resolution open => fixed
2011-05-04 19:48 c_schmitz Status resolved => closed
2011-05-04 19:48 c_schmitz Fixed in Version => 1.91