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

dev_newshixunModel
hjm 6 years ago
commit 41e89a3fbe

@ -253,7 +253,10 @@ class ApplicationController < ActionController::Base
if Digest::MD5.hexdigest(content) == params[:chinaoocKey] if Digest::MD5.hexdigest(content) == params[:chinaoocKey]
user = open_class_user user = open_class_user
start_user_session(user) if user if user
start_user_session(user)
set_autologin_cookie(user)
end
User.current = user User.current = user
end end
end end

@ -51,7 +51,7 @@ class CommonsController < ApplicationController
200 200
end end
when 'journals_for_message' when 'journals_for_message'
course = @object.jour&.course || @object.jour&.student_work&.homework_common&.course course = @object&.jour_type.to_s == "StudentWorksScore" ? @object.jour&.student_work&.homework_common&.course : @object.jour&.course
if current_user.course_identity(course) >= Course::STUDENT && @object.user != current_user if current_user.course_identity(course) >= Course::STUDENT && @object.user != current_user
403 403
else else

@ -128,8 +128,8 @@ class CoursesController < ApplicationController
# POST /courses # POST /courses
# POST /courses.json # POST /courses.json
def create def create
ActiveRecord::Base.transaction do
begin begin
ActiveRecord::Base.transaction do
@course = Course.new(name: params[:name], class_period: params[:class_period], credit: params[:credit], @course = Course.new(name: params[:name], class_period: params[:class_period], credit: params[:credit],
end_date: params[:end_date], is_public: params[:is_public], school_id: @school.id, end_date: params[:end_date], is_public: params[:is_public], school_id: @school.id,
authentication: params[:authentication], professional_certification: params[:professional_certification]) authentication: params[:authentication], professional_certification: params[:professional_certification])
@ -174,13 +174,14 @@ class CoursesController < ApplicationController
course_module_types = params[:course_module_types] course_module_types = params[:course_module_types]
@course.create_course_modules(course_module_types) @course.create_course_modules(course_module_types)
end end
end
CreateSubjectCourseStudentJob.perform_later(@course.id) if @course.subject && @course.subject.subject_appointments.count > 0
rescue => e rescue => e
uid_logger_error(e.message) uid_logger_error(e.message)
tip_exception(e.message) tip_exception(e.message)
raise ActiveRecord::Rollback raise ActiveRecord::Rollback
end end
end end
end
# PATCH/PUT /courses/1 # PATCH/PUT /courses/1
# PATCH/PUT /courses/1.json # PATCH/PUT /courses/1.json

@ -19,6 +19,10 @@ class GitsController < ApplicationController
result = false result = false
if request.env["HTTP_AUTHORIZATION"] && request.env["HTTP_AUTHORIZATION"].split(" ").length == 2 if request.env["HTTP_AUTHORIZATION"] && request.env["HTTP_AUTHORIZATION"].split(" ").length == 2
username_password = Base64.decode64(request.env["HTTP_AUTHORIZATION"].split(" ")[1]) username_password = Base64.decode64(request.env["HTTP_AUTHORIZATION"].split(" ")[1])
if username_password.split(":")[0].nil? || username_password.split(":")[1].nil?
result = false
else
input_username = username_password.split(":")[0].strip() input_username = username_password.split(":")[0].strip()
input_password = username_password.split(":")[1].strip() input_password = username_password.split(":")[1].strip()
uid_logger("git start auth: input_username is #{input_username}") uid_logger("git start auth: input_username is #{input_username}")
@ -60,6 +64,7 @@ class GitsController < ApplicationController
end end
end end
end end
end
authenticate_or_request_with_http_basic do |username, password| authenticate_or_request_with_http_basic do |username, password|
result result

@ -0,0 +1,22 @@
class CreateSubjectCourseStudentJob < ApplicationJob
queue_as :default
def perform(course_id)
course = Course.find_by(id: course_id)
return if course.blank? || course.subject.blank?
attrs = %i[course_id user_id role created_at updated_at]
same_attrs = {course_id: course.id, role: 4}
Rails.logger.info("1:course.students.count:##{course.students.count}")
CourseMember.bulk_insert(*attrs) do |worker|
course.subject.subject_appointments.each do |app|
Rails.logger.info("##{course.students.where(user_id: app.user_id)}")
next if course.students.where(user_id: app.user_id).any?
worker.add same_attrs.merge(user_id: app.user_id)
end
end
Rails.logger.info("2:course.students.count:##{course.students.count}")
course.subject.subject_appointments.destroy_all
end
end

@ -10,9 +10,11 @@ json.results do
# 去除开头标点符号 # 去除开头标点符号
reg = /^[,。?:;‘’!“”—……、]/ reg = /^[,。?:;‘’!“”—……、]/
# 附件的替换 # 附件的替换
atta_reg = /!\[\]\(\/api\/attachments\/\d+\)/ atta_reg = /!\[.*]\(\/api\/attachments\/\d+\)/
highlights[:description]&.first&.sub!(reg, '').sub!(atta_reg, '') highlights[:description]&.first&.sub!(reg, '')
highlights[:content]&.first&.sub!(reg, '').sub!(atta_reg, '') highlights[:description]&.map{|des| des.gsub!(atta_reg, '')}
highlights[:content]&.first&.sub!(reg, '')
highlights[:content]&.map{|des| des.gsub!(atta_reg, '')}
json.content highlights json.content highlights
end end

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

