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

dev_hss
caicai8 5 years ago
commit 8199d3abd5

@ -30,7 +30,7 @@ class Users::QuestionBanksController < Users::BaseController
.where(commit_status: 1, exercises: { exercise_bank_id: question_bank_ids }) .where(commit_status: 1, exercises: { exercise_bank_id: question_bank_ids })
.group('exercises.exercise_bank_id').count .group('exercises.exercise_bank_id').count
when 'poll' then when 'poll' then
PollUser.joins(:poll).where(polls: { exercise_bank_id: question_bank_ids }) PollUser.joins(:poll).where(commit_status: 1, polls: { exercise_bank_id: question_bank_ids })
.group('polls.exercise_bank_id').count .group('polls.exercise_bank_id').count
when 'gtask' then when 'gtask' then
GraduationWork.has_committed.joins(:graduation_task) GraduationWork.has_committed.joins(:graduation_task)

@ -24,7 +24,7 @@ module Searchable::Course
author_name: teacher&.real_name, author_name: teacher&.real_name,
author_school_name: teacher&.school_name, author_school_name: teacher&.school_name,
visits_count: visits, visits_count: visits,
members_count: members_count, members_count: course_members_count,
is_public: is_public == 1, is_public: is_public == 1,
first_category_url: ApplicationController.helpers.module_url(none_hidden_course_modules.first, self) first_category_url: ApplicationController.helpers.module_url(none_hidden_course_modules.first, self)
} }

@ -0,0 +1,28 @@
class MigrateBankQuotes < ActiveRecord::Migration[5.2]
def change
HomeworkBank.all.each do |bank|
task_count = bank.homework_commons.count
bank.update_column("quotes", task_count == 0 ? 1 : task_count)
end
GtopicBank.all.each do |bank|
task_count = bank.graduation_topics.count
bank.update_column("quotes", task_count == 0 ? 1 : task_count)
end
GtaskBank.all.each do |bank|
task_count = bank.graduation_tasks.count
bank.update_column("quotes", task_count == 0 ? 1 : task_count)
end
ExerciseBank.all.each do |bank|
if bank.container_type == 'Exercise'
task_count = bank.exercises.count
bank.update_column("quotes", task_count == 0 ? 1 : task_count)
elsif bank.container_type == 'Poll'
task_count = bank.polls.count
bank.update_column("quotes", task_count == 0 ? 1 : task_count)
end
end
end
end

