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

dev_ec
杨树林 5 years ago
commit bad129a0cc

@ -14,19 +14,15 @@ class ExerciseAnswersController < ApplicationController
else
ea = @exercise_question.exercise_answers.search_answer_users("user_id",current_user.id) #试卷的当前用户的答案
if q_type == Exercise::SINGLE || q_type == Exercise::JUDGMENT #选择题(单选)/判断题
ea_choice = ea.search_exercise_answer("exercise_choice_id",choice_id).first
answer_option = {
if ea.exists?
ea.first.update_attribute(:exercise_choice_id,choice_id )
else
answer_option = {
:user_id => current_user.id,
:exercise_question_id => @exercise_question.id,
:exercise_choice_id => choice_id,
:answer_text => ""
}
if ea_choice.present? #如果当前用户的答案存在,再次点击,即为删除
ea_choice.destroy
else
if @exercise_question.exercise_standard_answers.count <= 1 #单选题的时候
ea.first.destroy if ea.present?
end
}
ex_a = ExerciseAnswer.new(answer_option)
ex_a.save!
end

@ -123,7 +123,7 @@ class GraduationWork < ApplicationRecord
# 作品是否被评阅过
def scored?
graduation_work_scores.where.not(core: nil).exists?
graduation_work_scores.where.not(score: nil).exists?
end
def work_cross_teacher_ids

@ -13,6 +13,7 @@ end
if @task.task_type == 2
json.is_leader_work @work.user_id == @commit_user_id
json.members @work_members do |member|
json.user_id member.user_id
json.is_leader_work @work.user_id == @commit_user_id
json.user_name member.user.real_name
json.group_name member.course_group_name

@ -11,12 +11,12 @@ json.shixun_list do
atta_reg = /!\[.*]\(\/api\/attachments\/\d+\)/
highlights[:description]&.first&.sub!(reg, '')
highlights[:description]&.map{|des| des.gsub!(atta_reg, '')}
highlights[:description]&.map{|des| des.gsub(atta_reg, '')}
highlights[:content]&.first&.sub!(reg, '')
highlights[:content]&.map{|des| des.gsub!(atta_reg, '')}
highlights[:content]&.map{|des| des.gsub(atta_reg, '')}
json.title highlights.delete(:name)&.join('...') || obj.searchable_title
json.description highlights[:description]&.join('...') || Util.extract_content(obj.description)[0..300]&.sub!(atta_reg, '')
json.description highlights[:description]&.join('...') || Util.extract_content(obj.description)[0..300]&.gsub(atta_reg, '')
json.content highlights
json.level level_to_s(obj.trainee)

@ -7,15 +7,15 @@ json.subject_list do
# 去除开头标点符号
reg = /^[,。?:;‘’!“”—……、]/
# 附件的替换
atta_reg = /!\[.*]\(\/api\/attachments\/\d+\)/
atta_reg = /!\[.*\]\(\/api\/attachments\/\d+\)/
highlights[:description]&.first&.sub!(reg, '')
highlights[:description]&.map{|des| des.gsub!(atta_reg, '')}
highlights[:description]&.map{|des| des.gsub(atta_reg, '')}
highlights[:content]&.first&.sub!(reg, '')
highlights[:content]&.map{|des| des.gsub!(atta_reg, '')}
highlights[:content]&.map{|des| des.gsub(atta_reg, '')}
json.title highlights.delete(:name)&.join('...') || obj.searchable_title
json.description highlights[:description]&.join('...') || Util.extract_content(obj.description)[0..300]&.sub!(atta_reg, '')
json.description highlights[:description]&.join('...') || Util.extract_content(obj.description)[0..300]&.gsub(atta_reg, '')
json.content highlights
end