@ -1,4 +1,4 @@
document.write("<link href='//at.alicdn.com/t/font_653600_qa9lwwv74z.css' rel='stylesheet' type='text/css'/>"); document.write("<link href='https://at.alicdn.com/t/font_653600_qa9lwwv74z.css' rel='stylesheet' type='text/css'/>");
/*! /*!
* JavaScript Cookie v2.2.0 * JavaScript Cookie v2.2.0

@ -1,7 +1,10 @@
<!DOCTYPE html> <!DOCTYPE html>
<html lang="en"> <html lang="en">
<head> <head>
<meta charset="utf-8"> <meta charset="utf-8">
<!--<meta http-equiv="Content-Security-Policy" content="upgrade-insecure-requests" />-->
<!-- width=device-width, initial-scale=1 , shrink-to-fit=no --> <!-- width=device-width, initial-scale=1 , shrink-to-fit=no -->
<!-- <meta name="viewport" content=""> --> <!-- <meta name="viewport" content=""> -->
<meta name="theme-color" content="#000000"> <meta name="theme-color" content="#000000">

@ -22,7 +22,7 @@ import 'moment/locale/zh-cn';
import './yslexercisetable.css'; import './yslexercisetable.css';
import {getImageUrl, toPath} from 'educoder'; import {getImageUrl, toPath} from 'educoder';
import CheckBoxGroup from "../../page/component/CheckBoxGroup"; import CheckBoxGroup from "../../page/component/CheckBoxGroup";
import NoneData from '../../../modules/courses/coursesPublic/NoneData'
const Search = Input.Search; const Search = Input.Search;
const RadioGroup = Radio.Group; const RadioGroup = Radio.Group;
const CheckboxGroup = Checkbox.Group; const CheckboxGroup = Checkbox.Group;
@ -1217,6 +1217,7 @@ class Studentshavecompletedthelist extends Component {
) )
}, },
], ],
exercise_status:0,
} }
// console.log("Studentshavecompletedthelist"); // console.log("Studentshavecompletedthelist");
// console.log(props.current_status); // console.log(props.current_status);
@ -1277,6 +1278,20 @@ class Studentshavecompletedthelist extends Component {
}catch (e) { }catch (e) {
} }
try {
if(this.props.Commonheadofthetestpaper.exercise_status !== undefined){
this.setState({
exercise_status:this.props.Commonheadofthetestpaper.exercise_status,
})
}else{
this.setState({
exercise_status:0,
})
}
}catch (e) {
}
} }
componentWillReceiveProps = (nextProps) => { componentWillReceiveProps = (nextProps) => {
@ -2065,11 +2080,11 @@ class Studentshavecompletedthelist extends Component {
this.setState({ this.setState({
loadingstate: false, loadingstate: false,
}) })
console.log(response); // console.log(response);
console.log(1997); // console.log(1997);
this.Generatenewdatasy(response.data.exercise_users, response); this.Generatenewdatasy(response.data.exercise_users, response);
}).catch((error) => { }).catch((error) => {
console.log(error) // console.log(error)
this.setState({ this.setState({
loadingstate: false, loadingstate: false,
}) })
@ -2472,7 +2487,7 @@ class Studentshavecompletedthelist extends Component {
render() { render() {
const isAdmin = this.props.isAdmin(); const isAdmin = this.props.isAdmin();
let {data, datas, page, columns, course_groupyslsthree, columnstwo, styletable, course_groupyslstwodatas, limit, course_groupysls, course_groupyslstwodata, course_groupyslstwo, teacherlists, Teacherliststudentlist, order, columnss, course_groupsdatas, course_groups, Evaluationarray, unlimited, unlimiteds, unlimitedtwo, teacherlist, searchtext, loadingstate, review, nocomment, commented, unsubmitted, submitted, columnsys, exercise_users,mylistansum} = this.state; let {data, datas, page, columns, course_groupyslsthree, columnstwo, styletable,exercise_status, course_groupyslstwodatas, limit, course_groupysls, course_groupyslstwodata, course_groupyslstwo, teacherlists, Teacherliststudentlist, order, columnss, course_groupsdatas, course_groups, Evaluationarray, unlimited, unlimiteds, unlimitedtwo, teacherlist, searchtext, loadingstate, review, nocomment, commented, unsubmitted, submitted, columnsys, exercise_users,mylistansum} = this.state;
// console.log("Studentshavecompletedthelist"); // console.log("Studentshavecompletedthelist");
// console.log(this.props.current_status); // console.log(this.props.current_status);
return ( return (
@ -2483,6 +2498,13 @@ class Studentshavecompletedthelist extends Component {
" min-width": " 1200px", " min-width": " 1200px",
}}> }}>
{/*老师*/} {/*老师*/}
{
exercise_status===0 || exercise_status===1 ?
<div className="edu-back-white">
<NoneData></NoneData>
</div>
:
<div>
<div className="edu-back-white" > <div className="edu-back-white" >
<ul className="clearfix" style={{padding: '10px 30px 10px 30px'}}> <ul className="clearfix" style={{padding: '10px 30px 10px 30px'}}>
@ -2680,6 +2702,8 @@ class Studentshavecompletedthelist extends Component {
</div> </div>
: "" : ""
} }
</div>
}
</div> </div>
@ -2691,6 +2715,12 @@ class Studentshavecompletedthelist extends Component {
<div> <div>
<div className=" clearfix " <div className=" clearfix "
style={{"margin": "0 auto", "padding-bottom": "100px", " min-width": " 1200px"}}> style={{"margin": "0 auto", "padding-bottom": "100px", " min-width": " 1200px"}}>
{
exercise_status === 0 || exercise_status === 1 ?
<div className="edu-back-white">
<NoneData></NoneData>
</div>
:
<div className={"educontent mb20"}> <div className={"educontent mb20"}>
<div className="edu-back-white" id="graduation_work_list" <div className="edu-back-white" id="graduation_work_list"
@ -2754,7 +2784,7 @@ class Studentshavecompletedthelist extends Component {
</div> </div>
}
</div> </div>
</div> </div>
@ -2766,6 +2796,13 @@ class Studentshavecompletedthelist extends Component {
"padding-bottom": "100px", "padding-bottom": "100px",
" min-width": " 1200px" " min-width": " 1200px"
}}> }}>
{
exercise_status === 0 || exercise_status === 1 ?
<div className="edu-back-white">
<NoneData></NoneData>
</div>
:
<div>
<div className={"educontent mb20 edu-back-white"}> <div className={"educontent mb20 edu-back-white"}>
<style> <style>
{ {
@ -2903,6 +2940,8 @@ class Studentshavecompletedthelist extends Component {
: "" : ""
} }
</div> </div>
}
</div>
</div> </div>

@ -436,7 +436,7 @@ class Testpapersettinghomepage extends Component{
/> />
{ {
// 教师列表 // 教师列表
parseInt(tab[0])==0 && <Studentshavecompletedthelist {...this.props} {...this.state} triggerRef={this.bindRef} setcourse_groupysls={(value)=>this.setcourse_groupysls(value)} current_status = {this.state.current_status}></Studentshavecompletedthelist> parseInt(tab[0])==0 && <Studentshavecompletedthelist {...this.props} {...this.state} triggerRef={this.bindRef} setcourse_groupysls={(value)=>this.setcourse_groupysls(value)} current_status = {this.state.current_status} Commonheadofthetestpaper={this.state.Commonheadofthetestpaper}></Studentshavecompletedthelist>
} }
{/*统计结果*/} {/*统计结果*/}

@ -33,6 +33,8 @@ import Startshixuntask from "../coursesPublic/Startshixuntask";
import ModulationModal from "../coursesPublic/ModulationModal"; import ModulationModal from "../coursesPublic/ModulationModal";
import HomeworkModal from "../coursesPublic/HomeworkModal"; import HomeworkModal from "../coursesPublic/HomeworkModal";
import ShixunWorkModal from "./Shixunworkdetails/ShixunWorkModal"; import ShixunWorkModal from "./Shixunworkdetails/ShixunWorkModal";
import NoneData from '../../../modules/courses/coursesPublic/NoneData'
const Search = Input.Search; const Search = Input.Search;
const RadioGroup = Radio.Group; const RadioGroup = Radio.Group;
const CheckboxGroup = Checkbox.Group; const CheckboxGroup = Checkbox.Group;
@ -1451,6 +1453,7 @@ class Listofworksstudentone extends Component {
], ],
yslpros:false, yslpros:false,
datajs:[], datajs:[],
homework_status:[],
} }
} }
@ -1569,7 +1572,8 @@ class Listofworksstudentone extends Component {
allow_late:result.data.allow_late, allow_late:result.data.allow_late,
loadingstate: false, loadingstate: false,
computeTimetype:true, computeTimetype:true,
}) homework_status:result.data.homework_status,
});
this.seacthdatat(result.data,result.data.student_works,result.data.work_efficiency,result.data.course_group_info,1); this.seacthdatat(result.data,result.data.student_works,result.data.work_efficiency,result.data.course_group_info,1);
if (result.data.student_works === undefined || result.data.student_works === null || JSON.stringify(result.data.student_works) === "[]") { if (result.data.student_works === undefined || result.data.student_works === null || JSON.stringify(result.data.student_works) === "[]") {
@ -1626,7 +1630,8 @@ class Listofworksstudentone extends Component {
code_review: result.data.code_review, code_review: result.data.code_review,
challenges_count:result.data.challenges_count, challenges_count:result.data.challenges_count,
view_report:result.data.view_report, view_report:result.data.view_report,
}) homework_status:result.data.homework_status,
});
if (result.data.student_works === undefined || result.data.student_works === null || JSON.stringify(result.data.student_works) === "[]") { if (result.data.student_works === undefined || result.data.student_works === null || JSON.stringify(result.data.student_works) === "[]") {
this.seacthdata(result.data); this.seacthdata(result.data);
} else { } else {
@ -2129,7 +2134,8 @@ class Listofworksstudentone extends Component {
code_review: result.data.code_review, code_review: result.data.code_review,
challenges_count:result.data.challenges_count, challenges_count:result.data.challenges_count,
view_report:result.data.view_report, view_report:result.data.view_report,
}) homework_status:result.data.homework_status,
});
this.seacthdata(result.data); this.seacthdata(result.data);
this.props.Getdataback(result,result.data); this.props.Getdataback(result,result.data);
} }
@ -2242,7 +2248,8 @@ class Listofworksstudentone extends Component {
end_immediately: result.data.end_immediately, end_immediately: result.data.end_immediately,
code_review: result.data.code_review, code_review: result.data.code_review,
challenges_count:result.data.challenges_count, challenges_count:result.data.challenges_count,
}) homework_status:result.data.homework_status,
});
this.seacthdatat(result.data,result.data.student_works,result.data.work_efficiency,result.data.course_group_info,page); this.seacthdatat(result.data,result.data.student_works,result.data.work_efficiency,result.data.course_group_info,page);
this.props.Getdataback(result,result.data); this.props.Getdataback(result,result.data);
// } // }
@ -3037,7 +3044,7 @@ class Listofworksstudentone extends Component {
}) })
} }
render() { render() {
let {columns,course_groupysls,datajs,isAdmin, 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,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 />;
// console.log(this.state.student_works); // console.log(this.state.student_works);
@ -3068,8 +3075,8 @@ class Listofworksstudentone extends Component {
} }
return ( return (
this.props.isAdmin() === true ? this.props.isAdmin() === true ?
(
<div className=" clearfix " style={{margin: "auto" , minWidth:"1200px"}}> <div className=" clearfix " style={{margin: "auto" , minWidth:"1200px"}}>
{visible === true ? <ModulationModal {visible === true ? <ModulationModal
visible={visible} visible={visible}
@ -3143,6 +3150,17 @@ class Listofworksstudentone extends Component {
starttimes={this.state.starttimes} starttimes={this.state.starttimes}
typs={this.state.typs} typs={this.state.typs}
/> />
{
homework_status.length===0?
<div className="edu-back-white">
<NoneData></NoneData>
</div>
:
homework_status.length>0 && homework_status[0]==="未发布"?
<div className="edu-back-white">
<NoneData></NoneData>
</div>
:
<div className={"educontent "}> <div className={"educontent "}>
@ -3387,11 +3405,10 @@ class Listofworksstudentone extends Component {
: "" : ""
} }
</div> </div>
}
</div> </div>
)
: :
(
<div> <div>
{ {
teacherdata === undefined || teacherdata.student_works === undefined || teacherdata.student_works === null || JSON.stringify(teacherdata.student_works) === "[]" ? teacherdata === undefined || teacherdata.student_works === undefined || teacherdata.student_works === null || JSON.stringify(teacherdata.student_works) === "[]" ?
@ -3473,6 +3490,19 @@ class Listofworksstudentone extends Component {
: "" : ""
} }
{
homework_status.length===0?
<div className=" clearfix edu-back-white" style={{margin: "auto" , minWidth:"1200px"}}>
<NoneData></NoneData>
</div>
:
homework_status.length>0 && homework_status[0]==="未发布"?
<div className=" clearfix edu-back-white " style={{margin: "auto" , minWidth:"1200px"}}>
<NoneData></NoneData>
</div>
:
<div className={"educontent "}> <div className={"educontent "}>
<div className="edu-back-white" style={{width: "1200"}}> <div className="edu-back-white" style={{width: "1200"}}>
@ -3593,7 +3623,7 @@ class Listofworksstudentone extends Component {
</div> </div>
</div> </div>
}
</div> </div>
: :
// 学生能查看别人的 // 学生能查看别人的
@ -3619,6 +3649,18 @@ class Listofworksstudentone extends Component {
Cancel={() => this.cancelModulationModels()} Cancel={() => this.cancelModulationModels()}
/> : "" /> : ""
} }
{
homework_status.length===0?
<div className=" clearfix edu-back-white" style={{margin: "auto" , minWidth:"1200px"}}>
<NoneData></NoneData>
</div>
:
homework_status.length>0 && homework_status[0]==="未发布"?
<div className=" clearfix edu-back-white" style={{margin: "auto" , minWidth:"1200px"}}>
<NoneData></NoneData>
</div>
:
<div className={"educontent mb20"}> <div className={"educontent mb20"}>
<div > <div >
@ -3807,10 +3849,12 @@ class Listofworksstudentone extends Component {
} }
</div> </div>
</div> </div>
}
</div> </div>
} }
</div> </div>
)
) )
} }

