Merge branch 'dev_aliyun' of http://bdgit.educoder.net/Hjqreturn/educoder into dev_aliyun

dev_hs
cxt 5 years ago
commit 7d1e4b5b01

@ -34,8 +34,7 @@ module GitHelper
rescue Exception => e
Rails.logger.error(e.message)
Rails.logger.error("#####__________文档内容获取异常")
# raise Educoder::TipException.new("文档内容获取异常")
raise Educoder::TipException.new("文档内容获取异常")
end
end

@ -484,7 +484,11 @@ module ExercisesHelper
game_code = game_challenge
code = game_code.try(:new_code)
else
begin
code = git_fle_content(game.myshixun.repo_path,cha_path)
rescue
code = ""
end
end
end
if ex_shixun_answer_content.blank? #把关卡的答案存入试卷的实训里

@ -760,9 +760,9 @@ html>body #ajax-indicator { position: fixed; }
.paddingLeft28{padding-left:28px;}
.ant-modal-header{
border-radius: 10px;
}
/*.ant-modal-header{*/
/*border-radius: 10px;*/
/*}*/
.color656565{
color:#656565;

@ -31,8 +31,9 @@ json.shixun_detail do
if shixun_challenge.challenge&.path.present?
if game.try(:lastest_code).blank?
cha_path = challenge_path(shixun_challenge.challenge&.path)
begin
latest_code = git_fle_content(game.myshixun.repo_path,cha_path)
if latest_code.to_s == "true"
rescue
latest_code = ""
end
else

@ -149,7 +149,12 @@ namespace :excellent_course_exercise do
game_code = game_challenge
code = game_code.try(:new_code)
else
begin #8-23,hs
code = git_fle_content(game.myshixun.repo_path,cha_path)
rescue
code = ""
end
# code = git_fle_content(game.myshixun.repo_path,cha_path)
end
end
if ex_shixun_answer_content.blank? #把关卡的答案存入试卷的实训里

@ -1,10 +1,10 @@
const isDev = window.location.port == 3007;
export const TEST_HOST = "https://pre-newweb.educoder.net"
export const TEST_HOST = "http://pre-newweb.educoder.net"
export function getImageUrl(path) {
// https://www.educoder.net
// https://testbdweb.trustie.net
// const local = 'http://localhost:3000'
const local = 'https://pre-newweb.educoder.net'
const local = 'http://pre-newweb.educoder.net'
if (isDev) {
return `${local}/${path}`
}
@ -12,7 +12,7 @@ export function getImageUrl(path) {
}
export function setImagesUrl(path){
const local = 'https://pre-newweb.educoder.net'
const local = 'http://pre-newweb.educoder.net'
let firstStr=path.substr(0,1);
// console.log(firstStr);
if(firstStr=="/"){
@ -31,7 +31,7 @@ export function getUrl(path, goTest) {
// testbdweb.educoder.net testbdweb.trustie.net
// const local = goTest ? 'https://testeduplus2.educoder.net' : 'http://localhost:3000'
// const local = 'https://testeduplus2.educoder.net'
const local = 'https://pre-newweb.educoder.net'
const local = 'http://pre-newweb.educoder.net'
if (isDev) {
return `${local}${path?path:''}`
}

@ -70,3 +70,5 @@ export { CNotificationHOC as CNotificationHOC } from '../modules/courses/common/
export { default as ModalWrapper } from '../modules/courses/common/ModalWrapper'
export { default as NoneData } from '../modules/courses/coursesPublic/NoneData'
export {default as WordNumberTextarea} from '../modules/modals/WordNumberTextarea'

@ -174,7 +174,7 @@ class TPIContextProvider extends Component {
}
let testPath = ''
if (window.location.port == 3007) {
testPath = 'https://pre-newweb.educoder.net'
testPath = 'http://pre-newweb.educoder.net'
}
// var url = `${testPath}/api/v1/games/${ game.identifier }/cost_time`
var url = `${testPath}/api/tasks/${ game.identifier }/cost_time`

@ -25,9 +25,9 @@ body {
.ant-message{
z-index: 20000;
}
.ant-modal-header{
border-radius: 10px;
}
/*.ant-modal-header{*/
/*border-radius: 10px;*/
/*}*/
.ant-upload-list-item-info .anticon-loading, .ant-upload-list-item-info .anticon-paper-clip{
color: #29bd8b !important;
}

@ -1,9 +1,11 @@
import React,{ Component } from "react";
import { Modal,Checkbox,Upload,Button,Icon,message,notification} from "antd";
import { WordsBtn,getUrl, getUploadActionUrl} from 'educoder';
import { Modal,Checkbox,Upload,Button,Icon,message,notification,Input} from "antd";
import { WordsBtn,getUrl, getUploadActionUrl,WordNumberTextarea} from 'educoder';
import axios from 'axios';
import Modals from '../../modals/Modals';
const CheckboxGroup = Checkbox.Group;
const { TextArea } = Input;
class AccessoryModal extends Component{
constructor(props){
@ -19,6 +21,7 @@ class AccessoryModal extends Component{
updatas:false,
shixunsreplace:false,
Errormessage:false,
description:undefined
}
}
@ -238,6 +241,7 @@ class AccessoryModal extends Component{
ModalSave,
loadtype,
shixunsreplace,
description
}=this.state;
let {course_groups}=this.props;
const uploadProps = {
@ -258,7 +262,6 @@ class AccessoryModal extends Component{
},
};
return(
<React.Fragment>
@ -335,23 +338,24 @@ class AccessoryModal extends Component{
</Upload>
</p>
<textarea placeholder="请在此输入补交附件的原因最大限制100个字符" className={"mt20"} value={settextarea} onInput={this.settextarea} style={{
width: '100%',
height:'150px',
border:'1px solid rgba(234,234,234,1)',
padding: '10px'
}}></textarea>
<WordNumberTextarea
placeholder={`请在此输入补交附件的原因,最大限制${this.props.maxFontLength || 100}个字符`}
onInput={(e)=>this.settextarea(e)}
value={description}
maxlength={100}
/>
{
this.state.Errormessage && this.state.Errormessage === true ?
<p className="color-red mt5 mb5 " style={{width: " 100%", height: "20px"}}>
<span className="fl" style={{textAlign:"left",width: " 100%"}}>还未上传附件</span>
</p>
: <div style={{height:"25px"}}></div>
: ""
}
{this.state.updatas===true?<span className={"color-red"}>请上传附件</span>:""}
<div className="clearfix mt30 edu-txt-center mb10">
<a className="task-btn color-white mr70" onClick={this.props.Cancel}>{this.props.Cancelname || '取消'}</a>
<a className="task-btn color-white mr30" onClick={this.props.Cancel}>{this.props.Cancelname || '取消'}</a>
<a className="task-btn task-btn-orange" onClick={()=>this.Saves()}>{this.props.Savesname || '确认'}</a>
</div>

@ -1,6 +1,6 @@
import React,{ Component } from "react";
import { Modal,Checkbox,Upload,Button,Icon,message,Input} from "antd";
import { WordNumberTextarea } from 'educoder';
class ModulationModal extends Component{
constructor(props){
@ -78,12 +78,20 @@ class ModulationModal extends Component{
<div className="clearfix">
<textarea
className="winput-100-150"
placeholder="请填写您对作品调分的原因"
{/*<textarea*/}
{/*className="winput-100-150"*/}
{/*placeholder="请填写您对作品调分的原因"*/}
{/*value={textareaval}*/}
{/*onInput={this.settextarea}*/}
{/*></textarea>*/}
<WordNumberTextarea
placeholder={"请填写您对作品调分的原因"}
onInput={(e)=>this.settextarea(e)}
value={textareaval}
onInput={this.settextarea}
></textarea>
maxlength={100}
/>
<li style={{height:"20px",lineHeight:"20px"}}><span className={textareavaltype===true?"color-red":"none"}>原因不能为空</span></li>
</div>
<li>

@ -77,16 +77,6 @@ class GraduationTasksSubmitedit extends Component{
}
setedit=()=>{
// let coursesId=this.props.match.params.coursesId;
// let workId=this.props.match.params.work_Id;
// let {workslist}=this.state
// let task_id=workslist&&workslist.task_id;
// window.location.href="/courses/"+coursesId+"/graduation_tasks/"+task_id+"/"+workId+"/works/edit";
this.goback()
}
handleSelectChange = (value) => {
console.log(value);
@ -103,7 +93,8 @@ class GraduationTasksSubmitedit extends Component{
// }else{
// this.props.history.push(this.props.current_user.first_category_url);
// }
this.props.history.goBack()
this.props.history.replace(`/courses/${this.state.workslist.course_id}/graduation_tasks/${this.state.workslist.graduation_id}`);
}
@ -378,6 +369,9 @@ class GraduationTasksSubmitedit extends Component{
}
Commoninterface =(fileList,selectmemberslist,workslist)=>{
let coursesIds=this.props.match.params.coursesId
let workId=this.props.match.params.work_Id;
let userids=[];
for(var list of selectmemberslist){
@ -424,7 +418,7 @@ class GraduationTasksSubmitedit extends Component{
this.setState({
spinnings:true
})
let workId=this.props.match.params.work_Id;
// if(fileList.length===0){
// this.setState({
@ -444,8 +438,8 @@ class GraduationTasksSubmitedit extends Component{
spinnings:false
})
if(response!== undefined){
this.setedit()
// this.goback()
window.location.href=`/courses/${coursesIds}/graduation_tasks/${workId}/appraise`
}
// if(response.status===200) {
// GraduationTasksnewtype=false;

@ -105,7 +105,7 @@ class GraduationTasksSubmitnew extends Component{
// }else{
// this.props.history.push(this.props.current_user.first_category_url);
// }
this.props.history.goBack()
this.props.history.replace(`/courses/${this.state.workslist.course_id}/graduation_tasks/${this.state.workslist.graduation_id}`);
}
@ -361,9 +361,7 @@ class GraduationTasksSubmitnew extends Component{
return false;
}
}
gocannel=()=>{
this.props.history.goBack()
}
//公用数据
Commoninterface = (fileList,selectmemberslist,workslist)=>{

@ -76,7 +76,9 @@ class GraduationTasksappraise extends Component{
// }else{
// this.props.history.push(this.props.current_user.first_category_url);
// }
this.props.history.goBack()
this.props.history.replace(`/courses/${this.state.datalist.course_id}/graduation_tasks/${this.state.datalist.graduation_id}/${this.state.datalist.task_id}/list`);
}
Cancelvisible=()=>{

@ -18,7 +18,7 @@ class GraduationTasksedit extends Component{
this.state={
coursename:"",
coursesearch:"",
title_num:60,
title_num:0,
title_value:"",
fileList: [],
contents: [{val:"",id:1}],
@ -53,14 +53,14 @@ class GraduationTasksedit extends Component{
//
// }
let namelength=result.data.task_name.length;
let sixlength=title_num-namelength
// let sixlength=title_num-namelength
this.setState({
// fileList:newfilelist,
description:result.data.description,
tasktype:result.data.task_type,
name:result.data.task_name,
data:result.data,
title_num:sixlength,
title_num:namelength,
attachments:result.data.attachments,
})
@ -88,15 +88,15 @@ class GraduationTasksedit extends Component{
// }else{
// this.props.history.push(this.props.current_user.first_category_url);
// }
this.props.history.goBack()
this.props.history.replace(`/courses/${this.state.data.course_id}/graduation_tasks/${this.state.data.graduation_id}`);
}
// 输入title
changeTitle=(e)=>{
// title_num:60-parseInt(e.target.value.length),
this.setState({
title_num:60-parseInt(e.target.value.length),
title_num:e.target.value.length,
title_value:e.target.value
})
@ -379,7 +379,7 @@ class GraduationTasksedit extends Component{
<Form.Item label="任务标题" >
{getFieldDecorator('name', {
rules: [{ required: true, message: "请输入标题" }],
})(<Input placeholder="请输入任务名称最大限制60个字符" value={name} onInput={this.changeTitle} className="searchView searchViewAfter" style={{"width":"100%"}} maxLength="60" suffix={String(title_num)}/>)}
})(<Input placeholder="请输入任务名称最大限制60个字符" value={name} onInput={this.changeTitle} className="searchView searchViewAfter" style={{"width":"100%"}} maxLength="60" suffix={String(title_num)+"/60"}/>)}
</Form.Item>
<input type="hidden" id='nametypes' />
</div>

@ -19,7 +19,7 @@ class GraduationTasksnew extends Component {
this.state = {
coursename: "",
coursesearch: "",
title_num: 60,
title_num: 0,
title_value: "",
fileList: [],
contents: [{val: "", id: 1}],
@ -113,15 +113,16 @@ class GraduationTasksnew extends Component {
// }else{
// this.props.history.push(this.props.current_user.first_category_url);
// }
this.props.history.goBack()
// this.props.history.goBack()
this.props.history.replace(`/courses/${this.props.match.params.coursesId}/graduation_tasks/${this.props.match.params.category_id}`);
}
// 输入title
changeTitle = (e) => {
// title_num: 60 - parseInt(e.target.value.length),
this.setState({
title_num: 60 - parseInt(e.target.value.length),
title_num: e.target.value.length,
title_value: e.target.value
})
@ -384,7 +385,7 @@ class GraduationTasksnew extends Component {
rules: [{required: true, message: "不能为空"}],
})(<Input placeholder="请输入任务名称最大限制60个字符" value={title_value} onInput={this.changeTitle}
className="searchView searchViewAfter h40" style={{"width": "100%"}} maxLength="60"
suffix={String(title_num)}/>)}
suffix={String(title_num)+"/60"}/>)}
</Form.Item>
<input type="hidden" id='nametypes' />
</div>

@ -771,7 +771,10 @@ class GraduationTaskssettingapp extends Component{
// }else{
// this.props.history.push(this.props.current_user.first_category_url);
// }
this.props.history.goBack()
// this.props.history.goBack()
// this.props.history.replace(this.props.current_user.first_category_url);
this.props.history.replace(`/courses/${this.state.settingdata.course_id}/graduation_tasks/${this.state.settingdata.graduation_id}`);
}
isgoback=()=>{

@ -66,7 +66,8 @@ class GraduationTaskssettinglist extends Component{
// }else{
// this.props.history.push(this.props.current_user.first_category_url);
// }
this.props.history.goBack()
// this.props.history.goBack()
this.props.history.replace(`/courses/${this.state.taskslistdata.course_id}/graduation_tasks/${this.state.taskslistdata.graduation_id}`);
}
seacthdata=(teacher_comment,task_status,course_group,cross_comment,order,b_order,search,pages)=>{

@ -62,7 +62,8 @@ class GraduationTasksquestions extends Component{
// this.props.history.push(this.props.current_user.first_category_url);
// }
this.props.history.goBack()
// this.props.history.goBack()
this.props.history.replace(`/courses/${this.state.questionslist.course_id}/graduation_tasks/${this.state.questionslist.graduation_id}`);
}
end=()=>{

@ -113,21 +113,19 @@ class ShixunHomeworkPage extends Component {
bindRef = ref => { this.child = ref }
///////////////教师截止
gotohome=()=>{
// let courseId=this.props.match.params.coursesId;
// if(courseId===undefined){
// this.props.history.push("/courses");
// }else{
// this.props.history.push(this.props.current_user.first_category_url);
// }
this.props.history.goBack()
// console.log(this.props)
let {jobsettingsdatapage}=this.state
this.props.history.replace(`/courses/${this.props.match.params.coursesId}/${jobsettingsdatapage === undefined ? "" : jobsettingsdatapage.data.category.mian === 1 ? "shixun_homeworks" :"shixun_homework"}/${jobsettingsdatapage === undefined ? "" : jobsettingsdatapage.data.category.category_id === undefined ? "" : jobsettingsdatapage.data.category.category_id}`);
}
render() {
let {tab, teacherdatapage, jobsettingsdatapage} = this.state;
const isAdmin = this.props.isAdmin();
// console.log(119)
// console.log(jobsettingsdatapage);
// console.log(teacherdatapage);
console.log(jobsettingsdatapage);
return (
<div className="newMain clearfix ">
@ -136,11 +134,11 @@ class ShixunHomeworkPage extends Component {
<div className="educontent mb20">
<p className="clearfix mb20 mt10">
<a className="btn colorgrey fl hovercolorblue " onClick={()=>this.gotohome()}>{jobsettingsdatapage === undefined ? "" : jobsettingsdatapage.data.course_name}</a>
<Link className="btn colorgrey fl hovercolorblue " to={this.props.current_user.first_category_url}>{jobsettingsdatapage === undefined ? "" : jobsettingsdatapage.data.course_name}</Link>
<span className="color-grey-9 fl ml3 mr3">&gt;</span>
<a
className=" btn colorgrey fl hovercolorblue "
href={`/courses/${this.props.match.params.coursesId}/${this.state.shixuntypes}/${jobsettingsdatapage === undefined ? "" : jobsettingsdatapage.data.category.category_id === undefined ? "" : jobsettingsdatapage.data.category.category_id}`}>{jobsettingsdatapage === undefined ? "" : jobsettingsdatapage.data.category.category_name}</a>
href={`/courses/${this.props.match.params.coursesId}/${jobsettingsdatapage === undefined ? "" : jobsettingsdatapage.data.category.mian === 1 ? "shixun_homeworks" :"shixun_homework"}/${jobsettingsdatapage === undefined ? "" : jobsettingsdatapage.data.category.category_id === undefined ? "" : jobsettingsdatapage.data.category.category_id}`}>{jobsettingsdatapage === undefined ? "" : jobsettingsdatapage.data.category.category_name}</a>
<span className="color-grey-9 fl ml3 mr3">&gt;</span>
<WordsBtn className="fl">作业详情</WordsBtn>
</p>
@ -240,14 +238,14 @@ class ShixunHomeworkPage extends Component {
<a className="fr color-blue font-16" onClick={(child)=>this.workshowmodels(this.child)}>代码查重</a>
: "" : ""}
{this.state.view_report === true ? <Link className="fr color-blue font-16" target={"_blank"}
to={`/courses/${this.props.match.params.coursesId}/${this.state.shixuntypes}/${teacherdatapage&&teacherdatapage.work_id}/shixun_work_report`}>
to={`/courses/${this.props.match.params.coursesId}/${jobsettingsdatapage === undefined ? "" : jobsettingsdatapage.data.category.mian === 1 ? "shixun_homeworks" :"shixun_homework"}/${teacherdatapage&&teacherdatapage.work_id}/shixun_work_report`}>
查看实训报告
</Link> : ""}
{
teacherdatapage === undefined ? ""
: teacherdatapage.commit_des === null || teacherdatapage.commit_des === undefined ? "" :
<a className="fr color-blue font-16"
href={`/courses/${this.props.match.params.coursesId}/${this.state.shixuntypes}/${teacherdatapage === undefined ? "" : teacherdatapage.id}/commitsummary/${this.props.match.params.homeworkid}`}>{teacherdatapage.commit_des}</a>
href={`/courses/${this.props.match.params.coursesId}/${jobsettingsdatapage === undefined ? "" : jobsettingsdatapage.data.category.mian === 1 ? "shixun_homeworks" :"shixun_homework"}/${teacherdatapage === undefined ? "" : teacherdatapage.id}/commitsummary/${this.props.match.params.homeworkid}`}>{teacherdatapage.commit_des}</a>
}
{teacherdatapage === undefined ? "" : <Startshixuntask
{...this.props}

@ -58,7 +58,9 @@ class ShixunWorkDetails extends Component {
// }else{
// window.history.go(-1)
// }
this.props.history.goBack()
// this.props.history.goBack()
// "/courses/1545/shixun_homeworks/15220/list?tab=2"
this.props.history.replace(`/courses/${this.props.match.params.coursesId}/shixun_homeworks/${this.props.match.params.homeworkid}/list?tab=2`);
}
render() {
let{data}=this.state;

@ -116,8 +116,7 @@ class ShixunWorkReport extends Component {
}
goback = () => {
this.props.history.goBack()
this.props.history.replace(`/courses/${this.props.match.params.coursesId}/shixun_homeworks/${this.state.data.homework_common_id}/list?tab=0`);
}
render() {
let{data} =this.state;
@ -159,7 +158,7 @@ class ShixunWorkReport extends Component {
{/*className="fr color-blue font-16"*/}
{/*onClick={()=>this.confirmysl(`/student_works/${homeworkid}/export_shixun_work_report.pdf`)}*/}
{/*>导出实训报告数据</a> : ""}*/}
{/*<a onClick={this.goback} className="color-grey-6 fr font-16 ml30 mt15 mr20">返回</a>*/}
<a onClick={this.goback} className="color-grey-6 fr font-16 ml30 mt15 mr20">返回</a>
</div>
<div className="stud-class-set">

@ -0,0 +1,42 @@
.WordNumberTextarea {
outline: none; /* 去掉输入字符时的默认样式 */
appearance:none;
-webkit-appearance:none;
-moz-appearance:none;
background-color: white;
text-shadow: none;
-webkit-writing-mode: horizontal-tb !important;
-webkit-tap-highlight-color:rgba(0,0,0,0);
resize:none; /*禁止拉伸*/
border: none; /*去掉默认边框*/
width: 100%;
height:150px;
border:none;
padding: 10px;
display: block;
}
.WordNumbernote {
padding: 0;
margin: 0;
list-style: none;
text-decoration: none;
box-sizing: border-box;
overflow: hidden;
height: auto;
border: 1px solid rgba(234,234,234,1);
border-radius: 0.125rem;
margin: 0.31rem;
padding: 0.19rem;
backgroud:rgba(234,234,234,1);
padding-bottom: 10px;
padding-right: 10px;
}
.WordNumberTextarea-count {
display: inline-block;
float: right;
font-size: 0.28rem;
color: #adadad;
padding-right: 0.25rem;
}

@ -0,0 +1,23 @@
import React, { Component } from 'react';
import './WordNumberTextarea.css';
class WordNumberTextarea extends Component {
constructor(props) {
super(props);
}
render() {
return(
<div className="WordNumbernote">
<textarea
placeholder={this.props.placeholder}
className="WordNumberTextarea"
value={this.props.value}
onInput={(e)=>this.props.onInput(e)}
maxlength={this.props.maxlength}
/>
<div className="WordNumberTextarea-count"><span>{this.props.value===undefined?0:this.props.value.length}</span>/{this.props.maxlength}</div>
</div>
)
}
}
export default WordNumberTextarea;

@ -46,7 +46,7 @@ function loadMonacoResouce(callback) {
prefix = ''
} else {
// _url_origin = `https://testeduplus2.educoder.net/`;
_url_origin = 'https://pre-newweb.educoder.net';
_url_origin = 'http://pre-newweb.educoder.net';
}
const $ = window.$;

@ -23,7 +23,7 @@ const versionNum = '0001';
// let _url_origin = getUrl()
let _url_origin='';
if(window.location.port === "3007"){
_url_origin="https://pre-newweb.educoder.net";
_url_origin="http://pre-newweb.educoder.net";
}
// let _url_origin=`https://www.educoder.net`;

@ -3752,3 +3752,7 @@ a.singlepublishtwo{
.pointer{
cursor: pointer;
}
.has-error .ant-input:focus{
border-color: #ff4d4f !important;
}

@ -761,9 +761,9 @@ html>body #ajax-indicator { position: fixed; }
.paddingLeft28{padding-left:28px;}
.ant-modal-header{
border-radius: 10px;
}
/*.ant-modal-header{*/
/*border-radius: 10px;*/
/*}*/
.color656565{
color:#656565;

Loading…
Cancel
Save