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

courseware
cxt 5 years ago
commit 52340f26ce

@ -57,7 +57,6 @@ class Users::VideosController < Users::BaseController
video = Video.find_by(id: params[:id]) video = Video.find_by(id: params[:id])
return render_forbidden unless video.user_id == current_user.id || current_user.admin? return render_forbidden unless video.user_id == current_user.id || current_user.admin?
return render_not_found if video.blank? return render_not_found if video.blank?
return render_error('该状态下不能删除视频') unless video.published?
video.destroy! video.destroy!

@ -48,6 +48,16 @@ class Weapps::CoursesController < Weapps::BaseController
render_error(ex.message) render_error(ex.message)
end end
def course_videos
videos = @course.videos.where(transcoded: true)
videos = custom_sort(videos, params[:sort_by], params[:sort_direction])
#sql = "left join videos on videos.id=course_videos.video_id AND (videos.transcoded=1 OR videos.user_id = #{current_user.id})"
#@videos = paginate videos.joins(sql).includes(video: [user: :user_extension], user: :user_extension)
videos = videos.includes(user: :user_extension)
@count = videos.count
@videos = paginate videos
end
def basic_info def basic_info
@course = current_course @course = current_course
end end

@ -0,0 +1,4 @@
json.count @count
json.videos @videos do |video|
json.partial! 'users/videos/video', locals: { video: video.video }
end

@ -1055,6 +1055,7 @@ Rails.application.routes.draw do
get :course_groups get :course_groups
get :basic_info get :basic_info
get :course_activities get :course_activities
get :course_videos
post :change_member_roles post :change_member_roles
delete :delete_course_teachers delete :delete_course_teachers
delete :delete_course_students delete :delete_course_students

@ -916,7 +916,7 @@ class Fileslists extends Component{
{ {
` `
.filesnameslist{ .filesnameslist{
max-width: 486px; max-width: 389px;
overflow: hidden; overflow: hidden;
text-overflow: ellipsis; text-overflow: ellipsis;
white-space: nowrap; white-space: nowrap;

@ -285,7 +285,23 @@ function buildColumns(that, student_works, studentData) {
), ),
}) })
} }
if (that.state.anonymous_comment) {
/**
开启了匿评的才显示此列
*/
columns.push({
width: 84,
title: <div style={{color: 'rgba(0,0,0,.85)'}}>已评数</div>,
key: 'user_comment_count',
dataIndex: 'user_comment_count',
render: (student_score, record) => (
<span style={{color:'#989898', cursor: 'default'}}>
{record.user_comment_count}
</span>
),
})
}
if (that.state.anonymous_appeal) { if (that.state.anonymous_appeal) {
columns.push({ columns.push({
width: 70, width: 70,

@ -294,7 +294,7 @@ class CoursesBanner extends Component {
}) })
that.modalCancel(); that.modalCancel();
message.success("删除成功", 1) message.success("删除成功", 1)
push.push(`/courses`) push.push(`/classrooms`)
} }
}) })

@ -181,6 +181,7 @@ class Coursesleftnav extends Component{
} }
componentDidMount() { componentDidMount() {
this.setState({ this.setState({
url:this.props.match.url url:this.props.match.url
}) })

@ -157,7 +157,7 @@ class ExerciseNewCommon extends Component{
const exercise_id = response.data.data.exercise_id; const exercise_id = response.data.data.exercise_id;
this.isEdit = true; this.isEdit = true;
this.props.history.replace(`/courses/${courseId}/exercises/${exercise_id}/edit`); this.props.history.replace(`/classrooms/${courseId}/exercises/${exercise_id}/edit`);
} }
}) })

