View Issue Details

This bug affects 1 person(s).
IDProjectCategoryView StatusLast Update
13955Feature requestsStatisticspublic2021-10-08 14:26
Reportermikebb Assigned To 
Status newResolutionopen 
Summary13955: Add sub-question headings on simple statistics graphs
DescriptionSimple statistics would be much more useful if the graphs showing sub-question data had headings that matched the sub-question - not just the parent question heading that is currently shown.

More detail: In ‘simple statistics’ when viewing results for a sub-question, the graph heading show the parent question’s text when questions are arrays - even when the subquestions have their own texts. So all the subquestion graphs will show the same (parent) heading – and the user can’t easily tell which subquestion they are for. Its confusing.
Also if a sub-question’s parent does not have any text (ie it only has a title) then there is no heading shown for all sub-question graphs – so no indication of what the graph data is.

I've read that the devs are reluctant to patch the statistics code as it needs a re-write, but this could be fixed very easily with minimal coding - see additional info below.

there are there are two screenshots attached of a simple survey:
- first with current code (LS 3.14.3+180809),
- second with this suggested patch
Additional Informationfollowing code in '/application/helpers/admin/statistics_helper.php':
/// ---------------
// insert at Line 1160- - before 'switch ($qtype){'
$parent_title = $qtitle;// save this as may use later for sub-question graph headings.

// insert before the return of buildOutputList(), line 1460
if (isset($atext ) && $atext){ // if there is subquestion text
    $qquestion = rtrim($qquestion, $linefeed); // trim off the linefeed. (better if linefeed was added last, and not in switch conditions)
    // shows parent-q text: sub-q text. or use parent title if need:
    $qquestion .= ((trim($qquestion=='')) ? ucfirst($parent_title) : null) . ": " . $atext . $linefeed;
/// --------------------------
TagsNo tags attached.
Bug heat6

Users monitoring this issue

User List There are no users monitoring this issue.




2018-08-12 11:46




2019-07-17 16:43

manager   ~52915

@dominikvitt, your thoughts?


2019-07-17 16:44

reporter   ~52916

great thanks, that worked a treat! Should be built into the new versions if it's not already.

Now an aggregated stacked bar chart would be ideal :)


2021-10-08 14:26

reporter   ~66812

Hi, is there any chance that this fix could be merged into the master branch? If the answer is yes, i could prepare an pull request with the solution mentioned here

Issue History

Date Modified Username Field Change
2018-08-12 11:46 mikebb New Issue
2018-08-12 11:46 mikebb File Added: simple stats - no subquestion headers.jpg
2018-08-12 11:46 mikebb File Added: simple stats MOD-parent and subquestion headers.jpg
2019-07-17 16:43 cdorin Note Added: 52915
2019-07-17 16:44 markusd1984 Note Added: 52916
2021-10-08 14:26 gwdgls Note Added: 66812
2021-10-08 14:26 gwdgls Bug heat 4 => 6