@ -84,9 +84,9 @@ export function initAxiosInterceptors(props) {
}
config.url = `${proxy}${url}`;
if (config.url.indexOf('?') == -1) {
config.url = `${config.url}?debug=${debugType}`
config.url = `${config.url}?debug=${debugType}`;
} else {
config.url = `${config.url}&debug=${debugType}`
config.url = `${config.url}&debug=${debugType}`;
}
} else {
// 加api前缀

@ -485,7 +485,7 @@ class NewShixunModel extends Component{
</span>}
{this.props.type==='shixuns'?"":<span className="fl color-grey-9 pointer mr30">
<a className={" color-grey-6"} onClick={()=>this.updatepathlist("myshixuns_count",order)}>使用人数</a>
<a className={" color-grey-6"} onClick={()=>this.updatepathlist("myshixuns_count",order)}>学习人数</a>
<sapn className="relativef ml5 " >
<i className={order==="asc"&&sort==="myshixuns_count"?"iconfont icon-sanjiaoxing-up font-12 ntopsj color-grey-9 color-blue":"iconfont icon-sanjiaoxing-up font-12 ntopsj color-grey-9"}></i>
<i className={order==="desc"&&sort==="myshixuns_count"?"iconfont icon-sanjiaoxing-down font-12 nyslbottomsj color-grey-9 color-blue":"iconfont icon-sanjiaoxing-down font-12 nyslbottomsj color-grey-9"}></i>

@ -523,17 +523,17 @@ class GraduationAcross extends Component{
</span>
</span>
</div>
{
<style>
{
`
.ant-table-thead > tr > th .anticon-filter, .ant-table-thead > tr > th .ant-table-filter-icon{
left: 40px;
}
`
}
</style>
}
{/*{*/}
{/*<style>*/}
{/*{*/}
{/*`*/}
{/*.ant-table-thead > tr > th .anticon-filter, .ant-table-thead > tr > th .ant-table-filter-icon{*/}
{/*left: 40px;*/}
{/*}*/}
{/*`*/}
{/*}*/}
{/*</style>*/}
{/*}*/}
<Table rowSelection={rowSelection} columns={bindTableColumn(this)} dataSource={users} pagination={false} onChange={this.handleTableChange} loading={tableLoading}></Table>
<div className="clearfix mt20 pb30 pl30 pr30 acrossfoot">
<div className="fl">

@ -334,22 +334,27 @@ class GraduationTasksSubmitedit extends Component{
}
delecttask_status=(id)=>{
delecttask_status=(id,student_id)=>{
let newid=id===undefined||id===null?student_id:id;
let{selectmemberslist,task_status}=this.state;
let newlist=task_status;
let selects=selectmemberslist;
for(var i=0; i<newlist.length; i++){
if(newlist[i]===id){
if(newlist[i]===newid){
newlist.splice(i,1)
}
}
for(var z=0; z<selects.length; z++){
if(selects[z].user_id===id){
if(selects[z].user_id===newid){
selects.splice(z,1)
}
}else if(selects[z].student_id===newid){
selects.splice(z,1)
}
}
console.log(newlist)
console.log(selects)
this.setState({
task_status:newlist,
selectmemberslist:selects
@ -380,10 +385,12 @@ class GraduationTasksSubmitedit extends Component{
for(var list of selectmemberslist){
if(list.user_id!=undefined&&list.user_id!=null){
userids.push(list.user_id)
if(list.student_id!=undefined&&list.student_id!=null){
userids.push(list.student_id)
}
if(list.user_id!=undefined&&list.user_id!=null){
userids.push(list.user_id)
}
}
let listid=[];
@ -392,6 +399,7 @@ class GraduationTasksSubmitedit extends Component{
listid.push(list.response == undefined ? list.id : list.response.id)
}
console.log(userids)
this.props.form.validateFields((err, values) => {
@ -401,6 +409,7 @@ class GraduationTasksSubmitedit extends Component{
// debugger
return
}
if(workslist.task_type===2){
if(userids.length<workslist.min_num){
this.setState({
@ -460,6 +469,9 @@ class GraduationTasksSubmitedit extends Component{
// }
}).catch((error) => {
console.log(error)
this.setState({
spinnings:false
})
})
@ -785,6 +797,7 @@ class GraduationTasksSubmitedit extends Component{
<div className={"members fl autos"}>
{selectmemberslist&&selectmemberslist.map((item,key)=>{
console.log(item)
if(item.group_name!=undefined) {
return (
<div key={key} style={{
@ -799,7 +812,7 @@ class GraduationTasksSubmitedit extends Component{
{key > 0 ?
<div className={"fr ml20"}><i className={"iconfont icon-shanchudiao fl color-grey-9"}
style={{marginTop: '-4px'}}
onClick={() => this.delecttask_status(item.user_id)}></i>
onClick={() => this.delecttask_status(item.user_id,item.student_id)}></i>
</div> : ""}
<div className={"both"}></div>
</div>

@ -383,7 +383,7 @@ class GraduationTasksSubmitnew extends Component{
let userids=[];
for(var list of selectmemberslist){
debugger
if(list.user_id!=undefined&&list.user_id!=null){
userids.push(list.user_id)
}
@ -408,6 +408,8 @@ class GraduationTasksSubmitnew extends Component{
// debugger
return
}
if(workslist&&workslist.task_type===2){
if(userids!=undefined){
if(userids.length<workslist.min_num){

@ -514,6 +514,7 @@ class GraduationTaskssettinglist extends Component{
}
showAllocationModal=(id)=>{
this.setState({
Allocationtype:true,
operationId:id
@ -861,13 +862,13 @@ class GraduationTaskssettinglist extends Component{
{
tag.name &&
<Tooltip key={key} placement="bottom" title={tag.name==="分配"?taskslistdata&&taskslistdata.cross_comment===true?"":"指定该作品的交叉评阅人":tag.name==="调分"?<pre>调整学生最终成绩<br/>其它历史评分将全部失效</pre>:""}>
{tag.name==="评阅"?<p style={{color:'#4CACFF',padding:"0px 5px"}} href={"/courses/"+courseId+"/graduation_tasks/"+tag.id+"/appraise"} >
{tag.name==="评阅"?<a style={{color:'#4CACFF',padding:"0px 5px"}} href={"/courses/"+courseId+"/graduation_tasks/"+tag.id+"/appraise"} >
{tag.name}
</p>
</a>
:
<p style={{color:tag.name==="调分"?"#000":'#4CACFF',padding:"0px 5px"}}
onClick={tag.name==="调分"?()=>this.showModulationtype(tag.id):tag.name==="分配"?taskslistdata&&taskslistdata.cross_comment===true?"":()=>this.showAllocationModal(tag.id):""}>
{tag.name==="分配"?taskslistdata&&taskslistdata.cross_comment===true?"":tag.name:tag.name}
onClick={tag.name==="调分"?()=>this.showModulationtype(tag.id):tag.name==="分配"?taskslistdata&&taskslistdata.cross_comment===true?"":"":""}>
{tag.name==="分配"?taskslistdata&&taskslistdata.cross_comment===true?"":"":tag.name}
</p>
}
</Tooltip>

Loading…
Cancel
Save