master
杨树林 5 years ago
parent 5372a0facb
commit 4e4d011d43

@ -102,8 +102,10 @@ class CommonWorkDetailIndex extends Component{
}
/// 确认是否下载
confirmysl(url){
axios.get(url).then((response) => {
confirmysl(url,params){
axios.get(url,{
params
}).then((response) => {
if(response.data.status&&response.data.status===-1){
}else if(response.data.status&&response.data.status===-2){
@ -171,7 +173,9 @@ class CommonWorkDetailIndex extends Component{
let params = {}
if (isListModule) {
// TODO
params =this.child._getRequestParams()!==undefined?this.child._getRequestParams():{};
if(this.child!=undefined) {
params = this.child._getRequestParams() !== undefined ? this.child._getRequestParams() : {};
}
}
// console.log("普通作业176176176");
// console.log(params);

@ -425,7 +425,8 @@ class CommonWorkList extends Component{
teacher_comment: arg_teacher_comment.length == 0 ? '' : arg_teacher_comment[0],
order,
limit: PAGE_SIZE,
b_order: orderMap[order]
b_order: orderMap[order],
group_id:arg_course_group,
}
}
fetchList = () => {

@ -33,6 +33,21 @@ class ExerciseDisplay extends Component{
this.state = {
exercise_questions: [],
exercise_group_id:[],
page:1,
limit:10,
searchtext:"",
order: "end_at",
}
}
_getRequestParams() {
const { order, exercise_group_id,searchtext, page ,limit} = this.state
return {
page,
search:searchtext,
order,
limit: limit,
group_id:exercise_group_id,
}
}
componentDidMount = () => {
@ -49,6 +64,21 @@ class ExerciseDisplay extends Component{
console.log(error);
});
}
try {
this.props.triggerRef(this);
}catch (e) {
}
}
_getRequestParams() {
const { order, exercise_group_id,searchtext, page ,limit} = this.state
return {
page,
search:searchtext,
order,
limit: limit,
group_id:exercise_group_id,
}
}
render() {
// let { question_title, question_score, question_type, question_choices, standard_answer,

@ -63,17 +63,46 @@ class Exercisesetting extends Component{
choice_random:true,
time:0,
publish_timetype:false,
end_timetype:false
end_timetype:false,
exercise_group_id:[],
page:1,
limit:10,
searchtext:"",
order: "end_at",
}
console.log("Exercisesetting");
console.log("69");
console.log(props);
}
_getRequestParams() {
const { order, exercise_group_id,searchtext, page ,limit} = this.state
return {
page,
search:searchtext,
order,
limit: limit,
group_id:exercise_group_id,
}
}
//加载
componentDidMount=()=>{
this.getSettingInfo();
// window.addEventListener('click', this.handleClick);
try {
this.props.triggerRef(this);
}catch (e) {
}
}
_getRequestParams() {
const { order, exercise_group_id,searchtext, page ,limit} = this.state
return {
page,
search:searchtext,
order,
limit: limit,
group_id:exercise_group_id,
}
}
// handleClick=(e)=>{

@ -23,15 +23,32 @@ class Exercisestatisticalresult extends Component {
exercise_group_id:[],
page:1,
limit:10,
searchtext:"",
order: "end_at",
}
}
componentDidMount() {
let{sort,exercise_group_id,page,limit}=this.state;
this.updatefun(sort,exercise_group_id,page,limit)
}
this.updatefun(sort,exercise_group_id,page,limit);
try {
this.props.triggerRef(this);
}catch (e) {
}
}
_getRequestParams() {
const { order, exercise_group_id,searchtext, page ,limit} = this.state
return {
page,
search:searchtext,
order,
limit: limit,
group_id:exercise_group_id,
}
}
updatefun=(sort,exercise_group_id,page,limit)=>{
let ExerciseId=this.props.match.params.Id;
let url = `/exercises/`+ExerciseId+`/exercise_result.json`;

@ -1213,6 +1213,11 @@ class Studentshavecompletedthelist extends Component {
// console.log("2222222222222");
// console.log(this.props.isAdmin());
// }
try {
this.props.triggerRef(this);
}catch (e) {
}
}
componentWillReceiveProps = (nextProps) => {
@ -2279,22 +2284,8 @@ class Studentshavecompletedthelist extends Component {
this.Searchdatasys(this.state.order, this.state.commit_status, this.state.review, this.state.checkedValuesineinfo, this.state.searchtext, 1, this.state.limit);
}
}
//搜索学生 文字输入
inputSearchValues = (e) => {
// console.log(e.target.value)
if (e.target.value === "") {
this.setState({
searchtext: undefined,
})
} else {
this.setState({
searchtext: e.target.value,
})
}
}
//搜索学生按钮输入
};
//搜索学生按钮输入 老师
searchValues = (value) => {
//点击直接搜索
// if(value === ""){
@ -2313,8 +2304,34 @@ class Studentshavecompletedthelist extends Component {
// console.log(value)
};
_getRequestParams() {
const { order, course_groups,searchtext, page ,limit} = this.state
return {
page,
search:searchtext,
order,
limit: limit,
group_id:course_groups,
}
}
//搜索学生 文字输入
inputSearchValues = (e) => {
// console.log(e.target.value)
if (e.target.value === "") {
this.setState({
searchtext: undefined,
})
} else {
this.setState({
searchtext: e.target.value,
})
}
};
//排序
funordersy = (e) => {
if (e === "end_at") {

@ -163,8 +163,10 @@ class Testpapersettinghomepage extends Component{
}
/// 确认是否下载
confirmysl(url){
axios.get(url).then((response) => {
confirmysl(url,params){
axios.get(url,{
params
}).then((response) => {
if(response.data.status&&response.data.status===-1){
}else if(response.data.status&&response.data.status===-2){
@ -218,6 +220,7 @@ class Testpapersettinghomepage extends Component{
// DownloadMessageval:undefined
// })
// }
bindRef = ref => { this.child = ref };
goback=()=>{
// let {datalist}=this.state;
// let courseId=this.props.match.params.coursesId;
@ -236,7 +239,13 @@ class Testpapersettinghomepage extends Component{
let {tab,visible,Commonheadofthetestpaper}=this.state;
const isAdmin =this.props.isAdmin();
const isStudent = this.props.isStudent();
// TODO
let params ={}
if(this.child!=undefined){
params =this.child._getRequestParams()!==undefined?this.child._getRequestParams():{};
}
// console.log("246");
// console.log(this.child);
return(
<div className="newMain clearfix ">
{/*<DownloadMessage*/}
@ -345,7 +354,7 @@ class Testpapersettinghomepage extends Component{
{isAdmin === true? <li className="li_line drop_down fr color-blue font-15" style={{"paddingLeft":"0px"}}>
导出<i className="iconfont icon-xiajiantou font-12 ml2"></i>
<ul className="drop_down_menu" style={{"right":"-34px","left":"unset","height":"auto"}}>
<li><a onClick={()=>this.confirmysl(`/exercises/${this.props.match.params.Id}/exercise_lists.xlsx`)}>学生成绩</a></li>
<li><a onClick={()=>this.confirmysl(`/exercises/${this.props.match.params.Id}/exercise_lists.xlsx`,params)}>学生成绩</a></li>
{/*<li><a onClick={()=>this.confirmysl(`/exercises/${this.props.match.params.Id}/export_exercise`)} >空白试卷</a></li>*/}
{/*<li><a onClick={()=>this.confirmysl(`/zip/export_exercises?exercise_id=${this.props.match.params.Id}${this.state.groupyslsval===null||this.state.groupyslsval===undefined?null:this.state.groupyslsval}`)}>学生答题试卷</a></li>*/}
</ul>
@ -400,22 +409,22 @@ class Testpapersettinghomepage extends Component{
/>
{
// 教师列表
parseInt(tab[0])==0 && <Studentshavecompletedthelist {...this.props} {...this.state} 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}></Studentshavecompletedthelist>
}
{/*统计结果*/}
{
parseInt(tab[0])==1 && <Exercisestatisticalresult {...this.props} {...this.state}></Exercisestatisticalresult>
parseInt(tab[0])==1 && <Exercisestatisticalresult {...this.props} {...this.state} triggerRef={this.bindRef}></Exercisestatisticalresult>
}
{
parseInt(tab[0])==2 && <ExerciseDisplay {...this.props} {...this.state}></ExerciseDisplay>
parseInt(tab[0])==2 && <ExerciseDisplay {...this.props} {...this.state} triggerRef={this.bindRef}></ExerciseDisplay>
}
{
parseInt(tab[0])==3 && <WrappedExercisesetting {...this.props} {...this.state} ></WrappedExercisesetting>
parseInt(tab[0])==3 && <WrappedExercisesetting {...this.props} {...this.state} triggerRef={this.bindRef}></WrappedExercisesetting>
}
</div>
</div>

Loading…
Cancel
Save