chromesetting
杨树林 5 years ago
commit 76d149ec18

@ -465,9 +465,9 @@ class ApplicationController < ActionController::Base
# 实训主类别列表,自带描述 # 实训主类别列表,自带描述
def shixun_main_type def shixun_main_type
list = [] list = []
mirrors = MirrorRepository.select([:id, :type_name, :description]).published_main_mirror mirrors = MirrorRepository.select([:id, :type_name, :description, :name]).published_main_mirror
mirrors.try(:each) do |mirror| mirrors.try(:each) do |mirror|
list << {id: mirror.id, type_name: mirror.type_name, description: mirror.try(:description)} list << {id: mirror.id, type_name: mirror.type_name, description: mirror.try(:description), mirror_name: mirror.name}
end end
list list
end end
@ -475,9 +475,9 @@ class ApplicationController < ActionController::Base
# 小类别列表 # 小类别列表
def shixun_small_type def shixun_small_type
list = [] list = []
mirrors = MirrorRepository.select([:id, :type_name, :description]).published_small_mirror mirrors = MirrorRepository.select([:id, :type_name, :description, :name]).published_small_mirror
mirrors.try(:each) do |mirror| mirrors.try(:each) do |mirror|
list << {id: mirror.id, type_name: mirror.type_name, description: mirror.description} list << {id: mirror.id, type_name: mirror.type_name, description: mirror.description, mirror_name: mirror.name}
end end
list list
end end

@ -400,13 +400,14 @@ class ShixunsController < ApplicationController
@shixun.shixun_info.update_attributes(shixun_info_params) @shixun.shixun_info.update_attributes(shixun_info_params)
# 镜像变动 # 镜像变动
@shixun.shixun_mirror_repositories.where.not(mirror_repository_id: old_mirror_ids).destroy_all @shixun.shixun_mirror_repositories.where.not(mirror_repository_id: old_mirror_ids).destroy_all
@shixun.shixun_mirror_repositories.create!(new_mirror_id) @shixun.shixun_mirror_repositories.create!(new_mirror_id) if new_mirror_id.present?
# 镜像变动要更换服务配置 # 镜像变动要更换服务配置
@shixun.shixun_service_configs.where.not(mirror_repository_id: old_mirror_ids).destroy_all @shixun.shixun_service_configs.where.not(mirror_repository_id: old_mirror_ids).destroy_all
@shixun.shixun_service_configs.create!(service_create_params) @shixun.shixun_service_configs.create!(service_create_params) if service_create_params.present?
service_update_params&.map do |service| service_update_params&.map do |service|
smr = @shixun.shixun_service_configs.find_by(mirror_repository_id: service[:mirror_repository_id]) smr = @shixun.shixun_service_configs.find_by(mirror_repository_id: service[:mirror_repository_id])
smr.update_attributes(service) logger.info("########smr: #{smr}")
smr.update_attributes(service) if smr.present?
end end
# 添加第二仓库(管理员权限) # 添加第二仓库(管理员权限)
if params[:is_secret_repository] if params[:is_secret_repository]

@ -167,6 +167,15 @@ class Weapps::CoursesController < Weapps::BaseController
normal_status(0, "修改成功") normal_status(0, "修改成功")
end end
# 分班列表
def course_groups
@course_groups = @course.course_groups
@course_groups = @course_groups.where("name like ?", "%#{params[:search]}%") unless params[:search].blank?
@all_group_count = @course_groups.size
@teachers = @course.teachers.includes(:user, :teacher_course_groups) if @user_course_identity < Course::NORMAL
@current_group_id = @course.students.where(user_id: current_user.id).take&.course_group_id if @user_course_identity == Course::STUDENT
end
private private
def course_params def course_params

@ -21,9 +21,17 @@
<td><%= myshixun.id %></td> <td><%= myshixun.id %></td>
<td><%= myshixun.identifier %></td> <td><%= myshixun.identifier %></td>
<td class="text-left"> <td class="text-left">
<% current_task = myshixun.last_executable_task || myshixun.last_task %> <% if myshixun.shixun.is_jupyter? %>
<%= link_to "/tasks/#{current_task.identifier}", target: '_blank' do %> <%= link_to "/tasks/#{myshixun.identifier}/jupyter", target: '_blank' do %>
<%= overflow_hidden_span myshixun.shixun.name, width: 280 %> <%= overflow_hidden_span myshixun.shixun.name, width: 280 %>
<% end %>
<% else %>
<% current_task = myshixun.last_executable_task || myshixun.last_task %>
<% if current_task %>
<%= link_to "/tasks/#{current_task.identifier}", target: '_blank' do %>
<%= overflow_hidden_span myshixun.shixun.name, width: 280 %>
<% end %>
<% end %>
<% end %> <% end %>
</td> </td>
<td><%= myshixun.shixun.user.real_name %></td> <td><%= myshixun.shixun.user.real_name %></td>

@ -38,6 +38,7 @@ json.homeworks @homework_commons.each do |homework|
current_myshixun = homework.user_work(@user.id).try(:myshixun) current_myshixun = homework.user_work(@user.id).try(:myshixun)
myshixun = current_myshixun ? current_myshixun : shixun.myshixuns.find_by(user_id: @user.id) myshixun = current_myshixun ? current_myshixun : shixun.myshixuns.find_by(user_id: @user.id)
# json.game_count current_myshixun ? current_myshixun.exec_count : 0 # json.game_count current_myshixun ? current_myshixun.exec_count : 0
json.shixun_status shixun.try(:status).to_i
json.task_operation task_operation_url(myshixun, shixun) json.task_operation task_operation_url(myshixun, shixun)
else else
work = homework.user_work(@user.id) work = homework.user_work(@user.id)

@ -0,0 +1,6 @@
json.course_groups @course_groups.each do |group|
json.(group, :id, :course_members_count, :name)
end
json.none_group_member_count @course.none_group_count
json.group_count @all_group_count

@ -0,0 +1,5 @@
class ModifyTaskPassForShixuns < ActiveRecord::Migration[5.2]
def change
change_column :shixuns, :task_pass, :boolean, :default => true
end
end

