pre_develop
jingquan huang 6 years ago
commit d02c056427

@ -3,7 +3,7 @@
module Mobile
module Apis
class Cnmooc < Grape::API
before {cnmooc_access_key!}
# before {cnmooc_access_key!}
content_type :json, 'application/json;charset=UTF-8'
resources :cnmoocs do
@ -39,7 +39,7 @@ module Mobile
desc "获取资源访问地址"
params do
requires :userId, type: Integer, desc: "用户ID"
requires :resouceId, type: String, desc: "资源唯一标示"
requires :resourceId, type: String, desc: "资源唯一标示"
requires :accessType, type: Integer, desc: "资源类型"
end
get "source_url" do
@ -72,7 +72,7 @@ module Mobile
desc "资源学习情况查询"
params do
requires :userId, type: Integer, desc: "用户ID"
requires :resouceId, type: String, desc: "资源唯一标示"
requires :resourceId, type: String, desc: "资源唯一标示"
end
get 'get_students_data' do
CnmoocsService.new.get_students_data params

@ -52,7 +52,7 @@ module ZipService
members = exercise.course.members
exercise_users.each do |exercise_user|
member = members.where(:user_id => exercise_user.user_id).first
group_name = member.try(:course_group_id).to_i == 0 ? '未分班' : member.course_group.name
group_name = member.try(:course_group_id).to_i == 0 ? '未分班' : member.course_group.try(:name)
export_file_name = "#{group_name}-#{exercise.course_id}-#{exercise.exercise_name}-#{exercise_user.user.user_extensions.student_id}-#{exercise_user.user.show_real_name}" + ".pdf"
out_file = export_user_exercise(exercise, exercise_user, export_file_name)
file_name = File::expand_path(out_file)

Loading…
Cancel
Save