Compare commits

...

4 Commits

Author SHA1 Message Date
  linchun 1232ed5ccf Merge branch 'linchun' of https://git.trustie.net/jacknudt/trustieforge into linchun 10 years ago
  linchun 383a53515d 20160603data_analysis 10 years ago
  linchun ff6b26b071 20160603data_analysis 10 years ago
  linchun 7c2cd5ffd8 dataaanlysis2 10 years ago
13 changed files with 72 additions and 0 deletions
Unified View
  1. +3
    -0
      app/assets/javascripts/data_analysis.js.coffee
  2. +3
    -0
      app/assets/stylesheets/data_analysis.css.scss
  3. +17
    -0
      app/controllers/admin_controller.rb
  4. +4
    -0
      app/controllers/data_analysis_controller.rb
  5. +2
    -0
      app/helpers/data_analysis_helper.rb
  6. +7
    -0
      app/views/admin/_tab_homework_analysis.erb
  7. +8
    -0
      app/views/admin/course_analysis.html.erb
  8. +7
    -0
      app/views/admin/excellent_courses.html.erb
  9. +1
    -0
      app/views/admin/homework_analysis.html.erb
  10. +1
    -0
      app/views/admin/student_course_comprehensive_performace.html.erb
  11. +2
    -0
      app/views/data_analysis/index.html.erb
  12. +5
    -0
      config/routes.rb
  13. +12
    -0
      spec/controllers/data_analysis_controller_spec.rb

+ 3
- 0
app/assets/javascripts/data_analysis.js.coffee View File

@@ -0,0 +1,3 @@
# Place all the behaviors and hooks related to the matching controller here.
# All this logic will automatically be available in application.js.
# You can use CoffeeScript in this file: http://jashkenas.github.com/coffee-script/

+ 3
- 0
app/assets/stylesheets/data_analysis.css.scss View File

@@ -0,0 +1,3 @@
// Place all the styles related to the data_analysis controller here.
// They will automatically be included in application.css.
// You can use Sass (SCSS) here: http://sass-lang.com/

+ 17
- 0
app/controllers/admin_controller.rb View File

@@ -63,6 +63,23 @@ class AdminController < ApplicationController
end end
end end
# 课程数据分析
def course_analysis
@course = Course.find(params[:course_id])
respond_to do |format|
format.html
end
end
#课程中学生作业得分分析
def homework_analysis
end
#课程中学生综合成绩
def student_course_comprehensive_performace
end
#精品课程下的全部课程 #精品课程下的全部课程
def excellent_all_courses def excellent_all_courses
name = params[:name] name = params[:name]


+ 4
- 0
app/controllers/data_analysis_controller.rb View File

@@ -0,0 +1,4 @@
class DataAnalysisController < ApplicationController
def index
end
end

+ 2
- 0
app/helpers/data_analysis_helper.rb View File

@@ -0,0 +1,2 @@
module DataAnalysisHelper
end

+ 7
- 0
app/views/admin/_tab_homework_analysis.erb View File

@@ -0,0 +1,7 @@
<div class="tabs">
<ul>
<li><%= link_to '作业成绩分析', {:action => 'homework_analysis'}, class: "#{current_page?(homework_analysis_path)? 'selected' : nil }" %></li>
<li><%= link_to '学生综合得分', {:action => 'student_course_comprehensive_performace'}, class: "#{current_page?(student_course_comprehensive_performace_path)? 'selected' : nil }" %></li>

</ul>
</div>

+ 8
- 0
app/views/admin/course_analysis.html.erb View File

@@ -0,0 +1,8 @@
<%= stylesheet_link_tag 'jquery/jquery-ui-1.9.2', :media => 'all' %>
<h1 class="BgBox_h2">课程中学生行为数据分析</h1>
<tr>课程名:<tr/><%= @course.name %><br>
<tr>主讲教师:</tr><%=@course.tea_id %><br>
<tr>学生数:</tr><%= studentCount(@course) %><br><br><br>

<%= render 'tab_homework_analysis' %>


+ 7
- 0
app/views/admin/excellent_courses.html.erb View File

@@ -39,6 +39,9 @@
<th style="width: 70px;"> <th style="width: 70px;">
动态数 动态数
</th> </th>
<th style="width: 70px;">
数据分析
</th>
</tr> </tr>
</thead> </thead>
<tbody> <tbody>
@@ -74,7 +77,11 @@
<td class="center"> <td class="center">
<%= course.course_activities.count%> <%= course.course_activities.count%>
</td> </td>
<td style="white-space: nowrap;overflow: hidden;text-overflow: ellipsis;" class="name" title='<%=course.name%>'>
<%= link_to '进入数据分析', {:controller => "admin", :action => "course_analysis", :course_id => course.id} %>
</td>
</tr> </tr>

<% end %> <% end %>
</tbody> </tbody>
</table> </table>


+ 1
- 0
app/views/admin/homework_analysis.html.erb View File

@@ -0,0 +1 @@
sdfddsg

+ 1
- 0
app/views/admin/student_course_comprehensive_performace.html.erb View File

@@ -0,0 +1 @@
dfgasd

+ 2
- 0
app/views/data_analysis/index.html.erb View File

@@ -0,0 +1,2 @@
<h1>DataAnalysis#index</h1>
<p>Find me in app/views/data_analysis/index.html.erb</p>

+ 5
- 0
config/routes.rb View File

@@ -26,6 +26,8 @@
# Example: :via => :get ====> :via => :get # Example: :via => :get ====> :via => :get
RedmineApp::Application.routes.draw do RedmineApp::Application.routes.draw do
get "data_analysis/index"
mount Mobile::API => '/api' mount Mobile::API => '/api'
# Enable Grack support # Enable Grack support
@@ -1007,6 +1009,9 @@ RedmineApp::Application.routes.draw do
match 'admin/projects', :via => :get match 'admin/projects', :via => :get
get 'admin/courses' get 'admin/courses'
get 'admin/excellent_courses', as: :excellent_courses get 'admin/excellent_courses', as: :excellent_courses
get 'admin/course_analysis', as: :course_analysis
get 'admin/homework_analysis', as: :homework_analysis
get 'admin/student_course_comprehensive_performace', as: :student_course_comprehensive_performace
get 'admin/excellent_all_courses', as: :excellent_all_courses get 'admin/excellent_all_courses', as: :excellent_all_courses
match 'admin/set_excellent_course/:id', :to => 'admin#set_excellent_course' match 'admin/set_excellent_course/:id', :to => 'admin#set_excellent_course'
get 'admin/course_resource_list' get 'admin/course_resource_list'


+ 12
- 0
spec/controllers/data_analysis_controller_spec.rb View File

@@ -0,0 +1,12 @@
require 'rails_helper'

RSpec.describe DataAnalysisController, :type => :controller do

describe "GET #index" do
it "returns http success" do
get :index
expect(response).to have_http_status(:success)
end
end

end

Loading…
Cancel
Save