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

newyslclassrooms
caicai8 5 years ago
commit ab2a62db13

@ -106,8 +106,6 @@ class CoursesController < ApplicationController
if params[:category_id].present? && params[:category_id].to_i != 0
videos = videos.where(course_second_category_id: params[:category_id].to_i)
end
@category = @main_category.course_second_categories.find_by(id: params[:category])
tip_exception("子目录id有误") if !@category.present?
videos = custom_sort(videos, params[:sort_by], params[:sort_direction])
@count = videos.count

@ -182,7 +182,7 @@ class ShixunsController < ApplicationController
select m.user_id, u.login, u.lastname, m.updated_at,
(select sum(cost_time) from games g where g.myshixun_id = m.id) as time,
(select sum(final_score) from games g where g.myshixun_id = m.id) as score
from (users u left join myshixuns m on m.user_id = u.id) where m.shixun_id = #{@shixun.id} and m.status = 1
from (users u left join myshixuns m on m.user_id = u.id) where u.is_test =0 and m.shixun_id = #{@shixun.id} and m.status = 1
order by score desc, time asc limit 10
"
@myshixuns = Myshixun.find_by_sql(sql)

@ -1,7 +1,7 @@
class CourseAttendance < ApplicationRecord
# status: 0: 未开启1已开启2已截止
# mode: 0 两种签到1 二维码签到2 数字签到
enum mode: { ALL: 0, QRCODE: 1, NUMBER: 2 }
enum mode: { ALL: 0, QRCODE: 1, NUMBER: 2, QUICK: 3 }
belongs_to :course
belongs_to :user

@ -1,15 +1,17 @@
json.current_attendance @current_attendance do |attendance|
json.(attendance, :id, :normal_count, :all_count)
json.attendance_date attendance.attendance_date.strftime("%Y/%m/%d")
json.(attendance, :id, :name, :normal_count, :all_count)
json.attendance_date attendance.attendance_date.strftime("%Y-%m-%d")
json.start_time attendance.start_time.strftime("%H:%M")
json.end_time attendance.end_time.strftime("%H:%M")
end
all_normal_rate = []
all_absence_rate = []
all_leave_rate = []
json.history_attendances @history_attendances.each_with_index.to_a do |attendance, index|
normal_count = history_member_count(@all_member_attendances, "NORMAL", attendance.id)
absence_count = history_member_count(@all_member_attendances, "ABSENCE", attendance.id)
leave_count = history_member_count(@all_member_attendances, "LEAVE", attendance.id)
all_count = @all_member_attendances.select{|member_attendance| member_attendance.course_attendance_id == attendance.id}.size
json.index index + 1
@ -17,8 +19,11 @@ json.history_attendances @history_attendances.each_with_index.to_a do |attendanc
all_normal_rate << cal_rate(normal_count, all_count)
json.absence_rate cal_rate(absence_count, all_count)
all_absence_rate << cal_rate(absence_count, all_count)
json.leave_rate cal_rate(leave_count, all_count)
all_leave_rate << cal_rate(leave_count, all_count)
end
json.all_history_count @all_history_count
json.avg_normal_rate @all_history_count == 0 ? 0 : all_normal_rate.sum / @all_history_count
json.avg_absence_rate @all_history_count == 0 ? 0 : all_absence_rate.sum / @all_history_count
json.avg_leave_rate @all_history_count == 0 ? 0 : all_leave_rate.sum / @all_history_count

@ -5,7 +5,8 @@ json.all_count @all_count
json.code @attendance.attendance_code
json.mode @attendance.mode
json.edit_auth @user_course_identity < Course::PROFESSOR || @attendance.user_id == User.current.id
json.attendance_date @attendance.attendance_date.strftime("%Y/%m/%d")
json.name @attendance.name
json.attendance_date @attendance.attendance_date.strftime("%Y-%m-%d")
json.start_time @attendance.start_time.strftime("%H:%M")
json.end_time @attendance.end_time.strftime("%H:%M")

