From bd2cbd6793eec04e1debed0ec29d62de90c32d6b Mon Sep 17 00:00:00 2001 From: huang Date: Tue, 11 Apr 2017 17:32:44 +0800 Subject: [PATCH] =?UTF-8?q?myshixun=E6=96=B0=E7=89=88=E6=A1=86=E6=9E=B6?= =?UTF-8?q?=E6=90=AD=E5=BB=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/helpers/application_helper.rb | 4 + app/views/games/_games_list.html.erb | 36 +++ app/views/games/_repository.html.erb | 32 +- app/views/games/show.html.erb | 207 +++++++++--- app/views/layouts/base_myshixun.html.erb | 347 ++------------------- app/views/myshixuns/_myshixun_top.html.erb | 31 +- 6 files changed, 263 insertions(+), 394 deletions(-) diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index 1799122c7..3c5f37db3 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -50,6 +50,10 @@ module ApplicationHelper end # 定义实训相关方法 + def sum_final_score + Game.find_by_sql("SELECT sum(final_score) as total_score FROM `games` where user_id=#{User.current.id}").first.try(:total_score) + end + # myshixun 最高分 def top_score shixun, position Game.find_by_sql("SELECT max(final_score) as top_score FROM `games` g, `challenges` c where g.challenge_id = c.id and c.position=#{position} and g.myshixun_id in (SELECT id FROM `myshixuns` ms where ms.shixun_id=#{shixun.id})").first.try(:top_score) diff --git a/app/views/games/_games_list.html.erb b/app/views/games/_games_list.html.erb index 75605342a..2d23b5076 100644 --- a/app/views/games/_games_list.html.erb +++ b/app/views/games/_games_list.html.erb @@ -1,3 +1,39 @@ +
+
+
+

全部任务

+
+
+
+ 01

础入门Python基础入门P

+
+
+
+
+
+ 02

础入门Python基础入门Python基础

+ +
+
+
+
+
+ 03

础入门Python基础入门Python基础入thon基础入thon基础入thon基础入thon基础入门

+ 正在解决 +
+
+
+
+
+ 04

础入门Python基础入门Python基

+ +
+
+
+
+
+ +
diff --git a/app/views/games/_repository.html.erb b/app/views/games/_repository.html.erb index 61de11723..ff9bd58f8 100644 --- a/app/views/games/_repository.html.erb +++ b/app/views/games/_repository.html.erb @@ -1,16 +1,22 @@ -
- <%= render :partial => 'myshixun_repository' %> +
+

+ <%= render :partial => 'myshixun_breadcrumbs', :locals => {:path => @path, :kind => 'dir'} %> +

+
+ + +
+
+
+ <% if params[:action] == "entry" || @file_open %> +
+ <%= render :partial => 'games/file_edit_form', :locals => {:filename => @path, :content => @content} %> +
+ <% else %> + <% unless @entries.blank? %> + <%= render :partial => 'tree', :locals => { :extend => false}%> + <% end %> + <% end %>
-
- diff --git a/app/views/games/show.html.erb b/app/views/games/show.html.erb index 0b80122f8..9dd632bb0 100644 --- a/app/views/games/show.html.erb +++ b/app/views/games/show.html.erb @@ -1,51 +1,162 @@ -<%= javascript_include_tag 'baiduTemplate', 'jquery.datetimepicker.js' %> -<%= javascript_include_tag "/assets/codemirror/codemirror_python_ruby_c" %> -<%= stylesheet_link_tag "/assets/codemirror/codemirror" %> -
- <%= render :partial => "game_show" %> +
+
+
+
+
+ +
+
+
+
+
+
+ <%= h @game_challenge.task_pass.try(:html_safe) %> +
+
+
+
+
+
+
+
+ <%= h @game_challenge.ready_knowledge.try(:html_safe) %> +
+
+
+
+
+
+
+
+ <%= @game_challenge.answer %> +
+
+
+
+
+
+ +
-
- <%= render :partial => 'desc_full_show'%> +
+
+
+
+
+
+
+ <%= render :partial => 'games/repository' %> +
+
+
+ +
+
+
+
+
+
+

0/11 编译错误

+
+
+ + 测试集 1 +
+
+
    +
  • 输入:param1:1
  • +
  • 实际输出:
  • +
  • 期望输出:3
  • +
+
+
+
+
+ + 测试集 2 +
+
+
+
+
+
+ + 测试集 3 + +
+
+
+
+
+
+ + 测试集 4 + +
+
+
+
+
+
+
+
+
+
+
+
+

11/11 全部通过

+
+
+
    +
  • 样例测试:9/9
  • +
  • 隐藏测试:9/9
  • +
  • 经验值:+ 300
  • +
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 耗时:1天5小时10分钟 + 测评 +
+
+
-
- <%= render :partial => 'myshixun_extend_repository' %>
-
- <%= render :partial => 'extend_test_output' %> -
- - +
\ No newline at end of file diff --git a/app/views/layouts/base_myshixun.html.erb b/app/views/layouts/base_myshixun.html.erb index 532aef9f1..0fb164eb8 100644 --- a/app/views/layouts/base_myshixun.html.erb +++ b/app/views/layouts/base_myshixun.html.erb @@ -19,59 +19,10 @@
-
-
-
-

