diff --git a/app/controllers/admins/customers_controller.rb b/app/controllers/admins/customers_controller.rb
index 80b01757b..8235bdb80 100644
--- a/app/controllers/admins/customers_controller.rb
+++ b/app/controllers/admins/customers_controller.rb
@@ -1,4 +1,5 @@
class Admins::CustomersController < Admins::BaseController
+ # skip_before_action :check_sign
helper_method :current_partner
def index
diff --git a/app/controllers/partners_controller.rb b/app/controllers/partners_controller.rb
index 7875e1780..dfa1b2017 100644
--- a/app/controllers/partners_controller.rb
+++ b/app/controllers/partners_controller.rb
@@ -1,4 +1,5 @@
class PartnersController < ApplicationController
+ skip_before_action :check_sign
include Base::PaginateHelper
include Admins::RenderHelper
diff --git a/app/controllers/shixuns_controller.rb b/app/controllers/shixuns_controller.rb
index 3de5970b6..e84e83c71 100644
--- a/app/controllers/shixuns_controller.rb
+++ b/app/controllers/shixuns_controller.rb
@@ -18,9 +18,9 @@ class ShixunsController < ApplicationController
before_action :find_repo_name, only: [:repository, :commits, :file_content, :update_file, :shixun_exec, :copy,
:add_file, :jupyter_exec]
- before_action :allowed, only: [:update, :close, :update_propaedeutics, :settings, :publish, :apply_public,
+ before_action :allowed, only: [:update, :close, :update_propaedeutics, :settings, :publish, :apply_public, :upload_git_folder,
:shixun_members_added, :change_manager, :collaborators_delete, :upload_git_file,
- :cancel_apply_public, :cancel_publish, :add_collaborators, :add_file]
+ :cancel_apply_public, :cancel_publish, :add_collaborators, :add_file, :delete_git_file]
before_action :portion_allowed, only: [:copy]
before_action :special_allowed, only: [:send_to_course, :search_user_courses]
@@ -896,6 +896,15 @@ class ShixunsController < ApplicationController
render_ok
end
+ def upload_git_folder
+ render_ok
+ end
+
+ def delete_git_file
+
+ render_ok
+ end
+
def add_collaborators
member_ids = "(" + @shixun.shixun_members.map(&:user_id).join(',') + ")"
user_name = "%#{params[:user_name].to_s.strip}%"
diff --git a/app/services/jupyter_service.rb b/app/services/jupyter_service.rb
index 2d43a0987..bbe0330bb 100644
--- a/app/services/jupyter_service.rb
+++ b/app/services/jupyter_service.rb
@@ -8,7 +8,8 @@ module JupyterService
uri = "#{shixun_tomcat}/bridge/jupyter/get"
tpiID = "tpm#{shixun.id}"
mount = shixun.data_sets.present?
- params = {tpiID: tpiID, identifier: shixun.identifier, needMount: mount, gitUrl: '',
+ gitUrl = "#{edu_setting('git_address_domain')}/#{shixun.repo_path}"
+ params = {tpiID: tpiID, identifier: shixun.identifier, needMount: mount, gitUrl: gitUrl,
:containers => "#{Base64.urlsafe_encode64(shixun_container_limit(shixun))}"}
logger.info "test_juypter: uri->#{uri}, params->#{params}"
diff --git a/config/routes.rb b/config/routes.rb
index 2409a8883..e48049f5f 100644
--- a/config/routes.rb
+++ b/config/routes.rb
@@ -315,6 +315,8 @@ Rails.application.routes.draw do
post :commits
post :file_content
post :upload_git_file
+ post :upload_git_folder
+ delete :delete_git_file
post :update_file
post :close
post :add_file
diff --git a/public/react/src/AppConfig.js b/public/react/src/AppConfig.js
index 9d856d899..87ab58f63 100644
--- a/public/react/src/AppConfig.js
+++ b/public/react/src/AppConfig.js
@@ -82,8 +82,8 @@ export function initAxiosInterceptors(props) {
// proxy = "https://testeduplus2.educoder.net"
//proxy="http://47.96.87.25:48080"
proxy="https://pre-newweb.educoder.net"
- proxy="https://test-newweb.educoder.net"
- // proxy="https://test-jupyterweb.educoder.net"
+ // proxy="https://test-newweb.educoder.net"
+ proxy="https://test-jupyterweb.educoder.net"
//proxy="http://192.168.2.63:3001"
// 在这里使用requestMap控制,避免用户通过双击等操作发出重复的请求;
@@ -123,7 +123,10 @@ export function initAxiosInterceptors(props) {
}
}
if(`${config[0]}`!=`true`){
+ let timestamp = Date.parse(new Date())/1000;
if (window.location.port === "3007") {
+ // let timestamp=railsgettimes(proxy);
+ console.log(timestamp)
railsgettimes(`${proxy}/api/main/first_stamp.json`);
let newopens=md5(opens+timestamp)
config.url = `${proxy}${url}`;
diff --git a/public/react/src/common/quillForEditor/ImageBlot.js b/public/react/src/common/quillForEditor/ImageBlot.js
index d00f2bafd..5ff84b249 100644
--- a/public/react/src/common/quillForEditor/ImageBlot.js
+++ b/public/react/src/common/quillForEditor/ImageBlot.js
@@ -4,7 +4,7 @@
* @Github:
* @Date: 2019-12-16 15:50:45
* @LastEditors : tangjiang
- * @LastEditTime : 2019-12-27 15:07:11
+ * @LastEditTime : 2019-12-31 13:59:02
*/
import Quill from "quill";
@@ -50,6 +50,7 @@ export default class ImageBlot extends BlockEmbed {
return node;
}
+ // 获取节点值
static value (node) {
return {
diff --git a/public/react/src/common/quillForEditor/index.js b/public/react/src/common/quillForEditor/index.js
index cb214465c..f3f359a80 100644
--- a/public/react/src/common/quillForEditor/index.js
+++ b/public/react/src/common/quillForEditor/index.js
@@ -4,7 +4,7 @@
* @Github:
* @Date: 2019-12-18 08:49:30
* @LastEditors : tangjiang
- * @LastEditTime : 2019-12-27 16:49:25
+ * @LastEditTime : 2019-12-31 15:11:37
*/
import './index.scss';
import 'quill/dist/quill.core.css'; // 核心样式
@@ -18,10 +18,18 @@ import deepEqual from './deepEqual.js'
import { fetchUploadImage } from '../../services/ojService.js';
import { getImageUrl } from 'educoder'
import ImageBlot from './ImageBlot';
+const Size = Quill.import('attributors/style/size');
+const Font = Quill.import('formats/font');
+// const Color = Quill.import('attributes/style/color');
+Size.whitelist = ['12px', '14px', '16px', '18px', '20px', false];
+Font.whitelist = ['SimSun', 'SimHei','Microsoft-YaHei','KaiTi','FangSong','Arial','Times-New-Roman','sans-serif'];
window.Quill = Quill;
window.katex = katex;
Quill.register(ImageBlot);
+Quill.register(Size);
+Quill.register(Font, true);
+// Quill.register(Color);
function QuillForEditor ({
placeholder,
@@ -38,15 +46,16 @@ function QuillForEditor ({
}) {
// toolbar 默认值
const defaultConfig = [
- ['bold', 'italic', 'underline'],
- [{align: []}, {list: 'ordered'}, {list: 'bullet'}], // 列表
- [{script: 'sub'}, {script: 'super'}],
- [{ 'color': [] }, { 'background': [] }],
- [{header: [1,2,3,4,5,false]}],
- ['blockquote', 'code-block'],
- ['link', 'image', 'video'],
- ['formula'],
- ['clean']
+ 'bold', 'italic', 'underline',
+ {size: ['12px', '14px', '16px', '18px', '20px']},
+ {align: []}, {list: 'ordered'}, {list: 'bullet'}, // 列表
+ {script: 'sub'}, {script: 'super'},
+ { 'color': [] }, { 'background': [] },
+ {header: [1,2,3,4,5,false]},
+ 'blockquote', 'code-block',
+ 'link', 'image', 'video',
+ 'formula',
+ 'clean'
];
const editorRef = useRef(null);
diff --git a/public/react/src/common/quillForEditor/index.scss b/public/react/src/common/quillForEditor/index.scss
index 3e951e2b6..96cd45edd 100644
--- a/public/react/src/common/quillForEditor/index.scss
+++ b/public/react/src/common/quillForEditor/index.scss
@@ -7,4 +7,107 @@
cursor: pointer;
}
}
+ .ql-snow .ql-picker.ql-size .ql-picker-label[data-value="12px"]::before,
+ .ql-snow .ql-picker.ql-size .ql-picker-item[data-value="12px"]::before {
+ content: '12px';
+ font-size: 12px;
+ }
+ .ql-snow .ql-picker.ql-size .ql-picker-label[data-value="14px"]::before,
+ .ql-snow .ql-picker.ql-size .ql-picker-item[data-value="14px"]::before {
+ content: '14px';
+ font-size: 14px;
+ }
+ .ql-snow .ql-picker.ql-size .ql-picker-label[data-value="16px"]::before,
+ .ql-snow .ql-picker.ql-size .ql-picker-item[data-value="16px"]::before {
+ content: '16px';
+ font-size: 16px;
+ }
+ .ql-snow .ql-picker.ql-size .ql-picker-label[data-value="18px"]::before,
+ .ql-snow .ql-picker.ql-size .ql-picker-item[data-value="18px"]::before {
+ content: '18px';
+ font-size: 18px;
+ }
+ .ql-snow .ql-picker.ql-size .ql-picker-label[data-value="20px"]::before,
+ .ql-snow .ql-picker.ql-size .ql-picker-item[data-value="20px"]::before {
+ content: '20px';
+ font-size: 20px;
+ }
+ //默认的样式
+ .ql-snow .ql-picker.ql-size .ql-picker-label::before,
+ .ql-snow .ql-picker.ql-size .ql-picker-item::before {
+ content: '14px';
+ font-size: 14px;
+ }
+
+ .ql-snow .ql-picker.ql-font .ql-picker-label[data-value=SimSun]::before,
+ .ql-snow .ql-picker.ql-font .ql-picker-item[data-value=SimSun]::before {
+ content: "宋体";
+ font-family: "SimSun";
+ }
+ .ql-snow .ql-picker.ql-font .ql-picker-label[data-value=SimHei]::before,
+ .ql-snow .ql-picker.ql-font .ql-picker-item[data-value=SimHei]::before {
+ content: "黑体";
+ font-family: "SimHei";
+ }
+ .ql-snow .ql-picker.ql-font .ql-picker-label[data-value=Microsoft-YaHei]::before,
+ .ql-snow .ql-picker.ql-font .ql-picker-item[data-value=Microsoft-YaHei]::before {
+ content: "微软雅黑";
+ font-family: "Microsoft YaHei";
+ }
+ .ql-snow .ql-picker.ql-font .ql-picker-label[data-value=KaiTi]::before,
+ .ql-snow .ql-picker.ql-font .ql-picker-item[data-value=KaiTi]::before {
+ content: "楷体";
+ font-family: "KaiTi";
+ }
+ .ql-snow .ql-picker.ql-font .ql-picker-label[data-value=FangSong]::before,
+ .ql-snow .ql-picker.ql-font .ql-picker-item[data-value=FangSong]::before {
+ content: "仿宋";
+ font-family: "FangSong";
+ }
+ .ql-snow .ql-picker.ql-font .ql-picker-label[data-value=Arial]::before,
+ .ql-snow .ql-picker.ql-font .ql-picker-item[data-value=Arial]::before {
+ content: "Arial";
+ font-family: "Arial";
+ }
+ .ql-snow .ql-picker.ql-font .ql-picker-label[data-value=Times-New-Roman]::before,
+ .ql-snow .ql-picker.ql-font .ql-picker-item[data-value=Times-New-Roman]::before {
+ content: "Times New Roman";
+ font-family: "Times New Roman";
+ }
+ .ql-snow .ql-picker.ql-font .ql-picker-label[data-value=sans-serif]::before,
+ .ql-snow .ql-picker.ql-font .ql-picker-item[data-value=sans-serif]::before {
+ content: "sans-serif";
+ font-family: "sans-serif";
+ }
+
+ .ql-font-SimSun {
+ font-family: "SimSun";
+ }
+ .ql-font-SimHei {
+ font-family: "SimHei";
+ }
+ .ql-font-Microsoft-YaHei {
+ font-family: "Microsoft YaHei";
+ }
+ .ql-font-KaiTi {
+ font-family: "KaiTi";
+ }
+ .ql-font-FangSong {
+ font-family: "FangSong";
+ }
+ .ql-font-Arial {
+ font-family: "Arial";
+ }
+ .ql-font-Times-New-Roman {
+ font-family: "Times New Roman";
+ }
+ .ql-font-sans-serif {
+ font-family: "sans-serif";
+ }
+
+ .ql-snow .ql-picker.ql-font .ql-picker-label::before,
+ .ql-snow .ql-picker.ql-font .ql-picker-item::before {
+ content: "微软雅黑";
+ font-family: "Microsoft YaHei";
+ }
}
\ No newline at end of file
diff --git a/public/react/src/constants/index.js b/public/react/src/constants/index.js
index 3e7aceab0..e9401e76e 100644
--- a/public/react/src/constants/index.js
+++ b/public/react/src/constants/index.js
@@ -3,8 +3,8 @@
* @Author: tangjiang
* @Github:
* @Date: 2019-11-20 23:10:48
- * @LastEditors: tangjiang
- * @LastEditTime: 2019-12-06 15:53:27
+ * @LastEditors : tangjiang
+ * @LastEditTime : 2020-01-02 14:57:02
*/
const CONST = {
jcLabel: {
@@ -12,9 +12,11 @@ const CONST = {
language: '编程语言',
description: '描述',
difficult: '难易度',
- category: '分类',
+ category: '课程',
openOrNot: '公开程序',
- timeLimit: '时间限制'
+ timeLimit: '时间限制',
+ knowledge: '知识点',
+ sub_discipline_id: '课程'
},
fontSetting: {
title: '代码格式',
diff --git a/public/react/src/modules/courses/Resource/Fileslistitem.js b/public/react/src/modules/courses/Resource/Fileslistitem.js
index 99888e558..e7e31baab 100644
--- a/public/react/src/modules/courses/Resource/Fileslistitem.js
+++ b/public/react/src/modules/courses/Resource/Fileslistitem.js
@@ -253,22 +253,22 @@ class Fileslistitem extends Component{
{discussMessage.is_publish===false?
{data&&data.username}
+{data&&data.username}
-
-
-
+
+
diff --git a/public/react/src/modules/courses/shixunHomework/shixunreport/ConclusionEvaluation.js b/public/react/src/modules/courses/shixunHomework/shixunreport/ConclusionEvaluation.js index 8d678f335..aa2da8594 100644 --- a/public/react/src/modules/courses/shixunHomework/shixunreport/ConclusionEvaluation.js +++ b/public/react/src/modules/courses/shixunHomework/shixunreport/ConclusionEvaluation.js @@ -66,7 +66,7 @@ class ConclusionEvaluation extends Component { ), },{ - title: '最终成绩', + title: '当前成绩', dataIndex: 'grade', key: 'grade', render: (text, record) => ( @@ -81,7 +81,7 @@ class ConclusionEvaluation extends Component { ), }, { - title: '实战耗时', + title: '实战总耗时', key: 'elapsed', dataIndex: 'elapsed', diff --git a/public/react/src/modules/developer/components/knowledge/index.js b/public/react/src/modules/developer/components/knowledge/index.js new file mode 100644 index 000000000..b287a42c9 --- /dev/null +++ b/public/react/src/modules/developer/components/knowledge/index.js @@ -0,0 +1,127 @@ +/* + * @Description: 知识点 + * @Author: tangjiang + * @Github: + * @Date: 2019-12-30 13:51:19 + * @LastEditors : tangjiang + * @LastEditTime : 2020-01-03 09:32:24 + */ +import './index.scss'; +import React, { useState, useEffect } from 'react'; +import { Select, notification } from 'antd'; + +const { Option } = Select; + +function KnowLedge (props) { + + const { + options = [], // 下拉选项 + values = [], // 已选择的下拉项 + onChange // 获取选择的值 + } = props; + + useEffect(() => { + const _options = []; + const _selects = []; + options.forEach(opt => { + if (!values.includes(opt.id)) { + _options.push(opt); + } else { + _selects.push(opt); + } + }); + setSelectOptions(_options || []); + setSelectValue(_selects || []); + }, [props]); + + // 显示的下拉项 + const [selectOptions, setSelectOptions] = useState(options); + // 已选择的下拉项 + const [selectValue, setSelectValue] = useState([]); + // + const [value] = useState([]); + + // 渲染下拉选项 + const renderOptions = (options = []) => { + return options.map((opt, i) => ( + + )); + } + // 过滤下拉列表项 + const handleSelectChange = (value) => { + value = +value.join(''); + const tempArr = [...selectValue]; + const _result = selectOptions.filter(item => { + if (item.id === value && tempArr.findIndex(t => t.id === value) === -1) { + tempArr.push(item); + } + return item.id !== value; + }); + if (tempArr.length > 50) { + notification.warning({ + message: '提示', + description: '知识点不能超过50个' + }); + return; + } + setSelectValue(tempArr); + setSelectOptions(_result); + // 将选择值返回 + onChange && onChange(tempArr); + } + + // 删除 + const handleRemoveResult = (item) => { + // console.log('点击了删除按钮===>>>>', item); + // 将删除的值重新加入到列表中 + const tempOptions = [...selectOptions]; + const tempValue = selectValue.filter(t => t.id !== item.id); + // console.log(selectValue); + tempOptions.push(item); + setSelectOptions(tempOptions); + setSelectValue(tempValue); + // 将选择值返回 + onChange && onChange(tempValue); + } + + // 渲染下拉结果 + const renderResult = (arrs) => { + return arrs.map((item) => ( + + {item.name} + handleRemoveResult(item)} + className="iconfont icon-roundclose knowledge-close" + > + + )); + } + // 渲染下拉列表 + const renderSelect = (options = []) => { + // console.log('+++++', options); + // setSelectValue(_selects); + return ( + + ) + } + + return ( +
题数:{this.props.all_score}
-总分:{this.props.all_questions_count}
+题数:{this.props.all_score}
+总分:{this.props.all_questions_count}
+一、单选题
(共{single_questions&&single_questions.questions_count}题;共{single_questions&&single_questions.questions_score}分)
-{single_questions===null?"一":"二"}、多选题
(共{multiple_questions&&multiple_questions.questions_count}题;共{multiple_questions&&multiple_questions.questions_score}分)
-{single_questions===null&&multiple_questions===null?"一":single_questions===null&&multiple_questions!==null?"二" - :single_questions!==null&&multiple_questions===null?"二" - :"三"}、判断题
(共{judgement_questions&&judgement_questions.questions_count}题;共{judgement_questions&&judgement_questions.questions_score}分)
-- {single_questions===null&&multiple_questions===null&&program_questions===null?"一" - :single_questions===null&&multiple_questions===null&&program_questions!==null?"二" - :single_questions!==null&&multiple_questions===null&&program_questions===null?"二" - :single_questions===null&&multiple_questions!==null&&program_questions===null?"二" - :single_questions!==null&&multiple_questions!==null&&program_questions===null?"三" - :single_questions===null&&multiple_questions!==null&&program_questions!==null?"三" - :single_questions!==null&&multiple_questions==null&&program_questions!==null?"三": - "四"} - 、编程题
(共{program_questions&&program_questions.questions_count}题;共{program_questions&&program_questions.questions_score}分)
-一、单选题
(共{single_questions && single_questions.questions_count}题;共{single_questions && single_questions.questions_score}分)
+{single_questions === null ? "一" : "二"}、多选题
+(共{multiple_questions && multiple_questions.questions_count}题;共{multiple_questions && multiple_questions.questions_score}分)
+{single_questions === null && multiple_questions === null ? "一" : single_questions === null && multiple_questions !== null ? "二" + : single_questions !== null && multiple_questions === null ? "二" + : "三"}、判断题
(共{judgement_questions && judgement_questions.questions_count}题;共{judgement_questions && judgement_questions.questions_score}分)
++ {single_questions === null && multiple_questions === null && program_questions === null ? "一" + : single_questions === null && multiple_questions === null && program_questions !== null ? "二" + : single_questions !== null && multiple_questions === null && program_questions === null ? "二" + : single_questions === null && multiple_questions !== null && program_questions === null ? "二" + : single_questions !== null && multiple_questions !== null && program_questions === null ? "三" + : single_questions === null && multiple_questions !== null && program_questions !== null ? "三" + : single_questions !== null && multiple_questions == null && program_questions !== null ? "三" : + "四"} + 、编程题
(共{program_questions && program_questions.questions_count}题;共{program_questions && program_questions.questions_score}分)
+{objectsingleid}
、({objectsinglescore}分)
*/} - {/*- { - objectsingle === undefined ||objectsingle === null? "" : objectsingle.choices.map((object, index) => { - return ( -
-
-
-
- + } + ++ { + objectsingle === undefined || objectsingle === null ? "" : objectsingle.choices.map((object, index) => { + return ( +
+
- { - objectsingle === undefined ||objectsingle === null? "" : objectsingle.choices.map((object, index) => { - return ( -
- {tagArray[index]} -
- - ) - }) - } - - } - - -+
+
+ + + : ++ { + objectsingle === undefined || objectsingle === null ? "" : objectsingle.choices.map((object, index) => { + return ( +
+ {tagArray[index]} +
+ + ) + }) + } + + } +