@ -742,9 +742,6 @@ class Question extends Component {
}
// 撤销
getitem_basketss=(id)=>{
this.setState({
})
if(Undoclickable===true){
Undoclickable=false;
//选用题型可以上传单个 或者多个题型

@ -232,39 +232,6 @@ class Contentpart extends Component {
}
const content = (
<div className="questiontypes" style={{
width:'93px',
height:'200px',
}}>
<p className="questiontype " onClick={()=>this.props.setitem_types(null)}>全部</p>
<p className="questiontypeheng" ></p>
<p className="questiontype " onClick={()=>this.props.setitem_types("SINGLE")}>单选题</p>
<p className="questiontypeheng" ></p>
<p className="questiontype " onClick={()=>this.props.setitem_types("MULTIPLE")}>多选题</p>
<p className="questiontypeheng"></p>
<p className="questiontype " onClick={()=>this.props.setitem_types("JUDGMENT")}>判断题</p>
<p className="questiontypeheng"></p>
<p className="questiontype " onClick={()=>this.props.setitem_types("PROGRAM")}>编程题</p>
<p className="questiontypeheng"></p>
</div>
);
const contents = (
<div className="questiontypes" style={{
width:'93px',
height:'120px',
}}>
<p className="questiontype " onClick={()=>this.props.setoj_status(null)}>全部</p>
<p className="questiontypeheng"></p>
<p className="questiontype " onClick={()=>this.props.setoj_status(0)}>未发布</p>
<p className="questiontypeheng"></p>
<p className="questiontype " onClick={()=>this.props.setoj_status(1)}>已发布</p>
<p className="questiontypeheng"></p>
</div>
);
// console.log("Contentpart.js");
// console.log(this.props.current_user.professional_certification);
@ -381,22 +348,6 @@ class Contentpart extends Component {
:""
}
{item_type==="PROGRAM"?
defaultActiveKey===0||defaultActiveKey==="0"?
<Popover getPopupContainer={trigger => trigger.parentNode} placement="bottom" trigger="hover" content={contents} onVisibleChange={()=>this.props.handleVisibleChange(true)}>
<div className=" sortinxdirection mr30">
<div className="subjecttit">
全部
</div>
<i className="iconfont icon-sanjiaoxing-down font-12 lg ml7 icondowncolor"></i>
</div>
</Popover>
:
"":""
}
{
this.props.Isitapopup&&this.props.Isitapopup==="true"?
<Search
@ -455,6 +406,7 @@ class Contentpart extends Component {
: this.props.Contentdata.items.map((object, index) => {
return (
<Listjihe {...this.state} {...this.props}
defaultActiveKeys={defaultActiveKeys}
Datacountbool={this.props.Datacountbool}
Datacount={this.props.Datacount}
Isitapopup={this.props.Isitapopup}

@ -346,9 +346,17 @@ class Listjihe extends Component {
</div>
{
items.item_type==="PROGRAM"?
<a onClick={()=>this.seturls(`/problems/${items.program_attr.identifier}/edit`)} className="ml10 flex1 mt2">
<div style={{wordBreak: "break-word",fontWeight:"bold"}} dangerouslySetInnerHTML={{__html: markdownToHTML(items&&items.name).replace(/▁/g, "▁▁▁")}}></div>
</a>
(
this.props.defaultActiveKeys&&this.props.defaultActiveKeys==="0"?
<a onClick={()=>this.seturls(`/problems/${items.program_attr.identifier}/edit`)} className="ml10 flex1 mt2 xiaoshou">
<div style={{wordBreak: "break-word",fontWeight:"bold"}} dangerouslySetInnerHTML={{__html: markdownToHTML(items&&items.name).replace(/▁/g, "▁▁▁")}}></div>
</a>
:
<p className="ml10 flex1 mt2 xiaoshout">
<div style={{wordBreak: "break-word",fontWeight:"bold"}} dangerouslySetInnerHTML={{__html: markdownToHTML(items&&items.name).replace(/▁/g, "▁▁▁")}}></div>
</p>
)
:
<div className="ml10 flex1 markdown-body mt2" style={{wordBreak: "break-word",fontWeight:"bold"}}>

@ -28,11 +28,21 @@ class QuestionModal extends Component {
width="442px"
>
<div className="educouddiv">
<div className={"tabeltext-alignleft mt10"}><p className="titiles">{this.props.titilesm}</p></div>
<div className={"tabeltext-alignleft mt10"}><p className="titiles">{this.props.titiless}</p></div>
{this.props.titilesm?
<div className={"tabeltext-alignleft mt10"}><p className="titiles">{this.props.titilesm}</p></div>
:
""
}
{
this.props.titiless?
<div className={"tabeltext-alignleft mt10"}><p className="titiles">{this.props.titiless}</p></div>
:
""
}
<div className="clearfix mt30 edu-txt-center">
<a className="task-btn mr30 w80" onClick={()=>this.props.modalCancel()}>取消</a>
<a className="task-btn task-btn-orange w80" onClick={()=>this.props.setDownload()}>确定</a>
<a className="task-btn task-btn-orange w80" onClick={()=>this.props.setDownload()}>{this.props.boolok?this.props.boolok:"确定"}</a>
</div>
</div>
</Modal>

@ -19,6 +19,7 @@ import '../tpm/newshixuns/css/Newshixuns.css';
import Bottomsubmit from "../../modules/modals/Bottomsubmit";
import Seeoagertit from "./component/Seeoagertit";
import Paperlibraryseeid_item from './component/Paperlibraryseeid_item';
import QuestionModal from "../question/component/QuestionModal";
//人工组卷预览
class Paperlibraryseeid extends Component {
constructor(props) {
@ -27,8 +28,10 @@ class Paperlibraryseeid extends Component {
this.state = {
paperlibrartdata:[],
defaultActiveKey:"0",
modalsType:false,
titilesm:"",
titiless:"",
boolok:"知道了"
}
@ -91,7 +94,11 @@ class Paperlibraryseeid extends Component {
}
preservation = () => {
//保存试卷
this.setState({
modalsType: true,
titilesm: "功能正在内测中,敬请期待",
titiless: "",
})
@ -109,13 +116,34 @@ class Paperlibraryseeid extends Component {
getcontentMdRef = (Ref) => {
this.contentMdRef = Ref;
}
modalCancel =()=>{
this.setState({
modalsType: false,
})
}
setDownload =()=>{
this.setState({
modalsType: false,
})
}
render() {
let {paperlibrartdata,defaultActiveKey} = this.state;
let {paperlibrartdata,defaultActiveKey,titilesm,titiless,boolok,modalsType} = this.state;
const params = this.props && this.props.match && this.props.match.params;
// ////console.log(params);
let urlsysl=`/paperlibrary?defaultActiveKey=${defaultActiveKey}`;
return (
<div>
{
modalsType===true?
<QuestionModal {...this.props}{...this.state} modalsType={modalsType} modalCancel={() => this.modalCancel()}
setDownload={() => this.setDownload()}></QuestionModal>
:""
}
<div id={"Itembankstopid"} className="newMain clearfix intermediatecenter "
>

Loading…
Cancel
Save