diff --git a/app/controllers/exercise_controller.rb b/app/controllers/exercise_controller.rb
index 296c744b6..ce3412caa 100644
--- a/app/controllers/exercise_controller.rb
+++ b/app/controllers/exercise_controller.rb
@@ -20,7 +20,10 @@ class ExerciseController < ApplicationController
end
def new
-
+ @exercise = Exercise.new
+ respond_to do |format|
+ format.html{render :layout => 'base_courses'}
+ end
end
def create
@@ -28,7 +31,9 @@ class ExerciseController < ApplicationController
end
def edit
-
+ respond_to do |format|
+ format.html{render :layout => 'base_courses'}
+ end
end
def update
@@ -51,6 +56,7 @@ class ExerciseController < ApplicationController
@exercise_count = @exercise.exercise_users.where('score is not NULL').count
if @is_teacher || (!@exercise.exercise_users.where(:user_id => User.current.id).empty? && Time.parse(@exercise.end_time.to_s).strftime("%Y-%m-%d-%H-%M-%S") <= Time.now.strftime("%Y-%m-%d-%H-%M-%S"))
@exercise_users_list = @exercise.exercise_users.where('score is not NULL')
+ @show_all = true;
elsif !@exercise.exercise_users.where(:user_id => User.current.id).empty? && Time.parse(@exercise.end_time.to_s).strftime("%Y-%m-%d-%H-%M-%S") > Time.now.strftime("%Y-%m-%d-%H-%M-%S")
@exercise_users_list = @exercise.exercise_users.where("user_id = ? and score is not NULL",User.current.id)
else
diff --git a/app/views/exercise/_edit_head.html.erb b/app/views/exercise/_edit_head.html.erb
new file mode 100644
index 000000000..b315d343c
--- /dev/null
+++ b/app/views/exercise/_edit_head.html.erb
@@ -0,0 +1,24 @@
+
+
+
+
+ <%# if edit_mode %>
+
+ <%# end %>
+
+
+ <%= calendar_for('homework_end_time')%>
+
+ <%# if edit_mode %>
+
+ <%# end %>
+
+
+ <%= calendar_for('homework_publish_time')%>
+
+
考试时长: 分钟
+
+
+
保存 取消
+
+
\ No newline at end of file
diff --git a/app/views/exercise/_exercise_content.html.erb b/app/views/exercise/_exercise_content.html.erb
new file mode 100644
index 000000000..76bad6a83
--- /dev/null
+++ b/app/views/exercise/_exercise_content.html.erb
@@ -0,0 +1,23 @@
+
+<% poll.exercise_questions.each do |poll_question|%>
+
+
+
+ <% if poll_question.question_type == 1%>
+ <%= render :partial => 'edit_MC', :locals => {:poll_question => poll_question} %>
+ <% elsif poll_question.question_type == 2%>
+ <%= render :partial => 'edit_MCQ', :locals => {:poll_question => poll_question} %>
+ <% elsif poll_question.question_type == 3%>
+ <%= render :partial => 'edit_single', :locals => {:poll_question => poll_question} %>
+ <% end%>
+
+
+<% end %>
\ No newline at end of file
diff --git a/app/views/exercise/_exercise_form.html.erb b/app/views/exercise/_exercise_form.html.erb
new file mode 100644
index 000000000..a062f1d80
--- /dev/null
+++ b/app/views/exercise/_exercise_form.html.erb
@@ -0,0 +1,333 @@
+<%= stylesheet_link_tag 'polls', :media => 'all' %>
+
+
diff --git a/app/views/exercise/_new_MC.html.erb b/app/views/exercise/_new_MC.html.erb
new file mode 100644
index 000000000..0ff662b3f
--- /dev/null
+++ b/app/views/exercise/_new_MC.html.erb
@@ -0,0 +1,38 @@
+
\ No newline at end of file
diff --git a/app/views/exercise/_new_MCQ.html.erb b/app/views/exercise/_new_MCQ.html.erb
new file mode 100644
index 000000000..0ba2a0133
--- /dev/null
+++ b/app/views/exercise/_new_MCQ.html.erb
@@ -0,0 +1,39 @@
+
\ No newline at end of file
diff --git a/app/views/exercise/_new_single.html.erb b/app/views/exercise/_new_single.html.erb
new file mode 100644
index 000000000..0082303b7
--- /dev/null
+++ b/app/views/exercise/_new_single.html.erb
@@ -0,0 +1,28 @@
+
\ No newline at end of file
diff --git a/app/views/exercise/_student_exercise.html.erb b/app/views/exercise/_student_exercise.html.erb
index b133baa04..25bf3f7cd 100644
--- a/app/views/exercise/_student_exercise.html.erb
+++ b/app/views/exercise/_student_exercise.html.erb
@@ -10,37 +10,64 @@
您已提交
<% end %>
- <%if @is_teacher || @exercise.exercise_status == 3%>
-
- <%= render :partial => "evaluation_un_title"%>
+ <%= render :partial => "student_table"%>
-<% @stundet_works.each do |student_work|%>
- <% if @is_evaluation%>
- <%= render :partial => "evaluation_work", :locals => {:student_work => student_work}%>
- <% else%>
- <%= render :partial => "evaluation_un_work", :locals => {:student_work => student_work}%>
- <% end%>
-
-
- <% if student_work.user == User.current && !@is_evaluation %>
- <% if @homework.homework_type == 2%>
- <%=render :partial => 'programing_work_show', :locals=> {:work => student_work, :score =>student_work_score(student_work,User.current),:student_work_scores => student_work.student_works_scores.order("updated_at desc")} %>
- <% else %>
- <%=render :partial => 'show' , :locals=> {:work => student_work, :score =>student_work_score(student_work,User.current),:student_work_scores => student_work.student_works_scores.order("updated_at desc")} %>
- <% end %>
- <% end %>
-
+<% @exercise_users_list.each do |exercise|%>
+
+
+
+
+
+ <%= link_to(image_tag(url_to_avatar(exercise.user),:width =>"40",:height => "40"),user_activities_path(exercise.user)) %>
+
+
+
+
+
+ <%= exercise.user.show_name%>
+
+
+ <%= exercise.user.user_extensions.nil? ? "--" : exercise.user.user_extensions.student_id%>
+
+
+ --
+
+
+
+
+
+
+
+ <% if exercise.created_at%>
+ <%= Time.parse(format_time(exercise.created_at)).strftime("%m-%d %H:%M")%>
+ <% end %>
+
+
+
+ <%= exercise.score.nil? ? "--" : format("%.1f",exercise.score)%>
+
+ 点击查看详情
+
+
<% end%>
\ No newline at end of file
diff --git a/app/views/exercise/_student_table.html.erb b/app/views/exercise/_student_table.html.erb
new file mode 100644
index 000000000..719667973
--- /dev/null
+++ b/app/views/exercise/_student_table.html.erb
@@ -0,0 +1,22 @@
+
+
+
+ 姓名
+ 学号
+ 班级
+
+
+
+ <%= link_to "时间",'',:class => "c_dark f14 fb fl ml50" ,:remote => true%>
+ <%# if @show_all && @order == "created_at"%>
+ <%#= link_to "", student_work_index_path(:homework => @homework.id,:order => "created_at", :sort => @score, :name => @name, :group => @group) ,:class => "#{@score == 'desc' ? 'st_up' : 'st_down'} mt10",:remote => true%>
+ <%# end%>
+
+
+
+ <%= link_to "成绩",'',:class => "c_dark f14 fb fl ml10",:remote => true%>
+ <%# if @show_all && @order == "score"%>
+ <%#= link_to "", student_work_index_path(:homework => @homework.id,:order => "score", :sort => @score, :name => @name, :group => @group) ,:class => "#{@score == 'desc' ? 'st_up' : 'st_down'} mt10",:remote => true%>
+ <%# end%>
+
+
\ No newline at end of file
diff --git a/app/views/exercise/edit.html.erb b/app/views/exercise/edit.html.erb
new file mode 100644
index 000000000..0b20dc90e
--- /dev/null
+++ b/app/views/exercise/edit.html.erb
@@ -0,0 +1 @@
+<%= render :partial => 'exercise_form'%>
\ No newline at end of file
diff --git a/app/views/exercise/new.html.erb b/app/views/exercise/new.html.erb
index e69de29bb..3d983d64f 100644
--- a/app/views/exercise/new.html.erb
+++ b/app/views/exercise/new.html.erb
@@ -0,0 +1 @@
+<%= render :partial => 'exercise_form'%>
diff --git a/public/stylesheets/courses.css b/public/stylesheets/courses.css
index 5469078a5..fdba7426a 100644
--- a/public/stylesheets/courses.css
+++ b/public/stylesheets/courses.css
@@ -83,6 +83,7 @@ a.hworkSearchIcon:hover {background:url(../images/nav_icon.png) -49px -1px no-re
.width180{width: 180px;}
.width525{width: 525px;}
.width285{width: 285px;}
+.width530{width: 530px;}
.mr95{margin-right: 95px;}
.mr140 {margin-right: 140px;}
.ml100{margin-left: 100px;}
@@ -1141,3 +1142,17 @@ input.sendSourceText {
width: 50px;
height: 25px;
}
+
+/*20151117在线测验byTim*/
+.testContainer {width:698px; border:1px solid #cbcbcb;background:#eeeeee; padding:10px; margin-bottom:10px;}
+.testTitle{ width:678px; height:40px; padding:0 10px; text-align:center; font-size:16px; font-weight:bold; background:#fff;border-style:solid; border:1px solid #CBCBCB;}
+.testDes{ width:678px; height:120px; padding:10px; margin-bottom:10px; background:#fff; border-style:solid; border:1px solid #CBCBCB; resize:none;}
+.btn_submit{ width:56px; height:24px; padding-top:4px;background:#269ac9; color:#fff; text-align:center; display:block; float:left; margin-right:10px;}
+a:hover.btn_submit{background:#297fb8;}
+.btn_cancel{width:54px; height:22px; padding-top:4px;background:#fff; color:#999; border:1px solid #999; text-align:center; display:block; float:left; }
+a:hover.btn_cancel{ color:#666;}
+.testQuestion{ width:708px; height: auto; border:1px solid #cbcbcb; padding:10px 0 0 10px; margin-bottom:10px;}
+.mr118 {margin-right:118px !important;}
+.questionContainer {width:698px; border:1px solid #cbcbcb;background:#eeeeee; padding:10px; margin-bottom:10px;}
+.questionTitle{ width:644px; height:30px; border:1px solid #cbcbcb; padding-left:5px; background:#fff;}
+.examTime {width:40px; border:1px solid #cbcbcb; outline:none; height:28px; text-align:center; padding-left:0px; }
\ No newline at end of file