|
|
@ -126,9 +126,7 @@ class CnmoocsService
|
|
|
|
def get_students_data params
|
|
|
|
def get_students_data params
|
|
|
|
shixun = Shixun.find_by_id params[:resouceId]
|
|
|
|
shixun = Shixun.find_by_id params[:resouceId]
|
|
|
|
return {error: -1, messages: "资源id不对,请使用资源的id查找"} if shixun.blank?
|
|
|
|
return {error: -1, messages: "资源id不对,请使用资源的id查找"} if shixun.blank?
|
|
|
|
# shixun_ids = StageShixun.where(:stage_id => subject.stages).pluck(:shixun_id)
|
|
|
|
myshixun = shixun.myshixuns.where(:user_id => params[:userId]).includes(:games).first
|
|
|
|
#myshixuns = Myshixun.where(:user_id => params[:userId], shixun_id: shixun_ids).includes(:games)
|
|
|
|
|
|
|
|
myshixun = shixun.myshixuns.where(:user_id => params[:userId]).includes(:games)
|
|
|
|
|
|
|
|
if myshixun.present?
|
|
|
|
if myshixun.present?
|
|
|
|
score = myshixun.total_score
|
|
|
|
score = myshixun.total_score
|
|
|
|
time = 0
|
|
|
|
time = 0
|
|
|
|