View Issue Details

IDProjectCategoryView StatusLast Update
11811Feature requestsStatisticspublic2019-01-03 18:51
Reporterjeskiv Assigned ToLouisGac 
PrioritynoneSeverityfeature 
Status assignedResolutionopen 
Summary11811: View free text answers in simple mode statistics
DescriptionAt the moment there is a message saying "No simple graph for this question type" for long free text and short free text answers. Instead, there could be a link to download the list of answers as CSV or PDF or a link to a separate page listing the answers, or the box could have the answers listed with its own scroll down bar.
TagsNo tags attached.

Activities

pmonstad

pmonstad

2016-10-18 15:56

updater   ~41423

I second this one! ++
LouisGac

LouisGac

2016-11-14 17:17

developer   ~41921

well, statistic helper code is the Hell of the Flying Spaghetti Monster.
My original idea was just to show nothing at all. But in a reasonable time, the best I could do was that. For sure, it's not that good.
jeskiv

jeskiv

2016-11-23 11:46

reporter   ~42192

I was actually able to do this just by adding the following lines in the statistics helper before the else which shows "nograph"-view which is on line 2366:

//show answers in text if type short text or text
elseif ($outputs['qtype'] == "T" || $outputs['qtype'] == "S")
                {
                    $aData['data']=$this->_listcolumn($surveyid, $al[2]);

                    $statisticsoutput .= Yii::app()->getController()->renderPartial('admin/export/generatestats/simplestats/_statisticsoutput_simpletext', $aData, true);
                }

And then the new view file _statisticsoutput_simpletext.php just has this:


<?php
/**
 * This view renders the 'text'-type answers
 */
?>
<div class="row">
    <div class="col-sm-12">
        <div class="alert alert-warning simpletext" role="alert" style="overflow: auto; height: 300px;">
            <?php foreach ($data as $i=>$data): ?>
               <?php echo $data['value']; ?>
               <hr style="margin-top: 1px; margin-bottom: 1px;" />
           <?php endforeach; ?>
        </div>
    </div>
</div>

I needed to do quite a lot of other customizations to the simple view in statistics helper, so I ended up creating my own "plugin", which now includes this as well. Feel free to add this to the original if it follows the design principles, I don't know about that.
DenisChenu

DenisChenu

2016-11-23 12:04

developer   ~42194

I'm not for actual update of statistics. Rewriting is need before.

And here : if you have 1000 answers : you show 1000 lines in "quick statistics" => quick ? Really ?
jeskiv

jeskiv

2016-11-23 12:43

reporter   ~42198

Well yes. I don't have such big data to test with so don't know how fast it works. It will show a scrollbar, so it will still look nice. As said, if you feel like it doesn't follow your design principles don't add it. I got what I needed and thought it might help. Doesn't it also go through all those 1000 answers in all the graphs so shouldn't it be as quick as those?
jeskiv

jeskiv

2016-11-23 12:59

reporter   ~42199

I now created a testfile of 1000 text answers, and it does load the "Simple statistics"-page quickly and looks nice. To specify: it shows scrollbar in each separate text field question answer box, so doesnt destroy the general layout. IMHO a lot more usable than showing "no simple graph for this question type". Yes sure, its quite hard to go through 1000 responses in that format, but I need it for maybe 10-20 respondents, where it still works well.
DenisChenu

DenisChenu

2016-11-23 14:42

developer   ~42202

Thinking
1. No graph for text question : OK
2. If graph : just anser VS no-answer
jeskiv

jeskiv

2016-11-23 16:14

reporter   ~42217

I think that it is useful for the user to see the free text answers right away. At least for us this removes the need to use the expert mode.

The data of answer vs no-answer could be also shown similar to arithmetic mean and standard deviation are shown under the question before the graph. You don't need a graph to say "answers 13 no answers 15".
burnheart

burnheart

2018-05-17 11:33

reporter   ~47659

it appears the free text answers do not show up in expert mode as well , even if "Show text responses inline" is selected (using Version 2.50+ Build 160206)
markusd1984

markusd1984

2019-01-03 13:04

reporter   ~50088

