Repository: oppia/oppia

Issue:
The visualization of Multiple Choice answers in the stats tab looks bad
Responses to multiple choice questions look like this 
<img width="603" alt="screen shot 2018-02-06 at 22 16 56" src="https://user-images.githubusercontent.com/13726796/35884645-9e04e2e0-0b8b-11e8-8a36-6963f1ebc0bd.png">

See https://oppiatestserver.appspot.com/create/fGoo1T3Nxt8r#/stats

They should be made more readable.


Discussion:
I would like to work on this issue. However how do I stimulate this view locally?
(/cc-ing @pranavsid98 to advise)
@tjiang11 this is breaking, right? (for the upcoming release)
Hmm... I actually can't seem to reproduce this (the link doesn't seem to produce the picture shown?), when when I look at the multiple choice statistics for fractions for example, it seems to look fine.
Hi @pranavsid98 I am not able to reproduce the histogram shown in the statistics tab image at local. Can you help?
Hi @pandeykartikey 

Sorry about the delayed response. To reproduce the histogram shown in the statistics tab image at local, perform the following steps:

1. Go to the admin page and run the job titled 'InteractionAnswerSummariesIntegrator'.
2. Now, create an exploration with a multiple choice interaction type card and publish it.
3. Submit a few answers to that card in learner view.
4. Now, you can view the above histogram in the statistics tab.
The current view in that same link is 
![screenshot from 2018-09-23 03-25-43](https://user-images.githubusercontent.com/22347970/45922095-94035c00-bee0-11e8-9911-0a8a5c060403.png)
So, can this be closed? Since this looks more readable. @jacobdavis11 @pranavsid98 
Hi @aks681, I think you need to actually click on a card in "Card statistics" to get a view that has parity to what @jacobdavis11 is referring to...
@seanlip Ok, thanks, but it seems that exploration does not have a multiple choice interaction anymore. So, I checked with [this](https://oppiatestserver.appspot.com/create/1#/stats) demo exploration and the statistics for multiple choice input seems readable.
![screenshot from 2018-09-26 17-54-15](https://user-images.githubusercontent.com/22347970/46079671-673b9700-c1b5-11e8-882d-aa31432b91d2.png)

Though, what I have a doubt is if the card was entered only 23 times and only 2 options are there (both of which lead to different cards), how does the graph go till almost 200?

Ah yeah, I agree that the readability issue has been fixed.

You're right that the stats discrepancy seems weird though. @pranavsid98 do you have any insight on this?
@bansalnitish @vibhor98, i don't think this issue is still there
See now its read able
![screenshot from 2019-03-07 11-27-00](https://user-images.githubusercontent.com/34139754/53935370-08ffd200-40cc-11e9-8d6f-e1e0c44da013.png)

Hi @import-keshav, I'm not sure here! The image in your comment suggests that the issue has been fixed but preceding comments show some discrepancies in the graph. @brianrodri may be able to help us here in determining what exactly the issue is for! Thanks!  
Thanks, @vibhor98 for the response.
Hello @brianrodri can you please confirm the above comments thanks?
Ping @brianrodri.
@import-keshav I am not sure what interaction you are looking at, but I just took a look at multiple-choice on the production server and saw this:

![Screenshot from 2019-03-08 12-34-57](https://user-images.githubusercontent.com/10575562/54054307-b17e6680-419e-11e9-8a0b-568bd5ca8604.png)

It seems like there's some room for improvement -- there are no labels on the answer choices, for example. In any case please make sure that you are looking at a **multiple-choice interaction**, the one you have in your screenshot seems more like fraction input.
Hey @nithusha21, any updates on this one ? 
De-assigning for now; please re-assign to resume work.
Here is how we are planning to present multiple choice answers in Improvements tab, and I think the view can be applied to stats as well.
![image](https://user-images.githubusercontent.com/56828144/76429345-eb4b0400-63d4-11ea-9f34-6c2965a0f0b0.png)
The idea is to focus on the answer itself, and then show the stat of how frequently the answer is given. Here, the answers are presented in decreasing order of their frequency of occurrence. By doing this, the creator encounters the answers in the order of importance, and can then see the severity on inspection. 

Hi @swaat-on-git, thanks! Just one question: could we use the raw number of answers instead? That way, a 50%/25%/25% split could be seen in context of whether it's for 4 answers or 4000 answers (the severity is clearly higher in the latter case).
True, I agree on the number actually showing severity better. I only have two concerns about it - 
1. Will seeing multiple raw numbers overwhelm them? Eg. If Spanish is 432, English 391 and French 116, would it still be simple for them to consume it? 
2. This number could be high simply because there are more learners on the exploration, and in relation to all the answers, it could actually be simpler to show the severity in percentage.

I'm also wondering if substantiating the highest answer with both percentage and the actual number would solve our intents? 


1. I think it's not a problem. I've seen this all the time and never felt fazed, as long as they're sorted in order.

2. I'm not sure I understand the concern here -- could you please elaborate? Is it the same point as (1)?
We discussed this on call, but putting it here to leave a trail
The second one is that, higher or lower absolute number may not always be indicative of the severity, because the it depends on the number of learners for that exploration. For example, if the exploration has only a 100 overall learners, maybe 30 people would be answering 'Spanish'. In relation the learners of that lesson, it is still a concern. 

Update: We're going to try and see if we can include the absolute count for just the first one, or show the count for each of them on hover. (might be a problem in mobile)
@swaat-on-git could you please share a link for the HTML/CSS details of your design?

Resolving patch:
diff --git a/extensions/interactions/MultipleChoiceInput/MultipleChoiceInput.py b/extensions/interactions/MultipleChoiceInput/MultipleChoiceInput.py
--- a/extensions/interactions/MultipleChoiceInput/MultipleChoiceInput.py
+++ b/extensions/interactions/MultipleChoiceInput/MultipleChoiceInput.py
@@ -70,15 +70,8 @@ class MultipleChoiceInput(base.BaseInteraction):
     }]
 
     _answer_visualization_specs = [{
-        # Bar chart with answer counts.
-        'id': 'BarChart',
-        'options': {
-            'x_axis_label': 'Answer',
-            'y_axis_label': 'Count',
-        },
+        'id': 'SortedTiles',
+        'options': {'header': 'Top answers', 'use_percentages': True},
         'calculation_id': 'AnswerFrequencies',
-        # Bar charts don't have any useful way to display which answers are
-        # addressed yet. By setting this option to False, we consequentially
-        # avoid doing extra computation.
-        'addressed_info_is_supported': False,
+        'addressed_info_is_supported': True,
     }]
diff --git a/extensions/visualizations/models.py b/extensions/visualizations/models.py
--- a/extensions/visualizations/models.py
+++ b/extensions/visualizations/models.py
@@ -167,4 +167,8 @@ class SortedTiles(BaseVisualization):
         'name': 'header',
         'description': 'Header for the tiles.',
         'schema': {'type': 'unicode'}
+    }, {
+        'name': 'use_percentages',
+        'description': 'Summarize frequency through percentages',
+        'schema': {'type': 'bool'},
     }]


Test patch: