This commit is contained in:
parent
c1b912188b
commit
9b51225c23
|
@ -314,7 +314,7 @@ class ExerciseController < ApplicationController
|
|||
@exercise_question.exercise_standard_answers.new standart_answer_option
|
||||
end
|
||||
else
|
||||
answer_standart = @exercise_question.exercise_standard_answers.first
|
||||
answer_standart = @exercise_question.exercise_standard_answers.first ? @exercise_question.exercise_standard_answers.first : ExerciseStandardAnswer.new(:exercise_question_id => @exercise_question.id)
|
||||
answer_standart.exercise_choice_id = @exercise_question.question_type == 1 ? sigle_selection_standard_answer(params[:exercise_choice]) : multiselect_standard_answer(params[:exercise_choice])
|
||||
answer_standart.save
|
||||
end
|
||||
|
|
|
@ -4,11 +4,11 @@
|
|||
function resetQuestion<%=exercise_question.id%>()
|
||||
{
|
||||
$("#poll_question_score_<%=exercise_question.id %>").val("<%= exercise_question.question_score%>");
|
||||
$("#question_standard_answer_<%=exercise_question.id %>").val("<%= convert_to_char(exercise_question.exercise_standard_answers.first.exercise_choice_id.to_s)%>");
|
||||
$("#poll_answers_<%=exercise_question.id%>").html("<input style='display: none;' name='exercise_choice' id='exercise_choice_<%=exercise_question.id%>' value='<%= convert_to_char(exercise_question.exercise_standard_answers.first.exercise_choice_id.to_s) %>'/>" +
|
||||
$("#question_standard_answer_<%=exercise_question.id %>").val("<%= exercise_question.exercise_standard_answers.empty? ? "" : convert_to_char(exercise_question.exercise_standard_answers.first.exercise_choice_id.to_s)%>");
|
||||
$("#poll_answers_<%=exercise_question.id%>").html("<input style='display: none;' name='exercise_choice' id='exercise_choice_<%=exercise_question.id%>' value='<%= exercise_question.exercise_standard_answers.empty? ? "" : convert_to_char(exercise_question.exercise_standard_answers.first.exercise_choice_id.to_s) %>'/>" +
|
||||
"<% exercise_question.exercise_choices.reorder("choice_position").each_with_index do |exercise_choice,index| %>" +
|
||||
"<li class='ur_item new_answer'>" +
|
||||
"<a class='<%= exercise_question.exercise_standard_answers.first.exercise_choice_id.to_s.include?((index+1).to_s) ? 'question_choice_blue' : 'question_choice_white' %> fl mr10 choice_btn' title='设为答案' href='javascript:void(0)' onclick='toggle_select($(this), 2, <%= exercise_question.id %>);'><%=convert_to_char (index+1).to_s %></a>" +
|
||||
"<a class='<%= exercise_question.exercise_standard_answers.empty? ? "" : exercise_question.exercise_standard_answers.first.exercise_choice_id.to_s.include?((index+1).to_s) ? 'question_choice_blue' : 'question_choice_white' %> fl mr10 choice_btn' title='设为答案' href='javascript:void(0)' onclick='toggle_select($(this), 2, <%= exercise_question.id %>);'><%=convert_to_char (index+1).to_s %></a>" +
|
||||
"<input maxlength='200' class='w600' type='text' name='question_answer[<%= exercise_choice.id %>]' placeholder='输入选项内容' value='<%=exercise_choice.choice_text %>'/>" +
|
||||
"<a class='icon_remove' title='删除' onclick='remove_single_answer($(this))'></a>" +
|
||||
"</li>" +
|
||||
|
@ -25,7 +25,7 @@
|
|||
<div class="mb10 ur_item">
|
||||
<label>分值<span class="ur_index"></span>: </label>
|
||||
<input id="poll_question_score_<%=exercise_question.id %>" value="<%=exercise_question.question_score %>" type="text" name="question_score" style="width:60px; text-align:center; padding-left:0px;">分
|
||||
<span class="fr c_red" style="width: 60px;" id="question_standard_answer_<%=exercise_question.id %>"><%=convert_to_char(exercise_question.exercise_standard_answers.first.exercise_choice_id.to_s) %></span>
|
||||
<span class="fr c_red" style="width: 60px;" id="question_standard_answer_<%=exercise_question.id %>"><%= exercise_question.exercise_standard_answers.empty? ? "" : convert_to_char(exercise_question.exercise_standard_answers.first.exercise_choice_id.to_s) %></span>
|
||||
<span class="fr">标准答案:</span>
|
||||
<div class="cl"></div>
|
||||
</div>
|
||||
|
@ -38,10 +38,10 @@
|
|||
<div class="ur_editor_content">
|
||||
<ul>
|
||||
<div id="poll_answers_<%=exercise_question.id%>">
|
||||
<input style="display: none;" name="exercise_choice" id="exercise_choice_<%=exercise_question.id%>" value="<%= convert_to_char(exercise_question.exercise_standard_answers.first.exercise_choice_id.to_s) %>"/>
|
||||
<input style="display: none;" name="exercise_choice" id="exercise_choice_<%=exercise_question.id%>" value="<%= exercise_question.exercise_standard_answers.empty? ? "" : convert_to_char(exercise_question.exercise_standard_answers.first.exercise_choice_id.to_s) %>"/>
|
||||
<% exercise_question.exercise_choices.reorder("choice_position").each_with_index do |exercise_choice,index| %>
|
||||
<li class="ur_item new_answer">
|
||||
<a class="<%= exercise_question.exercise_standard_answers.first.exercise_choice_id.to_s.include?((index+1).to_s) ? 'question_choice_blue' : 'question_choice_white' %> fl mr10 choice_btn" title="设为答案" href="javascript:void(0)" onclick="toggle_select($(this), 2, <%= exercise_question.id %>);"><%=convert_to_char (index+1).to_s %></a>
|
||||
<a class="<%= exercise_question.exercise_standard_answers.empty? ? 'question_choice_white' : exercise_question.exercise_standard_answers.first.exercise_choice_id.to_s.include?((index+1).to_s) ? 'question_choice_blue' : 'question_choice_white' %> fl mr10 choice_btn" title="设为答案" href="javascript:void(0)" onclick="toggle_select($(this), 2, <%= exercise_question.id %>);"><%=convert_to_char (index+1).to_s %></a>
|
||||
<input maxlength="200" class="w600" type='text' name='question_answer[<%= exercise_choice.id %>]' placeholder='输入选项内容' value="<%=exercise_choice.choice_text %>">
|
||||
<a class="icon_remove" title="删除" onclick="remove_single_answer($(this))"></a>
|
||||
</li>
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
<ul class="courseSend" style="width: 370px;">
|
||||
<li>
|
||||
<input id="course_id_<%= course.id %>" name="course_ids[]" type="checkbox" value="<%= course.id %>" class="courseSendCheckbox"/>
|
||||
<label for="course_id_<%= course.id %>" class="chooseCourseName" title="<%=course.name + '('+ (current_time_and_term_short course) + ')'%>"><%=course.name + '('+ (current_time_and_term_short course) + ')'%></label>
|
||||
<label for="course_id_<%= course.id %>" class="chooseCourseName" title="<%=course.name %>"><%=course.name %></label>
|
||||
</li>
|
||||
</ul>
|
||||
<% end %>
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
<div class="exercise_title">
|
||||
<div>
|
||||
<span class="fl lh27">第<%= exercise_question.question_number%>题. <%= exercise_question.question_score %>分
|
||||
标准答案:<%= convert_to_char(exercise_question.exercise_standard_answers.first.exercise_choice_id.to_s) %></span>
|
||||
标准答案:<%= exercise_question.exercise_standard_answers.empty? ? "" : convert_to_char(exercise_question.exercise_standard_answers.first.exercise_choice_id.to_s) %></span>
|
||||
<div class="fr none" id="menu_div_<%= exercise_question.id %>">
|
||||
<% type = exercise_question.question_type %>
|
||||
<% exercise = exercise_question.exercise %>
|
||||
|
|
Loading…
Reference in New Issue