From 6f12e3de097841e7c70b77448c7189da65e39932 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E6=9D=A8=E6=A0=91=E6=9E=97?= <904079904@qq.com>
Date: Wed, 11 Mar 2020 16:43:39 +0800
Subject: [PATCH 1/3] =?UTF-8?q?=E8=B0=83=E6=95=B4?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../src/modules/question/Questionitem_banks.js | 3 ++-
.../modules/question/component/ChoquesEditor.js | 12 ++++++++++++
.../question/component/JudquestionEditor.js | 15 +++++++++++++++
.../modules/question/component/SingleEditor.js | 12 ++++++++++++
4 files changed, 41 insertions(+), 1 deletion(-)
diff --git a/public/react/src/modules/question/Questionitem_banks.js b/public/react/src/modules/question/Questionitem_banks.js
index 345ca9753..503e6f5de 100644
--- a/public/react/src/modules/question/Questionitem_banks.js
+++ b/public/react/src/modules/question/Questionitem_banks.js
@@ -529,6 +529,7 @@ class Questionitem_banks extends Component {
}
handleShowUploadImage=(url)=>{
+ debugger
this.setState({
url:url
})
@@ -550,7 +551,7 @@ class Questionitem_banks extends Component {
>
{url?
- this.handleClose()}>
+ this.handleClose()}>
:
""
}
diff --git a/public/react/src/modules/question/component/ChoquesEditor.js b/public/react/src/modules/question/component/ChoquesEditor.js
index 3277f03c9..82cd7b1b4 100644
--- a/public/react/src/modules/question/component/ChoquesEditor.js
+++ b/public/react/src/modules/question/component/ChoquesEditor.js
@@ -176,7 +176,16 @@ class ChoquesEditor extends Component{
onCancel = () => {
this.props.onEditorCancel()
}
+ handleShowUploadImages=(url)=>{
+ this.setState({
+ url:url,
+ })
+ try {
+ this.props.handleShowUploadImage(url)
+ }catch (e) {
+ }
+ }
handleShowUploadImage = (url,i) => {
this.setState({
@@ -466,6 +475,8 @@ class ChoquesEditor extends Component{
options={options}
value={question_title}
onContentChange={this.onContentChange}
+ showUploadImage={(url)=>this.handleShowUploadImages(url)}
+
/>
@@ -577,6 +588,7 @@ class ChoquesEditor extends Component{
options={options}
value={question_titles}
onContentChange={this.onContentChanges}
+ showUploadImage={(url)=>this.handleShowUploadImages(url)}
/>
diff --git a/public/react/src/modules/question/component/JudquestionEditor.js b/public/react/src/modules/question/component/JudquestionEditor.js
index ab7e930b1..baea3391f 100644
--- a/public/react/src/modules/question/component/JudquestionEditor.js
+++ b/public/react/src/modules/question/component/JudquestionEditor.js
@@ -58,6 +58,7 @@ class JudquestionEditor extends Component{
zqda:null,
item_banksedit:[],
mychoicess:[],
+ url:''
}
}
addOption = () => {
@@ -334,6 +335,16 @@ class JudquestionEditor extends Component{
}
}
}
+ handleShowUploadImages=(url)=>{
+ this.setState({
+ url:url,
+ })
+ try {
+ this.props.handleShowUploadImage(url)
+ }catch (e) {
+
+ }
+ }
onContentChanges=(value,quill)=>{
const _text = quill.getText();
const reg = /^[\s\S]*.*[^\s][\s\S]*$/;
@@ -437,6 +448,8 @@ class JudquestionEditor extends Component{
options={options}
value={question_title}
onContentChange={this.onContentChange}
+ showUploadImage={(url)=>this.handleShowUploadImages(url)}
+
/>
@@ -487,6 +500,8 @@ class JudquestionEditor extends Component{
options={options}
value={question_titles}
onContentChange={this.onContentChanges}
+ showUploadImage={(url)=>this.handleShowUploadImages(url)}
+
/>
diff --git a/public/react/src/modules/question/component/SingleEditor.js b/public/react/src/modules/question/component/SingleEditor.js
index b34bfa9bb..06b057c82 100644
--- a/public/react/src/modules/question/component/SingleEditor.js
+++ b/public/react/src/modules/question/component/SingleEditor.js
@@ -251,6 +251,16 @@ class SingleEditor extends Component{
// standard_answers[index] = !standard_answers[index];
this.setState({ standard_answers })
}
+ handleShowUploadImages=(url)=>{
+ this.setState({
+ url:url,
+ })
+ try {
+ this.props.handleShowUploadImage(url)
+ }catch (e) {
+
+ }
+ }
handleShowUploadImage = (url,i) => {
@@ -494,6 +504,7 @@ class SingleEditor extends Component{
options={options}
value={question_title}
onContentChange={this.onContentChange}
+ showUploadImage={(url)=>this.handleShowUploadImages(url)}
/>
@@ -603,6 +614,7 @@ class SingleEditor extends Component{
options={options}
value={question_titles}
onContentChange={this.onContentChanges}
+ showUploadImage={(url)=>this.handleShowUploadImages(url)}
/>
From e39f7e9f0c2883df3e550a0ba8d7bbfaa602caac Mon Sep 17 00:00:00 2001
From: caicai8 <1149225589@qq.com>
Date: Wed, 11 Mar 2020 17:13:42 +0800
Subject: [PATCH 2/3] =?UTF-8?q?=E5=AD=A6=E9=99=A2=E7=BB=9F=E8=AE=A1?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
public/react/src/college/College.js | 12 ++++++------
1 file changed, 6 insertions(+), 6 deletions(-)
diff --git a/public/react/src/college/College.js b/public/react/src/college/College.js
index 15b0e82f8..bc8f2a3a2 100644
--- a/public/react/src/college/College.js
+++ b/public/react/src/college/College.js
@@ -907,7 +907,7 @@ class College extends Component {
{
- teachers_count?
+ teachers_count || teachers_count===0?
{teachers_count}人
:
@@ -915,7 +915,7 @@ class College extends Component {
{
- students_count?
+ students_count || students_count===0?
{students_count}人
:
@@ -923,7 +923,7 @@ class College extends Component {
{
- courses_count?
+ courses_count || courses_count === 0?
{courses_count}个
:
@@ -931,7 +931,7 @@ class College extends Component {
{
- shixuns_count?
+ shixuns_count || shixuns_count === 0?
{shixuns_count}个
:
@@ -939,7 +939,7 @@ class College extends Component {
{
- shixun_report_count?
+ shixun_report_count || shixun_report_count===0?
{shixun_report_count}个
:
@@ -947,7 +947,7 @@ class College extends Component {
{
- shixun_time?
+ shixun_time || shixun_time === 0 ?
{shixun_time}天
:
From 1ccb16f76d8235e6ec29de8590aae3b4aa35c106 Mon Sep 17 00:00:00 2001
From: daiao <358551898@qq.com>
Date: Wed, 11 Mar 2020 17:34:38 +0800
Subject: [PATCH 3/3] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E7=B4=A2=E5=BC=95?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
...311092049_add_index_user_id_challenge_id_for_games.rb | 9 +++++++++
1 file changed, 9 insertions(+)
create mode 100644 db/migrate/20200311092049_add_index_user_id_challenge_id_for_games.rb
diff --git a/db/migrate/20200311092049_add_index_user_id_challenge_id_for_games.rb b/db/migrate/20200311092049_add_index_user_id_challenge_id_for_games.rb
new file mode 100644
index 000000000..c9fab49d4
--- /dev/null
+++ b/db/migrate/20200311092049_add_index_user_id_challenge_id_for_games.rb
@@ -0,0 +1,9 @@
+class AddIndexUserIdChallengeIdForGames < ActiveRecord::Migration[5.2]
+ def change
+ delete_games = Game.where.not(myshixun_id: Myshixun.all).reorder(nil)
+ puts "delete_games: #{delete_games.pluck(:id)}"
+ delete_games.destroy_all
+
+ add_index :games, [:user_id, :challenge_id], unique: true
+ end
+end