Merge branch 'dev_aliyun' of http://bdgit.educoder.net/Hjqreturn/educoder into dev_aliyun

dev_forum
jasder 6 years ago
commit fa65d94dbd

@ -10,7 +10,8 @@ class HomeworkCommonsController < ApplicationController
:create_subject_homework, :multi_destroy, :add_to_homework_bank]
before_action :find_homework, only: [:edit, :show, :update, :group_list, :homework_code_repeat, :code_review_results,
:code_review_detail, :show_comment, :settings, :works_list, :update_settings,
:reference_answer, :publish_groups, :end_groups, :alter_name, :update_explanation]
:reference_answer, :publish_groups, :end_groups, :alter_name, :update_explanation,
:update_score, :update_student_score]
before_action :user_course_identity
before_action :homework_publish, only: [:show, :works_list, :code_review_results, :show_comment, :settings, :reference_answer, :update_student_score]
before_action :teacher_allowed, only: [:new, :edit, :create, :update, :shixuns, :subjects, :create_shixun_homework,

@ -733,14 +733,14 @@ class ShixunsController < ApplicationController
private
def shixun_params
raise("实训名称不能为空") if params[:name].blank?
raise("实训名称不能为空") if params[:shixun][:name].blank?
params.require(:shixun).permit(:name, :trainee, :webssh, :can_copy, :use_scope, :vnc, :test_set_permission,
:task_pass, :repo_name, :multi_webssh, :opening_time, :mirror_script_id, :code_hidden,
:hide_code, :forbid_copy)
end
def shixun_info_params
raise("实训描述不能为空") if params[:description].blank?
raise("评测脚本不能为空") if params[:evaluate_script].blank?
raise("实训描述不能为空") if params[:shixun_info][:description].blank?
raise("评测脚本不能为空") if params[:shixun_info][:evaluate_script].blank?
params.require(:shixun_info).permit(:description, :evaluate_script)
end

@ -52,7 +52,7 @@ class Challenge < ApplicationRecord
# 开启挑战
def open_game user_id, shixun
game = self.games.first
game = self.games.where(user_id: user_id).first
if game.present?
shixun.task_pass || game.status != 3 ? "/tasks/#{game.identifier}" : ""
else

@ -41,6 +41,9 @@ p{
.mt8{
margin-top:8px;
}
.mt10{
margin-top:10px;
}
.mbt10{
margin: 10px 0;
}
@ -109,6 +112,9 @@ p{
white-space: normal;
min-height:12px;
}
.null-answer p{
display: inline-block;
}
.choose-radio{
display: inline-block;
width: 12px;

@ -181,19 +181,19 @@
<% if q_type == 0 %>
<% q.exercise_choices.each do |s| %>
<% check_answer = (user_answer.present? && (s.id == user_answer.first.exercise_choice_id)) ? "choose-answer" : '' %>
<div class="pbt5 clearfix main-choice">
<span class="choose-radio <%= check_answer %> pull-left mt8"></span>
<div class="pbt10 clearfix main-choice">
<span class="choose-radio <%= check_answer %> pull-left mt10"></span>
<span class="inline-block pull-left ml10 choice-text"><%= to_markdown(s.choice_text,@request_url) %></span>
</div>
<% end %>
<% elsif q_type == 1 %>
<% q.exercise_choices.each do |s| %>
<% check_answer = (user_answer.present? && (user_answer.pluck(:exercise_choice_id).include?(s.id))) ? true : false %>
<div class="pbt5 clearfix main-choice">
<div class="pbt10 clearfix main-choice">
<% if check_answer %>
<span class="choose-checkbox choose-answer-multi mt8" ></span>
<span class="choose-checkbox choose-answer-multi mt10 pull-left" ></span>
<% else %>
<span class="choose-checkbox pull-left mt8"></span>
<span class="choose-checkbox pull-left mt10"></span>
<% end %>
<span class="inline-block pull-left choice-text ml10"><%= to_markdown(s.choice_text,@request_url) %></span>
</div>
@ -222,14 +222,16 @@
<% end %>
<p class="pbt10 flex-nowrap">
<span class="pull-left line-34">答案(填空<%= index+1 %></span>
<span class="null-answer"><%= to_markdown(check_answer) %></span>
<span class="null-answer"><%= to_markdown(check_answer,@request_url) %></span>
</p>
<% end %>
<% elsif q_type == 4 %>
<% check_answer = (user_answer.present? ? user_answer.first.answer_text : '--') %>
<p class="flex-nowrap">
<span class="null-answer main-height"><%= to_markdown(check_answer) %></span>
</p>
<div class="flex-nowrap">
<div class="null-answer main-height">
<%= to_markdown(check_answer,@request_url) %>
</div>
</div>
<% else %>
<div class="mbt10">
<p class="text-gray mbt10">

Loading…
Cancel
Save