|
|
|
@ -108,7 +108,7 @@ class CnmoocsService
|
|
|
|
|
if shixun.blank?
|
|
|
|
|
return { error: -1, messages: '资源不存在' }
|
|
|
|
|
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
|
|
|
|
|
|
|
|
|
|
def get_students_data params
|
|
|
|
@ -121,7 +121,7 @@ class CnmoocsService
|
|
|
|
|
myshixun.games.each do |game|
|
|
|
|
|
time += game.consumes_time_int
|
|
|
|
|
end
|
|
|
|
|
{error: 0, messages: '成功', data: {time: time, score: score * 10}}
|
|
|
|
|
{error: 0, messages: '成功', data: {experiment: {time: time, score: score * 10}}}
|
|
|
|
|
else
|
|
|
|
|
{error: -1, messages: '用户还未开始学习此资源'}
|
|
|
|
|
end
|
|
|
|
|