app/views/document_analyses/readability/_automated_readability_index.html.erb
<% if analysis.automated_readability_index %>
<div class="row">
<div class="col s12 m12 l12">
<div class="card">
<div class="card-content">
<div class="card-title">
<span class="right"><%= analysis.automated_readability_index.try(:round) %> / 16</span>
<i class="left material-icons orange-text">bubble_chart</i>
Automated Readability Index
</div>
<div class="progress">
<div class="determinate" style="width: <%= 100 * analysis.automated_readability_index.try(:round) / 16 %>%"></div>
</div>
<div class="row">
<div class="col s12 m12 l7">
<p>
According to this scale, your document is
<% if analysis.automated_readability_index.round > 12 %>
<strong>
Understandable by a <%= (analysis.automated_readability_index.round - 12).ordinalize %>-year college student.
</strong>
<% else %>
<strong>
Understandable by a <%= analysis.automated_readability_index.round.ordinalize %>-grade reader.
</strong>
<% end %>
</p>
<br />
<p>
The Automated Readability Index measures differentials in difficulty between words and
sentences to access how understandable text as a whole is to the average reader.
</p>
<br />
<p>
A <strong>higher score</strong> on this scale indicates a document is <strong class="red-text">harder to understand</strong>.
</p>
</div>
<div class="col s12 m12 l4 offset-l1">
<p class="red-text text-darken-3">
To <strong>raise</strong> your score on this scale:
</p>
<ul>
<li>
<i class="material-icons left red-text">arrow_drop_up</i>
Use longer words.
</li>
<li class="clearfix">
<i class="material-icons left red-text">arrow_drop_up</i>
Use more words per sentence.
</li>
</ul>
<br />
<p class="green-text text-darken-4">
To <strong>lower</strong> your score on this scale:
</p>
<ul>
<li>
<i class="material-icons left green-text">arrow_drop_down</i>
Use shorter words.
</li>
<li class="clearfix">
<i class="material-icons left green-text">arrow_drop_down</i>
Use fewer words per sentences.
</li>
</ul>
<br />
</div>
</div>
</div>
</div>
</div>
</div>
<% end %>