Merge remote-tracking branch 'origin/dev_aliyun' into dev_aliyun

dev_tpm_ui
杨树明 5 years ago
commit bea85d88db

@ -400,7 +400,7 @@ class ApplicationController < ActionController::Base
end
rescue Exception => e
uid_logger("--uri_exec: exception #{e.message}")
raise Educoder::TipException.new("实训平台繁忙繁忙等级84")
raise Educoder::TipException.new(message)
end
end
@ -603,7 +603,7 @@ class ApplicationController < ActionController::Base
end
def paginate(relation)
limit = params[:limit].to_i.zero? ? 20 : params[:limit].to_i
limit = (params[:limit].to_i.zero? || params[:limit].to_i > 20) ? 20 : params[:limit].to_i
page = params[:page].to_i.zero? ? 1 : params[:page].to_i
offset = (page - 1) * limit

@ -100,7 +100,7 @@ class HacksController < ApplicationController
@hack.update_attribute(:status, 1)
base_attrs = {
trigger_user_id: current_user.id, viewed: 0, tiding_type: 'System', user_id: @hack.user_id,
parent_container_type: "HackPublish"
parent_container_type: "HackPublish", extra: @hack.identifier
}
@hack.tidings.create!(base_attrs)
render_ok
@ -111,7 +111,7 @@ class HacksController < ApplicationController
@hack.update_attribute(:status, 0)
base_attrs = {
trigger_user_id: current_user.id, viewed: 0, tiding_type: 'System', user_id: @hack.user_id,
parent_container_type: "HackUnPublish"
parent_container_type: "HackUnPublish", extra: @hack.identifier
}
@hack.tidings.create!(base_attrs)
render_ok
@ -232,6 +232,11 @@ class HacksController < ApplicationController
hacks = hacks.where(category: params[:category])
end
# 语言
if params[:language]
hacks = hacks.joins(:hack_codes).where(hack_codes: {language: params[:language]})
end
# 排序
sort_by = params[:sort_by] || "hack_user_lastest_codes_count"
sort_direction = params[:sort_direction] || "desc"

@ -1046,7 +1046,7 @@ class HomeworkCommonsController < ApplicationController
course_module_id: course_module.id, position: course_module.course_second_categories.count + 1)
# 去掉不对当前用户的单位公开的实训,已发布的实训
stage.shixuns.where.not(shixuns: {id: none_shixun_ids}).unhidden.each do |shixun|
stage.shixuns.no_jupyter.where.not(shixuns: {id: none_shixun_ids}).unhidden.each do |shixun|
homework = HomeworksService.new.create_homework shixun, @course, category, current_user
@homework_ids << homework.id
CreateStudentWorkJob.perform_later(homework.id)

@ -4,7 +4,8 @@ class ShixunListsController < ApplicationController
end
private
def search_params
params.permit(:keyword, :type, :page, :limit, :order, :status, :diff, :sort)
params.permit(:keyword, :type, :page, :limit, :order, :status, :diff, :sort, :no_jupyter)
end
end

@ -772,7 +772,7 @@ class ShixunsController < ApplicationController
# jupyter开启挑战
def jupyter_exec
begin
if is_shixun_opening?
tip_show_exception(-3, "#{@shixun.opening_time.strftime('%Y-%m-%d %H:%M:%S')}")
end
@ -786,22 +786,23 @@ class ShixunsController < ApplicationController
commit_id = commit["id"]
cloud_bridge = edu_setting('cloud_bridge')
myshixun_identifier = generate_identifier Myshixun, 10
ActiveRecord::Base.transaction do
@myshixun = @shixun.myshixuns.create!(user_id: current_user.id, identifier: myshixun_identifier,
modify_time: @shixun.modify_time, reset_time: @shixun.reset_time,
onclick_time: Time.now, commit_id: commit_id)
# fork仓库
project_fork(@myshixun, @repo_path, current_user.login)
rep_url = Base64.urlsafe_encode64(repo_ip_url @repo_path)
uri = "#{cloud_bridge}/bridge/game/openGameInstance"
params = {tpiID: "#{@myshixun.id}", tpmGitURL: rep_url, tpiRepoName: @myshixun.repo_name.split("/").last}
interface_post uri, params, 83, "实训云平台繁忙繁忙等级83"
begin
ActiveRecord::Base.transaction do
@myshixun = @shixun.myshixuns.create!(user_id: current_user.id, identifier: myshixun_identifier,
modify_time: @shixun.modify_time, reset_time: @shixun.reset_time,
onclick_time: Time.now, commit_id: commit_id)
# fork仓库
project_fork(@myshixun, @repo_path, current_user.login)
rep_url = Base64.urlsafe_encode64(repo_ip_url @repo_path)
uri = "#{cloud_bridge}/bridge/game/openGameInstance"
params = {tpiID: "#{@myshixun.id}", tpmGitURL: rep_url, tpiRepoName: @myshixun.repo_name.split("/").last}
interface_post uri, params, 83, "服务器出现问题,请重置环境"
end
rescue => e
uid_logger_error(e.message)
tip_exception("服务器出现问题,请重置环境")
end
end
rescue => e
uid_logger_error(e.message)
tip_exception("服务器出现问题,请重置环境")
end
end
def publish

