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

courseware
caicai8 5 years ago
commit b2d153169e

@ -19,7 +19,7 @@ $(document).on('turbolinks:load', function() {
var json = {};
json[s_name] = s_value;
$.ajax({
url: "/admins/courses/" + s_id,
url: "/admins/classrooms/" + s_id,
type: "PUT",
dataType:'script',
data: json

@ -36,10 +36,13 @@ class CourseSecondCategoriesController < ApplicationController
# 更新相应对象的子目录id
if @course_module.module_type == "shixun_homework"
@category.homework_commons.update_all(course_second_category_id: 0)
@right_url = "/courses/#{@course.id}/shixun_homeworks/#{@course_module.id}"
@right_url = "/classrooms/#{@course.id}/shixun_homeworks/#{@course_module.id}"
elsif @course_module.module_type == "attachment"
Attachment.where(course_second_category_id: @category.id).update_all(course_second_category_id: 0)
@right_url = "/courses/#{@course.id}/files/#{@course_module.id}"
@right_url = "/classrooms/#{@course.id}/files/#{@course_module.id}"
elsif @course_module.module_type == "video"
@course.course_videos.where(course_second_category_id: @category.id).update_all(course_second_category_id: 0)
@right_url = "/classrooms/#{@course.id}/course_videos"
end
@category.destroy

@ -46,13 +46,13 @@ class StudentWork < ApplicationRecord
# 匿评次数
def student_comment_num
homework_common.homework_detail_manual.comment_status > 2 && work_status > 0 ? self.student_works_scores.select{|score| score.reviewer_role == 3}.group_by(&:user_id).count : 0
homework_common.homework_detail_manual.comment_status > 2 && work_status > 0 ? self.student_works_scores.select{|score| score.reviewer_role == 3}.group_by(&:user_id).size : 0
end
# 学生评阅作品数
def user_comment_num
if homework_common.homework_detail_manual.comment_status > 2 && work_status > 0
count = homework_common.student_works_scores.select{|score| score.reviewer_role == 3 && score.user_id == user_id}.group_by(&:student_work_id).count
count = homework_common.student_works_scores.select{|score| score.reviewer_role == 3 && score.user_id == user_id}.group_by(&:student_work_id).size
else
count = 0
end

@ -1,7 +1,7 @@
<td><%= list_index_no((params[:page] || 1).to_i, no) %></td>
<td><%= course.id %></td>
<td class="text-left">
<%= link_to(course.name, "/courses/#{course.id}", target: '_blank') %>
<%= link_to(course.name, "/classrooms/#{course.id}", target: '_blank') %>
</td>
<td><%= course.course_members_count %></td>
<td><%= get_attachment_count(course, 0) %></td>

@ -17,7 +17,7 @@
<% if @courses.present? %>
<% @courses.each do |course| %>
<tr>
<td class="text-left"><a href="/courses/<%= course.id %>/students" target="_blank" class="d-inline-block text-truncate" style="max-width: 220px"><%= course.name %></a></td>
<td class="text-left"><a href="/classrooms/<%= course.id %>/students" target="_blank" class="d-inline-block text-truncate" style="max-width: 220px"><%= course.name %></a></td>
<% teacher_names = course.teacher_users.map(&:real_name).join('、') %>
<td class="text-left">
<span class="d-inline-block text-truncate" style="max-width: 150px" data-toggle="tooltip" title="<%= teacher_names %>">

@ -1,3 +1,3 @@
json.status 0
json.message "删除成功"
json.right_url "/courses/#{@course.id}/students"
json.right_url "/classrooms/#{@course.id}/students"

@ -21,7 +21,7 @@ json.course_modules @course_modules.each do |mod|
json.position board.position
json.category_count board.messages_count
json.category_type "messages"
json.second_category_url "/courses/#{@course.id}/boards/#{board.id}"
json.second_category_url "/classrooms/#{@course.id}/boards/#{board.id}"
end
end
else

@ -4,11 +4,11 @@ json.top do
json.course_url "/courses"
json.competitions_url "#{@old_domain}/competitions"
json.topic_url "/forums"
json.new_course_url "/courses/new"
json.new_course_url "/classrooms/new"
json.new_shixun_url "/shixuns/new"
json.new_shixun_path_url "/paths/new"
json.new_project_url "#{@old_domain}/projects/new"
json.join_course_url "/courses/join_course_multi_role"
json.join_course_url "/classrooms/join_course_multi_role"
json.join_project_url "#{@old_domain}/applied_project/applied_project_info"
json.message_url "#{@user_url}/user_tidings"
json.new_message @new_message

@ -916,7 +916,7 @@ class Fileslists extends Component{
{
`
.filesnameslist{
max-width: 486px;
max-width: 389px;
overflow: hidden;
text-overflow: ellipsis;
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) {
columns.push({
width: 70,

@ -181,6 +181,7 @@ class Coursesleftnav extends Component{
}
componentDidMount() {
this.setState({
url:this.props.match.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?
<span>
<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>
</span>:"":"":""}

@ -41,7 +41,13 @@ class QuestionModal extends Component {
""
}
<div className="clearfix mt30 edu-txt-center">
<a className="task-btn mr30 w80" onClick={()=>this.props.modalCancel()}>取消</a>
{
this.props.titilesm&&this.props.titilesm==="功能正在内测中,敬请期待"?
""
:
<a className="task-btn mr30 w80" onClick={()=>this.props.modalCancel()}>取消</a>
}
<a className="task-btn task-btn-orange w80" onClick={()=>this.props.setDownload()}>{this.props.boolok?this.props.boolok:"确定"}</a>
</div>
</div>

Loading…
Cancel
Save