|
|
@ -526,9 +526,16 @@ class ExerciseQuestionsController < ApplicationController
|
|
|
|
ExerciseAnswer.create(answer_option)
|
|
|
|
ExerciseAnswer.create(answer_option)
|
|
|
|
ex_answer_old = 0
|
|
|
|
ex_answer_old = 0
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
if ex_obj_score <= 0.0
|
|
|
|
|
|
|
|
new_obj_score = @c_score
|
|
|
|
|
|
|
|
else
|
|
|
|
|
|
|
|
new_obj_score = ex_obj_score - ex_answer_old + @c_score
|
|
|
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
|
|
new_obj_score = ex_obj_score - ex_answer_old + @c_score
|
|
|
|
|
|
|
|
total_scores = new_obj_score + ex_subj_score
|
|
|
|
total_scores = new_obj_score + ex_subj_score
|
|
|
|
|
|
|
|
if total_scores < 0.0
|
|
|
|
|
|
|
|
total_scores = 0.0
|
|
|
|
|
|
|
|
end
|
|
|
|
ex_scores = {
|
|
|
|
ex_scores = {
|
|
|
|
:objective_score => new_obj_score,
|
|
|
|
:objective_score => new_obj_score,
|
|
|
|
:score => total_scores
|
|
|
|
:score => total_scores
|
|
|
@ -554,6 +561,9 @@ class ExerciseQuestionsController < ApplicationController
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
|
|
total_scores = new_obj_score + ex_subj_score
|
|
|
|
total_scores = new_obj_score + ex_subj_score
|
|
|
|
|
|
|
|
if total_scores < 0.0
|
|
|
|
|
|
|
|
total_scores = 0.0
|
|
|
|
|
|
|
|
end
|
|
|
|
ex_scores = {
|
|
|
|
ex_scores = {
|
|
|
|
:objective_score => new_obj_score,
|
|
|
|
:objective_score => new_obj_score,
|
|
|
|
:score => total_scores
|
|
|
|
:score => total_scores
|
|
|
@ -575,6 +585,9 @@ class ExerciseQuestionsController < ApplicationController
|
|
|
|
new_sub_score = ex_subj_score + @c_score
|
|
|
|
new_sub_score = ex_subj_score + @c_score
|
|
|
|
end
|
|
|
|
end
|
|
|
|
total_scores = ex_obj_score + new_sub_score
|
|
|
|
total_scores = ex_obj_score + new_sub_score
|
|
|
|
|
|
|
|
if total_scores < 0.0
|
|
|
|
|
|
|
|
total_scores = 0.0
|
|
|
|
|
|
|
|
end
|
|
|
|
ex_scores = {
|
|
|
|
ex_scores = {
|
|
|
|
:subjective_score => new_sub_score,
|
|
|
|
:subjective_score => new_sub_score,
|
|
|
|
:score => total_scores
|
|
|
|
:score => total_scores
|
|
|
@ -600,6 +613,9 @@ class ExerciseQuestionsController < ApplicationController
|
|
|
|
new_obj_score = @c_score
|
|
|
|
new_obj_score = @c_score
|
|
|
|
end
|
|
|
|
end
|
|
|
|
total_scores = new_obj_score + ex_subj_score
|
|
|
|
total_scores = new_obj_score + ex_subj_score
|
|
|
|
|
|
|
|
if total_scores < 0.0
|
|
|
|
|
|
|
|
total_scores = 0.0
|
|
|
|
|
|
|
|
end
|
|
|
|
ex_scores = {
|
|
|
|
ex_scores = {
|
|
|
|
:objective_score => new_obj_score,
|
|
|
|
:objective_score => new_obj_score,
|
|
|
|
:score => total_scores
|
|
|
|
:score => total_scores
|
|
|
|