dev_cs_new
杨树林 6 years ago
commit c603e8c32c

@ -39,6 +39,7 @@ class ApplicationController < ActionController::Base
@user_course_identity = current_user.course_identity(@course)
if @user_course_identity > Course::STUDENT && @course.is_public == 0
tip_exception(401, "..") unless User.current.logged?
check_account
tip_exception(409, "您没有权限进入")
end
uid_logger("###############user_course_identity:#{@user_course_identity}")

@ -17,6 +17,7 @@ module Searchable::Dependents::User
# reindex subject
created_subjects.each(&:reindex)
subjects.each(&:reindex)
end
end
end

@ -27,6 +27,7 @@ module Searchable::Subject
{
author_name: user.real_name,
author_school_name: user.school_name,
member_user_names: users.map(&:real_name).join(' ')
}
end

@ -246,6 +246,10 @@ class Shixun < ApplicationRecord
Game.joins(:myshixun).where(user_id: user.id, status: 2, myshixuns: { shixun_id: id }).count
end
def has_web_route?
self.mirror_name.include?('JFinal') || self.mirror_name.include?('PHP') && self.mirror_name.include?('Mysql') || self.mirror_name.include?('Web')
end
private
def send_tiding

@ -29,6 +29,7 @@ module ElasticsearchAble
subject_stages: { type: 'plain' },
content: { type: 'plain' },
descendants_contents: { type: 'plain' },
member_user_names: { type: 'plain' }
}
}
end

File diff suppressed because it is too large Load Diff

@ -13,6 +13,7 @@ elsif @tab == 1
# 评测设置的编辑模式
json.(@challenge, :id, :path, :exec_path, :show_type, :original_picture_path, :expect_picture_path, :picture_path,
:web_route, :test_set_score, :test_set_average)
json.has_web_route @shixun.has_web_route?
json.test_sets @challenge.test_sets do |set|
json.hidden (set.is_public ? 0 : 1)
json.(set, :input, :output, :score)

@ -3,6 +3,7 @@ json.candidates do
json.id user.id
json.name user.real_name
json.nickname user.nickname
json.login user.login
json.school_name user.user_extension.school.try(:name)
json.school_id user.user_extension.school.try(:id)
json.added @course.course_member?(user.id, [1, 2, 3])

@ -7,7 +7,8 @@ json.group_list do
end
end
# 未分班展示情况放在最后
if @course_groups.count != (@page.to_i - 1)*@limit.to_i && @course_groups.count < @limit.to_i
if (@course_groups.count != (@page.to_i - 1)*@limit.to_i && @course_groups.count < @limit.to_i) ||
(@page.to_i == 1 && @course_groups.count == 0)
ungroup_work_count = homework_ungroup_works_count(@homework, @ungroup_user_ids)
if ungroup_work_count > 0
json.ungroup_list do

@ -301,8 +301,8 @@ module.exports = {
},
warnings: false,
compress: {
drop_debugger: false,
drop_console: false
drop_debugger: true,
drop_console: true
}
}
}),

