<%= content_for(:header_tags) do %>
    <%= import_ke(enable_at: true, prettify: false, init_activity: true) %>
<% end %>

<div id="user_homework_list">
  <% homework_commons.each do |homework_common|%>
      <script type="text/javascript">
          $(function() {
              init_activity_KindEditor_data(<%= homework_common.id%>, null, "87%", "<%=homework_common.class.to_s%>");
          });

          function expand_reply(container,btnid){
              var target = $(container);
              var btn = $(btnid);
              if(btn.data('init')=='0'){
                  btn.data('init',1);
                  btn.html('收起回复');
                  target.show();
              }else{
                  btn.data('init',0);
                  btn.html('展开更多');
                  target.hide();
                  target.eq(0).show();
                  target.eq(1).show();
                  target.eq(2).show();
              }
          }
      </script>
      <%= render :partial => 'users/user_homework_detail', :locals => {:homework_common => homework_common,:is_in_course => is_in_course} %>
  <% end%>
  <% if homework_commons.count == 10%>
      <%= link_to "点击展开更多",homework_search_course_path(course_id,:page => page,:search=>search),:id => "user_show_more_homework",:remote => "true",:class => "loadMore f_grey"%>
  <% end%>
</div>