Merge branch 'dev_aliyun' into develop

dev_ec
hjm 6 years ago
commit 24c7816337

File diff suppressed because one or more lines are too long

@ -34,8 +34,9 @@
// location.href = './compatibility' // location.href = './compatibility'
location.href = '/compatibility.html' location.href = '/compatibility.html'
} }
const isMobile = (/android|webos|iphone|ipad|ipod|blackberry|iemobile|opera mini/i.test(navigator.userAgent.toLowerCase())); // const isMobile = (/android|webos|iphone|ipad|ipod|blackberry|iemobile|opera mini/i.test(navigator.userAgent.toLowerCase()));
if (isMobile) { const isWeiXin = (/MicroMessenger/i.test(navigator.userAgent.toLowerCase()));
if (isWeiXin) {
document.write('<script type="text/javascript" src="/javascripts/wx/jweixin-1.3.0.js"><\/script>'); document.write('<script type="text/javascript" src="/javascripts/wx/jweixin-1.3.0.js"><\/script>');
} }
</script> </script>

@ -9,7 +9,7 @@ import {
Route, Route,
Switch Switch
} from 'react-router-dom'; } from 'react-router-dom';
import axios from 'axios';
import '@icedesign/base/dist/ICEDesignBase.css'; import '@icedesign/base/dist/ICEDesignBase.css';
import '@icedesign/base/index.scss'; import '@icedesign/base/index.scss';
@ -37,7 +37,7 @@ import {MuiThemeProvider, createMuiTheme} from 'material-ui/styles';
import history from './history'; import history from './history';
import {SnackbarHOC, configShareForIndex} from 'educoder' import {SnackbarHOC} from 'educoder'
import {initAxiosInterceptors} from './AppConfig' import {initAxiosInterceptors} from './AppConfig'
@ -298,61 +298,7 @@ class App extends Component {
mydisplay:true, mydisplay:true,
}) })
}; };
initWXShare = () => {
if (window.wx) {
const wx = window.wx
const url = '/wechats/js_sdk_signature.json'
const currentUrl = window.location.href.split('#')[0]
// window.encodeURIComponent()
axios.post(url, {
url: window.__testUrl || currentUrl,
}).then((response) => {
console.log('got res')
const data = response.data;
wx.config({
debug: false,
appId: data.appid,
timestamp: data.timestamp,
nonceStr: data.noncestr,
signature: data.signature,
jsApiList: [
'onMenuShareTimeline',//
'onMenuShareAppMessage',
'onMenuShareQQ',
'onMenuShareWeibo',
'onMenuShareQZone'
]
});
wx.ready(function () {
console.log('wx is ready')
// var shareData = {
// title: 'EduCoder - 首页',
// desc: 'Educoder是一个面向计算机类的互联网IT教育和实战平台提供企业级工程实训以实现工程化专业教学的自动化和智能化。高校和企业人员可以在此开展计算机实践性教学活动将传统的知识传授和时兴的工程实战一体化。',
// link: currentUrl,
// imgUrl: window.__testImageUrl
// || (currentUrl.endsWith('/') ? currentUrl : currentUrl + '/') + 'react/build/images/share_logo_icon.jpg'
// };
// wx.onMenuShareAppMessage(shareData);//分享给好友
// wx.onMenuShareTimeline(shareData);//分享到朋友圈
// wx.onMenuShareQQ(shareData);//分享给手机QQ
// wx.onMenuShareWeibo(shareData);//分享腾讯微博
// wx.onMenuShareQZone(shareData);//分享到QQ空间
configShareForIndex('/')
});
wx.error(function (res) {
console.log('wx is error')
console.log(res)
//alert(res.errMsg);//错误提示
});
}).catch((error) => {
console.log(error)
})
}
}
disableVideoContextMenu = () => { disableVideoContextMenu = () => {
window.$( "body" ).on( "mousedown", "video", function(event) { window.$( "body" ).on( "mousedown", "video", function(event) {
if(event.which === 3) { if(event.which === 3) {
@ -374,7 +320,6 @@ class App extends Component {
}); });
initAxiosInterceptors(this.props) initAxiosInterceptors(this.props)
this.initWXShare()
// //
// axios.interceptors.response.use((response) => { // axios.interceptors.response.use((response) => {
// // console.log("response"+response); // // console.log("response"+response);

@ -4,3 +4,5 @@ export function isDev() {
// const isMobile // const isMobile
export const isMobile = (/android|webos|iphone|ipad|ipod|blackberry|iemobile|opera mini/i.test(navigator.userAgent.toLowerCase())); export const isMobile = (/android|webos|iphone|ipad|ipod|blackberry|iemobile|opera mini/i.test(navigator.userAgent.toLowerCase()));
// const isWeiXin = (/MicroMessenger/i.test(navigator.userAgent.toLowerCase()));

@ -1,3 +1,4 @@
import axios from 'axios'
const host = window.location.protocol + '//' + window.location.host const host = window.location.protocol + '//' + window.location.host
const wx = window.wx const wx = window.wx
function share(shareData) { function share(shareData) {
@ -11,7 +12,47 @@ function share(shareData) {
console.log(e) console.log(e)
} }
} }
const urlDoneMap = {}
function requestForSignatrue (callback) {
const currentUrl = window.location.href.split('#')[0]
if (window.wx && !urlDoneMap[currentUrl]) {
const wx = window.wx
const url = '/wechats/js_sdk_signature.json'
urlDoneMap[currentUrl] = true
// window.encodeURIComponent()
axios.post(url, {
url: window.__testUrl || currentUrl,
}).then((response) => {
console.log('got res')
const data = response.data;
wx.config({
debug: false,
appId: data.appid,
timestamp: data.timestamp,
nonceStr: data.noncestr,
signature: data.signature,
jsApiList: [
'onMenuShareTimeline',//
'onMenuShareAppMessage',
'onMenuShareQQ',
'onMenuShareWeibo',
'onMenuShareQZone'
]
});
wx.ready(function () {
callback && callback()
});
wx.error(function (res) {
console.log('wx is error')
console.log(res)
//alert(res.errMsg);//错误提示
});
}).catch((error) => {
console.log(error)
})
}
}
/** /**
实践课程 平台提供涵盖基础入门案例实践和创新应用的完整实训项目体系通过由浅入深的实训路径帮助学生快速提升实战能力 实践课程 平台提供涵盖基础入门案例实践和创新应用的完整实训项目体系通过由浅入深的实训路径帮助学生快速提升实战能力
实训项目 覆盖不同专业的IT实验和实训每周更新无需配置本机实验环境随时随地开启企业级真实实训 实训项目 覆盖不同专业的IT实验和实训每周更新无需配置本机实验环境随时随地开启企业级真实实训
@ -20,7 +61,7 @@ function share(shareData) {
*/ */
export function configShareForIndex (path) { export function configShareForIndex (path) {
if (!wx) return; requestForSignatrue(() => {
var shareData = { var shareData = {
title: 'EduCoder - 首页', title: 'EduCoder - 首页',
desc: 'Educoder是一个面向计算机类的互联网IT教育和实战平台提供企业级工程实训以实现工程化专业教学的自动化和智能化。高校和企业人员可以在此开展计算机实践性教学活动将传统的知识传授和时兴的工程实战一体化。', desc: 'Educoder是一个面向计算机类的互联网IT教育和实战平台提供企业级工程实训以实现工程化专业教学的自动化和智能化。高校和企业人员可以在此开展计算机实践性教学活动将传统的知识传授和时兴的工程实战一体化。',
@ -29,9 +70,11 @@ export function configShareForIndex (path) {
|| host + '/react/build/images/share_logo_icon.jpg' || host + '/react/build/images/share_logo_icon.jpg'
}; };
share(shareData) share(shareData)
})
} }
export function configShareForPaths () { export function configShareForPaths () {
if (!wx) return; requestForSignatrue(() => {
console.log('configShareForPaths', host)
var shareData = { var shareData = {
title: 'EduCoder - 实践课程', title: 'EduCoder - 实践课程',
desc: '平台提供涵盖基础入门、案例实践和创新应用的完整实训项目体系,通过由浅入深的实训路径,帮助学生快速提升实战能力。', desc: '平台提供涵盖基础入门、案例实践和创新应用的完整实训项目体系,通过由浅入深的实训路径,帮助学生快速提升实战能力。',
@ -40,9 +83,12 @@ export function configShareForPaths () {
|| host + '/react/build/images/share_logo_icon.jpg' || host + '/react/build/images/share_logo_icon.jpg'
}; };
share(shareData) share(shareData)
})
} }
export function configShareForShixuns () { export function configShareForShixuns () {
if (!wx) return; requestForSignatrue(() => {
console.log('configShareForShixuns', host)
var shareData = { var shareData = {
title: 'EduCoder - 实训项目', title: 'EduCoder - 实训项目',
desc: '覆盖不同专业的IT实验和实训每周更新无需配置本机实验环境随时随地开启企业级真实实训。', desc: '覆盖不同专业的IT实验和实训每周更新无需配置本机实验环境随时随地开启企业级真实实训。',
@ -51,9 +97,12 @@ export function configShareForShixuns () {
|| host + '/react/build/images/share_logo_icon.jpg' || host + '/react/build/images/share_logo_icon.jpg'
}; };
share(shareData) share(shareData)
})
} }
export function configShareForCourses () { export function configShareForCourses () {
if (!wx) return; requestForSignatrue(() => {
console.log('configShareForCourses', host)
var shareData = { var shareData = {
title: 'EduCoder - 翻转课堂', title: 'EduCoder - 翻转课堂',
desc: '自动评测实训任务,支持技能统计,提供教学活动分析报告,减轻教师和助教的辅导压力,免去作业发布和批改的困扰,实时了解学生学习情况,全面提升教师施教效率和水平。', desc: '自动评测实训任务,支持技能统计,提供教学活动分析报告,减轻教师和助教的辅导压力,免去作业发布和批改的困扰,实时了解学生学习情况,全面提升教师施教效率和水平。',
@ -62,11 +111,14 @@ export function configShareForCourses () {
|| host + '/react/build/images/share_logo_icon.jpg' || host + '/react/build/images/share_logo_icon.jpg'
}; };
share(shareData) share(shareData)
})
} }
// detail // detail
export function configShareForCustom (title, desc, path, imgUrl) { export function configShareForCustom (title, desc, path, imgUrl) {
if (!wx) return; requestForSignatrue(() => {
console.log('configShareForCustom', host)
var shareData = { var shareData = {
title: title, title: title,
desc: desc, desc: desc,
@ -75,4 +127,5 @@ export function configShareForCustom (title, desc, path, imgUrl) {
|| host + '/react/build/images/share_logo_icon.jpg' || host + '/react/build/images/share_logo_icon.jpg'
}; };
share(shareData) share(shareData)
})
} }

@ -35,11 +35,16 @@ class ShixunWorkDetails extends Component {
} }
}).then((result) => { }).then((result) => {
if (result.status === 200) { if (result.status === 200) {
if (result.data.status === 403 || result.data.status === 401 || result.data.status === 407 || result.data.status === 408|| result.data.status === 409 || result.data.status === 500) {
}else{
this.setState({ this.setState({
data:result.data, data:result.data,
spinning:false spinning:false
}) })
} }
}
}).catch((error) => { }).catch((error) => {
console.log(error) console.log(error)
}) })
@ -50,7 +55,33 @@ class ShixunWorkDetails extends Component {
shixuntypes:type[3] shixuntypes:type[3]
}) })
} }
updatas=()=>{
this.setState({
spinning:true
})
let homeworkid=this.props.match.params.homeworkid;
let userid=this.props.match.params.userid;
let url = "/homework_commons/"+homeworkid+"/code_review_detail.json";
axios.get(url,{
params: {
user_id:userid,
}
}).then((result) => {
if (result.status === 200) {
if (result.data.status === 403 || result.data.status === 401 || result.data.status === 407 || result.data.status === 408|| result.data.status === 409 || result.data.status === 500) {
}else{
this.setState({
data:result.data,
spinning:false
})
}
}
}).catch((error) => {
console.log(error)
})
}
goback=(sum)=>{ goback=(sum)=>{
// let{data}=this.state // let{data}=this.state
// if(sum===1){ // if(sum===1){
@ -102,14 +133,18 @@ class ShixunWorkDetails extends Component {
<span className="fl color-orange font-14">非编程类型任务不参与查重</span> <span className="fl color-orange font-14">非编程类型任务不参与查重</span>
<span className="fr mt4"> <span className="fr mt4">
<span className={"color656565"}>被查作品</span> <span className={"color656565"}>被查作品</span>
<span className={"mr20"}>{data&&data.username}</span> <span className={"mr50"}><span className={"color-orange"}>{data&&data.username}</span></span>
<span className={"color-orange"}>{data&&data.final_score}</span> {data&&data.eff_score===null||data&&data.eff_score===undefined||data&&data.eff_score_full===null||data&&data.eff_score_full===undefined?"":<span className={"mr50"}>效率分<span className={"color-orange"}>{data&&data.eff_score}</span>/{data&&data.eff_score_full}</span>}
<span className={""}>最终成绩<span className={"color-orange"}>{data&&data.final_score}</span></span>
</span> </span>
</div> </div>
<div className="stud-class-set bor-bottom-greyE"> <div className="stud-class-set bor-bottom-greyE">
<div className="clearfix edu-back-white poll_list"> <div className="clearfix edu-back-white poll_list">
<ShixunCustomsPass <ShixunCustomsPass
{...this.props}
{...this.state}
updatas={()=>this.updatas()}
data={data} data={data}
/> />
</div> </div>

@ -1,10 +1,10 @@
import React, {Component} from "react"; import React, {Component} from "react";
import {WordsBtn} from 'educoder'; import {WordsBtn} from 'educoder';
import {Table} from "antd"; import {Table,InputNumber} from "antd";
import {Link,Switch,Route,Redirect} from 'react-router-dom'; import {Link,Switch,Route,Redirect} from 'react-router-dom';
import moment from 'moment'; import moment from 'moment';
import { MonacoDiffEditor } from 'react-monaco-editor'; import { MonacoDiffEditor } from 'react-monaco-editor';
import axios from 'axios';
class ShixunCustomsPass extends Component { class ShixunCustomsPass extends Component {
constructor(props) { constructor(props) {
@ -18,10 +18,51 @@ class ShixunCustomsPass extends Component {
componentDidMount() { componentDidMount() {
} }
editgame_scores=(e,id,maxsum,code_rate,copy_user_id)=>{
let{datas}=this.state;
let newdatas=datas;
let score=e.target.value;
if(score!=null&&score!=undefined&&score!=""){
if(score<0){
this.props.showNotification("不能小于0");
this.setState({
customsids:id
})
}else if(score>maxsum){
this.props.showNotification(`不能大于关卡分值${maxsum}`);
this.setState({
customsids:id
})
}else{
let work_id=this.props.data.work_id;
let url=`/student_works/${work_id}/adjust_review_score.json`
axios.post(url,{
type:"review",
score:score,
challenge_id:id,
code_rate:code_rate,
copy_user_id:copy_user_id
}).then((result)=>{
if(result.data.status===0){
this.props.updatas();
this.props.showNotification(result.data.message);
}else{
this.props.showNotification(result.data.message);
}
}).catch((error)=>{
})
}
}else{
this.props.showNotification("调分为空将不会修改之前的分数");
}
}
render() { render() {
let {data}=this.props; let {data}=this.props;
console.log(data) let {customsids}=this.state;
// console.log(data)
let datas=[]; let datas=[];
data&&data.challenge_list.forEach((item,key)=>{ data&&data.challenge_list.forEach((item,key)=>{
@ -33,6 +74,8 @@ class ShixunCustomsPass extends Component {
finishtime:item.copy_username, finishtime:item.copy_username,
elapsedtime:item.copy_end_time===null?"无":item.copy_end_time===undefined?"无":item.copy_end_time===""?"无":moment(item.copy_end_time).format('YYYY-MM-DD HH:mm:ss'), elapsedtime:item.copy_end_time===null?"无":item.copy_end_time===undefined?"无":item.copy_end_time===""?"无":moment(item.copy_end_time).format('YYYY-MM-DD HH:mm:ss'),
empvalue:item.code_rate, empvalue:item.code_rate,
challenge_id:{id:item.id},
copy_user_id:item.copy_user_id
// adjustmentminute:asdasd // adjustmentminute:asdasd
}) })
}) })
@ -112,6 +155,22 @@ class ShixunCustomsPass extends Component {
render: (text, record) => ( render: (text, record) => (
<span className={"color-grey-9"}> <span className={"color-grey-9"}>
{record.elapsedtime} {record.elapsedtime}
</span>
),
},{
title: '调分',
key: 'adjustmentminute',
dataIndex: 'adjustmentminute',
render: (text, record) => (
<span>
<a>
{record.copy_user_id===null?"":<InputNumber size="small" className={customsids===record.challenge_id.id?"bor-red":""} defaultValue={record.evaluating.final_score}
onBlur={(e) => this.editgame_scores(e,record.challenge_id.id,record.evaluating.all_score,record.empvalue,record.copy_user_id)}
// min={0} max={record.game_scores.game_score_full}
/>}
</a>
{/*<a style={{textAlign: "center"}} className="color-blue font-14 mr20">查看</a>*/}
</span> </span>
), ),
}, { }, {
@ -138,7 +197,15 @@ class ShixunCustomsPass extends Component {
// }, // },
if(this.props.isAdmin()===false){
columns.some((item,key)=> {
if (item.title === "调分") {
columns.splice(key, 1)
return true
}
}
)
}
return ( return (
<div> <div>
@ -177,6 +244,9 @@ class ShixunCustomsPass extends Component {
.customsPass{ .customsPass{
text-align: left !important; text-align: left !important;
} }
.ant-table-thead > tr > th, .ant-table-tbody > tr > td {
padding: 16px 12px;
}
`} `}
</style> </style>
{datas===undefined?"":<Table {datas===undefined?"":<Table

@ -8,6 +8,7 @@ class ShixunPath extends Component{
super(props) super(props)
} }
componentDidMount() { componentDidMount() {
console.log('configShareForPaths')
configShareForPaths() configShareForPaths()
} }

@ -16,8 +16,8 @@ require('codemirror/lib/codemirror.css');
let origin = getUrl(); let origin = getUrl();
let path = getUrl("/editormd/lib/") let path = '/editormd/lib/'
path = getUrl("/editormd/lib/")
const $ = window.$; const $ = window.$;
let timeout; let timeout;
@ -171,7 +171,7 @@ function create_editorMD(id, width, high, placeholder, imageUrl, callback, initV
$("#" + _id + " [type=\"inline\"]").bind("click", function () { $("#" + _id + " [type=\"inline\"]").bind("click", function () {
_editorName.cm.replaceSelection("`$$$$`"); _editorName.cm.replaceSelection("`$$$$`");
var __Cursor = _editorName.cm.getDoc().getCursor(); var __Cursor = _editorName.cm.getDoc().getCursor();
_editorName.cm.setCursor(__Cursor.line, __Cursor.ch - 2); _editorName.cm.setCursor(__Cursor.line, __Cursor.ch - 3);
_editorName.cm.focus(); _editorName.cm.focus();
}); });
$("[type=\"inline\"]").attr("title", "行内公式"); $("[type=\"inline\"]").attr("title", "行内公式");

Loading…
Cancel
Save