View Issue Details

This issue affects 1 person(s).
 8
IDProjectCategoryView StatusLast Update
04595Bug reportsData Entry (non public)public2010-09-29 16:29
Reporteruser9658Assigned ToDenisChenu  
PrioritynormalSeverityminor 
Status closedResolutionsuspended 
Product Version1.90+ 
Fixed in Version1.90+ 
Summary04595: Ranking questions can't not be filled by dataentry screen
Description

When you answer survey with ranking questions using « dataentry screen » all fields in database stay empty (NULL value)

Responses filled by public interface is working.

Steps To Reproduce

Import survey joined. Use dataentry screen to anwser and look at results with « Browse responses in this survey » or in the database.

Additional Information

Import survey joined. Use dataentry screen to anwser and look at results with « Browse responses in this survey » or in the database.

TagsNo tags attached.
Attached Files
dataentry.php.patch (6,713 bytes)   
--- admin/dataentry.php	2010-09-13 21:56:08.000000000 +0200
+++ admin/dataentry.php.new	2010-09-13 21:56:06.000000000 +0200
@@ -67,9 +67,9 @@
 $actsurresult = db_execute_assoc($actsurquery) or safe_die($connect->ErrorMsg());
 $actsurrows = $actsurresult->FetchRow();
 
+
 if ($_SESSION['USER_RIGHT_SUPERADMIN'] == 1 || $actsurrows['browse_response'])
 {
-
     $surveyoptions = browsemenubar($clang->gT("Browse Responses"));
     if (!$surveyid && !$subaction)
     {
@@ -221,9 +221,10 @@
             $values=array();
             $_POST['startlanguage']=$baselang;
             $_POST['startdate']=$_POST['datestamp'];
-            foreach ($fieldmap as $irow)
+						foreach ($fieldmap as $irow)
             {
                 $fieldname = $irow['fieldname'];
+           
                 if (isset($_POST[$fieldname]))
                 {
                     if ($_POST[$fieldname] == "" && ($irow['type'] == 'D' || $irow['type'] == 'N' || $irow['type'] == 'K'))
@@ -669,7 +670,7 @@
                         ."\$b=i;\n"
                         ."\$b += '';\n"
                         ."\$inputname=\"RANK_$thisqid\"+\$b;\n"
-                        ."\$hiddenname=\"d$myfname\"+\$b;\n"
+                        ."\$hiddenname=\"$myfname\"+\$b;\n"
                         ."\$cutname=\"cut_$thisqid\"+i;\n"
                         ."document.getElementById(\$cutname).style.display='none';\n"
                         ."if (!document.getElementById(\$inputname).value)\n"
@@ -704,13 +705,13 @@
                         ."\tif (cutindex > 1)\n"
                         ."{\n"
                         ."\$cut1name=\"cut_$thisqid\"+(cutindex-1);\n"
-                        ."\$cut2name=\"d$myfname\"+(cutindex);\n"
+                        ."\$cut2name=\"$myfname\"+(cutindex);\n"
                         ."document.getElementById(\$cut1name).style.display='';\n"
                         ."document.getElementById(\$cut2name).value='';\n"
                         ."}\n"
                         ."\telse\n"
                         ."{\n"
-                        ."\$cut2name=\"d$myfname\"+(cutindex);\n"
+                        ."\$cut2name=\"$myfname\"+(cutindex);\n"
                         ."document.getElementById(\$cut2name).value='';\n"
                         ."}\n"
                         ."\tvar i=document.getElementById('CHOICES_$thisqid').options.length;\n"
@@ -756,7 +757,7 @@
                                 $ranklist .= " value='".$thistext."'";
                             }
                             $ranklist .= " onFocus=\"this.blur()\"  />\n"
-                            . "<input type='hidden' id='d$myfname$j' name='d$myfname$j' value='";
+                            . "<input type='hidden' id='$myfname$j' name='$myfname$j' value='";
                             if (isset($currentvalues) && isset($currentvalues[$k]) && $currentvalues[$k])
                             {
                                 $ranklist .= $thiscode;
@@ -768,7 +769,7 @@
                             {
                                 $ranklist .= "style='display:none'";
                             }
-                            $ranklist .= " id='cut_$thisqid$j' onclick=\"deletethis_$thisqid(document.editresponse.RANK_$thisqid$j.value, document.editresponse.d$myfname$j.value, document.editresponse.RANK_$thisqid$j.id, this.id)\" /><br />\n\n";
+                            $ranklist .= " id='cut_$thisqid$j' onclick=\"deletethis_$thisqid(document.editresponse.RANK_$thisqid$j.value, document.editresponse.$myfname$j.value, document.editresponse.RANK_$thisqid$j.id, this.id)\" /><br />\n\n";
                         }
 
                         if (!isset($choicelist)) {$choicelist="";}
@@ -1839,7 +1840,7 @@
                         ."\$b=i;\n"
                         ."\$b += '';\n"
                         ."\$inputname=\"RANK_$thisqid\"+\$b;\n"
-                        ."\$hiddenname=\"d$fieldname\"+\$b;\n"
+                        ."\$hiddenname=\"$fieldname\"+\$b;\n"
                         ."\$cutname=\"cut_$thisqid\"+i;\n"
                         ."document.getElementById(\$cutname).style.display='none';\n"
                         ."if (!document.getElementById(\$inputname).value)\n"
@@ -1874,13 +1875,13 @@
                         ."\tif (cutindex > 1)\n"
                         ."{\n"
                         ."\$cut1name=\"cut_$thisqid\"+(cutindex-1);\n"
-                        ."\$cut2name=\"d$fieldname\"+(cutindex);\n"
+                        ."\$cut2name=\"$fieldname\"+(cutindex);\n"
                         ."document.getElementById(\$cut1name).style.display='';\n"
                         ."document.getElementById(\$cut2name).value='';\n"
                         ."}\n"
                         ."\telse\n"
                         ."{\n"
-                        ."\$cut2name=\"d$fieldname\"+(cutindex);\n"
+                        ."\$cut2name=\"$fieldname\"+(cutindex);\n"
                         ."document.getElementById(\$cut2name).value='';\n"
                         ."}\n"
                         ."\tvar i=document.getElementById('CHOICES_$thisqid').options.length;\n"
@@ -1933,7 +1934,7 @@
                                 $ranklist .= "'";
                             }
                             $ranklist .= " onFocus=\"this.blur()\"  />\n";
-                            $ranklist .= "<input type='hidden' id='d$fieldname$i' name='d$fieldname$i' value='";
+                            $ranklist .= "<input type='hidden' id='$fieldname$i' name='$fieldname$i' value='";
                             $chosen[]=""; //create array
                             if (isset($myfname) && $_SESSION[$myfname])
                             {
@@ -1947,7 +1948,7 @@
                                 $ranklist .= "style='display:none'";
                             }
                             $mfn=$fieldname.$i;
-                            $ranklist .= " id='cut_$thisqid$i' onclick=\"deletethis_$thisqid(document.addsurvey.RANK_$thisqid$i.value, document.addsurvey.d$fieldname$i.value, document.addsurvey.RANK_$thisqid$i.id, this.id)\" /><br />\n\n";
+                            $ranklist .= " id='cut_$thisqid$i' onclick=\"deletethis_$thisqid(document.addsurvey.RANK_$thisqid$i.value, document.addsurvey.$fieldname$i.value, document.addsurvey.RANK_$thisqid$i.id, this.id)\" /><br />\n\n";
                         }
                         if (!isset($choicelist)) {$choicelist="";}
                         $choicelist .= "<select size='$anscount' class='choicelist' name='CHOICES' id='CHOICES_$thisqid' onclick=\"rankthis_$thisqid(this.options[this.selectedIndex].value, this.options[this.selectedIndex].text)\" >\n";
dataentry.php.patch (6,713 bytes)   
Bug heat8
Complete LimeSurvey version number (& build)9118
I will donate to the project if issue is resolved
BrowserIceweasel
Database type & version143
Server OS (if known)Debian Lenny
Webserver software & version (if known)apache 2.2.9
PHP Version5.2.6 (debian stable package)
Git branch / Pull Request URL

Users monitoring this issue

DenisChenu

Activities

user9658

2010-09-13 22:35

  ~12842

Please have a look at this patch (remove « d » before hidden names). With this, dataentry is now working with ranking questions.

DenisChenu

DenisChenu

2010-09-16 16:23

developer   ~12854

Thank you !!

But i have an error with the patch : javascript error when i trye to remove an option.

:)

