View Issue Details

This bug affects 1 person(s).
 4
IDProjectCategoryView StatusLast Update
05065Bug reportsSurvey takingpublic2011-05-04 19:47
Reporterroom2web Assigned Tomagiclko 
PrioritynormalSeverityminor 
Status closedResolutionfixed 
Product Version1.91RC5 
Fixed in Version1.91 
Summary05065: Show totals: grand total is not calculated on reload/revisit of Survey Page
Description

Grand total is not calculated on reload/revisit of Survey Page

Steps To Reproduce

Create a survey.
Create a question, type: Array (Texts)
Show advanced settings.
Activate:

  • Show totals for both rows and columns
  • Numbers only
  • Show grand total
    ( - Optional: create second survey page with dummy data)
    Create dummy matrix fields.
    Load survey, fill out some data. Everything should calculate just fine. Reload page or navigate to 2nd page and back to first again: Total are being calculated for rows and cols only, but not for grand total.
Additional Information

The following change to survey_runtime.js should fix this issue.

[...]
571 //need to check for grand
572 if(_td[_a].className.match(_match_grand,'ig'))
573 {
574 //set up a grand total
575 if(vert && _bits[_counter].length > 1)
576 {
577 _grand=1;
578 calc_horo(_bits.length - 1); // calculate grand total
579 }
580 else
581 {
582 _grand=2;
583 _bits[_counter][_bits[0].length - 1]=_bits[_counter][0];
584 calc_vert(_bits[0].length - 1); // calculate grand total
585 }
586 }
[...]

TagsNo tags attached.
Attached Files
05065_dev.patch (784 bytes)   
Index: scripts/survey_runtime.js
===================================================================
--- scripts/survey_runtime.js	(revision 10000)
+++ scripts/survey_runtime.js	(working copy)
@@ -575,11 +575,15 @@
 										if(vert && _bits[_counter].length > 1)
 										{
 											_grand=1;
+                                            //run calc across last row
+                                            calc_horo(_bits.length - 1);
 										}
 										else
 										{
 											_grand=2;
 											_bits[_counter][_bits[0].length - 1]=_bits[_counter][0];
+                                            //run calc on last col
+                                            calc_vert(_bits[0].length - 1);
 										}
 									}
 									else
05065_dev.patch (784 bytes)   
Bug heat4
Complete LimeSurvey version number (& build)9872
I will donate to the project if issue is resolvedNo
Browser
Database type & versionMySql 5
Server OS (if known)any
Webserver software & version (if known)any
PHP Versionany

Users monitoring this issue

There are no users monitoring this issue.

Activities

c_schmitz

c_schmitz

2011-03-29 20:02

administrator   ~14607

Evan, can you please take a look at this and check if this change fine?

magiclko

magiclko

2011-04-14 15:15

reporter   ~14815

Patch attached. Issue was that initially _grad = 0 and hence, no case of switch statement inside calc was satisfied and hence the problem!

c_schmitz

c_schmitz

2011-04-16 17:43

administrator   ~14829

Looks good - please commit.

Issue History

Date Modified Username Field Change
2011-03-28 16:19 room2web New Issue
2011-03-29 20:01 c_schmitz Assigned To => Evan
2011-03-29 20:01 c_schmitz Status new => assigned
2011-03-29 20:02 c_schmitz Note Added: 14607
2011-04-13 16:37 c_schmitz Assigned To Evan => dionet
2011-04-13 16:38 c_schmitz Assigned To dionet => magiclko
2011-04-14 15:10 magiclko File Added: 05065_dev.patch
2011-04-14 15:15 magiclko Note Added: 14815
2011-04-16 17:37 magiclko Assigned To magiclko => c_schmitz
2011-04-16 17:43 c_schmitz Assigned To c_schmitz => magiclko
2011-04-16 17:43 c_schmitz Note Added: 14829
2011-04-16 20:56 magiclko Status assigned => resolved
2011-05-04 19:47 c_schmitz Status resolved => closed
2011-05-04 19:47 c_schmitz Resolution open => fixed
2011-05-04 19:47 c_schmitz Fixed in Version => 1.91