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

courseware
cxt 5 years ago
commit 84ce7fce52

@ -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

@ -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.(@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

@ -44,7 +44,9 @@ export default ({ src, videoId, logWatchHistory, courseId = null }) => {
let pos = []//
const log = useCallback((callback, isEnd = false) => {
let params = {}
let params = {
point: el.currentTime.currentTime
}
if (logId) {
params['log_id'] = logId
params['watch_duration'] = getTotalEffectTime(pos) //
@ -137,7 +139,7 @@ export default ({ src, videoId, logWatchHistory, courseId = null }) => {
log()
}
}
}else {
} else {
lastUpdatedTime = newTime
}
}
@ -177,7 +179,7 @@ export default ({ src, videoId, logWatchHistory, courseId = null }) => {
el.current.removeEventListener('seeking', onSeeking)
el.current.removeEventListener('seeked', onSeeked)
el.current.removeEventListener('timeupdate', onTimeupdate)
if(el.current.playing) {
if (el.current.playing) {
log()
}
}

Loading…
Cancel
Save