DenisChenu

DenisChenu

2010-09-16 18:09

developer   ~12855

Fixed in 9136,

Thanks again Flyinvap.

(remove the d only for name )

c_schmitz

c_schmitz

2010-09-29 16:29

administrator   ~12935

New 1.90+ version was released.

Issue History

Date Modified Username Field Change
2010-09-12 23:42 user9658 New Issue
2010-09-12 23:42 user9658 File Added: limesurvey_survey_26778.lss
2010-09-12 23:43 user9658 Issue Monitored: user9658
2010-09-12 23:50 DenisChenu Issue Monitored: DenisChenu
2010-09-13 22:35 user9658 File Added: dataentry.php.patch
2010-09-13 22:35 user9658 Note Added: 12842
2010-09-16 16:23 DenisChenu Note Added: 12854
2010-09-16 16:24 DenisChenu Assigned To => DenisChenu
2010-09-16 16:24 DenisChenu Status new => confirmed
2010-09-16 18:08 DenisChenu Status confirmed => resolved
2010-09-16 18:08 DenisChenu Fixed in Version => 1.90+
2010-09-16 18:09 DenisChenu Note Added: 12855
2010-09-29 16:29 c_schmitz Note Added: 12935
2010-09-29 16:29 c_schmitz Status resolved => closed
2021-08-04 22:19 guest Bug heat 6 => 8
2026-10-25 16:41 c_schmitz Resolution open => suspended