@ -86,7 +86,7 @@ class Trainingjobsetting extends Component {
latepenaltytype: false, latepenaltytype: false,
unifiedsetting: true, unifiedsetting: true,
allowreplenishment: undefined, allowreplenishment: undefined,
completionefficiencyscore: true, completionefficiencyscore: false,
whethertopay: false, whethertopay: false,
proportion: undefined, proportion: undefined,
level: undefined, level: undefined,
@ -120,6 +120,7 @@ class Trainingjobsetting extends Component {
showmodel:false, showmodel:false,
code_review:false, code_review:false,
testscripttiptype:false, testscripttiptype:false,
end_timebool:false, end_timebool:false,
late_timesbool:false, late_timesbool:false,
} }
@ -659,6 +660,7 @@ class Trainingjobsetting extends Component {
flagPageEditsthrees:false, flagPageEditsthrees:false,
flagPageEditsfor:false, flagPageEditsfor:false,
whethertopay:false, whethertopay:false,
completionefficiencyscore:true,
}) })
this.refs.targetElementTrainingjobsetting.scrollIntoView() this.refs.targetElementTrainingjobsetting.scrollIntoView()
@ -1067,7 +1069,7 @@ class Trainingjobsetting extends Component {
// //占比分 // //占比分
changeTopicNametwo = (value) => { changeTopicNametwo = (value) => {
// console.log("2e.target.value", value) // console.log("TrainingjobsettingTrainingjobsetting", value)
if (value === "" || value === undefined) { if (value === "" || value === undefined) {
return return
} }
@ -1701,6 +1703,7 @@ class Trainingjobsetting extends Component {
flagPageEditstwo:releasetime, flagPageEditstwo:releasetime,
flagPageEditsthrees:deadline, flagPageEditsthrees:deadline,
flagPageEditsfor:endtime, flagPageEditsfor:endtime,
completionefficiencyscore:true,
unifiedsetting:this.state.unifiedsetting, unifiedsetting:this.state.unifiedsetting,
}) })
if(this.state.proportion === "自定义分值"){ if(this.state.proportion === "自定义分值"){
@ -1733,6 +1736,8 @@ class Trainingjobsetting extends Component {
hand__e_tip: "", hand__e_tip: "",
hand_flags: false, hand_flags: false,
handclass: undefined, handclass: undefined,
completionefficiencyscore:true,
latedeductiontwo:0,
unit_e_tip: "", unit_e_tip: "",
}) })
this.refs.targetElementTrainingjobsetting.scrollIntoView(); this.refs.targetElementTrainingjobsetting.scrollIntoView();
@ -2139,7 +2144,7 @@ class Trainingjobsetting extends Component {
</div> </div>
<div className=" mt20" style={{marginLeft:"75px"}}> <div className=" mt20" style={{marginLeft:"75px"}}>
<span className="c_grey mr10" style={{"color":"#999999"}}>分值</span> <span className="c_grey mr10" style={{"color":"#999999"}}>分值</span>
<InputNumber min={0} disabled={!flagPageEdit} max={100} className="ml10 h40 mr10 color-grey-9" <InputNumber min={0} disabled={!this.state.completionefficiencyscore} max={100} className="ml10 h40 mr10 color-grey-9"
style={{width: "100px","color":"#999999"}} style={{width: "100px","color":"#999999"}}
onChange={this.changeTopicNametwo} onChange={this.changeTopicNametwo}
value={this.state.latedeductiontwo}/> value={this.state.latedeductiontwo}/>

@ -1064,8 +1064,7 @@ class ShixunHomework extends Component{
<div className="edu-back-white"> <div className="edu-back-white">
<p className="clearfix padding30 bor-bottom-greyE"> <p className="clearfix padding30 bor-bottom-greyE">
<p style={{height: '20px'}}> <p style={{height: '20px'}}>
{/*<span className="font-18 fl color-dark-21">{datas&&datas.category_name===undefined||datas&&datas.category_name===null?datas&&datas.main_category_name:datas&&datas.category_name+" 作业列表"}</span>*/} <span className="font-18 fl color-dark-21">{datas&&datas.category_name===undefined||datas&&datas.category_name===null?datas&&datas.main_category_name:datas&&datas.category_name+" 作业列表"}</span>
<span className="font-18 fl color-dark-21">实训作业</span>
<li className="fr"> <li className="fr">
{datas===undefined?"":datas.homeworks && datas.homeworks.length>1?this.props.isAdminOrCreator()===true?datas&&datas.category_name===undefined||datas&&datas.category_name===null? {datas===undefined?"":datas.homeworks && datas.homeworks.length>1?this.props.isAdminOrCreator()===true?datas&&datas.category_name===undefined||datas&&datas.category_name===null?
<span> <span>

@ -39,20 +39,20 @@ class EcStudentList extends Component {
let major_id=this.props.match.params.major_id; let major_id=this.props.match.params.major_id;
let year_id=this.props.match.params.year_id; let year_id=this.props.match.params.year_id;
const url ='/ec_major_schools/'+major_id+'/academic_years/'+year_id+'/student_lists_data'; // const url ='/ec_major_schools/'+major_id+'/academic_years/'+year_id+'/student_lists_data';
axios.get(url, { // axios.get(url, {
withCredentials: true, // withCredentials: true,
}).then((response) => { // }).then((response) => {
if(response.status===200){ // if(response.status===200){
this.setState({ // this.setState({
majorschoollist:response.data, // majorschoollist:response.data,
ismanager:response.data.ismanager, // ismanager:response.data.ismanager,
}) // })
} // }
}) // })
.catch(function (error) { // .catch(function (error) {
console.log(error); // console.log(error);
}); // });
// let majorschoollist={ // let majorschoollist={
// ec_students: [{index: 1, student_name: "同意", student_id: "s20111458"}, // ec_students: [{index: 1, student_name: "同意", student_id: "s20111458"},
// {index: 1, student_name: "同意", student_id: "s20111458"}, // {index: 1, student_name: "同意", student_id: "s20111458"},

@ -479,6 +479,8 @@ class MessagSub extends Component{
return ''; return '';
case "PublicCourseStart": case "PublicCourseStart":
return window.open(`/courses/${item.container_id}/informs`); return window.open(`/courses/${item.container_id}/informs`);
case "SubjectStartCourse":
return window.open(`/paths/${item.container_id}`);
default : default :
return window.open("/") return window.open("/")
} }

@ -23,6 +23,15 @@ render() {
centered={true} centered={true}
width="530px" width="530px"
> >
{this.props.modalsType===true?<style>
{
`
body{
overflow: hidden !important;
}
`
}
</style>:""}
<Spin indicator={antIcons} spinning={this.props.antIcon===undefined?false:this.props.antIcon} > <Spin indicator={antIcons} spinning={this.props.antIcon===undefined?false:this.props.antIcon} >
<div className="task-popup-content"> <div className="task-popup-content">
<p className="task-popup-text-center font-16">{this.props.modalsTopval}</p> <p className="task-popup-text-center font-16">{this.props.modalsTopval}</p>

@ -336,7 +336,7 @@ class DetailCards extends Component{
showparagraphindex showparagraphindex
}=this.state; }=this.state;
const antIcon = <Icon type="loading" style={{ fontSize: 24 }} spin />; const antIcon = <Icon type="loading" style={{ fontSize: 24 }} spin />;
// console.log("zzz"+this.props.MenuItemsindextype)
return( return(
<div> <div>
{AccountProfiletype===true?<AccountProfile {AccountProfiletype===true?<AccountProfile
@ -495,7 +495,7 @@ class DetailCards extends Component{
: :
<li className={showparagraph===false?"none":"fr status_li"}> <li className={showparagraph===false?"none":"fr status_li"}>
{ {
showparagraphkey===key&&showparagraphindex===index?<div> showparagraphkey===key&&showparagraphindex===index?this.props.detailInfoList&&this.props.detailInfoList.allow_statistics===false&&this.props.MenuItemsindextype===2?"":<div>
<Link to={'/shixuns/'+line.identifier+'/challenges'} className="mr30 color-blue_4C shixun_detail pointer fl" target="_blank">查看详情</Link> <Link to={'/shixuns/'+line.identifier+'/challenges'} className="mr30 color-blue_4C shixun_detail pointer fl" target="_blank">查看详情</Link>
{line.shixun_status==="暂未公开"?"":<a onClick={()=>this.startgameid(line.identifier)} className="btn_auto user_bluebg_btn fl" id="shixun_operation" >开始实战</a>} {line.shixun_status==="暂未公开"?"":<a onClick={()=>this.startgameid(line.identifier)} className="btn_auto user_bluebg_btn fl" id="shixun_operation" >开始实战</a>}
</div>:"" </div>:""

@ -67,3 +67,15 @@
white-space: nowrap; white-space: nowrap;
height: 40px; height: 40px;
} }
.mb100{
margin-bottom: 100px !important;
}
.task-btn-28BE6C{
background: #28BE6C !important;
color: #fff!important;
}
.mt43{
margin-top: 43px;
}

@ -26,7 +26,9 @@ class DetailTop extends Component{
MenuItemskey:1, MenuItemskey:1,
courseslist:[], courseslist:[],
Pathcourseid:undefined, Pathcourseid:undefined,
OpenCourseTypes:false OpenCourseTypes:false,
putappointmenttype:false,
getappointmenttype:false
} }
} }
componentDidMount(){ componentDidMount(){
@ -48,33 +50,43 @@ class DetailTop extends Component{
}) })
}else{ }else{
let type=undefined;
this.props.courses.map((item,key)=>{ this.props.courses.map((item,key)=>{
if(listtype===false){ let arr=[]
keys=key+1 keys=key+1
if(item.course_status.status===0) { if(item.course_status.status===2) {
listtype=true type=key+1
return ( arr.push(item)
courseslist.push(item)
)
}
} }
courseslist=arr;
}) })
this.props.courses.map((item,key)=>{ this.props.courses.map((item,key)=>{
let arr=[]
if(listtype===false){ if(listtype===false){
keys=key+1 keys=key+1
if(item.course_status.status===2) { if(item.course_status.status===0) {
listtype=true listtype=true
return ( // courseslist.push(item)
courseslist.push(item) arr.push(item)
) courseslist=arr
} }
} }
}) })
console.log(courseslist)
} }
if(courseslist.length!=0){
this.props.getMenuItemsindex(keys,courseslist[0].course_status.status)
} }
}
this.setState({ this.setState({
courseslist:courseslist, courseslist:courseslist,
MenuItemskey:keys, MenuItemskey:keys,
@ -156,7 +168,8 @@ class DetailTop extends Component{
Modalstype:false, Modalstype:false,
Modalsbottomval:'', Modalsbottomval:'',
loadtype:false, loadtype:false,
deletepathtype:false deletepathtype:false,
putappointmenttype:false
}) })
} }
@ -219,6 +232,8 @@ class DetailTop extends Component{
) )
} }
}) })
this.props.getMenuItemsindex(keys,courseslist[0].course_status.status)
this.setState({ this.setState({
MenuItemskey:keys, MenuItemskey:keys,
courseslist:courseslist, courseslist:courseslist,
@ -245,6 +260,20 @@ class DetailTop extends Component{
pathcousestypeid:typeid pathcousestypeid:typeid
}) })
} }
putappointment=()=>{
this.setState({
Modalstype:true,
Modalstopval:"是否确认立即预约?",
Modalsbottomval:"",
cardsModalcancel:()=>this.cardsModalcancel(),
putappointmenttype:true,
loadtype:false
})
}
ysljoinmodalCancel=()=>{ ysljoinmodalCancel=()=>{
this.setState({ this.setState({
yslJointhe:false yslJointhe:false
@ -267,9 +296,34 @@ class DetailTop extends Component{
OpenCourseTypes:false OpenCourseTypes:false
}) })
} }
getappointment=()=>{
let pathid=this.props.match.params.pathId;
let url=`/paths/${pathid}/appointment.json`
axios.post(url).then((response) => {
if (response.status === 200) {
if(response.data.status===0){
this.setState({
getappointmenttype:true
})
this.cardsModalcancel()
// this.props.getlistdatas()
this.props.showNotification(response.data.message)
}else{
this.props.showNotification(response.data.message)
}
}
}).catch((error) => {
console.log(error)
this.cardsModalcancel()
})
}
render(){ render(){
let{detailInfoList}=this.props; let{detailInfoList}=this.props;
let{Modalstype,Modalstopval,cardsModalcancel,OpenCourseTypes,Modalsbottomval,cardsModalsavetype,loadtype}=this.state; let{Modalstype,Modalstopval,cardsModalcancel,putappointmenttype,Modalsbottomval,cardsModalsavetype,loadtype,getappointmenttype}=this.state;
const radioStyle = { const radioStyle = {
display: 'block', display: 'block',
height: '30px', height: '30px',
@ -292,15 +346,19 @@ class DetailTop extends Component{
let applypath=this.props.detailInfoList&&this.props.detailInfoList.participant_count!=undefined&&this.props.detailInfoList&&this.props.detailInfoList.allow_statistics===false;
let coursestypes=this.props.courses!=undefined&&this.props.courses.length===0;
let isadminallow_statistics=this.props.courses&&this.props.courses.length===0&&this.props.detailInfoList&&this.props.detailInfoList.allow_statistics===true;
return( return(
<div className={this.props.courses===undefined||this.props.courses.length===0?"subhead":"subhead mb70"}> <div className={this.props.courses===undefined||this.props.courses.length===0?"subhead":applypath===false?"subhead mb70":this.state.MenuItemskey===this.props.courses.length?"subhead mb100":"subhead mb70"}>
<Modals <Modals
modalsType={Modalstype} modalsType={Modalstype}
modalsTopval={Modalstopval} modalsTopval={Modalstopval}
modalsBottomval={Modalsbottomval} modalsBottomval={Modalsbottomval}
modalCancel={cardsModalcancel} modalCancel={cardsModalcancel}
modalSave={cardsModalsavetype===true?this.reovkissuePaths:this.cardsModalsave} modalSave={cardsModalsavetype===true?()=>this.reovkissuePaths():putappointmenttype===true?()=>this.getappointment():()=>this.cardsModalsave()}
loadtype={loadtype} loadtype={loadtype}
> >
</Modals> </Modals>
@ -309,7 +367,7 @@ class DetailTop extends Component{
{ {
detailInfoList && detailInfoList &&
<div className={this.props.courses===undefined||this.props.courses.length===0?"subhead_content":"subhead_content pt100"}> <div className={this.props.courses===undefined?"subhead_content":this.props.courses.length===0?"subhead_content pt40":"subhead_content pt100"}>
<div className="font-28 color-white clearfix"> <div className="font-28 color-white clearfix">
{/*<Tooltip placement="bottom" title={detailInfoList.name.length>27?detailInfoList.name:""}>*/} {/*<Tooltip placement="bottom" title={detailInfoList.name.length>27?detailInfoList.name:""}>*/}
@ -428,9 +486,7 @@ class DetailTop extends Component{
</div> </div>
{this.props.courses===undefined||this.props.courses.length===0?"":<div className="userNavs mt20"> {this.props.courses===undefined||isadminallow_statistics===true?"":<div className="userNavs mt20" style={applypath===false?{}:this.state.MenuItemskey===this.props.courses.length?{height:'158px'}:{}}>
<li className={"fl pd4020"}>
<style> <style>
{ {
` `
@ -453,9 +509,9 @@ class DetailTop extends Component{
` `
} }
</style> </style>
{this.props.courses===undefined||this.props.courses.length===0?"":<li className={"fl pd4020"}>
{this.state.courseslist.map((item,key)=>{
{this.props.courses===undefined?"":this.state.courseslist.map((item,key)=>{
if(item.course_identity<4){ if(item.course_identity<4){
return( return(
<Tooltip placement="bottom" title={"编辑课堂"} key={key}> <Tooltip placement="bottom" title={"编辑课堂"} key={key}>
@ -475,7 +531,7 @@ class DetailTop extends Component{
<span className={"color-orange"}> {this.state.MenuItemskey} </span>次开课 <Icon className="aIcons" type={!this.state.onVisibleChangestype?"down":"up"} /> <span className={"color-orange"}> {this.state.MenuItemskey} </span>次开课 <Icon className="aIcons" type={!this.state.onVisibleChangestype?"down":"up"} />
</a> </a>
</Dropdown> </Dropdown>
</li> </li>}
<style> <style>
{ {
` `
@ -496,7 +552,7 @@ class DetailTop extends Component{
` `
} }
</style> </style>
<li className={"ml20"}> {this.props.courses===undefined||this.props.courses.length===0?"":<li className={"ml20"}>
{this.state.courseslist.map((item,key)=>{ {this.state.courseslist.map((item,key)=>{
return( return(
<div className={"ant-breadcrumb pdt28"} key={key}> <div className={"ant-breadcrumb pdt28"} key={key}>
@ -539,9 +595,7 @@ class DetailTop extends Component{
}) })
} }
</li> </li>}
<li className={"fr mr25"}>
<style> <style>
{ {
` `
@ -565,17 +619,50 @@ class DetailTop extends Component{
.courseslistsa{ .courseslistsa{
color:#fff !important; color:#fff !important;
} }
.pathbtensbox{
width: 215px !important;
height: 46px !important;
background: rgba(76,172,255,1);
border-radius: 4px;
line-height: 46px !important;
}
.lineHeight0{
line-height: 0px;
}
.font153{
font-size: 14px;
font-weight: 400;
color: rgba(153,153,153,1);
line-height: 14px;
margin-left: 30px;
}
.absolutewidth{
position: absolute;
top: -21px;
right: 71px;
}
.relativewidth{
position: relative;
width: 100%;
}
` `
} }
</style> </style>
{this.props.courses===undefined||this.props.courses.length===0?"":<li className={"fr mr25"}>
{/*
height: 158px;
}*/}
{this.state.courseslist.map((item,key)=>{ {this.state.courseslist.map((item,key)=>{
return( return(
<div key={key}> <div key={key}>
{item.course_status.status===0?<div className="mr51 shixun_detail pointer fl user-colorgrey-green pathdefault">即将开课</div>:""} {/*{item.course_status.status===0?<div className="mr51 shixun_detail pointer fl user-colorgrey-green pathdefault">即将开课</div>:""}*/}
{item.course_status.status===1?<div className="mr51 shixun_detail pointer fl color-orange pathdefault">{item.course_status.time}</div>:""} {item.course_status.status===1?<div className="mr51 shixun_detail pointer fl color-orange pathdefault">{item.course_status.time}</div>:""}
{item.course_status.status===2&&item.course_identity<6?<div className="mr51 shixun_detail pointer fl user-colorgrey-9b pathdefault">已结束</div>:""} {item.course_status.status===2&&item.course_identity<6?<div className="mr20 shixun_detail pointer fl user-colorgrey-9b pathdefault">已结束</div>:""}
{/*<div className="fr user_default_btn background191 font-18 mt28 pathbtens pathdefault">已结束</div>*/}
{item.course_status.status===0? {item.course_status.status===0?
item.course_identity<5?<a className="fr user_default_btn task-btn-orange font-18 mt28 pathbtens courseslistsa" href={item.first_category_url} target="_blank"> item.course_identity<5?<a className="fr user_default_btn task-btn-orange font-18 mt28 pathbtens courseslistsa" href={item.first_category_url} target="_blank">
进入课堂 进入课堂
@ -592,13 +679,24 @@ class DetailTop extends Component{
{item.course_status.status===2? {item.course_status.status===2?
item.course_identity<6?<a className="fr user_default_btn task-btn-orange font-18 mt28 pathbtens courseslistsa" href={item.first_category_url} target="_blank"> item.course_identity<6?<a className="fr user_default_btn task-btn-orange font-18 mt28 pathbtens courseslistsa" href={item.first_category_url} target="_blank">
进入课堂 进入课堂
</a>:<div className="fr user_default_btn background191 font-18 mt28 pathbtens pathdefault"></div>:""} </a>:<div className="mr80 shixun_detail pointer fl user-colorgrey-9b pathdefault"></div>:""}
</div> </div>
)})} )})}
</li> </li>}
{applypath===false?"":this.state.MenuItemskey===this.props.courses.length?<div className={"clear"}></div>:""}
{applypath===false?"":this.state.MenuItemskey===this.props.courses.length||coursestypes===true?<span className={coursestypes===true?"fl ml20 lineHeight0 relativewidth mt43":"fl ml20 lineHeight0 relativewidth"}>
<span>当前预约报名人数<span className={"color-red mr5"}>{getappointmenttype===true?this.props.detailInfoList&&this.props.detailInfoList.participant_count+1:this.props.detailInfoList&&this.props.detailInfoList.participant_count}</span></span>
<span className={"font153"}>当预约报名人数达到 {this.props.detailInfoList&&this.props.detailInfoList.student_count} 人时即将开课</span>
{this.props.detailInfoList&&this.props.detailInfoList.has_participate===false?
getappointmenttype===true?<span className={coursestypes===true?"fr user_default_btn background191 font-18 pathbtensbox absolutewidth mt5":"fr user_default_btn background191 font-18 pathbtensbox absolutewidth"}>预约报名成功</span>:<a className={coursestypes===true?"fr user_default_btn task-btn-28BE6C font-18 pathbtensbox absolutewidth mt5":"fr user_default_btn task-btn-28BE6C font-18 pathbtensbox absolutewidth"} onClick={()=>this.putappointment()}></a>:
<span className={coursestypes===true?"fr user_default_btn background191 font-18 pathbtensbox absolutewidth mt5":"fr user_default_btn background191 font-18 pathbtensbox absolutewidth"}>预约报名成功</span>}
</span>:""}
</div>} </div>}
</div> </div>

@ -85,6 +85,8 @@ class PathDetailIndex extends Component{
items: getItems(10), items: getItems(10),
pathtopskey:1, pathtopskey:1,
dataquerys:{}, dataquerys:{},
MenuItemsindex:1,
MenuItemsindextype:0
} }
this.onDragEnd = this.onDragEnd.bind(this); this.onDragEnd = this.onDragEnd.bind(this);
@ -147,7 +149,10 @@ class PathDetailIndex extends Component{
} }
componentDidMount(){ componentDidMount(){
this.getlistdatas()
}
getlistdatas=()=>{
const query = this.props.location.search; const query = this.props.location.search;
// const type = query.split('?chinaoocTimestamp='); // const type = query.split('?chinaoocTimestamp=');
// console.log("Eduinforms12345"); // console.log("Eduinforms12345");
@ -254,7 +259,13 @@ class PathDetailIndex extends Component{
console.log(error); console.log(error);
}) })
}; };
getMenuItemsindex=(key,status)=>{
this.setState({
MenuItemsindex:key,
MenuItemsindextype:status
})
}
getdatasindex=(key)=>{ getdatasindex=(key)=>{
// yslwebobject 后端需要的接口 // yslwebobject 后端需要的接口
let pathid=this.props.match.params.pathId; let pathid=this.props.match.params.pathId;
@ -460,9 +471,13 @@ class PathDetailIndex extends Component{
members, members,
tags, tags,
courses, courses,
MenuItemsindex,
MenuItemsindextype
} = this.state } = this.state
// console.log(MenuItemsindex)
// console.log(MenuItemsindextype===2&&detailInfoList&&detailInfoList.allow_statistics===false)
return( return(
<div className="newContainer"> <div className="newContainer">
<style> <style>
@ -487,7 +502,7 @@ class PathDetailIndex extends Component{
> >
</Modals> </Modals>
<div className="newMain clearfix"> <div className="newMain clearfix">
<DetailTop {...this.state} {...this.props} getdatasindex={(key)=>this.getdatasindex(key)}></DetailTop> <DetailTop {...this.state} {...this.props} getdatasindex={(key)=>this.getdatasindex(key)} getMenuItemsindex={(key,status)=>this.getMenuItemsindex(key,status)} getlistdatas={()=>this.getlistdatas()}></DetailTop>
<div className="educontent clearfix mb80"> <div className="educontent clearfix mb80">
<div className="with65 fl"> <div className="with65 fl">
<div className="produce-content mb10"> <div className="produce-content mb10">

@ -0,0 +1,5 @@
require 'rails_helper'
RSpec.describe CreateSubjectCourseStudentJob, type: :job do
pending "add some examples to (or delete) #{__FILE__}"
end
Loading…
Cancel
Save