@ -10,7 +10,6 @@ broadcastChannelOnmessage('refreshPage', () => {
})
function locationurl(list){
debugger
if (window.location.port === "3007") {
} else {
@ -43,6 +42,10 @@ export function initAxiosInterceptors(props) {
// proxy = "http://testbdweb.educoder.net"
// proxy = "https://testeduplus2.educoder.net"
proxy="http://47.96.87.25:48080"
// wy
// proxy="http://192.168.2.63:3001"
// 在这里使用requestMap控制避免用户通过双击等操作发出重复的请求
// 如果需要支持重复的请求考虑config里面自定义一个allowRepeat参考来控制

@ -68,7 +68,7 @@ class ListPageIndex extends Component{
constructor(props) {
super(props);
this.state={
yslGuideone:true,
yslGuideone:null,
}
}
@ -96,9 +96,8 @@ class ListPageIndex extends Component{
}
render() {
let {yslGuideone} =this.state;
console.log("98");
console.log(yslGuideone);
// console.log(this.props.isAdmin());
// console.log("98");
// console.log(yslGuideone);
return (
<div>
<div className="newMain clearfix">

@ -85,9 +85,9 @@ function buildColumns(that, student_works) {
overflow: 'hidden',
textOverflow: 'ellipsis',
whiteSpace: 'nowrap',
width: '98px',
width: '74px',
margin: '0 auto'
}} title={text}>
}} title={text && text.length > 5 ? text : ''}>
{/* <Tooltip placement="bottom" title={text}>
</Tooltip> */}
{text}
@ -136,7 +136,7 @@ function buildColumns(that, student_works) {
render: (text, record) => (
<span>
<a href="javascript:;" style={{color:'#4CACFF'}}>{record.work_group}</a>
<a href="javascript:void(0);" style={{color:'#4CACFF'}}>{record.work_group}</a>
</span>
),
})
@ -150,7 +150,8 @@ function buildColumns(that, student_works) {
render: (project_info, record) => (
<span>
{project_info && project_info.name && <a href={`/projects/${project_info.id}`} target="_blank"
{project_info && project_info.name && <a href={project_info.id == -1 ? 'javascript:void(0)' : `/projects/${project_info.id}`}
target={ project_info.id == -1 ? '' : "_blank" }
className="overflowHidden1" style={{color:'#4CACFF', width: '80px', margin: '0 auto', display: 'block'}} title={project_info.name}
>{project_info.name}</a>}
</span>
@ -184,7 +185,7 @@ function buildColumns(that, student_works) {
</span>
)},
}, {
width: 150,
width: 106,
title: '更新时间',
dataIndex: 'update_time',
key: 'update_time',
@ -249,7 +250,8 @@ function buildColumns(that, student_works) {
*/
columns.push({
width: 84,
title: <div style={{color: 'rgba(0,0,0,.85)'}}><div style={{color: 'rgba(0,0,0,.85)'}}>匿评</div></div>,
// title: <div style={{color: 'rgba(0,0,0,.85)'}}><div style={{color: 'rgba(0,0,0,.85)'}}>匿评</div>评分</div>,
title: <div style={{color: 'rgba(0,0,0,.85)'}}>匿评评分</div>,
key: 'student_score',
dataIndex: 'student_score',
@ -323,7 +325,7 @@ function buildColumns(that, student_works) {
}
if (isAdminOrStudent || that.props.work_public == true) {
columns.push({
width: 92,
width: 72,
title: '操作',
key: 'operation',
dataIndex: 'operation',
@ -614,6 +616,7 @@ class CommonWorkList extends Component{
ref="checkCodeModal"
{...this.props}
></CheckCodeModal>
<AccessoryModal
{...this.props}
modalname={"补交附件"}
@ -649,6 +652,10 @@ class CommonWorkList extends Component{
position: absolute;
right: 18px;
}
.workListContent .ant-table-thead > tr > th, .workListContent .ant-table-tbody > tr > td {
padding: 10px 1px;
}
`}</style>
<div style={{ background: '#fff'}} className="workListContent">
{ isAdmin && <ul className="clearfix" style={{padding: "20px 40px 10px", position: 'relative', paddingLeft: '24px'}}>

@ -498,13 +498,13 @@ class CoursesBanner extends Component {
</style>
<Breadcrumb separator="|" className={"mt5"}>
<Breadcrumb.Item href={"/courses/"+this.props.match.params.coursesId+"/teachers"}>
<span className="color-grey-c font-16">教师 {coursedata.teacher_count}</span>
<span className="color-grey-c font-16"><span className={"mr10"}>教师</span> <span className={"mr10"}>{coursedata.teacher_count}</span></span>
</Breadcrumb.Item>
<Breadcrumb.Item href={"/courses/"+this.props.match.params.coursesId+"/students"}>
<span className="color-grey-c font-16">学生 {coursedata.student_count}</span>
<span className="color-grey-c font-16"><span className={"mr10 ml10"}>学生</span> <span className={"mr10"}>{coursedata.student_count}</span></span>
</Breadcrumb.Item>
<Breadcrumb.Item>{coursedata.credit===null?"":
<span className="color-grey-c font-16">学分 {coursedata.credit}</span>
<span className="color-grey-c font-16"><span className={"mr10 ml10"}>学分</span> <span className={"mr10"}>{coursedata.credit}</span></span>
}</Breadcrumb.Item>
</Breadcrumb>

@ -221,7 +221,7 @@ class AddStudentModal extends Component{
</p>
<Spin size="large" spinning={isSpin}>
{ users && users.length ? <div>
{ loading || users.length ? <div>
{/* https://github.com/CassetteRocks/react-infinite-scroller/issues/70 */}
<div className="edu-back-skyblue padding10-15" style={{"height":"300px", overflowY: "scroll", overflowAnchor: 'none' }}>
<InfiniteScroll
@ -242,7 +242,7 @@ class AddStudentModal extends Component{
<ConditionToolTip title={candidate.name} condition={candidate.name && candidate.name.length > 12 }>
<label className="task-hide fl" style={{"maxWidth":"208px;"}}>
{ candidate.name ?
<a href={`/users/${candidate.login}`} target="_blank">
<a href={`/users/${candidate.login}`} target="_blank" style={{"maxWidth":"208px;"}}>
{ candidate.name }
</a> : <span> </span> }
</label>

@ -205,7 +205,7 @@ class AddTeacherModal extends Component{
{`
.demo-loading-container {
position: absolute;
bottom: 93px;
bottom: 210px;
width: 82%;
text-align: center;
}
@ -265,7 +265,7 @@ class AddTeacherModal extends Component{
<span className="fl with10"><label className="task-hide fl" style={{"maxWidth":"48px"}}>{''}</label></span>
</p>
{ candidates && candidates.length ? <div>
{ loading || candidates.length ? <div>
{/* https://github.com/CassetteRocks/react-infinite-scroller/issues/70 */}
<div className="edu-back-skyblue padding10-15" style={{"height":"300px", overflowY: "scroll", overflowAnchor: 'none' }}>
<InfiniteScroll
@ -284,7 +284,12 @@ class AddTeacherModal extends Component{
<Checkbox className="fl" value={candidate.id} ></Checkbox>
<span className="fl with25">
<ConditionToolTip title={candidate.name} condition={candidate.name && candidate.name.length > 12 }>
<label className="task-hide fl" style={{"maxWidth":"208px;"}}>{candidate.name}</label>
<label className="task-hide fl" style={{"maxWidth":"208px;"}}
>
<a href={`/users/${candidate.login}`} target="_blank"
style={{"color":"#4c4c4c"}}
>{candidate.name}</a>
</label>
</ConditionToolTip>
</span>
<span className="fl with25">

@ -2489,7 +2489,7 @@ class Listofworksstudentone extends Component {
<div className="clearfix">
<span className="fl color-grey-6 font-12"><span
className="color-orange-tip">{teacherdata === undefined ? "" : teacherdata.student_works&&teacherdata.student_works.length}</span>{teacherdata === undefined ? "" : teacherdata.all_member_count} </span>
className="color-orange-tip">{teacherdata === undefined ? "" :teacherdata.student_works&&teacherdata.student_works.length}</span>{teacherdata === undefined ? "" : teacherdata.all_member_count} </span>
<style>
{
`

@ -132,13 +132,14 @@ class ShixunWorkModal extends Component{
onChange=(e)=>{
let{group_list}=this.state;
let {data}=this.props;
if(e.target.checked===true){
if(data&&data.length===0){
let id=[]
group_list.forEach((item,key)=>{
id.push(item.id)
if(item.works_count!=0){
id.push(item.id)
}
})
this.setState({
group_ids:id,
@ -147,7 +148,9 @@ class ShixunWorkModal extends Component{
}else{
let id=[]
group_list.forEach((item,key)=>{
id.push(item.id)
if(item.works_count!=0){
id.push(item.id)
}
})
this.setState({
group_ids:id,
@ -161,6 +164,9 @@ class ShixunWorkModal extends Component{
})
}
}

@ -649,7 +649,7 @@ submittojoinclass=(value)=>{
return (
<div className="newHeader" id="nHeader" >
<div className="newHeaders" id="nHeader" >
{isRender===true?<LoginDialog
Modifyloginvalue={()=>this.Modifyloginvalue()}
@ -662,7 +662,7 @@ submittojoinclass=(value)=>{
{...this.props}
{...this.state}
/>:""}
<a href="/" className={"fl mr60 ml25"}>
<a href="/" className={"fl mr60 ml25 mt15"}>
<img alt="高校智能化教学与实训平台" className="logoimg" src={getImageUrl("images/educoder/headNavLogo.png?1526520218")}></img>
</a>

@ -471,7 +471,22 @@ class TPMBanner extends Component {
})
}
render() {
showonMouseOver=()=>{
$("#ratePanel").show();
this.setState({
showradios:true
})
}
hideonMouseOut=()=>{
$("#ratePanel").hide();
this.setState({
showradios:false
})
}
render() {
let {
Forkvisible,
Senttothetype,
@ -541,21 +556,6 @@ class TPMBanner extends Component {
// }
// }
// }
$("#commentsStar").hover(()=>{
$("#ratePanel").show();
this.setState({
showradios:true
})
},()=>{
$("#ratePanel").hide();
this.setState({
showradios:false
})
})
const radioStyle = {
display: 'block',
height: '30px',
@ -617,12 +617,12 @@ class TPMBanner extends Component {
</li>
</ul>
<div className="pr fl" id="commentsStar">
<div className="pr fl" id="commentsStar" onMouseOver={()=>this.showonMouseOver()}>
<div className={"color-grey-c mb11"} style={{color: "#Fff",textAlign: "center"}}>学员评分</div>
<div className="rateYo">
<Rating value={star_info[0]} disabled allowHalf/>
</div>
<div id="ratePanel" className="showratePanel" style={{"width":"512px"}}>
<div id="ratePanel" className="showratePanel" style={{"width":"512px"}} onMouseOut={()=>this.hideonMouseOut()}>
<div className="pr">
<span className="rateTrangle"></span>
<div className="pr clearfix ratePanelContent" style={{height: '177px'}}>
@ -638,7 +638,7 @@ class TPMBanner extends Component {
</div>
</div>
</div>
<div className="fr">
<div className="fr width360">
<div className="clearfix">
<div className="rateYo fl mt3">
{showradios === true ?

@ -35,14 +35,14 @@ if (!window['indexHOCLoaded']) {
// $('head').append($('<link rel="stylesheet" type="text/css" />')
// .attr('href', `${_url_origin}/stylesheets/educoder/antd.min.css?1525440977`));
$('head').append($('<link rel="stylesheet" type="text/css" />')
.attr('href', `${_url_origin}/stylesheets/css/edu-common.css?7`));
.attr('href', `${_url_origin}/stylesheets/css/edu-common.css?8`));
$('head').append($('<link rel="stylesheet" type="text/css" />')
.attr('href', `${_url_origin}/stylesheets/educoder/edu-main.css?7`));
.attr('href', `${_url_origin}/stylesheets/educoder/edu-main.css?8`));
// index.html有加载
$('head').append($('<link rel="stylesheet" type="text/css" />')
.attr('href', `${_url_origin}/stylesheets/educoder/edu-all.css?7`));
.attr('href', `${_url_origin}/stylesheets/educoder/edu-all.css?8`));
// $('head').append($('<link rel="stylesheet" type="text/css" />')
@ -361,7 +361,16 @@ export function TPMIndexHOC(WrappedComponent) {
max-width: unset;
overflow: hidden;
}
.newHeaders{
max-width: unset;
background: #24292D !important;
width: 100%;
height: 60px !important;
min-width: 1200px;
z-index: 1000;
-moz-box-shadow: 0px 0px 12px rgba(0,0,0,0.1);
box-shadow: 0px 0px 12px rgba(0,0,0,0.1);
}
`
}</style>
<NewHeader {...this.state} {...this.props}></NewHeader>

@ -15,7 +15,7 @@ import axios from 'axios';
import './css/TPMsettings.css';
import { getImageUrl, toPath, getUrl } from 'educoder';
import { getImageUrl, toPath, getUrl ,appendFileSizeToUploadFileAll} from 'educoder';
let origin = getUrl();
@ -1112,16 +1112,20 @@ export default class TPMsettings extends Component {
// this.deleteAttachment(this.state.file);
this.setState({
file:undefined,
deleteisnot:true,
languagewrite:"",
systemenvironment:"",
testcoderunmode:"",
fileList:[]
})
}else {
this.setState({
file:undefined,
deleteisnot:true,
languagewrite:"",
systemenvironment:"",
testcoderunmode:"",
fileList:[]
})
}
// this.props.showNotification('提交成功!');
@ -1154,16 +1158,20 @@ export default class TPMsettings extends Component {
// this.deleteAttachment(this.state.file);
this.setState({
file:undefined,
deleteisnot:true,
languagewrite:"",
systemenvironment:"",
testcoderunmode:"",
fileList:[]
})
}else {
this.setState({
file:undefined,
deleteisnot:true,
languagewrite:"",
systemenvironment:"",
testcoderunmode:"",
fileList:[]
})
}
}
@ -1330,9 +1338,13 @@ export default class TPMsettings extends Component {
}
handleChange = (info) => {
console.log("handleChange1");
let fileList = info.fileList;
this.setState({ fileList:fileList,
deleteisnot:false});
let {fileList}=this.state;
if(fileList.length===0){
let fileLists = info.fileList;
this.setState({ fileList:fileLists,
deleteisnot:false});
}
}
onAttachmentRemove = (file) => {
@ -1660,22 +1672,11 @@ export default class TPMsettings extends Component {
<div className="mt10" style={{
display: "inline-block"
}}>
{
this.state.deleteisnot=== true?
<Upload {...uploadProps} >
<Icon type="upload" className="fl mt3" > </Icon>
<span className="color-blue fl cdefault">上传附件</span>
<span className="color-grey-c fl ml10 ">(单个文件50M以内)</span>
</Upload>
:
<Upload {...uploadProps} disabled={true} >
<Icon type="upload" className="fl mt3" > </Icon>
<span className="color-grey-c fl">上传附件</span>
<span className="color-grey-c fl ml10 ">(单个文件50M以内)</span>
</Upload>
}
<Upload {...uploadProps} >
<Icon type="upload" className="fl mt3" > </Icon>
<span className="color-blue fl cdefault">上传附件</span>
<span className="color-grey-c fl ml10 ">(单个文件50M以内)</span>
</Upload>
</div>
</li>
<div className={"color-red shixunspanred"}>

@ -2,7 +2,7 @@ import React, {Component} from 'react';
import {TPMIndexHOC} from '../TPMIndexHOC';
import {SnackbarHOC} from 'educoder';
import {SnackbarHOC,appendFileSizeToUploadFileAll} from 'educoder';
import {Input, Select, Radio, Checkbox, Modal, Icon, DatePicker,Upload,Button,message,Form,notification} from 'antd';
@ -635,16 +635,20 @@ class Newshixuns extends Component {
// this.deleteAttachment(this.state.file);
this.setState({
file:undefined,
deleteisnot:true,
languagewrite:"",
systemenvironment:"",
testcoderunmode:"",
fileList:[]
})
}else {
this.setState({
file:undefined,
deleteisnot:true,
languagewrite:"",
systemenvironment:"",
testcoderunmode:"",
fileList:[]
})
}
// this.props.showNotification('提交成功!');
@ -676,16 +680,20 @@ class Newshixuns extends Component {
// this.deleteAttachment(this.state.file);
this.setState({
file:undefined,
deleteisnot:true,
languagewrite:"",
systemenvironment:"",
testcoderunmode:"",
fileList:[]
})
}else {
this.setState({
file:undefined,
deleteisnot:true,
languagewrite:"",
systemenvironment:"",
testcoderunmode:"",
fileList:[]
})
}
}
@ -752,10 +760,16 @@ class Newshixuns extends Component {
// 附件相关 START
handleChange = (info) => {
let {fileList}=this.state;
console.log("handleChange1");
let fileList = info.fileList;
this.setState({ fileList:fileList,
deleteisnot:false});
if(fileList.length===0){
let fileLists = info.fileList;
this.setState({
// fileList:appendFileSizeToUploadFileAll(fileList),
fileList:fileLists,
deleteisnot:false});
}
}
onAttachmentRemove = (file) => {
confirm({
@ -1042,32 +1056,12 @@ class Newshixuns extends Component {
<div className="mt10" style={{
display: "inline-block"
}}>
{/*<Form.Item>*/}
{/* {*/}
{/* getFieldDecorator('file',{*/}
{/* rules:[{*/}
{/* }]*/}
{/* })(*/}
{
deleteisnot=== true?
<Upload {...uploadProps} >
<Icon type="upload" className="fl mt3" > </Icon>
<span className="color-blue fl cdefault">上传附件</span>
<span className="color-grey-c fl ml10 ">(单个文件50M以内)</span>
</Upload>
:
<Upload {...uploadProps} disabled={true} >
<Icon type="upload" className="fl mt3" > </Icon>
<span className="color-grey-c fl">上传附件</span>
<span className="color-grey-c fl ml10 ">(单个文件50M以内)</span>
</Upload>
}
{/* )*/}
{/* }*/}
{/*</Form.Item>*/}
<Upload {...uploadProps}>
<Icon type="upload" className="fl mt3" > </Icon>
<span className="color-blue fl cdefault">上传附件</span>
<span className="color-grey-c fl ml10 ">(单个文件50M以内)</span>
</Upload>
</div>
</li>

@ -105,4 +105,8 @@ a:active{text-decoration:none;}
.flexbannerright{
display: flex;
justify-content: flex-end;
}
.width360{
width:360px;
}

@ -247,8 +247,20 @@ class SearchPage extends Component{
})
}
</div>
<div>
{/*合作单位*/}
{item.content.member_user_names === undefined || item.content.member_user_names===0?"": item.content.member_user_names.map((item7, key7) => {
return (
<div className={"df"}>
<span style={{flex: '0 0 82px'}}>合作单位</span>
<span className={key7>1?" tzbq ":" tzbqx"}
dangerouslySetInnerHTML={{__html:item7}} />
</div>
)
})
}
</div>
<div className="mt20">
{/* <span className="ziticor">

@ -169,7 +169,7 @@ input::-ms-clear{display:none;}
.newContainer{ min-height:100%; height: auto !important; height: 100%; /*IE6不识别min-height*/position: relative;}
.educontent{width: 1200px;margin:0px auto;box-sizing: border-box}/*中间部分宽度固定为1200*/
.newMain{ margin: 0 auto; padding-bottom: 235px; min-width:1200px;padding-top: 60px}/*padding-bottom根据底部的高度而定*/
.newMain{ margin: 0 auto; padding-bottom: 235px; min-width:1200px;}/*padding-bottom根据底部的高度而定*/
.newMain{ padding-bottom: 120px !important; }
/*高度*/

Loading…
Cancel
Save