@ -255,7 +255,7 @@ class SubjectsController < ApplicationController
CourseSecondCategory.create!(name: stage.name, course_id: @course.id, category_type: "shixun_homework",
course_module_id: course_module.id, position: course_module.course_second_categories.count + 1)
stage.shixuns.where(id: params[:shixun_ids], status: 2).each do |shixun|
stage.shixuns.no_jupyter.where(id: params[:shixun_ids], status: 2).each do |shixun|
homework = HomeworksService.new.create_homework shixun, @course, category, current_user
homework_ids << homework.id
end

@ -226,7 +226,8 @@ module TidingDecorator
end
def discuss_content
I18n.t(locale_format(parent_container_type, container.parent_id.present?)) % message_content_helper(container.content)
I18n.t(locale_format(parent_container_type, container.parent_id.present?)) %
(parent_container_type == 'Hack' ? container.content : message_content_helper(container.content))
end
def grade_content

@ -53,18 +53,20 @@ class Discuss < ApplicationRecord
def send_tiding
if dis_type == 'Shixun'
user_id = has_parent? ? parent.user_id : Challenge.find(challenge_id).user_id
send_user_id = has_parent? ? parent.user_id : Challenge.find(challenge_id).user_id
parent_container_type = 'Challenge'
challenge_id = challenge_id
extra = ''
elsif dis_type == 'Hack'
user_id = has_parent? ? parent.user_id : Hack.find(dis_id).user_id
send_user_id = has_parent? ? parent.user_id : Hack.find(dis_id).user_id
parent_container_type = 'Hack'
challenge_id = dis_id
extra = HackUserLastestCode.where(user_id: user_id, hack_id: dis_id).first&.identifier
end
base_attrs = {
trigger_user_id: user_id, parent_container_id: challenge_id, parent_container_type: parent_container_type,
belong_container_id: dis_id, belong_container_type: dis_type, viewed: 0, tiding_type: 'Comment'
belong_container_id: dis_id, belong_container_type: dis_type, viewed: 0, tiding_type: 'Comment', extra: extra
}
tidings.create!(base_attrs.merge(user_id: user_id))
tidings.create!(base_attrs.merge(user_id: send_user_id))
end
end

@ -83,6 +83,7 @@ class Shixun < ApplicationRecord
scope :publiced, lambda{ where(public: 2) }
scope :field_for_recommend, lambda{ select([:id, :name, :identifier, :myshixuns_count]) }
scope :find_by_ids,lambda{|k| where(id:k)}
scope :no_jupyter, -> { where(is_jupyter: false) }
after_create :send_tiding
#同步到trustie

@ -9,7 +9,7 @@ module ElasticsearchAble
highlight: highlight_options,
body_options: body_options,
page: page,
per_page: per_page
per_page: 20
}
end
@ -37,7 +37,7 @@ module ElasticsearchAble
def per_page
per_page = params[:per_page].to_s.strip.presence || params[:limit].to_s.strip.presence
per_page.to_i <= 0 ? 20 : per_page.to_i
per_page.to_i <= 0 || per_page.to_i > 20 ? 20 : per_page.to_i
end
def page

@ -1,5 +1,5 @@
json.extract! tiding, :id, :status, :viewed, :user_id, :tiding_type, :container_id, :container_type,
:parent_container_id, :parent_container_type, :belong_container_id, :belong_container_type
:parent_container_id, :parent_container_type, :belong_container_id, :belong_container_type, :extra
json.content tiding.content
json.identifier tiding.identifier

@ -1806,6 +1806,12 @@
<div class="code-name">&amp;#xe70e;</div>
</li>
<li class="dib">
<span class="icon iconfont">&#xe710;</span>
<div class="name">复制</div>
<div class="code-name">&amp;#xe710;</div>
</li>
</ul>
<div class="article markdown">
<h2 id="unicode-">Unicode 引用</h2>
@ -4520,6 +4526,15 @@
</div>
</li>
<li class="dib">
<span class="icon iconfont icon-fuzhi3"></span>
<div class="name">
复制
</div>
<div class="code-name">.icon-fuzhi3
</div>
</li>
</ul>
<div class="article markdown">
<h2 id="font-class-">font-class 引用</h2>
@ -6917,6 +6932,14 @@
<div class="code-name">#icon-shitilan</div>
</li>
<li class="dib">
<svg class="icon svg-icon" aria-hidden="true">
<use xlink:href="#icon-fuzhi3"></use>
</svg>
<div class="name">复制</div>
<div class="code-name">#icon-fuzhi3</div>
</li>
</ul>
<div class="article markdown">
<h2 id="symbol-">Symbol 引用</h2>

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

@ -2076,6 +2076,13 @@
"font_class": "shitilan",
"unicode": "e70e",
"unicode_decimal": 59150
},
{
"icon_id": "12568379",
"name": "复制",
"font_class": "fuzhi3",
"unicode": "e710",
"unicode_decimal": 59152
}
]
}

