diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rb
index e825d53da..c76ca51a7 100644
--- a/app/controllers/application_controller.rb
+++ b/app/controllers/application_controller.rb
@@ -583,4 +583,8 @@ class ApplicationController < ActionController::Base
def render_parameter_missing
render json: { status: -1, message: '参数缺失' }
end
+
+ def set_export_cookies
+ cookies[:fileDownload] = true
+ end
end
diff --git a/app/controllers/homework_commons_controller.rb b/app/controllers/homework_commons_controller.rb
index dfa6795fb..f7906ecda 100644
--- a/app/controllers/homework_commons_controller.rb
+++ b/app/controllers/homework_commons_controller.rb
@@ -212,7 +212,7 @@ class HomeworkCommonsController < ApplicationController
else
respond_to do |format|
format.xlsx{
- cookies[:fileDownload] = true
+ set_export_cookies
student_work_to_xlsx(@work_excel,@homework)
exercise_export_name = "#{current_user.real_name}_#{@course.name}_#{@homework.name}_#{Time.now.strftime('%Y%m%d_%H%M%S')}"
render xlsx: "#{exercise_export_name.strip}",template: "homework_commons/works_list.xlsx.axlsx",locals:
@@ -223,8 +223,6 @@ class HomeworkCommonsController < ApplicationController
elsif params[:format] == "zip"
if @user_course_identity >= Course::STUDENT
tip_exception(403, "无权限操作")
- elsif params[:export].present? && params[:export]
- normal_status(0,"正在下载中")
else
if @work_excel.present?
zip_works = @work_excel&.where("work_status > 0")
@@ -234,13 +232,17 @@ class HomeworkCommonsController < ApplicationController
end
if status == 0
- respond_to do |format|
- format.zip{
- cookies[:fileDownload] = true
- zipfile = zip_homework_common @homework, zip_works
- file = decode64(zipfile[0][:base64file])
- send_file "#{OUTPUT_FOLDER}/#{file}", filename: filename_for_content_disposition(file), type: 'application/zip'
- }
+ if params[:export].present? && params[:export]
+ normal_status(0,"正在下载中")
+ else
+ respond_to do |format|
+ format.zip{
+ set_export_cookies
+ zipfile = zip_homework_common @homework, zip_works
+ file = decode64(zipfile[0][:base64file])
+ send_file "#{OUTPUT_FOLDER}/#{file}", filename: filename_for_content_disposition(file), type: 'application/zip'
+ }
+ end
end
else
normal_status(status, status == -2 ? "500M" : "无附件可下载")
diff --git a/app/controllers/zips_controller.rb b/app/controllers/zips_controller.rb
index bea5784c7..b1f7804a9 100644
--- a/app/controllers/zips_controller.rb
+++ b/app/controllers/zips_controller.rb
@@ -11,7 +11,7 @@ class ZipsController < ApplicationController
if params[:export].present? && params[:export]
normal_status(0,"正在下载中")
else
- cookies[:fileDownload] = true
+ set_export_cookies
send_file service.zip, filename: filename_, type: 'application/zip'
end
diff --git a/public/react/src/modules/courses/busyWork/CommonWorkDetailIndex.js b/public/react/src/modules/courses/busyWork/CommonWorkDetailIndex.js
index 2d3361492..b8a5d450c 100644
--- a/public/react/src/modules/courses/busyWork/CommonWorkDetailIndex.js
+++ b/public/react/src/modules/courses/busyWork/CommonWorkDetailIndex.js
@@ -66,7 +66,7 @@ class CommonWorkDetailIndex extends Component{
this.state = {
DownloadType:false,
DownloadMessageval:undefined,
- donwloading: false,
+ donwloading:false,
}
}
initWorkDetailCommonState = (data) => {
@@ -106,7 +106,10 @@ class CommonWorkDetailIndex extends Component{
/// 确认是否下载
confirmysl(url){
- axios.get(url).then((response) => {
+ axios.get(url+ '&export=true').then((response) => {
+ if(response===undefined){
+ return
+ }
if(response.data.status&&response.data.status===-1){
}else if(response.data.status&&response.data.status===-2){
@@ -187,7 +190,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);
@@ -311,15 +316,15 @@ class CommonWorkDetailIndex extends Component{
导出
diff --git a/public/react/src/modules/courses/busyWork/CommonWorkList.js b/public/react/src/modules/courses/busyWork/CommonWorkList.js
index 8bc029cec..9224e7eb2 100644
--- a/public/react/src/modules/courses/busyWork/CommonWorkList.js
+++ b/public/react/src/modules/courses/busyWork/CommonWorkList.js
@@ -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 = () => {
diff --git a/public/react/src/modules/courses/exercise/ExerciseDisplay.js b/public/react/src/modules/courses/exercise/ExerciseDisplay.js
index bd70bece6..a0296476f 100644
--- a/public/react/src/modules/courses/exercise/ExerciseDisplay.js
+++ b/public/react/src/modules/courses/exercise/ExerciseDisplay.js
@@ -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,
diff --git a/public/react/src/modules/courses/exercise/Exercisesetting.js b/public/react/src/modules/courses/exercise/Exercisesetting.js
index 06269244d..9b6103fdb 100644
--- a/public/react/src/modules/courses/exercise/Exercisesetting.js
+++ b/public/react/src/modules/courses/exercise/Exercisesetting.js
@@ -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)=>{
diff --git a/public/react/src/modules/courses/exercise/Exercisestatisticalresult.js b/public/react/src/modules/courses/exercise/Exercisestatisticalresult.js
index 1771d87b3..34f32b234 100644
--- a/public/react/src/modules/courses/exercise/Exercisestatisticalresult.js
+++ b/public/react/src/modules/courses/exercise/Exercisestatisticalresult.js
@@ -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`;
diff --git a/public/react/src/modules/courses/exercise/Studentshavecompletedthelist.js b/public/react/src/modules/courses/exercise/Studentshavecompletedthelist.js
index fffadccf6..f7a989f79 100644
--- a/public/react/src/modules/courses/exercise/Studentshavecompletedthelist.js
+++ b/public/react/src/modules/courses/exercise/Studentshavecompletedthelist.js
@@ -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) => {
@@ -1384,7 +1389,8 @@ class Studentshavecompletedthelist extends Component {
loadingstate: true,
})
}
-
+ console.log(response);
+ console.log(1393);
thiss.Generatenewdatasy(response.data.exercise_users, response);
}
}).catch((error) => {
@@ -1984,9 +1990,14 @@ class Studentshavecompletedthelist extends Component {
}).then((response) => {
// console.log("528");
// console.log(JSON.stringify(response));
+ if(response===undefined){
+ return
+ }
this.setState({
loadingstate: false,
})
+ console.log(response);
+ console.log(1997);
this.Generatenewdatasy(response.data.exercise_users, response);
}).catch((error) => {
console.log(error)
@@ -2279,22 +2290,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 +2310,34 @@ class Studentshavecompletedthelist extends Component {
// console.log(value)
+ };
+ _getRequestParams() {
+ const { order, checkedValuesineinfo,searchtext, page ,limit} = this.state
+ return {
+ page,
+ search:searchtext,
+ group_id:checkedValuesineinfo,
+ limit: limit,
+ order,
+ }
}
+ //搜索学生 文字输入
+ 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") {
diff --git a/public/react/src/modules/courses/exercise/Testpapersettinghomepage.js b/public/react/src/modules/courses/exercise/Testpapersettinghomepage.js
index 36b319f5a..24e960a9d 100644
--- a/public/react/src/modules/courses/exercise/Testpapersettinghomepage.js
+++ b/public/react/src/modules/courses/exercise/Testpapersettinghomepage.js
@@ -1,7 +1,7 @@
import React,{ Component } from "react";
import {Checkbox,Input,Table, Pagination,Menu} from "antd";
import {Link,NavLink} from 'react-router-dom';
-import { WordsBtn ,ActionBtn} from 'educoder';
+import { WordsBtn ,ActionBtn,queryString} from 'educoder';
import CoursesListType from '../coursesPublic/CoursesListType';
import '../css/members.css';
import '../css/busyWork.css';
@@ -19,7 +19,7 @@ import Ecerciseallbackagain from './Ecerciseallbackagain';
const polls_status={1:"未发布",2:"提交中",3:"已截止",4:"已结束"}
const start_Value={0:"继续答题",1:"查看答题",2:"开始答题"}
-
+const qs = require('qs');
//试卷主要设置页面
class Testpapersettinghomepage extends Component{
constructor(props) {
@@ -163,8 +163,17 @@ class Testpapersettinghomepage extends Component{
}
/// 确认是否下载
- confirmysl(url){
- axios.get(url).then((response) => {
+ confirmysl(url,child){
+ let params ={}
+ if(child!=undefined){
+ params =child._getRequestParams()!==undefined?child._getRequestParams():{};
+ }
+ console.log("170");
+ console.log(params);
+ axios.get(url+`?${queryString.stringify(params)}`).then((response) => {
+ if(response===undefined){
+ return
+ }
if(response.data.status&&response.data.status===-1){
}else if(response.data.status&&response.data.status===-2){
@@ -184,7 +193,7 @@ class Testpapersettinghomepage extends Component{
}
}else {
this.props.showNotification(`正在下载中`);
- window.open("/api"+url, '_blank');
+ window.open("/api"+url+`?${queryString.stringify(params)}`, '_blank');
}
}).catch((error) => {
console.log(error)
@@ -218,6 +227,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,6 +246,7 @@ class Testpapersettinghomepage extends Component{
let {tab,visible,Commonheadofthetestpaper}=this.state;
const isAdmin =this.props.isAdmin();
const isStudent = this.props.isStudent();
+ // TODO
return(
@@ -345,7 +356,7 @@ class Testpapersettinghomepage extends Component{
{isAdmin === true?
导出
@@ -400,22 +411,22 @@ class Testpapersettinghomepage extends Component{
/>
{
// 教师列表
- parseInt(tab[0])==0 && this.setcourse_groupysls(value)} current_status = {this.state.current_status}>
+ parseInt(tab[0])==0 && this.setcourse_groupysls(value)} current_status = {this.state.current_status}>
}
{/*统计结果*/}
{
- parseInt(tab[0])==1 &&
+ parseInt(tab[0])==1 &&
}
{
- parseInt(tab[0])==2 &&
+ parseInt(tab[0])==2 &&
}
{
- parseInt(tab[0])==3 &&
+ parseInt(tab[0])==3 &&
}
diff --git a/public/react/src/modules/paths/PathDetail/DetailCardsEditAndAdd.js b/public/react/src/modules/paths/PathDetail/DetailCardsEditAndAdd.js
index 2d7bcc0e0..6f771ece8 100644
--- a/public/react/src/modules/paths/PathDetail/DetailCardsEditAndAdd.js
+++ b/public/react/src/modules/paths/PathDetail/DetailCardsEditAndAdd.js
@@ -500,7 +500,9 @@ class DetailCardsEditAndAdd extends Component{