View Issue Details

IDProjectCategoryView StatusLast Update
04792User patchesStatisticspublic2012-06-21 14:17
Reportertringate Assigned To 
PrioritynormalSeveritytweak 
Status confirmedResolutionopen 
Product Version1.90+ 
Summary04792: Add some additional functions to the user statistics display
Description

This link points to the forum thread where Mazi suggested I open this ticket.
http://www.limesurvey.org/en/support/forums/5-can-i-do-this-with-limesurvey/53498-more-control-over-the-format-of-the-user-statistic

Add a few items to the user statistics display:

  1. Add a menu system to show all public surveys of this survey site
  2. Place the current date and time in the header of the user survey display
  3. Place option switches in the user survey to supress: answer codes, question numbers, answers with no ansers.
Steps To Reproduce

The attached file has three modules that accomplist the above ites.

Item 1 is accomplished by including module; public_statistics_user.php
Item 2 is accomplished by replacing module: statistics_user.php
Item 3 is accomplished by replacing module: admin/statistics_function.php

These three changes are independant on one another and do not require the others to function.

Items 1 and 2 are very minor, and require nearly no coding involvement other than proper module notations for Item 1's module.

Item three requires a minimal amount of code change but has some specific effects I will document in "additional Information".

TagsNo tags attached.
Complete LimeSurvey version number (& build)9561

Activities

tringate

tringate

2010-12-05 17:33

reporter  

statistics_user.zip (31,716 bytes)
tringate

tringate

2010-12-05 17:53

reporter   ~13693

I thought I could add additional information after submitting but I guess I need to add it as additional notes now.

Item 1 is a stand along module solution and it uses the survey template to display the available surveys that are marked as public. It is placed in the root directory of the limesurvey application and the url is either given in the survey end page or in any way the author chooses to display this menu.

Item 2 is a very simple modification that puts the current date and time in the header of the user statistics display.

Item 3 is more complicated, and it actuall has 4 switches in it. One I forgot to mention in the original submition of this tickey.

Item 4 accomplishes the following:

  • a switch to turn on or off the answer codes in the statistics display
  • a switch to turn on or off the question numbers in the statistics display
  • a switch to allow or remove answers with no answer given.
  • a switch to supress the summary header

Here are those four switches:

//TLR Special switches to control output
$noqnumber = 1; // set to "0" to let question numbers display in the user statistics, "1" to supress question number.
$noaid = 1; // set to "0" to let answer ID display in the user statistics, "1" to supress answer ID.
$supress_blank_answer=0; // set to "1" to show answers with a value of zero.
$supress_summary_header=1; // set to "1" to suprass summery header display.

It should be noted that these affect all statistics displays as I have implemented these changes. A better solution would be to move these switches from this module and make them global in the survey display menues during survey author time.

I also only implemented these changes for the HTML displays and not the PDF or XMP outputs of the statistics.

The most useful of these changes is the item that suppresses blank answers.

Think of aa profile question that asks what country you are in and uses a dropdown box with some 300 countries listed. Usually only a few countries will be used, but in the display you will see all 300 countries with most showing zero. By supressing these answers from the display you now only see those answers that have a non zero answer. Makes for a much smaller statistics display and much more readable.

Some other things that could be addressed is the failure for correct percentages on some question types.

In the old phpsurvey I had these solved, but with so many changes to the statistics code those errors were abandon and I just leave them in the current displays.

The errors result because the formula always uses the "possible" numbers of answers, and the "actual" numbers of answers.

This gets further complicated when conditions or wuestion types allow people to give answers that do not agree with the total numbers of survey takers.

An answer should reflect the percentage of the total number of those answers given, not the percentage of the number of survey takers. In multiple choice answers the numbers of total answers can easily exceed the number of total people taking the survey.

I only mention this here because when you remove the zero answers, this error becomes more obvious. It is a total seporate issue, and not related to these changes at all.

tringate

tringate

2010-12-05 18:00

reporter   ~13694

I forgot to mention that in the 2 replacement modules all the code I have added is notated with the following comment lines:

// TLR
.
.
.
// end TLR

or a comment as:

// TLR to the line added.

tringate

tringate

2010-12-05 18:05

reporter   ~13695

Mazi also asked me to comment on my abilities like I did in the forum so here is that exerpt.

Unfortunatly, I do not know how to use svn, so that way isn't really a viable way for me.

A year or so ago a couple of the limesurvey developers requested a link to view this statistics display in production. I sent them a link as well as the code.

In the two modules that replace existing modules the new code is bracketed with the comment lines containing " // TLR " so it is fairly easy to see what was changed.

If I was a developer, and knew how to use tools like svn, I would be happy to use the existing process.

Unfortunatly, I am just a hacker, who will play with existing code to twist it around to work like I want it to.

Maybe someone who is a limesurvey user who knows svn might take this mod and do as you suggest. I have no ego involved so they could claim it as their own if that made it worth their effort.

c_schmitz

c_schmitz

2010-12-11 13:36

administrator   ~13755

Hello Thomas,

About 1)
It is just a hack because the parameters can only be changed by editing the source code. We can accept generic patches only.

About 2)
You are totally ignoring the date format setting for the particular survey and setting. Also there is no way to set the time format currently.

About 3)
I am not sure if this is needed - because if the survey is set to be listed pubicly at the frontpage and it has public statistics activated, then the link to the public statistics is also shown right behind it?

I am sorry but in their current state we cannot accept any of these patches.

Issue History

Date Modified Username Field Change
2010-12-05 17:31 tringate New Issue
2010-12-05 17:33 tringate File Added: statistics_user.zip
2010-12-05 17:53 tringate Note Added: 13693
2010-12-05 18:00 tringate Note Added: 13694
2010-12-05 18:05 tringate Note Added: 13695
2010-12-05 19:03 c_schmitz Project Bug reports => User patches
2010-12-11 13:36 c_schmitz Note Added: 13755
2010-12-11 13:36 c_schmitz Assigned To => c_schmitz
2010-12-11 13:36 c_schmitz Status new => confirmed
2012-06-21 14:17 c_schmitz Assigned To c_schmitz =>