|
|
|
@ -65,7 +65,7 @@ class GamesService
|
|
|
|
|
|
|
|
|
|
# power判断用户是否有权限查看隐藏测试集(TPM管理员;平台认证的老师;花费金币查看者) -1 表示不能解锁 0 表示需要付费解锁 1表示可以看
|
|
|
|
|
# myshixun_manager
|
|
|
|
|
myshixun_manager = shixun_manager(shixun, current_user) || (current_user.is_certification_teacher && shixun.test_set_permission)
|
|
|
|
|
myshixun_manager = shixun_manager(shixun, current_user) || (current_user.is_certification_teacher)
|
|
|
|
|
power = (myshixun_manager || game.test_sets_view ) ? 1 : (shixun.test_set_permission ? 0 : -1)
|
|
|
|
|
|
|
|
|
|
# 选择题和编程题公共部分
|
|
|
|
@ -862,7 +862,7 @@ class GamesService
|
|
|
|
|
Rails.logger.warn("last_output is #{latest_output}")
|
|
|
|
|
|
|
|
|
|
# power判断用户是否有权限查看隐藏测试集(TPM管理员;平台认证的老师;花费金币查看者)
|
|
|
|
|
power = (shixun_manager(shixun, current_user) || (current_user.is_certification_teacher && shixun.test_set_permission)) ? 1 : (shixun.test_set_permission ? 0 : -1)
|
|
|
|
|
power = (shixun_manager(shixun, current_user) || (current_user.is_certification_teacher)) ? 1 : (shixun.test_set_permission ? 0 : -1)
|
|
|
|
|
# 测试集统计及处理
|
|
|
|
|
unless qurey_test_sets.blank?
|
|
|
|
|
check_power = (power == 1 || game.test_sets_view)
|
|
|
|
|