@ -62,7 +62,7 @@ module.exports = {
// We generate sourcemaps in production. This is slow but gives good results. // We generate sourcemaps in production. This is slow but gives good results.
// You can exclude the *.map files from the build during deployment. // You can exclude the *.map files from the build during deployment.
// devtool: shouldUseSourceMap ? 'nosources-source-map' : false, //正式版 // devtool: shouldUseSourceMap ? 'nosources-source-map' : false, //正式版
devtool: shouldUseSourceMap ? 'source-map' : false,//测试版 devtool: shouldUseSourceMap ? 'source-map' : 'source-map',//测试版
// In production, we only want to load the polyfills and the app code. // In production, we only want to load the polyfills and the app code.
entry: [require.resolve('./polyfills'), paths.appIndexJs], entry: [require.resolve('./polyfills'), paths.appIndexJs],
output: { output: {

@ -450,6 +450,7 @@ class NewWorkForm extends Component{
className="AboutInputForm groupSetting" className="AboutInputForm groupSetting"
> >
{getFieldDecorator('personNum', { {getFieldDecorator('personNum', {
validateTrigger: 'onNone',
rules: [{ rules: [{
// required: true, // required: true,
// message: '人数不能为空' // message: '人数不能为空'

@ -6,6 +6,7 @@ import axios from 'axios';
import TPMMDEditor from "../../tpm/challengesnew/TPMMDEditor"; import TPMMDEditor from "../../tpm/challengesnew/TPMMDEditor";
import moment from "../new/CoursesNew"; import moment from "../new/CoursesNew";
import Fileslistitem from "../Resource/Fileslistitem"; import Fileslistitem from "../Resource/Fileslistitem";
import Modals from "../../modals/Modals";
// 公告栏 // 公告栏
class Bullsubdirectory extends Component{ class Bullsubdirectory extends Component{
constructor(props){ constructor(props){
@ -19,6 +20,10 @@ class Bullsubdirectory extends Component{
addonAfter:0, addonAfter:0,
eduintits:"", eduintits:"",
informs:[], informs:[],
Modalstype:false,
Modalstopval:"是否确认删除?",
ModalCancel:"",
ModalSave:"",
} }
@ -47,6 +52,61 @@ class Bullsubdirectory extends Component{
} }
setModeltrue=()=>{
this.setState({
Modalstype:true,
Modalstopval:"是否确认删除?",
ModalCancel:this.cancelmodel,
ModalSave:this.saveonOpen,
})
}
cancelmodel=()=>{
//取消
this.setState({
Modalstype:false,
Modalstopval:"是否确认删除?",
ModalCancel:"",
ModalSave:"",
})
}
saveonOpen=()=>{
//确认
// /
// 删除公告
var id=this.props.match.params.coursesId
const url =`/courses/${id}/delete_informs.json`;
axios.delete(url, { data: {
inform_id: this.props.id
}})
.then((response) => {
if(response){
if(response.data){
if(response.data.status===0){
this.setState({
Modalstype:false,
Modalstopval:"是否确认删除?",
ModalCancel:"",
ModalSave:"",
})
this.props.showNotification(`删除成功`);
this.props.getinputdata();
}else{
this.props.showNotification(`删除失败`);
}
}else{
this.props.showNotification(`删除失败`);
}
}
})
.catch(function (error) {
console.log(error);
this.props.showNotification(`删除失败`);
});
}
bianji = (bians)=>{ bianji = (bians)=>{
this.setState({ this.setState({
@ -113,7 +173,7 @@ class Bullsubdirectory extends Component{
} }
var url = `/courses/${id}/update_informs.json`; var url = `/courses/${id}/update_informs.json`;
axios.post(url,{ axios.post(url,{
inform_id:this.state.id, inform_id:this.props.id,
name:titname, name:titname,
description:values.description, description:values.description,
}).then((result) => { }).then((result) => {
@ -154,12 +214,18 @@ class Bullsubdirectory extends Component{
render(){ render(){
let{description,whethertoeditysl,addonAfter,eduintits,informs,isSpinysl} =this.state; let{description,whethertoeditysl,addonAfter,eduintits,informs,isSpinysl} =this.state;
let{myname,mydescription}=this.props; let{myname,mydescription,id}=this.props;
const {getFieldDecorator} = this.props.form; const {getFieldDecorator} = this.props.form;
return( return(
<React.Fragment > <React.Fragment >
<div > <div >
{this.state.Modalstype&&this.state.Modalstype===true?<Modals
modalsType={this.state.Modalstype}
modalsTopval={this.state.Modalstopval}
modalCancel={this.state.ModalCancel}
modalSave={this.state.ModalSave}
/>:""}
<Spin size="large" spinning={isSpinysl} > <Spin size="large" spinning={isSpinysl} >
<div className="edu-back-white "> <div className="edu-back-white ">
{ {
@ -171,16 +237,29 @@ class Bullsubdirectory extends Component{
<span className="ysltitbt">{myname}</span> <span className="ysltitbt">{myname}</span>
</div> </div>
<div> <div>
<span className="fr pr25 yslbianji"> <span className="fr yslbianji" style={{marginRight:"17px"}}>
{ {
this.props.isAdmin() === true ? this.props.isClassManagement() === true ?
(this.props.yslbool===false? (this.props.yslbool===false?
<i className="iconfont icon-bianji1 newbianji1" onClick={()=>this.bianji(true)}></i> <i className="iconfont icon-bianji1 newbianji1" onClick={()=>this.bianji(true)}></i>
: :
"" ""
) )
:"" :""
} }
</span>
<span className="fr yslbianji" style={{marginRight:"22px"}}>
{
this.props.isClassManagement() === true ?
(this.props.yslbool===false?
<i className="iconfont icon-shanchu newbianji1" style={{ color: "#4CACFF"}} onClick={()=>this.setModeltrue(true)}></i>
:
""
)
:""
}
</span> </span>
</div> </div>
<div className="yslclear"></div> <div className="yslclear"></div>

@ -82,11 +82,16 @@ class GroupPackage extends Component {
</p> </p>
} }
{ {
datas&&datas.group_info&&datas.group_info.base_on_project? datas&&datas.group_info&&datas.group_info.base_on_project===1?
<p> <p>
<span className="ysltextcolor66">基于项目实施</span> <span className="ysltextcolor66">基于项目实施</span>
<span className="ysltextcolor05">学生必须在本平台创建项目项目管理员可以提交作品</span> <span className="ysltextcolor05">学生必须在本平台创建项目项目管理员可以提交作品</span>
</p> </p>
:datas&&datas.group_info&&datas.group_info.base_on_project===0?
<p>
<span className="ysltextcolor66">基于项目实施</span>
<span className="ysltextcolor05">无需在平台创建项目任意小组成员均可以提交作品</span>
</p>
:"" :""
} }
</div> </div>

@ -251,16 +251,19 @@ class Listofworksstudentone extends Component {
textAlign: "center" textAlign: "center"
} }
}> }>
{record.cost_time === null? "--":record.cost_time === undefined?"--": {record.cost_time === null? "--":record.cost_time === undefined?"--":record.cost_time === "--"?"--":
<a style={ <Tooltip placement="bottom" title={<div>
{ 学员在EduCoder做实训花费的时间
color: '#747A7F', </div>}>
textAlign: "center" <span style={
{
color: '#747A7F',
textAlign: "center"
}
} }
} >{record.cost_time === null ? "--":record.cost_time === undefined ?"--":record.cost_time}
title={"学员在EduCoder做实训花费的时间"} </span>
>{record.cost_time === null ? "--":record.cost_time === undefined ?"--":record.cost_time} </Tooltip>
</a>
} }
</span> </span>
) )
@ -524,16 +527,19 @@ class Listofworksstudentone extends Component {
textAlign: "center" textAlign: "center"
} }
}> }>
{record.cost_time === null? "--":record.cost_time === undefined?"--": {record.cost_time === null? "--":record.cost_time === undefined?"--":record.cost_time === "--"?"--":
<Tooltip placement="bottom" title={<div>
学员在EduCoder做实训花费的时间
</div>}>
<a style={ <a style={
{ {
color: '#747A7F', color: '#747A7F',
textAlign: "center" textAlign: "center"
} }
} }
title={"学员在EduCoder做实训花费的时间"}
>{record.cost_time === null ? "--":record.cost_time === undefined ?"--":record.cost_time} >{record.cost_time === null ? "--":record.cost_time === undefined ?"--":record.cost_time}
</a> </a>
</Tooltip>
} }
</span> </span>
// <a style={ // <a style={
@ -847,16 +853,19 @@ class Listofworksstudentone extends Component {
textAlign: "center" textAlign: "center"
} }
}> }>
{record.cost_time === null ? "--":record.cost_time === undefined ?"--": {record.cost_time === null ? "--":record.cost_time === undefined ?"--":record.cost_time === "--" ?"--":
<Tooltip placement="bottom" title={<div>
学员在EduCoder做实训花费的时间
</div>}>
<a style={ <a style={
{ {
color: '#747A7F', color: '#747A7F',
textAlign: "center" textAlign: "center"
} }
} }
title={"学员在EduCoder做实训花费的时间"}
>{record.cost_time === null ? "--":record.cost_time === undefined ?"--":record.cost_time} >{record.cost_time === null ? "--":record.cost_time === undefined ?"--":record.cost_time}
</a> </a>
</Tooltip>
} }
</span> </span>
) )

@ -74,6 +74,8 @@ class ActionView extends Component {
render() { render() {
const { onRunCodeTest, onShowPrevStage, onShowNextStage, gameBuilding const { onRunCodeTest, onShowPrevStage, onShowNextStage, gameBuilding
, game, classes, st, shixun, record, challenge, time_limit, real_time_limit } = this.props; , game, classes, st, shixun, record, challenge, time_limit, real_time_limit } = this.props;
console.log(shixun)
return ( return (
<div className="-flex -layout-h" id="game_operate_action"> <div className="-flex -layout-h" id="game_operate_action">
<style>{` <style>{`
@ -150,7 +152,7 @@ class ActionView extends Component {
{(!shixun.vnc || shixun.vnc_evaluate) && <div id="code_test" className="act_btn"> {(shixun&&!shixun.vnc || shixun&&shixun.vnc_evaluate) && <div id="code_test" className="act_btn">
{ {
st === 1 && game.status === 2 ? st === 1 && game.status === 2 ?
<Tooltip title={ "已通关的选择题任务无法再次测评" }> <Tooltip title={ "已通关的选择题任务无法再次测评" }>

@ -34,23 +34,26 @@ function getNewTreeData(treeData, curKey, child, level) {
} }
function fileData2TreeData(repoFilesData) { function fileData2TreeData(repoFilesData) {
const fileTreeData = []; if(repoFilesData!=null){
repoFilesData.forEach((item) => { const fileTreeData = [];
if (item.kind === 'file') { repoFilesData.forEach((item) => {
fileTreeData.push({ if (item.kind === 'file') {
key: item.path, fileTreeData.push({
name: item.name, key: item.path,
isLeaf: true name: item.name,
}) isLeaf: true
} else { })
fileTreeData.push({ } else {
key: item.path, fileTreeData.push({
name: item.name, key: item.path,
// isLeaf: false name: item.name,
}) // isLeaf: false
} })
}) }
return fileTreeData; })
return fileTreeData;
}
} }
class CodeRepositoryViewContainer extends Component { class CodeRepositoryViewContainer extends Component {

@ -70,6 +70,14 @@ class InfosTopics extends Component{
// }else{ // }else{
// //
// } // }
let types=this.props.match.params.topicstype;
let professional_certification=this.props.current_user&&this.props.current_user.professional_certification;
if(professional_certification===false&&types==="publicly"){
}else{
this.setState({ this.setState({
isSpin:true isSpin:true
}) })
@ -77,43 +85,42 @@ class InfosTopics extends Component{
let user_id=""; let user_id="";
if(types==="publicly"){ if(types==="publicly"){
user_id=this.props.current_user&&this.props.current_user.login; user_id=this.props.current_user&&this.props.current_user.login;
}else{ }else{
user_id=this.props.match.params&&this.props.match.params.username; user_id=this.props.match.params&&this.props.match.params.username;
} }
if(user_id===undefined){ if(user_id===undefined){
user_id=this.props.match.params&&this.props.match.params.username; user_id=1
} }
if(user_id!=undefined){ let {per_page}=this.state;
let {per_page}=this.state; let url=`/users/${user_id}/question_banks.json`;
let url=`/users/${user_id}/question_banks.json`;
axios.get(encodeURI(url),{params:{ axios.get(encodeURI(url),{params:{
type, type,
object_type:category, object_type:category,
course_list_id, course_list_id,
sort_by, sort_by,
sort_direction, sort_direction,
page, page,
per_page per_page
} }
}).then((response) => { }).then((response) => {
this.setState({ this.setState({
data:response.data, data:response.data,
checkBoxValues:[], checkBoxValues:[],
isSpin:false isSpin:false
}) })
}).catch((error) => { }).catch((error) => {
this.setState({ this.setState({
isSpin:false isSpin:false
}) })
}); });
}
}
} }

@ -127,7 +127,7 @@ class BanksIndex extends Component{
{ {
crumbData && crumbData &&
<Breadcrumb separator=">" className="breadcrumb mt22"> <Breadcrumb separator=">" className="breadcrumb mt22">
<Breadcrumb.Item href={crumbData && crumbData.is_public == true ?`/topicbank/${this.props.current_user && this.props.current_user.login}/publicly`:`/users/${this.props.current_user && this.props.current_user.login}/topics/personal`}>{ crumbData && crumbData.is_public == true ? '公共' : '我的' }题库</Breadcrumb.Item> <Breadcrumb.Item href={crumbData && crumbData.is_public == true ?`/topicbank/publicly`:`/users/${this.props.current_user && this.props.current_user.login}/topics/personal`}>{ crumbData && crumbData.is_public == true ? '公共' : '我的' }题库</Breadcrumb.Item>
{ {
crumbData.crumbArray && crumbData.crumbArray.map((item,key)=>{ crumbData.crumbArray && crumbData.crumbArray.map((item,key)=>{
return( return(

Loading…
Cancel
Save