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

* 'dev_aliyun' of https://bdgit.educoder.net/Hjqreturn/educoder:
  调整
  调整
  学生重做的权限调整
  协作老师
  增加老师名称
courseware
harry 5 years ago
commit 45925e4fc6

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

@ -99,7 +99,7 @@ class CoursesController < ApplicationController
limit = params[:limit] || 16
@courses = @courses.page(page).per(limit)
@courses = @courses.preload(:school, :none_hidden_course_modules, :teacher_users, teacher: :user_extension)
@courses = @courses.preload(:school, :none_hidden_course_modules, teacher: :user_extension)
end
def course_videos

@ -18,7 +18,8 @@ class MyshixunsController < ApplicationController
# 强制重置实训
# 前段需要按照操作过程提示
def reset_my_game
unless (current_user.admin? || current_user.id == @myshixun.user_id)
course = Course.find_by(id: params[:course_id])
unless (current_user.admin_or_business? || current_user.id == @myshixun.user_id) || (course.present? && current_user.course_identity(course) < Course::STUDENT)
tip_exception("403", "")
end
begin

@ -76,6 +76,7 @@ class Weapps::CoursesController < Weapps::BaseController
def show
@course = current_course
@current_user = current_user
@teacher_users = @course.teacher_users.where.not(id: @course.tea_id).map(&:real_name)[0..2]
end
def shixun_homework_category

@ -19,7 +19,7 @@ class Weapps::HomesController < Weapps::BaseController
@courses = @courses.where(id: current_laboratory.all_courses)
@course_count = @courses.count
order_str = "course_members.sticky=1 desc, course_members.sticky_time desc, courses.created_at desc"
@courses = paginate(@courses.order(order_str).includes(:teacher, :school))
@courses = paginate(@courses.order(order_str).includes(:teacher_users, :teacher, :school))
@user = current_user
end
end

@ -13,6 +13,5 @@ json.courses @courses do |course|
json.is_end course.is_end
json.first_category_url module_url(course.none_hidden_course_modules.first, course)
json.excellent course.excellent
json.teacher_users course.teacher_users.select{|u| u.id != course.tea_id }.map(&:real_name)[0..2] # 取前3名老师
end
json.courses_count @courses_count

@ -1,4 +1,5 @@
json.homework_common_id @homework.id
json.course_id @homework.course_id
json.category @homework.category_info
json.course_name @course.name
json.work_id @work.id

@ -1,4 +1,5 @@
json.(@course, :id, :name, :course_members_count, :credit, :invite_code_halt)
json.teachers_count @course.teachers.count
json.students_count @course.students.count
json.course_identity @current_user.course_identity(@course)
json.course_identity @current_user.course_identity(@course)
json.teacher_users @teacher_users

@ -26,5 +26,6 @@ json.courses @courses.each do |course|
course_member = @category == "study" ? course.students.where(user_id: @user.id).first : course.teachers.where(user_id: @user.id).first
json.sticky course_member.sticky
json.course_identity current_user.course_identity(course)
json.teacher_users course.teacher_users.select{|u| u.id != course.tea_id }.map(&:real_name)[0..2] # 取前3名老师
end

@ -1,6 +1,6 @@
import React,{Component} from "react";
import { Form, Select, Input, Button,Checkbox,Upload,Icon,message,Modal, Table, Divider, Tag,DatePicker,Radio,Tooltip,Spin, Pagination} from "antd";
import {WordsBtn, ConditionToolTip, queryString, publicSearchs, on, off, NoneData, sortDirections} from 'educoder';
import { Form, Table,Tooltip,Spin, Pagination} from "antd";
import { queryString, publicSearchs, on, off, NoneData, sortDirections} from 'educoder';
import axios from 'axios';
import CheckAllGroup from '../common/button/CheckAllGroup'
import moment from 'moment';
@ -11,7 +11,6 @@ import ModulationModal from "../coursesPublic/ModulationModal";
import AccessoryModal from "../coursesPublic/AccessoryModal";
import LeaderIcon from './common/LeaderIcon'
const $ = window.$;
const Search = Input.Search;
function renderScore(score, content) {
let color = '#747A7F'
@ -369,18 +368,24 @@ function buildColumns(that, student_works, studentData) {
{/* 0 未提交 */}
{/*<React.Fragment>*/}
{/*</React.Fragment>*/}
<div>
<a style={{color: '#4CACFF'}} id={"asdasdasdasd"}
className="font-14"
onMouseDown={(e) => that.props.toWorkDetailPage2(e, courseId, workId, record.id)}
// onClick={() => that.props.toWorkDetailPage(courseId, workId, record.id)}
>{isAdmin ? record.has_comment===true?"已评阅":'评阅':"查看"}</a>
</div>
<div>
{ isAdmin && <Tooltip placement="bottom" title={<pre>调整学生当前成绩<br/>其它历史评分将全部失效</pre>}>
<a style={{color: "#4CACFF"}}
<a style={{color: "#32C090"}}
className="font-14"
onClick={() => that.showModulationModal(record)}
>调分</a>
</Tooltip> }
</div>
{/* toWorkDetailPage */}
{/* /classrooms/"+courseId+"/common_homeworks/"+workId+ '/' + record.id +"/appraise */}
<a style={{color: '#4CACFF', marginLeft: '4px'}} id={"asdasdasdasd"}
onMouseDown={(e) => that.props.toWorkDetailPage2(e, courseId, workId, record.id)}
// onClick={() => that.props.toWorkDetailPage(courseId, workId, record.id)}
>{isAdmin ? record.has_comment===true?"已评阅":'评阅':"查看"}</a>
</div>
),

@ -23,7 +23,7 @@ class Chongzuomodel extends React.Component {
this.setState({
antIcon:true
})
let zrl=`/myshixuns/${this.props.chongzuoId}/reset_my_game.json`;
let zrl=`/myshixuns/${this.props.chongzuoId}/reset_my_game.json?course_id=${this.props.match.params.coursesId}`;
axios.get(zrl).then((response) => {
this.setState({
antIcon:false

Loading…
Cancel
Save