<style>
    .tscore_con h2{ display:block; background:#eaeaea; font-size:14px; color:#343333; height:31px; width: auto;  text-align: center; padding-top:5px;}
    .tscore_box li{ height:25px;}
</style>


<div class="tscore_con" id="user_score">
  <% act_score = CourseContributorScore.where("user_id = ? and course_id = ?", member.user_id, member.course_id).first %>
  <h2><%= member.user.show_name %> 活跃度计算</h2>
  <% if act_score.nil? %>
      <div style="padding-left: 40px;padding-bottom: 2px;padding-right: 2px;padding-top: 10px;">
        资源发布数 x 5 = 0 x 5 = 0</br>
        问答发布数 x 2 = 0 x 2 = 0</br>
        通知发布数 x 1 = 0 x 1 = 0</br>
        问答回帖数 x 1 = 0 x 1 = 0</br>
        作业留言数 x 1 = 0 x 1 = 0</br>
        通知留言数 x 1 = 0 x 1 = 0</br>
        课程留言数  x 1 = 0 x 1 = 0</br>
        总得分：0
      </div>
  <% else %>
      <% total_score = act_score.resource_num.to_i * 5 + act_score.message_num.to_i * 2 +
              act_score.message_reply_num.to_i * 1 + act_score.journal_num.to_i * 1 +
              + act_score.homework_journal_num.to_i * 1 + act_score.news_reply_num.to_i * 1 +
              act_score.news_num.to_i * 1 %>
      <div style="padding-left: 40px;padding-bottom: 2px;padding-right: 2px;padding-top: 10px;">
        资源发布数 x 5 = <%= act_score.resource_num.to_i %> x 5 = <%= act_score.resource_num.to_i * 5 %></br>
        问答发布数 x 2 = <%= act_score.message_num.to_i %> x 2 = <%= act_score.message_num.to_i * 2 %></br>
        通知发布数 x 1 = <%= act_score.news_num.to_i %> x 1 = <%= act_score.news_num.to_i %></br>
        问答回帖数 x 1 = <%= act_score.message_reply_num.to_i %> x 1 = <%= act_score.message_reply_num.to_i %></br>
        作业留言数 x 1 = <%= act_score.homework_journal_num.to_i %> x 1 = <%= act_score.homework_journal_num.to_i %></br>
        通知留言数 x 1 = <%= act_score.news_reply_num.to_i %> x 1 = <%= act_score.news_reply_num.to_i %></br>
        课程留言数  x 1 = <%= act_score.journal_num.to_i %> x 1 = <%= act_score.journal_num.to_i %></br>
        总得分：<%=total_score %>
      </div>
  <% end %>

</div>
