diff --git a/app/assets/javascripts/common.js b/app/assets/javascripts/common.js
index fa7bef244..dc0818b64 100644
--- a/app/assets/javascripts/common.js
+++ b/app/assets/javascripts/common.js
@@ -1,5 +1,6 @@
function createMDEditor(element, opts){
var defaults = {
+ height: 600,
path: '/editormd/lib/',
syncScrolling: "single",
tex: true,
diff --git a/app/controllers/games_controller.rb b/app/controllers/games_controller.rb
index ac72577e0..916f09430 100644
--- a/app/controllers/games_controller.rb
+++ b/app/controllers/games_controller.rb
@@ -67,13 +67,19 @@ class GamesController < ApplicationController
uri = "#{shixun_tomcat}/bridge/vnc/getvnc"
params = {tpiID: @myshixun.id, :containers => "#{Base64.urlsafe_encode64(shixun_container_limit(@shixun))}"}
res = uri_post uri, params
+ logger.info("###############---- ")
if res && res['code'].to_i != 0
raise("实训云平台繁忙(繁忙等级:99)")
end
- # 无域名版本
- #@vnc_url = "http://#{service_host}:#{res['port']}/vnc_lite.html?password=headless"
- # 有域名版本
- @vnc_url = "https://#{res['port']}.#{service_host}/vnc_lite.html?password=headless"
+
+ if request.subdomain == "pre-newweb"
+ # 无域名版本
+ @vnc_url = "http://#{service_host}:#{res['port']}/vnc_lite.html?password=headless"
+ else
+ # 有域名版本
+ @vnc_url = "https://#{res['port']}.#{service_host}/vnc_lite.html?password=headless"
+ end
+
@vnc_evaluate = @shixun.vnc_evaluate
rescue Exception => e
Rails.logger.error(e.message)
diff --git a/app/controllers/question_banks_controller.rb b/app/controllers/question_banks_controller.rb
index e7be8b395..b4e98e05f 100644
--- a/app/controllers/question_banks_controller.rb
+++ b/app/controllers/question_banks_controller.rb
@@ -265,6 +265,7 @@ class QuestionBanksController < ApplicationController
# exercise.update_column(:quotes, exercise.quotes+1)
# end
new_exercise if new_exercise.save!
+ exercise.update_column(:quotes, exercise.quotes+1)
end
end
@@ -292,6 +293,7 @@ class QuestionBanksController < ApplicationController
# poll.update_column(:quotes, poll.quotes+1)
# end
new_poll if new_poll.save!
+ poll.update_column(:quotes, poll.quotes+1)
end
end
diff --git a/app/controllers/shixuns_controller.rb b/app/controllers/shixuns_controller.rb
index 180c269b5..79e182fef 100644
--- a/app/controllers/shixuns_controller.rb
+++ b/app/controllers/shixuns_controller.rb
@@ -448,6 +448,7 @@ class ShixunsController < ApplicationController
ShixunMirrorRepository.create(:shixun_id => @shixun.id, :mirror_repository_id => mirror)
end
end
+ logger.info("#########shixun_params#{shixun_params}")
@shixun.update_attributes(shixun_params)
logger.info("##########shixun_info_params: #{shixun_info_params}")
logger.info("##########params[:shixun_info][:evaluate_script]: #{params[:shixun_info][:evaluate_script]}")
diff --git a/app/models/gtopic_bank.rb b/app/models/gtopic_bank.rb
index af5b267a6..609219711 100644
--- a/app/models/gtopic_bank.rb
+++ b/app/models/gtopic_bank.rb
@@ -1,7 +1,7 @@
class GtopicBank < ApplicationRecord
belongs_to :user
- belongs_to :graduation_topic
- belongs_to :course_list
+ belongs_to :graduation_topic, optional: true
+ belongs_to :course_list, optional: true
has_many :attachments, as: :container, dependent: :destroy
has_many :graduation_topics, dependent: :nullify
diff --git a/app/models/user_extension.rb b/app/models/user_extension.rb
index 5a0dc8a37..98afcb165 100644
--- a/app/models/user_extension.rb
+++ b/app/models/user_extension.rb
@@ -1,6 +1,6 @@
class UserExtension < ApplicationRecord
# identity 0: 教师教授 1: 学生, 2: 专业人士, 3: 开发者
- enum identity: { teacher: 0, student: 1, professional: 2, developer: 3 }
+ enum identity: { teacher: 0, student: 1, professional: 2, developer: 3, cnmooc: 4, unselect: -1 }
belongs_to :user, touch: true
belongs_to :school, optional: true
diff --git a/db/migrate/20190907021100_migrate_bank_reference_id.rb b/db/migrate/20190907021100_migrate_bank_reference_id.rb
new file mode 100644
index 000000000..c71034167
--- /dev/null
+++ b/db/migrate/20190907021100_migrate_bank_reference_id.rb
@@ -0,0 +1,31 @@
+class MigrateBankReferenceId < ActiveRecord::Migration[5.2]
+ def change
+ HomeworkBank.all.each do |bank|
+ if bank.homework_common
+ bank.homework_common.update_column("homework_bank_id", bank.id) if bank.homework_common.homework_bank_id.nil?
+ end
+ end
+
+ GtopicBank.all.each do |bank|
+ if bank.graduation_topic
+ bank.graduation_topic.update_column("gtopic_bank_id", bank.id) if bank.graduation_topic.gtopic_bank_id.nil?
+ end
+ end
+
+ GtaskBank.all.each do |bank|
+ if bank.graduation_task
+ bank.graduation_task.update_column("gtask_bank_id", bank.id) if bank.graduation_task.gtask_bank_id.nil?
+ end
+ end
+
+ ExerciseBank.all.each do |bank|
+ if bank.container_type == 'Exercise'
+ exercise = Exercise.find_by(id: bank.container_id)
+ exercise.update_column("exercise_bank_id", bank.id) if exercise && exercise.exercise_bank_id.nil?
+ elsif bank.container_type == 'Poll'
+ poll = Poll.find_by(id: bank.container_id)
+ poll.update_column("exercise_bank_id", bank.id) if poll && poll.exercise_bank_id.nil?
+ end
+ end
+ end
+end
diff --git a/public/images/educoder/path.png b/public/images/educoder/path.png
index d29dae522..1461d47e6 100644
Binary files a/public/images/educoder/path.png and b/public/images/educoder/path.png differ
diff --git a/public/react/src/images/path/path.png b/public/react/src/images/path/path.png
index 594358959..1461d47e6 100644
Binary files a/public/react/src/images/path/path.png and b/public/react/src/images/path/path.png differ
diff --git a/public/react/src/modules/courses/busyWork/common/TabRightComponents.js b/public/react/src/modules/courses/busyWork/common/TabRightComponents.js
index 34044330d..25ae55203 100644
--- a/public/react/src/modules/courses/busyWork/common/TabRightComponents.js
+++ b/public/react/src/modules/courses/busyWork/common/TabRightComponents.js
@@ -63,7 +63,7 @@ class TabRightComponents extends Component{
})
}
}else {
- this.props.slowDownload(url)
+ this.props.slowDownload(url);
// this.props.showNotification(`正在下载中`);
// window.open("/api"+url, '_blank');
}
diff --git a/public/react/src/modules/courses/poll/PollNewQuestbank.js b/public/react/src/modules/courses/poll/PollNewQuestbank.js
index b38bfccfd..ad68530e7 100644
--- a/public/react/src/modules/courses/poll/PollNewQuestbank.js
+++ b/public/react/src/modules/courses/poll/PollNewQuestbank.js
@@ -302,7 +302,7 @@ class PollNewQuestbank extends Component {
{content:'编辑'}
]
}
- this.props.initPublic(crumbData,response.data);
+ this.props.initPublic(crumbData,result.data);
}catch (e) {
}
diff --git a/public/react/src/modules/courses/shixunHomework/Listofworksstudentone.js b/public/react/src/modules/courses/shixunHomework/Listofworksstudentone.js
index 3db3846fe..71ce6a4ea 100644
--- a/public/react/src/modules/courses/shixunHomework/Listofworksstudentone.js
+++ b/public/react/src/modules/courses/shixunHomework/Listofworksstudentone.js
@@ -67,7 +67,7 @@ class Listofworksstudentone extends Component {
pages: 1,
limit: 20,
loadingstate: true,
- order: "update_time",
+ order: "",
search: null,
day: 0,
hour: 0,
@@ -130,30 +130,30 @@ class Listofworksstudentone extends Component {
{record.name === undefined ?
--
:
record.name === "" ?
--
:
record.name === null ?
--
:
record.name === "--" ?
--
:
{record.name}
}
@@ -167,24 +167,23 @@ class Listofworksstudentone extends Component {
key: 'stduynumber',
align: "center",
className:'font-14 maxnamewidth110',
- width:'110px',
render: (text, record) => (
{record.stduynumber === undefined ?
--
: record.stduynumber === null ?
--
: record.stduynumber === "" ?
--
@@ -193,8 +192,8 @@ class Listofworksstudentone extends Component {
title={record.stduynumber}
className="maxnamewidth110"
style={{
- color: '#9A9A9A',
- textAlign: "center"
+ "color": '#9A9A9A',
+ textAlign: "center"
}}>{
record.stduynumber
}
@@ -214,7 +213,7 @@ class Listofworksstudentone extends Component {
render: (text, record) => (
{record.classroom === undefined ? "--" : record.classroom === "" ? "--" : record.classroom === null ? "--" : record.classroom}
@@ -229,10 +228,10 @@ class Listofworksstudentone extends Component {
render: (text, record) => (
{record.submitstate === undefined ? "--" : record.submitstate === "" ? "--" : record.submitstate === null ? "--" : record.submitstate}
@@ -251,26 +250,37 @@ class Listofworksstudentone extends Component {
color: '#747A7F',
textAlign: "center"
}
- }>{record.cost_time === null ? "--":record.cost_time === undefined ?"--":record.cost_time }
-
+ }>
+ {record.cost_time === null? "--":record.cost_time === undefined?"--":
+ {record.cost_time === null ? "--":record.cost_time === undefined ?"--":record.cost_time}
+
+ }
+
)
},
- {
- title: '更新时间',
- dataIndex: 'updatetime',
- key: 'updatetime',
- align: "center",
- className:'font-14',
- render: (text, record) => (
-
- {record.updatetime === undefined ? "--" : record.updatetime === "" ? "--" : record.updatetime}
-
- ),
- },
+ // {
+ // title: '更新时间',
+ // dataIndex: 'updatetime',
+ // key: 'updatetime',
+ // align: "center",
+ // className:'font-14',
+ // render: (text, record) => (
+ //
+ // {record.updatetime === undefined ? "--" : record.updatetime === "" ? "--" : record.updatetime}
+ //
+ // ),
+ // },
{
title: '完成情况',
dataIndex: 'completion',
@@ -279,7 +289,7 @@ class Listofworksstudentone extends Component {
className:'font-14',
render: (text, record) => (
- {record.completion+"/"+this.state.challenges_count}
+ {record.completion+"/"+this.state.challenges_count}
),
},
@@ -379,7 +389,7 @@ class Listofworksstudentone extends Component {
},
],
- orders: "update_time",
+ orders: "",
b_order:"desc",
allow_late:false,
checkedValuesine: undefined,
@@ -395,8 +405,8 @@ class Listofworksstudentone extends Component {
course_group: null,
publish_immediately: undefined,
end_immediately: undefined,
- mystyle: {"display": "block", color: '#07111B', textAlign: "center"},
- mystyles: {"display": "none", color: '#07111B', textAlign: "center"},
+ mystyle: {"display": "block", "color": '#07111B', textAlign: "center"},
+ mystyles: {"display": "none", "color": '#07111B', textAlign: "center"},
mystyle1: {"display": "block"},
mystyles1: {"display": "none"},
unlimited: 0,
@@ -413,7 +423,7 @@ class Listofworksstudentone extends Component {
align: 'center',
className:'font-14',
render: (text, record) => (
- {record.number}
+ {record.number}
)
},
@@ -425,7 +435,7 @@ class Listofworksstudentone extends Component {
className:'font-14 maxnamewidth100',
width:'100px',
render: (text, record) => (
- {record.name}
+ {record.name}
)
},
{
@@ -434,7 +444,6 @@ class Listofworksstudentone extends Component {
key: 'stduynumber',
align: "center",
className:'font-14 maxnamewidth110',
- width:'110px',
render: (text, record) => (
{record.stduynumber === undefined ?
@@ -480,7 +489,7 @@ class Listofworksstudentone extends Component {
className:'font-14',
render: (text, record) => (
- {record.classroom === undefined ? -- : record.classroom === "" ? --: record.classroom === null ? -- : {record.classroom}}
+ {record.classroom === undefined ? -- : record.classroom === "" ? --: record.classroom === null ? -- : {record.classroom}}
)
},
@@ -514,21 +523,41 @@ class Listofworksstudentone extends Component {
color: '#747A7F',
textAlign: "center"
}
- }>{record.cost_time === null ? "--":record.cost_time === undefined ?"--":record.cost_time }
-
+ }>
+ {record.cost_time === null? "--":record.cost_time === undefined?"--":
+ {record.cost_time === null ? "--":record.cost_time === undefined ?"--":record.cost_time}
+
+ }
+
+ // {record.cost_time === null ? "--":record.cost_time === undefined ?"--":record.cost_time }
+ //
)
},
- {
- title: '更新时间',
- dataIndex: 'updatetime',
- key: 'updatetime',
- align: 'center',
- className:'font-14',
- render: (text, record) => (
- {record.updatetime}
- ),
- },
+ // {
+ // title: '更新时间',
+ // dataIndex: 'updatetime',
+ // key: 'updatetime',
+ // align: 'center',
+ // className:'font-14',
+ // render: (text, record) => (
+ // {record.updatetime}
+ // ),
+ // },
{
title: '完成情况',
dataIndex: 'completion',
@@ -541,7 +570,7 @@ class Listofworksstudentone extends Component {