{this.props.data&&this.props.data.task_type===1?"普通作业":this.props.data&&this.props.data.task_type===2?"分组作业":""}
@@ -342,7 +336,7 @@ class NewGtaskForms extends Component{
From 1958989ee11b440df0627928d375ad5e97315a95 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E6=9D=A8=E6=A0=91=E6=98=8E?= <775174143@qq.com>
Date: Fri, 6 Sep 2019 18:44:06 +0800
Subject: [PATCH 05/13] =?UTF-8?q?=E8=B0=83=E7=94=A8=E9=97=AE=E9=A2=98?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
public/react/src/modules/user/usersInfo/InfosTopics.js | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/public/react/src/modules/user/usersInfo/InfosTopics.js b/public/react/src/modules/user/usersInfo/InfosTopics.js
index d90feed0f..2cffce0ec 100644
--- a/public/react/src/modules/user/usersInfo/InfosTopics.js
+++ b/public/react/src/modules/user/usersInfo/InfosTopics.js
@@ -74,7 +74,7 @@ class InfosTopics extends Component{
isSpin:true
})
let types=this.props.match.params.topicstype;
- let user_id="";
+ let user_id=undefined;
if(types==="publicly"){
user_id=this.props.current_user&&this.props.current_user.login;
@@ -83,7 +83,7 @@ class InfosTopics extends Component{
}
if(user_id!=undefined){
- console.log(user_id)
+
let {per_page}=this.state;
let url=`/users/${user_id}/question_banks.json`;
From d0d90a1e1fc4c3d8a48c201b3ff2bb5079e45b58 Mon Sep 17 00:00:00 2001
From: caicai8 <1149225589@qq.com>
Date: Fri, 6 Sep 2019 18:44:33 +0800
Subject: [PATCH 06/13] =?UTF-8?q?=E9=A2=98=E5=BA=93=E9=97=AE=E5=8D=B7?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../src/modules/courses/poll/PollDetailTabThirdInfo.js | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/public/react/src/modules/courses/poll/PollDetailTabThirdInfo.js b/public/react/src/modules/courses/poll/PollDetailTabThirdInfo.js
index 792c1b64f..dfe8ad4e7 100644
--- a/public/react/src/modules/courses/poll/PollDetailTabThirdInfo.js
+++ b/public/react/src/modules/courses/poll/PollDetailTabThirdInfo.js
@@ -21,11 +21,11 @@ class PollDetailTabThirdInfo extends Component{
{ pollDetail.poll.polls_description }
}
- { pollDetail && pollDetail.question_types.q_counts===0 ? "" :
+ { !pollDetail || !pollDetail.question_types || pollDetail.question_types.q_counts===0 ? "" :
{
- pollDetail && pollDetail.question_types.q_counts > 0 &&
- 合计{pollDetail.question_types.q_counts}题:
+ pollDetail && pollDetail.question_types && pollDetail.question_types.q_counts > 0 &&
+ 合计{pollDetail.question_types && pollDetail.question_types.q_counts}题:
}
{
pollDetail && pollDetail.question_types.q_singles > 0 &&
@@ -44,7 +44,7 @@ class PollDetailTabThirdInfo extends Component{
{
- pollDetail && pollDetail.questions.map((item,key)=>{
+ pollDetail && pollDetail.questions && pollDetail.questions.map((item,key)=>{
return(
From 38c309c216e9e77ba16bb6f57f1125148e87b5ec Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E6=9D=A8=E6=A0=91=E6=98=8E?= <775174143@qq.com>
Date: Fri, 6 Sep 2019 18:50:28 +0800
Subject: [PATCH 07/13] =?UTF-8?q?=E8=B0=83=E6=95=B4?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
public/react/src/modules/user/usersInfo/InfosTopics.js | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/public/react/src/modules/user/usersInfo/InfosTopics.js b/public/react/src/modules/user/usersInfo/InfosTopics.js
index 2cffce0ec..d90feed0f 100644
--- a/public/react/src/modules/user/usersInfo/InfosTopics.js
+++ b/public/react/src/modules/user/usersInfo/InfosTopics.js
@@ -74,7 +74,7 @@ class InfosTopics extends Component{
isSpin:true
})
let types=this.props.match.params.topicstype;
- let user_id=undefined;
+ let user_id="";
if(types==="publicly"){
user_id=this.props.current_user&&this.props.current_user.login;
@@ -83,7 +83,7 @@ class InfosTopics extends Component{
}
if(user_id!=undefined){
-
+ console.log(user_id)
let {per_page}=this.state;
let url=`/users/${user_id}/question_banks.json`;
From 1d86e0f641bfb9fa4d6fe1a212caedae6fe05ac9 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E6=9D=A8=E6=A0=91=E6=98=8E?= <775174143@qq.com>
Date: Fri, 6 Sep 2019 19:01:26 +0800
Subject: [PATCH 08/13] =?UTF-8?q?=E8=B0=83=E6=95=B4?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
public/react/src/AppConfig.js | 20 ++++++------
.../src/modules/user/usersInfo/InfosTopics.js | 32 +++++++++----------
2 files changed, 25 insertions(+), 27 deletions(-)
diff --git a/public/react/src/AppConfig.js b/public/react/src/AppConfig.js
index 939d2cdaa..2fbee86da 100644
--- a/public/react/src/AppConfig.js
+++ b/public/react/src/AppConfig.js
@@ -21,16 +21,16 @@ let hashTimeout
// TODO 开发期多个身份切换
let debugType =""
-if (isDev) {
- const _search = window.location.search;
- let parsed = {};
- if (_search) {
- parsed = queryString.parse(_search);
- }
- debugType = window.location.search.indexOf('debug=t') != -1 ? 'teacher' :
- window.location.search.indexOf('debug=s') != -1 ? 'student' :
- window.location.search.indexOf('debug=a') != -1 ? 'admin' : parsed.debug || 'admin'
-}
+// if (isDev) {
+// const _search = window.location.search;
+// let parsed = {};
+// if (_search) {
+// parsed = queryString.parse(_search);
+// }
+// debugType = window.location.search.indexOf('debug=t') != -1 ? 'teacher' :
+// window.location.search.indexOf('debug=s') != -1 ? 'student' :
+// window.location.search.indexOf('debug=a') != -1 ? 'admin' : parsed.debug || 'admin'
+// }
window._debugType = debugType;
export function initAxiosInterceptors(props) {
diff --git a/public/react/src/modules/user/usersInfo/InfosTopics.js b/public/react/src/modules/user/usersInfo/InfosTopics.js
index d90feed0f..edd7e554a 100644
--- a/public/react/src/modules/user/usersInfo/InfosTopics.js
+++ b/public/react/src/modules/user/usersInfo/InfosTopics.js
@@ -70,20 +70,22 @@ class InfosTopics extends Component{
// }else{
//
// }
- this.setState({
- isSpin:true
- })
- let types=this.props.match.params.topicstype;
- let user_id="";
+ this.setState({
+ isSpin:true
+ })
+ let types=this.props.match.params.topicstype;
+ let user_id="";
+
+ if(types==="publicly"){
+ user_id=this.props.current_user&&this.props.current_user.login;
+ }else{
+ user_id=this.props.match.params&&this.props.match.params.username;
+ }
- if(types==="publicly"){
- user_id=this.props.current_user&&this.props.current_user.login;
- }else{
- user_id=this.props.match.params&&this.props.match.params.username;
- }
- if(user_id!=undefined){
- console.log(user_id)
+ if(user_id===undefined){
+ user_id=this.props.match.params&&this.props.match.params.username;
+ }
let {per_page}=this.state;
let url=`/users/${user_id}/question_banks.json`;
@@ -107,11 +109,7 @@ class InfosTopics extends Component{
isSpin:false
})
});
- }else{
- this.setState({
- isSpin:false
- })
- }
+
}
searchCategory=(type)=>{
From 8d7af860c40d04ba30cc4f1f2034a185d83867f4 Mon Sep 17 00:00:00 2001
From: cxt <853663049@qq.com>
Date: Fri, 6 Sep 2019 19:08:56 +0800
Subject: [PATCH 09/13] tiaoz
---
app/controllers/application_controller.rb | 2 +-
app/controllers/users/question_banks_controller.rb | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rb
index 86d6312ab..a15e2b5ab 100644
--- a/app/controllers/application_controller.rb
+++ b/app/controllers/application_controller.rb
@@ -47,7 +47,7 @@ class ApplicationController < ActionController::Base
# 题库的访问权限
def bank_visit_auth
- tip_exception("未通过职业认证") if current_user.is_teacher? && !current_user.certification_teacher? && !current_user.admin? && @bank.user_id != current_user.id && @bank.is_public
+ tip_exception(-2,"未通过职业认证") if current_user.is_teacher? && !current_user.certification_teacher? && !current_user.admin? && @bank.user_id != current_user.id && @bank.is_public
tip_exception(403, "无权限") unless @bank.user_id == current_user.id || current_user.admin? ||
(current_user.certification_teacher? && @bank.is_public)
end
diff --git a/app/controllers/users/question_banks_controller.rb b/app/controllers/users/question_banks_controller.rb
index d6a2fcc88..76523eca4 100644
--- a/app/controllers/users/question_banks_controller.rb
+++ b/app/controllers/users/question_banks_controller.rb
@@ -65,7 +65,7 @@ class Users::QuestionBanksController < Users::BaseController
def check_user_permission!
if params[:type] == 'publicly'
- render_error("未通过职业认证") unless User.current.admin? || User.current.certification_teacher?
+ normal_status(-2,"未通过职业认证") unless User.current.admin? || User.current.certification_teacher?
else
render_forbidden unless User.current.admin? || User.current.is_teacher?
end
From 58e07fc5b2456aaf1e7515a58195c382c9983da4 Mon Sep 17 00:00:00 2001
From: caicai8 <1149225589@qq.com>
Date: Fri, 6 Sep 2019 19:17:11 +0800
Subject: [PATCH 10/13] =?UTF-8?q?=E9=A2=98=E5=BA=93=E8=AE=A4=E8=AF=81?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../user/usersInfo/banks/BanksIndex.js | 28 +++++++++----------
1 file changed, 14 insertions(+), 14 deletions(-)
diff --git a/public/react/src/modules/user/usersInfo/banks/BanksIndex.js b/public/react/src/modules/user/usersInfo/banks/BanksIndex.js
index 15331a2e7..0698048f2 100644
--- a/public/react/src/modules/user/usersInfo/banks/BanksIndex.js
+++ b/public/react/src/modules/user/usersInfo/banks/BanksIndex.js
@@ -78,10 +78,10 @@ class BanksIndex extends Component{
}
componentDidMount = () =>{
- let pathname = this.props.location.pathname;
- this.setState({
- publicly:pathname.indexOf("/publicly") > -1
- })
+ // let pathname = this.props.location.pathname;
+ // this.setState({
+ // publicly:pathname.indexOf("/publicly") > -1
+ // })
}
@@ -92,16 +92,16 @@ class BanksIndex extends Component{
}
componentDidUpdate(prevProps) {
- if(prevProps.current_user!=this.props.current_user){
- let { publicly }=this.state;
- if( this.props.checkIfLogin()) {
- if (this.props.current_user && this.props.current_user.professional_certification == false && publicly){
- this.props.history.push(`/topicbank/${this.props.current_user.login}/publicly`);
- }
- } else {
- this.props.showLoginDialog()
- }
- }
+ // if(prevProps.current_user!=this.props.current_user){
+ // let { publicly }=this.state;
+ // if( this.props.checkIfLogin()) {
+ // if (this.props.current_user && this.props.current_user.professional_certification == false && publicly){
+ // this.props.history.push(`/topicbank/${this.props.current_user.login}/publicly`);
+ // }
+ // } else {
+ // this.props.showLoginDialog()
+ // }
+ // }
// let { publicly }=this.state;
// if(this.props.current_user && this.props.current_user.professional_certification == false && publicly){
// if( this.props.checkIfLogin()) {
From 479062bcbeb4fb671ffd8409fef19d8983de8617 Mon Sep 17 00:00:00 2001
From: cxt <853663049@qq.com>
Date: Fri, 6 Sep 2019 19:19:15 +0800
Subject: [PATCH 11/13] =?UTF-8?q?=E6=AF=95=E8=AE=BE=E9=80=89=E9=A2=98?=
=?UTF-8?q?=E7=9A=84=E8=AE=BE=E4=B8=BA=E5=85=AC=E5=BC=80?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
db/migrate/20190906111746_gtopic_bank_is_public.rb | 5 +++++
1 file changed, 5 insertions(+)
create mode 100644 db/migrate/20190906111746_gtopic_bank_is_public.rb
diff --git a/db/migrate/20190906111746_gtopic_bank_is_public.rb b/db/migrate/20190906111746_gtopic_bank_is_public.rb
new file mode 100644
index 000000000..193824dc4
--- /dev/null
+++ b/db/migrate/20190906111746_gtopic_bank_is_public.rb
@@ -0,0 +1,5 @@
+class GtopicBankIsPublic < ActiveRecord::Migration[5.2]
+ def change
+ GtopicBank.where(is_public: nil).update_all(is_public: 0)
+ end
+end
From 2f82c863f99eafa1aa30f4b923fed60836300058 Mon Sep 17 00:00:00 2001
From: caicai8 <1149225589@qq.com>
Date: Fri, 6 Sep 2019 19:26:18 +0800
Subject: [PATCH 12/13] =?UTF-8?q?=E6=AF=95=E8=AE=BE=E4=BB=BB=E5=8A=A1?=
=?UTF-8?q?=E5=88=97=E8=A1=A8?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
public/react/src/modules/courses/css/Courses.css | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/public/react/src/modules/courses/css/Courses.css b/public/react/src/modules/courses/css/Courses.css
index 72ea16378..45c7f00af 100644
--- a/public/react/src/modules/courses/css/Courses.css
+++ b/public/react/src/modules/courses/css/Courses.css
@@ -1221,7 +1221,7 @@ samp {
}
/* 毕设任务 */
- .graduationTaskMenu a{
+ .graduationTaskMenu>a{
display: block;
position: relative;
line-height: 72px;
@@ -1229,7 +1229,7 @@ samp {
margin-right: 30px;
float: left;
}
- .graduationTaskMenu a.active:after{
+ .graduationTaskMenu>a.active:after{
position: absolute;
left: 0px;
height: 2px;
@@ -1239,7 +1239,7 @@ samp {
bottom: 0px;
font-weight:400;
}
- .graduationTaskMenu a.active{
+ .graduationTaskMenu>a.active{
color: #4CACFF!important;
}
From c1e5f28702d6268770ffb6fd024ab7560994fdaf Mon Sep 17 00:00:00 2001
From: cxt <853663049@qq.com>
Date: Fri, 6 Sep 2019 19:29:03 +0800
Subject: [PATCH 13/13] =?UTF-8?q?=E8=B0=83=E6=95=B4?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
app/controllers/task_banks_controller.rb | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/app/controllers/task_banks_controller.rb b/app/controllers/task_banks_controller.rb
index b88768456..8d17c15f1 100644
--- a/app/controllers/task_banks_controller.rb
+++ b/app/controllers/task_banks_controller.rb
@@ -35,7 +35,7 @@ class TaskBanksController < ApplicationController
def gtask_bank_params
tip_exception("name参数不能为空") if params[:gtask_bank][:name].blank?
tip_exception("description参数不能为空") if params[:gtask_bank][:description].blank?
- if @bank.homework_type == 3
+ if @bank.task_type == 2
tip_exception("base_on_project参数不能为空") if params[:gtask_bank][:base_on_project].nil?
tip_exception("min_num参数不能为空") if params[:gtask_bank][:min_num].blank?
tip_exception("max_num参数不能为空") if params[:gtask_bank][:max_num].blank?