Merge remote-tracking branch 'origin/dev_aliyun' into dev_aliyun

dev_home
杨树明 5 years ago
commit fdc04c1d62

@ -16,7 +16,7 @@ class Cooperative::BaseController < ApplicationController
private private
def current_laboratory def current_laboratory
@_current_laboratory ||= Laboratory.find_by_subdomain('hut' || request.subdomain) @_current_laboratory ||= Laboratory.find_by_subdomain(request.subdomain)
end end
def current_setting_or_default(name) def current_setting_or_default(name)

@ -164,7 +164,7 @@ module ExercisesHelper
question_answer_infos.push(answer_option) question_answer_infos.push(answer_option)
end end
elsif ex.question_type == Exercise::COMPLETION #填空题 elsif ex.question_type == Exercise::COMPLETION #填空题
effictive_users_count = effictive_users.pluck(:user_id).uniq.size effictive_users_count = effictive_users.where("answer_text is not null").pluck(:user_id).uniq.size
ex_ordered = ex.is_ordered ex_ordered = ex.is_ordered
null_standard_answer = ex.exercise_standard_answers null_standard_answer = ex.exercise_standard_answers
null_stand_choice = null_standard_answer.pluck(:exercise_choice_id) #一个exercise_choice_id可能对应多个answer_text null_stand_choice = null_standard_answer.pluck(:exercise_choice_id) #一个exercise_choice_id可能对应多个answer_text
@ -214,7 +214,7 @@ module ExercisesHelper
# percent = commit_user_ids > 0 ? (all_user_count / commit_user_ids.to_f).round(3)*100 : 0.0 # percent = commit_user_ids > 0 ? (all_user_count / commit_user_ids.to_f).round(3)*100 : 0.0
user_right_count = effictive_users.where("score > 0.0").pluck(:user_id).uniq user_right_count = effictive_users.where("score > 0.0").pluck(:user_id).uniq
user_wrong_counts = effictive_users.where("score < 0.0").pluck(:user_id).uniq user_wrong_counts = effictive_users.where("score < 0.0 and answer_text is not null").pluck(:user_id).uniq
user_wrong_count = (user_wrong_counts - user_right_count).size user_wrong_count = (user_wrong_counts - user_right_count).size
if effictive_users_count > 0 && user_wrong_count >= 0 if effictive_users_count > 0 && user_wrong_count >= 0

@ -13,7 +13,7 @@ module PollsHelper
end end
def poll_votes_count(votes,user_ids) def poll_votes_count(votes,user_ids)
votes.find_current_vote("user_id",user_ids.uniq).reject(&:blank?).size votes.find_current_vote("user_id",user_ids.uniq).pluck(:user_id).uniq.reject(&:blank?).size
end end
#公用tab页的相关信息 #公用tab页的相关信息

@ -14,7 +14,7 @@ if @poll_questions_count > 0
json.array! @poll_questions do |question| json.array! @poll_questions do |question|
json.partial! "polls/commit_answers_result", question: question, json.partial! "polls/commit_answers_result", question: question,
answers:question.poll_answers, answers:question.poll_answers,
question_votes:question.poll_votes.where(user_id:@poll_commit_ids) #问题的全部答案 question_votes: question.poll_votes.where(user_id:@poll_commit_ids) #问题的全部答案
end end
end end
else else

@ -246,13 +246,13 @@ class PollDetailTabFirst extends Component{
dataIndex: 'No', dataIndex: 'No',
key: 'No', key: 'No',
className:"edu-txt-center", className:"edu-txt-center",
width:110 width:120
}, { }, {
title: '姓名', title: '姓名',
dataIndex: 'name', dataIndex: 'name',
key: 'name', key: 'name',
className:"edu-txt-center", className:"edu-txt-center",
width:160 width:170
}, { }, {
title: '学号', title: '学号',
dataIndex: 'StudentNo', dataIndex: 'StudentNo',
@ -269,11 +269,11 @@ class PollDetailTabFirst extends Component{
title: '分班', title: '分班',
key: 'classes', key: 'classes',
dataIndex: 'classes', dataIndex: 'classes',
width:160, width:220,
className:poll_types && poll_types.groups_count > 0 ? "edu-txt-center":"edu-txt-center none", className:poll_types && poll_types.groups_count > 0 ? "edu-txt-center":"edu-txt-center none",
render:(classes,item,index)=>{ render:(classes,item,index)=>{
return( return(
item.classes ? <span>{item.classes}</span> : <span className="color-grey-9">--</span> item.classes ? <span style={{maxWidth:'208px',display:"block"}} title={item.classes} className="task-hide">{item.classes}</span> : <span className="color-grey-9">--</span>
) )
} }
}, { }, {
@ -281,7 +281,7 @@ class PollDetailTabFirst extends Component{
dataIndex: 'status', dataIndex: 'status',
key: 'status', key: 'status',
className:"edu-txt-center", className:"edu-txt-center",
width:160, width:170,
render:(status,item,index)=>{ render:(status,item,index)=>{
return( return(
item.status == 1 ?<span className='color-green'>按时提交</span>:<span></span> item.status == 1 ?<span className='color-green'>按时提交</span>:<span></span>
@ -292,7 +292,7 @@ class PollDetailTabFirst extends Component{
dataIndex: 'time', dataIndex: 'time',
key: 'time', key: 'time',
className:"edu-txt-center", className:"edu-txt-center",
width:160, width:170,
sorter: true, sorter: true,
defaultSortOrder: 'descend', defaultSortOrder: 'descend',
sortDirections: sortDirections, sortDirections: sortDirections,
@ -395,7 +395,7 @@ class PollDetailTabFirst extends Component{
{/* </div>*/} {/* </div>*/}
{/*}*/} {/*}*/}
</div>} </div>}
<div className="edu-table edu-back-white minH-560"> <div className="edu-table edu-back-white minH-560 pollResultList">
{ {
data && data.length > 0 ? <Table columns={columns} dataSource={data} pagination={false} data && data.length > 0 ? <Table columns={columns} dataSource={data} pagination={false}
onChange={this.table1handleChange}></Table> : <NoneData></NoneData> onChange={this.table1handleChange}></Table> : <NoneData></NoneData>

@ -338,7 +338,9 @@ textarea:read-only{
border:1px solid #FF0000; border:1px solid #FF0000;
border-radius: 5px; border-radius: 5px;
} }
.pollResultList .ant-table-thead > tr > th,.pollResultList .ant-table-tbody > tr > td{
padding:15px 6px;
}
/* 试卷 */ /* 试卷 */
.setScoreInput{ .setScoreInput{
width: 60px!important;height: 30px!important;box-sizing: border-box; width: 60px!important;height: 30px!important;box-sizing: border-box;

Loading…
Cancel
Save