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

courseware
daiao 5 years ago
commit 27f8cc68c5

@ -13,7 +13,7 @@ class Admins::CoursesController < Admins::BaseController
format.js
format.html
format.xlsx do
@courses = courses.includes(:school, :students, :teacher_course_members, :informs, :course_videos, :attachments, :homework_commons, :course_activities, teacher: [user_extension: :department])
@courses = courses.not_deleted.includes(:school, :students, :teacher_course_members, :informs, :course_videos, :attachments, :homework_commons, :course_activities, teacher: [user_extension: :department])
filename = "课堂列表_#{Time.current.strftime('%Y%m%d%H%M%S')}.xlsx"
render xlsx: 'index', filename: filename
end

@ -330,7 +330,7 @@ class ApplicationController < ActionController::Base
end
if !User.current.logged? && Rails.env.development?
User.current = User.find 1
User.current = User.find 8825
end

@ -11,7 +11,7 @@ class HomeworkCommonsController < ApplicationController
before_action :find_homework, only: [:edit, :show, :update, :group_list, :homework_code_repeat, :code_review_results,
:code_review_detail, :show_comment, :settings, :works_list, :update_settings,
:reference_answer, :publish_groups, :end_groups, :alter_name, :update_explanation,
:update_score, :update_student_score, :batch_comment]
:update_score, :update_student_score, :batch_comment, :get_next_work]
before_action :user_course_identity
before_action :homework_publish, only: [:show, :works_list, :code_review_results, :show_comment, :settings, :reference_answer,
:update_student_score]
@ -287,6 +287,15 @@ class HomeworkCommonsController < ApplicationController
end
end
def get_next_work
member = @course.course_member(current_user.id)
student_works = @homework.teacher_works(member).where.not(id: @homework.student_works_scores.where(reviewer_role: [1, 2]))
if params[:work_id]
student_works = student_works.where.not(id: params[:work_id])
end
@work = student_works.where("work_status > 0").take
end
def update_score
tip_exception("作业还未发布,暂不能计算成绩") if @homework.publish_time.nil? || @homework.publish_time > Time.now
@homework.update_homework_work_score

