删除
立即发布
From 7309b02b65d047a7c1614b29d698365a6d596ac9 Mon Sep 17 00:00:00 2001
From: cxt <853663049@qq.com>
Date: Fri, 30 Aug 2019 09:15:23 +0800
Subject: [PATCH 11/26] =?UTF-8?q?=E9=97=AE=E5=8D=B7=E9=A2=98=E5=BA=93?=
=?UTF-8?q?=E8=AF=A6=E6=83=85=E9=A1=B5?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
app/controllers/exercise_banks_controller.rb | 78 +++++++++++--------
app/controllers/question_banks_controller.rb | 2 +-
.../_poll_questions.json.jbuilder | 18 +++++
app/views/exercise_banks/show.json.jbuilder | 44 ++++++++---
4 files changed, 98 insertions(+), 44 deletions(-)
create mode 100644 app/views/exercise_banks/_poll_questions.json.jbuilder
diff --git a/app/controllers/exercise_banks_controller.rb b/app/controllers/exercise_banks_controller.rb
index cc7a1003e..9aa589768 100644
--- a/app/controllers/exercise_banks_controller.rb
+++ b/app/controllers/exercise_banks_controller.rb
@@ -8,38 +8,12 @@ class ExerciseBanksController < ApplicationController
def show
@exercise_questions = @bank.exercise_bank_questions&.includes(:exercise_bank_choices, :exercise_bank_shixun_challenges,
:exercise_bank_standard_answers).order("question_number ASC")
- @exercise_ques_count = @exercise_questions.size # 全部的题目数
- @exercise_ques_scores = @exercise_questions.pluck(:question_score).sum
-
- #单选题的数量及分数
- exercise_single_ques = @exercise_questions.find_by_custom("question_type", Exercise::SINGLE)
- @exercise_single_ques_count = exercise_single_ques.size
- @exercise_single_ques_scores = exercise_single_ques.pluck(:question_score).sum
-
- #多选题的数量及分数
- exercise_double_ques = @exercise_questions.find_by_custom("question_type", Exercise::MULTIPLE)
- @exercise_double_ques_count = exercise_double_ques.size
- @exercise_double_ques_scores = exercise_double_ques.pluck(:question_score).sum
- # 判断题数量及分数
- exercise_ques_judge = @exercise_questions.find_by_custom("question_type", Exercise::JUDGMENT)
- @exercise_ques_judge_count = exercise_ques_judge.size
- @exercise_ques_judge_scores = exercise_ques_judge.pluck(:question_score).sum
-
- #填空题数量及分数
- exercise_ques_null = @exercise_questions.find_by_custom("question_type", Exercise::COMPLETION)
- @exercise_ques_null_count = exercise_ques_null.size
- @exercise_ques_null_scores = exercise_ques_null.pluck(:question_score).sum
-
- #简答题数量及分数
- exercise_ques_main = @exercise_questions.find_by_custom("question_type", Exercise::SUBJECTIVE)
- @exercise_ques_main_count = exercise_ques_main.size
- @exercise_ques_main_scores = exercise_ques_main.pluck(:question_score).sum
-
- #实训题数量及分数
- exercise_ques_shixun = @exercise_questions.find_by_custom("question_type", Exercise::PRACTICAL)
- @exercise_ques_shixun_count = exercise_ques_shixun.size
- @exercise_ques_shixun_scores = exercise_ques_shixun.pluck(:question_score).sum
+ if @bank.container_type == "Exercise"
+ get_exercise_question_count
+ else
+ get_poll_question_count
+ end
end
def update
@@ -103,4 +77,46 @@ class ExerciseBanksController < ApplicationController
end
end
+ def get_exercise_question_count
+ @exercise_ques_count = @exercise_questions.size # 全部的题目数
+ @exercise_ques_scores = @exercise_questions.pluck(:question_score).sum
+
+ #单选题的数量及分数
+ exercise_single_ques = @exercise_questions.find_by_custom("question_type", Exercise::SINGLE)
+ @exercise_single_ques_count = exercise_single_ques.size
+ @exercise_single_ques_scores = exercise_single_ques.pluck(:question_score).sum
+
+ #多选题的数量及分数
+ exercise_double_ques = @exercise_questions.find_by_custom("question_type", Exercise::MULTIPLE)
+ @exercise_double_ques_count = exercise_double_ques.size
+ @exercise_double_ques_scores = exercise_double_ques.pluck(:question_score).sum
+
+ # 判断题数量及分数
+ exercise_ques_judge = @exercise_questions.find_by_custom("question_type", Exercise::JUDGMENT)
+ @exercise_ques_judge_count = exercise_ques_judge.size
+ @exercise_ques_judge_scores = exercise_ques_judge.pluck(:question_score).sum
+
+ #填空题数量及分数
+ exercise_ques_null = @exercise_questions.find_by_custom("question_type", Exercise::COMPLETION)
+ @exercise_ques_null_count = exercise_ques_null.size
+ @exercise_ques_null_scores = exercise_ques_null.pluck(:question_score).sum
+
+ #简答题数量及分数
+ exercise_ques_main = @exercise_questions.find_by_custom("question_type", Exercise::SUBJECTIVE)
+ @exercise_ques_main_count = exercise_ques_main.size
+ @exercise_ques_main_scores = exercise_ques_main.pluck(:question_score).sum
+
+ #实训题数量及分数
+ exercise_ques_shixun = @exercise_questions.find_by_custom("question_type", Exercise::PRACTICAL)
+ @exercise_ques_shixun_count = exercise_ques_shixun.size
+ @exercise_ques_shixun_scores = exercise_ques_shixun.pluck(:question_score).sum
+ end
+
+ def get_poll_question_count
+ @poll_questions_count = @exercise_questions&.size # 全部的题目数
+ @poll_question_singles = @exercise_questions.find_by_custom("question_type", 1).size # 单选题
+ @poll_question_doubles = @exercise_questions.find_by_custom("question_type", 2).size # 多选题
+ @poll_question_mains = @exercise_questions.find_by_custom("question_type", 3).size #主观题
+ end
+
end
diff --git a/app/controllers/question_banks_controller.rb b/app/controllers/question_banks_controller.rb
index 00fea5f3e..f09a53dbe 100644
--- a/app/controllers/question_banks_controller.rb
+++ b/app/controllers/question_banks_controller.rb
@@ -1,7 +1,7 @@
class QuestionBanksController < ApplicationController
before_action :require_login, :check_auth
before_action :params_filter, except: [:my_courses]
- before_action :teacher_or_admin, except: [:bank_list]
+ # before_action :teacher_or_admin, except: [:bank_list]
# 题库选用列表
# object_type: # normal 普通作业题库; group 分组作业题库; poll问卷题库; exercise试卷题库; gtask 毕设选题题库;gtopic 毕设任务
diff --git a/app/views/exercise_banks/_poll_questions.json.jbuilder b/app/views/exercise_banks/_poll_questions.json.jbuilder
new file mode 100644
index 000000000..524864e60
--- /dev/null
+++ b/app/views/exercise_banks/_poll_questions.json.jbuilder
@@ -0,0 +1,18 @@
+json.question do
+ json.id question.id
+ json.question_number question.question_number
+ json.question_title question.question_title
+ json.question_type question.question_type
+ json.is_necessary question.is_necessary
+ if question.question_type == 2
+ json.max_choices question.max_choices
+ json.min_choices question.min_choices
+ end
+ json.answers do
+ json.array! answers do | a|
+ json.answer_id a.id
+ json.answer_position a.choice_position
+ json.answer_text a.choice_text.nil? ? "other_choices" : a.choice_text ##
+ end
+ end
+end
\ No newline at end of file
diff --git a/app/views/exercise_banks/show.json.jbuilder b/app/views/exercise_banks/show.json.jbuilder
index 1b2a931fa..049886b50 100644
--- a/app/views/exercise_banks/show.json.jbuilder
+++ b/app/views/exercise_banks/show.json.jbuilder
@@ -1,16 +1,36 @@
-json.exercise do
- json.extract! @bank, :id, :name, :description, :is_public
-end
+if @bank.container_type == "Exercise"
+ json.exercise do
+ json.extract! @bank, :id, :name, :description, :is_public
+ end
+
+ json.partial! "exercises/exercise_scores"
+
+ json.exercise_questions do
+ json.array! @exercise_questions do |q|
+ json.partial! "exercise_bank_questions/exercise_bank_questions",
+ question: q,
+ choices:q.exercise_bank_choices,
+ shixun_challenges: q.exercise_bank_shixun_challenges,
+ ques_position:nil,
+ edit_type:nil
+ end
+ end
-json.partial! "exercises/exercise_scores"
+else
+ json.poll do
+ json.extract! @bank, :id, :name, :description, :is_public
+ end
+
+ json.question_types do
+ json.q_counts @poll_questions_count
+ json.q_singles @poll_question_singles
+ json.q_doubles @poll_question_doubles
+ json.q_mains @poll_question_mains
+ end
-json.exercise_questions do
- json.array! @exercise_questions do |q|
- json.partial! "exercise_bank_questions/exercise_bank_questions",
- question: q,
- choices:q.exercise_bank_choices,
- shixun_challenges: q.exercise_bank_shixun_challenges,
- ques_position:nil,
- edit_type:nil
+ json.questions do
+ json.array! @exercise_questions do | question|
+ json.partial! "exercise_banks/poll_questions", question: question, answers: question.exercise_bank_choices
+ end
end
end
\ No newline at end of file
From b654864778192cdfbd35bf36fa9b47884c16ba84 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, 30 Aug 2019 09:17:21 +0800
Subject: [PATCH 12/26] =?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/tpm/component/TPMright.css | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/public/react/src/modules/tpm/component/TPMright.css b/public/react/src/modules/tpm/component/TPMright.css
index 41b87c0d0..c664d75c4 100644
--- a/public/react/src/modules/tpm/component/TPMright.css
+++ b/public/react/src/modules/tpm/component/TPMright.css
@@ -44,7 +44,7 @@
position:relative;
}
.newedboxheight{
- max-height:204px;
+ max-height: 177px;
overflow-y: hidden;
}
.newminheight{
From 680410923ccaf24597e56e4509a7b2ef8fbee716 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, 30 Aug 2019 09:35:12 +0800
Subject: [PATCH 13/26] =?UTF-8?q?=E8=B0=83=E6=95=B4?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../courses/exercise/Exercisesetting.js | 13 +++++++------
.../graduation/tasks/GraduationTaskssetting.js | 1 +
.../courses/shixunHomework/shixunHomework.js | 18 ++++++++++++++----
3 files changed, 22 insertions(+), 10 deletions(-)
diff --git a/public/react/src/modules/courses/exercise/Exercisesetting.js b/public/react/src/modules/courses/exercise/Exercisesetting.js
index a93aa9942..96cc17ca8 100644
--- a/public/react/src/modules/courses/exercise/Exercisesetting.js
+++ b/public/react/src/modules/courses/exercise/Exercisesetting.js
@@ -4,14 +4,14 @@ import {Form,Checkbox,DatePicker,Button,Input,Select,Tooltip} from "antd";
import { handleDateString } from 'educoder';
import PollDetailTabForthRules from '../poll/PollDetailTabForthRules';
-import '../css/members.css'
-import '../css/busyWork.css'
-import '../poll/pollStyle.css'
+import '../css/members.css';
+import '../css/busyWork.css';
+import '../poll/pollStyle.css';
-import moment from 'moment'
+import moment from 'moment';
import locale from 'antd/lib/date-picker/locale/zh_CN';
-import axios from 'axios'
-import Modals from '../../modals/Modals'
+import axios from 'axios';
+import Modals from '../../modals/Modals';
const Search=Input.Search;
const Option=Select.Option;
@@ -549,6 +549,7 @@ class Exercisesetting extends Component{
}
//取消编辑
cancelEdit=()=>{
+ this.getSettingInfo();
this.setState({
flagPageEdit:false
})
diff --git a/public/react/src/modules/courses/graduation/tasks/GraduationTaskssetting.js b/public/react/src/modules/courses/graduation/tasks/GraduationTaskssetting.js
index 7e5707695..e0b327016 100644
--- a/public/react/src/modules/courses/graduation/tasks/GraduationTaskssetting.js
+++ b/public/react/src/modules/courses/graduation/tasks/GraduationTaskssetting.js
@@ -778,6 +778,7 @@ class GraduationTaskssettingapp extends Component{
}
isgoback=()=>{
+ this.getsettings();
this.setState({
flagPageEdit: false,
})
diff --git a/public/react/src/modules/courses/shixunHomework/shixunHomework.js b/public/react/src/modules/courses/shixunHomework/shixunHomework.js
index 528495a9b..bf59380f5 100644
--- a/public/react/src/modules/courses/shixunHomework/shixunHomework.js
+++ b/public/react/src/modules/courses/shixunHomework/shixunHomework.js
@@ -54,7 +54,8 @@ class ShixunHomework extends Component{
course_groupslist:[],
checkedtype:false,
checkBoxValues:[],
- isSpin:false
+ isSpin:false,
+ antIcon:false
}
}
updateNavSuccess=()=>{
@@ -660,10 +661,11 @@ class ShixunHomework extends Component{
savedelete=()=>{
+ this.setState({
+ antIcon:true
+ })
let {Coursename,page,order,checkBoxValues,datas}=this.state;
let category_id=this.props.match.params.category_id;
-
-
const cid = this.props.match.params.coursesId
const url = `/courses/`+cid+`/homework_commons/multi_destroy.json`;
axios.post(url, {
@@ -691,11 +693,17 @@ class ShixunHomework extends Component{
Loadtype:false,
checkBoxValues:[],
checkedtype:false,
+ antIcon:false
})
this.props.showNotification(response.data.message)
this.homeworkupdatalist(Coursename,page,order);
this.props.updataleftNavfun()
- }
+ }else{
+ this.setState({
+ antIcon:false
+ })
+ this.props.showNotification(response.data.message)
+ }
})
.catch(function (error) {
console.log(error);
@@ -923,6 +931,7 @@ class ShixunHomework extends Component{
course_modules,
shixunpath,
order,
+ antIcon,
}=this.state;
let main_id=this.props.match.params.main_id;
@@ -938,6 +947,7 @@ class ShixunHomework extends Component{
modalSave={this.state.ModalSave}
modalsBottomval={this.state.ModalsBottomval}
loadtype={this.state.Loadtype}
+ antIcon={this.state.antIcon}
/>:""}
{/*立即发布*/}
{visible===true?
Date: Fri, 30 Aug 2019 10:01:44 +0800
Subject: [PATCH 14/26] =?UTF-8?q?=E8=B0=83=E6=95=B4=E7=A7=BB=E5=8A=A8?=
=?UTF-8?q?=E8=87=B3=20=E9=83=BD=E5=8A=A0=E4=B8=8A=E9=BB=98=E8=AE=A4?=
=?UTF-8?q?=E6=8F=90=E7=A4=BA?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../src/modules/courses/Resource/index.js | 4 +-
.../react/src/modules/courses/boards/index.js | 2 +-
.../modules/courses/members/studentsList.js | 2 +-
.../courses/shixunHomework/shixunHomework.js | 6 +-
.../TPMUpdatepropaede/TPMUpdatepropaede.js | 134 +++---------------
5 files changed, 23 insertions(+), 125 deletions(-)
diff --git a/public/react/src/modules/courses/Resource/index.js b/public/react/src/modules/courses/Resource/index.js
index 8d9d3aa44..0e2cd7a86 100644
--- a/public/react/src/modules/courses/Resource/index.js
+++ b/public/react/src/modules/courses/Resource/index.js
@@ -838,7 +838,7 @@ class Fileslists extends Component{
{course_modules&&course_modules.course_modules.map((item,key)=>{
return(
- filesId&&filesId===item.id?"": this.moveTos(0)}>{item.module_name}
+ filesId&&filesId===item.id?"": this.moveTos(0)} title={item.module_name}>{item.module_name}
)
})}
@@ -848,7 +848,7 @@ class Fileslists extends Component{
return (!this.state.dirSearchValue || item.name.indexOf(this.state.dirSearchValue) != -1)
}).map((itm,k)=>{
return(
- filesId&&filesId===itm.id?"": this.moveTos(itm.id )}>{itm.name}
+ filesId&&filesId===itm.id?"": this.moveTos(itm.id )} title={itm.name}>{itm.name}
)
})
})}
diff --git a/public/react/src/modules/courses/boards/index.js b/public/react/src/modules/courses/boards/index.js
index dbb6dea1c..572c8dd63 100644
--- a/public/react/src/modules/courses/boards/index.js
+++ b/public/react/src/modules/courses/boards/index.js
@@ -387,7 +387,7 @@ class Boards extends Component{
boards && boards.filter((item)=> {
return item.id != bid && (!this.state.dirSearchValue || item.name.indexOf(this.state.dirSearchValue) != -1)
}).map( (item) => {
- return this.moveTo(item)}>{item.name}
+ return this.moveTo(item)} title={item.name}>{item.name}
})
}
{ isAdmin &&
diff --git a/public/react/src/modules/courses/members/studentsList.js b/public/react/src/modules/courses/members/studentsList.js
index 096d19402..3726704cb 100644
--- a/public/react/src/modules/courses/members/studentsList.js
+++ b/public/react/src/modules/courses/members/studentsList.js
@@ -650,7 +650,7 @@ class studentsList extends Component{
return item.id != course_group_id && (!this.state.groupSearchValue || item.name.indexOf(this.state.groupSearchValue) != -1)
}).map( item => {
return (
- this.moveToGroup(item)}>{item.name}
+ this.moveToGroup(item)} title={item.name}>{item.name}
)
}) }
{ isAdmin &&
diff --git a/public/react/src/modules/courses/shixunHomework/shixunHomework.js b/public/react/src/modules/courses/shixunHomework/shixunHomework.js
index bf59380f5..dd5a93534 100644
--- a/public/react/src/modules/courses/shixunHomework/shixunHomework.js
+++ b/public/react/src/modules/courses/shixunHomework/shixunHomework.js
@@ -1100,7 +1100,7 @@ class ShixunHomework extends Component{
{course_modules&&course_modules.main_category.map((item,key)=>{
return(
- datas&&datas.category_id===null?"": this.moveTos(item.main_category_id)}>{item.main_category_name}
+ datas&&datas.category_id===null?"": this.moveTos(item.main_category_id)} title={item.main_category_name}>{item.main_category_name}
)
})}
@@ -1109,10 +1109,10 @@ class ShixunHomework extends Component{
return (!this.state.dirSearchValue || item.category_name.indexOf(this.state.dirSearchValue) != -1)
}).map( (item,key) => {
if(datas&&datas.category_id!=null&&datas&&datas.category_id===item.category_id===false){
- return this.moveTos(item.category_id )}>{item.category_name}
+ return this.moveTos(item.category_id )} title={item.category_name}>{item.category_name}
}
if(datas&&datas.category_id===null){
- return this.moveTos(item.category_id )}>{item.category_name}
+ return this.moveTos(item.category_id )} title={item.category_name}>{item.category_name}
}
})}
diff --git a/public/react/src/modules/tpm/TPMUpdatepropaede/TPMUpdatepropaede.js b/public/react/src/modules/tpm/TPMUpdatepropaede/TPMUpdatepropaede.js
index 835debddb..a847c4125 100644
--- a/public/react/src/modules/tpm/TPMUpdatepropaede/TPMUpdatepropaede.js
+++ b/public/react/src/modules/tpm/TPMUpdatepropaede/TPMUpdatepropaede.js
@@ -4,139 +4,43 @@ import {Input, Select, Radio, Checkbox, Popconfirm, message, Modal} from 'antd';
import {BrowserRouter as Router, Route, Link, Switch} from "react-router-dom";
-// import "antd/dist/antd.css";
-
import axios from 'axios';
+import TPMMDEditor from '../../tpm/challengesnew/TPMMDEditor';
+
import {getUrl} from 'educoder';
-let origin = getUrl();
-
-let path = getUrl("/editormd/lib/")
-
-const $ = window.$;
-
-let timeout;
-
-let currentValue;
-
-const Option = Select.Option;
-
-const RadioGroup = Radio.Group;
-
-function create_editorMD(id, width, high, placeholder, imageUrl, callback) {
- var editorName = window.editormd(id, {
- width: width,
- height: high,
- path: path, // "/editormd/lib/"
-
- syncScrolling: "single",
- tex: true,
- tocm: true,
- emoji: true,
- taskList: true,
- codeFold: true,
- searchReplace: true,
- htmlDecode: "style,script,iframe",
- sequenceDiagram: true,
- autoFocus: false,
- toolbarIcons: function () {
- // Or return editormd.toolbarModes[name]; // full, simple, mini
- // Using "||" set icons align right.
- return ["bold", "italic", "|", "list-ul", "list-ol", "|", "code", "code-block", "|", "testIcon", "testIcon1", '|', "image", "table", '|', "watch", "clear"]
- },
- toolbarCustomIcons: {
- testIcon: "",
- testIcon1: ""
- },
- //这个配置在simple.html中并没有,但是为了能够提交表单,使用这个配置可以让构造出来的HTML代码直接在第二个隐藏的textarea域中,方便post提交表单。
- saveHTMLToTextarea: true,
- // 用于增加自定义工具栏的功能,可以直接插入HTML标签,不使用默认的元素创建图标
- dialogMaskOpacity: 0.6,
- placeholder: placeholder,
- imageUpload: true,
- imageFormats: ["jpg", "jpeg", "gif", "png", "bmp", "webp", "JPG", "JPEG", "GIF", "PNG", "BMP", "WEBP"],
- imageUploadURL: imageUrl,//url
- onload: function () {
- // this.previewing();
- $("#" + id + " [type=\"latex\"]").bind("click", function () {
- editorName.cm.replaceSelection("```latex");
- editorName.cm.replaceSelection("\n");
- editorName.cm.replaceSelection("\n");
- editorName.cm.replaceSelection("```");
- var __Cursor = editorName.cm.getDoc().getCursor();
- editorName.cm.setCursor(__Cursor.line - 1, 0);
- });
-
- $("#" + id + " [type=\"inline\"]").bind("click", function () {
- editorName.cm.replaceSelection("$$$$");
- var __Cursor = editorName.cm.getDoc().getCursor();
- editorName.cm.setCursor(__Cursor.line, __Cursor.ch - 2);
- editorName.cm.focus();
- });
- $("[type=\"inline\"]").attr("title", "行内公式");
- $("[type=\"latex\"]").attr("title", "多行公式");
-
- window.md_elocalStorage(editorName, `UpdatepropaedeMDs_${id}`, "UpdatepropaedeMDs");
-
- callback && callback()
- }
- });
- return editorName;
-}
export default class TPMUpdatepropaede extends Component {
constructor(props) {
super(props)
+ this.neweditanswerRef=React.createRef();
this.state = {
- shixunId:undefined
+ shixunId:undefined,
}
}
- updatepropaedeMD(initValue, id) {
-
- this.contentChanged = false;
- const placeholder = "";
- // amp;
- // 编辑时要传memoId
- const imageUrl = `/api/attachments.json`;
- // 创建editorMd
-
- const Updatepropaede_editormd = create_editorMD(id, '100%', 400, placeholder, imageUrl, () => {
- setTimeout(() => {
- Updatepropaede_editormd.resize()
- Updatepropaede_editormd.cm && Updatepropaede_editormd.cm.refresh()
- }, 500)
-
- if (initValue != undefined) {
- Updatepropaede_editormd.setValue(initValue)
- }
- Updatepropaede_editormd.cm.on("change", (_cm, changeObj) => {
- console.log('....contentChanged')
- this.contentChanged = true;
- })
- });
- this.Updatepropaede_editormd = Updatepropaede_editormd;
- window.Updatepropaede_editormd = Updatepropaede_editormd;
- }
-
componentDidMount() {
let id = this.props.match.params.shixunId;
let url="/shixuns/"+id+"/propaedeutics.json";
axios.get(url).then((response) => {
- console.log(response)
if (response.data.status === 403||response.data.status === 401||response.data.status === 500) {
}else{
this.setState({
- shixunId:id
+ shixunId:id,
})
-
if(response.data.content[0]!=null){
- this.updatepropaedeMD(response.data.content, "UpdatepropaedeMD");
+ this.setState({
+ editanswersRefval:response.data.content,
+ })
+ this.neweditanswerRef.current.setValue(response.data.content)
}else{
- this.updatepropaedeMD("", "UpdatepropaedeMD");
+ this.setState({
+ editanswersRefval:"",
+ })
+ this.neweditanswerRef.current.setValue('')
}
}
}).catch((error) => {
@@ -148,7 +52,7 @@ export default class TPMUpdatepropaede extends Component {
updatepropaedeuticsvalue=()=>{
let id = this.props.match.params.shixunId;
let url="/shixuns/"+id+"/update_propaedeutics.json";
- const update_propaedeuticsvalue = this.Updatepropaede_editormd.getValue();
+ const update_propaedeuticsvalue = this.editanswersRef.current.getValue().trim();
axios.post(url,{
content:update_propaedeuticsvalue
}
@@ -163,10 +67,7 @@ export default class TPMUpdatepropaede extends Component {
});
}
render() {
-
let {shixunId} = this.state;
-
-
return (
@@ -178,11 +79,8 @@ export default class TPMUpdatepropaede extends Component {
From 703039d145a5f547ee36bbb12b0cd3d9fece5f34 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, 30 Aug 2019 10:06:51 +0800
Subject: [PATCH 15/26] =?UTF-8?q?=E5=88=A0=E9=99=A4=E5=AD=90=E7=9B=AE?=
=?UTF-8?q?=E5=BD=95=20=E5=8A=A0=E8=BD=BD=E8=B0=83=E6=95=B4?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../src/modules/courses/coursesDetail/CoursesLeftNav.js | 8 ++++++--
1 file changed, 6 insertions(+), 2 deletions(-)
diff --git a/public/react/src/modules/courses/coursesDetail/CoursesLeftNav.js b/public/react/src/modules/courses/coursesDetail/CoursesLeftNav.js
index cc29cb2a0..1a7c19824 100644
--- a/public/react/src/modules/courses/coursesDetail/CoursesLeftNav.js
+++ b/public/react/src/modules/courses/coursesDetail/CoursesLeftNav.js
@@ -56,7 +56,8 @@ class Coursesleftnav extends Component{
positiontype:undefined,
toopvisible:false,
toopvisibleindex:undefined,
- sandiantypes:undefined
+ sandiantypes:undefined,
+ antIcon:false
}
}
@@ -582,7 +583,9 @@ class Coursesleftnav extends Component{
}
deletenavchilds=(url,mainurl)=>{
-
+ this.setState({
+ antIcon:true
+ })
axios.delete(url).then((result)=>{
if(result.data.status===0){
@@ -809,6 +812,7 @@ class Coursesleftnav extends Component{
modalSave={ModalSave}
modalCancel={this.cannerNavmoda}
loadtype={loadtype}
+ antIcon={this.state.antIcon}
>
From 651677f9197a69b6666260ec51f2d2a8f8566ce4 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E6=9D=A8=E6=A0=91=E6=9E=97?= <904079904@qq.com>
Date: Fri, 30 Aug 2019 10:10:19 +0800
Subject: [PATCH 16/26] =?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/courses/poll/PollNew.js | 15 +++++++++++++--
1 file changed, 13 insertions(+), 2 deletions(-)
diff --git a/public/react/src/modules/courses/poll/PollNew.js b/public/react/src/modules/courses/poll/PollNew.js
index 33a85bf0e..171a27c5e 100644
--- a/public/react/src/modules/courses/poll/PollNew.js
+++ b/public/react/src/modules/courses/poll/PollNew.js
@@ -2146,8 +2146,19 @@ class PollNew extends Component {
} else {
for (var i = 0; i < arr.length; i++) {
if (index === i) {
- arr[i].question.min_choices = parseInt(value);
- arr[i].question.max_choices = length;
+ try {
+ if(parseInt(value)===0){
+ arr[i].question.min_choices = 2;
+ arr[i].question.max_choices = length;
+ }else{
+ arr[i].question.min_choices = parseInt(value);
+ arr[i].question.max_choices = length;
+ }
+ }catch (e) {
+ arr[i].question.min_choices = 2;
+ arr[i].question.max_choices = length;
+ }
+ break;
}
}
this.setState({
From 35f12021968ec33b0a85ae4180b0c8c2e1bb83d5 Mon Sep 17 00:00:00 2001
From: p31729568