|
|
@ -115,12 +115,13 @@ class CnmoocsService
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
|
|
def source_url(params)
|
|
|
|
def source_url(params)
|
|
|
|
|
|
|
|
user = User.find_by_id(params[:userId])
|
|
|
|
|
|
|
|
token = Token.get_or_create_permanent_login_token(user)
|
|
|
|
shixun = Shixun.find_by_id(params[:resouceId])
|
|
|
|
shixun = Shixun.find_by_id(params[:resouceId])
|
|
|
|
if shixun.blank?
|
|
|
|
if shixun.blank?
|
|
|
|
return { error: -1, messages: '资源不存在' }
|
|
|
|
return { error: -1, messages: '资源不存在' }
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
{ error: 0, messages: '成功', accessUrl: "#{Redmine::Configuration['educoder_domain']}/shixuns/#{shixun.identifier}/challenges?authToken=#{token.value}" }
|
|
|
|
{ error: 0, messages: '成功', accessUrl: "#{Redmine::Configuration['educoder_domain']}/shixuns/#{shixun.identifier}" }
|
|
|
|
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
|
|
def get_students_data params
|
|
|
|
def get_students_data params
|
|
|
|