diff --git a/app/controllers/shixuns_controller.rb b/app/controllers/shixuns_controller.rb index bb25f1404..14deb6c65 100644 --- a/app/controllers/shixuns_controller.rb +++ b/app/controllers/shixuns_controller.rb @@ -725,6 +725,16 @@ class ShixunsController < ApplicationController end end + def fork_list + @shixuns = Shixun.where(:fork_from => @shixun.id) + @shixuns_count = @shixuns.count + @limit = 16 + @is_remote = true + @shixun_pages = Paginator.new @shixuns_count, @limit, params['page'] || 1 + @offset ||= @shixun_pages.offset + @shixuns = paginateHelper @shixuns, @limit + end + def show respond_to do |format| format.html{redirect_to shixun_challenges_path(@shixun)} diff --git a/app/views/attachments/_activity_attach.html.erb b/app/views/attachments/_activity_attach.html.erb index fd6eb661f..162eb239b 100644 --- a/app/views/attachments/_activity_attach.html.erb +++ b/app/views/attachments/_activity_attach.html.erb @@ -1,15 +1,15 @@ <% if activity.attachments.any? %> <% activity.attachments.each do |attachment| %>
第<%= i + 1 %>题:[<%= exercise_question.question_type_name %>]<%= exercise_question.question_score %>分
+第<%= i + 1 %>题:[<%= exercise_question.question_type_name %>]<%= exercise_question.question_score %>分
第<%= exercise_question.question_number %>题:[<%= exercise_question.question_type_name %>]<%= exercise_question.question_score %>分<%= question_commit_status exercise_question, @exercise_user.user %>
+第<%= exercise_question.question_number %>题:[<%= exercise_question.question_type_name %>]<%= exercise_question.question_score %>分<%= question_commit_status exercise_question, @exercise_user.user %>
<% if exercise_question.question_type != 4 %> <% is_correct = answer_is_correct(exercise_question, user) %><%= is_correct ? exercise_question.question_score : 0 %>分
diff --git a/app/views/exercise/_new_question.html.erb b/app/views/exercise/_new_question.html.erb index 8aff26709..169230966 100644 --- a/app/views/exercise/_new_question.html.erb +++ b/app/views/exercise/_new_question.html.erb @@ -2,10 +2,11 @@ <%= import_ke(enable_at: false, prettify: false, init_activity: false) %> <% end %> -单选题 -多选题 -填空题 -简答题 ++ 单选题 ++ 多选题 ++ 填空题 ++ 简答题 + diff --git a/app/views/exercise/student_exercise_list.html.erb b/app/views/exercise/student_exercise_list.html.erb index 103fafdb3..45e999a73 100644 --- a/app/views/exercise/student_exercise_list.html.erb +++ b/app/views/exercise/student_exercise_list.html.erb @@ -31,17 +31,46 @@- <%= @user.show_name %> > 论坛 + <%= @user.show_name %> > 讨论区
- <%= memo.viewed_count %> - <%= get_praise_num(memo) %> - <%= Memo.where(:root_id => memo.id).count %> - + <% if memo.viewed_count > 0%> + <%= memo.viewed_count %> + <% end %> + <% if get_praise_num(memo) > 0%> + <%= get_praise_num(memo) %> + <% end %> + <% if Memo.where(:root_id => memo.id).count > 0%> + <%= Memo.where(:root_id => memo.id).count %> + <% end %> +
diff --git a/app/views/layouts/_course_base_info.html.erb b/app/views/layouts/_course_base_info.html.erb index 18fce614e..b255a3fcf 100644 --- a/app/views/layouts/_course_base_info.html.erb +++ b/app/views/layouts/_course_base_info.html.erb @@ -82,8 +82,8 @@ <% end %> <% unless (is_teacher || is_TA || is_TE || is_ST) %> -
<%= link_to "加入课堂", join_private_courses_courses_path, :remote => true, :method => "post", :class => 'color_white' %>
+<%= link_to "加入课堂", join_private_courses_courses_path, :remote => true, :method => "post", :class => 'white-btn orange-btn' %>
<% if comment.creator_user == User.current %> 删除 + | <% end %> - | <%= link_to( '回复'.html_safe, {:controller => 'users' ,:action => 'reply_to',:reply_id => comment.id, :type => memo.class.to_s, :user_activity_id => memo.id}, diff --git a/app/views/memos/show.html.erb b/app/views/memos/show.html.erb index addf53876..7a32dd01b 100644 --- a/app/views/memos/show.html.erb +++ b/app/views/memos/show.html.erb @@ -5,11 +5,11 @@
- <%= @user.show_name %> > 讨论 + <%= @user.show_name %> > 讨论区
- 讨论详情 + 帖子详情
- <% if is_teacher || comment.creator_user == User.current%> - 删除 - <% end %> - | - <%= link_to( - '回复'.html_safe, - {:controller => 'users' ,:action => 'reply_to',:reply_id => comment.id, :type => activity.class.to_s, :user_activity_id => activity.id}, - :remote => true, - :method => 'get', - :title => l(:button_reply),:class => "color-grey") %> - | - - <%=render :partial=> "praise_tread/edu_praise", :locals => {:activity=>comment, :user_activity_id=>comment.id,:type=>"reply"}%> - -
-
+ <% if is_teacher || comment.creator_user == User.current%> + 删除 + <% end %> + | + <%= link_to( + '回复'.html_safe, + {:controller => 'users' ,:action => 'reply_to',:reply_id => comment.id, :type => activity.class.to_s, :user_activity_id => activity.id}, + :remote => true, + :method => 'get', + :title => l(:button_reply),:class => "color-grey") %> + | + + <%=render :partial=> "praise_tread/edu_praise", :locals => {:activity=>comment, :user_activity_id=>comment.id,:type=>"reply"}%> + +
+- <%= @shixun.owner.try(:show_name) %> - /
<%= @shixun.name %>
- ++ <%= @shixun.owner.try(:show_name) %> + /
<%= @shixun.name %>
+ + <% if @shixun.fork_from.present? %> + <% fork_shixun = Shixun.find(@shixun.fork_from) %> + + forked from <%= fork_shixun.owner.try(:show_name) %>/<%= fork_shixun.name %> + <% end %> + + + <% unless User.current.manager_of_shixun?(@shixun) %> + <%= @shixun.language %> + <%= @shixun.shixun_trainee %> + <%= @shixun.shixun_major_courses.blank? ? "" : CourseList.where(:id => @shixun.shixun_major_courses.map(&:course_list_id)).map(&:name).join("、") %> + <% end %> ++ <%= shixun.name %> +
+<%= shixun.shixun_trainee %>
++- <%= shixun.challenges.count %>
+ - <%= shixun.myshixuns.count %>
+ - <%= shixun.shixun_score %>
+
++ <%= pagination_links_full @shixun_pages, @shixuns_count, :per_page_links => false, :remote => @is_remote, :flag => true, :is_new => true %> +
+ +- <%= render :partial=>"attachments/activity_attach", :locals=>{:activity => @homework} %> -
-<% if @homework.homework_type == 3 %> -分组要求
-分组人数: <%= @homework.homework_detail_group.min_num %> - <%= @homework.homework_detail_group.max_num %> 人
- 注:任一成员都可以提交作品,提交作品时需要关联同组成员,组内成员作品共享。 -输入输出样例:<%= samples.count %> 组
---
-
- 样例<%= index + 1 %>
-
- -
-
-
-
-
-
- -
-
-
-
-
-
-
-+ 作业说明: + 编辑 + 保存 +
+兴趣的信息,利用所学到的有关“协议与编码器”/解码器/转换器/处理器”的思维,为该类信息设计协议
+ +测试集:<%=@homework.homework_tests.count %> 组
-+ <%= render :partial=>"attachments/activity_attach", :locals=>{:activity => @homework} %> +
+ <% if @homework.homework_type == 3 %> +分组要求
+分组人数: <%= @homework.homework_detail_group.min_num %> - <%= @homework.homework_detail_group.max_num %> 人
+ 注:任一成员都可以提交作品,提交作品时需要关联同组成员,组内成员作品共享。 +输入输出样例:<%= samples.count %> 组
++-
+
+ 样例<%= index + 1 %>
+
+ -
+
+
+
+
+
+ -
+
+
+
+
+
+
+测试集:<%=@homework.homework_tests.count %> 组
+提示
提示
' + str + '
提示
提示
' + str + '
提示
提示
' + str + '
提示
提示
' + str + '
提示
提示
' + str + '
提示
提示
' + str + '
提示
提示
' + str + '
提示
提示
' + str + '