Merge branch 'dev_aliyun' into dev_hjm_a

dev_unstable
hjm 6 years ago
commit e860b3088f

@ -172,7 +172,7 @@ class AttachmentsController < ApplicationController
# 课堂资源、作业、毕设相关资源的权限判断
if @file.container.is_a?(Course)
course = @file.container
candown = current_user.member_of_course?(course) || @file.is_public == 1
candown = current_user.member_of_course?(course) || (course.is_public? && @file.publiced?)
elsif @file.container.is_a?(HomeworkCommon) || @file.container.is_a?(GraduationTask) || @file.container.is_a?(GraduationTopic)
course = @file.container&.course
candown = current_user.member_of_course?(course)

@ -339,10 +339,11 @@ class ExerciseQuestionsController < ApplicationController
@exercise_question.exercise_shixun_challenges.each_with_index do |challenge, index|
challenge.question_score = params[:question_scores][index].to_f.round(1)
challenge.save
question_score += challenge.question_score
question_score += params[:question_scores][index].to_f.round(1)
end
@exercise_question.question_score = question_score
@exercise_question.shixun_name = shixun_name
@exercise_question.save
end
#当试卷已发布时(试卷的总状态),当标准答案修改时,如有已提交的学生,需重新计算分数.

@ -26,6 +26,12 @@ class Users::BaseController < ApplicationController
render_forbidden
end
def require_teacher!
return if current_user.admin_or_business? || observed_user.is_teacher?
render_forbidden
end
def require_auth_teacher!
return if current_user.admin_or_business? || observed_user.certification_teacher?

@ -1,5 +1,6 @@
class Users::VideosController < Users::BaseController
before_action :private_user_resources!, :check_account
before_action :require_teacher!
before_action :require_auth_teacher!, except: [:index, :review]
helper_method :current_video

@ -10,7 +10,15 @@ module AliyunVod::Service::Base
Rails.logger.info("[AliyunVod] response => status: #{response.status}, result: #{result}")
raise AliyunVod::Error, result['Code'] if response.status != 200
if response.status != 200
message =
case result['Code']
when 'InvalidFileName.Extension' then '不支持的视频格式'
when 'IllegalCharacters' then '视频名称包含非法字符'
else raise AliyunVod::Error, result['Message']
end
raise AliyunVod::Error, message if message.present?
end
result
rescue => ex

@ -16,15 +16,6 @@ module AliyunVod::Service::VideoUpload
result = request(:post, params)
if result['Code'].present?
message =
case result['Code']
when 'InvalidFileName.Extension' then '不支持的文件格式'
when 'IllegalCharacters' then '文件名称包含非法字符'
end
raise AliyunVod::Error, message if message.present?
end
raise AliyunVod::Error, '获取上传凭证失败' if result['UploadAddress'].blank?
result

@ -21,7 +21,14 @@ class Videos::CreateAuthService < ApplicationService
private
def title
@_title ||= params.delete(:title).to_s.strip
@_title ||= begin
str = params.delete(:title).to_s.strip
if str.length > 30
"#{str[0, 15]}...#{str.reverse[0,10].reverse}"
else
str
end
end
end
def filename

@ -13,6 +13,7 @@ class Videos::DispatchCallbackService < ApplicationService
case params['EventType']
when 'FileUploadComplete' then # 视频上传完成
video.file_url = params['FileUrl']
video.filesize = params['Size']
video.upload_success
video.save!
when 'SnapshotComplete' then # 封面截图完成

@ -0,0 +1,5 @@
class AddFilesizeToVideos < ActiveRecord::Migration[5.2]
def change
add_column :videos, :filesize, :integer, default: 0
end
end

@ -0,0 +1,33 @@
import React,{ Component } from "react";
class AttachmentsList extends Component{
constructor(props){
super(props);
}
render(){
let { attachments } = this.props;
return(
<React.Fragment>
{
attachments.map((item,key)=>{
return(
<p key={key}>
<a className="color-grey">
<i className="font-14 color-green iconfont icon-fujian mr8"></i>
</a>
{
item.is_pdf && item.is_pdf == true ?
<a href={item.url} className="mr12" length="58" target="_blank">{item.title}</a>
:
<a href={item.url} className="mr12" length="58">{item.title}</a>
}
<span className="color-grey mt2 color-grey-6 font-12">{item.filesize}</span>
</p>
)
})
}
</React.Fragment>
)
}
}
export default AttachmentsList;