"Show text responses inline" works in 3.15 within the expert mode (so one doesn't has to click the "Browse" answers to list them).

However I also think an option to show free text answers in the simple mode would be very good,
because some users can have surveys with little responses where this makes the simple statistic view more useful instead of looking at the responses or requiring the user to have expert mode "skills" just to create a similar view (to get charts + text answers).

Perhaps what could be considers to help with going through more answers / scrolling might be to have the question listed in a full row instead of just one column and perhaps with an option to expand the view more to have less scrolling.

I would think that many users will have a 20-50 participants audience and not always in the hundreds or thousands :)
Hence making it user friendly and perhaps an option to enable / disable would cater both small and large responses.
markusd1984

markusd1984

2019-01-03 17:07

reporter   ~50093

I tried out the approach by jeskiv which worked great to get the output of the answers, I removed the classes for alert and alert-warning to make it look better :)

than i managed to use the same view from the expert mode instead, which offers the search icon to open individual records which is even better :)

elseif ($outputs['qtype'] == "T" || $outputs['qtype'] == "S")
{
$aData['data']=$this->_listcolumn($surveyid, $al[2]);
$aData['surveyid']=$surveyid;
                $statisticsoutput .= Yii::app()->getController()->renderPartial('/admin/export/generatestats/simplestats/_statisticsoutput_simpletext', $aData, true);
            }

/application/views/admin/export/generatestats/simplestats/_statisticsoutput_simpletext.php

<?php
/**

This view renders the 'text'-type answers
*/
?>
<div class="row">
<div class="col-sm-12">
<div class="simpletext" role="alert" style="overflow: auto; height: 300px;">

<?php
foreach ($data as $row) {
?>
    <div class='statisticscolumnid col-sm-1'>
     <a href='<?php echo Yii::app()->getController()->createUrl("admin/responses/sa/view/surveyid/".$surveyid."/id/".$row['id']); ?>' target='_blank' title='<?php eT("View response"); ?>' data-toggle="tooltip" data-placement="top">
       <span class="fa fa-search kochanie"></span>
      </a>
    </div>
<div class='statisticscolumndata col-sm-11 text-left' >
    <?php echo sanitize_html_string($row['value']) ?>
</div>

<?php
}
?>
</div>
</div>
</div>
markusd1984

markusd1984

2019-01-03 17:16

reporter   ~50094

forgot to include the permission check:

<?php
/**

This view renders the 'text'-type answers
*/
?>
<div class="row">
<div class="col-sm-12">
<div class="simpletext" role="alert" style="overflow: auto; height: 300px;">

<?php
foreach ($data as $row) {
?>
<?php if(Permission::model()->hasSurveyPermission($surveyid,'responses','read')){ ?>
    <div class='statisticscolumnid col-sm-1'>
     <a href='<?php echo Yii::app()->getController()->createUrl("admin/responses/sa/view/surveyid/".$surveyid."/id/".$row['id']); ?>' target='_blank' title='<?php eT("View response"); ?>' data-toggle="tooltip" data-placement="top">
       <span class="fa fa-search"></span>
      </a>
    </div>
<?php } ?>
<div class='statisticscolumndata col-sm-11 text-left' >
    <?php echo sanitize_html_string($row['value']) ?>
</div>

<?php
}
?>
</div>
</div>
</div>
DenisChenu

DenisChenu

2019-01-03 18:51

developer   ~50097

We can not do foreach ($data as $row) { …

There can be 10 000 and more row … need to be ajaxed with start and count

Issue History

Date Modified Username Field Change
2016-10-18 15:37 jeskiv New Issue
2016-10-18 15:56 pmonstad Note Added: 41423
2016-11-14 17:17 LouisGac Note Added: 41921
2016-11-14 17:18 LouisGac Assigned To => LouisGac
2016-11-14 17:18 LouisGac Status new => assigned
2016-11-23 11:46 jeskiv Note Added: 42192
2016-11-23 12:04 DenisChenu Note Added: 42194
2016-11-23 12:43 jeskiv Note Added: 42198
2016-11-23 12:59 jeskiv Note Added: 42199
2016-11-23 14:42 DenisChenu Note Added: 42202
2016-11-23 16:14 jeskiv Note Added: 42217
2018-05-17 11:33 burnheart Note Added: 47659
2019-01-03 13:04 markusd1984 Note Added: 50088
2019-01-03 17:07 markusd1984 File Added: LS statistics simple text.png
2019-01-03 17:07 markusd1984 Note Added: 50093
2019-01-03 17:16 markusd1984 Note Added: 50094
2019-01-03 18:51 DenisChenu Note Added: 50097