@ -3,7 +3,7 @@ wb = xlsx_package.workbook
wb.styles do |s|
blue_cell = s.add_style :bg_color => "FAEBDC", :sz => 10,:height => 25,:b => true, :border => { :style => :thin, :color =>"000000" },:alignment => {wrap_text: true,:horizontal => :center,:vertical => :center}
wb.add_worksheet(name: "课堂列表") do |sheet|
sheet.add_row %w(ID 课堂名称 老师 学生 资源 公告 视频 普通作业 分组作业 实训作业 实训作业已发布数 作品数 试卷 评测次数 私有 状态 单位 部门 创建者 创建时间 动态时间), :height => 25,:style => blue_cell
sheet.add_row %w(ID 课堂名称 老师 学生 分班数 资源 公告 视频 普通作业 分组作业 实训作业 实训作业已发布数 作品数 试卷 评测次数 私有 状态 单位 部门 创建者 创建时间 动态时间), :height => 25,:style => blue_cell
@courses.each do |course|
data = [
@ -11,6 +11,7 @@ wb.styles do |s|
course.name,
course.teacher_course_members.size,
course.students.size,
course.course_groups_count,
get_attachment_count(course, 0),
course.informs.size,
course.course_videos.size,

@ -0,0 +1,2 @@
json.work_id @work&.id
json.user_name @work&.user&.real_name

@ -597,6 +597,7 @@ Rails.application.routes.draw do
get :update_score
get :update_student_score
post :batch_comment
get :get_next_work
end
collection do

@ -44,7 +44,9 @@ export default ({ src, videoId, logWatchHistory, courseId = null }) => {
let pos = []//
const log = useCallback((callback, isEnd = false) => {
let params = {}
let params = {
point: el.currentTime.currentTime
}
if (logId) {
params['log_id'] = logId
params['watch_duration'] = getTotalEffectTime(pos) //
@ -137,7 +139,7 @@ export default ({ src, videoId, logWatchHistory, courseId = null }) => {
log()
}
}
}else {
} else {
lastUpdatedTime = newTime
}
}
@ -177,7 +179,7 @@ export default ({ src, videoId, logWatchHistory, courseId = null }) => {
el.current.removeEventListener('seeking', onSeeking)
el.current.removeEventListener('seeked', onSeeked)
el.current.removeEventListener('timeupdate', onTimeupdate)
if(el.current.playing) {
if (el.current.playing) {
log()
}
}

@ -379,7 +379,7 @@ function buildColumns(that, student_works, studentData) {
<a style={{color: '#4CACFF', marginLeft: '4px'}} id={"asdasdasdasd"}
onMouseDown={(e) => that.props.toWorkDetailPage2(e, courseId, workId, record.id)}
// onClick={() => that.props.toWorkDetailPage(courseId, workId, record.id)}
>{isAdmin ? '评阅' : '查看'}</a>
>{isAdmin ? record.has_comment===true?"已评阅":'评阅':"查看"}</a>
</div>
@ -692,7 +692,7 @@ class CommonWorkList extends Component{
modulationModalVisible, work_statuses,
id, user_name, user_login, student_id, group_name, work_status, update_time, teacher_score, teaching_asistant_score, student_score,
ultimate_score, work_score, student_comment_count, appeal_all_count, appeal_deal_count,
ultimate_score, work_score, student_comment_count, appeal_all_count, appeal_deal_count,has_comment,
late_penalty, absence_penalty, appeal_penalty,user_comment_count
, end_immediately, publish_immediately

@ -26,4 +26,8 @@
overflow:hidden;
text-overflow:ellipsis;
white-space:nowrap
}
.color32C090{
color:#32C090 !important;
}

@ -0,0 +1,68 @@
import React from 'react';
import Modals from "../../modals/Modals";
import axios from 'axios';
class Chongzuomodel extends React.Component {
constructor(props) {
super(props);
this.state = {
ModalsType:false,
antIcon:false
}
}
componentDidMount(){
this.setState({
ModalsType:this.props.Chongzuomodeltype,
Modalstopval:`该作业将被打回重做,学生实训记录将被清空!`,
ModalsBottomval:`确定打回?`,
})
}
ModalSaves=()=>{
this.setState({
antIcon:true
})
let zrl=`/myshixuns/${this.props.chongzuoId}/reset_my_game.json`;
axios.get(zrl).then((response) => {
this.setState({
antIcon:false
})
this.props.showNotification("操作成功");
this.props.hideChongzuomodeltype()
this.props.Isupdatass();
}).catch((error) => {
this.setState({
antIcon:false
})
});
}
ModalCancels=()=>{
this.props.hideChongzuomodeltype()
}
render() {
//console.log(this.props)
// Chongzuomodeltype:undefined,
// chongzuoId:undefined,
return (
<React.Fragment>
<Modals
modalsType={this.state.ModalsType}
modalsTopval={this.state.Modalstopval}
modalsBottomval={this.state.ModalsBottomval}
modalSave={()=>this.ModalSaves()}
modalCancel={()=>this.ModalCancels()}
loadtype={false}
antIcon={this.state.antIcon}
>
</Modals>
</React.Fragment>
);
}
}
export default Chongzuomodel;

@ -1,19 +1,10 @@
import React, {Component} from "react";
import CoursesListType from '../coursesPublic/CoursesListType';
import {getRandomcode, publicSearchs, sortDirections} from 'educoder';
import {
Form,
Select,
Input,
Button,
Checkbox,
Upload,
Icon,
message,
Modal,
Table,
Pagination,
Radio,
Tooltip,
notification,
Spin,
@ -30,18 +21,15 @@ import './Challenges.css';
import {getImageUrl} from 'educoder';
import TraineetraininginformationModal from "./TraineetraininginformationModal";
import DownloadMessageysl from '../../modals/DownloadMessageysl';
import Startshixuntask from "../coursesPublic/Startshixuntask";
import ModulationModal from "../coursesPublic/ModulationModal";
import HomeworkModal from "../coursesPublic/HomeworkModal";
import OneSelfOrderModal from "../coursesPublic/OneSelfOrderModal";
import ShixunWorkModal from "./Shixunworkdetails/ShixunWorkModal";
import NoneData from '../../../modules/courses/coursesPublic/NoneData';
import Chongzuomodel from "./Chongzuomodel";
const Search = Input.Search;
const RadioGroup = Radio.Group;
const CheckboxGroup = Checkbox.Group;
const {Option} = Select;
//GraduationTaskssetting.js
//作品列表(学生)
let allow_lates=false;
@ -65,6 +53,8 @@ class Listofworksstudentone extends Component {
//关卡得分final_score
this.state = {
Chongzuomodeltype:undefined,
chongzuoId:undefined,
searchtypes:false,
jobsettingsdata: undefined,
endTime: "2018/11/10 17:10:00",
@ -280,7 +270,11 @@ class Listofworksstudentone extends Component {
width: '98px',
render: (text, record) => (
<span style={{width: '98px',}}>
<span style={record.submitstate === "迟交通关" ? {
<span style={record.submitstate === "重做中" ?{
color: '#FF8432',
textAlign: "center",
width: '98px',
}:record.submitstate === "迟交通关" ? {
color: '#DD1717',
textAlign: "center",
width: '98px',
@ -675,7 +669,11 @@ class Listofworksstudentone extends Component {
width: '98px',
render: (text, record) => (
<span style={{width: '98px',}}>
<span style={record.submitstate === "迟交通关" ? {
<span style={record.submitstate === "重做中" ?{
color: '#FF8432',
textAlign: "center",
width: '98px',
}:record.submitstate === "迟交通关" ? {
color: '#DD1717',
textAlign: "center",
width: '98px',
@ -1029,7 +1027,11 @@ class Listofworksstudentone extends Component {
align: 'center',
className: 'font-14',
render: (text, record) => (
<span style={record.submitstate === "迟交通关" ? {
<span style={record.submitstate === "重做中" ?{
color: '#FF8432',
textAlign: "center",
width: '98px',
}:record.submitstate === "迟交通关" ? {
color: '#DD1717',
textAlign: "center"
} : record.submitstate === "按时通关" ? {color: '#29BD8B', textAlign: "center"}
@ -1297,16 +1299,35 @@ class Listofworksstudentone extends Component {
width: '80px',
render: (text, record) => (
record.submitstate === "未开启" ?
<a style={{textAlign: "center",width: '40px'}} className="color-blue"
onMouseDown={(e) => this.Viewstudenttraininginformationtysl2(e, record)}
// onClick={() => this.Viewstudenttraininginformationt(record)}
>{record.has_comment===true?"已评阅":"评阅 "}</a> :
<span>
<a style={{textAlign: "center"}} className="color-blue"
onMouseDown={(e) => this.Viewstudenttraininginformationtysl2(e, record)}
// onClick={() => this.Viewstudenttraininginformationt(record)}
>{record.has_comment===true?"已评阅":"评阅 "}</a>
</span>
<div>
<a style={{textAlign: "center",width: '40px'}} className="color-blue"
onMouseDown={(e) => this.Viewstudenttraininginformationtysl2(e, record)}
>{record.has_comment===true?"已评阅":"评阅 "}</a>
</div>
{this.props.teacherdatapage === undefined ? "": this.props.teacherdatapage.homework_status[0]==="已截止"?"":record.myshixun_id===0?"":<div>
<a style={{textAlign: "center",width: '40px'}} className="color32C090"
onMouseDown={(e) => this.chongzuofun(record.myshixun_identifier)}
>重做</a>
</div>}
</span>:
<span>
<div>
<a style={{textAlign: "center"}} className="color-blue"
onMouseDown={(e) => this.Viewstudenttraininginformationtysl2(e, record)}
>{record.has_comment===true?"已评阅":"评阅 "}</a>
</div>
{this.props.teacherdatapage === undefined ? "": this.props.teacherdatapage.homework_status[0]==="已截止"?"":record.myshixun_id===0?"":<div>
<a style={{textAlign: "center",width: '40px'}} className="color32C090"
onMouseDown={(e) => this.chongzuofun(record.myshixun_identifier)}
>重做</a>
</div>}
</span>
)
},
],
@ -1407,7 +1428,11 @@ class Listofworksstudentone extends Component {
align: 'center',
className: 'font-14',
render: (text, record) => (
<span style={record.submitstate === "迟交通关" ? {
<span style={record.submitstate === "重做中" ?{
color: '#FF8432',
textAlign: "center",
width: '98px',
}:record.submitstate === "迟交通关" ? {
color: '#DD1717',
textAlign: "center"
} : record.submitstate === "按时通关" ? {color: '#29BD8B', textAlign: "center"}
@ -1664,16 +1689,34 @@ class Listofworksstudentone extends Component {
width: '80px',
render: (text, record) => (
record.submitstate === "未开启" ?
<a style={{textAlign: "center",width: '40px'}} className="color-blue"
onMouseDown={(e) => this.Viewstudenttraininginformationtysl2(e, record)}
// onClick={() => this.Viewstudenttraininginformationt(record)}
>{record.has_comment===true?"已评阅":"评阅"}</a> :
<span>
<div>
<a style={{textAlign: "center",width: '40px'}} className="color-blue"
onMouseDown={(e) => this.Viewstudenttraininginformationtysl2(e, record)}
// onClick={() => this.Viewstudenttraininginformationt(record)}
>{record.has_comment===true?"已评阅":"评阅"}</a>
</div>
{this.props.teacherdatapage === undefined ? "": this.props.teacherdatapage.homework_status[0]==="已截止"?"":record.myshixun_id===0?"":<div>
<a style={{textAlign: "center",width: '40px'}} className="color32C090"
onMouseDown={(e) => this.chongzuofun(record.myshixun_identifier)}
>重做</a>
</div>}
</span>:
<span>
<a style={{textAlign: "center"}} className="color-blue"
<div>
<a style={{textAlign: "center"}} className="color-blue"
onMouseDown={(e) => this.Viewstudenttraininginformationtysl2(e, record)}
// onClick={() => this.Viewstudenttraininginformationt(record)}
>{record.has_comment===true?"已评阅":"评阅"}</a>
</span>
</div>
{this.props.teacherdatapage === undefined ? "": this.props.teacherdatapage.homework_status[0]==="已截止"?"":record.myshixun_id===0?"":<div>
<a style={{textAlign: "center",width: '40px'}} className="color32C090"
onMouseDown={(e) => this.chongzuofun(record.myshixun_identifier)}
>重做</a>
</div>}
</span>
)
},
],
@ -2072,7 +2115,7 @@ class Listofworksstudentone extends Component {
classroom: teacherdata.group_name,
cost_time: teacherdata.cost_time,
has_comment:teacherdata.has_comment,
submitstate: teacherdata.work_status === 0 ? "未开启" : teacherdata.work_status === 1 ? "未通关" : teacherdata.work_status === 2 ? "按时通关" : "迟交通关",
submitstate:teacherdata.work_status === -1 ? "重做中":teacherdata.work_status === 0 ? "未开启" : teacherdata.work_status === 1 ? "未通关" : teacherdata.work_status === 2 ? "按时通关" : "迟交通关",
// updatetime:this.state.teacherdata.student_works[i].update_time,
// updatetime:"",
updatetime: timedata === "Invalid date" ? "--" : timedata,
@ -2118,7 +2161,9 @@ class Listofworksstudentone extends Component {
classroom: student_works[i].group_name,
cost_time: student_works[i].cost_time,
has_comment:student_works[i].has_comment,
submitstate: student_works[i].work_status === 0 ? "未开启" : student_works[i].work_status === 1 ? "未通关" : student_works[i].work_status === 2 ? "按时通关" : "迟交通关",
myshixun_id:student_works[i].myshixun_id,
myshixun_identifier:student_works[i].myshixun_identifier,
submitstate:student_works[i].work_status === -1 ? "重做中":student_works[i].work_status === 0 ? "未开启" : student_works[i].work_status === 1 ? "未通关" : student_works[i].work_status === 2 ? "按时通关" : "迟交通关",
// updatetime:this.state.teacherdata.student_works[i].update_time,
// updatetime:"",
updatetime: timedata === "Invalid date" ? "--" : timedata,
@ -2280,7 +2325,7 @@ class Listofworksstudentone extends Component {
classroom: teacherdata.group_name,
cost_time: teacherdata.cost_time,
has_comment:teacherdata.has_comment,
submitstate: teacherdata.work_status === 0 ? "未开启" : teacherdata.work_status === 1 ? "未通关" : teacherdata.work_status === 2 ? "按时通关" : "迟交通关",
submitstate:teacherdata.work_status === -1 ? "重做中":teacherdata.work_status === 0 ? "未开启" : teacherdata.work_status === 1 ? "未通关" : teacherdata.work_status === 2 ? "按时通关" : "迟交通关",
// updatetime:this.state.teacherdata.student_works[i].update_time,
// updatetime:"",
updatetime: timedata === "Invalid date" ? "--" : timedata,
@ -2645,7 +2690,9 @@ class Listofworksstudentone extends Component {
classroom: student_works[i].group_name,
cost_time: student_works[i].cost_time,
has_comment:student_works[i].has_comment,
submitstate: student_works[i].work_status === 0 ? "未开启" : student_works[i].work_status === 1 ? "未通关" : student_works[i].work_status === 2 ? "按时通关" : "迟交通关",
myshixun_id:student_works[i].myshixun_id,
myshixun_identifier:student_works[i].myshixun_identifier,
submitstate:student_works[i].work_status === -1 ? "重做中":student_works[i].work_status === 0 ? "未开启" : student_works[i].work_status === 1 ? "未通关" : student_works[i].work_status === 2 ? "按时通关" : "迟交通关",
// updatetime:this.state.teacherdata.student_works[i].update_time,
// updatetime:"",
updatetime: timedata === "Invalid date" ? "--" : timedata,
@ -3441,6 +3488,19 @@ class Listofworksstudentone extends Component {
})
}
chongzuofun=(id)=>{
this.setState({
chongzuoId:id,
Chongzuomodeltype:true
})
}
hideChongzuomodeltype=()=>{
this.setState({
chongzuoId:undefined,
Chongzuomodeltype:false
})
}
render() {
let {columns,columnss, course_groupysls, datajs, isAdmin, homework_status, course_groupyslstwo, unlimited, unlimitedtwo, course_group_info, orders, task_status, checkedValuesine, searchtext, teacherlist, visible, visibles, game_list, columnsstu, columnsstu2, limit, experience, boolgalist, viewtrainingdata, teacherdata, page, data, jobsettingsdata, styletable, datas, order, loadingstate, computeTimetype} = this.state;
@ -3482,6 +3542,13 @@ class Listofworksstudentone extends Component {
this.props.isAdmin() === true ?
<div className=" clearfix " style={{margin: "auto", minWidth: "1200px"}}>
{this.state.Chongzuomodeltype===true?<Chongzuomodel
{...this.props}
{...this.state}
hideChongzuomodeltype={()=>this.hideChongzuomodeltype()}
Isupdatass={()=>this.Isupdatass()}
/>:""}
{visible === true ? <ModulationModal
visible={visible}
Cancel={() => this.cancelModulationModel()}

@ -22,6 +22,7 @@ import "../common/formCommon.css";
import '../css/Courses.css';
import './style.css';
import 'moment/locale/zh-cn';
import Chongzuomodel from "./Chongzuomodel";
class ShixunWorkReport extends Component {
@ -39,7 +40,12 @@ class ShixunWorkReport extends Component {
work_comment:undefined,
has_commit: false,
shixun_detail:[],
view_tpi:false
view_tpi:false,
myshixun_id:undefined,
myshixun_identifier:undefined,
homework_end:undefined,
chongzuoId:undefined,
Chongzuomodeltype:false
}
}
@ -117,7 +123,10 @@ class ShixunWorkReport extends Component {
spinning: false,
has_commit: result.data.has_commit,
shixun_detail:result.data.shixun_detail,
view_tpi:result.data.view_tpi
view_tpi:result.data.view_tpi,
myshixun_id:result.data.myshixun_id,
myshixun_identifier:result.data.myshixun_identifier,
homework_end:result.data.homework_end,
})
}
@ -308,8 +317,22 @@ class ShixunWorkReport extends Component {
}
}
Backtoredo=(id)=>{
this.setState({
chongzuoId:id,
Chongzuomodeltype:true
})
}
hideChongzuomodeltype=()=>{
this.setState({
chongzuoId:undefined,
Chongzuomodeltype:false
})
}
render() {
let {data, showAppraiseModaltype, work_comment_hidden, work_comment, has_commit,shixun_detail,view_tpi} = this.state;
let {data, showAppraiseModaltype, work_comment_hidden, work_comment, has_commit,shixun_detail,view_tpi,myshixun_id,myshixun_identifier,homework_end} = this.state;
let category_id=data===undefined?"":data.category===null?"":data.category.category_id;
let homework_common_id=data===undefined?"":data.homework_common_id;
@ -324,6 +347,13 @@ class ShixunWorkReport extends Component {
return (
data===undefined?"":<Spin indicator={antIcon} spinning={this.state.spinning}>
{this.state.Chongzuomodeltype===true?<Chongzuomodel
{...this.props}
{...this.state}
hideChongzuomodeltype={()=>this.hideChongzuomodeltype()}
Isupdatass={()=>this.getdatalist()}
/>:""}
<Modals
modalsType={this.state.modalsType}
modalsTopval={this.state.modalsTopval}
@ -385,6 +415,12 @@ class ShixunWorkReport extends Component {
{/*className=" color-blue font-14 fr ml20 mt15"*/}
{/*onClick={()=>this.showAppraiseModal(1)}*/}
{/*>评阅</a> : ""}*/}
{this.props.isAdmin()?homework_end===false&&myshixun_id!=0?<a
className=" color-blue font-14 fr ml20 mt15"
onClick={()=>this.Backtoredo(myshixun_identifier)}
>打回重做</a>:"":""}
{this.props.isAdmin() ?<a
className=" color-blue font-14 fr ml20 mt15"
onClick={()=>this.showAppraiseModal("main",undefined,work_comment,work_comment_hidden)}

Loading…
Cancel
Save