|
|
@ -7,6 +7,7 @@
|
|
|
|
<% my_work = @homework.student_works.where("user_id = #{User.current.id}").first %>
|
|
|
|
<% my_work = @homework.student_works.where("user_id = #{User.current.id}").first %>
|
|
|
|
<% if !@is_teacher && my_work.nil? && User.current.member_of_course?(@course) %>
|
|
|
|
<% if !@is_teacher && my_work.nil? && User.current.member_of_course?(@course) %>
|
|
|
|
<span class="f12 c_red">您尚未提交作品</span>
|
|
|
|
<span class="f12 c_red">您尚未提交作品</span>
|
|
|
|
|
|
|
|
<%=link_to "提交作品", new_student_work_url_without_domain(@homework.id),:class => 'blueCir ml5 f12' %>
|
|
|
|
<% elsif !@is_teacher && my_work &&Time.parse(@homework.end_time.to_s).strftime("%Y-%m-%d") < Time.parse(Time.now.to_s).strftime("%Y-%m-%d") && !@stundet_works.empty?%>
|
|
|
|
<% elsif !@is_teacher && my_work &&Time.parse(@homework.end_time.to_s).strftime("%Y-%m-%d") < Time.parse(Time.now.to_s).strftime("%Y-%m-%d") && !@stundet_works.empty?%>
|
|
|
|
<span class="f12 c_red">您已提交且不可再修改,因为截止日期已过</span>
|
|
|
|
<span class="f12 c_red">您已提交且不可再修改,因为截止日期已过</span>
|
|
|
|
<% elsif !@is_teacher && my_work &&Time.parse(@homework.end_time.to_s).strftime("%Y-%m-%d") >= Time.parse(Time.now.to_s).strftime("%Y-%m-%d") && !@stundet_works.empty?%>
|
|
|
|
<% elsif !@is_teacher && my_work &&Time.parse(@homework.end_time.to_s).strftime("%Y-%m-%d") >= Time.parse(Time.now.to_s).strftime("%Y-%m-%d") && !@stundet_works.empty?%>
|
|
|
@ -58,7 +59,7 @@
|
|
|
|
<% end %>
|
|
|
|
<% end %>
|
|
|
|
<% unless work.nil? %>
|
|
|
|
<% unless work.nil? %>
|
|
|
|
<% if @homework.homework_type == 2 %>
|
|
|
|
<% if @homework.homework_type == 2 %>
|
|
|
|
$("#about_hwork_<%= work.id%>").html("<%= escape_javascript(render :partial => 'programing_work_show',:locals => {:work =>work,:score =>student_work_score(work,User.current),:student_work_scores => work.student_works_scores.order("updated_at desc")}) %>");
|
|
|
|
$("#about_hwork_<%= work.id%>").html("<%= escape_javascript(render :partial => 'programing_work_show',:locals => {:work =>work,:score =>student_work_score(work,User.current),:student_work_scores => work.student_works_scores.order("updated_at desc"),:is_focus => @is_focus}) %>");
|
|
|
|
|
|
|
|
|
|
|
|
var program_name = "text/x-csrc";
|
|
|
|
var program_name = "text/x-csrc";
|
|
|
|
var language = <%= @homework.language %>;
|
|
|
|
var language = <%= @homework.language %>;
|
|
|
@ -82,11 +83,11 @@
|
|
|
|
value: $("#work-src_<%= work.id%>").text()
|
|
|
|
value: $("#work-src_<%= work.id%>").text()
|
|
|
|
});
|
|
|
|
});
|
|
|
|
<% elsif @homework.homework_type == 1 %>
|
|
|
|
<% elsif @homework.homework_type == 1 %>
|
|
|
|
$("#about_hwork_<%= work.id%>").html("<%= escape_javascript(render :partial => 'show',:locals => {:work => work, :score =>student_work_score(work,User.current),:student_work_scores => work.student_works_scores.order("updated_at desc")}) %>");
|
|
|
|
$("#about_hwork_<%= work.id%>").html("<%= escape_javascript(render :partial => 'show',:locals => {:work => work, :score =>student_work_score(work,User.current),:student_work_scores => work.student_works_scores.order("updated_at desc"),:is_focus => @is_focus}) %>");
|
|
|
|
<% elsif @homework.homework_type == 3 %>
|
|
|
|
<% elsif @homework.homework_type == 3 %>
|
|
|
|
<% pro = @homework.student_work_projects.where(:user_id => User.current.id).first %>
|
|
|
|
<% pro = @homework.student_work_projects.where(:user_id => User.current.id).first %>
|
|
|
|
<% if pro && pro.student_work_id == work.id %>
|
|
|
|
<% if pro && pro.student_work_id == work.id %>
|
|
|
|
$("#about_hwork_<%= work.id%>").html("<%= escape_javascript(render :partial => 'show',:locals => {:work => work, :score =>student_work_score(work,User.current),:student_work_scores => work.student_works_scores.order("updated_at desc")}) %>");
|
|
|
|
$("#about_hwork_<%= work.id%>").html("<%= escape_javascript(render :partial => 'show',:locals => {:work => work, :score =>student_work_score(work,User.current),:student_work_scores => work.student_works_scores.order("updated_at desc"),:is_focus => @is_focus}) %>");
|
|
|
|
<% end %>
|
|
|
|
<% end %>
|
|
|
|
<% end %>
|
|
|
|
<% end %>
|
|
|
|
$('#score_<%= work.id%>').peSlider({range: 'min'});
|
|
|
|
$('#score_<%= work.id%>').peSlider({range: 'min'});
|
|
|
|