diff --git a/app/controllers/challenges_controller.rb b/app/controllers/challenges_controller.rb
index 953a3575f..89e298286 100644
--- a/app/controllers/challenges_controller.rb
+++ b/app/controllers/challenges_controller.rb
@@ -92,6 +92,11 @@ class ChallengesController < ApplicationController
end
def edit
+ challenge_num = Challenge.where(:shixun_id => @shixun).count
+ challenge_pos = @challenge.position
+ if challenge_pos < challenge_num
+ @next_challenge = Challenge.where(:shixun_id => @shixun, :position => challenge_pos+1).first
+ end
@tab = params[:tab].blank? ? 1 : params[:tab].to_i
@editor = params[:editor] # 编辑模式
end
diff --git a/app/views/challenges/_answer_form.html.erb b/app/views/challenges/_answer_form.html.erb
index 9e7ed5cde..11007ca74 100644
--- a/app/views/challenges/_answer_form.html.erb
+++ b/app/views/challenges/_answer_form.html.erb
@@ -20,7 +20,9 @@
保存
- 取消
+ <% if @challenge.answer %>
+ 取消
+ <% end %>
\ No newline at end of file
diff --git a/app/views/challenges/_edit_scoring.html.erb b/app/views/challenges/_edit_scoring.html.erb
index 4c19ce5bd..307f8d74c 100644
--- a/app/views/challenges/_edit_scoring.html.erb
+++ b/app/views/challenges/_edit_scoring.html.erb
@@ -18,7 +18,7 @@
* 奖励经验值:
- <%= @challenge.score %>分
+ <%= @challenge.score.nil? ? 0 : @challenge.score %>分
diff --git a/app/views/challenges/_evaluating_form.html.erb b/app/views/challenges/_evaluating_form.html.erb
index 83fb35cc1..953f2d55a 100644
--- a/app/views/challenges/_evaluating_form.html.erb
+++ b/app/views/challenges/_evaluating_form.html.erb
@@ -72,7 +72,9 @@
保存
- 取消
+ <% if @challenge.evaluation_way != 0 %>
+ 取消
+ <% end %>
diff --git a/app/views/challenges/_score_form.html.erb b/app/views/challenges/_score_form.html.erb
index 7f8e66622..ff8801819 100644
--- a/app/views/challenges/_score_form.html.erb
+++ b/app/views/challenges/_score_form.html.erb
@@ -24,7 +24,9 @@
保存
- 取消
+ <% if !@challenge.score.nil? %>
+ 取消
+ <% end %>
diff --git a/app/views/challenges/_skill_form.html.erb b/app/views/challenges/_skill_form.html.erb
index e7f0f81b9..b1f6b80e8 100644
--- a/app/views/challenges/_skill_form.html.erb
+++ b/app/views/challenges/_skill_form.html.erb
@@ -11,7 +11,7 @@
<% end %>
<% end %>
-
+
" id="add_shixun_skill">
×
@@ -44,16 +44,18 @@
$(".task-tag-input").attr("value","");
}
$("#shixun_skill_input").val("");
+ $("#add_shixun_skill").hide();
}
function close_tag(thisObj){
// 获取父节点的id
- var obj = thisObj.parentNode.id;
- $("#"+obj).remove();
+ var obj = $(thisObj).parent();
+ $(obj).remove();
}
function challenge_skill_update(){
var nSkill = $(".knowledge_frame");
+ add_tag();
if (nSkill.length > 0){
$("#challenge_skill_update").submit();
}else{
diff --git a/app/views/challenges/_task_pass_form.html.erb b/app/views/challenges/_task_pass_form.html.erb
index 30ab40395..b5ca126ed 100644
--- a/app/views/challenges/_task_pass_form.html.erb
+++ b/app/views/challenges/_task_pass_form.html.erb
@@ -31,7 +31,7 @@
<% if params[:action] == "new" %>
取消
<% else %>
-
取消
+
取消
<% end %>
diff --git a/app/views/challenges/edit.html.erb b/app/views/challenges/edit.html.erb
index 55bae7a68..521b6c719 100644
--- a/app/views/challenges/edit.html.erb
+++ b/app/views/challenges/edit.html.erb
@@ -19,6 +19,12 @@
diff --git a/app/views/shixuns/_shixun_list.html.erb b/app/views/shixuns/_shixun_list.html.erb
index db2105df6..2b0dcec9e 100644
--- a/app/views/shixuns/_shixun_list.html.erb
+++ b/app/views/shixuns/_shixun_list.html.erb
@@ -1,9 +1,9 @@
">
- <%= link_to "最新", search_shixuns_path(:order => "created_at", :status => @status, :language => @language, :search => @search, :trainee => @trainee, :major =>@major, :course => @course, :sort => @sort), :remote => true %>
+ <%= link_to "最新", search_shixuns_path(:order => "created_at", :shixun_status => @shixun_status, :status => @status, :language => @language, :search => @search, :trainee => @trainee, :major =>@major, :course => @course, :sort => @sort), :remote => true %>
">
- <%= link_to "最热", search_shixuns_path(:order => "myshixun_count", :status => @status, :language => @language, :search => @search, :trainee => @trainee, :major =>@major, :course => @course, :sort => @sort), :remote => true %>
+ <%= link_to "最热", search_shixuns_path(:order => "myshixun_count", :shixun_status => @shixun_status, :status => @status, :language => @language, :search => @search, :trainee => @trainee, :major =>@major, :course => @course, :sort => @sort), :remote => true %>