|
|
@ -108,7 +108,7 @@ class CnmoocsService
|
|
|
|
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: '成功', data: {accessUrl: "#{Redmine::Configuration['educoder_domain']}/shixuns/#{shixun.identifier}/challenges?authToken=#{token.value}" }}
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
|
|
def get_students_data params
|
|
|
|
def get_students_data params
|
|
|
@ -121,7 +121,7 @@ class CnmoocsService
|
|
|
|
myshixun.games.each do |game|
|
|
|
|
myshixun.games.each do |game|
|
|
|
|
time += game.consumes_time_int
|
|
|
|
time += game.consumes_time_int
|
|
|
|
end
|
|
|
|
end
|
|
|
|
{error: 0, messages: '成功', data: {time: time, score: score * 10}}
|
|
|
|
{error: 0, messages: '成功', data: {experiment: {time: time, score: score * 10}}}
|
|
|
|
else
|
|
|
|
else
|
|
|
|
{error: -1, messages: '用户还未开始学习此资源'}
|
|
|
|
{error: -1, messages: '用户还未开始学习此资源'}
|
|
|
|
end
|
|
|
|
end
|
|
|
|