diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index 7e9fd652b..7fedb4c5d 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -62,15 +62,18 @@ module ApplicationHelper # shixun开启挑战对应的行为名及url def task_operation_url current_myshixun, shixun - url = "/shixuns/#{shixun.identifier}/shixun_exec" - name = - if current_myshixun.blank? - shixun.status == 0 ? "模拟实战" : "开启挑战" - elsif current_myshixun.status == 1 - "查看实战" + if current_myshixun.blank? + name = shixun.status == 0 ? "模拟实战" : "开启挑战" + url = "/shixuns/#{shixun.identifier}/shixun_exec" + else + identifier = current_myshixun.current_task(current_myshixun.games) + if current_myshixun.status == 1 + name = "查看实战" else - "继续挑战" + name = "继续挑战" end + url = identifier + end [name, url] end