From acaac93da1e5fcde0d3744c5009eb911c5d4b044 Mon Sep 17 00:00:00 2001 From: cxt Date: Fri, 20 Nov 2015 11:08:50 +0800 Subject: [PATCH] tijiao --- app/views/exercise/_exercise_student.html.erb | 6 +++--- app/views/exercise/_exercise_student_result.html.erb | 6 +++--- app/views/exercise/_exercise_teacher.html.erb | 7 ++++++- app/views/exercise/_show_MC.html.erb | 2 +- app/views/exercise/_show_MCQ.html.erb | 2 +- app/views/exercise/_show_single.html.erb | 2 +- public/stylesheets/courses.css | 3 ++- 7 files changed, 17 insertions(+), 11 deletions(-) diff --git a/app/views/exercise/_exercise_student.html.erb b/app/views/exercise/_exercise_student.html.erb index 0cc34958f..bc91ead85 100644 --- a/app/views/exercise/_exercise_student.html.erb +++ b/app/views/exercise/_exercise_student.html.erb @@ -18,9 +18,9 @@
- <% mc_question_list = exercise_questions.where("question_type=1") %> - <% mcq_question_list = exercise_questions.where("question_type=2") %> - <% single_question_list = exercise_questions.where("question_type=3") %> + <% mc_question_list = exercise.exercise_questions.where("question_type=1") %> + <% mcq_question_list = exercise.exercise_questions.where("question_type=2") %> + <% single_question_list = exercise.exercise_questions.where("question_type=3") %>
">

单选题

<% mc_question_list.each do |exercise_question| %> diff --git a/app/views/exercise/_exercise_student_result.html.erb b/app/views/exercise/_exercise_student_result.html.erb index 40f9b953b..8a723d75c 100644 --- a/app/views/exercise/_exercise_student_result.html.erb +++ b/app/views/exercise/_exercise_student_result.html.erb @@ -19,9 +19,9 @@
得分:<%=exercise_user.score %>分
- <% mc_question_list = exercise_questions.where("question_type=1") %> - <% mcq_question_list = exercise_questions.where("question_type=2") %> - <% single_question_list = exercise_questions.where("question_type=3") %> + <% mc_question_list = exercise.exercise_questions.where("question_type=1") %> + <% mcq_question_list = exercise.exercise_questions.where("question_type=2") %> + <% single_question_list = exercise.exercise_questions.where("question_type=3") %>
">

单选题

<% mc_question_list.each do |exercise_question| %> diff --git a/app/views/exercise/_exercise_teacher.html.erb b/app/views/exercise/_exercise_teacher.html.erb index 4ddd5054d..b803519ce 100644 --- a/app/views/exercise/_exercise_teacher.html.erb +++ b/app/views/exercise/_exercise_teacher.html.erb @@ -107,7 +107,12 @@
<%= link_to "确定",exercise_index_path(:course_id => @course.id),:class => "ur_button_submit" %> - <%= link_to l(:button_edit), edit_exercise_path(exercise.id), :class => "ur_button_submit", :style => "float:right"%> + <% if exercise.exercise_status == 1 %> + <%= link_to l(:button_edit), edit_exercise_path(exercise.id), :class => "ur_button_submit", :style => "float:right"%> + <% else %> + 编辑 + <%#= link_to l(:button_edit), '', :class => "ur_button_submit", :style => "float:right; background:#a3a3a3"%> + <% end %>
diff --git a/app/views/exercise/_show_MC.html.erb b/app/views/exercise/_show_MC.html.erb index 0883995dc..183e8d190 100644 --- a/app/views/exercise/_show_MC.html.erb +++ b/app/views/exercise/_show_MC.html.erb @@ -39,7 +39,7 @@ } else{ <% score =exercise_question.question_score %> $("#insert_new_poll_question_"+quest_type+"_"+quest_id).html( - '<%= form_for(ExerciseQuestion.new,:html=>{:multipart=>true},:url=>create_exercise_question_exercise_path(exercise_question.id),:remote=>true) do |f|%>'+ + '<%= form_for(ExerciseQuestion.new,:html=>{:multipart=>true},:url=>create_exercise_question_exercise_path(exercise_question.exercise.id),:remote=>true) do |f|%>'+ '
'+ '
'+ ''+ diff --git a/app/views/exercise/_show_MCQ.html.erb b/app/views/exercise/_show_MCQ.html.erb index 52f01e6c7..af2b0facb 100644 --- a/app/views/exercise/_show_MCQ.html.erb +++ b/app/views/exercise/_show_MCQ.html.erb @@ -38,7 +38,7 @@ } else { <% score =exercise_question.question_score %> $("#insert_new_poll_question_"+quest_type+"_"+quest_id).html( - '<%= form_for(ExerciseQuestion.new,:html=>{:multipart=>true},:url=>create_exercise_question_exercise_path(exercise_question.id),:remote=>true) do |f|%>'+ + '<%= form_for(ExerciseQuestion.new,:html=>{:multipart=>true},:url=>create_exercise_question_exercise_path(exercise_question.exercise.id),:remote=>true) do |f|%>'+ '
'+ '
'+ ''+ diff --git a/app/views/exercise/_show_single.html.erb b/app/views/exercise/_show_single.html.erb index 933f2edcc..9c7936e6d 100644 --- a/app/views/exercise/_show_single.html.erb +++ b/app/views/exercise/_show_single.html.erb @@ -26,7 +26,7 @@ } else { <% score =exercise_question.question_score %> $("#insert_new_poll_question_"+quest_type+"_"+quest_id).html( - '<%= form_for(ExerciseQuestion.new,:html=>{:multipart=>true},:url=>create_exercise_question_exercise_path(exercise_question.id),:remote=>true) do |f|%>'+ + '<%= form_for(ExerciseQuestion.new,:html=>{:multipart=>true},:url=>create_exercise_question_exercise_path(exercise_question.exercise.id),:remote=>true) do |f|%>'+ '
'+ '
'+ ''+ diff --git a/public/stylesheets/courses.css b/public/stylesheets/courses.css index e267b9010..5ff34a4e1 100644 --- a/public/stylesheets/courses.css +++ b/public/stylesheets/courses.css @@ -1165,4 +1165,5 @@ a:hover.testEdit{ background:url(images/icons.png) -21px -272px no-repeat;} .testEditTitle{ padding:10px 0px ; float:left; width:564px; } .questionEditContainer {border:1px solid #cbcbcb;background:#eeeeee; padding:10px; margin-bottom:10px; margin-top:10px;} .fillInput {border:1px solid #cbcbcb; padding-left:5px; background-color:#ffffff; width:693px; height:30px; color:#888888;} -.mr130 {margin-right:130px;} \ No newline at end of file +.mr130 {margin-right:130px;} +.ur_button_submit{ display:block; width:106px; height:31px; margin:0 auto; background:#15bccf; color:#fff; font-size:16px; text-align:center; padding-top:4px; margin-bottom:10px; } \ No newline at end of file