dev_ec
Alec Zhou 6 years ago
commit 584da88eca

@ -164,7 +164,7 @@
<% if exercise_question.question_type == 5 %>
<p class="pl15 pr15 mb10"><%= exercise_question.shixun.name %></p>
<% end %>
<div class="pl15 pr15 justify upload_img table_maxWidth break_word"><%= sanitize exercise_question.question_title %></div>
<div class="pl15 pr15 justify upload_img table_maxWidth break_word"><%= exercise_question.question_title.html_safe %></div>
<% case exercise_question.question_type %>
<% when 1 %>
<div class="pl15 pr15 mb15">

@ -142,7 +142,7 @@
<% if exercise_question.question_type == 5 %>
<p class="pl15 pr15 mb10"><%= exercise_question.shixun.name %></p>
<% end %>
<div class="pl15 pr15 justify upload_img table_maxWidth break_word"><%= sanitize exercise_question.question_title %></div>
<div class="pl15 pr15 justify upload_img table_maxWidth break_word"><%= exercise_question.question_title.html_safe %></div>
<% case exercise_question.question_type %>
<% when 1 %>
<div class="pl15 pr15 mb15">

@ -15,7 +15,7 @@
</p>
<% end %>
</div>
<div class="pl15 pr15 justify upload_img table_maxWidth break_word"><%= sanitize exercise_question.question_title%></div>
<div class="pl15 pr15 justify upload_img table_maxWidth break_word"><%= exercise_question.question_title.html_safe%></div>
<div class="pl15 pr15 mb10">
<% exercise_question.exercise_choices.reorder("choice_position").each_with_index do |exercise_choice,index| %>
<li class="clearfix">

@ -15,7 +15,7 @@
</p>
<% end %>
</div>
<div class="pl15 pr15 justify upload_img table_maxWidth break_word"><%= sanitize exercise_question.question_title %></div>
<div class="pl15 pr15 justify upload_img table_maxWidth break_word"><%= exercise_question.question_title.html_safe %></div>
<div class="pl15 pr15 mb10">
<% exercise_question.exercise_choices.reorder("choice_position").each_with_index do |exercise_choice,index| %>
<li class="clearfix">

@ -15,7 +15,7 @@
</p>
<% end %>
</div>
<div class="pl15 pr15 justify upload_img table_maxWidth break_word"><%= sanitize exercise_question.question_title %></div>
<div class="pl15 pr15 justify upload_img table_maxWidth break_word"><%= exercise_question.question_title.html_safe %></div>
<div class="clearfix bor-top-greyE padding15 answer_con">
<p>参考答案:</p>
<div class="justify font-14" style="padding: 0; padding-left: 10px;" id="exercise_answer_text_<%= exercise_question.id %>">

@ -15,7 +15,7 @@
</p>
<% end %>
</div>
<div class="pl15 pr15 justify upload_img table_maxWidth break_word"><%= sanitize exercise_question.question_title %></div>
<div class="pl15 pr15 justify upload_img table_maxWidth break_word"><%= exercise_question.question_title.html_safe %></div>
<div class="pl15 pr15 pt10 pb10 bor-top-greyE">
<% exercise_question.exercise_standard_answers.reorder("created_at").each_with_index do |exercise_choice,index| %>
<span class="">候选答案<%= convert_to_chi_num(index+1) %></span>

@ -259,7 +259,7 @@
<p class="pl15 pr15 mb10"><%= exercise_question.shixun.name %></p>
<% end %>
<div class="pl15 pr15 justify upload_img table_maxWidth break_word">
<%= sanitize exercise_question.question_title %>
<%= exercise_question.question_title.html_safe %>
</div>
<% case exercise_question.question_type %>
<% when 1 %>

@ -0,0 +1,20 @@
class MigrateExerciseAnswerScore < ActiveRecord::Migration
def up
exercise = Exercise.where(:id => 1527).first
if exercise.present?
exercise.exercise_users.each do |exercise_user|
score = 0
exercise.exercise_questions.each do |question|
ExerciseShixunAnswer.where(exercise_question_id: question.id, user_id: exercise_user.user_id).each do |answer|
score += answer.score
end
end
exercise_user.update_attributes(objective_score: score, score: score)
end
end
end
def down
end
end
Loading…
Cancel
Save