diff --git a/app/controllers/boards_controller.rb b/app/controllers/boards_controller.rb index 7aba1442..2329db0f 100644 --- a/app/controllers/boards_controller.rb +++ b/app/controllers/boards_controller.rb @@ -326,14 +326,16 @@ class BoardsController < ApplicationController end def update_position - if @course || @contest + if @course + @is_teacher = User.current.allowed_to?(:as_teacher,@course) || User.current.admin? + boards = @board.parent.children - if params[:opr] == 'up' && @board.position > 1 + if @is_teacher && params[:opr] == 'up' && @board.position > 1 before_board = boards.where("position = #{@board.position - 1}").first if before_board && @board.update_attribute('position', @board.position - 1) before_board.update_attribute('position', before_board.position + 1) end - elsif params[:opr] == 'down' && @board.position < boards.count + elsif @is_teacher && params[:opr] == 'down' && @board.position < boards.count after_board = boards.where("position = #{@board.position + 1}").first if after_board && @board.update_attribute('position', @board.position + 1) after_board.update_attribute('position', after_board.position - 1) diff --git a/app/controllers/exercise_controller.rb b/app/controllers/exercise_controller.rb index 65a0b9e9..15998dbf 100644 --- a/app/controllers/exercise_controller.rb +++ b/app/controllers/exercise_controller.rb @@ -73,8 +73,14 @@ class ExerciseController < ApplicationController @exercise_user = ExerciseUser.where("user_id=? and exercise_id=?", User.current.id, @exercise.id).first if @exercise_user.nil? @exercise_user = ExerciseUser.create(:user_id => User.current.id, :exercise_id => @exercise.id, :start_at => Time.now, :status => false, :commit_status => 0) + if @exercise.exercise_level_settings.where("num != exercise_questions_count").count > 0 + @exercise.create_user_question_list(@exercise_user) + end # @exercise_user = ExerciseUser.where("user_id=? and exercise_id=?", User.current.id, @exercise.id).first elsif @exercise_user.start_at.nil? + if @exercise.exercise_level_settings.where("num != exercise_questions_count").count > 0 + @exercise.create_user_question_list(@exercise_user) + end @exercise_user.update_attributes(:start_at => Time.now) end @@ -103,7 +109,9 @@ class ExerciseController < ApplicationController @exercise_user = ExerciseUser.where("user_id=? and exercise_id=?", params[:user_id], @exercise.id).first @can_edit_excercise = false end - Rails.logger.info("###########can_edit_excercise:#{@can_edit_excercise}") + + @exercise_questions = user_question_list @exercise_user.id + # @percent = get_percent(@exercise,User.current) #@exercise_questions = @exercise.exercise_questions respond_to do |format| @@ -139,11 +147,16 @@ class ExerciseController < ApplicationController else none_shixun_ids = ShixunSchool.where("school_id != #{User.current.user_extensions.try(:school_id)}").pluck(:shixun_id) end - @shixuns = Shixun.where("status = 2 and id not in (#{none_shixun_ids.join(",")})").where("name like ?", "%#{search}%").select{|shixun| shixun.challenges.where(:st => 1).count == 0} - @limit = 8 + @shixuns = Shixun.where("status = 2 and challenges_count = 1 and id not in (#{none_shixun_ids.join(",")})"). + where("name like ?", "%#{search}%").select{|shixun| shixun.challenges.where(:st => 1).count == 0} + @limit = 10 + @total_pages = (@shixuns.count / 10.0).ceil @shixuns = paginateHelper @shixuns, @limit respond_to do |format| format.js + format.json { + render json: exercise_shixun_json_data(@shixuns) + } end end @@ -977,118 +990,122 @@ class ExerciseController < ApplicationController # 已提交过的且是限时的则不允许答题 exercise_user = ExerciseUser.where(:exercise_id => @exercise.id, :user_id => User.current.id).first - if (exercise_user && exercise_user.commit_status == 1) || @exercise.end_time < Time.now - render :json => {:text => "Over"} - return - end - if eq.question_type == 1 - # 单选题 - ea = ExerciseAnswer.find_by_exercise_question_id_and_user_id(params[:exercise_question_id],User.current.id) - if ea.nil? - # 尚未答该题,添加答案 - ea = ExerciseAnswer.new - ea.user_id = User.current.id - ea.exercise_question_id = params[:exercise_question_id] - end - #修改该题对应答案 - ea.exercise_choice_id = params[:exercise_choice_id] - if ea.save - # 保存成功返回成功信息及当前以答题百分比 - uncomplete_question = get_uncomplete_question(@exercise, User.current) - if uncomplete_question.count < 1 - complete = 1; - else - complete = 0; - end - @percent = get_percent(@exercise,User.current) - render :json => {:text => "ok" ,:complete => complete,:percent => format("%.2f" ,@percent)} - else - #返回失败信息 - render :json => {:text => "failure"} + if exercise_user + if (exercise_user && exercise_user.commit_status == 1) || @exercise.end_time < Time.now + render :json => {:text => "Over"} + return end - elsif eq.question_type == 2 - #多选题 - ea = ExerciseAnswer.find_by_exercise_choice_id_and_user_id(params[:exercise_choice_id],User.current.id) - if ea.nil? - #尚未答该题,添加答案 - ea = ExerciseAnswer.new - ea.user_id = User.current.id - ea.exercise_question_id = params[:exercise_question_id] + if eq.question_type == 1 + # 单选题 + ea = ExerciseAnswer.find_by_exercise_question_id_and_user_id(params[:exercise_question_id],User.current.id) + if ea.nil? + # 尚未答该题,添加答案 + ea = ExerciseAnswer.new + ea.user_id = User.current.id + ea.exercise_question_id = params[:exercise_question_id] + end + #修改该题对应答案 ea.exercise_choice_id = params[:exercise_choice_id] if ea.save - uncomplete_question = get_uncomplete_question(@exercise, User.current) + # 保存成功返回成功信息及当前以答题百分比 + uncomplete_question = get_uncomplete_question(@exercise, exercise_user) if uncomplete_question.count < 1 complete = 1; else complete = 0; end - is_answer = User.current.exercise_answer.where(:exercise_question_id => params[:exercise_question_id].to_i).count > 0 - @percent = get_percent(@exercise,User.current) - render :json => {:text => "ok",:complete => complete,:percent => format("%.2f" ,@percent),:is_answer => is_answer} - else - render :json => {:text => "failure"} - end - else - #pv不为空,则当前选项之前已被选择,再次点击则是不再选择该项,故删除该答案 - if ea.delete - is_answer = User.current.exercise_answer.where(:exercise_question_id => params[:exercise_question_id].to_i).count > 0 - @percent = get_percent(@exercise, User.current) - render :json => {:text => "false" ,:percent => format("%.2f" , @percent),:is_answer => is_answer} + @percent = get_percent(@exercise, exercise_user) + render :json => {:text => "ok" ,:complete => complete,:percent => format("%.2f" ,@percent)} else + #返回失败信息 render :json => {:text => "failure"} end - end - elsif eq.question_type == 3 || eq.question_type == 4 - #单行文本,多行文本题 - ea = ExerciseAnswer.find_by_exercise_question_id_and_user_id(params[:exercise_question_id], User.current.id) - if ea.nil? - # ea为空之前尚未答题,添加答案 - if params[:answer_text].nil? || params[:answer_text].blank? - #用户提交空答案,视作不作答 - @percent = get_percent(@exercise,User.current) - render :json => {:text => "",:percent => format("%.2f", @percent)} - else - #添加答案 + elsif eq.question_type == 2 + #多选题 + ea = ExerciseAnswer.find_by_exercise_choice_id_and_user_id(params[:exercise_choice_id],User.current.id) + if ea.nil? + #尚未答该题,添加答案 ea = ExerciseAnswer.new ea.user_id = User.current.id ea.exercise_question_id = params[:exercise_question_id] - ea.answer_text = params[:answer_text] + ea.exercise_choice_id = params[:exercise_choice_id] if ea.save - uncomplete_question = get_uncomplete_question(@exercise, User.current) + uncomplete_question = get_uncomplete_question(@exercise, exercise_user) if uncomplete_question.count < 1 complete = 1; else complete = 0; end - @percent = get_percent(@exercise,User.current) - render :json => {:text => ea.answer_text,:complete => complete,:percent => format("%.2f",@percent)} + is_answer = User.current.exercise_answer.where(:exercise_question_id => params[:exercise_question_id].to_i).count > 0 + @percent = get_percent(@exercise, exercise_user) + render :json => {:text => "ok",:complete => complete,:percent => format("%.2f" ,@percent),:is_answer => is_answer} else render :json => {:text => "failure"} end - end - - else - # ea不为空说明用户之前已作答 - if params[:answer_text].nil? || params[:answer_text].blank? - # 用户提交空答案,视为删除答案 + else + #pv不为空,则当前选项之前已被选择,再次点击则是不再选择该项,故删除该答案 if ea.delete - @percent = get_percent(@exercise,User.current) - render :json => {:text => "",:percent => format("%.2f", @percent)} + is_answer = User.current.exercise_answer.where(:exercise_question_id => params[:exercise_question_id].to_i).count > 0 + @percent = get_percent(@exercise, exercise_user) + render :json => {:text => "false" ,:percent => format("%.2f" , @percent),:is_answer => is_answer} else render :json => {:text => "failure"} end + end + elsif eq.question_type == 3 || eq.question_type == 4 + #单行文本,多行文本题 + ea = ExerciseAnswer.find_by_exercise_question_id_and_user_id(params[:exercise_question_id], User.current.id) + if ea.nil? + # ea为空之前尚未答题,添加答案 + if params[:answer_text].nil? || params[:answer_text].blank? + #用户提交空答案,视作不作答 + @percent = get_percent(@exercise, exercise_user) + render :json => {:text => "",:percent => format("%.2f", @percent)} + else + #添加答案 + ea = ExerciseAnswer.new + ea.user_id = User.current.id + ea.exercise_question_id = params[:exercise_question_id] + ea.answer_text = params[:answer_text] + if ea.save + uncomplete_question = get_uncomplete_question(@exercise, exercise_user) + if uncomplete_question.count < 1 + complete = 1; + else + complete = 0; + end + @percent = get_percent(@exercise, exercise_user) + render :json => {:text => ea.answer_text,:complete => complete,:percent => format("%.2f",@percent)} + else + render :json => {:text => "failure"} + end + end + else - #用户修改答案 - ea.answer_text = params[:answer_text] - if ea.save - @percent = get_percent(@exercise,User.current) - render :json => {:text => ea.answer_text,:percent => format("%.2f", @percent)} + # ea不为空说明用户之前已作答 + if params[:answer_text].nil? || params[:answer_text].blank? + # 用户提交空答案,视为删除答案 + if ea.delete + @percent = get_percent(@exercise, exercise_user) + render :json => {:text => "",:percent => format("%.2f", @percent)} + else + render :json => {:text => "failure"} + end else - render :json => {:text => "failure"} + #用户修改答案 + ea.answer_text = params[:answer_text] + if ea.save + @percent = get_percent(@exercise, exercise_user) + render :json => {:text => ea.answer_text,:percent => format("%.2f", @percent)} + else + render :json => {:text => "failure"} + end end end - end + else + render :json => {:text => "failure"} + end else render :json => {:text => "failure"} end @@ -1165,9 +1182,10 @@ class ExerciseController < ApplicationController # 获取学生未答情况 def get_student_uncomplete_question + exercise_user = @exercise.exercise_users.where(:user_id => User.current).first time_limit = @exercise.time == -1 || @exercise.time.nil? - uncomplete_count = get_uncomplete_question(@exercise, User.current).count - uncomplete_shixun = get_uncomplete_shixun(@exercise, User.current).count + uncomplete_count = get_uncomplete_question(@exercise, exercise_user).count + uncomplete_shixun = get_uncomplete_shixun(@exercise, exercise_user).count render :json => {:time_limit => time_limit, :uncomplete_count => uncomplete_count, :uncomplete_shixun => uncomplete_shixun} end @@ -1241,8 +1259,8 @@ class ExerciseController < ApplicationController @is_teacher = params[:pdf] ? true : User.current.allowed_to?(:as_teacher,@course) || User.current.admin? if @is_teacher || (User.current.member_of_course?(@exercise.course) && @exercise.exercise_status > 2) @user = User.find params[:user_id] - @exercise_questions = @exercise.exercise_questions @exercise_user = ExerciseUser.where("user_id =? and exercise_id=?", @user.id, @exercise.id).first + @exercise_questions = @exercise.user_question_list @exercise_user.id respond_to do |format| if params[:pdf] format.html { render :layout => "pdf" } @@ -1305,7 +1323,8 @@ class ExerciseController < ApplicationController score2 = 0 score3 = 0 score4 = 0 - exercise_qustions = exercise.exercise_questions + exercise_user = exercise.exercise_users.where(user_id: user.id).first + exercise_qustions = exercise.user_question_list(exercise_user.try(:id)) exercise_qustions.each do |question| if question.question_type != 5 answer = get_user_answer(question, user) @@ -1608,11 +1627,11 @@ class ExerciseController < ApplicationController standard_answer end # 是否完成了答题 - def get_complete_question(exercise,user) - questions = exercise.exercise_questions.includes(:exercise_answers) + def get_complete_question(exercise, exercise_user) + questions = exercise.user_question_list(exercise_user.id).includes(:exercise_answers) complete_question = [] questions.each do |question| - answers = question.exercise_answers.select{|e| e.user_id == user.id} + answers = question.exercise_answers.select{|e| e.user_id == exercise_user.user_id} if !(answers.nil? || answers.count < 1) complete_question << question end @@ -1621,12 +1640,13 @@ class ExerciseController < ApplicationController end # 获取答题百分比 - def get_percent exercise,user - complete_count = get_complete_question(exercise,user).count - if exercise.exercise_questions.count == 0 + def get_percent exercise, exercise_user + complete_count = get_complete_question(exercise,exercise_user).count + questions = exercise.user_question_list(exercise_user.id) + if questions.count == 0 return 0 else - return (complete_count.to_f / exercise.exercise_questions.count.to_f)*100 + return (complete_count.to_f / questions.count.to_f)*100 end end diff --git a/app/controllers/graduation_topics_controller.rb b/app/controllers/graduation_topics_controller.rb index 32823ab9..d55638df 100644 --- a/app/controllers/graduation_topics_controller.rb +++ b/app/controllers/graduation_topics_controller.rb @@ -106,7 +106,7 @@ class GraduationTopicsController < ApplicationController def student_select_topic if User.current.student_graduation_topics.where(:course_id => @course.id, :status => [0, 1]).count == 0 @topic.student_graduation_topics << StudentGraduationTopic.new(:course_id => @course.id, :user_id => User.current.id, - :member_id => @course.members.where(:user_id => User.current.id).first.try(:id)) + :member_id => @course.course_members.where(:user_id => current_user.id).first.try(:id)) @topic.update_attributes(:status => 1) end redirect_to graduation_topic_path(@topic) diff --git a/app/controllers/homework_common_controller.rb b/app/controllers/homework_common_controller.rb index 84f337d8..5b03010d 100644 --- a/app/controllers/homework_common_controller.rb +++ b/app/controllers/homework_common_controller.rb @@ -359,8 +359,8 @@ class HomeworkCommonController < ApplicationController # homework 的记录更新 # 发布时间不为空 if params_publish_time && min_publish_time != "" - @homework.publish_time = min_publish_time - @homework.end_time = max_end_time + @homework.publish_time = min_publish_time if @homework.publish_time.nil? || @homework.publish_time > Time.now + @homework.end_time = max_end_time if @homework.end_time.nil? || @homework.end_time > Time.now # @homework.archive_time = params_archive_time if params_archive_time if @homework.publish_time < Time.now and @homework_detail_manual.comment_status == 0 @homework_detail_manual.comment_status = 1 @@ -379,10 +379,10 @@ class HomeworkCommonController < ApplicationController =end # 发布时间未设置 则按当前时间立即发布 elsif params_publish_time && min_publish_time == "" - @homework_detail_manual.comment_status = 1 - @homework.publish_time = Time.now + @homework_detail_manual.comment_status = 1 if @homework_detail_manual.comment_status == 0 + @homework.publish_time = Time.now if @homework.publish_time.nil? || @homework.publish_time > Time.now @homework.unified_setting = 1 - @homework.end_time = Time.at(((1.month.since.to_i)/3600.0).ceil * 3600) + @homework.end_time = Time.at(((1.month.since.to_i)/3600.0).ceil * 3600) if @homework.end_time.nil? || @homework.end_time > Time.now # @homework.archive_time = Time.at(((2.months.since.to_i)/3600.0).ceil * 3600) create_homework_user = 1 @@ -391,7 +391,7 @@ class HomeworkCommonController < ApplicationController end # 已发布的作业,只更新截止时间和结束时间 else - @homework.end_time = max_end_time if params_end_time + @homework.end_time = max_end_time if params_end_time && (@homework.end_time.nil? || @homework.end_time > Time.now) # @homework.archive_time = params_archive_time if params_archive_time =begin diff --git a/app/helpers/exercise_helper.rb b/app/helpers/exercise_helper.rb index b5a56020..b0ebedcf 100644 --- a/app/helpers/exercise_helper.rb +++ b/app/helpers/exercise_helper.rb @@ -1,5 +1,20 @@ # encoding: utf-8 module ExerciseHelper + def exercise_shixun_json_data shixuns + shixuns.map do |shixun| + shixun_owner = shixun.owner.try(:show_name) + shixun_path = shixun_path(shixun) + shixun_level = shixun.shixun_level + owner_path = user_path(shixun.owner) + shixun.attributes.dup.except("gpid", "identifier", "major_id", "webssh", "homepage_show", "fork_from", "git_url", + "mirror_script_id", "repo_name", "pod_life").merge({ + shixun_owner: shixun_owner, + shixun_level: shixun_level, + shixun_path: shixun_path, + owner_path: owner_path + }) + end + end def un_commit_num exercise course = exercise.course @@ -266,12 +281,13 @@ module ExerciseHelper end #获取未完成的题目 - def get_uncomplete_question exercise,user + def get_uncomplete_question exercise, exercise_user # all_questions = exercise.exercise_questions.includes(:exercise_answers).where("question_type != 5") uncomplete_question = [] - exercise.exercise_questions.includes(:exercise_answers).where("question_type != 5").each do |question| + questions = exercise.user_question_list(exercise_user.id) + questions.includes(:exercise_answers).where("question_type != 5").each do |question| # answers = get_user_answer(question, user) - answers = question.exercise_answers.select{|e| e.user_id == user.id} + answers = question.exercise_answers.select{|e| e.user_id == exercise_user.user_id} if answers.empty? uncomplete_question << question end @@ -280,8 +296,9 @@ module ExerciseHelper end # 获取未通关的实训 - def get_uncomplete_shixun exercise,user - all_questions = exercise.exercise_questions.where("question_type = 5") + def get_uncomplete_shixun exercise, exercise_user + questions = exercise.user_question_list(exercise_user.try(:id)) + all_questions = questions.where("question_type = 5") uncomplete_shixun = [] all_questions.each do |question| myshixun = Myshixun.where(:shixun_id => question.shixun_id, :user_id => user.id).first diff --git a/app/models/exercise.rb b/app/models/exercise.rb index 47993cf9..a8452df0 100644 --- a/app/models/exercise.rb +++ b/app/models/exercise.rb @@ -5,13 +5,17 @@ class Exercise < ActiveRecord::Base belongs_to :course ,:touch => true belongs_to :exercise_bank has_many :exercise_group_settings, :dependent => :destroy - has_many :exercise_questions, :dependent => :destroy,:order => "#{ExerciseQuestion.table_name}.question_number" + has_many :exercise_questions, :dependent => :destroy has_many :exercise_users, :dependent => :destroy, :conditions => "exercise_users.is_delete = 0" has_many :users, :through => :exercise_users #该测试被哪些用户提交答案过 has_many :course_acts, :class_name => 'CourseActivity',:as =>:course_act ,:dependent => :destroy # 课程消息 has_many :tidings, as: :container, dependent: :destroy has_many :course_messages, :class_name =>'CourseMessage', :as => :course_message, :dependent => :destroy + + has_many :exercise_level_settings, :dependent => :destroy + has_many :exercise_user_questions + after_create :acts_as_course_message def acts_as_course_message if self.course @@ -24,4 +28,27 @@ class Exercise < ActiveRecord::Base end end end + + def create_user_question_list exercise_user_id + self.exercise_questions.where("question_type != 5").each do |question| + self.exercise_user_questions << ExerciseUserQuestion.new(exercise_user_id: exercise_user_id, + exercise_question_id: question) + end + self.exercise_level_settings.each do |setting| + # 每个级别中随机挑选num个实训题 + setting.exercise_questions.pluck(:id).sample(setting.num).each do |question_id| + self.exercise_user_questions << ExerciseUserQuestion.new(exercise_user_id: exercise_user_id, + exercise_question_id: question_id) + end + end + end + + def user_question_list exercise_user_id + if self.exercise_user_questions.where(exercise_user_id: exercise_user_id).count == 0 + self.exercise_questions + else + self.exercise_questions.where(id: self.exercise_user_questions.where(exercise_user_id: exercise_user_id). + pluck(:exercise_question_id)) + end + end end diff --git a/app/models/exercise_level_setting.rb b/app/models/exercise_level_setting.rb new file mode 100644 index 00000000..3e687d8c --- /dev/null +++ b/app/models/exercise_level_setting.rb @@ -0,0 +1,5 @@ +class ExerciseLevelSetting < ActiveRecord::Base + belongs_to :exercise + has_many :exercise_questions + # attr_accessible :level, :num, :score +end diff --git a/app/models/exercise_question.rb b/app/models/exercise_question.rb index cadc67fc..63d9cdf9 100644 --- a/app/models/exercise_question.rb +++ b/app/models/exercise_question.rb @@ -1,6 +1,7 @@ #encoding: utf-8 class ExerciseQuestion < ActiveRecord::Base include Redmine::SafeAttributes + default_scope :order => 'question_number' belongs_to :exercise belongs_to :shixun @@ -11,6 +12,9 @@ class ExerciseQuestion < ActiveRecord::Base has_many :exercise_answer_comments, :dependent => :destroy has_many :exercise_standard_answers, :dependent => :destroy + belongs_to :exercise_level_setting, counter_cache: true + has_many :exercise_user_questions, :dependent => :destroy + def question_type_name case self.question_type when 1 diff --git a/app/models/exercise_user.rb b/app/models/exercise_user.rb index c675f35a..8609ba26 100644 --- a/app/models/exercise_user.rb +++ b/app/models/exercise_user.rb @@ -4,4 +4,6 @@ class ExerciseUser < ActiveRecord::Base belongs_to :user belongs_to :exercise + + has_many :exercise_user_questions end diff --git a/app/models/exercise_user_question.rb b/app/models/exercise_user_question.rb new file mode 100644 index 00000000..136a187f --- /dev/null +++ b/app/models/exercise_user_question.rb @@ -0,0 +1,6 @@ +class ExerciseUserQuestion < ActiveRecord::Base + belongs_to :exercise + belongs_to :exercise_user + belongs_to :exercise_question + # attr_accessible :title, :body +end diff --git a/app/views/boards/update_position.js.erb b/app/views/boards/update_position.js.erb index bd7ee8fd..cba7203d 100644 --- a/app/views/boards/update_position.js.erb +++ b/app/views/boards/update_position.js.erb @@ -1,7 +1,8 @@ <% if @course %> $("#tbc_04").html("<%=escape_javascript(render :partial => 'courses/settings/boards_setting') %>"); <% course_board = @course.boards.where(:parent_id => 0).first %> -$("#board_children_list").html("<%= escape_javascript(render :partial => 'layouts/board_children_list', :locals => {:course_board => course_board})%>"); +$("#board_children_list").html("<%= escape_javascript(render :partial => 'layouts/board_children_list', :locals => + {:course_board => course_board, :is_teacher => @is_teacher})%>"); <% elsif @contest %> $("#game-setting-content-3").html("<%=escape_javascript(render :partial => 'contests/boards') %>"); <% contest_board = @contest.boards.where(:parent_id => 0).first %> diff --git a/app/views/courses/_course_activity.html.erb b/app/views/courses/_course_activity.html.erb index 89187650..19eab902 100644 --- a/app/views/courses/_course_activity.html.erb +++ b/app/views/courses/_course_activity.html.erb @@ -32,7 +32,9 @@ <%= render :partial => 'users/course_create', :locals => {:activity => activity.course_act, :user_activity_id => activity.id, :is_course => 1} if activity.course_act %> <% when 'JoinCourse' %> <% act = CourseMessage.where(:id => activity.course_act_id).first %> - <%= render :partial => 'users/join_course', :locals => {:activity => act, :user_activity_id => activity.id} %> + <% if act.present? %> + <%= render :partial => 'users/join_course', :locals => {:activity => act, :user_activity_id => activity.id} %> + <% end %> <% end %> <% end %> <% end %> diff --git a/app/views/exercise/_edit_shixun.html.erb b/app/views/exercise/_edit_shixun.html.erb index 4d60a41c..23396e40 100644 --- a/app/views/exercise/_edit_shixun.html.erb +++ b/app/views/exercise/_edit_shixun.html.erb @@ -1,35 +1,113 @@ <%= form_for("",:url => update_exercise_question_exercise_index_path(:exercise_question => exercise_question.id),:html => {:id => "update_exercise_question_#{exercise_question.id}"}) do |f|%> -
实训题
-<%= exercise_question.shixun.name %>
-实训题
- - - -<%= @shixun.name %>
-