正式版报500
This commit is contained in:
parent
699d0e22dd
commit
481b7b96eb
|
@ -359,7 +359,7 @@ class ExerciseController < ApplicationController
|
||||||
if @exercise.end_time <= Time.now
|
if @exercise.end_time <= Time.now
|
||||||
@course.student.each do |student|
|
@course.student.each do |student|
|
||||||
if ExerciseUser.where("user_id = ? && exercise_id = ?",student.student_id,@exercise.id).empty?
|
if ExerciseUser.where("user_id = ? && exercise_id = ?",student.student_id,@exercise.id).empty?
|
||||||
ExerciseUser.create(:user_id => student.student_id, :exercise_id => @exercise.id, :start_at => @exercise.end_time, :status => false,:score=>0)
|
ExerciseUser.create(:user_id => student.student_id, :exercise_id => @exercise.id, :start_at => @exercise.end_time, :status => true,:score=>0)
|
||||||
end
|
end
|
||||||
|
|
||||||
s_score = calculate_student_score(@exercise, student.student)
|
s_score = calculate_student_score(@exercise, student.student)
|
||||||
|
@ -577,15 +577,15 @@ class ExerciseController < ApplicationController
|
||||||
standard_answer = get_user_standard_answer(question, user)
|
standard_answer = get_user_standard_answer(question, user)
|
||||||
unless answer.empty?
|
unless answer.empty?
|
||||||
# 问答题有多个答案
|
# 问答题有多个答案
|
||||||
if question.question_type == 3
|
if question.question_type == 3 && !standard_answer.empty?
|
||||||
if standard_answer.include?(answer.first.answer_text)
|
if standard_answer.include?(answer.first.answer_text)
|
||||||
score1 = score1+ question.question_score unless question.question_score.nil?
|
score1 = score1+ question.question_score unless question.question_score.nil?
|
||||||
end
|
end
|
||||||
elsif question.question_type == 1
|
elsif question.question_type == 1 && !standard_answer.nil?
|
||||||
if answer.first.exercise_choice.choice_position == standard_answer.exercise_choice_id
|
if answer.first.exercise_choice.choice_position == standard_answer.exercise_choice_id
|
||||||
score2 = score2 + question.question_score unless question.question_score.nil?
|
score2 = score2 + question.question_score unless question.question_score.nil?
|
||||||
end
|
end
|
||||||
else
|
elsif question.question_type == 2 && !standard_answer.nil?
|
||||||
arr = get_mulscore(question, user)
|
arr = get_mulscore(question, user)
|
||||||
if arr.to_i == standard_answer.exercise_choice_id
|
if arr.to_i == standard_answer.exercise_choice_id
|
||||||
score3 = score3 + question.question_score unless question.question_score.nil?
|
score3 = score3 + question.question_score unless question.question_score.nil?
|
||||||
|
|
|
@ -32,7 +32,7 @@
|
||||||
<div>
|
<div>
|
||||||
<div class="testEditTitle"> 第<%= list_index+1%>题:<%= exercise_question.question_title %> (<%= exercise_question.question_score %>分)
|
<div class="testEditTitle"> 第<%= list_index+1%>题:<%= exercise_question.question_title %> (<%= exercise_question.question_score %>分)
|
||||||
<br />
|
<br />
|
||||||
标准答案:<%= convert_to_char(exercise_question.exercise_standard_answers.first.exercise_choice_id.to_s) %>
|
标准答案:<%= convert_to_char(exercise_question.exercise_standard_answers.first.exercise_choice_id.to_s) if exercise_question.exercise_standard_answers.first %>
|
||||||
</div>
|
</div>
|
||||||
<div class="cl"></div>
|
<div class="cl"></div>
|
||||||
<div class="ur_inputs">
|
<div class="ur_inputs">
|
||||||
|
@ -64,7 +64,7 @@
|
||||||
<div>
|
<div>
|
||||||
<div class="testEditTitle"> 第<%= list_index+1%>题:<%= exercise_question.question_title %> (<%= exercise_question.question_score %>分)
|
<div class="testEditTitle"> 第<%= list_index+1%>题:<%= exercise_question.question_title %> (<%= exercise_question.question_score %>分)
|
||||||
<br />
|
<br />
|
||||||
标准答案:<%= convert_to_char(exercise_question.exercise_standard_answers.first.exercise_choice_id.to_s) %>
|
标准答案:<%= convert_to_char(exercise_question.exercise_standard_answers.first.exercise_choice_id.to_s) if exercise_question.exercise_standard_answers.first%>
|
||||||
</div>
|
</div>
|
||||||
<div class="cl"></div>
|
<div class="cl"></div>
|
||||||
<div class="ur_inputs">
|
<div class="ur_inputs">
|
||||||
|
|
|
@ -11,7 +11,7 @@
|
||||||
#
|
#
|
||||||
# It's strongly recommended to check this file into your version control system.
|
# It's strongly recommended to check this file into your version control system.
|
||||||
|
|
||||||
ActiveRecord::Schema.define(:version => 20151215105425) do
|
ActiveRecord::Schema.define(:version => 20151215112107) do
|
||||||
|
|
||||||
create_table "activities", :force => true do |t|
|
create_table "activities", :force => true do |t|
|
||||||
t.integer "act_id", :null => false
|
t.integer "act_id", :null => false
|
||||||
|
@ -1161,6 +1161,7 @@ ActiveRecord::Schema.define(:version => 20151215105425) do
|
||||||
t.datetime "updated_at", :null => false
|
t.datetime "updated_at", :null => false
|
||||||
t.boolean "locked", :default => false
|
t.boolean "locked", :default => false
|
||||||
t.integer "sticky", :default => 0
|
t.integer "sticky", :default => 0
|
||||||
|
t.integer "org_subfield_id"
|
||||||
end
|
end
|
||||||
|
|
||||||
create_table "org_member_roles", :force => true do |t|
|
create_table "org_member_roles", :force => true do |t|
|
||||||
|
@ -1187,6 +1188,7 @@ ActiveRecord::Schema.define(:version => 20151215105425) do
|
||||||
t.string "name"
|
t.string "name"
|
||||||
t.datetime "created_at", :null => false
|
t.datetime "created_at", :null => false
|
||||||
t.datetime "updated_at", :null => false
|
t.datetime "updated_at", :null => false
|
||||||
|
t.string "field_type"
|
||||||
end
|
end
|
||||||
|
|
||||||
create_table "organizations", :force => true do |t|
|
create_table "organizations", :force => true do |t|
|
||||||
|
|
Loading…
Reference in New Issue