@ -908,6 +908,9 @@ Created by iconfont
<glyph glyph-name="shitilan" unicode="&#59150;" d="M816.118519-128H184.019753c-69.530864 0-126.419753 56.888889-126.419753 126.419753V756.938272C57.6 826.469136 114.488889 883.358025 184.019753 883.358025h568.888889l189.62963-189.62963v-695.308642c0-69.530864-56.888889-126.419753-126.419753-126.419753zM727.624691 820.148148H184.019753c-37.925926 0-63.209877-25.283951-63.209876-63.209876v-758.518519c0-37.925926 25.283951-63.209877 63.209876-63.209876h632.098766c37.925926 0 63.209877 25.283951 63.209876 63.209876V668.444444L727.624691 820.148148zM955.180247 662.123457h-189.62963c-25.283951 0-44.246914 18.962963-44.246913 44.246913l6.320987 189.62963 227.555556-233.876543z m-170.666667 82.172839v-18.962963h18.962963l-18.962963 18.962963zM670.735802 567.308642H329.402469c-18.962963 0-31.604938 12.641975-31.604938 31.604938S310.439506 630.518519 329.402469 630.518519h341.333333c18.962963 0 31.604938-12.641975 31.604939-31.604939s-12.641975-31.604938-31.604939-31.604938zM670.735802 314.469136H329.402469c-18.962963 0-31.604938 12.641975-31.604938 31.604938S310.439506 377.679012 329.402469 377.679012h341.333333c18.962963 0 31.604938-12.641975 31.604939-31.604938s-12.641975-31.604938-31.604939-31.604938zM670.735802 61.62963H329.402469c-18.962963 0-31.604938 12.641975-31.604938 31.604938s12.641975 31.604938 31.604938 31.604938h341.333333c18.962963 0 31.604938-12.641975 31.604939-31.604938s-12.641975-31.604938-31.604939-31.604938z" horiz-adv-x="1024" />
<glyph glyph-name="fuzhi3" unicode="&#59152;" d="M648.533333-128h-477.866666C75.093333-128 0-52.906667 0 42.666667v477.866666C0 616.106667 75.093333 691.2 170.666667 691.2h477.866666C744.106667 691.2 819.2 616.106667 819.2 520.533333v-477.866666c0-95.573333-75.093333-170.666667-170.666667-170.666667z m-477.866666 750.933333C116.053333 622.933333 68.266667 575.146667 68.266667 520.533333v-477.866666c0-54.613333 47.786667-102.4 102.4-102.4h477.866666c54.613333 0 102.4 47.786667 102.4 102.4v477.866666c0 54.613333-47.786667 102.4-102.4 102.4h-477.866666zM955.733333 110.933333c-20.48 0-34.133333 13.653333-34.133333 34.133334V691.2c0 54.613333-47.786667 102.4-102.4 102.4H273.066667c-20.48 0-34.133333 13.653333-34.133334 34.133333s13.653333 34.133333 34.133334 34.133334h546.133333c95.573333 0 170.666667-75.093333 170.666667-170.666667v-546.133333c0-20.48-13.653333-34.133333-34.133334-34.133334z" horiz-adv-x="1024" />
</font>

Before

Width:  |  Height:  |  Size: 373 KiB

After

Width:  |  Height:  |  Size: 374 KiB

@ -727,7 +727,7 @@ class App extends Component {
(props) => (<RecordDetail {...this.props} {...props} {...this.state} />)
}
/>
<Route path="/myproblems/:id"
<Route path="/myproblems/:id/:tab?"
render={
(props) => (<StudentStudy {...this.props} {...props} {...this.state} />)
} />

