indentlabs/notebook

View on GitHub
app/views/document_analyses/readability/_linsear_write.html.erb

Summary

Maintainability
Test Coverage
<% if analysis.linsear_write_grade %>
  <div class="row">
    <div class="col s12 m12 l12">
      <div class="card">
        <div class="card-content">
          <div class="card-title">
            <span class="right"><%= analysis.linsear_write_grade.try(:round) %> / 16</span>
            <i class="left material-icons orange-text">bubble_chart</i>
            Linsear Write Formula
          </div>
          <div class="progress">
            <div class="determinate" style="width: <%= 100 * analysis.linsear_write_grade.try(:round) / 16 %>%"></div>
          </div>
          <div class="row">
            <div class="col s12 m12 l7">
              <p>
                According to this scale, your document is
                <% if analysis.linsear_write_grade.round > 12 %>
                  <strong>
                    Understandable by a <%= (analysis.linsear_write_grade.round - 12).ordinalize %>-year college student.
                  </strong>
                <% else %>
                  <strong>
                    Understandable by a <%= analysis.linsear_write_grade.round.ordinalize %>-grade reader.
                  </strong>
                <% end %>
              </p>
              <br />
              <p>
                The Linsear Write Formula was designed for the United States Air Force to help them calculate the readability of Air Force technical manuals.
              </p>
              <br />
              <p>
                Simply put, this scale considers shorter sentences and shorter words easier to read. Rather than penalizing complex words and long sentences,
                it measures readability by tallying up easy words and sentences.
              </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 more words of at least three syllables.
                </li>
                <li class="clearfix">
                  <i class="material-icons left red-text">arrow_drop_up</i>
                  Use fewer or longer sentences.
                </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 more one- and two-syllable words.
                </li>
                <li class="clearfix">
                  <i class="material-icons left green-text">arrow_drop_up</i>
                  Use more sentences.
                </li>
              </ul>
              <br />
            </div>
          </div>
          
        </div>
      </div>
    </div>
  </div>
<% end %>