@ -35,7 +35,7 @@ if (isDev) {
// 老师 // 老师
//ebugType="teacher"; //ebugType="teacher";
// 学生 // 学生
// debugType="student"; //debugType="student";
window._debugType = debugType; window._debugType = debugType;
export function initAxiosInterceptors(props) { export function initAxiosInterceptors(props) {
@ -52,6 +52,7 @@ export function initAxiosInterceptors(props) {
//proxy="http://47.96.87.25:48080" //proxy="http://47.96.87.25:48080"
proxy="https://pre-newweb.educoder.net" proxy="https://pre-newweb.educoder.net"
proxy="https://test-newweb.educoder.net" proxy="https://test-newweb.educoder.net"
//proxy="https://test-jupyterweb.educoder.net"
//proxy="http://192.168.2.63:3001" //proxy="http://192.168.2.63:3001"
// 在这里使用requestMap控制避免用户通过双击等操作发出重复的请求 // 在这里使用requestMap控制避免用户通过双击等操作发出重复的请求

@ -893,7 +893,6 @@ class PollNew extends Component {
//保存并继续 //保存并继续
//保存并继续,即提交本题的新建并继续创建一个相同的题(该新题处于编辑模式,题目和选项不要清空) //保存并继续,即提交本题的新建并继续创建一个相同的题(该新题处于编辑模式,题目和选项不要清空)
Deleteadddomtwo = (indexo, object,bool) => { Deleteadddomtwo = (indexo, object,bool) => {
debugger
var thiss = this; var thiss = this;
@ -1038,7 +1037,7 @@ class PollNew extends Component {
if(object.question.max_choices){ if(object.question.max_choices){
if(object.question.max_choices>0){ if(object.question.max_choices>0){
if (object.question.max_choices < object.question.min_choices) { if (object.question.max_choices < object.question.min_choices) {
this.props.showNotification(`可选:最小和最大限制须同时为数值或者“--"`); this.props.showNotification(`可选的最大限制不能小于最小限制`);
return; return;
} }
} }
@ -1258,7 +1257,7 @@ class PollNew extends Component {
if(object.question.max_choices){ if(object.question.max_choices){
if(object.question.max_choices>0){ if(object.question.max_choices>0){
if (object.question.max_choices < object.question.min_choices) { if (object.question.max_choices < object.question.min_choices) {
this.props.showNotification(`可选:最小和最大限制须同时为数值或者“--"`); this.props.showNotification(`可选的最大限制不能小于最小限制`);
return; return;
} }
} }
@ -1449,9 +1448,7 @@ class PollNew extends Component {
// indexo 第几个数组 // indexo 第几个数组
//object 单个数组数据 //object 单个数组数据
Deleteadddomthree = (indexo, object,bool) => { Deleteadddomthree = (indexo, object,bool) => {
this.setState({
newoption: false,
})
// console.log("deleteadddom 349") // console.log("deleteadddom 349")
var thiss = this; var thiss = this;
let arr = this.state.adddom; let arr = this.state.adddom;
@ -1477,9 +1474,14 @@ class PollNew extends Component {
} }
if (newarr[indexo].question.question_title === "") { if (newarr[indexo].question.question_title === "") {
this.props.showNotification('题目不能为空!'); this.props.showNotification('题目不能为空!');
return
}
if (newarr[indexo].question.question_title.match(/^[ ]*$/)) {
this.props.showNotification('题目不能为空!');
return return
} }
if (max > 0) { if (max > 0) {
if (object.question.question_type === 1) { if (object.question.question_type === 1) {
this.props.showNotification('选项内容不能为空!'); this.props.showNotification('选项内容不能为空!');
@ -1579,7 +1581,7 @@ class PollNew extends Component {
if(object.question.max_choices){ if(object.question.max_choices){
if(object.question.max_choices>0){ if(object.question.max_choices>0){
if (object.question.max_choices < object.question.min_choices) { if (object.question.max_choices < object.question.min_choices) {
this.props.showNotification(`可选:最小和最大限制须同时为数值或者“--"`); this.props.showNotification(`可选的最大限制不能小于最小限制`);
return; return;
} }
} }
@ -1790,7 +1792,7 @@ class PollNew extends Component {
if(object.question.max_choices){ if(object.question.max_choices){
if(object.question.max_choices>0){ if(object.question.max_choices>0){
if (object.question.max_choices < object.question.min_choices) { if (object.question.max_choices < object.question.min_choices) {
this.props.showNotification(`可选:最小和最大限制须同时为数值或者“--"`); this.props.showNotification(`可选的最大限制不能小于最小限制`);
return; return;
} }
} }
@ -1867,7 +1869,6 @@ class PollNew extends Component {
}; };
question = {"question": questiontwo}; question = {"question": questiontwo};
//插入多选题 //插入多选题
if (uuk !== -1) { if (uuk !== -1) {
// console.log("修改") // console.log("修改")
this.edittotheserver(object, 2, arrc, null, object.question.max_choices, object.question.min_choices,object.question.answers.length); this.edittotheserver(object, 2, arrc, null, object.question.max_choices, object.question.min_choices,object.question.answers.length);
@ -2016,10 +2017,11 @@ class PollNew extends Component {
if (result !== undefined) { if (result !== undefined) {
if (result.data.status === 0) { if (result.data.status === 0) {
this.props.showNotification(`已完成`); this.props.showNotification(`已完成`);
thiss.thisinitializationdatanew(); thiss.thisinitializationdatanew();
this.setState({ this.setState({
Newdisplay:false, Newdisplay:false,
newoption: false,
}) })
// console.log("确认创建问题") // console.log("确认创建问题")
// console.log(result) // console.log(result)
@ -2032,11 +2034,24 @@ class PollNew extends Component {
// //
// } // }
} }
}else{
this.setState({
Newdisplay:true,
newoption: false,
})
} }
// } catch (e) { // } catch (e) {
// //
// } // }
}).catch((error) => {
console.log(error)
this.setState({
Newdisplay:true,
newoption: false,
})
}) })
@ -2096,11 +2111,24 @@ class PollNew extends Component {
if (result.data.status === 0) { if (result.data.status === 0) {
this.props.showNotification(`编辑题目成功`); this.props.showNotification(`编辑题目成功`);
thiss.thisinitializationdatanew(); thiss.thisinitializationdatanew();
this.setState({
Newdisplay:false,
newoption: false,
})
} }
} catch (e) { } catch (e) {
// console.log("调用了edittotheserver") // console.log("调用了edittotheserver")
console.log(e) this.setState({
Newdisplay:true,
newoption: false,
})
} }
}).catch((error) => {
console.log(error)
this.setState({
Newdisplay:true,
newoption: false,
})
}) })
} }
@ -2685,7 +2713,8 @@ class PollNew extends Component {
// console.log("2301"); // console.log("2301");
// console.log(newr); // console.log(newr);
// window.history.pushState('','',newUrl+'?tab='+e); // window.history.pushState('','',newUrl+'?tab='+e);
window.location.href = `/courses/${coursesId}/polls/${result.data.data.id}/edit`;
// window.location.href = `/courses/${coursesId}/polls/${result.data.data.id}/edit`;
}) })
} else { } else {
@ -2773,6 +2802,7 @@ class PollNew extends Component {
height: '30px', height: '30px',
lineHeight: '30px', lineHeight: '30px',
}; };
const hejiine=this.state.mysingles + this.state.mydoubles + this.state.mymainsint;
// console.log(this.state.projects===undefined?"":this.state.projects.poll_questions) // console.log(this.state.projects===undefined?"":this.state.projects.poll_questions)
var displaymysave = (mysave === true) ? "" : "display:none;"; var displaymysave = (mysave === true) ? "" : "display:none;";
@ -2942,7 +2972,7 @@ class PollNew extends Component {
{ {
this.state.mysingles + this.state.mydoubles + this.state.mymainsint === 0 ? "" : hejiine=== 0 ? "" :
<div> <div>
<span className="fl"> <span className="fl">
{this.state.mysingles === 0 ? "" : <span {this.state.mysingles === 0 ? "" : <span
@ -2959,7 +2989,7 @@ class PollNew extends Component {
</span> </span>
<span className="fr">合计 <span <span className="fr">合计 <span
className="color-blue">{this.state.mysingles === undefined ? "" : this.state.mydoubles === undefined ? "" : this.state.mymainsint === undefined ? "" : this.state.mysingles + this.state.mydoubles + this.state.mymainsint}</span> </span> className="color-blue">{this.state.mysingles === undefined ? "" : this.state.mydoubles === undefined ? "" : this.state.mymainsint === undefined ? "" : hejiine}</span> </span>
</div> </div>
} }

@ -46,6 +46,7 @@ const {Option} = Select;
//作品列表(学生) //作品列表(学生)
let allow_lates=false; let allow_lates=false;
let answer_open_evaluation=false; let answer_open_evaluation=false;
// Curcomlevel
class Listofworksstudentone extends Component { class Listofworksstudentone extends Component {
//unifiedsetting 统一设置 //unifiedsetting 统一设置
//allowreplenishment 允许补交 //allowreplenishment 允许补交
@ -60,6 +61,9 @@ class Listofworksstudentone extends Component {
//要提交的分班状态checkedValuesineinfo //要提交的分班状态checkedValuesineinfo
//searchtext 输入的姓名和学号 //searchtext 输入的姓名和学号
//order 排序时间 //order 排序时间
//当前成绩work_score
//关卡得分final_score
this.state = { this.state = {
jobsettingsdata: undefined, jobsettingsdata: undefined,
endTime: "2018/11/10 17:10:00", endTime: "2018/11/10 17:10:00",
@ -269,7 +273,7 @@ class Listofworksstudentone extends Component {
), ),
}, },
{ {
title: '提交状态', title: '作品状态',
dataIndex: 'submitstate', dataIndex: 'submitstate',
key: 'submitstate', key: 'submitstate',
align: "center", align: "center",
@ -277,15 +281,17 @@ class Listofworksstudentone extends Component {
width: '98px', width: '98px',
render: (text, record) => ( render: (text, record) => (
<span style={{width: '98px',}}> <span style={{width: '98px',}}>
<span style={record.submitstate === "延时完成" ? { <span style={record.submitstate === "迟交通关" ? {
color: '#DD1717', color: '#DD1717',
textAlign: "center", textAlign: "center",
width: '98px', width: '98px',
} : record.submitstate === "按时完成" ? {color: '#29BD8B', textAlign: "center", width: '98px',} : { } : record.submitstate === "按时通关" ? {color: '#29BD8B', textAlign: "center", width: '98px',}
color: '#747A7F', : record.submitstate === "未通关" ? {color: '#F69707', textAlign: "center", width: '98px',}
textAlign: "center", : {
width: '98px', color: '#747A7F',
}}>{record.submitstate === undefined ? "--" : record.submitstate === "" ? "--" : record.submitstate === null ? "--" : record.submitstate}</span> textAlign: "center",
width: '98px',
}}>{record.submitstate === undefined ? "--" : record.submitstate === "" ? "--" : record.submitstate === null ? "--" : record.submitstate}</span>
</span> </span>
), ),
@ -310,14 +316,14 @@ class Listofworksstudentone extends Component {
} }
}> }>
{record.cost_time === null ? "--" : record.cost_time === undefined ? "--" : record.cost_time === "--" ? "--" : {record.cost_time === null ? "--" : record.cost_time === undefined ? "--" : record.cost_time === "--" ? "--" :
<span style={ <span style={
{ {
color: '#747A7F', color: '#747A7F',
textAlign: "center", textAlign: "center",
width: '145px', width: '145px',
}
} }
>{record.cost_time === null ? "--" : record.cost_time === undefined ? "--" : record.cost_time} }
>{record.cost_time === null ? "--" : record.cost_time === undefined ? "--" : record.cost_time}
</span> </span>
} }
</span> </span>
@ -340,7 +346,26 @@ class Listofworksstudentone extends Component {
// ), // ),
// }, // },
{ {
title: '完成情况', title: '当前完成关卡',
dataIndex: 'curcomlevel',
key: 'curcomlevel',
align: "center",
className: 'font-14',
width: '99px',
render: (text, record) => (
<span style={{
width: '99px',
}}>
<span style={{
color: '#07111B',
textAlign: "center",
width: '99px'
}}>{record.Curcomlevel + "/" + this.state.challenges_count}</span>
</span>
),
},
{
title: '截止前完成关卡',
dataIndex: 'completion', dataIndex: 'completion',
key: 'completion', key: 'completion',
align: "center", align: "center",
@ -359,9 +384,12 @@ class Listofworksstudentone extends Component {
), ),
}, },
{ {
title: '关卡得分', title:<span>关卡得分<Tooltip placement="top" title={<pre>
dataIndex: 'levelscore', 计算规则:<br/>
key: 'levelscore', 截止前学员完成的关卡才有成绩<br/>
</pre>}><img src={getImageUrl("images/educoder/problem.png")} className={"ml2"}/></Tooltip></span>,
dataIndex: 'final_score',
key: 'final_score',
align: 'center', align: 'center',
className: 'font-14', className: 'font-14',
width: '99px', width: '99px',
@ -369,19 +397,19 @@ class Listofworksstudentone extends Component {
<span style={{ <span style={{
width: '99px', width: '99px',
}}> }}>
<span style={parseInt(record.levelscore) <= 60 ? { <span style={parseInt(record.final_score) <= 60 ? {
color: '#747A7F', color: '#747A7F',
textAlign: "center", textAlign: "center",
width: '99px', width: '99px',
} : parseInt(record.levelscore) < 90 ? { } : parseInt(record.final_score) < 90 ? {
color: '#FF6800', color: '#FF6800',
textAlign: "center", textAlign: "center",
width: '99px', width: '99px',
} : parseInt(record.levelscore) >= 90 ? {color: '#DD1717', textAlign: "center", width: '99px',} : { } : parseInt(record.final_score) >= 90 ? {color: '#DD1717', textAlign: "center", width: '99px',} : {
color: '#747A7F', color: '#747A7F',
textAlign: "center", textAlign: "center",
width: '99px', width: '99px',
}}>{record.levelscore}</span> }}>{record.final_score}</span>
</span> </span>
) )
}, },
@ -435,26 +463,26 @@ class Listofworksstudentone extends Component {
}, },
{ {
title: '当前成绩', title: '当前成绩',
dataIndex: 'levelscore', dataIndex: 'work_score',
key: 'levelscore', key: 'work_score',
align: "center", align: "center",
className: 'font-14', className: 'font-14',
width: '99px', width: '99px',
render: (text, record) => ( render: (text, record) => (
<span style={{width: '99px',}}> <span style={{width: '99px',}}>
{ {
record.levelscore && record.levelscore === "--" ? record.work_score && record.work_score === "--" ?
<span style={{color: '#9A9A9A', textAlign: "center", width: '99px',}}>{record.levelscore}</span> <span style={{color: '#9A9A9A', textAlign: "center", width: '99px',}}>{record.work_score}</span>
: :
<span style={parseInt(record.levelscore) >= 90 ? { <span style={parseInt(record.work_score) >= 90 ? {
color: '#DD1717', color: '#DD1717',
textAlign: "center", textAlign: "center",
width: '99px', width: '99px',
} : parseInt(record.levelscore) <= 60 ? { } : parseInt(record.work_score) <= 60 ? {
color: '#FF6800', color: '#FF6800',
textAlign: "center", textAlign: "center",
width: '99px', width: '99px',
} : {color: '#747A7F', textAlign: "center", width: '99px',}}>{record.levelscore}</span> } : {color: '#747A7F', textAlign: "center", width: '99px',}}>{record.work_score}</span>
} }
</span> </span>
@ -638,7 +666,7 @@ class Listofworksstudentone extends Component {
), ),
}, },
{ {
title: '提交状态', title: '作品状态',
dataIndex: 'submitstate', dataIndex: 'submitstate',
key: 'submitstate', key: 'submitstate',
align: "center", align: "center",
@ -646,15 +674,17 @@ class Listofworksstudentone extends Component {
width: '98px', width: '98px',
render: (text, record) => ( render: (text, record) => (
<span style={{width: '98px',}}> <span style={{width: '98px',}}>
<span style={record.submitstate === "延时完成" ? { <span style={record.submitstate === "迟交通关" ? {
color: '#DD1717', color: '#DD1717',
textAlign: "center", textAlign: "center",
width: '98px', width: '98px',
} : record.submitstate === "按时完成" ? {color: '#29BD8B', textAlign: "center", width: '98px',} : { } : record.submitstate === "按时通关" ? {color: '#29BD8B', textAlign: "center", width: '98px',}
color: '#747A7F', : record.submitstate === "未通关" ? {color: '#F69707', textAlign: "center", width: '98px',}
textAlign: "center", : {
width: '98px', color: '#747A7F',
}}>{record.submitstate === undefined ? "--" : record.submitstate === "" ? "--" : record.submitstate === null ? "--" : record.submitstate}</span> textAlign: "center",
width: '98px',
}}>{record.submitstate === undefined ? "--" : record.submitstate === "" ? "--" : record.submitstate === null ? "--" : record.submitstate}</span>
</span> </span>
), ),
@ -709,7 +739,26 @@ class Listofworksstudentone extends Component {
// ), // ),
// }, // },
{ {
title: '完成情况', title: '当前完成关卡',
dataIndex: 'curcomlevel',
key: 'curcomlevel',
align: "center",
className: 'font-14',
width: '99px',
render: (text, record) => (
<span style={{
width: '99px',
}}>
<span style={{
color: '#07111B',
textAlign: "center",
width: '99px'
}}>{record.Curcomlevel + "/" + this.state.challenges_count}</span>
</span>
),
},
{
title: '截止前完成关卡',
dataIndex: 'completion', dataIndex: 'completion',
key: 'completion', key: 'completion',
align: "center", align: "center",
@ -728,9 +777,12 @@ class Listofworksstudentone extends Component {
), ),
}, },
{ {
title: '关卡得分', title:<span>关卡得分<Tooltip placement="top" title={<pre>
dataIndex: 'levelscore', 计算规则:<br/>
key: 'levelscore', 截止前学员完成的关卡才有成绩<br/>
</pre>}><img src={getImageUrl("images/educoder/problem.png")} className={"ml2"}/></Tooltip></span>,
dataIndex: 'final_score',
key: 'final_score',
align: 'center', align: 'center',
className: 'font-14', className: 'font-14',
width: '99px', width: '99px',
@ -738,19 +790,19 @@ class Listofworksstudentone extends Component {
<span style={{ <span style={{
width: '99px', width: '99px',
}}> }}>
<span style={parseInt(record.levelscore) <= 60 ? { <span style={parseInt(record.final_score) <= 60 ? {
color: '#747A7F', color: '#747A7F',
textAlign: "center", textAlign: "center",
width: '99px', width: '99px',
} : parseInt(record.levelscore) < 90 ? { } : parseInt(record.final_score) < 90 ? {
color: '#FF6800', color: '#FF6800',
textAlign: "center", textAlign: "center",
width: '99px', width: '99px',
} : parseInt(record.levelscore) >= 90 ? {color: '#DD1717', textAlign: "center", width: '99px',} : { } : parseInt(record.final_score) >= 90 ? {color: '#DD1717', textAlign: "center", width: '99px',} : {
color: '#747A7F', color: '#747A7F',
textAlign: "center", textAlign: "center",
width: '99px', width: '99px',
}}>{record.levelscore}</span> }}>{record.final_score}</span>
</span> </span>
) )
}, },
@ -804,26 +856,26 @@ class Listofworksstudentone extends Component {
}, },
{ {
title: '当前成绩', title: '当前成绩',
dataIndex: 'levelscore', dataIndex: 'work_score',
key: 'levelscore', key: 'work_score',
align: "center", align: "center",
className: 'font-14', className: 'font-14',
width: '99px', width: '99px',
render: (text, record) => ( render: (text, record) => (
<span style={{width: '99px',}}> <span style={{width: '99px',}}>
{ {
record.levelscore && record.levelscore === "--" ? record.work_score && record.work_score === "--" ?
<span style={{color: '#9A9A9A', textAlign: "center", width: '99px',}}>{record.levelscore}</span> <span style={{color: '#9A9A9A', textAlign: "center", width: '99px',}}>{record.work_score}</span>
: :
<span style={parseInt(record.levelscore) >= 90 ? { <span style={parseInt(record.work_score) >= 90 ? {
color: '#DD1717', color: '#DD1717',
textAlign: "center", textAlign: "center",
width: '99px', width: '99px',
} : parseInt(record.levelscore) <= 60 ? { } : parseInt(record.work_score) <= 60 ? {
color: '#FF6800', color: '#FF6800',
textAlign: "center", textAlign: "center",
width: '99px', width: '99px',
} : {color: '#747A7F', textAlign: "center", width: '99px',}}>{record.levelscore}</span> } : {color: '#747A7F', textAlign: "center", width: '99px',}}>{record.work_score}</span>
} }
</span> </span>
@ -967,19 +1019,21 @@ class Listofworksstudentone extends Component {
) )
}, },
{ {
title: '提交状态', title: '作品状态',
dataIndex: 'submitstate', dataIndex: 'submitstate',
key: 'submitstate', key: 'submitstate',
align: 'center', align: 'center',
className: 'font-14', className: 'font-14',
render: (text, record) => ( render: (text, record) => (
<span style={record.submitstate === "延时完成" ? { <span style={record.submitstate === "迟交通关" ? {
color: '#DD1717', color: '#DD1717',
textAlign: "center" textAlign: "center"
} : record.submitstate === "按时完成" ? {color: '#29BD8B', textAlign: "center"} : { } : record.submitstate === "按时通关" ? {color: '#29BD8B', textAlign: "center"}
color: '#747A7F', : record.submitstate === "未通关" ? {color: '#F69707', textAlign: "center", width: '98px'}
textAlign: "center" : {
}}>{record.submitstate} color: '#747A7F',
textAlign: "center"
}}>{record.submitstate}
</span> </span>
) )
@ -1036,7 +1090,26 @@ class Listofworksstudentone extends Component {
// ), // ),
// }, // },
{ {
title: '完成情况', title: '当前完成关卡',
dataIndex: 'curcomlevel',
key: 'curcomlevel',
align: "center",
className: 'font-14',
width: '99px',
render: (text, record) => (
<span style={{
width: '99px',
}}>
<span style={{
color: '#07111B',
textAlign: "center",
width: '99px'
}}>{record.Curcomlevel + "/" + this.state.challenges_count}</span>
</span>
),
},
{
title: '截止前完成关卡',
dataIndex: 'completion', dataIndex: 'completion',
key: 'completion', key: 'completion',
align: 'center', align: 'center',
@ -1051,23 +1124,26 @@ class Listofworksstudentone extends Component {
) )
}, },
{ {
title: '关卡得分', title:<span>关卡得分<Tooltip placement="top" title={<pre>
dataIndex: 'levelscore', 计算规则:<br/>
key: 'levelscore', 截止前学员完成的关卡才有成绩<br/>
</pre>}><img src={getImageUrl("images/educoder/problem.png")} className={"ml2"}/></Tooltip></span>,
dataIndex: 'final_score',
key: 'final_score',
align: 'center', align: 'center',
className: 'font-14', className: 'font-14',
render: (text, record) => ( render: (text, record) => (
<span> <span>
<span style={parseInt(record.levelscore) <= 60 ? { <span style={parseInt(record.final_score) <= 60 ? {
color: '#747A7F', color: '#747A7F',
"text-align": "center" "text-align": "center"
} : parseInt(record.levelscore) < 90 ? { } : parseInt(record.final_score) < 90 ? {
color: '#FF6800', color: '#FF6800',
"text-align": "center" "text-align": "center"
} : parseInt(record.levelscore) >= 90 ? {color: '#DD1717', "text-align": "center"} : { } : parseInt(record.final_score) >= 90 ? {color: '#DD1717', "text-align": "center"} : {
color: '#747A7F', color: '#747A7F',
"text-align": "center" "text-align": "center"
}}>{record.levelscore}</span> }}>{record.final_score}</span>
</span> </span>
) )
}, },
@ -1094,12 +1170,12 @@ class Listofworksstudentone extends Component {
{ {
record.efficiencyscore && record.efficiencyscore === "--" ? ( record.efficiencyscore && record.efficiencyscore === "--" ? (
this.state.allow_late && this.state.allow_late === false ? this.state.allow_late && this.state.allow_late === false ?
<span style={{color: "#9A9A9A"}}> <span style={{color: "#9A9A9A"}}>
-- --
</span> </span>
: :
this.state.allow_late && this.state.allow_late === true ? this.state.allow_late && this.state.allow_late === true ?
<span style={{color: "#9A9A9A"}}> <span style={{color: "#9A9A9A"}}>
-- --
</span> </span>
: :
@ -1125,8 +1201,8 @@ class Listofworksstudentone extends Component {
}, },
{ {
title: '当前成绩', title: '当前成绩',
dataIndex: 'finalscore', dataIndex: 'work_score',
key: 'finalscore', key: 'work_score',
align: 'center', align: 'center',
className: 'font-14', className: 'font-14',
sorter: true, sorter: true,
@ -1138,35 +1214,35 @@ class Listofworksstudentone extends Component {
record.ultimate_score === true ? record.ultimate_score === true ?
<Tooltip placement="bottom" title={<div> <Tooltip placement="bottom" title={<div>
{/*<div>{record.user_name}{record.user_login}</div>*/} {/*<div>{record.user_name}{record.user_login}</div>*/}
<div>{record.finalscore === "--" ? <span>最终调整成绩0</span> : <div>{record.work_score === "--" ? <span>最终调整成绩0</span> :
<span>最终调整成绩{record.finalscore}</span>}</div> <span>最终调整成绩{record.work_score}</span>}</div>
</div>}> </div>}>
{ {
record.finalscore && record.finalscore === "--" ? record.work_score && record.work_score === "--" ?
<span style= <span style=
{{ {{
color: '#9A9A9A', color: '#9A9A9A',
"text-align": "center" "text-align": "center"
}}>{record.finalscore}</span> }}>{record.work_score}</span>
: :
<span style={parseInt(record.finalscore) <= 60 ? { <span style={parseInt(record.work_score) <= 60 ? {
color: '#747A7F', color: '#747A7F',
"text-align": "center" "text-align": "center"
} : parseInt(record.finalscore) < 90 ? { } : parseInt(record.work_score) < 90 ? {
color: '#FF6800', color: '#FF6800',
"text-align": "center" "text-align": "center"
} : parseInt(record.finalscore) >= 90 ? {color: '#DD1717', "text-align": "center"} : { } : parseInt(record.work_score) >= 90 ? {color: '#DD1717', "text-align": "center"} : {
color: '#747A7F', color: '#747A7F',
"text-align": "center" "text-align": "center"
}}>{record.finalscore}</span> }}>{record.work_score}</span>
} }
</Tooltip> </Tooltip>
: :
<Tooltip placement="bottom" title={<div> <Tooltip placement="bottom" title={<div>
{/*<div>{record.user_name}{record.user_login}</div>*/} {/*<div>{record.user_name}{record.user_login}</div>*/}
<div>{record.levelscore === "--" ? <span>关卡得分0</span> : <div>{record.final_score === "--" ? <span>关卡得分0</span> :
<span>关卡得分{record.levelscore}</span>}</div> <span>关卡得分{record.final_score}</span>}</div>
<div>{record.efficiencyscore === "--" ? <span>效率评分0</span> : <div>{record.efficiencyscore === "--" ? <span>效率评分0</span> :
<span>效率评分{record.efficiencyscore}</span>}</div> <span>效率评分{record.efficiencyscore}</span>}</div>
@ -1176,27 +1252,27 @@ class Listofworksstudentone extends Component {
{answer_open_evaluation===true?"":<div>查看参考答案{record.view_answer_count}</div>} {answer_open_evaluation===true?"":<div>查看参考答案{record.view_answer_count}</div>}
<div>{record.finalscore === "--" ? <span>最终成绩0</span> : <div>{record.work_score === "--" ? <span>最终成绩0</span> :
<span>最终成绩{record.finalscore}</span>}</div> <span>最终成绩{record.work_score}</span>}</div>
</div>}> </div>}>
{ {
record.finalscore && record.finalscore === "--" ? record.work_score && record.work_score === "--" ?
<span style= <span style=
{{ {{
color: '#9A9A9A', color: '#9A9A9A',
"text-align": "center" "text-align": "center"
}}>{record.finalscore}</span> }}>{record.work_score}</span>
: :
<span style={parseInt(record.finalscore) <= 60 ? { <span style={parseInt(record.work_score) <= 60 ? {
color: '#747A7F', color: '#747A7F',
"text-align": "center" "text-align": "center"
} : parseInt(record.finalscore) < 90 ? { } : parseInt(record.work_score) < 90 ? {
color: '#FF6800', color: '#FF6800',
"text-align": "center" "text-align": "center"
} : parseInt(record.finalscore) >= 90 ? {color: '#DD1717', "text-align": "center"} : { } : parseInt(record.work_score) >= 90 ? {color: '#DD1717', "text-align": "center"} : {
color: '#747A7F', color: '#747A7F',
"text-align": "center" "text-align": "center"
}}>{record.finalscore}</span> }}>{record.work_score}</span>
} }
</Tooltip> </Tooltip>
@ -1315,19 +1391,21 @@ class Listofworksstudentone extends Component {
) )
}, },
{ {
title: '提交状态', title: '作品状态',
dataIndex: 'submitstate', dataIndex: 'submitstate',
key: 'submitstate', key: 'submitstate',
align: 'center', align: 'center',
className: 'font-14', className: 'font-14',
render: (text, record) => ( render: (text, record) => (
<span style={record.submitstate === "延时完成" ? { <span style={record.submitstate === "迟交通关" ? {
color: '#DD1717', color: '#DD1717',
textAlign: "center" textAlign: "center"
} : record.submitstate === "按时完成" ? {color: '#29BD8B', textAlign: "center"} : { } : record.submitstate === "按时通关" ? {color: '#29BD8B', textAlign: "center"}
color: '#747A7F', : record.submitstate === "未通关" ? {color: '#F69707', textAlign: "center", width: '98px'}
textAlign: "center" : {
}}>{record.submitstate} color: '#747A7F',
textAlign: "center"
}}>{record.submitstate}
</span> </span>
) )
@ -1360,20 +1438,39 @@ class Listofworksstudentone extends Component {
} }
}> }>
{record.cost_time === null ? "--" : record.cost_time === undefined ? "--" : record.cost_time === "--" ? "--" : {record.cost_time === null ? "--" : record.cost_time === undefined ? "--" : record.cost_time === "--" ? "--" :
<a style={ <a style={
{ {
color: '#747A7F', color: '#747A7F',
textAlign: "center" textAlign: "center"
}
} }
>{record.cost_time === null ? "--" : record.cost_time === undefined ? "--" : record.cost_time} }
</a> >{record.cost_time === null ? "--" : record.cost_time === undefined ? "--" : record.cost_time}
</a>
} }
</span> </span>
) )
}, },
{ {
title: '完成情况', title: '当前完成关卡',
dataIndex: 'curcomlevel',
key: 'curcomlevel',
align: "center",
className: 'font-14',
width: '99px',
render: (text, record) => (
<span style={{
width: '99px',
}}>
<span style={{
color: '#07111B',
textAlign: "center",
width: '99px'
}}>{record.Curcomlevel + "/" + this.state.challenges_count}</span>
</span>
),
},
{
title: '截止前完成关卡',
dataIndex: 'completion', dataIndex: 'completion',
key: 'completion', key: 'completion',
align: 'center', align: 'center',
@ -1388,23 +1485,26 @@ class Listofworksstudentone extends Component {
) )
}, },
{ {
title: '关卡得分', title:<span>关卡得分<Tooltip placement="top" title={<pre>
dataIndex: 'levelscore', 计算规则:<br/>
key: 'levelscore', 截止前学员完成的关卡才有成绩<br/>
</pre>}><img src={getImageUrl("images/educoder/problem.png")} className={"ml2"}/></Tooltip></span>,
dataIndex: 'final_score',
key: 'final_score',
align: 'center', align: 'center',
className: 'font-14', className: 'font-14',
render: (text, record) => ( render: (text, record) => (
<span> <span>
<span style={parseInt(record.levelscore) <= 60 ? { <span style={parseInt(record.final_score) <= 60 ? {
color: '#747A7F', color: '#747A7F',
textAlign: "center" textAlign: "center"
} : parseInt(record.levelscore) < 90 ? { } : parseInt(record.final_score) < 90 ? {
color: '#FF6800', color: '#FF6800',
textAlign: "center" textAlign: "center"
} : parseInt(record.levelscore) >= 90 ? {color: '#DD1717', textAlign: "center"} : { } : parseInt(record.final_score) >= 90 ? {color: '#DD1717', textAlign: "center"} : {
color: '#747A7F', color: '#747A7F',
textAlign: "center" textAlign: "center"
}}>{record.levelscore}</span> }}>{record.final_score}</span>
</span> </span>
) )
}, },
@ -1431,12 +1531,12 @@ class Listofworksstudentone extends Component {
{ {
record.efficiencyscore && record.efficiencyscore === "--" ? ( record.efficiencyscore && record.efficiencyscore === "--" ? (
this.state.allow_late && this.state.allow_late === false ? this.state.allow_late && this.state.allow_late === false ?
<span style={{color: "#9A9A9A"}}> <span style={{color: "#9A9A9A"}}>
-- --
</span> </span>
: :
this.state.allow_late && this.state.allow_late === true ? this.state.allow_late && this.state.allow_late === true ?
<span style={{color: "#9A9A9A"}}> <span style={{color: "#9A9A9A"}}>
-- --
</span> </span>
: :
@ -1462,8 +1562,8 @@ class Listofworksstudentone extends Component {
}, },
{ {
title: '当前成绩', title: '当前成绩',
dataIndex: 'finalscore', dataIndex: 'work_score',
key: 'finalscore', key: 'work_score',
align: 'center', align: 'center',
className: 'font-14', className: 'font-14',
sorter: true, sorter: true,
@ -1475,35 +1575,35 @@ class Listofworksstudentone extends Component {
record.ultimate_score === true ? record.ultimate_score === true ?
<Tooltip placement="bottom" title={<div> <Tooltip placement="bottom" title={<div>
{/*<div>{record.user_name}{record.user_login}</div>*/} {/*<div>{record.user_name}{record.user_login}</div>*/}
<div>{record.finalscore === "--" ? <span>最终调整成绩0</span> : <div>{record.work_score === "--" ? <span>最终调整成绩0</span> :
<span>最终调整成绩{record.finalscore}</span>}</div> <span>最终调整成绩{record.work_score}</span>}</div>
</div>}> </div>}>
{ {
record.finalscore && record.finalscore === "--" ? record.work_score && record.work_score === "--" ?
<span style= <span style=
{{ {{
color: '#9A9A9A', color: '#9A9A9A',
textAlign: "center" textAlign: "center"
}}>{record.finalscore}</span> }}>{record.work_score}</span>
: :
<span style={parseInt(record.finalscore) <= 60 ? { <span style={parseInt(record.work_score) <= 60 ? {
color: '#747A7F', color: '#747A7F',
textAlign: "center" textAlign: "center"
} : parseInt(record.finalscore) < 90 ? { } : parseInt(record.work_score) < 90 ? {
color: '#FF6800', color: '#FF6800',
textAlign: "center" textAlign: "center"
} : parseInt(record.finalscore) >= 90 ? {color: '#DD1717', textAlign: "center"} : { } : parseInt(record.work_score) >= 90 ? {color: '#DD1717', textAlign: "center"} : {
color: '#747A7F', color: '#747A7F',
textAlign: "center" textAlign: "center"
}}>{record.finalscore}</span> }}>{record.work_score}</span>
} }
</Tooltip> </Tooltip>
: :
<Tooltip placement="bottom" title={<div> <Tooltip placement="bottom" title={<div>
{/*<div>{record.user_name}{record.user_login}</div>*/} {/*<div>{record.user_name}{record.user_login}</div>*/}
<div>{record.levelscore === "--" ? <span>关卡得分0</span> : <div>{record.final_score === "--" ? <span>关卡得分0</span> :
<span>关卡得分{record.levelscore}</span>}</div> <span>关卡得分{record.final_score}</span>}</div>
<div>{record.efficiencyscore === "--" ? <span>效率评分0</span> : <div>{record.efficiencyscore === "--" ? <span>效率评分0</span> :
<span>效率评分{record.efficiencyscore}</span>}</div> <span>效率评分{record.efficiencyscore}</span>}</div>
@ -1513,27 +1613,27 @@ class Listofworksstudentone extends Component {
{answer_open_evaluation===true?"":<div>查看参考答案{record.view_answer_count}</div>} {answer_open_evaluation===true?"":<div>查看参考答案{record.view_answer_count}</div>}
<div>{record.finalscore === "--" ? <span>最终成绩0</span> : <div>{record.work_score === "--" ? <span>最终成绩0</span> :
<span>最终成绩{record.finalscore}</span>}</div> <span>最终成绩{record.work_score}</span>}</div>
</div>}> </div>}>
{ {
record.finalscore && record.finalscore === "--" ? record.work_score && record.work_score === "--" ?
<span style= <span style=
{{ {{
color: '#9A9A9A', color: '#9A9A9A',
textAlign: "center" textAlign: "center"
}}>{record.finalscore}</span> }}>{record.work_score}</span>
: :
<span style={parseInt(record.finalscore) <= 60 ? { <span style={parseInt(record.work_score) <= 60 ? {
color: '#747A7F', color: '#747A7F',
textAlign: "center" textAlign: "center"
} : parseInt(record.finalscore) < 90 ? { } : parseInt(record.work_score) < 90 ? {
color: '#FF6800', color: '#FF6800',
textAlign: "center" textAlign: "center"
} : parseInt(record.finalscore) >= 90 ? {color: '#DD1717', textAlign: "center"} : { } : parseInt(record.work_score) >= 90 ? {color: '#DD1717', textAlign: "center"} : {
color: '#747A7F', color: '#747A7F',
textAlign: "center" textAlign: "center"
}}>{record.finalscore}</span> }}>{record.work_score}</span>
} }
</Tooltip> </Tooltip>
@ -1977,7 +2077,7 @@ class Listofworksstudentone extends Component {
stduynumber: teacherdata.student_id, stduynumber: teacherdata.student_id,
classroom: teacherdata.group_name, classroom: teacherdata.group_name,
cost_time: teacherdata.cost_time, cost_time: teacherdata.cost_time,
submitstate: teacherdata.work_status === 0 ? "未提交" : teacherdata.work_status === 1 ? "按时完成" : teacherdata.work_status === 2 ? "延时完成" : "未提交", submitstate: teacherdata.work_status === 0 ? "未提交" : teacherdata.work_status === 1 ? "未通关" : teacherdata.work_status === 2 ? "按时通关" : "迟交通关",
// updatetime:this.state.teacherdata.student_works[i].update_time, // updatetime:this.state.teacherdata.student_works[i].update_time,
// updatetime:"", // updatetime:"",
updatetime: timedata === "Invalid date" ? "--" : timedata, updatetime: timedata === "Invalid date" ? "--" : timedata,
@ -1985,12 +2085,14 @@ class Listofworksstudentone extends Component {
levelscore: teacherdata.final_score, levelscore: teacherdata.final_score,
view_answer_count: teacherdata.view_answer_count, view_answer_count: teacherdata.view_answer_count,
efficiencyscore: teacherdata.eff_score, efficiencyscore: teacherdata.eff_score,
finalscore: teacherdata.work_score, final_score: teacherdata.final_score===null||teacherdata.final_score===undefined||teacherdata.final_score===""?"--":teacherdata.final_score,
work_score: teacherdata.work_score===null||teacherdata.work_score===undefined||teacherdata.work_score===""?"--":teacherdata.work_score,
operating: "查看", operating: "查看",
late_penalty: teacherdata.late_penalty === null ? "0" : teacherdata.late_penalty === undefined ? "0" : teacherdata.late_penalty, late_penalty: teacherdata.late_penalty === null ? "0" : teacherdata.late_penalty === undefined ? "0" : teacherdata.late_penalty,
ultimate_score: teacherdata.ultimate_score, ultimate_score: teacherdata.ultimate_score,
user_name: teacherdata.user_name, user_name: teacherdata.user_name,
user_login: teacherdata.user_login, user_login: teacherdata.user_login,
Curcomlevel: teacherdata.current_complete_count===undefined||teacherdata.current_complete_count===null||teacherdata.current_complete_count===""?0:teacherdata.current_complete_count,
}) })
// } // }
@ -2019,20 +2121,22 @@ class Listofworksstudentone extends Component {
stduynumber: student_works[i].student_id, stduynumber: student_works[i].student_id,
classroom: student_works[i].group_name, classroom: student_works[i].group_name,
cost_time: student_works[i].cost_time, cost_time: student_works[i].cost_time,
submitstate: student_works[i].work_status === 0 ? "未提交" : student_works[i].work_status === 1 ? "按时完成" : student_works[i].work_status === 2 ? "延时完成" : "未提交", submitstate: student_works[i].work_status === 0 ? "未提交" : student_works[i].work_status === 1 ? "未通关" : student_works[i].work_status === 2 ? "按时通关" : "迟交通关",
// updatetime:this.state.teacherdata.student_works[i].update_time, // updatetime:this.state.teacherdata.student_works[i].update_time,
// updatetime:"", // updatetime:"",
updatetime: timedata === "Invalid date" ? "--" : timedata, updatetime: timedata === "Invalid date" ? "--" : timedata,
completion: student_works[i].complete_count === null ? "0" : student_works[i].complete_count === undefined ? "0" : student_works[i].complete_count, completion: student_works[i].complete_count === null ? "0" : student_works[i].complete_count === undefined ? "0" : student_works[i].complete_count,
levelscore: student_works[i].final_score, levelscore: student_works[i].final_score,
final_score: student_works[i].final_score=== null ||student_works[i].final_score=== undefined||student_works[i].final_score=== ""?"--":student_works[i].final_score,
work_score: student_works[i].work_score===null||student_works[i].work_score===undefined||student_works[i].work_score===""?"--":student_works[i].work_score,
efficiencyscore: student_works[i].eff_score === "0.0" ? "--" : student_works[i].eff_score === "0" ? "--" : student_works[i].eff_score, efficiencyscore: student_works[i].eff_score === "0.0" ? "--" : student_works[i].eff_score === "0" ? "--" : student_works[i].eff_score,
finalscore: student_works[i].work_score,
view_answer_count: student_works[i].view_answer_count, view_answer_count: student_works[i].view_answer_count,
operating: "查看", operating: "查看",
late_penalty: student_works[i].late_penalty === null ? "0" : student_works[i].late_penalty === undefined ? "0" : student_works[i].late_penalty, late_penalty: student_works[i].late_penalty === null ? "0" : student_works[i].late_penalty === undefined ? "0" : student_works[i].late_penalty,
ultimate_score: student_works[i].ultimate_score, ultimate_score: student_works[i].ultimate_score,
user_name: student_works[i].user_name, user_name: student_works[i].user_name,
user_login: student_works[i].user_login, user_login: student_works[i].user_login,
Curcomlevel:student_works[i].current_complete_count===null||student_works[i].current_complete_count===null||student_works[i].current_complete_count===""?0:student_works[i].current_complete_count,
}) })
} }
@ -2178,7 +2282,7 @@ class Listofworksstudentone extends Component {
stduynumber: teacherdata.student_id, stduynumber: teacherdata.student_id,
classroom: teacherdata.group_name, classroom: teacherdata.group_name,
cost_time: teacherdata.cost_time, cost_time: teacherdata.cost_time,
submitstate: teacherdata.work_status === 0 ? "未提交" : teacherdata.work_status === 1 ? "按时完成" : teacherdata.work_status === 2 ? "延时完成" : "未提交", submitstate: teacherdata.work_status === 0 ? "未提交" : teacherdata.work_status === 1 ? "未通关" : teacherdata.work_status === 2 ? "按时通关" : "迟交通关",
// updatetime:this.state.teacherdata.student_works[i].update_time, // updatetime:this.state.teacherdata.student_works[i].update_time,
// updatetime:"", // updatetime:"",
updatetime: timedata === "Invalid date" ? "--" : timedata, updatetime: timedata === "Invalid date" ? "--" : timedata,
@ -2186,12 +2290,15 @@ class Listofworksstudentone extends Component {
levelscore: teacherdata.final_score, levelscore: teacherdata.final_score,
efficiencyscore: teacherdata.eff_score, efficiencyscore: teacherdata.eff_score,
view_answer_count: teacherdata.view_answer_count, view_answer_count: teacherdata.view_answer_count,
finalscore: teacherdata.work_score, final_score: teacherdata.final_score===null||teacherdata.final_score===undefined||teacherdata.final_score===""?"--":teacherdata.final_score,
work_score:teacherdata.work_score===null||teacherdata.work_score===undefined||teacherdata.work_score===""?"--":teacherdata.work_score,
operating: "查看", operating: "查看",
late_penalty: teacherdata.late_penalty === null ? "0" : teacherdata.late_penalty === undefined ? "0" : teacherdata.late_penalty, late_penalty: teacherdata.late_penalty === null ? "0" : teacherdata.late_penalty === undefined ? "0" : teacherdata.late_penalty,
ultimate_score: teacherdata.ultimate_score, ultimate_score: teacherdata.ultimate_score,
user_name: teacherdata.user_name, user_name: teacherdata.user_name,
user_login: teacherdata.user_login, user_login: teacherdata.user_login,
Curcomlevel: teacherdata.current_complete_count===null|| teacherdata.current_complete_count===undefined|| teacherdata.current_complete_count===""?0: teacherdata.current_complete_count,
}) })
// } // }
@ -2537,20 +2644,22 @@ class Listofworksstudentone extends Component {
stduynumber: student_works[i].student_id, stduynumber: student_works[i].student_id,
classroom: student_works[i].group_name, classroom: student_works[i].group_name,
cost_time: student_works[i].cost_time, cost_time: student_works[i].cost_time,
submitstate: student_works[i].work_status === 0 ? "未提交" : student_works[i].work_status === 1 ? "按时完成" : student_works[i].work_status === 2 ? "延时完成" : "未提交", submitstate: student_works[i].work_status === 0 ? "未提交" : student_works[i].work_status === 1 ? "未通关" : student_works[i].work_status === 2 ? "按时通关" : "迟交通关",
// updatetime:this.state.teacherdata.student_works[i].update_time, // updatetime:this.state.teacherdata.student_works[i].update_time,
// updatetime:"", // updatetime:"",
updatetime: timedata === "Invalid date" ? "--" : timedata, updatetime: timedata === "Invalid date" ? "--" : timedata,
completion: student_works[i].complete_count === null ? "0" : student_works[i].complete_count === undefined ? "0" : student_works[i].complete_count, completion: student_works[i].complete_count === null ? "0" : student_works[i].complete_count === undefined ? "0" : student_works[i].complete_count,
levelscore: student_works[i].final_score, levelscore: student_works[i].final_score,
efficiencyscore: student_works[i].eff_score === "0.0" ? "--" : student_works[i].eff_score === "0" ? "--" : student_works[i].eff_score, efficiencyscore: student_works[i].eff_score === "0.0" ? "--" : student_works[i].eff_score === "0" ? "--" : student_works[i].eff_score,
finalscore: student_works[i].work_score, final_score: student_works[i].final_score===null||student_works[i].final_score===undefined||student_works[i].final_score===""?"--":student_works[i].final_score,
work_score:student_works[i].work_score===null||student_works[i].work_score===undefined||student_works[i].work_score===""?"--":student_works[i].work_score,
view_answer_count: student_works[i].view_answer_count, view_answer_count: student_works[i].view_answer_count,
operating: "查看", operating: "查看",
late_penalty: student_works[i].late_penalty === null ? "0" : student_works[i].late_penalty === undefined ? "0" : student_works[i].late_penalty, late_penalty: student_works[i].late_penalty === null ? "0" : student_works[i].late_penalty === undefined ? "0" : student_works[i].late_penalty,
ultimate_score: student_works[i].ultimate_score, ultimate_score: student_works[i].ultimate_score,
user_name: student_works[i].user_name, user_name: student_works[i].user_name,
user_login: student_works[i].user_login, user_login: student_works[i].user_login,
Curcomlevel: student_works[i].current_complete_count===undefined||student_works[i].current_complete_count===null||student_works[i].current_complete_count===""?0:student_works[i].current_complete_count,
}) })
} }
@ -3356,13 +3465,42 @@ class Listofworksstudentone extends Component {
} }
render() { render() {
let {columns, course_groupysls, datajs, isAdmin, homework_status, course_groupyslstwo, unlimited, unlimitedtwo, course_group_info, orders, task_status, checkedValuesine, searchtext, teacherlist, visible, visibles, game_list, columnsstu, columnsstu2, limit, experience, boolgalist, viewtrainingdata, teacherdata, page, data, jobsettingsdata, styletable, datas, order, loadingstate, computeTimetype} = this.state; let {columns,columnss, course_groupysls, datajs, isAdmin, homework_status, course_groupyslstwo, unlimited, unlimitedtwo, course_group_info, orders, task_status, checkedValuesine, searchtext, teacherlist, visible, visibles, game_list, columnsstu, columnsstu2, limit, experience, boolgalist, viewtrainingdata, teacherdata, page, data, jobsettingsdata, styletable, datas, order, loadingstate, computeTimetype} = this.state;
const antIcon = <Icon type="loading" style={{fontSize: 24}} spin/>; const antIcon = <Icon type="loading" style={{fontSize: 24}} spin/>;
let course_is_end = this.props.current_user && this.props.current_user.course_is_end; let course_is_end = this.props.current_user && this.props.current_user.course_is_end;
// console.log("Listofworksstudentone.js"); // console.log("Listofworksstudentone.js");
// console.log(orders); // console.log(orders);
let homewrok=false;
if(homework_status && homework_status.length > 0){
for(var i=0;i<homework_status.length;i++){
if(homework_status[i]==="已截止"){
homewrok=true;
}
}
if(homewrok===false){
for(var i=0;i<columnsstu.length;i++){
if (columnsstu[i].title === "当前完成关卡"){//item.id==122
columnsstu.splice(i,1)
}
}
for(var i=0;i<columnsstu2.length;i++){
if (columnsstu2[i].title === "当前完成关卡"){//item.id==122
columnsstu2.splice(i,1)
}
}
for(var i=0;i<columns.length;i++){
if (columns[i].title === "当前完成关卡"){//item.id==122
columns.splice(i,1)
}
}
for(var i=0;i<columnss.length;i++){
if (columnss[i].title === "当前完成关卡"){//item.id==122
columnss.splice(i,1)
}
}
}
}
return ( return (
this.props.isAdmin() === true ? this.props.isAdmin() === true ?
@ -3675,7 +3813,7 @@ class Listofworksstudentone extends Component {
height: 58px; height: 58px;
} }
.ysltableo .ant-table-thead > tr > th, .ant-table-tbody > tr > td { .ysltableo .ant-table-thead > tr > th, .ant-table-tbody > tr > td {
padding: 9px; padding: 0px;
} }
`}</style> `}</style>
<div className="edu-table edu-back-white ant-tables ysltableo table1"> <div className="edu-table edu-back-white ant-tables ysltableo table1">
@ -3846,10 +3984,10 @@ class Listofworksstudentone extends Component {
{teacherdata === undefined ? "" : teacherdata.left_time === undefined ? "" : teacherdata.left_time === null ? "" : {teacherdata === undefined ? "" : teacherdata.left_time === undefined ? "" : teacherdata.left_time === null ? "" :
<span className="ml20">{teacherdata.left_time.status}</span> <span className="ml20">{teacherdata.left_time.status}</span>
} }
{teacherdata === undefined ? "0" : teacherdata.left_time === undefined ? "0" : teacherdata.left_time === null ? "0" : {teacherdata === undefined ? "0" : teacherdata.left_time === undefined ? "0" : teacherdata.left_time === null ? "0" :
<span className="ml20" <span className="ml20"
style={{color: '#FF6800'}}>{teacherdata.left_time.time}</span> style={{color: '#FF6800'}}>{teacherdata.left_time.time}</span>
} }
</span> </span>
</span> </span>
@ -3901,7 +4039,7 @@ class Listofworksstudentone extends Component {
height: 58px; height: 58px;
} }
.ysltableow .ant-table-thead > tr > th, .ant-table-tbody > tr > td { .ysltableow .ant-table-thead > tr > th, .ant-table-tbody > tr > td {
padding: 9px; padding: 0px;
} }
`}</style> `}</style>
<div className="edu-table edu-back-white ysltableow table2"> <div className="edu-table edu-back-white ysltableow table2">
@ -4005,7 +4143,7 @@ class Listofworksstudentone extends Component {
height: 58px; height: 58px;
} }
.ysltableows .ant-table-thead > tr > th, .ant-table-tbody > tr > td { .ysltableows .ant-table-thead > tr > th, .ant-table-tbody > tr > td {
padding: 9px; padding: 0px;
} }
` `
} }
@ -4043,9 +4181,9 @@ class Listofworksstudentone extends Component {
<span style={{color: "#666"}}> <span style={{color: "#666"}}>
{teacherdata === undefined ? "" : teacherdata.left_time === undefined ? "" : teacherdata.left_time === null ? "" : {teacherdata === undefined ? "" : teacherdata.left_time === undefined ? "" : teacherdata.left_time === null ? "" :
<span className="ml20">{teacherdata.left_time.status}</span>} <span className="ml20">{teacherdata.left_time.status}</span>}
{teacherdata === undefined ? "0" : teacherdata.left_time === undefined ? "0" : teacherdata.left_time === null ? "0" : {teacherdata === undefined ? "0" : teacherdata.left_time === undefined ? "0" : teacherdata.left_time === null ? "0" :
<span className="ml20" <span className="ml20"
style={{color: '#FF6800'}}>{teacherdata.left_time.time}</span>} style={{color: '#FF6800'}}>{teacherdata.left_time.time}</span>}
</span> </span>
</span> </span>
<style> <style>
@ -4134,7 +4272,7 @@ class Listofworksstudentone extends Component {
height: 58px; height: 58px;
} }
.ysltableowss .ant-table-thead > tr > th, .ant-table-tbody > tr > td { .ysltableowss .ant-table-thead > tr > th, .ant-table-tbody > tr > td {
padding: 9px; padding: 0px;
} }
`}</style> `}</style>
<div className="edu-table edu-back-white ysltableowss table4"> <div className="edu-table edu-back-white ysltableowss table4">

@ -232,9 +232,11 @@ class ShixunHomeworkPage extends Component {
typelist={teacherdatapage === undefined ? [""] : teacherdatapage.homework_status} typelist={teacherdatapage === undefined ? [""] : teacherdatapage.homework_status}
/> />
<a className="color-grey-9 fr font-16 summaryname ml20 mr20" onClick={()=>this.gotohome()}>返回</a> <a className="color-grey-9 fr font-16 summaryname ml20 mr20" onClick={()=>this.gotohome()}>返回</a>
{teacherdatapage&&teacherdatapage.shixun_status>1?<a className="color-grey-9 fr font-16 mr20" {teacherdatapage&&teacherdatapage.shixun_status>1?this.props.isAdmin()?<a className="color-grey-9 fr font-16 mr20"
href={`/shixuns/${teacherdatapage === undefined ? "" : teacherdatapage.shixun_identifier}/challenges`} href={`/shixuns/${teacherdatapage === undefined ? "" : teacherdatapage.shixun_identifier}/challenges`}
target={"_blank"}>实训详情</a>:""} target={"_blank"}>实训详情</a>: this.props.isStudent()?teacherdatapage&&teacherdatapage.time_status<5?<a className="color-grey-9 fr font-16 mr20"
href={`/shixuns/${teacherdatapage === undefined ? "" : teacherdatapage.shixun_identifier}/challenges`}
target={"_blank"}>实训详情</a>:"":"":""}
</div> </div>
@ -336,7 +338,7 @@ class ShixunHomeworkPage extends Component {
<a className="fr color-blue font-16" <a className="fr color-blue font-16"
href={`/courses/${this.props.match.params.coursesId}/${jobsettingsdatapage === undefined ? "" : jobsettingsdatapage.data.category.main === 1 ? "shixun_homeworks" :"shixun_homework"}/${teacherdatapage === undefined ? "" : teacherdatapage.id}/commitsummary/${this.props.match.params.homeworkid}`}>{teacherdatapage.commit_des}</a> href={`/courses/${this.props.match.params.coursesId}/${jobsettingsdatapage === undefined ? "" : jobsettingsdatapage.data.category.main === 1 ? "shixun_homeworks" :"shixun_homework"}/${teacherdatapage === undefined ? "" : teacherdatapage.id}/commitsummary/${this.props.match.params.homeworkid}`}>{teacherdatapage.commit_des}</a>
} }
{teacherdatapage === undefined ? "" :teacherdatapage&&teacherdatapage.shixun_status>1?<Startshixuntask {teacherdatapage === undefined ? "" :teacherdatapage&&teacherdatapage.shixun_status>1&&teacherdatapage&&teacherdatapage.time_status<5?<Startshixuntask
{...this.props} {...this.props}
data={teacherdatapage} data={teacherdatapage}
/>:""} />:""}

@ -371,6 +371,7 @@ class ShixunhomeWorkItem extends Component{
{this.props.isStudent===true?this.props.course_identity===5?discussMessage&&discussMessage.shixun_status>1? {this.props.isStudent===true?this.props.course_identity===5?discussMessage&&discussMessage.shixun_status>1?
discussMessage.time_status<5?
<WordsBtn style="blue" className="colorblue font-16 mr20 fr mt10"> <WordsBtn style="blue" className="colorblue font-16 mr20 fr mt10">
{startbtn===false? {startbtn===false?
(discussMessage.task_operation[0] == '继续挑战' || discussMessage.task_operation[0] == '查看实战' ? (discussMessage.task_operation[0] == '继续挑战' || discussMessage.task_operation[0] == '查看实战' ?
@ -381,7 +382,7 @@ class ShixunhomeWorkItem extends Component{
<a className="btn colorblue" onClick={()=>this.taskoperationId(discussMessage.task_operation[1])}> <a className="btn colorblue" onClick={()=>this.taskoperationId(discussMessage.task_operation[1])}>
{discussMessage.task_operation[0]} {discussMessage.task_operation[0]}
</a>):<a className="btn colorblue" ></a>} </a>):<a className="btn colorblue" ></a>}
</WordsBtn>:"":"":"" </WordsBtn>:"":"":"":""
} }
</h6> </h6>

@ -1208,7 +1208,7 @@ class ShixunHomework extends Component{
{this.props.isAdmin()?<Menu.Item key="0">未发布</Menu.Item>:""} {this.props.isAdmin()?<Menu.Item key="0">未发布</Menu.Item>:""}
<Menu.Item key="1">提交中</Menu.Item> <Menu.Item key="1">提交中</Menu.Item>
<Menu.Item key="2">补交中</Menu.Item> <Menu.Item key="2">补交中</Menu.Item>
<Menu.Item key="5">评阅中</Menu.Item> <Menu.Item key="5">已截止</Menu.Item>
</Menu> </Menu>
</div> </div>
<div className="fr mt16 mb16 searchView"> <div className="fr mt16 mb16 searchView">

@ -418,12 +418,21 @@ class Shixuninformation extends Component {
selectscripts:response.data[0].id selectscripts:response.data[0].id
}) })
this.get_mirror_script(response.data[0].id) this.get_mirror_script(response.data[0].id)
this.setState({
choice_main_type: value, if(e.props.mirror_name===null){
standard_scripts: response.data, this.setState({
shixun_service_configs: newshixun_service_configsagin, choice_main_type: value,
shixun_service_configlist: newshixun_service_configsagin, standard_scripts: response.data,
}) })
}else{
this.setState({
choice_main_type: value,
standard_scripts: response.data,
shixun_service_configs: newshixun_service_configsagin,
shixun_service_configlist: newshixun_service_configsagin,
})
}
} }
}).catch((error) => { }).catch((error) => {
@ -476,46 +485,52 @@ class Shixuninformation extends Component {
}) })
} }
littleClass = (value,e) => { littleClass = (value,e) => {
let newshixun_service_configs = this.state.shixun_service_configs;
let newchoice_small_type = this.state.choice_small_type;
let list = []
list.push(this.state.choice_main_type)
newchoice_small_type.map((item, key) => {
list.push(item)
})
let newshixun_service_configsagin = []
newshixun_service_configs.map((item, key) => {
list.map((its, index) => {
if (item.mirror_repository_id === its) {
newshixun_service_configsagin.push(item)
}
})
})
this.props.data.shixun.small_type.some((items, keys) => { let newshixun_service_configs = this.state.shixun_service_configs;
if (items.id === value) { let newchoice_small_type = this.state.choice_small_type;
newshixun_service_configsagin.push({ let list = []
mirror_repository_id: value, list.push(this.state.choice_main_type)
name: items.type_name, newchoice_small_type.map((item, key) => {
cpu_limit: 1, list.push(item)
lower_cpu_limit: 0.1, })
memory_limit: 1024,
request_limit: 10 let newshixun_service_configsagin = []
})
return true newshixun_service_configs.map((item, key) => {
} list.map((its, index) => {
if (item.mirror_repository_id === its) {
newshixun_service_configsagin.push(item)
}
})
})
this.props.data.shixun.small_type.some((items, keys) => {
if (items.id === value) {
newshixun_service_configsagin.push({
mirror_repository_id: value,
name: items.type_name,
cpu_limit: 1,
lower_cpu_limit: 0.1,
memory_limit: 1024,
request_limit: 10
})
return true
}
}
)
newchoice_small_type.push(value)
if(e.props.mirror_name===null){
this.setState({
choice_small_type: newchoice_small_type,
})
}else{
this.setState({
choice_small_type: newchoice_small_type,
shixun_service_configs: newshixun_service_configsagin,
shixun_service_configlist: newshixun_service_configsagin,
})
} }
)
newchoice_small_type.push(value)
this.setState({
choice_small_type: newchoice_small_type,
shixun_service_configs: newshixun_service_configsagin,
shixun_service_configlist: newshixun_service_configsagin,
})
} }
SelectScput = (value, e) => { SelectScput = (value, e) => {
@ -845,7 +860,7 @@ class Shixuninformation extends Component {
let itemtype=item.type_name.toLowerCase().indexOf('jupyter'.toLowerCase()) let itemtype=item.type_name.toLowerCase().indexOf('jupyter'.toLowerCase())
if(itemtype>-1) { if(itemtype>-1) {
return ( return (
<Option value={item.id} key={key} name={item.description}> <Option value={item.id} key={key} name={item.description} mirror_name={item.mirror_name}>
<Tooltip placement="right" title={item.description === "" ? "无描述" : item.description}> <Tooltip placement="right" title={item.description === "" ? "无描述" : item.description}>
{item.type_name} {item.type_name}
</Tooltip> </Tooltip>
@ -899,7 +914,7 @@ class Shixuninformation extends Component {
{ {
this.props.data === undefined ? "" : this.props.data.shixun&&this.props.data.shixun.small_type.map((item, key) => { this.props.data === undefined ? "" : this.props.data.shixun&&this.props.data.shixun.small_type.map((item, key) => {
return ( return (
<Option value={item.id} key={key} name={item.description}> <Option value={item.id} key={key} name={item.description} mirror_name={item.mirror_name}>
<Tooltip placement="right" title={item.description === "" ? "无描述" : item.description}> <Tooltip placement="right" title={item.description === "" ? "无描述" : item.description}>
{item.type_name} {item.type_name}
</Tooltip> </Tooltip>

Loading…
Cancel
Save