@ -4,7 +4,7 @@
* @Github:
* @Date: 2019-12-17 17:32:55
* @LastEditors : tangjiang
* @LastEditTime : 2019-12-26 18:43:21
* @LastEditTime : 2019-12-27 16:50:43
*/
import './index.scss';
import React, { useState } from 'react';
@ -25,6 +25,7 @@ function CommentForm (props) {
const { getFieldDecorator } = form;
const [ctx, setCtx] = useState('');
const [focus, setFocus] = useState(false);
const options = [
['bold', 'italic', 'underline'],
@ -38,6 +39,7 @@ function CommentForm (props) {
// 点击输入框
const handleInputClick = (type) => {
setShowQuill(true);
setFocus(true);
}
// 取消
const handleCancle = () => {
@ -116,6 +118,7 @@ function CommentForm (props) {
overflow: showQuill ? 'none' : 'hidden',
transition: 'all 0.3s'
}}
autoFocus={focus}
style={{ height: '150px' }}
placeholder="说点儿什么~"
options={options}

@ -4,7 +4,7 @@
* @Github:
* @Date: 2019-12-18 08:49:30
* @LastEditors : tangjiang
* @LastEditTime : 2019-12-27 10:36:11
* @LastEditTime : 2019-12-27 16:49:25
*/
import './index.scss';
import 'quill/dist/quill.core.css'; // 核心样式
@ -26,6 +26,7 @@ Quill.register(ImageBlot);
function QuillForEditor ({
placeholder,
readOnly,
autoFocus,
options,
value,
imgAttrs = {}, // 指定图片的宽高
@ -172,6 +173,12 @@ function QuillForEditor ({
}
}, [quill, handleOnChange]);
useEffect(() => {
if (autoFocus) {
quill.focus();
}
}, [quill, autoFocus]);
// 返回结果
return (
<div className='quill_editor_for_react_area' style={wrapStyle}>

@ -721,13 +721,21 @@ class CoursesBanner extends Component {
.ant-breadcrumb-separator{
color: rgba(255,255,255,0.3) !important;
}
.ant-tooltip-inner{
background: #FFFFFF !important;
opacity: 0.2 !important;
}
.ant-tooltip-arrow::before{
background: #FFFFFF !important;
opacity: 0.2 !important;
}
`}
</style>
<Breadcrumb separator="|" className={"mt5"}>
<Breadcrumb.Item className={"pointer"}>
<Tooltip visible={coursedata.teacher_applies_count===undefined?false:coursedata.teacher_applies_count>0?true:false}
placement="topLeft"
<Tooltip visible={coursedata.teacher_applies_count===undefined?false:coursedata.teacher_applies_count>0?true:false}
placement="topLeft"
title={<pre>{coursedata.teacher_applies_count===undefined?"":coursedata.teacher_applies_count>0?<span>您有{coursedata.teacher_applies_count}条新的加入申请<a className={"daishenp"} onClick={()=>this.setHistoryFun("/courses/"+this.props.match.params.coursesId+"/teachers?tab=2")}>
<span style={{
color:"#FFA804"

@ -2,14 +2,14 @@ i.iconfont {
cursor: pointer;
}
.overflowHidden1 {
overflow: hidden;
text-overflow: ellipsis;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
display: inline-block;
}
.overflowHidden2 {
overflow: hidden;
text-overflow: ellipsis;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
@ -637,7 +637,7 @@ a.white-btn.use_scope-btn:hover{
/* 公用的文字按钮:蓝、白、灰 */
.btn.colorblue {
color:#4CACFF !important;
}
}
.btn.colorblue:hover{
color:#459BE5 !important;
}
@ -685,7 +685,7 @@ a.white-btn.use_scope-btn:hover{
background-color: #fff;
color: #4CACFF!important;
border: 1px solid #4CACFF;
}
}
.greyBack{
/* 不要固定宽度 */
/* width: 64px; */
@ -1217,7 +1217,7 @@ samp {
top: 4px;
color: #FE4F4C;
}
/* 毕设任务 */
.graduationTaskMenu>a{
display: block;
@ -1240,7 +1240,7 @@ samp {
.graduationTaskMenu>a.active{
color: #4CACFF!important;
}
/* end */
/* form表单包含多个item时 */
.createPage{
@ -1268,7 +1268,7 @@ samp {
.createPage .ant-form-explain{
padding-left: 0px;
}
.has-error .ant-input-group-addon{
border-color:#f5222d!important;
}
@ -1282,7 +1282,7 @@ samp {
top: 32px;
color: #FE4F4C;
}
.searchView{
width: 248px;
height: 40px;
@ -1544,7 +1544,7 @@ samp {
/* 单选下拉列表(超出十条数据带搜索、且有添加按钮) */
.drop_down_menu li{
overflow:hidden;
white-space: nowrap;
white-space: nowrap;
text-overflow:ellipsis;
padding:0px 20px;
height: 34px;
@ -1571,7 +1571,7 @@ samp {
line-height: 48px;
color: #666666;
}
/* 下拉 ---------------- END */
/* List列表页的公共样式---------------------------------------------- END */
@ -1749,4 +1749,8 @@ input.ant-input-number-input:focus {
.daishenp{
color: #F79946 !important;
text-decoration: underline !important;
}
}
.pointertooltip{
background: #DDDDDD;
}

@ -9,7 +9,7 @@
import './index.scss';
import React from 'react';
import { Table, Button, Dropdown, Icon, Menu, Card, Input, Select, Tag, Modal } from 'antd';
import { Table, Button, Dropdown, Icon, Menu, Card, Input, Select, Tag } from 'antd';
import { connect } from 'react-redux';
import actions from '../../redux/actions';
import MultipTags from './components/multiptags';
@ -46,9 +46,24 @@ const maps = {
],
'languageMenu': [
{
'key': 'c',
'name': 'C语言',
'value': 'c'
'key': 'C',
'name': 'C',
'value': 'C'
},
{
'key': 'C++',
'name': 'C++',
'value': 'C++'
},
{
'key': 'Python',
'name': 'Python',
'value': 'Python'
},
{
'key': 'Java',
'name': 'Java',
'value': 'Java'
}
],
'difficultMenu': [
@ -105,7 +120,6 @@ const testMaps = {
2: '数据结构与算法'
}
}
class DeveloperHome extends React.PureComponent {
/**
* 表格列

@ -4,7 +4,7 @@
* @Github:
* @Date: 2019-11-27 16:02:36
* @LastEditors : tangjiang
* @LastEditTime : 2019-12-27 09:32:34
* @LastEditTime : 2019-12-27 18:05:50
*/
import './index.scss';
import React, { useState, useRef, useEffect } from 'react';
@ -19,6 +19,7 @@ const ControlSetting = (props) => {
const {
hack,
userCode,
inputValue,
loading,
submitLoading,
@ -58,7 +59,7 @@ const ControlSetting = (props) => {
// 调试代码
const handleTestCode = (e) => {
if (!hack.code) {
if (!userCode) {
notification.warning({
message: '提示',
description: '代码块内容不能为空'
@ -77,6 +78,13 @@ const ControlSetting = (props) => {
// 提交
const handleSubmit = (e) => {
e.preventDefault();
if (!userCode) {
notification.warning({
message: '提示',
description: '代码块内容不能为空'
});
return;
}
changeSubmitLoadingStatus(true);
onSubmitForm && onSubmitForm();
}
@ -145,9 +153,10 @@ const ControlSetting = (props) => {
const mapStateToProps = (state) => {
const {commonReducer, ojForUserReducer} = state;
const {loading, excuteState, submitLoading, showOrHideControl } = commonReducer;
const { commitTestRecordDetail, hack } = ojForUserReducer;
const { commitTestRecordDetail, hack, userCode } = ojForUserReducer;
return {
hack,
userCode,
loading,
submitLoading,
excuteState,

@ -4,7 +4,7 @@
* @Github:
* @Date: 2019-11-27 15:02:52
* @LastEditors : tangjiang
* @LastEditTime : 2019-12-27 10:32:25
* @LastEditTime : 2019-12-27 18:01:48
*/
import './index.scss';
import React, { useState, useRef, useEffect } from 'react';
@ -86,6 +86,7 @@ function MyMonacoEditor (props, ref) {
// TODO 需要优化 节流
const val = editorRef.current.getValue();
// setEditCode(val);
// console.log('编辑器代码====>>>>', val);
onCodeChange(val);
// 值一变化保存当前代码值
// saveUserInputCode(val);

@ -4,7 +4,7 @@
* @Github:
* @Date: 2019-11-23 10:53:19
* @LastEditors : tangjiang
* @LastEditTime : 2019-12-27 10:25:14
* @LastEditTime : 2019-12-27 16:22:47
*/
import './index.scss';
import React, { useEffect, useState } from 'react';
@ -30,6 +30,7 @@ function StudentStudy (props) {
// hack_identifier,
// user_program_identifier,
restoreInitialCode,
changeUserCodeTab,
changeShowOrHideControl
} = props;
@ -39,13 +40,17 @@ function StudentStudy (props) {
saveUserProgramIdentifier
} = props;
let { id } = params;
let { id, tab } = params;
useEffect(() => {
// 保存当前的id
saveUserProgramIdentifier(id);
// startProgramQuestion(id);
getUserProgramDetail(id);
if (tab) {
changeUserCodeTab(tab);
}
}, []);
useEffect(() => {
@ -176,7 +181,8 @@ const mapDispatchToProps = (dispatch) => ({
// 恢复初始代码
restoreInitialCode: (identifier, msg) => dispatch(actions.restoreInitialCode(identifier, msg)),
changeShowOrHideControl: (flag) => dispatch(actions.changeShowOrHideControl(flag)),
clearOjForUserReducer: () => dispatch(actions.clearOjForUserReducer())
clearOjForUserReducer: () => dispatch(actions.clearOjForUserReducer()),
changeUserCodeTab: (tab) => dispatch(actions.changeUserCodeTab(tab))
});
export default withRouter(connect(

@ -4,7 +4,7 @@
* @Github:
* @Date: 2019-11-27 09:49:33
* @LastEditors : tangjiang
* @LastEditTime : 2019-12-27 10:39:00
* @LastEditTime : 2019-12-27 17:14:04
*/
import './index.scss';
import React, { useState, useEffect } from 'react';
@ -116,6 +116,7 @@ const CommitRecord = (props) => {
执行结果: <span className={classes}>{reviewResult[status]}</span>
</p>
<p
id="copyError"
onClick={clickCopyErrInfo}
className={showErrorCopy} data-clipboard-target="#errcode">
<span>
@ -158,7 +159,7 @@ const CommitRecord = (props) => {
// 复制功能
let count = 0;
useEffect(() => {
clipboard = new ClipboardJS('.copy_error');
clipboard = new ClipboardJS('#copyError');
clipboard && clipboard.on('success', (e) => {
e.clearSelection();
if (count > 0) return;
@ -166,8 +167,12 @@ const CommitRecord = (props) => {
message.success('复制成功');
setTimeout(() => {
message.destroy();
}, 300);
}, 3000);
});
return () => {
clipboard = null;
}
}, []);
const clickCopyErrInfo = () => {

@ -4,7 +4,7 @@
* @Github:
* @Date: 2019-11-23 11:33:41
* @LastEditors : tangjiang
* @LastEditTime : 2019-12-25 17:10:30
* @LastEditTime : 2019-12-27 16:03:04
// */
import './index.scss';
import React, { useState, useEffect, useMemo } from 'react';
@ -28,7 +28,7 @@ const LeftPane = (props) => {
comments_count, /* 评论数*/
user_praise // 用户是否点赞
} = hack;
const [defaultActiveKey, setDefaultActiveKey] = useState('comment');
const [defaultActiveKey, setDefaultActiveKey] = useState('task');
const navItem = [
{
@ -51,6 +51,8 @@ const LeftPane = (props) => {
comment: (<Comment />)
};
console.log('======>>>>>>>', props);
useEffect(() => {
setDefaultActiveKey(userCodeTab);
}, [userCodeTab])

@ -4,7 +4,7 @@
* @Github:
* @Date: 2019-11-27 09:49:30
* @LastEditors : tangjiang
* @LastEditTime : 2019-12-25 14:50:37
* @LastEditTime : 2019-12-27 18:42:59
*/
import '../index.scss';
import React from 'react';
@ -18,7 +18,7 @@ const {tagBackground, diffText} = CONST;
const TaskDescription = (props) => {
const { hack = {} } = props;
const { hack = {}, userInfo = {} } = props;
const {language, difficult, time_limit, username, description} = hack;
return (
<div className={'task_description_area'}>
@ -37,7 +37,7 @@ const TaskDescription = (props) => {
</p>
<p className={'header_flex'}>
<span className={'flex_label'}>出题者:</span>
<Link to="/users/innov/courses" target="_blank" style={{ color: '#5091FF'}}>{username}</Link>
<Link to={`/users/${userInfo.login}/courses`} target="_blank" style={{ color: '#5091FF'}}>{username}</Link>
</p>
</div>
<div className="task_desc_area">
@ -52,8 +52,10 @@ const TaskDescription = (props) => {
const mapStateToProps = (state) => {
const { hack } = state.ojForUserReducer;
const { userInfo } = state.userReducer;
return {
hack
hack,
userInfo
}
}

@ -475,7 +475,11 @@ class MessagSub extends Component {
// }
}
case "Discuss":
return window.open(`/shixuns/${item.identifier}/shixun_discuss`);
if (item.parent_container_type === 'Hack' && item.extra) {
return window.open(`/myproblems/${item.extra}/comment`);
} else {
return window.open(`/shixuns/${item.identifier}/shixun_discuss`);
}
case "Video":
if (item.tiding_type === "Apply") {
return window.open(`/admins/video_applies`);
@ -506,6 +510,10 @@ class MessagSub extends Component {
//分组作业
return window.open(`/courses/${item.belong_container_id}/group_homeworks/${item.parent_container_id}`);
}
case 'Hack':
if (item.extra) {
return window.open(`/problems/${item.extra}/edit`);
}
default :
return
}

@ -1,6 +1,6 @@
import React, {Component} from 'react';
import {Redirect} from 'react-router';
import {List, Typography, Tag, Modal, Radio, Checkbox, Table, Pagination,Upload,Button} from 'antd';
import {List, Typography, Tag, Modal, Radio, Checkbox, Table,message, Pagination,Upload,Button} from 'antd';
import { NoneData } from 'educoder'
import TPMRightSection from './component/TPMRightSection';
@ -12,7 +12,29 @@ import moment from 'moment';
import Tpmdatasetmodel from "./tpmmodel/Tpmdatasetmodel";
const confirm = Modal.confirm;
function clearSlct() {
if("getSelection" in window){
window.getSelection().removeAllRanges();
}else{
document.selection.empty();
};
}
function jsCopy(s) {
clearSlct();
const copyEle = document.getElementById(s);
copyEle.select();
const copyStatus=document.execCommand("Copy");
// 对成功与否定进行提示
copyStatuss(copyStatus)
}
function copyStatuss(copyStatus){
if (copyStatus) {
message.success('复制成功');
} else {
message.error('复制失败');
}
}
class TPMDataset extends Component {
constructor(props) {
super(props)
@ -69,6 +91,33 @@ class TPMDataset extends Component {
</div>
)
},
{
title: '操作',
dataIndex: 'operation',
key: 'operation',
align: 'center',
className: "edu-txt-center font-14 ",
render: (text, record) => (
<div style={{
cursor:"pointer",
}} onClick={() => {
jsCopy("file_path"+record.id)
}}>
<i className="iconfont icon-fuzhi3 font-18 ml2 questiontype" style={{
color:"#A0A7B4"
}} ></i>
<div
style={{
overflow: 'hidden',
height: "1px",
width: "1px"
}}
>
<input id={"file_path"+record.id} value={record.file_path}/>
</div>
</div>
)
},
],
page: 1,
limit: 10,
@ -148,6 +197,7 @@ class TPMDataset extends Component {
filesize:datas[i].filesize,
id:datas[i].id,
title:datas[i].title,
file_path:datas[i].file_path,
})
}
this.setState({
@ -203,6 +253,7 @@ class TPMDataset extends Component {
filesize:datas[i].filesize,
id:datas[i].id,
title:datas[i].title,
file_path:datas[i].file_path,
})
}
this.setState({

@ -344,14 +344,20 @@ class Challengesjupyter extends Component {
identifier:id
}}).then((response) => {
if(response.data.status===0){
setTimeout(()=>{
this.setState({
jupyter_url :response.data.url,
booljupyterurls:true,
})
},1000);
},500);
this.props.showNotification('重置实训成功!');
setTimeout(()=>{
this.setState({
booljupyterurls:true,
})
},1000);
}
});
}
@ -557,7 +563,49 @@ class Challengesjupyter extends Component {
</style>
{
this.state.jupyter_url === null || this.state.jupyter_url === undefined ?
""
enlarge===true?
<div style={{
height: '63px',
}} className={enlarge?"shixunjianjiecballenges edu-back-white intermediatecenter fangdaone":"shixunjianjiecballenges edu-back-white mt20"}>
<div className={enlarge?"sortinxdirection jupyterswidth":"sortinxdirection"} >
<div className="renwuxiangssi sortinxdirection">
<div><p className="renwuxiangqdiv">任务详情</p></div>
<div><p className="renwuxiangqdivtest ml1 shixunbingbaocun">请将实训题目写在下方并保存</p></div>
</div>
<div className="renwuxiangssit xaxisreverseorder">
{
enlarge===true?
<i className="iconfont icon-suoxiao2 font-18 ml2 ysliconfont" style={{
marginLeft: '30px',
}} onClick={()=>this.onclki(false)}></i>
:
<i className="iconfont icon-fangda font-18 ml2 ysliconfont" style={{
marginLeft: '30px',
}} onClick={()=>this.onclki(true)}></i>
}
<style>
{
`
.ant-upload-list{
display:none
}
`
}
</style>
<Upload {...uploadProps}>
<div className="challenbaocun" type="upload">
<p className="challenbaocuntest" type="upload" >导入</p>
</div>
</Upload>
<button type="button" className="ant-btn deletebuttom chongzhistyles" onClick={this.handleClickResetTpi}><span>重置环境</span></button>
</div>
</div>
</div>
:""
:
(
admin===true||business===true||mysidentity===true?
@ -640,15 +688,20 @@ class Challengesjupyter extends Component {
this.state.jupyter_url===null || this.state.jupyter_url===undefined?
(
booljupyterurls===false?
<LoadingSpin></LoadingSpin>
:""
<div className={enlarge?"fangdatwo edu-back-white":""}>
<LoadingSpin ></LoadingSpin>
</div>
:<div className={enlarge?"fangdatwo edu-back-white":""}>
</div>
)
:
<div className={enlarge?"fangdatwo edu-back-white":""}>
<iframe src={this.state.jupyter_url} className={enlarge?"fangdatwo":""}
scrolling="no" id="frame"
name="framename" width="100%" height="700" frameBorder="0"
></iframe>
scrolling="no" id="frame"
name="framename" width="100%" height="700" frameBorder="0"
></iframe>
</div>
}
</div>
</div>
@ -664,3 +717,4 @@ class Challengesjupyter extends Component {
}
export default Challengesjupyter;

@ -127,3 +127,14 @@
background: #FFFFFF;
}
.file_path_input{
position: absolute;
right: -50%;
}
.questiontype:hover{
color: #4CACFF !important;
}
.questiontype:active{
color: #4CACFF !important;
}

@ -4,7 +4,7 @@
* @Github:
* @Date: 2019-11-20 16:35:46
* @LastEditors : tangjiang
* @LastEditTime : 2019-12-27 14:18:02
* @LastEditTime : 2019-12-27 18:50:22
*/
import types from './actionTypes';
import CONST from '../../constants';
@ -297,6 +297,9 @@ export const validateOjForm = (props, type, cb) => {
type: types.SAVE_OJ_FORM_ID,
payload: identifier
});
if (paramsObj['submitType'] === 'add' && identifier) {
props.history.push(`/problems/${identifier}/edit`)
};
}
// 保存或更新后调用start接口
// linkToDev(dispatch, props);

@ -4,7 +4,7 @@
* @Github:
* @Date: 2019-11-27 13:41:48
* @LastEditors : tangjiang
* @LastEditTime : 2019-12-27 09:18:02
* @LastEditTime : 2019-12-27 16:52:30
*/
import types from "../actions/actionTypes";
import { Base64 } from 'js-base64';

@ -137,8 +137,10 @@ class SearchPage extends Component{
margin-right: 4px;
font-size: 16px !important;
}
.shixundetailtopcss{
}
`}</style>
<div className="shixunDetail_top " >
<div className="shixunDetail_top shixundetailtopcss" >
{/*<div style={{height:"53px"}}></div>*/}
<div className="intermediatecenter" style={{ width: "100%"}}>
<Search

@ -178,9 +178,10 @@
.ml9{
margin-left: 9px;
}
.shixunDetail_top{width: 100%;background-image: url("/images/educoder/searchforbackres.jpg"); height: 240px;
.shixunDetail_top{width: 100%;background-image: url("/images/educoder/searchforbackres.jpg"); height: 160px;
justify-content: center;align-items: center;display: -webkit-flex;
background-size: cover;
background-position: center;
background-repeat: no-repeat;
padding-top: 0px !important;
}

@ -1806,6 +1806,12 @@
<div class="code-name">&amp;#xe70e;</div>
</li>
<li class="dib">
<span class="icon iconfont">&#xe710;</span>
<div class="name">复制</div>
<div class="code-name">&amp;#xe710;</div>
</li>
</ul>
<div class="article markdown">
<h2 id="unicode-">Unicode 引用</h2>
@ -4520,6 +4526,15 @@
</div>
</li>
<li class="dib">
<span class="icon iconfont icon-fuzhi3"></span>
<div class="name">
复制
</div>
<div class="code-name">.icon-fuzhi3
</div>
</li>
</ul>
<div class="article markdown">
<h2 id="font-class-">font-class 引用</h2>
@ -6917,6 +6932,14 @@
<div class="code-name">#icon-shitilan</div>
</li>
<li class="dib">
<svg class="icon svg-icon" aria-hidden="true">
<use xlink:href="#icon-fuzhi3"></use>
</svg>
<div class="name">复制</div>
<div class="code-name">#icon-fuzhi3</div>
</li>
</ul>
<div class="article markdown">
<h2 id="symbol-">Symbol 引用</h2>

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

@ -2076,6 +2076,13 @@
"font_class": "shitilan",
"unicode": "e70e",
"unicode_decimal": 59150
},
{
"icon_id": "12568379",
"name": "复制",
"font_class": "fuzhi3",
"unicode": "e710",
"unicode_decimal": 59152
}
]
}

@ -908,6 +908,9 @@ Created by iconfont
<glyph glyph-name="shitilan" unicode="&#59150;" d="M816.118519-128H184.019753c-69.530864 0-126.419753 56.888889-126.419753 126.419753V756.938272C57.6 826.469136 114.488889 883.358025 184.019753 883.358025h568.888889l189.62963-189.62963v-695.308642c0-69.530864-56.888889-126.419753-126.419753-126.419753zM727.624691 820.148148H184.019753c-37.925926 0-63.209877-25.283951-63.209876-63.209876v-758.518519c0-37.925926 25.283951-63.209877 63.209876-63.209876h632.098766c37.925926 0 63.209877 25.283951 63.209876 63.209876V668.444444L727.624691 820.148148zM955.180247 662.123457h-189.62963c-25.283951 0-44.246914 18.962963-44.246913 44.246913l6.320987 189.62963 227.555556-233.876543z m-170.666667 82.172839v-18.962963h18.962963l-18.962963 18.962963zM670.735802 567.308642H329.402469c-18.962963 0-31.604938 12.641975-31.604938 31.604938S310.439506 630.518519 329.402469 630.518519h341.333333c18.962963 0 31.604938-12.641975 31.604939-31.604939s-12.641975-31.604938-31.604939-31.604938zM670.735802 314.469136H329.402469c-18.962963 0-31.604938 12.641975-31.604938 31.604938S310.439506 377.679012 329.402469 377.679012h341.333333c18.962963 0 31.604938-12.641975 31.604939-31.604938s-12.641975-31.604938-31.604939-31.604938zM670.735802 61.62963H329.402469c-18.962963 0-31.604938 12.641975-31.604938 31.604938s12.641975 31.604938 31.604938 31.604938h341.333333c18.962963 0 31.604938-12.641975 31.604939-31.604938s-12.641975-31.604938-31.604939-31.604938z" horiz-adv-x="1024" />
<glyph glyph-name="fuzhi3" unicode="&#59152;" d="M648.533333-128h-477.866666C75.093333-128 0-52.906667 0 42.666667v477.866666C0 616.106667 75.093333 691.2 170.666667 691.2h477.866666C744.106667 691.2 819.2 616.106667 819.2 520.533333v-477.866666c0-95.573333-75.093333-170.666667-170.666667-170.666667z m-477.866666 750.933333C116.053333 622.933333 68.266667 575.146667 68.266667 520.533333v-477.866666c0-54.613333 47.786667-102.4 102.4-102.4h477.866666c54.613333 0 102.4 47.786667 102.4 102.4v477.866666c0 54.613333-47.786667 102.4-102.4 102.4h-477.866666zM955.733333 110.933333c-20.48 0-34.133333 13.653333-34.133333 34.133334V691.2c0 54.613333-47.786667 102.4-102.4 102.4H273.066667c-20.48 0-34.133333 13.653333-34.133334 34.133333s13.653333 34.133333 34.133334 34.133334h546.133333c95.573333 0 170.666667-75.093333 170.666667-170.666667v-546.133333c0-20.48-13.653333-34.133333-34.133334-34.133334z" horiz-adv-x="1024" />
</font>

Before

Width:  |  Height:  |  Size: 373 KiB

After

Width:  |  Height:  |  Size: 374 KiB

Loading…
Cancel
Save