diff --git a/app/services/shixuns_service.rb b/app/services/shixuns_service.rb index f4842076..69bbc431 100644 --- a/app/services/shixuns_service.rb +++ b/app/services/shixuns_service.rb @@ -128,9 +128,9 @@ class ShixunsService manager = current_user.manager_of_shixun?(dis, current_user) game_url = if manager - challenge_id = dis.challenges.where(position: d.position).pluck(:id).first - game_identifier = Game.where(user_id: current_user, - challenge_id: challenge_id).pluck(:identifier).first + position = d.position.nil? ? 1 : d.position + game_identifier = Game.find_by_sql("SELECT g.identifier FROM games g JOIN challenges c on g.challenge_id = c.id + WHERE c.shixun_id = #{dis.id} AND c.position = #{position} AND g.user_id = #{d.user_id}").first.try(:identifier) "/tasks/#{game_identifier}" else "" diff --git a/app/views/layouts/pdf.html.erb b/app/views/layouts/pdf.html.erb index 23e1f238..b20f1c15 100644 --- a/app/views/layouts/pdf.html.erb +++ b/app/views/layouts/pdf.html.erb @@ -10,13 +10,12 @@ <%= heads_for_theme %> <%= call_hook :view_layouts_base_html_head %> <%= stylesheet_link_tag 'jquery/jquery-ui-1.9.2', 'css/edu-common','educoder/edu-main','educoder/edu-all', 'css/edu-public', 'css/font-awesome', 'css/edu-class', 'css/magic-check'%> - <%#= javascript_heads %> - <%= javascript_include_tag "edu/application",'educoder/edu_application'%> + <%= javascript_heads %> + <%= javascript_include_tag "edu/application", 'educoder/edu_application'%> - +
- <%= render_flash_messages %> <%= yield %>
diff --git a/app/views/managements/_users_authorization_list.html.erb b/app/views/managements/_users_authorization_list.html.erb index 5be2d75c..16aa63e1 100644 --- a/app/views/managements/_users_authorization_list.html.erb +++ b/app/views/managements/_users_authorization_list.html.erb @@ -38,7 +38,7 @@ <%= user.try(:authentication_status) %> <%= user.try(:professional_status) %> <%= user.try(:user_extensions).try(:school).try(:name).blank? ? "--" : user.try(:user_extensions).try(:school) %> - <%= user.try(:user_extensions).department ? user.try(:user_extensions).try(:department).try(:name).to_s : '--' %> + <%= user.try(:user_extensions).try(:department) ? user.try(:user_extensions).try(:department).try(:name).to_s : '--' %> <%= user.last_login_on.blank? ? "--" : (format_time user.last_login_on) %> <%= identity_authentication_status(user) %> diff --git a/app/views/student_work/shixun_work_report.html.erb b/app/views/student_work/shixun_work_report.html.erb index a7307405..1b1fe228 100644 --- a/app/views/student_work/shixun_work_report.html.erb +++ b/app/views/student_work/shixun_work_report.html.erb @@ -93,7 +93,7 @@ <%#= render :partial => "student_work/echart_of_shixun_skills" %>
--> -<% if true %> + <% unless params[:pdf] %>

图形统计 diff --git a/public/react/src/modules/comment/Comments.js b/public/react/src/modules/comment/Comments.js index 7bde1298..250cf16b 100644 --- a/public/react/src/modules/comment/Comments.js +++ b/public/react/src/modules/comment/Comments.js @@ -277,6 +277,12 @@ class Comments extends Component { {item.time} { item.position && [第{item.position}关] } + { item.game_url ? + + 查看 + : ""} { item.reward ? @@ -303,7 +309,7 @@ class Comments extends Component {

- { item.hidden && item.admin === false && item.manager === false + { item.hidden && item.admin === false && (item.manager === false || item.manager == undefined) ?

违规评论已被屏蔽!

:
}