@ -30,6 +30,9 @@ export { trace_collapse, trace, debug, info, warn, error, trace_c, debug_c, info
export { EDU_ADMIN, EDU_BUSINESS, EDU_SHIXUN_MANAGER, EDU_SHIXUN_MEMBER, EDU_CERTIFICATION_TEACHER
, EDU_GAME_MANAGER, EDU_TEACHER, EDU_NORMAL} from './Const'
export { default as AttachmentList } from './components/attachment/AttachmentList'
export { themes, ThemeContext } from './context/ThemeContext'
export { ModalHOC } from './components/ModalHOC'

@ -45,6 +45,7 @@ class Studentshavecompletedthelist extends Component {
teacherlist: undefined,
searchtext: "",
Teacherliststudentlist: undefined,
mylistansum:0,
review: null,
course_groupysls: undefined,
nocomment: false,
@ -109,17 +110,17 @@ class Studentshavecompletedthelist extends Component {
<span style={{
"color": '#999999',
"text-align": "center"
}}>--</span> :
}}>--</span> :
record.stduynumber ===
"" ?
<span style={{
"color": '#999999',
"text-align": "center"
}}>--</span> :
}}>--</span> :
<span style={{
"color": '#9A9A9A',
"text-align": "center"
}}>{record.stduynumber}</span>
}}>{record.stduynumber}</span>
}
</span>
@ -132,23 +133,23 @@ class Studentshavecompletedthelist extends Component {
align: 'center',
className: "edu-txt-center font-14",
width:"260px",
render: (text, record) => (
render: (text, record) => (
<span>
{record.classroom === null ?
<span style={{
"color": '#999999',
"text-align": "center"
}}>--</span> :
}}>--</span> :
record.classroom ===
"" ?
<span style={{
"color": '#999999',
"text-align": "center"
}}>--</span> :
}}>--</span> :
<span style={{
"color": '#07111B',
"text-align": "center"
}}>{record.classroom}</span>
}}>{record.classroom}</span>
}
</span>
@ -159,16 +160,16 @@ class Studentshavecompletedthelist extends Component {
dataIndex: 'submitstate',
key: 'submitstate',
align: 'center',
className: "edu-txt-center font-14",
className: "edu-txt-center font-14",
render: (text, record) => (
<span>
<span style={record.submitstate === "未提交" ? {
"color": '#999999',
"text-align": "center",
} : record.submitstate === "已提交" ? {"color": '#29BD8B', "text-align": "center"} : {
} : record.submitstate === "已提交" ? {"color": '#29BD8B', "text-align": "center"} : {
"color": '#29BD8B',
"text-align": "center",
}}>{record.submitstate}</span>
}}>{record.submitstate}</span>
</span>
)
@ -179,7 +180,7 @@ class Studentshavecompletedthelist extends Component {
key: 'updatetime',
align: 'center',
className: "edu-txt-center font-14",
render: (text, record) => (
render: (text, record) => (
<span>
{record.updatetime === "--" ?
<span style={{"color": '#999999', "text-align": "center" }}>{record.updatetime}</span>
@ -195,30 +196,30 @@ class Studentshavecompletedthelist extends Component {
key: 'completion',
align: 'center',
className: "edu-txt-center font-14",
render: (text, record) => (
render: (text, record) => (
<span> {
record.completion === "--" ?
<span style={{
"color": '#999999',
"text-align": "center"
}}>
}}>
{record.completion}
</span>
:
<span style={parseInt(record.completion) > 90 ? {
"color": '#DD1717',
"text-align": "center"
} : parseInt(record.completion) <= 90 ? {
} : parseInt(record.completion) <= 90 ? {
"color": '#FF6800',
"text-align": "center"
} : parseInt(record.completion) <= 60 ? {
} : parseInt(record.completion) <= 60 ? {
"color": '#747A7F',
"text-align": "center"
} :
} :
{
"color": '#747A7F',
"text-align": "center"
}}>{record.completion}</span>
}}>{record.completion}</span>
}
</span>
@ -229,27 +230,27 @@ class Studentshavecompletedthelist extends Component {
dataIndex: 'levelscore',
key: 'levelscore',
align: 'center',
className: "edu-txt-center font-14",
className: "edu-txt-center font-14",
render: (text, record) => (
<span>
{record.levelscore === "--" ?
<span style={{
"color": '#999999',
"text-align": "center"
}}>
}}>
{record.levelscore}
</span>
:
<span style={parseInt(record.levelscore) > 90 ? {
"color": '#DD1717',
"text-align": "center"
} : parseInt(record.levelscore) <= 90 ? {
} : parseInt(record.levelscore) <= 90 ? {
"color": '#FF6800',
"text-align": "center"
} : parseInt(record.levelscore) <= 60 ? {
} : parseInt(record.levelscore) <= 60 ? {
"color": '#747A7F',
"text-align": "center"
} : {"color": '#747A7F', "text-align": "center"}}>{record.levelscore}</span>
} : {"color": '#747A7F', "text-align": "center"}}>{record.levelscore}</span>
}
</span>
)
@ -259,34 +260,34 @@ class Studentshavecompletedthelist extends Component {
dataIndex: 'efficiencyscore',
key: 'efficiencyscore',
align: 'center',
className: "edu-txt-center font-14",
className: "edu-txt-center font-14",
render: (text, record) => (
<span>
{record.efficiencyscore === "--" ?
<Tooltip placement="bottom" title={<div>
<div>未评分</div>
</div>}>
<a style={{
"color": '#999999',
"text-align": "center"
}}>
{record.efficiencyscore}
</a>
<a style={{
"color": '#999999',
"text-align": "center"
}}>
{record.efficiencyscore}
</a>
</Tooltip>
:
<span style={parseInt(record.efficiencyscore) > 90 ? {
"color": '#DD1717',
"text-align": "center"
} : parseInt(record.efficiencyscore) <= 90 ? {
} : parseInt(record.efficiencyscore) <= 90 ? {
"color": '#FF6800',
"text-align": "center"
} : parseInt(record.efficiencyscore) <= 60 ? {
} : parseInt(record.efficiencyscore) <= 60 ? {
"color": '#747A7F',
"text-align": "center",
} : {
"color": '#747A7F',
"text-align": "center"
}}>{record.efficiencyscore}</span>
}}>{record.efficiencyscore}</span>
}
</span>
)
@ -298,7 +299,7 @@ class Studentshavecompletedthelist extends Component {
dataIndex: 'number',
key: 'number',
align: 'center',
className: "edu-txt-center tabletd font-14",
className: "edu-txt-center tabletd font-14",
render: (text, record) => (
<span>
{
@ -318,7 +319,7 @@ class Studentshavecompletedthelist extends Component {
key: 'name',
align: 'center',
className: "edu-txt-center tabletd font-14",
render: (text, record) => (
render: (text, record) => (
<span>
{
record.name === "--" ?
@ -336,24 +337,24 @@ class Studentshavecompletedthelist extends Component {
key: 'stduynumber',
align: 'center',
className: "edu-txt-center tabletd font-14",
render: (text, record) => (
render: (text, record) => (
<span>
{record.stduynumber === null ?
<span style={{
"color": '#999999',
"text-align": "center"
}}>--</span>
}}>--</span>
:
record.stduynumber === "" ?
<span style={{
"color": '#999999',
"text-align": "center"
}}>--</span>
}}>--</span>
:
<span style={{
"color": '#9A9A9A',
"text-align": "center"
}}>{record.stduynumber}</span>
}}>{record.stduynumber}</span>
}
</span>
@ -366,22 +367,22 @@ class Studentshavecompletedthelist extends Component {
align: 'center',
className: "edu-txt-center tabletd font-14",
width:"260px",
render: (text, record) => (
render: (text, record) => (
<span>
{record.classroom === null ?
<span style={{
"color": '#999999',
"text-align": "center"
}}>--</span>: record.classroom === "" ?
}}>--</span>: record.classroom === "" ?
<span style={{
"color": '#999999',
"text-align": "center"
}}>--</span>:
}}>--</span>:
<span tyle={{
"color": '#07111B',
"text-align": "center"
}}>{record.classroom}</span>
}
}}>{record.classroom}</span>
}
</span>
)
@ -391,16 +392,16 @@ class Studentshavecompletedthelist extends Component {
dataIndex: 'submitstate',
key: 'submitstate',
align: 'center',
className: "edu-txt-center tabletd font-14",
className: "edu-txt-center tabletd font-14",
render: (text, record) => (
<span>
<span style={record.submitstate === "未提交" ? {
"color": '#999999',
"text-align": "center",
} : record.submitstate === "已提交" ? {"color": '#29BD8B', "text-align": "center"} : {
} : record.submitstate === "已提交" ? {"color": '#29BD8B', "text-align": "center"} : {
"color": '#29BD8B',
"text-align": "center",
}}>{record.submitstate}</span>
}}>{record.submitstate}</span>
</span>
)
@ -411,7 +412,7 @@ class Studentshavecompletedthelist extends Component {
key: 'updatetime',
align: 'center',
className: "edu-txt-center tabletd font-14",
render: (text, record) => (
render: (text, record) => (
<span>
{record.updatetime === "--"?
<span style={{"color": '#999999', "text-align": "center", }}>--</span>
@ -427,13 +428,13 @@ class Studentshavecompletedthelist extends Component {
key: 'completion',
align: 'center',
className: "edu-txt-center tabletd font-14",
render: (text, record) => (
render: (text, record) => (
<span>
{record.completion === "--" ?
<span style={{
<span style={{
"color": '#999999',
"text-align": "center"
}}>
}}>
--
</span>
@ -441,16 +442,16 @@ class Studentshavecompletedthelist extends Component {
<span style={parseInt(record.completion) > 90 ? {
"color": '#DD1717',
"text-align": "center"
} : parseInt(record.completion) <= 90 ? {
} : parseInt(record.completion) <= 90 ? {
"color": '#FF6800',
"text-align": "center"
} : parseInt(record.completion) <= 60 ? {
} : parseInt(record.completion) <= 60 ? {
"color": '#747A7F',
"text-align": "center"
} : {
} : {
"color": '#747A7F',
"text-align": "center"
}}>{record.completion}</span>
}}>{record.completion}</span>
}
</span>
)
@ -460,27 +461,27 @@ class Studentshavecompletedthelist extends Component {
dataIndex: 'levelscore',
key: 'levelscore',
align: 'center',
className: "edu-txt-center tabletd font-14",
className: "edu-txt-center tabletd font-14",
render: (text, record) => (
<span>
{record.levelscore === "--"?
<span style={{
"color": '#999999',
"text-align": "center"
}}>
}}>
--
</span>
:
<span style={parseInt(record.levelscore) > 90 ? {
"color": '#DD1717',
"text-align": "center"
} : parseInt(record.levelscore) <= 90 ? {
} : parseInt(record.levelscore) <= 90 ? {
"color": '#FF6800',
"text-align": "center"
} : parseInt(record.levelscore) <= 60 ? {
} : parseInt(record.levelscore) <= 60 ? {
"color": '#747A7F',
"text-align": "center"
} : {"color": '#747A7F', "text-align": "center"}}>{record.levelscore}</span>
} : {"color": '#747A7F', "text-align": "center"}}>{record.levelscore}</span>
}
</span>
)
@ -490,7 +491,7 @@ class Studentshavecompletedthelist extends Component {
dataIndex: 'efficiencyscore',
key: 'efficiencyscore',
align: 'center',
className: "edu-txt-center tabletd font-14",
className: "edu-txt-center tabletd font-14",
render: (text, record) => (
<span>
{
@ -498,25 +499,25 @@ class Studentshavecompletedthelist extends Component {
<Tooltip placement="bottom" title={<div>
<div>未评分</div>
</div>}>
<a style={{
"color": '#DD1717',
"text-align": "center"
}}>--</a>
<a style={{
"color": '#DD1717',
"text-align": "center"
}}>--</a>
</Tooltip>
:
<span style={parseInt(record.efficiencyscore) > 90 ? {
"color": '#DD1717',
"text-align": "center"
} : parseInt(record.efficiencyscore) <= 90 ? {
} : parseInt(record.efficiencyscore) <= 90 ? {
"color": '#FF6800',
"text-align": "center"
} : parseInt(record.efficiencyscore) <= 60 ? {
} : parseInt(record.efficiencyscore) <= 60 ? {
"color": '#747A7F',
"text-align": "center",
} : {
"color": '#747A7F',
"text-align": "center"
}}>{record.efficiencyscore}</span>
}}>{record.efficiencyscore}</span>
}
</span>
@ -536,7 +537,7 @@ class Studentshavecompletedthelist extends Component {
record.number=== "--"?
<span style={{"color": '#999999', "text-align": "center"}}>--</span>
:
<span style={{"color": '#07111B', "text-align": "center"}}>{record.number}</span>
<span style={{"color": '#07111B', "text-align": "center"}}>{record.number}</span>
}
</span>
@ -569,20 +570,20 @@ class Studentshavecompletedthelist extends Component {
<span>
{record.stduynumber === null ?
<span style={{
"color": '#999999',
"text-align": "center"
}}>--</span>
"color": '#999999',
"text-align": "center"
}}>--</span>
: record.stduynumber === "" ?
<span style={{
"color": '#999999',
"text-align": "center"
}}>--</span>
"color": '#999999',
"text-align": "center"
}}>--</span>
:
<span style={{
"color": '#9A9A9A',
"text-align": "center"
}}>{record.stduynumber}</span>
}
}
</span>
),
@ -609,7 +610,7 @@ class Studentshavecompletedthelist extends Component {
"color": '#07111B',
"text-align": "center"
}}>{record.classroom}</span>
}
}
</span>
)
@ -662,10 +663,10 @@ class Studentshavecompletedthelist extends Component {
<span>
{
record.completion === "--"?
<span style={{
"color": '#999999',
"text-align": "center",
}}>--</span>
<span style={{
"color": '#999999',
"text-align": "center",
}}>--</span>
:
<span style={parseInt(record.completion) > 90 ? {
"color": '#DD1717',
@ -727,12 +728,12 @@ class Studentshavecompletedthelist extends Component {
<Tooltip placement="bottom" title={<div>
<div>未评分</div>
</div>}>
<a style={{
"color": '#999999',
"text-align": "center",
}}>--</a>
<a style={{
"color": '#999999',
"text-align": "center",
}}>--</a>
</Tooltip>
:
:
<span style={parseInt(record.efficiencyscore) > 90 ? {
"color": '#DD1717',
"text-align": "center",
@ -763,9 +764,9 @@ class Studentshavecompletedthelist extends Component {
:record.submitstate === "未提交"?
<span style={{"text-align": "center","color": '#999999',}}>--</span>
:
<a style={{"text-align": "center"}} className="color-blue"
href={`/courses/${this.props.match.params.coursesId}/exercises/${this.props.match.params.Id}/users/${record.myid}`}>{record.operating}</a>
}
<a style={{"text-align": "center"}} className="color-blue"
href={`/courses/${this.props.match.params.coursesId}/exercises/${this.props.match.params.Id}/users/${record.myid}`}>{record.operating}</a>
}
</span>
)
@ -785,7 +786,7 @@ class Studentshavecompletedthelist extends Component {
key: 'number',
align: 'center',
className: "edu-txt-center font-14",
render: (text, record) => (
render: (text, record) => (
<span>
{record.number === "--" ?
<span style={{"color": '#999999', "text-align": "center"}}>--</span>
@ -801,7 +802,7 @@ class Studentshavecompletedthelist extends Component {
key: 'name',
align: 'center',
className: "edu-txt-center font-14",
render: (text, record) => (
render: (text, record) => (
<span>
{record.name==="--"?
<span style={{"color": '#999999', "text-align": "center"}}>{record.name}</span>
@ -817,12 +818,12 @@ class Studentshavecompletedthelist extends Component {
key: 'stduynumber',
align: 'center',
className: "edu-txt-center font-14",
render: (text, record) => (
<span>
render: (text, record) => (
<span>
{record.stduynumber === "--" ?
<span style={{"color": '#999999', "text-align": "center"}}>{record.stduynumber}</span>
:
<span style={{"color": '#9A9A9A', "text-align": "center"}}>{record.stduynumber}</span>
<span style={{"color": '#999999', "text-align": "center"}}>{record.stduynumber}</span>
:
<span style={{"color": '#9A9A9A', "text-align": "center"}}>{record.stduynumber}</span>
}
</span>
),
@ -850,7 +851,7 @@ class Studentshavecompletedthelist extends Component {
key: 'submitstate',
align: 'center',
className: "edu-txt-center font-14",
render: (text, record) => (
render: (text, record) => (
<span>
<span style={record.submitstate === "未提交" ? {
"color": '#999999',
@ -869,7 +870,7 @@ class Studentshavecompletedthelist extends Component {
dataIndex: 'updatetime',
key: 'updatetime',
align: 'center',
className: "edu-txt-center font-14",
className: "edu-txt-center font-14",
render: (text, record) => (
<span>
{record.updatetime==="--"?
@ -886,7 +887,7 @@ class Studentshavecompletedthelist extends Component {
key: 'completion',
align: 'center',
className: "edu-txt-center font-14",
render: (text, record) => (
render: (text, record) => (
<span>
{record.completion=== "--"?
<span style={{"color": '#999999', "text-align": "center"}}>--</span>
@ -902,7 +903,7 @@ class Studentshavecompletedthelist extends Component {
key: 'levelscore',
align: 'center',
className: "edu-txt-center font-14",
render: (text, record) => (
render: (text, record) => (
<span>
{record.levelscore==="--"?
<span style={{"color": '#999999', "text-align": "center"}}>--</span>
@ -918,30 +919,30 @@ class Studentshavecompletedthelist extends Component {
key: 'efficiencyscore',
align: 'center',
className: "edu-txt-center font-14",
render: (text, record) => (
render: (text, record) => (
<span>
{record.efficiencyscore === "--" ?
<Tooltip placement="bottom" title={<div>
<div>未评分</div>
</div>}>
<a style={{"color": '#999999',
<a style={{"color": '#999999',
"text-align": "center",}}>--</a>
</Tooltip>
:
<span style={parseInt(record.efficiencyscore) > 90 ? {
"color": '#DD1717',
"text-align": "center",
} : parseInt(record.efficiencyscore) <= 90 ? {
"color": '#FF6800',
"text-align": "center",
} : parseInt(record.efficiencyscore) <= 60 ? {
"color": '#747A7F',
"text-align": "center",
} : {
"color": '#747A7F',
"text-align": "center",
}}>{record.efficiencyscore}</span>
}
:
<span style={parseInt(record.efficiencyscore) > 90 ? {
"color": '#DD1717',
"text-align": "center",
} : parseInt(record.efficiencyscore) <= 90 ? {
"color": '#FF6800',
"text-align": "center",
} : parseInt(record.efficiencyscore) <= 60 ? {
"color": '#747A7F',
"text-align": "center",
} : {
"color": '#747A7F',
"text-align": "center",
}}>{record.efficiencyscore}</span>
}
</span>
)
},
@ -951,7 +952,7 @@ class Studentshavecompletedthelist extends Component {
key: 'finalscore',
align: 'center',
className: "edu-txt-center font-14",
render: (text, record) => (
render: (text, record) => (
<span>
{record.finalscore==="--"?
<span style={{"text-align": "center","color": '#999999'}}
@ -959,9 +960,9 @@ class Studentshavecompletedthelist extends Component {
:record.submitstate === "未提交"?
<span style={{"text-align": "center","color": '#999999'}}
>--</span>
:
<a style={{"text-align": "center"}} className="color-blue"
href={`/courses/${this.props.match.params.coursesId}/exercises/${this.props.match.params.Id}/users/${record.myid}`}>{record.finalscore}</a>
:
<a style={{"text-align": "center"}} className="color-blue"
href={`/courses/${this.props.match.params.coursesId}/exercises/${this.props.match.params.Id}/users/${record.myid}`}>{record.finalscore}</a>
}
</span>
@ -1114,8 +1115,8 @@ class Studentshavecompletedthelist extends Component {
<Tooltip placement="bottom" title={<div>
<div>未评分</div>
</div>}>
<a style={{"color": '#999999',
"text-align": "center",}}>--</a>
<a style={{"color": '#999999',
"text-align": "center",}}>--</a>
</Tooltip>
:
<span style={parseInt(record.efficiencyscore) > 90 ? {
@ -1149,9 +1150,9 @@ class Studentshavecompletedthelist extends Component {
:record.submitstate === "未提交"?
<span style={{"text-align": "center","color": '#999999'}}
>--</span>
:
<a style={{"text-align": "center"}} className="color-blue"
href={`/courses/${this.props.match.params.coursesId}/exercises/${this.props.match.params.Id}/users/${record.myid}`}>{record.finalscore}</a>
:
<a style={{"text-align": "center"}} className="color-blue"
href={`/courses/${this.props.match.params.coursesId}/exercises/${this.props.match.params.Id}/users/${record.myid}`}>{record.finalscore}</a>
}
</span>
@ -1252,6 +1253,7 @@ class Studentshavecompletedthelist extends Component {
exercise_users: response.data.exercise_users,
current_answer_user: response.data.current_answer_user,
course_groups: response.data.course_groups,
mylistansum:response.data.exercise_types.answer_users+response.data.exercise_types.unanswer_users
})
if (response.data.current_answer_user === undefined || response.data.current_answer_user === null) {
// 学生未截止
@ -1389,7 +1391,7 @@ class Studentshavecompletedthelist extends Component {
loadingstate: true,
})
}
console.log(response);
console.log(response);
console.log(1393);
thiss.Generatenewdatasy(response.data.exercise_users, response);
}
@ -1622,6 +1624,7 @@ class Studentshavecompletedthelist extends Component {
commit_status: response.data.commit_status,
exercise_users: response.data.exercise_users,
current_answer_user: response.data.current_answer_user,
mylistansum:response.data.exercise_types.answer_users+response.data.exercise_types.unanswer_users,
})
if (response.data.exercise_types.subjective === 0) {
@ -1756,6 +1759,7 @@ class Studentshavecompletedthelist extends Component {
commit_status: response.data.commit_status,
exercise_users: response.data.exercise_users,
course_groups: response.data.course_groups,
mylistansum:response.data.exercise_types.answer_users+response.data.exercise_types.unanswer_users,
loadingstate: false,
columnsys: arr,
})
@ -1788,6 +1792,7 @@ class Studentshavecompletedthelist extends Component {
commit_status: response.data.commit_status,
exercise_users: response.data.exercise_users,
course_groups: response.data.course_groups,
mylistansum:response.data.exercise_types.answer_users+response.data.exercise_types.unanswer_users,
columnsys: arr,
})
}
@ -1799,7 +1804,7 @@ class Studentshavecompletedthelist extends Component {
//显示分班
//8ge
var arr =[];
var arr =[];
for(var i=0;i<this.state.columnsys.length;i++){
var item = this.state.columnsys[i];
if(item.title==="客观题得分"){
@ -1823,6 +1828,7 @@ class Studentshavecompletedthelist extends Component {
commit_status: response.data.commit_status,
exercise_users: response.data.exercise_users,
course_groups: response.data.course_groups,
mylistansum:response.data.exercise_types.answer_users+response.data.exercise_types.unanswer_users,
loadingstate: false,
columnsys: arr,
})
@ -1854,6 +1860,7 @@ class Studentshavecompletedthelist extends Component {
commit_status: response.data.commit_status,
exercise_users: response.data.exercise_users,
course_groups: response.data.course_groups,
mylistansum:response.data.exercise_types.answer_users+response.data.exercise_types.unanswer_users,
loadingstate: false,
columnsys: arr,
})
@ -1885,6 +1892,7 @@ class Studentshavecompletedthelist extends Component {
commit_status: response.data.commit_status,
exercise_users: response.data.exercise_users,
course_groups: response.data.course_groups,
mylistansum:response.data.exercise_types.answer_users+response.data.exercise_types.unanswer_users,
columnsys: arr,
})
} else {
@ -1909,6 +1917,7 @@ class Studentshavecompletedthelist extends Component {
commit_status: response.data.commit_status,
exercise_users: response.data.exercise_users,
course_groups: response.data.course_groups,
mylistansum:response.data.exercise_types.answer_users+response.data.exercise_types.unanswer_users,
columnsys:arr,
})
}
@ -1923,6 +1932,7 @@ class Studentshavecompletedthelist extends Component {
commit_status: response.data.commit_status,
exercise_users: response.data.exercise_users,
course_groups: response.data.course_groups,
mylistansum:response.data.exercise_types.answer_users+response.data.exercise_types.unanswer_users,
loadingstate: false,
columnsys: this.state.columnsystwo,
})
@ -1948,6 +1958,7 @@ class Studentshavecompletedthelist extends Component {
commit_status: response.data.commit_status,
exercise_users: response.data.exercise_users,
course_groups: response.data.course_groups,
mylistansum:response.data.exercise_types.answer_users+response.data.exercise_types.unanswer_users,
loadingstate: false,
columnsys: arr,
})
@ -2401,7 +2412,7 @@ class Studentshavecompletedthelist extends Component {
render() {
const isAdmin = this.props.isAdmin();
let {data, datas, page, columns, course_groupyslsthree, columnstwo, styletable, course_groupyslstwodatas, limit, course_groupysls, course_groupyslstwodata, course_groupyslstwo, teacherlists, Teacherliststudentlist, order, columnss, course_groupsdatas, course_groups, Evaluationarray, unlimited, unlimiteds, unlimitedtwo, teacherlist, searchtext, loadingstate, review, nocomment, commented, unsubmitted, submitted, columnsys, exercise_users} = this.state;
let {data, datas, page, columns, course_groupyslsthree, columnstwo, styletable, course_groupyslstwodatas, limit, course_groupysls, course_groupyslstwodata, course_groupyslstwo, teacherlists, Teacherliststudentlist, order, columnss, course_groupsdatas, course_groups, Evaluationarray, unlimited, unlimiteds, unlimitedtwo, teacherlist, searchtext, loadingstate, review, nocomment, commented, unsubmitted, submitted, columnsys, exercise_users,mylistansum} = this.state;
// console.log("Studentshavecompletedthelist");
// console.log(this.props.current_status);
return (
@ -2789,11 +2800,11 @@ class Studentshavecompletedthelist extends Component {
</div>
{
Teacherliststudentlist && Teacherliststudentlist.exercise_types.total_users && Teacherliststudentlist.exercise_types.total_users > limit ?
mylistansum && mylistansum > limit ?
<div className="edu-txt-center mt30 mb20">
<Pagination showQuickJumper current={page}
onChange={this.paginationonChanges} pageSize={limit}
total={Teacherliststudentlist.exercise_types.total_users}></Pagination>
total={mylistansum}></Pagination>
</div>
: ""
}

@ -413,8 +413,8 @@ class Testpapersettinghomepage extends Component{
<a className="fr color-blue font-16 mt20" onClick={()=>this.setgameexercise(`/courses/${this.props.match.params.coursesId}/exercises/${this.props.match.params.Id}/users/${this.props.current_user.login}`)}>开始答题</a>:
<Link className="fr color-blue font-16 mt20"
to={`/courses/${this.props.match.params.coursesId}/exercises/${this.props.match.params.Id}/users/${this.props.current_user.login}`}>
{start_Value[Commonheadofthetestpaper&&Commonheadofthetestpaper.user_permission.current_status]}
</Link>
{Commonheadofthetestpaper && Commonheadofthetestpaper.exercise_status===3?"":Commonheadofthetestpaper && Commonheadofthetestpaper.exercise_status===4?"":start_Value[Commonheadofthetestpaper&&Commonheadofthetestpaper.user_permission.current_status]}
</Link>
:""}
</div>

@ -206,7 +206,9 @@ class PollDetailIndex extends Component{
{
user_permission && user_permission.current_status!=3 ?
<WordsBtn style="blue" to={`/courses/${this.props.match.params.coursesId}/polls/${this.props.match.params.pollId}/users/${this.props.current_user.login}`}>
{ user_permission && user_permission.current_status ==0 ? "继续答题" : user_permission.current_status == 1 ? "查看答题" : "开始答题" }
{ user_permission && user_permission.current_status ==0 ? "继续答题" : user_permission.current_status == 1 ?
(pollDetail && pollDetail.polls_status===3?"":pollDetail && pollDetail.polls_status===4?"":"查看答题")
: "开始答题" }
</WordsBtn>
:""
}

@ -5,70 +5,70 @@ import "../css/Courses.css";
import CoursesMarkdown from "../coursesPublic/CoursesMarkdown";
import TPMMDEditor from '../../tpm/challengesnew/TPMMDEditor';
import {
Form, Icon, Input, Button, Checkbox,message,
Form, Icon, Input, Button, Checkbox,message,
} from "antd";
import {WordsBtn} from 'educoder';
//引入对应跳转的组件
import axios from 'axios';
//提交总结
class CommitSummary extends Component{
constructor(props) {
super(props)
this.state = {
contents: [{val:"",id:1}],
course_id:0,
course_name:"",
category:[],
homework_id:0,
user_name:"",
work_id:0,
description:"",
data:undefined,
cancels:false,
}
}
componentDidMount() {
this.Getsubmissionsummaryinterface();
let query = this.props.location.pathname;
const type = query.split('/');
this.setState({
shixuntypes:type[3]
})
constructor(props) {
super(props)
this.state = {
contents: [{val:"",id:1}],
course_id:0,
course_name:"",
category:[],
homework_id:0,
user_name:"",
work_id:0,
description:"",
data:undefined,
cancels:false,
}
}
componentDidMount() {
this.Getsubmissionsummaryinterface();
let query = this.props.location.pathname;
const type = query.split('/');
this.setState({
shixuntypes:type[3]
})
}
//获取提交总结接口
Getsubmissionsummaryinterface=()=>{
var worksid=this.props.match.params.id;
// console.log("Getsubmissionsummaryinterface");
// console.log(this.props.match.params);
// console.log(worksid);
var url = `/student_works/${worksid}/commit_des.json`;
axios.get(url).then((result) => {
// console.log(result);
if (result.status === 200) {
// console.log(url)
// console.log("提交总结接口")
// console.log(JSON.stringify(result))
this.setState({
data:result.data,
description: result.data.description,
cancels:true,
})
}else {
this.props.showNotification(result.data.message);
}
}).catch((error) => {
console.log(error)
//获取提交总结接口
Getsubmissionsummaryinterface=()=>{
var worksid=this.props.match.params.id;
// console.log("Getsubmissionsummaryinterface");
// console.log(this.props.match.params);
// console.log(worksid);
var url = `/student_works/${worksid}/commit_des.json`;
axios.get(url).then((result) => {
// console.log(result);
if (result.status === 200) {
// console.log(url)
// console.log("提交总结接口")
// console.log(JSON.stringify(result))
this.setState({
data:result.data,
description: result.data.description,
cancels:true,
})
}
}else {
this.props.showNotification(result.data.message);
submitCommitSummary=()=> {
const mdContnet = this.refs[`md${1}`].getValue().trim();
console.log(mdContnet)
}
}).catch((error) => {
console.log(error)
})
}
submitCommitSummary=()=> {
const mdContnet = this.refs[`md${1}`].getValue().trim();
console.log(mdContnet)
}
gotohome=()=>{
// let courseId=this.props.match.params.coursesId;
@ -77,126 +77,146 @@ class CommitSummary extends Component{
// }else{
// this.props.history.push(this.props.current_user.first_category_url);
// }
this.props.history.goBack()
}
this.props.history.goBack()
}
asdasdsad=()=>{
this.setState({
contents:""
})
this.setState({
contents:""
})
}
handleSubmit=(e) => {
e.preventDefault();
this.props.form.validateFields((err, values) => {
if (!err) {
console.log(values.description);
if(values.description === undefined|| values.description === "" || values.description ===null){
this.props.showNotification(`请输入提交内容`);
return
}
var worksid=this.props.match.params.id;
var url = `/student_works/${worksid}/update_des.json`;
axios.post(url,{
description:values.description,
}).then((result) => {
if (result.status === 200) {
// console.log(url)
// console.log("提交总结接口")
// console.log(JSON.stringify(result))
// message.success(result.data.message);
// 这里以前是学生
this.props.history.push(`/courses/${this.props.match.params.coursesId}/${this.state.shixuntypes}/${this.props.match.params.homeworkid}/list?tab=0`);
}
}).catch((error) => {
console.log(error)
})
}
});
}
handleSubmit=(e) => {
e.preventDefault();
this.props.form.validateFields((err, values) => {
if (!err) {
console.log(values.description);
if(values.description === undefined|| values.description === "" || values.description ===null){
this.props.showNotification(`请输入提交内容`);
return
}
var worksid=this.props.match.params.id;
var url = `/student_works/${worksid}/update_des.json`;
axios.post(url,{
description:values.description,
}).then((result) => {
if (result.status === 200) {
// console.log(url)
// console.log("提交总结接口")
// console.log(JSON.stringify(result))
// message.success(result.data.message);
// 这里以前是学生
this.props.history.push(`/courses/${this.props.match.params.coursesId}/${this.state.shixuntypes}/${this.props.match.params.homeworkid}/list?tab=0`);
}
}).catch((error) => {
console.log(error)
})
}
});
}
render() {
const {getFieldDecorator} = this.props.form;
let {contents,data}=this.state;
// console.log(this.props);
return (
<div>
<div className="newMain clearfix">
{/*<Form onSubmit={this.handleSubmit}>*/}
<div className={"educontent mb20"}>
<div style={{
width:'100%',
height:'20px'
}} >
<div className="educontent mb30">
<p className="clearfix mb20 mt10 ">
<a className="btn colorgrey fl hovercolorblue " onClick={()=>this.gotohome()}>{data === undefined ? "" :data.course_name===undefined?"": data.course_name}</a>
<span className="color-grey-9 fl ml3 mr3">&gt;</span>
{/* style="grey" */}
<a
className="btn colorgrey fl hovercolorblue ">{data === undefined ? "" :data.category===undefined?"":data.category.category_name}</a>
<span className="color-grey-9 fl ml3 mr3">&gt;</span>
<a className="fl">作业详情</a>
</p>
</div>
render() {
const {getFieldDecorator} = this.props.form;
let {contents,data}=this.state;
// console.log(this.props);
return (
<div>
<div className="newMain clearfix">
{/*<Form onSubmit={this.handleSubmit}>*/}
<div className={"educontent mb20"}>
<div style={{
width:'100%',
height:'20px'
}} >
<div className="educontent mb30">
<p className="clearfix mb20 mt10 ">
<a className="btn colorgrey fl hovercolorblue " onClick={()=>this.gotohome()}>{data === undefined ? "" :data.course_name===undefined?"": data.course_name}</a>
<span className="color-grey-9 fl ml3 mr3">&gt;</span>
{/* style="grey" */}
<a
className="btn colorgrey fl hovercolorblue ">{data === undefined ? "" :data.category===undefined?"":data.category.category_name}</a>
<span className="color-grey-9 fl ml3 mr3">&gt;</span>
<a className="fl">作业详情</a>
</p>
</div>
</div>
<div>
<p className=" fl color-black mt10 summaryname" onClick={this.asdasdsad}>{this.state.description ? '修改总结' : '提交总结'}</p>
<a onClick={()=>this.gotohome()} className="color-grey-6 fr font-16 ml30 mt10">返回</a>
</div>
{/*educontentbox*/}
<div className="stud-class-set pt40 pb40">
<div className={"mt10"}>
<div style={{ "background": "#fff", "padding": "15px"}}>
</div>
<div className="mt20">
<p className=" fl color-black mt10 summaryname" onClick={this.asdasdsad}>{this.state.description ? '修改总结' : '提交总结'}</p>
<a onClick={()=>this.gotohome()} className="color-grey-6 fr font-16 ml30 mt10">返回</a>
</div>
{/*educontentbox*/}
<div className="stud-class-set pt40 pb40">
<div className={"mt10"}>
<div style={{ "background": "#fff", "padding": "15px"}}>
<span className="commitcontentsysl">
<span className="color-red">*</span>
内容</span>
</div>
<div className="new-wrap">
<Form layout='vertical' onSubmit={this.handleSubmit} >
<Form.Item
>
<div style={{ "background": "#fff","padding-bottom":"20px","padding-left":"20px","padding-right":"20px"}}
className="mdInForm">
{getFieldDecorator('description', {
rules: [{
required: true, message: '请在此输入总结内容,最多5000个字符',
}, {
max: 5000, message: '最大限制为5000个字符',
}],
})(
<TPMMDEditor ref={this.mdRef} placeholder={'请在此输入总结内容最多5000个字符'}
mdID={'courseMessageMD'} initValue={this.state.description} className="courseMessageMD"></TPMMDEditor>
)}
</div>
</Form.Item>
<Form.Item>
<div className="clearfix mt40 mb30">
<Button type="primary" htmlType="submit" className="defalutSubmitbtn fl mr20" >
提交
</Button>
<a className="defalutCancelbtn fl" href={`/courses/${this.props.match.params.coursesId}/${this.state.shixuntypes}/${this.props.match.params.homeworkid}/list?tab=0`}>取消</a>
</div>
</Form.Item>
</Form>
</div>
</div>
</div>
<div className="new-wrap">
<Form layout='vertical' onSubmit={this.handleSubmit} >
<Form.Item
>
<div style={{ "background": "#fff","padding-bottom":"20px","padding-left":"20px","padding-right":"20px"}}
className="mdInForm">
{getFieldDecorator('description', {
rules: [{
required: true, message: '请在此输入总结内容,最多5000个字符',
}, {
max: 5000, message: '最大限制为5000个字符',
}],
})(
<TPMMDEditor ref={this.mdRef} placeholder={'请在此输入总结内容最多5000个字符'}
mdID={'courseMessageMD'} initValue={this.state.description} className="courseMessageMD"></TPMMDEditor>
)}
</div>
</Form.Item>
<style>
{
`
.ant-form-item {
-webkit-box-sizing: border-box;
box-sizing: border-box;
margin: 0;
padding: 0;
color: rgba(0, 0, 0, 0.65);
font-size: 14px;
font-variant: tabular-nums;
line-height: 1.5;
list-style: none;
-webkit-font-feature-settings: 'tnum';
font-feature-settings: 'tnum';
/* margin-bottom: 24px; */
vertical-align: top;
}
`
}
</style>
<Form.Item>
<div className="clearfix mt40 mb30">
<Button type="primary" htmlType="submit" className="defalutSubmitbtn fl mr20" >
提交
</Button>
<a className="defalutCancelbtn fl" href={`/courses/${this.props.match.params.coursesId}/${this.state.shixuntypes}/${this.props.match.params.homeworkid}/list?tab=0`}>取消</a>
</div>
</Form.Item>
</Form>
</div>
</div>
</div>
</div>
{/*</Form>*/}
</div>
</div>
)
}
</div>
{/*</Form>*/}
</div>
</div>
)
}
}
const GraduationTasksnewApp = Form.create({ name: 'coursesNew' })(CommitSummary);
export default GraduationTasksnewApp;

@ -132,7 +132,7 @@ class ShixunHomeworkPage extends Component {
<div className="newMain clearfix ">
<div className={"educontent mt20 mb20"} style={{width: "1200px"}}>
<div className={"educontent mt10 mb20"} style={{width: "1200px"}}>
<div className="educontent mb20">
<p className="clearfix mb20 mt10">

@ -2,13 +2,15 @@ import React,{ Component } from "react";
import './css/moopCases.css'
import '../courses/css/Courses.css'
import { getImageUrl , MarkdownToHtml , ActionBtn } from 'educoder';
import { getImageUrl , MarkdownToHtml , ActionBtn , AttachmentList } from 'educoder';
import Tags from './CaseTags'
import axios from 'axios';
import Modals from '../modals/Modals'
// import AttachmentList from '../../common/components/attachment/AttachmentList'
class CaseDetail extends Component{
constructor(props){
super(props);
@ -65,110 +67,103 @@ class CaseDetail extends Component{
} = this.state;
return(
<div className="educontent mt10 mb50">
<Modals
modalsType={modalsType}
modalsTopval={modalsTopval}
modalsBottomval={modalsBottomval}
modalCancel={this.cancelDelClasses}
modalSave={this.sureDelClasses}
>
</Modals>
<p className="mt10 mb20 clearfix lineh-20">
<a href="/moop_cases" className="color-grey-9">教学案例</a> &gt; <span className="color-grey-3">{ CaseDetail && CaseDetail.title}</span>
</p>
<p className="lineh-25 mb20 clearfix">
<span className="font-22 fl mr10 task-hide" style={{maxWidth:"800px"}}>
{ CaseDetail && CaseDetail.title}
</span>
<span className="mt5 fl">
<Tags tags={tags}></Tags>
{
CaseDetail && CaseDetail.status == "pending" && <span class="edu-filter-btn fl cdefault edu-activity-green ml10">草稿</span>
}
{
CaseDetail && CaseDetail.status == "processing" && <span class="edu-filter-btn fl cdefault edu-activity-green ml10">审核中</span>
}
{
CaseDetail && CaseDetail.status == "refused" && <span class="edu-filter-btn fl cdefault edu-activity-orange ml10">未通过</span>
}
</span>
<a href="/moop_cases" className="fr color-grey-9 mt5">返回</a>
</p>
<div className="edu-back-white">
<div className="padding30">
<div className="df mb5">
<a href="/users/moop"><img alt="82274?1563067098" className="radius mr15 mt3" height="50" src={getImageUrl(`images/${creator && creator.image_url}`)} width="50" /></a>
<div className="flex1">
<li className="clearfix mb5">
<span className="font-16 fl">{creator && creator.name}</span>
{
operation && operation.can_deletable ? <ActionBtn style="greyLine" onClick={this.delCases} className="fr">删除</ActionBtn>:""
}
{
operation && operation.can_editable ? <ActionBtn style="colorBlue" to={`/moop_cases/${this.props.match.params.caseID}/edit`} className="fr mr20">编辑</ActionBtn>:""
}
</li>
<li className="clearfix lineh-20">
<span className="fl color-grey-9 mr20">{creator && creator.school_name}</span>
<span className="fr">
<span className="fl color-grey-9 mr30">编码<span className="color-grey-6">{CaseDetail && CaseDetail.uuid}</span></span>
{
CaseDetail && CaseDetail.status=="published" ?
<span className="fl color-grey-9">发布时间<span className="color-grey-6">{CaseDetail && CaseDetail.published_at}</span></span>
:
<span className="fl color-grey-9">上传时间<span className="color-grey-6">{CaseDetail && CaseDetail.created_at}</span></span>
}
</span>
</li>
</div>
</div>
<div>
<span className="fl color-grey-9">作者</span>{CaseDetail && CaseDetail.author_name}/{CaseDetail && CaseDetail.author_school_name}
</div>
<style>
{`
.setMDStyle .editormd-html-preview{
width:100%!important;
{
CaseDetail &&
<React.Fragment>
<Modals
modalsType={modalsType}
modalsTopval={modalsTopval}
modalsBottomval={modalsBottomval}
modalCancel={this.cancelDelClasses}
modalSave={this.sureDelClasses}
>
</Modals>
<p className="mt10 mb20 clearfix lineh-20">
<a href="/moop_cases" className="color-grey-9">教学案例</a> &gt; <span className="color-grey-3">{ CaseDetail.title}</span>
</p>
<p className="lineh-25 mb20 clearfix">
<span className="font-22 fl mr10 task-hide" style={{maxWidth:"800px"}}>
{ CaseDetail.title}
</span>
<span className="mt5 fl">
<Tags tags={tags}></Tags>
{
CaseDetail.status == "pending" && <span class="edu-filter-btn fl cdefault edu-activity-green ml10">草稿</span>
}
{
CaseDetail.status == "processing" && <span class="edu-filter-btn fl cdefault edu-activity-green ml10">审核中</span>
}
`}
</style>
<div class="mt20 setMDStyle">
{ CaseDetail && CaseDetail.content && <MarkdownToHtml content={CaseDetail.content} id="casesDetail" selector="casesDetail" style={{width:"100%!important"}}></MarkdownToHtml>}
</div>
{ attachments &&
<div className="mt10">
{
attachments.map((item,key)=>{
return(
<p>
<a className="color-grey">
<i className="font-14 color-green iconfont icon-fujian mr8"></i>
</a>
<a href={item.url} className="mr12" length="58">{item.title}</a>
<span className="color-grey mt2 color-grey-6 font-12">{item.filesize}</span>
</p>
)
})
CaseDetail.status == "refused" && <span class="edu-filter-btn fl cdefault edu-activity-orange ml10">未通过</span>
}
</span>
<a href="/moop_cases" className="fr color-grey-9 mt5">返回</a>
</p>
<div className="edu-back-white">
<div className="padding30">
<div className="df mb5">
<a href="/users/moop"><img alt="82274?1563067098" className="radius mr15 mt3" height="50" src={getImageUrl(`images/${creator && creator.image_url}`)} width="50" /></a>
<div className="flex1">
<li className="clearfix mb5">
<span className="font-16 fl">{creator && creator.name}</span>
{
operation && operation.can_deletable ? <ActionBtn style="greyLine" onClick={this.delCases} className="fr">删除</ActionBtn>:""
}
{
operation && operation.can_editable ? <ActionBtn style="colorBlue" to={`/moop_cases/${this.props.match.params.caseID}/edit`} className="fr mr20">编辑</ActionBtn>:""
}
</li>
<li className="clearfix lineh-20">
<span className="fl color-grey-9 mr20">{creator && creator.school_name}</span>
<span className="fr">
<span className="fl color-grey-9 mr30">编码<span className="color-grey-6">{CaseDetail.uuid}</span></span>
{
CaseDetail && CaseDetail.status=="published" ?
<span className="fl color-grey-9">发布时间<span className="color-grey-6">{CaseDetail.published_at}</span></span>
:
<span className="fl color-grey-9">上传时间<span className="color-grey-6">{CaseDetail.created_at}</span></span>
}
</span>
</li>
</div>
</div>
<div>
<span className="fl color-grey-9">作者</span>{CaseDetail.author_name}/{CaseDetail.author_school_name}
</div>
<style>
{`
.setMDStyle .editormd-html-preview{
width:100%!important;
}
`}
</style>
<div class="mt20 setMDStyle">
{ CaseDetail.content && <MarkdownToHtml content={CaseDetail.content} id="casesDetail" selector="casesDetail" style={{width:"100%!important"}}></MarkdownToHtml>}
</div>
{ attachments &&
<div className="mt10">
<AttachmentList {...this.props} {...this.state} attachments={attachments}></AttachmentList>
</div>
}
<div class="mt40">
{
user_praised ?
<p className="pointsBtn pointedBtn">
<span>已赞</span>
<span>{praise_count}</span>
</p>
:
<p onClick = {()=>this.props.praisePoint(this.props.match.params.caseID)} className="pointsBtn">
<span><i class="iconfont icon-dianzan"></i></span>
<span>{praise_count}</span>
</p>
}
</div>
</div>
}
<div class="mt40">
{
user_praised ?
<p className="pointsBtn pointedBtn">
<span>已赞</span>
<span>{praise_count}</span>
</p>
:
<p onClick = {()=>this.props.praisePoint(this.props.match.params.caseID)} className="pointsBtn">
<span><i class="iconfont icon-dianzan"></i></span>
<span>{praise_count}</span>
</p>
}
</div>
</div>
</div>
</React.Fragment>
}
</div>
)
}

Loading…
Cancel
Save