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

dev_cs
caicai8 5 years ago
commit 964c22e604

@ -5,6 +5,6 @@ class ShixunListsController < ApplicationController
private
def search_params
params.permit(:keyword, :type, :page, :per_page, :order, :type, :status, :diff)
params.permit(:keyword, :type, :page, :limit, :order, :type, :status, :diff)
end
end

@ -16,18 +16,26 @@ module ExercisesHelper
end
if q_type <= Exercise::JUDGMENT
if answers_content.present? #学生有回答时
answer_choice_array = []
answers_content.each do |a|
answer_choice_array.push(a.exercise_choice.choice_position) #学生答案的位置
end
user_answer_content = answer_choice_array.sort
standard_answer = q.exercise_standard_answers.pluck(:exercise_choice_id).sort #该问题的标准答案,可能有多个
if user_answer_content == standard_answer #答案一致,多选或单选才给分,答案不对不给分
ques_score = q.question_score
else
ques_score = 0.0
end
if answers_content.present? #学生有回答时,分数已经全部存到exercise_answer 表,所以可以直接取第一个值
ques_score = answers_content.first.score
ques_score = ques_score < 0 ? 0.0 : ques_score
# answer_choice_array = []
# answers_content.each do |a|
# answer_choice_array.push(a.exercise_choice.choice_position) #学生答案的位置
# end
# user_answer_content = answer_choice_array.sort
# standard_answer = q.exercise_standard_answers.pluck(:exercise_choice_id).sort #该问题的标准答案,可能有多个
# if q_type == Exercise::MULTIPLE && standard_answer.size == 1 # 老数据的问题
# ques_score = answers_content.first.score
# else
#
# end
# if user_answer_content == standard_answer #答案一致,多选或单选才给分,答案不对不给分
# ques_score = q.question_score
# else
# ques_score = 0.0
# end
else
ques_score = 0.0
end
@ -58,7 +66,6 @@ module ExercisesHelper
exercise_sub_status.each do |s|
sub_answer = s.exercise_answers.search_answer_users("user_id",user_id) #主观题只有一个回答
if sub_answer.present? && sub_answer.first.score >= 0.0
if s.question_score <= sub_answer.first.score
stand_status = 1
else

@ -42,7 +42,7 @@ class ShixunSearchService < ApplicationService
def search_options
model_options = {
includes: Shixun.searchable_includes
includes: [ :shixun_info, :challenges, :subjects, user: { user_extension: :school } ]
}
model_options.merge!(where: { id: @shixuns.pluck(:id) })
model_options.merge!(order: {"myshixuns_count" => sort_str})

@ -141,7 +141,8 @@ class NewShixunModel extends Component{
belongto=(value)=>{
this.setState({
type:value
type:value,
keyword:undefined
})
let{page,status,keyword,order,diff,limit}=this.state;
this.getdatalist(page,value,status,keyword,order,diff,limit)
@ -426,7 +427,21 @@ class NewShixunModel extends Component{
</a>
<div className="cl"></div>
{JSON.stringify(item.description) == "{}"?"":<div className="newshixunmodelmidfont" dangerouslySetInnerHTML={{__html: item.description}}>
<style>
{
`
.newradioStyles{
overflow: hidden;
text-overflow: ellipsis;
display: -webkit-box;
-webkit-line-clamp: 2;
-webkit-box-orient: vertical;
max-height: 42px;
}
`
}
</style>
{JSON.stringify(item.description) == "{}"?"":<div className="newshixunmodelmidfont newradioStyles" dangerouslySetInnerHTML={{__html: item.description}}>
</div>}
{item.challenge_names.length===0?"":<div className="newshixunmodelbotfont">

@ -149,16 +149,12 @@
color: #999999;
margin-top: 15px;
margin-left: 30px;
max-width: 1100px;
overflow: hidden;
-o-text-overflow: ellipsis;
text-overflow: ellipsis;
max-width: 1100px;
display: -webkit-box !important;
overflow: hidden !important;
text-overflow: ellipsis !important;
display: -webkit-box !important;
-webkit-line-clamp: 2 !important;
-webkit-box-orient: vertical !important;
display: -webkit-box;
-webkit-line-clamp: 2;
-webkit-box-orient: vertical;
}
.newshixunmodelbotfont{

Loading…
Cancel
Save