全部任务

-
-
-
- 01

础入门Python基础入门P

-
-
-
-
-
- 02

础入门Python基础入门Python基础

- -
-
-
-
-
- 03

础入门Python基础入门Python基础入thon基础入thon基础入thon基础入thon基础入门

- 正在解决 -
-
-
-
-
- 04

础入门Python基础入门Python基

- -
-
-
-
+ - -
+ -
-
-
-
-
- -
-
-
-
-
-
-

第一关标题

-

- Python3 代码风格建议
- Python3 中使用注释
- 认识 Python3 模块
- 实验步骤
- 1. 解释器
- Python 是一个脚本语言,你可以在 Python
解释器中直接写代码或者将代码写到一个文件里,然后执行这个文件(即脚本文件)。
- 首先,我们从使用解释器开始,打开终端,键入Python3 并回车。这个时候解释器便工作于交互模式。
- Python3 中使用注释
- 认识 Python3 模块
- 实验步骤
- 1. 解释器
- Python 是一个脚本语言,你可以在 Python
解释器中直接写代码或者将代码写到一个文件里,然后执行这个文件(即脚本文件)。
- 首先,我们从使用解释器开始,打开终端,键入Python3 并回车。这个时候解释器便工作于交互模式。
- Python3 中使用注释
- 认识 Python3 模块
- 实验步骤
- 1. 解释器
- Python 是一个脚本语言,你可以在 Python
解释器中直接写代码或者将代码写到一个文件里,然后执行这个文件(即脚本文件)。
- 首先,我们从使用解释器开始,打开终端,键入Python3 并回车。这个时候解释器便工作于交互模式。
- Python3 中使用注释
- 认识 Python3 模块
- 实验步骤
- 1. 解释器
- Python 是一个脚本语言,你可以在 Python
解释器中直接写代码或者将代码写到一个文件里,然后执行这个文件(即脚本文件)。
- 首先,我们从使用解释器开始,打开终端,键入Python3 并回车。这个时候解释器便工作于交互模式。
- 1. 解释器
- Python 是一个脚本语言,你可以在 Python
解释器中直接写代码或者将代码写到一个文件里,然后执行这个文件(即脚本文件)。
- 首先,我们从使用解释器开始,打开终端,键入Python3 并回车。这个时候解释器便工作于交互模式。
- Python3 中使用注释
- 认识 Python3 模块
- 实验步骤
- 1. 解释器
- Python 是一个脚本语言,你可以在 Python
解释器中直接写代码或者将代码写到一个文件里,然后执行这个文件(即脚本文件)。
- 首先,我们从使用解释器开始,打开终端,键入Python3 并回车。这个时候解释器便工作于交互模式。
-

-
-
-
-
-
-
-
-
-

dafafdasf

-

dafafdasf

-

dafafdasf

-

dafafdasf

-

dafafdasf

-

dafafdasf

-

dafafdasf

-

dafafdasf

-

dafafdasf

-

dafafdasf

-

dafafdasf

-

dafafdasf

-

dafafdasf

-

dafafdasf

-

dafafdasf

-

dafafdasf

-

dafafdasf

-

dafafdasf

-
-
-
-
-
-
-
-
-

dafafdasf

-

dafafdasf

-

dafafdasf

-

dafafdasf

-

dafafdasf

-

dafafdasf

-

dafafdasf

-

dafafdasf

-

dafafdasf

-

dafafdasf

-

dafafdasf

-

dafafdasf

-

dafafdasf

-

dafafdasf

-

dafafdasf

-

dafafdasf

-

dafafdasf

-

dafafdasf

-
-
-
-
-
-
- -
-
-
-
-
-
-
-
-
-
-

testrepo / lib / plugins / acts_as_searchable / init.rb

-
- -
-
-
-
-
-
-
- -
-
-
-
-
-
-

0/11 编译错误

-
-
- - 测试集 1 -
-
-
    -
  • 输入:param1:1
  • -
  • 实际输出:
  • -
  • 期望输出:3
  • -
-
-
-
-
- - 测试集 2 -
-
-
-
-
-
- - 测试集 3 - -
-
-
-
-
-
- - 测试集 4 - -
-
-
-
-
-
-
-
-
-
-
-
-

11/11 全部通过

-
-
-
    -
  • 样例测试:9/9
  • -
  • 隐藏测试:9/9
  • -
  • 经验值:+ 300
  • -
-
-
-
-
-
-
-
-
-
-
-
-
-
- 耗时:1天5小时10分钟 - 测评 -
-
-
-
-
-
+<%= yield %>