@ -30,8 +30,8 @@ const { Countdown } = Statistic;
const Textarea =Input.TextArea const Textarea =Input.TextArea
const tagArray = [ const tagArray = [
'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I',
'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R',
'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z' 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z'
] ]
const $ = window.$; const $ = window.$;
@ -99,8 +99,8 @@ class ExerciseReviewAndAnswer extends Component{
if(this.props.coursedata.name){ if(this.props.coursedata.name){
this.getInfo(); this.getInfo();
} }
//window.addEventListener('scroll', this.handleScroll); //window.addEventListener('scroll', this.handleScroll);
} }
remainTime=(time)=>{ remainTime=(time)=>{
@ -170,7 +170,7 @@ class ExerciseReviewAndAnswer extends Component{
sureCommit=()=>{ sureCommit=()=>{
let coursesId = this.props.match.params.coursesId; let coursesId = this.props.match.params.coursesId;
let eId = this.props.match.params.Id; let eId = this.props.match.params.Id;
this.props.history.push(`/courses/${coursesId}/exercises/${eId}/student_exercise_list?tab=0`); this.props.history.push(`/classrooms/${coursesId}/exercises/${eId}/student_exercise_list?tab=0`);
} }
// 滚动定位 // 滚动定位
@ -279,7 +279,7 @@ class ExerciseReviewAndAnswer extends Component{
//答题后更改题目列表得状态 //答题后更改题目列表得状态
changeQuestionStatus=(No,flag)=>{ changeQuestionStatus=(No,flag)=>{
this.setState( this.setState(
(prevState) => ({ (prevState) => ({
question_status : update(prevState.question_status, {[No]: { ques_status: {$set: flag} }}) question_status : update(prevState.question_status, {[No]: { ques_status: {$set: flag} }})
}) })
) )
@ -287,7 +287,7 @@ class ExerciseReviewAndAnswer extends Component{
// 调分 // 调分
showSetScore=(key,flag,position,type,id)=>{ showSetScore=(key,flag,position,type,id)=>{
this.setState( this.setState(
(prevState) => ({ (prevState) => ({
exercise_questions : update(prevState.exercise_questions, {[key]: { setScore: {$set: flag == undefined || flag==false ? true : false}}}) exercise_questions : update(prevState.exercise_questions, {[key]: { setScore: {$set: flag == undefined || flag==false ? true : false}}})
}),()=>{ }),()=>{
if (position && type && (flag == undefined || flag==false)) { if (position && type && (flag == undefined || flag==false)) {
@ -323,7 +323,7 @@ class ExerciseReviewAndAnswer extends Component{
// setTip:"请输入数字" // setTip:"请输入数字"
// }) // })
this.setState( this.setState(
(prevState) => ({ (prevState) => ({
ajustSore : update(prevState.ajustSore, {[index]: { setTip: {$set: "请输入数字"}}}) ajustSore : update(prevState.ajustSore, {[index]: { setTip: {$set: "请输入数字"}}})
}) })
) )
@ -334,7 +334,7 @@ class ExerciseReviewAndAnswer extends Component{
// score:value // score:value
// }) // })
this.setState( this.setState(
(prevState) => ({ (prevState) => ({
ajustSore : update(prevState.ajustSore, {[index]: { inputSore: {$set: value},setTip:{$set: ""}}}) ajustSore : update(prevState.ajustSore, {[index]: { inputSore: {$set: value},setTip:{$set: ""}}})
}) })
) )
@ -349,7 +349,7 @@ class ExerciseReviewAndAnswer extends Component{
let { ajustSore } = this.state; let { ajustSore } = this.state;
var index = ajustSore.map(function (item) { return item.id; }).indexOf(id); var index = ajustSore.map(function (item) { return item.id; }).indexOf(id);
this.setState( this.setState(
(prevState) => ({ (prevState) => ({
ajustSore : update(prevState.ajustSore, {[index]: { desc: {$set: value}}}) ajustSore : update(prevState.ajustSore, {[index]: { desc: {$set: value}}})
}) })
) )
@ -368,7 +368,7 @@ class ExerciseReviewAndAnswer extends Component{
// setTip:"请输入分数" // setTip:"请输入分数"
// }) // })
this.setState( this.setState(
(prevState) => ({ (prevState) => ({
ajustSore : update(prevState.ajustSore, {[index]: { setTip: {$set: "请输入分数"}}}) ajustSore : update(prevState.ajustSore, {[index]: { setTip: {$set: "请输入分数"}}})
}) })
) )
@ -379,7 +379,7 @@ class ExerciseReviewAndAnswer extends Component{
// setTip:"分数必须大于或者等于0" // setTip:"分数必须大于或者等于0"
// }) // })
this.setState( this.setState(
(prevState) => ({ (prevState) => ({
ajustSore : update(prevState.ajustSore, {[index]: { setTip: {$set: "分数必须大于或者等于0"}}}) ajustSore : update(prevState.ajustSore, {[index]: { setTip: {$set: "分数必须大于或者等于0"}}})
}) })
) )
@ -390,7 +390,7 @@ class ExerciseReviewAndAnswer extends Component{
// setTip:"分数不能大于当前题目的分数" // setTip:"分数不能大于当前题目的分数"
// }) // })
this.setState( this.setState(
(prevState) => ({ (prevState) => ({
ajustSore : update(prevState.ajustSore, {[index]: { setTip: {$set: "分数不能大于当前题目的分数"}}}) ajustSore : update(prevState.ajustSore, {[index]: { setTip: {$set: "分数不能大于当前题目的分数"}}})
}) })
) )
@ -407,15 +407,15 @@ class ExerciseReviewAndAnswer extends Component{
this.props.showNotification('调分成功'); this.props.showNotification('调分成功');
this.getInfo(); this.getInfo();
// let statusScore = score==0 ? 0 : score > 0 && score < maxScore ? 2 : 1; // let statusScore = score==0 ? 0 : score > 0 && score < maxScore ? 2 : 1;
// this.setState( // this.setState(
// (prevState) => ({ // (prevState) => ({
// exercise_questions : update(prevState.exercise_questions, {[key]: { user_score: {$set: parseFloat(score).toFixed(1)},answer_status : {$set: statusScore},question_comments:{$set:result.data.question_comments} }}), // exercise_questions : update(prevState.exercise_questions, {[key]: { user_score: {$set: parseFloat(score).toFixed(1)},answer_status : {$set: statusScore},question_comments:{$set:result.data.question_comments} }}),
// }) // })
// ) // )
// this.setState( // this.setState(
// (prevState) => ({ // (prevState) => ({
// ajustSore : update(prevState.ajustSore, {[index]: { desc: {$set: undefined},inputSore:{ $set:undefined }}}) // ajustSore : update(prevState.ajustSore, {[index]: { desc: {$set: undefined},inputSore:{ $set:undefined }}})
// }) // })
// ) // )
@ -430,14 +430,14 @@ class ExerciseReviewAndAnswer extends Component{
console.log(error); console.log(error);
}) })
} }
} }
// 选择题,切换答案 // 选择题,切换答案
changeOption = (index,ids) =>{ changeOption = (index,ids) =>{
//console.log(index+" "+ids); //console.log(index+" "+ids);
this.setState( this.setState(
(prevState) => ({ (prevState) => ({
exercise_questions : update(prevState.exercise_questions, {[index]: { user_answer: {$set: ids} }}), exercise_questions : update(prevState.exercise_questions, {[index]: { user_answer: {$set: ids} }}),
}) })
) )
@ -446,7 +446,7 @@ class ExerciseReviewAndAnswer extends Component{
//简答题 显示和隐藏答案 //简答题 显示和隐藏答案
changeA_flag=(index,status)=>{ changeA_flag=(index,status)=>{
this.setState( this.setState(
(prevState) => ({ (prevState) => ({
exercise_questions : update(prevState.exercise_questions, {[index]: { a_flag: {$set: status} }}) exercise_questions : update(prevState.exercise_questions, {[index]: { a_flag: {$set: status} }})
}) })
) )
@ -582,7 +582,7 @@ class ExerciseReviewAndAnswer extends Component{
returnBtn = () =>{ returnBtn = () =>{
let coursesId=this.props.match.params.coursesId; let coursesId=this.props.match.params.coursesId;
let eId=this.props.match.params.Id; let eId=this.props.match.params.Id;
this.props.history.push(`/courses/${coursesId}/exercises/${eId}/student_exercise_list?tab=0`) this.props.history.push(`/classrooms/${coursesId}/exercises/${eId}/student_exercise_list?tab=0`)
} }
deadline=(time)=>{ deadline=(time)=>{
@ -684,9 +684,9 @@ class ExerciseReviewAndAnswer extends Component{
<p className="clearfix mb20"> <p className="clearfix mb20">
<WordsBtn style="grey" className="fl" to={current_user && current_user.first_category_url}>{courseName}</WordsBtn> <WordsBtn style="grey" className="fl" to={current_user && current_user.first_category_url}>{courseName}</WordsBtn>
<span className="color-grey-9 fl ml3 mr3">&gt;</span> <span className="color-grey-9 fl ml3 mr3">&gt;</span>
<WordsBtn style="grey" className="fl" to={`/courses/${coursesId}/exercises/${data && data.left_banner_id}`}>{data && data.left_banner_name}</WordsBtn> <WordsBtn style="grey" className="fl" to={`/classrooms/${coursesId}/exercises/${data && data.left_banner_id}`}>{data && data.left_banner_name}</WordsBtn>
<span className="color-grey-9 fl ml3 mr3">&gt;</span> <span className="color-grey-9 fl ml3 mr3">&gt;</span>
<WordsBtn style="grey" to={`/courses/${coursesId}/exercises/${eId}/student_exercise_list?tab=0`} className="fl mr3">{data && data.left_banner_name}详情</WordsBtn>&gt; <WordsBtn style="grey" to={`/classrooms/${coursesId}/exercises/${eId}/student_exercise_list?tab=0`} className="fl mr3">{data && data.left_banner_name}详情</WordsBtn>&gt;
<span className="ml3">{exercise_answer_user&&exercise_answer_user.user_name}{data&&data.exercise.user_name}</span> <span className="ml3">{exercise_answer_user&&exercise_answer_user.user_name}{data&&data.exercise.user_name}</span>
</p> </p>
<p className="clearfix"> <p className="clearfix">
@ -722,23 +722,23 @@ class ExerciseReviewAndAnswer extends Component{
} }
<p className="padding20-30 clearfix"> <p className="padding20-30 clearfix">
{ {
exercise_types && exercise_types.q_singles > 0 && exercise_types && exercise_types.q_singles > 0 &&
<span className="color-grey-9 mr15">单选题 {exercise_types.q_singles} , {exercise_types && exercise_types.q_singles_scores} </span> <span className="color-grey-9 mr15">单选题 {exercise_types.q_singles} , {exercise_types && exercise_types.q_singles_scores} </span>
} }
{ {
exercise_types && exercise_types.q_doubles > 0 && exercise_types && exercise_types.q_doubles > 0 &&
<span className="color-grey-9 mr15">多选题 {exercise_types.q_doubles} , {exercise_types && exercise_types.q_doubles_scores} </span> <span className="color-grey-9 mr15">多选题 {exercise_types.q_doubles} , {exercise_types && exercise_types.q_doubles_scores} </span>
} }
{ {
exercise_types && exercise_types.q_judges > 0 && exercise_types && exercise_types.q_judges > 0 &&
<span className="color-grey-9 mr15">判断题 {exercise_types.q_judges} , {exercise_types && exercise_types.q_judges_scores} </span> <span className="color-grey-9 mr15">判断题 {exercise_types.q_judges} , {exercise_types && exercise_types.q_judges_scores} </span>
} }
{ {
exercise_types && exercise_types.q_nulls > 0 && exercise_types && exercise_types.q_nulls > 0 &&
<span className="color-grey-9 mr15">填空题 {exercise_types.q_nulls} , {exercise_types && exercise_types.q_nulls_scores} </span> <span className="color-grey-9 mr15">填空题 {exercise_types.q_nulls} , {exercise_types && exercise_types.q_nulls_scores} </span>
} }
{ {
exercise_types && exercise_types.q_mains > 0 && exercise_types && exercise_types.q_mains > 0 &&
<span className="color-grey-9 mr15">简答题 {exercise_types.q_mains} , {exercise_types && exercise_types.q_mains_scores} </span> <span className="color-grey-9 mr15">简答题 {exercise_types.q_mains} , {exercise_types && exercise_types.q_mains_scores} </span>
} }
{ {
@ -755,11 +755,11 @@ class ExerciseReviewAndAnswer extends Component{
{ {
exercise_start_at && <span className="fl color-grey-9">开始答题时间{ exercise_start_at && moment(exercise_start_at).format(format) }</span> exercise_start_at && <span className="fl color-grey-9">开始答题时间{ exercise_start_at && moment(exercise_start_at).format(format) }</span>
} }
{ {
(isAdmin || (isStudent && exercise && exercise.exercise_status == 3)) && exerciseTotalScore && (isAdmin || (isStudent && exercise && exercise.exercise_status == 3)) && exerciseTotalScore &&
<span className="color-grey-9 fr">总分<span className="color-orange-tip"> { exerciseTotalScore }</span> </span> <span className="color-grey-9 fr">总分<span className="color-orange-tip"> { exerciseTotalScore }</span> </span>
} }
</span> </span>
{ {
// 老师身份 || 学生身份且试卷已经截止 // 老师身份 || 学生身份且试卷已经截止
(isAdmin || (isStudent && exercise && exercise.exercise_status == 3)) && (isAdmin || (isStudent && exercise && exercise.exercise_status == 3)) &&
@ -785,7 +785,7 @@ class ExerciseReviewAndAnswer extends Component{
</div> </div>
} }
{ {
exercise_scores && exercise_scores.subjective_scores.length > 0 && exercise_scores && exercise_scores.subjective_scores.length > 0 &&
<div> <div>
<p className="clearfix"> <p className="clearfix">
<span className="font-16 mr40">主观题</span> <span className="font-16 mr40">主观题</span>
@ -804,8 +804,8 @@ class ExerciseReviewAndAnswer extends Component{
</div> </div>
} }
</div> </div>
} }
{ {
//学生身份 且试卷还未截止 //学生身份 且试卷还未截止
isStudent && exercise && exercise.exercise_status == 2 ? isStudent && exercise && exercise.exercise_status == 2 ?
@ -838,12 +838,12 @@ class ExerciseReviewAndAnswer extends Component{
<span className="fr"> <span className="fr">
{ {
// 填空(一直都有调分),和简答题调分:老师身份 已经评分的才能出现调分按钮 // 填空(一直都有调分),和简答题调分:老师身份 已经评分的才能出现调分按钮
isAdmin && ((parseInt(item.answer_status) != 0 && item.question_type == 4) || item.question_type == 3 || item.question_type == 1) ? isAdmin && ((parseInt(item.answer_status) != 0 && item.question_type == 4) || item.question_type == 3 || item.question_type == 1) ?
<WordsBtn style="blue" className="ml20 font-16 fl" onClick={()=>this.showSetScore(key,item.setScore,item.q_position,item.question_type,item.question_id)}>调分</WordsBtn>:"" <WordsBtn style="blue" className="ml20 font-16 fl" onClick={()=>this.showSetScore(key,item.setScore,item.q_position,item.question_type,item.question_id)}>调分</WordsBtn>:""
} }
{ {
// 简答题,未评分的显示未批 // 简答题,未评分的显示未批
isAdmin && parseInt(item.answer_status) == 0 && item.question_type == 4 ? isAdmin && parseInt(item.answer_status) == 0 && item.question_type == 4 ?
<span className="color-red fl ml20">未批</span>:"" <span className="color-red fl ml20">未批</span>:""
} }
{ {
@ -869,16 +869,16 @@ class ExerciseReviewAndAnswer extends Component{
</p> </p>
<li className="break_word mt15 mb15 pl30 pr30"> <li className="break_word mt15 mb15 pl30 pr30">
{/* <p className="standardAnswer markdown-body" dangerouslySetInnerHTML={{__html: markdownToHTML1(item.question_type == 5 ? item.shixun_name : item.question_title).replace(/▁/g,"▁▁▁")}}></p> */} {/* <p className="standardAnswer markdown-body" dangerouslySetInnerHTML={{__html: markdownToHTML1(item.question_type == 5 ? item.shixun_name : item.question_title).replace(/▁/g,"▁▁▁")}}></p> */}
<MarkdownToHtml content={(item.question_type == 5 ? item.shixun_name : item.question_title)} selector={'answer_' + key} <MarkdownToHtml content={(item.question_type == 5 ? item.shixun_name : item.question_title)} selector={'answer_' + key}
className="standardAnswer" className="standardAnswer"
></MarkdownToHtml> ></MarkdownToHtml>
</li> </li>
{ {
// 选择题和判断题共用 // 选择题和判断题共用
(item.question_type == 0 || item.question_type == 2) && (item.question_type == 0 || item.question_type == 2) &&
<Single <Single
{...this.props} {...this.props}
{...this.state} {...this.state}
exercise={exercise} exercise={exercise}
questionType={item} questionType={item}
user_exercise_status={user_exercise_status} user_exercise_status={user_exercise_status}
@ -890,9 +890,9 @@ class ExerciseReviewAndAnswer extends Component{
{ {
// 多选题 // 多选题
item.question_type == 1 && item.question_type == 1 &&
<Multiple <Multiple
{...this.props} {...this.props}
{...this.state} {...this.state}
exercise={exercise} exercise={exercise}
questionType={item} questionType={item}
user_exercise_status={user_exercise_status} user_exercise_status={user_exercise_status}
@ -905,9 +905,9 @@ class ExerciseReviewAndAnswer extends Component{
{ {
// 填空题 // 填空题
item.question_type == 3 && item.question_type == 3 &&
<FillEmpty <FillEmpty
{...this.props} {...this.props}
{...this.state} {...this.state}
exercise={exercise} exercise={exercise}
questionType={item} questionType={item}
user_exercise_status={user_exercise_status} user_exercise_status={user_exercise_status}
@ -919,9 +919,9 @@ class ExerciseReviewAndAnswer extends Component{
{ {
// 简答题 // 简答题
item.question_type == 4 && item.question_type == 4 &&
<SimpleAnswer <SimpleAnswer
{...this.props} {...this.props}
{...this.state} {...this.state}
exercise={exercise} exercise={exercise}
questionType={item} questionType={item}
user_exercise_status={user_exercise_status} user_exercise_status={user_exercise_status}
@ -933,9 +933,9 @@ class ExerciseReviewAndAnswer extends Component{
{ {
// 实训题 // 实训题
item.question_type == 5 && item.question_type == 5 &&
<ShixunAnswer <ShixunAnswer
{...this.props} {...this.props}
{...this.state} {...this.state}
exercise={exercise} exercise={exercise}
questionType={item} questionType={item}
user_exercise_status={user_exercise_status} user_exercise_status={user_exercise_status}
@ -944,10 +944,10 @@ class ExerciseReviewAndAnswer extends Component{
></ShixunAnswer> ></ShixunAnswer>
} }
{ {
//调分理由部分 //调分理由部分
item.question_comments && item.question_comments.comment && (item.question_type == 3 || item.question_type == 4 || item.question_type == 1) && item.question_comments && item.question_comments.comment && (item.question_type == 3 || item.question_type == 4 || item.question_type == 1) &&
<div className="ml30 mr30 bor-top-greyE pt30 mt20 clearfix df"> <div className="ml30 mr30 bor-top-greyE pt30 mt20 clearfix df">
<img src={getImageUrl(`images/${item.question_comments.user_picture}`)} width="48" height="48" className="radius mr10"/> <img src={getImageUrl(`images/${item.question_comments.user_picture}`)} width="48" height="48" className="radius mr10"/>
<div className="flex1"> <div className="flex1">
@ -967,14 +967,14 @@ class ExerciseReviewAndAnswer extends Component{
<span><span className="color-red">*</span></span> <span><span className="color-red">*</span></span>
<li className="fr"> <li className="fr">
<p> <p>
<InputNumber <InputNumber
placeholder="请填写分数" placeholder="请填写分数"
min={0} min={0}
// max={item.question_score} // max={item.question_score}
value={list && list.length>0 && list[0].inputSore} value={list && list.length>0 && list[0].inputSore}
step={0.1} step={0.1}
precision={1} precision={1}
className={ list && list.length>0 && list[0].setTip !="" ? "edu-txt-center winput-115-40 fl mt3 noticeTip inputNumber30" : "edu-txt-center winput-115-40 fl mt3 inputNumber30"} className={ list && list.length>0 && list[0].setTip !="" ? "edu-txt-center winput-115-40 fl mt3 noticeTip inputNumber30" : "edu-txt-center winput-115-40 fl mt3 inputNumber30"}
onChange={(value)=>this.inputScore(value,item.question_id)} onChange={(value)=>this.inputScore(value,item.question_id)}
id={`${"input_"+item.q_position+"_"+item.question_type}`} id={`${"input_"+item.q_position+"_"+item.question_type}`}
></InputNumber> ></InputNumber>
@ -1016,4 +1016,4 @@ class ExerciseReviewAndAnswer extends Component{
) )
} }
} }
export default ExerciseReviewAndAnswer export default ExerciseReviewAndAnswer

@ -88,7 +88,7 @@ class GraduateTopicDetail extends Component{
} }
}) })
} }
render(){ render(){
let { let {
tableData, tableData,
@ -107,14 +107,14 @@ class GraduateTopicDetail extends Component{
<p className="clearfix mb15 lineh-20"> <p className="clearfix mb15 lineh-20">
<WordsBtn style="grey" className="fl" to={current_user&&current_user.first_category_url}>{tableData && tableData.course_name}</WordsBtn> <WordsBtn style="grey" className="fl" to={current_user&&current_user.first_category_url}>{tableData && tableData.course_name}</WordsBtn>
<span className="color-grey-9 fl ml3 mr3">&gt;</span> <span className="color-grey-9 fl ml3 mr3">&gt;</span>
<WordsBtn style="grey" className="fl" to={`/courses/${tableData.course_id}/graduation_topics/${tableData.graduation_id}`}>{tableData.graduation_name}</WordsBtn> <WordsBtn style="grey" className="fl" to={`/classrooms/${tableData.course_id}/graduation_topics/${tableData.graduation_id}`}>{tableData.graduation_name}</WordsBtn>
<span className="color-grey-9 fl ml3 mr3">&gt;</span> <span className="color-grey-9 fl ml3 mr3">&gt;</span>
<span>选题详情</span> <span>选题详情</span>
</p> </p>
<p className="clearfix mb20 lineh-25"> <p className="clearfix mb20 lineh-25">
<span className="color-grey-3 font-24 fl task-hide" style={{lineHeight:"25px",maxWidth:"900px"}}>{tableData && tableData.graduation_topic_name}</span> <span className="color-grey-3 font-24 fl task-hide" style={{lineHeight:"25px",maxWidth:"900px"}}>{tableData && tableData.graduation_topic_name}</span>
<span className="fl mt1" style={{height:"25px"}}><CoursesListType typelist={[`${tableData && tableData.status_name}`]} typesylename={""} /></span> <span className="fl mt1" style={{height:"25px"}}><CoursesListType typelist={[`${tableData && tableData.status_name}`]} typesylename={""} /></span>
<WordsBtn className="fr font-16 mt1" style="grey" to={`/courses/${tableData.course_id}/graduation_topics/${tableData.graduation_id}`}>返回</WordsBtn> <WordsBtn className="fr font-16 mt1" style="grey" to={`/classrooms/${tableData.course_id}/graduation_topics/${tableData.graduation_id}`}>返回</WordsBtn>
</p> </p>
<div> <div>
<div className="clearfix edu-back-white bor-bottom-greyE" > <div className="clearfix edu-back-white bor-bottom-greyE" >
@ -134,14 +134,14 @@ class GraduateTopicDetail extends Component{
<WordsBtn className="fr font-16 mt22 mr30" style="blue" onClick={this.actionTopic}>取消选题</WordsBtn> <WordsBtn className="fr font-16 mt22 mr30" style="blue" onClick={this.actionTopic}>取消选题</WordsBtn>
} }
{ {
isAdmin && <WordsBtn className="fr font-16 mt22 mr30" to={`/courses/${course_id}/graduation_topics/${graduation_topic_id}/edit`} style="blue">编辑</WordsBtn> isAdmin && <WordsBtn className="fr font-16 mt22 mr30" to={`/classrooms/${course_id}/graduation_topics/${graduation_topic_id}/edit`} style="blue">编辑</WordsBtn>
} }
</div> </div>
{ {
tab && tab==1&& tab && tab==1&&
<div> <div>
<div className="minH-560 edu-back-white"> <div className="minH-560 edu-back-white">
<DetailTable {...this.props} {...this.state} tableData={tableData} page={tablePage} getDetailList={this.getDetailList}></DetailTable> <DetailTable {...this.props} {...this.state} tableData={tableData} page={tablePage} getDetailList={this.getDetailList}></DetailTable>
</div> </div>
{ {
tableData && tableData.users_count>tablePageSize && tableData && tableData.users_count>tablePageSize &&
@ -161,4 +161,4 @@ class GraduateTopicDetail extends Component{
) )
} }
} }
export default GraduateTopicDetail; export default GraduateTopicDetail;

@ -720,7 +720,7 @@ class Goldsubject extends Component {
{/* <Breadcrumb.Item>{Whethertocreateanewclassroom===true?"新建课堂":"编辑课堂"}</Breadcrumb.Item>*/} {/* <Breadcrumb.Item>{Whethertocreateanewclassroom===true?"新建课堂":"编辑课堂"}</Breadcrumb.Item>*/}
{/*</Breadcrumb>*/} {/*</Breadcrumb>*/}
<p className="clearfix mb20 mt10"> <p className="clearfix mb20 mt10">
<a className="btn colorgrey fl hovercolorblue " href={Whethertocreateanewclassroom===true?"/courses":this.props.current_user&&this.props.current_user.first_category_url} <a className="btn colorgrey fl hovercolorblue " href={Whethertocreateanewclassroom===true?"/classrooms":this.props.current_user&&this.props.current_user.first_category_url}
>{Whethertocreateanewclassroom===true?"教学课堂":name}</a> >{Whethertocreateanewclassroom===true?"教学课堂":name}</a>
<span className="color-grey-9 fl ml3 mr3">&gt;</span> <span className="color-grey-9 fl ml3 mr3">&gt;</span>
<span className="fl cdefault">{Whethertocreateanewclassroom===true?"新建课堂":"编辑课堂"}</span> <span className="fl cdefault">{Whethertocreateanewclassroom===true?"新建课堂":"编辑课堂"}</span>

@ -362,7 +362,7 @@ class PollNew extends Component {
pollid: result.data.data.id, pollid: result.data.data.id,
Newedit: false, Newedit: false,
}) })
this.props.history.push(`/courses/${this.props.match.params.coursesId}/polls/${result.data.data.id}/detail?tab=2`) this.props.history.push(`/classrooms/${this.props.match.params.coursesId}/polls/${result.data.data.id}/detail?tab=2`)
} }
}) })
} }
@ -2590,7 +2590,7 @@ class PollNew extends Component {
if (result.data.status === 0) { if (result.data.status === 0) {
// console.log("更新题目成功") // console.log("更新题目成功")
// this.props.showNotification("保存成功"); // this.props.showNotification("保存成功");
this.props.history.push(`/courses/${this.props.match.params.coursesId}/polls/${pollid}/detail?tab=2`) this.props.history.push(`/classrooms/${this.props.match.params.coursesId}/polls/${pollid}/detail?tab=2`)
} }
} catch (e) { } catch (e) {
@ -2766,7 +2766,7 @@ class PollNew extends Component {
// //
// let courseId=this.props.match.params.coursesId; // let courseId=this.props.match.params.coursesId;
// if(courseId===undefined){ // if(courseId===undefined){
// this.props.history.push("/courses"); // this.props.history.push("/classrooms");
// }else{ // }else{
// this.props.history.push(this.props.current_user.first_category_url); // this.props.history.push(this.props.current_user.first_category_url);
// } // }
@ -2833,10 +2833,10 @@ class PollNew extends Component {
{ {
this.props.match.params.news === "new"? this.props.match.params.news === "new"?
<a className=" btn colorgrey fl hovercolorblue" <a className=" btn colorgrey fl hovercolorblue"
href={`/courses/${this.props.match.params.coursesId}/polls/${this.props.match.params.pollid}`}>问卷</a> href={`/classrooms/${this.props.match.params.coursesId}/polls/${this.props.match.params.pollid}`}>问卷</a>
: :
<a className=" btn colorgrey fl hovercolorblue" <a className=" btn colorgrey fl hovercolorblue"
href={`/courses/${this.props.match.params.coursesId}/polls/${left_banner_id}`}>问卷</a> href={`/classrooms/${this.props.match.params.coursesId}/polls/${left_banner_id}`}>问卷</a>
} }
<span className="color-grey-9 fl ml3 mr3">&gt;</span> <span className="color-grey-9 fl ml3 mr3">&gt;</span>
@ -2847,10 +2847,10 @@ class PollNew extends Component {
className="fl color-black summaryname mt5">{this.props.match.params.news === undefined ? "新建问卷" : this.props.match.params.news === "new" ? "新建问卷" : "编辑问卷"}</p> className="fl color-black summaryname mt5">{this.props.match.params.news === undefined ? "新建问卷" : this.props.match.params.news === "new" ? "新建问卷" : "编辑问卷"}</p>
{ {
this.props.match.params.news === "new" ? this.props.match.params.news === "new" ?
<a href={`/courses/${this.props.match.params.coursesId}/polls/${this.props.match.params.pollid}`} <a href={`/classrooms/${this.props.match.params.coursesId}/polls/${this.props.match.params.pollid}`}
className=" fr font-16"></a> className=" fr font-16"></a>
: :
<a href={`/courses/${this.props.match.params.coursesId}/polls/${left_banner_id}`} <a href={`/classrooms/${this.props.match.params.coursesId}/polls/${left_banner_id}`}
className=" fr font-16"></a> className=" fr font-16"></a>
} }
</div> </div>

@ -385,7 +385,7 @@ class PollNewQuestbank extends Component {
pollid: result.data.data.id, pollid: result.data.data.id,
Newedit: false, Newedit: false,
}) })
this.props.history.push(`/courses/${this.props.match.params.coursesId}/polls/${result.data.data.id}/detail?tab=2`) this.props.history.push(`/classrooms/${this.props.match.params.coursesId}/polls/${result.data.data.id}/detail?tab=2`)
} }
}) })
} }
@ -4309,4 +4309,4 @@ export default PollNewQuestbank
{/* */ {/* */
} }
{/*}*/ {/*}*/
} }

@ -138,7 +138,7 @@ class ShixunWorkReport extends Component {
gotohome=()=>{ gotohome=()=>{
let courseId=this.props.match.params.coursesId; let courseId=this.props.match.params.coursesId;
if(courseId===undefined){ if(courseId===undefined){
this.props.history.push("/courses"); this.props.history.push("/classrooms");
}else{ }else{
this.props.history.push(this.props.current_user.first_category_url); this.props.history.push(this.props.current_user.first_category_url);
} }

@ -974,7 +974,7 @@ class ShixunHomework extends Component{
gotohome=()=>{ gotohome=()=>{
let courseId=this.props.match.params.coursesId; let courseId=this.props.match.params.coursesId;
if(courseId===undefined){ if(courseId===undefined){
this.props.history.push("/courses"); this.props.history.push("/classrooms");
}else{ }else{
this.props.history.push(this.props.current_user.first_category_url); this.props.history.push(this.props.current_user.first_category_url);
} }
@ -1179,7 +1179,7 @@ class ShixunHomework extends Component{
{datas===undefined?"":datas.homeworks && datas.homeworks.length>1?this.props.isAdminOrCreator()===true?datas&&datas.category_name===undefined||datas&&datas.category_name===null? {datas===undefined?"":datas.homeworks && datas.homeworks.length>1?this.props.isAdminOrCreator()===true?datas&&datas.category_name===undefined||datas&&datas.category_name===null?
<span> <span>
<WordsBtn style="blue" className={"mr30 font-16"}> <WordsBtn style="blue" className={"mr30 font-16"}>
<Link className="color4CACFF" to={`/courses/${this.props.match.params.coursesId}/ordering/shixun_homework/${main_id&&main_id}`}>调整排序</Link> <Link className="color4CACFF" to={`/classrooms/${this.props.match.params.coursesId}/ordering/shixun_homework/${main_id&&main_id}`}>调整排序</Link>
</WordsBtn> </WordsBtn>
</span>:"":"":""} </span>:"":"":""}

@ -68,9 +68,6 @@
} }
.videoInReviewItem .square-main {
background: #EAEAEA;
}
.videoItem .time { .videoItem .time {
color: #C0C4CC; color: #C0C4CC;
} }

@ -65,7 +65,8 @@ function InfoVideo(props) {
const videoEl = useRef(null); const videoEl = useRef(null);
const { showNotification, history } = props; const { showNotification, history } = props;
const username = props.match.params.username const username = props.match.params.username;
const { user } = props;
function toUpload() { function toUpload() {
if (props.current_user.admin || (props.current_user.is_teacher && props.checkIfProfessionalCertification())) { if (props.current_user.admin || (props.current_user.is_teacher && props.checkIfProfessionalCertification())) {
@ -87,16 +88,15 @@ function InfoVideo(props) {
sort_direction: sorts[1], sort_direction: sorts[1],
// //
} }
}).then((response) => {
setLoading(false)
if (response.data.videos) {
setvideos(response.data.videos)
setCount(response.data.count)
}
}).catch(() => {
setLoading(false)
}) })
.then((response) => {
setLoading(false)
if (response.data.videos) {
setvideos(response.data.videos)
setCount(response.data.count)
}
}).catch(() => {
setLoading(false)
})
} }
function fetchReviewvideos() { function fetchReviewvideos() {
const fetchUrl = `/users/${username}/videos/review.json` const fetchUrl = `/users/${username}/videos/review.json`
@ -144,7 +144,8 @@ function InfoVideo(props) {
useEffect(() => { useEffect(() => {
if (videoModalObj.visible == false) { if (videoModalObj.visible == false) {
// 关闭视频 // 关闭视频
videoEl.current && videoEl.current.pause() videoEl.current && videoEl.current.pause();
videoId = {};
if (_clipboard) { if (_clipboard) {
_clipboard.destroy(); _clipboard.destroy();
_clipboard = null; _clipboard = null;
@ -184,9 +185,8 @@ function InfoVideo(props) {
videoId = { videoId = {
videoId: item.id, videoId: item.id,
title: item.title, title: item.title,
file_url: item.file_url, file_url: item.play_url || item.file_url,
cover_url: item.cover_url cover_url: item.cover_url
} }
videoModalObj.setVisible(true) videoModalObj.setVisible(true)
} }
@ -218,6 +218,36 @@ function InfoVideo(props) {
} }
function deleteVideo(item){
props.confirm({
content: '该视频将被删除,不可恢复',
subContent: '是否确认删除?',
onOk: () => {
const url = `/users/${user && user.login}/videos/${item.id}.json`;
axios.delete(url).then(result => {
if (result) {
props.showNotification(`视频删除成功!`);
if (pageObj.current === 1) {
if (categoryObj.category === 'all') {
fetchvideos()
} else {
fetchReviewvideos()
}
} else {
pageObj.onChange(1)
}
}
}).catch(error => {
console.log(error);
})
},
onCancel() {
console.log('Cancel');
},
});
}
function getCopyText(file_url, cover_url) { function getCopyText(file_url, cover_url) {
return `<video src="${file_url}" controls="true" controlslist="nodownload" width="${DEFAULT_VIDEO_WIDTH_IN_MD}" height="${DEFAULT_VIDEO_HEIGHT_IN_MD}" poster="${cover_url}">您的浏览器不支持 video 标签。</video>` return `<video src="${file_url}" controls="true" controlslist="nodownload" width="${DEFAULT_VIDEO_WIDTH_IN_MD}" height="${DEFAULT_VIDEO_HEIGHT_IN_MD}" poster="${cover_url}">您的浏览器不支持 video 标签。</video>`
} }
@ -237,7 +267,7 @@ function InfoVideo(props) {
className="showVideoModal" className="showVideoModal"
width={800 - 1} width={800 - 1}
> >
<VideoPlay src={videoId.file_url} /> {videoModalObj.visible && <VideoPlay src={videoId.file_url} />}
<div className="df copyLine"> <div className="df copyLine">
<Input value={_inputValue} <Input value={_inputValue}
className="dark" className="dark"
@ -397,7 +427,7 @@ function InfoVideo(props) {
onEditVideo={onEditVideo} onEditVideo={onEditVideo}
onMaskClick={onMaskClick} onMaskClick={onMaskClick}
getCopyText={getCopyText} getCopyText={getCopyText}
deleteVideo={user && ((user.login === item.user_login) || user.admin) ? deleteVideo : undefined}
> >
</VideoInReviewItem>) </VideoInReviewItem>)
}) })
@ -416,6 +446,7 @@ function InfoVideo(props) {
{...item} {...item}
key={item.id} key={item.id}
isReview={true} isReview={true}
deleteVideo={user && ((user.login === item.user_login) || user.admin) ? deleteVideo : undefined}
> >
</VideoInReviewItem>) </VideoInReviewItem>)
}) })

@ -79,9 +79,9 @@ function VideoInReviewItem (props) {
<i className={`icon-dianjiliang iconfont dianjilianicon`}></i> <i className={`icon-dianjiliang iconfont dianjilianicon`}></i>
</Tooltip> } {!vv || (vv && vv)===0?"":vv} </Tooltip> } {!vv || (vv && vv)===0?"":vv}
</span> </span>
{ isReview != true && <div> <div>
{ {
moveVideo && isReview !== true && moveVideo &&
<Tooltip title="移动到" placement="bottom"> <Tooltip title="移动到" placement="bottom">
<i className="icon-yidong iconfont font-15" onClick={() => moveVideo(props)} <i className="icon-yidong iconfont font-15" onClick={() => moveVideo(props)}
style={{ marginTop: '1px', display: 'inline-block'}} style={{ marginTop: '1px', display: 'inline-block'}}
@ -98,7 +98,7 @@ function VideoInReviewItem (props) {
} }
{ {
operation && isReview !== true && operation &&
<Tooltip title="编辑" placement="bottom"> <Tooltip title="编辑" placement="bottom">
<i className="icon-bianji1 iconfont" onClick={() => onEditVideo(props)} <i className="icon-bianji1 iconfont" onClick={() => onEditVideo(props)}
style={{ marginTop: '1px', display: 'inline-block'}} style={{ marginTop: '1px', display: 'inline-block'}}
@ -106,13 +106,13 @@ function VideoInReviewItem (props) {
</Tooltip> </Tooltip>
} }
{ {
!link ? isReview !== true && !link ?
<Tooltip title="复制视频地址" placement="bottom"> <Tooltip title="复制视频地址" placement="bottom">
<i className={`icon-fuzhi iconfont copybtn_item_${id}`} data-clipboard-text={getCopyText((play_url || file_url), cover_url)}></i> <i className={`icon-fuzhi iconfont copybtn_item_${id}`} data-clipboard-text={getCopyText((play_url || file_url), cover_url)}></i>
</Tooltip>:"" </Tooltip>:""
} }
</div> } </div>
</div> </div>
</div> </div>
</div> </div>

Loading…
Cancel
Save