commit
a0db221ffc
@ -1 +1 @@
|
||||
{"access_token":"oEEf8ZKAB8Y2G0o_xnTPkPJHKKk8iHkLC-f5ptvQ2nCMj9IpC86ivLD2-p38GfOkuG-HuQp3pWZqhs3NJXUMdPLWsr5k67hPZYuqg4ozLccx0xdLswapj0mn8ovZhK1tKIKiAFAOMO","expires_in":7200,"got_token_at":1467012449}
|
||||
{"access_token":"b_Pc60Dd5eyg_ut3cHbsjQO9EJJdj2Qj5F99o9LH9ltKSme7_FZ3Of22lWLL-K2V0siWzv-bd9PO0Dn-L1PBvIy9LhXa0qPVaFl6vTtZHR2kA8qjo1ps2ancya0t7KmzURGbAFAAXM","expires_in":7200,"got_token_at":1467976842}
|
@ -0,0 +1,114 @@
|
||||
source 'https://ruby.taobao.org/'
|
||||
|
||||
unless RUBY_PLATFORM =~ /w32/
|
||||
# unix-like only
|
||||
gem 'iconv'
|
||||
gem "rmagick", ">= 2.0.0"
|
||||
gem 'certified'
|
||||
end
|
||||
|
||||
gem 'net-ssh', '2.9.1'
|
||||
gem 'jenkins_api_client'
|
||||
gem 'nokogiri'
|
||||
|
||||
gem 'wechat',path: 'lib/wechat'
|
||||
gem 'grack', path:'lib/grack'
|
||||
gem 'gitlab', path: 'lib/gitlab-cli'
|
||||
gem 'rest-client'
|
||||
gem "mysql2", "= 0.3.18"
|
||||
gem 'redis-rails'
|
||||
gem 'rubyzip'
|
||||
gem 'delayed_job_active_record'#, :group => :production
|
||||
gem 'daemons'
|
||||
gem 'grape', '~> 0.9.0'
|
||||
gem 'grape-entity'
|
||||
gem 'rack-cors', :require => 'rack/cors'
|
||||
gem 'seems_rateable', '~> 1.0.13'
|
||||
gem 'rails', '~> 3.2'
|
||||
gem "jquery-rails", "~> 2.0.2"
|
||||
gem "i18n", "~> 0.6.0"
|
||||
gem 'coderay', '~> 1.1.0'
|
||||
gem "fastercsv", "~> 1.5.0", :platforms => [:mri_18, :mingw_18, :jruby]
|
||||
gem "builder", "3.0.0"
|
||||
gem 'acts-as-taggable-on', '2.4.1'
|
||||
gem 'spreadsheet'
|
||||
gem 'ruby-ole'
|
||||
gem 'rails_kindeditor',path:'lib/rails_kindeditor'
|
||||
gem 'binding_of_caller'
|
||||
gem 'chinese_pinyin'
|
||||
# gem 'sunspot_rails', '~> 1.3.3'
|
||||
# gem 'sunspot_solr'
|
||||
# gem 'sunspot'
|
||||
# gem 'progress_bar'
|
||||
gem 'ansi'
|
||||
|
||||
gem 'kaminari'
|
||||
gem 'elasticsearch-model'
|
||||
gem 'elasticsearch-rails'
|
||||
|
||||
|
||||
### profile
|
||||
#gem 'oneapm_rpm'
|
||||
|
||||
group :development do
|
||||
gem 'grape-swagger'
|
||||
gem 'better_errors', '~> 1.1.0'
|
||||
# gem "query_reviewer"
|
||||
# gem 'rack-mini-profiler', '~> 0.9.3'
|
||||
if RUBY_PLATFORM =~ /w32/
|
||||
gem 'win32console'
|
||||
end
|
||||
end
|
||||
|
||||
group :development, :test do
|
||||
unless RUBY_PLATFORM =~ /w32/
|
||||
gem 'pry-rails'
|
||||
if RUBY_VERSION >= '2.0.0'
|
||||
gem 'pry-byebug'
|
||||
end
|
||||
gem 'pry-stack_explorer'
|
||||
if RUBY_PLATFORM =~ /darwin/
|
||||
gem 'puma'
|
||||
end
|
||||
end
|
||||
|
||||
gem 'rspec-rails', '~> 3.0'
|
||||
gem 'factory_girl_rails'
|
||||
end
|
||||
|
||||
# Gems used only for assets and not required
|
||||
# in production environments by default.
|
||||
group :assets do
|
||||
gem 'sass-rails', '~> 3.2.3'
|
||||
gem 'coffee-rails', '~> 3.2.1'
|
||||
|
||||
# See https://github.com/sstephenson/execjs#readme for more supported runtimes
|
||||
# gem 'therubyracer', :platforms => :ruby
|
||||
|
||||
gem 'uglifier', '>= 1.0.3'
|
||||
end
|
||||
|
||||
# Optional gem for LDAP authentication
|
||||
group :ldap do
|
||||
gem "net-ldap", "~> 0.3.1"
|
||||
end
|
||||
|
||||
|
||||
# Optional gem for OpenID authentication
|
||||
group :openid do
|
||||
gem "ruby-openid", "~> 2.1.4", :require => "openid"
|
||||
gem "rack-openid"
|
||||
end
|
||||
|
||||
|
||||
database_file = File.join(File.dirname(__FILE__), "config/database.yml")
|
||||
if File.exist?(database_file)
|
||||
else
|
||||
warn("Please configure your config/database.yml first")
|
||||
end
|
||||
|
||||
# Load plugins' Gemfiles
|
||||
Dir.glob File.expand_path("../plugins/*/Gemfile", __FILE__) do |file|
|
||||
puts "Loading #{file} ..." if $DEBUG # `ruby -d` or `bundle -v`
|
||||
instance_eval File.read(file)
|
||||
end
|
@ -0,0 +1,103 @@
|
||||
#coding=utf-8
|
||||
|
||||
module Mobile
|
||||
module Apis
|
||||
class Syllabuses < Grape::API
|
||||
|
||||
resources :syllabuses do
|
||||
desc "获取大纲列表"
|
||||
params do
|
||||
requires :token, type: String
|
||||
end
|
||||
get do
|
||||
authenticate!
|
||||
|
||||
cs = SyllabusesService.new
|
||||
courses = cs.user_syllabus(current_user)
|
||||
present :data, courses, with: Mobile::Entities::Syllabus
|
||||
present :status, 0
|
||||
end
|
||||
|
||||
desc "获取某个大纲"
|
||||
params do
|
||||
requires :token, type: String
|
||||
end
|
||||
get ':id' do
|
||||
authenticate!
|
||||
|
||||
ss = SyllabusesService.new
|
||||
|
||||
sy = ::Syllabus.find(params[:id])
|
||||
sy.courses = sy.courses.not_deleted
|
||||
sy = ss.judge_can_setting(sy,current_user)
|
||||
|
||||
present :data, sy, with: Mobile::Entities::Syllabus
|
||||
present :status, 0
|
||||
end
|
||||
|
||||
desc "获取新建大纲的权限"
|
||||
params do
|
||||
requires :token, type: String
|
||||
end
|
||||
post 'auth' do
|
||||
authenticate!
|
||||
|
||||
auth = 0
|
||||
|
||||
if (current_user.user_extensions && current_user.user_extensions.identity == 0 && current_user.allowed_to?(:add_course, nil, :global => true))
|
||||
auth = 1
|
||||
end
|
||||
|
||||
present :auth, auth
|
||||
end
|
||||
|
||||
desc "新建大纲"
|
||||
params do
|
||||
requires :token, type: String
|
||||
requires :title, type: String, desc: '大纲标题'
|
||||
requires :courses, type: Array[String], desc: '课程名'
|
||||
end
|
||||
post do
|
||||
authenticate!
|
||||
|
||||
ss = SyllabusesService.new
|
||||
|
||||
sy = ss.create(current_user, params[:title],
|
||||
params[:courses].map{|c| {name: c} })
|
||||
|
||||
if sy.new_record?
|
||||
{status:-1, message: '创建大纲失败' }
|
||||
else
|
||||
present :data, sy, with: Mobile::Entities::Syllabus
|
||||
present :status, 0
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
desc '编辑大纲'
|
||||
params do
|
||||
requires :token, type: String
|
||||
requires :title, type: String, desc: '大纲标题'
|
||||
# requires :add_courses, type: Array[String], desc: '课程名'
|
||||
# requires :modify_courses, type: Array[Integer,String], desc: '课程名'
|
||||
end
|
||||
post ':id/edit' do
|
||||
|
||||
authenticate!
|
||||
|
||||
ss = SyllabusesService.new
|
||||
|
||||
#修改课程大纲
|
||||
status = ss.edit(current_user, params)
|
||||
|
||||
if status == -1
|
||||
{status:status, message: '修改课程信息失败' }
|
||||
else
|
||||
present :status, status
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
end
|
||||
end
|
||||
end
|
@ -0,0 +1,13 @@
|
||||
module Mobile
|
||||
module Entities
|
||||
class Syllabus < Grape::Entity
|
||||
include ApplicationHelper
|
||||
|
||||
expose :title
|
||||
expose :id
|
||||
expose :can_setting
|
||||
|
||||
expose :courses, using: Mobile::Entities::Course
|
||||
end
|
||||
end
|
||||
end
|
@ -1,3 +1,4 @@
|
||||
class ApplyAddSchools < ActiveRecord::Base
|
||||
attr_accessible :address, :city, :name, :province, :remarks, :school_id, :status
|
||||
belongs_to :school
|
||||
end
|
||||
|
@ -0,0 +1,3 @@
|
||||
class SonarError < ActiveRecord::Base
|
||||
attr_accessible :jenkins_job_name, :output, :project_id
|
||||
end
|
@ -0,0 +1,4 @@
|
||||
#coding=utf-8
|
||||
#
|
||||
class WechatLog < ActiveRecord::Base
|
||||
end
|
@ -0,0 +1,53 @@
|
||||
#coding=utf-8
|
||||
|
||||
class ResourcesService
|
||||
|
||||
#发送资源到课程
|
||||
def send_resource_to_course user,params
|
||||
send_id = params[:send_id]
|
||||
@ori = Attachment.find_by_id(send_id)
|
||||
course_ids = params[:course_ids]
|
||||
@flag = false
|
||||
unless course_ids.nil?
|
||||
course_ids.each do |id|
|
||||
next if @ori.blank?
|
||||
@exist = false
|
||||
Course.find(id).attachments.each do |att| #如果课程中包含该资源
|
||||
if att.id == @ori.id || (!att.copy_from.nil? && !@ori.copy_from.nil? && att.copy_from == @ori.copy_from) || att.copy_from == @ori.id || att.id == @ori.copy_from
|
||||
att.created_on = Time.now
|
||||
att.save
|
||||
@exist = true
|
||||
@flag = true
|
||||
break
|
||||
end
|
||||
end
|
||||
next if @exist
|
||||
attach_copied_obj = @ori.copy
|
||||
attach_copied_obj.tag_list.add(@ori.tag_list) # tag关联
|
||||
attach_copied_obj.container = Course.find(id)
|
||||
attach_copied_obj.created_on = Time.now
|
||||
attach_copied_obj.author_id = user.id
|
||||
attach_copied_obj.is_public = 0
|
||||
attach_copied_obj.copy_from = @ori.copy_from.nil? ? @ori.id : @ori.copy_from #发送要添加copy_from
|
||||
if attach_copied_obj.attachtype == nil
|
||||
attach_copied_obj.attachtype = 4
|
||||
end
|
||||
if attach_copied_obj.save
|
||||
# 更新引用次数
|
||||
quotes = @ori.quotes.to_i + 1
|
||||
@ori.update_attribute(:quotes, quotes) unless @ori.nil?
|
||||
@ori.forwards << Forward.new(:to_type => attach_copied_obj.class.name, :to_id => attach_copied_obj.id,:created_at => Time.now)
|
||||
@flag = true
|
||||
else
|
||||
@flag = false
|
||||
@save_message = attach_copied_obj.errors.full_messages
|
||||
break
|
||||
end
|
||||
|
||||
end
|
||||
end
|
||||
|
||||
[@ori, @flag, @save_message]
|
||||
end
|
||||
|
||||
end
|
@ -0,0 +1,143 @@
|
||||
#coding=utf-8
|
||||
|
||||
class SyllabusesService
|
||||
|
||||
include ApplicationHelper
|
||||
include CoursesHelper
|
||||
|
||||
def judge_can_setting(sy,user)
|
||||
sy[:can_setting] = sy[:user_id] == user.id ? true : false
|
||||
|
||||
sy[:can_setting] = false if sy[:id].nil?
|
||||
|
||||
sy.courses.each do |c|
|
||||
c[:can_setting] = false
|
||||
|
||||
member = c.members.where("user_id=#{user.id} and course_id=#{c.id}")[0]
|
||||
roleName = member.roles[0].name if member
|
||||
|
||||
if roleName && (roleName == "TeachingAsistant" || roleName == "Teacher" )
|
||||
c[:can_setting] = true
|
||||
end
|
||||
|
||||
if c.tea_id == user.id
|
||||
c[:can_setting] = true
|
||||
end
|
||||
end
|
||||
|
||||
sy
|
||||
end
|
||||
#获取指定用户的课程大纲
|
||||
def user_syllabus(user)
|
||||
courses = CoursesService.new.user_courses_list(user)
|
||||
|
||||
other = Syllabus.new(title: '未命名课程',user_id: user.id)
|
||||
|
||||
courses.each do |c|
|
||||
other.courses << c[:course] unless c[:course].syllabus
|
||||
end
|
||||
|
||||
# user.syllabuses.each do |syllabus|
|
||||
# syllabus.courses = syllabus.courses.not_deleted
|
||||
# end
|
||||
#
|
||||
# user.syllabuses.to_a << other
|
||||
|
||||
courses = user.courses.not_deleted
|
||||
syllabus_ids = courses.empty? ? '(-1)' : "(" + courses.map{|course| !course.syllabus_id.nil? && course.syllabus_id}.join(",") + ")"
|
||||
syllabuses = Syllabus.where("id in #{syllabus_ids} or user_id = #{user.id}").order("updated_at desc")
|
||||
|
||||
syllabuses.each do |syllabus|
|
||||
syllabus.courses = courses.where("syllabus_id = #{syllabus.id}").select("courses.*,(SELECT MAX(updated_at) FROM `course_activities` WHERE course_activities.course_id = courses.id) AS updatetime").order("time desc")
|
||||
end
|
||||
|
||||
syllabuses.to_a << other
|
||||
|
||||
#管理权限 can_setting
|
||||
syllabuses.each do |s|
|
||||
s = judge_can_setting(s,user)
|
||||
end
|
||||
|
||||
syllabuses
|
||||
end
|
||||
|
||||
def after_create_course(course, user)
|
||||
#unless User.current.admin?
|
||||
r = Role.givable.find_by_id(Setting.new_project_user_role_id.to_i) || Role.givable.first
|
||||
m = Member.new(:user => user, :roles => [r])
|
||||
m.project_id = -1
|
||||
course_info = CourseInfos.new(:user_id => user.id, :course_id => course.id)
|
||||
#user_grades = UserGrade.create(:user_id => User.current.id, :course_id => @course.id)
|
||||
course.members << m
|
||||
course.course_infos << course_info
|
||||
end
|
||||
|
||||
#创建大纲
|
||||
# params {title: '大纲名称', [{course}, {course}]}
|
||||
def create(user, title, courses = [])
|
||||
sy = Syllabus.new(title: title, user_id: user.id)
|
||||
ActiveRecord::Base.transaction() do
|
||||
sy.save!
|
||||
|
||||
courses.each do |course|
|
||||
if ::Course === course
|
||||
course.syllabus_id = sy.id
|
||||
course.save!
|
||||
elsif Hash === course
|
||||
c = ::Course.new(course)
|
||||
c.tea_id = user.id
|
||||
c.syllabus_id = sy.id
|
||||
c.update_default_value
|
||||
c.is_public = 0
|
||||
c.save!
|
||||
after_create_course(c, user)
|
||||
end
|
||||
end
|
||||
|
||||
end
|
||||
sy[:can_setting] = true
|
||||
sy
|
||||
end
|
||||
|
||||
#修改课程大纲的名称、班级名称、新增班级
|
||||
def edit(user, option)
|
||||
courses = []
|
||||
status = -1
|
||||
syllabus_id = option[:id]
|
||||
|
||||
sy = Syllabus.where("id=?",option[:id]).first
|
||||
|
||||
if sy && sy.user_id == user.id
|
||||
syllabus_title = option[:title]
|
||||
|
||||
sy.title = syllabus_title
|
||||
sy.save!
|
||||
#修改班级名称
|
||||
modify_courses = option[:modify_courses]
|
||||
modify_courses.each do |c|
|
||||
course = Course.where("id=?",c.id).first
|
||||
|
||||
if course && course.tea_id == user.id
|
||||
course.name = c.name
|
||||
!course.save
|
||||
end
|
||||
end
|
||||
|
||||
#新增班级
|
||||
add_courses = option[:add_courses]
|
||||
add_courses.each do |c|
|
||||
course = Course.new()
|
||||
course.name = c
|
||||
course.tea_id = user.id
|
||||
course.syllabus_id = sy.id
|
||||
course.update_default_value
|
||||
course.is_public = 0
|
||||
course.save!
|
||||
after_create_course(course, user)
|
||||
end
|
||||
status = 0
|
||||
end
|
||||
status
|
||||
end
|
||||
|
||||
end
|
@ -0,0 +1,30 @@
|
||||
<td style="text-align: center;">
|
||||
<%= course.id %>
|
||||
</td>
|
||||
<td style="white-space: nowrap;overflow: hidden;text-overflow: ellipsis;" class="name" title='<%=course.name%>'>
|
||||
<span>
|
||||
<%= link_to(course.name, course_path(course.id)) %>
|
||||
</span>
|
||||
</td>
|
||||
<td align="center">
|
||||
<%= link_to(course.try(:teacher).try(:realname).truncate(6, omission: '...'), user_path(course.teacher)) %>
|
||||
</td>
|
||||
<td align="center">
|
||||
<%= course.class_period %>
|
||||
</td>
|
||||
<td class="center">
|
||||
<%= checked_image course.is_public? %>
|
||||
</td>
|
||||
<td class="center">
|
||||
<%= format_date(course.created_at) %>
|
||||
</td>
|
||||
<td class="center">
|
||||
<%= course.updated_at.strftime('%Y-%m-%d %H:%M:%S') %>
|
||||
</td>
|
||||
<td class="center">
|
||||
<%= select_tag :syllabus_id,options_for_select(course_syllabus_option(course.teacher),course.syllabus_id), {:id=>"new_syllabus_id_#{course.id}", :class=>"course_syllabus_input", :onchange=>"select_syllabus(#{course.id});"}%>
|
||||
</td>
|
||||
<td class="center">
|
||||
<a href="javascript:void(0)" onclick="alert_new_syllabus(<%=course.id %>, 0)">新建课程</a>
|
||||
<%#= link_to "新建课程", admin_create_syllabus_path%>
|
||||
</td>
|
@ -0,0 +1,3 @@
|
||||
<span>
|
||||
<a title="<%= course.name %>" id="rename_course_name_<%= course.id %>" ondblclick="rename_course_name($(this),'<%=course.name %>','<%=course.id %>');"><%= course.name %></a>
|
||||
</span>
|
@ -0,0 +1,7 @@
|
||||
<div class="tabs">
|
||||
<ul>
|
||||
<li><%= link_to '课程列表', {:action => 'syllabuses'}, class: "#{current_page?(all_syllabuses_path)? 'selected' : nil }" %></li>
|
||||
<li><%= link_to '全部班级列表', {:action => 'courses'}, class: "#{current_page?(all_courses_path)? 'selected' : nil }" %></li>
|
||||
<li><%= link_to '未配置班级列表', {:action => 'non_syllabus_courses'}, class: "#{current_page?(non_syllabus_courses_path)? 'selected' : nil }" %></li>
|
||||
</ul>
|
||||
</div>
|
@ -0,0 +1,10 @@
|
||||
hideModal();
|
||||
<%courses = Course.where("tea_id = #{@user.id}") %>
|
||||
<% unless courses.empty? %>
|
||||
<% courses.each do |course|%>
|
||||
$("#course_<%=course.id %>").html("<%=escape_javascript(render :partial => 'courselist_detail_tr', :locals => {:course => course}) %>");
|
||||
<% end %>
|
||||
<% end %>
|
||||
<% if @flag == 1 %>
|
||||
$("#course_<%=@course.id %>").html("");
|
||||
<% end %>
|
@ -0,0 +1,164 @@
|
||||
<div class="contextual">
|
||||
<%= link_to l(:label_course_new), {:controller => 'courses', :action => 'new'}, :class => 'icon icon-add' %>
|
||||
</div>
|
||||
|
||||
<h3>
|
||||
未配置班级列表
|
||||
</h3>
|
||||
<%= render 'tab_syllabuses_courses' %>
|
||||
|
||||
<h3>
|
||||
未配置班级列表
|
||||
</h3>
|
||||
|
||||
<%= form_tag({}, :method => :get) do %>
|
||||
<fieldset>
|
||||
<label for='name'>
|
||||
班级:
|
||||
</label>
|
||||
<%= text_field_tag 'name', params[:name], :size => 30, :placeholder => '班级、老师名称' %>
|
||||
<%= submit_tag l(:button_apply), :class => "small", :name => nil %>
|
||||
<%= link_to l(:button_clear), {:controller => 'admin', :action => 'non_syllabus_courses'}, :class => 'icon icon-reload' %>
|
||||
</fieldset>
|
||||
<% end %>
|
||||
|
||||
|
||||
<div class="autoscroll">
|
||||
<table class="list" style="width: 100%;table-layout: fixed">
|
||||
<thead>
|
||||
<tr>
|
||||
<th style="width: 30px;">
|
||||
序号
|
||||
</th>
|
||||
<th style="width: 85px;">
|
||||
班级
|
||||
</th>
|
||||
<th style="width: 35px;">
|
||||
主讲老师
|
||||
</th>
|
||||
<th style="width: 20px;">
|
||||
学时
|
||||
</th>
|
||||
<th style="width: 15px;">
|
||||
<%=l(:field_is_public)%>
|
||||
</th>
|
||||
<th style="width: 45px;">
|
||||
<%=l(:field_created_on)%>
|
||||
</th>
|
||||
<th style="width: 45px;">
|
||||
动态时间
|
||||
</th>
|
||||
<th style="width:75px">
|
||||
课程
|
||||
</th>
|
||||
<th style="width:35px">
|
||||
|
||||
</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<% @courses.each do |course| %>
|
||||
<tr class="<%= cycle("odd", "even") %>" id="course_<%=course.id %>">
|
||||
<td style="text-align: center;">
|
||||
<%= course.id %>
|
||||
</td>
|
||||
<td style="white-space: nowrap;overflow: hidden;text-overflow: ellipsis;" class="name" title='<%=course.name%>'>
|
||||
<span>
|
||||
<a title="<%=course.name %>" id="rename_course_name_<%=course.id %>" ondblclick="rename_course_name($(this),'<%=course.name %>','<%=course.id %>');"><%= course.name%></a>
|
||||
</span>
|
||||
</td>
|
||||
<td align="center">
|
||||
<%= link_to(course.try(:teacher).try(:realname).truncate(6, omission: '...'), user_path(course.teacher)) %>
|
||||
</td>
|
||||
<td align="center">
|
||||
<%= course.class_period %>
|
||||
</td>
|
||||
<td class="center">
|
||||
<%= checked_image course.is_public? %>
|
||||
</td>
|
||||
<td class="center">
|
||||
<%= format_date(course.created_at) %>
|
||||
</td>
|
||||
<td class="center">
|
||||
<%= course.updated_at.strftime('%Y-%m-%d %H:%M:%S') %>
|
||||
</td>
|
||||
<td class="center">
|
||||
<%= select_tag :syllabus_id,options_for_select(course_syllabus_option(course.teacher),course.syllabus_id), {:id=>"new_syllabus_id_#{course.id}", :class=>"course_syllabus_input", :onchange=>"select_syllabus(#{course.id});"}%>
|
||||
</td>
|
||||
<td class="center">
|
||||
<a href="javascript:void(0)" onclick="alert_new_syllabus(<%=course.id %>, 1)">新建课程</a>
|
||||
</td>
|
||||
</tr>
|
||||
<% end %>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
<div class="pagination">
|
||||
<%= pagination_links_full @obj_pages, @obj_count, :per_page_links => false %>
|
||||
</div>
|
||||
|
||||
<script type="text/javascript">
|
||||
var tagNameHtml; //当前双击的链接的父节点的html
|
||||
var parentCssBorder; //当前双击的链接的父节点
|
||||
var ele; //当前双击的链接
|
||||
var tagId; //班级的id
|
||||
var tagName; //班级名称
|
||||
|
||||
function rename_course_name(domEle,name,id){
|
||||
isdb = true; //这是双击
|
||||
//clearTimeout(clickFunction);
|
||||
if (domEle.children().get(0) != undefined) { //已经是编辑框的情况下不要动
|
||||
return;
|
||||
}
|
||||
tagNameHtml = domEle.parent().html();
|
||||
parentCssBorder = domEle.parent().css("border");
|
||||
ele = domEle;
|
||||
tagId = id;
|
||||
tagName = name;
|
||||
domEle.html('<input name="" id="renameCourseName" maxlength="120" minlength="1" style="width:125px;" value="' + name + '"/>');
|
||||
domEle.parent().css("border", "1px solid #ffffff");
|
||||
$("#renameCourseName").focus();
|
||||
}
|
||||
|
||||
$(function(){
|
||||
$("#renameCourseName").live("blur",function(){
|
||||
updateCourseName();
|
||||
}).live("keypress",function(e){
|
||||
if (e.keyCode == '13') {
|
||||
updateCourseName();
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
//执行修改courseName方法
|
||||
function updateCourseName(){
|
||||
if(isdb){
|
||||
isdb = false;
|
||||
if($("#renameCourseName").val() == tagName){ //如果值一样,则恢复原来的状态
|
||||
ele.parent().css("border","");
|
||||
ele.parent().html(tagNameHtml);
|
||||
}
|
||||
else{
|
||||
$.post(
|
||||
'<%= admin_update_course_name_path %>',
|
||||
{"course_id": tagId, "name": $("#renameCourseName").val().trim()}
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
function select_syllabus(id){
|
||||
val = $("#new_syllabus_id_"+id).children('option:selected').val();
|
||||
if(val != "0") {
|
||||
$.ajax({
|
||||
type: "post",
|
||||
url: "/admin/select_course_syllabus",
|
||||
data: {syllabus_id: val,
|
||||
course_id: id},
|
||||
success: function (data) {
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
</script>
|
||||
<% html_title(l(:label_course_all)) -%>
|
@ -0,0 +1,140 @@
|
||||
<h3>
|
||||
课程列表
|
||||
</h3>
|
||||
<%= render 'tab_syllabuses_courses' %>
|
||||
|
||||
<h3>
|
||||
课程列表
|
||||
</h3>
|
||||
|
||||
<%= form_tag({}, :method => :get) do %>
|
||||
<fieldset>
|
||||
<label for='name'>
|
||||
课程:
|
||||
</label>
|
||||
<%= text_field_tag 'name', params[:name], :size => 30, :placeholder => '课程名称' %>
|
||||
<%= submit_tag l(:button_apply), :class => "small", :name => nil %>
|
||||
<%= link_to l(:button_clear), {:controller => 'admin', :action => 'syllabuses'}, :class => 'icon icon-reload' %>
|
||||
</fieldset>
|
||||
<% end %>
|
||||
|
||||
|
||||
<div class="autoscroll">
|
||||
<table class="list" style="width: 100%;table-layout: fixed">
|
||||
<thead>
|
||||
<tr>
|
||||
<th style="width: 30px;">
|
||||
序号
|
||||
</th>
|
||||
<th style="width: 85px;">
|
||||
课程名称
|
||||
</th>
|
||||
<th style="width: 85px;">
|
||||
班级名称
|
||||
</th>
|
||||
<th style="width: 35px;">
|
||||
创建老师
|
||||
</th>
|
||||
<th style="width: 60px;">
|
||||
<%=l(:field_created_on)%>
|
||||
</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<% @syllabuses.each do |syllabus| %>
|
||||
<tr class="odd">
|
||||
<td style="text-align: center;">
|
||||
<%= syllabus.id %>
|
||||
</td>
|
||||
<td style="white-space: nowrap;overflow: hidden;text-overflow: ellipsis;" class="name" title='<%=syllabus.title%>'>
|
||||
<span>
|
||||
<%= link_to(syllabus.title, syllabus_path(syllabus.id)) %>
|
||||
</span>
|
||||
</td>
|
||||
<td class="center">
|
||||
</td>
|
||||
<td align="center">
|
||||
<%= link_to(syllabus.try(:user).try(:realname).truncate(6, omission: '...'), user_path(syllabus.user)) %>
|
||||
</td>
|
||||
<td class="center">
|
||||
<%= format_date(syllabus.created_at) %>
|
||||
</td>
|
||||
</tr>
|
||||
<% courses = syllabus.courses %>
|
||||
<% courses.each do |course| %>
|
||||
<tr class="even">
|
||||
<td style="text-align: center;">
|
||||
<%= course.id %>
|
||||
</td>
|
||||
<td class="center">
|
||||
</td>
|
||||
<td style="white-space: nowrap;overflow: hidden;text-overflow: ellipsis;" class="name" title='<%=course.name%>' id="syllabus_course_name_<%=course.id %>">
|
||||
<%= render :partial => 'admin/rename_course_name', :locals => {:course => course} %>
|
||||
</td>
|
||||
<td align="center">
|
||||
<%= link_to(course.try(:teacher).try(:realname).truncate(6, omission: '...'), user_path(course.teacher)) %>
|
||||
</td>
|
||||
<td class="center">
|
||||
<%= format_date(course.created_at) %>
|
||||
</td>
|
||||
</tr>
|
||||
<% end %>
|
||||
<% end %>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
<div class="pagination">
|
||||
<%= pagination_links_full @obj_pages, @obj_count, :per_page_links => false %>
|
||||
</div>
|
||||
|
||||
<script type="text/javascript">
|
||||
var tagNameHtml; //当前双击的链接的父节点的html
|
||||
var parentCssBorder; //当前双击的链接的父节点
|
||||
var ele; //当前双击的链接
|
||||
var tagId; //班级的id
|
||||
var tagName; //班级名称
|
||||
|
||||
function rename_course_name(domEle,name,id){
|
||||
isdb = true; //这是双击
|
||||
//clearTimeout(clickFunction);
|
||||
if (domEle.children().get(0) != undefined) { //已经是编辑框的情况下不要动
|
||||
return;
|
||||
}
|
||||
tagNameHtml = domEle.parent().html();
|
||||
parentCssBorder = domEle.parent().css("border");
|
||||
ele = domEle;
|
||||
tagId = id;
|
||||
tagName = name;
|
||||
domEle.html('<input name="" id="renameCourseName" maxlength="120" minlength="1" style="width:125px;" value="' + name + '"/>');
|
||||
domEle.parent().css("border", "1px solid #ffffff");
|
||||
$("#renameCourseName").focus();
|
||||
}
|
||||
|
||||
$(function(){
|
||||
$("#renameCourseName").live("blur",function(){
|
||||
updateCourseName();
|
||||
}).live("keypress",function(e){
|
||||
if (e.keyCode == '13') {
|
||||
updateCourseName();
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
//执行修改TAGName方法
|
||||
function updateCourseName(){
|
||||
if(isdb){
|
||||
isdb = false;
|
||||
if($("#renameCourseName").val() == tagName){ //如果值一样,则恢复原来的状态
|
||||
ele.parent().css("border","");
|
||||
ele.parent().html(tagNameHtml);
|
||||
}
|
||||
else{
|
||||
$.post(
|
||||
'<%= admin_update_course_name_path %>',
|
||||
{"course_id": tagId, "name": $("#renameCourseName").val().trim()}
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
@ -0,0 +1 @@
|
||||
$("#syllabus_course_name_<%=@course.id %>").html("<%=escape_javascript(render :partial => 'admin/rename_course_name', :locals => {:course => @course}) %>");
|
@ -0,0 +1,5 @@
|
||||
<span style="word-break: normal; word-wrap: break-word;"><%=@syllabus.title %></span>
|
||||
|
||||
<% if User.current == syllabus.user %>
|
||||
<%= link_to image_tag("../images/signature_edit.png",width:"12px", height: "12px"), "javascript:void(0);",:id => "syllabus_edit_title_png", :class => "none", :onclick => "show_edit_title();"%>
|
||||
<% end %>
|
@ -1,9 +1,11 @@
|
||||
<% if @current_build_status == "success" %>
|
||||
<%= render :partial => "show", :locals => {:branch => params[:branch]} %>
|
||||
<% else %>
|
||||
<% if @build_console_result %>
|
||||
运行结果超时
|
||||
<% else %>
|
||||
<%= render :partial => "console_output" %>
|
||||
<% end %>
|
||||
<% end %>
|
||||
<div class="project_r_h">
|
||||
<h2 class="project_h2" style="width:180px;">质量分析</h2>
|
||||
</div>
|
||||
<div>
|
||||
<div class="c_red">本次分析失败,原因如下:</div>
|
||||
<% if @build_console_result == false %>
|
||||
分析超时
|
||||
<% else %>
|
||||
<%= h @sonar_error.to_json %>
|
||||
<% end %>
|
||||
</div>
|
@ -0,0 +1,11 @@
|
||||
<div class="project_r_h">
|
||||
<h2 class="project_h2" style="width:180px;">质量分析</h2>
|
||||
</div>
|
||||
<div>
|
||||
<div class="c_red">本次分析失败,原因如下:</div>
|
||||
<% if @build_console_result == false %>
|
||||
分析超时
|
||||
<% else %>
|
||||
<%= h @error_list.output %>
|
||||
<% end %>
|
||||
</div>
|
@ -0,0 +1,48 @@
|
||||
<tr class="b_grey hworkH30">
|
||||
<th class="hworkList40 hworkH30 pl5 pr5">序号</th>
|
||||
<th class="hworkList50"> </th>
|
||||
<th class="<%= @homework.anonymous_comment == 1 ? 'hworkList130' : 'hworkList100' %> pl5 pr5 hide-text">
|
||||
<%= link_to "姓名", @show_all ? student_work_index_path(:homework => @homework.id, :order => "lastname", :sort => @score, :name => @name, :group => @group) : "javascript:void(0)", :class => "c_dark f14 fb", :remote => true %>
|
||||
<% if @show_all && @order == "lastname" %>
|
||||
<%= link_to "", student_work_index_path(:homework => @homework.id, :order => "lastname", :sort => @score, :name => @name, :group => @group), :class => "#{@score == 'desc' ? 'sort_up' : 'sort_down'} float-none", :style => "line-height:30px; vertical-align:middle;", :remote => true %>
|
||||
<% end %>
|
||||
</th>
|
||||
<th class="<%= @homework.anonymous_comment == 1 ? 'hworkList130' : 'hworkList90' %> pl5 pr5 hide-text">
|
||||
<%= link_to "学号", @show_all ? student_work_index_path(:homework => @homework.id, :order => "student_id", :sort => @score, :name => @name, :group => @group) : "javascript:void(0)", :class => "c_dark f14 fb", :remote => true %>
|
||||
<% if @show_all && @order == "student_id" %>
|
||||
<%= link_to "", student_work_index_path(:homework => @homework.id, :order => "student_id", :sort => @score, :name => @name, :group => @group), :class => "#{@score == 'desc' ? 'sort_up' : 'sort_down'} float-none", :style => "line-height:30px; vertical-align:middle;", :remote => true %>
|
||||
<% end %>
|
||||
</th>
|
||||
<th class="hworkList130">
|
||||
<%= link_to "时间", @show_all ? student_work_index_path(:homework => @homework.id, :order => "created_at", :sort => @score, :name => @name, :group => @group) : "javascript:void(0)", :class => "c_dark f14 fb", :remote => true %>
|
||||
<% if @show_all && @order == "created_at" %>
|
||||
<%= link_to "", student_work_index_path(:homework => @homework.id, :order => "created_at", :sort => @score, :name => @name, :group => @group), :class => "#{@score == 'desc' ? 'sort_up' : 'sort_down'} float-none", :style => "line-height:30px; vertical-align:middle;", :remote => true %>
|
||||
<% end %>
|
||||
</th>
|
||||
<th class="hworkList70">
|
||||
<%= link_to "教师", @show_all ? student_work_index_path(:homework => @homework.id, :order => "teacher_score", :sort => @score, :name => @name, :group => @group) : "javascript:void(0)", :class => "c_dark f14 fb", :remote => true %>
|
||||
<% if @show_all && @order == "teacher_score" %>
|
||||
<%= link_to "", student_work_index_path(:homework => @homework.id, :order => "teacher_score", :sort => @score, :name => @name, :group => @group), :class => "#{@score == 'desc' ? 'sort_up' : 'sort_down'} float-none", :style => "line-height:30px; vertical-align:middle;", :remote => true %>
|
||||
<% end %>
|
||||
</th>
|
||||
<th class="hworkList70">
|
||||
<%= link_to "教辅", @show_all ? student_work_index_path(:homework => @homework.id, :order => "teaching_asistant_score", :sort => @score, :name => @name, :group => @group) : "javascript:void(0)", :class => "c_dark f14 fb", :remote => true %>
|
||||
<% if @show_all && @order == "teaching_asistant_score" %>
|
||||
<%= link_to "", student_work_index_path(:homework => @homework.id, :order => "teaching_asistant_score", :sort => @score, :name => @name, :group => @group), :class => "#{@score == 'desc' ? 'sort_up' : 'sort_down'} float-none", :style => "line-height:30px; vertical-align:middle;", :remote => true %>
|
||||
<% end %>
|
||||
</th>
|
||||
<% if @homework.anonymous_comment == 0 %>
|
||||
<th class="hworkList70">
|
||||
<%= link_to "匿评", @show_all ? student_work_index_path(:homework => @homework.id, :order => "student_score", :sort => @score, :name => @name, :group => @group) : "javascript:void(0)", :class => "c_dark f14 fb", :remote => true %>
|
||||
<% if @show_all && @order == "student_score" %>
|
||||
<%= link_to "", student_work_index_path(:homework => @homework.id, :order => "student_score", :sort => @score, :name => @name, :group => @group), :class => "#{@score == 'desc' ? 'sort_up' : 'sort_down'} float-none", :style => "line-height:30px; vertical-align:middle;", :remote => true %>
|
||||
<% end %>
|
||||
</th>
|
||||
<% end %>
|
||||
<th class="hworkList70">
|
||||
<%= link_to "成绩", @show_all ? student_work_index_path(:homework => @homework.id, :order => "score", :sort => @score, :name => @name, :group => @group) : "javascript:void(0)", :class => "c_dark f14 fb", :remote => true %>
|
||||
<% if @show_all && @order == "score" %>
|
||||
<%= link_to "", student_work_index_path(:homework => @homework.id, :order => "score", :sort => @score, :name => @name, :group => @group), :class => "#{@score == 'desc' ? 'sort_up' : 'sort_down'} float-none", :style => "line-height:30px; vertical-align:middle;", :remote => true %>
|
||||
<% end %>
|
||||
</th>
|
||||
</tr>
|
@ -0,0 +1,79 @@
|
||||
<tr class="hworkListRow" id="student_work_<%= student_work.id %>">
|
||||
<td class="none"><a name="<%= student_work.id %>"></a></td>
|
||||
<td class="hworkList40 pl5 pr5" id="work_num_<%= student_work.id %>"><%= index + 1 %></td>
|
||||
<td class="hworkPortrait pr10 float-none">
|
||||
<%= link_to(image_tag(url_to_avatar(student_work.user), :width => "40", :height => "40", :style => "display:block;"), user_activities_path(student_work.user)) %>
|
||||
</td>
|
||||
<td class="<%= @homework.anonymous_comment == 1 ? 'hworkStName130' : 'hworkStName100' %> pr10 float-none student_work_<%= student_work.id %>" title="<%= student_work.user.show_name %>" onclick="show_student_work('<%= student_work_path(student_work)%>');" style="cursor:pointer;">
|
||||
<%= student_work.user.show_name %>
|
||||
</td>
|
||||
<td class="<%= @homework.anonymous_comment == 1 ? 'hworkStName130' : 'hworkStID90' %> pr10 float-none student_work_<%= student_work.id %>" title="<%= student_work.user.user_extensions.nil? ? "--" : student_work.user.user_extensions.student_id %>" onclick="show_student_work('<%= student_work_path(student_work)%>');" style="cursor:pointer;">
|
||||
<%= student_work.user.user_extensions.nil? ? "--" : student_work.user.user_extensions.student_id %>
|
||||
</td>
|
||||
<td class="hworkList130 c_grey student_work_<%= student_work.id %>" onclick="show_student_work('<%= student_work_path(student_work)%>');" style="cursor: pointer;">
|
||||
<% if student_work.created_at && @homework.end_time %>
|
||||
<%= Time.parse(format_time(student_work.created_at)).strftime("%m-%d %H:%M") %>
|
||||
<% if Time.parse(@homework.end_time.to_s).strftime("%Y-%m-%d") < Time.parse(format_time(student_work.created_at)).strftime("%Y-%m-%d") %>
|
||||
<span class="c_red">[迟交]</span>
|
||||
<% end %>
|
||||
<% end %>
|
||||
</td>
|
||||
<td class="hworkList70 <%= score_color student_work.teacher_score %>">
|
||||
<%= student_work.teacher_score.nil? ? "--" : format("%.1f", student_work.teacher_score) %>
|
||||
</td>
|
||||
<td class="hworkList70 <%= score_color student_work.teaching_asistant_score %>">
|
||||
<%= student_work.teaching_asistant_score.nil? ? "--" : format("%.1f", student_work.teaching_asistant_score) %>
|
||||
</td>
|
||||
<% if @homework.anonymous_comment == 0 %>
|
||||
<td class="hworkList70 <%= score_color student_work.student_score %> student_score_info">
|
||||
<% if student_work.student_score.nil? %>
|
||||
<span title="该作品未被匿评">未参与</span>
|
||||
<% else %>
|
||||
<%= format("%.1f", student_work.student_score) %>
|
||||
<% end %>
|
||||
<% unless student_work.student_score.nil? %>
|
||||
<span class="linkBlue">
|
||||
(<%= student_work.student_works_scores.where(:reviewer_role => 3).group_by(&:user_id).count %>)
|
||||
</span>
|
||||
|
||||
<div class="infoNi none">
|
||||
现共有
|
||||
<span class="c_red"> <%= student_work.student_works_scores.where(:reviewer_role => 3).group_by(&:user_id).count %> </span>
|
||||
名学生进行了匿评,平均分为
|
||||
<span class="c_red"> <%= format("%.1f", student_work.student_score) %> </span>分。
|
||||
</div>
|
||||
<% end %>
|
||||
</td>
|
||||
<% end %>
|
||||
<!-- 成绩 -->
|
||||
<% if student_work.homework_common && student_work.homework_common.teacher_priority == 1 && student_work.teacher_score %>
|
||||
<% score = student_work.respond_to?("score") ? student_work.score : student_work.teacher_score %>
|
||||
<% else %>
|
||||
<% score = student_work.respond_to?("score") ? student_work.score : (student_work.final_score || 0) - student_work.absence_penalty - student_work.late_penalty %>
|
||||
<% end %>
|
||||
<td class="hworkList70 <%= score_color score %> student_final_scor_info">
|
||||
<%= score.nil? ? "--" : format("%.1f", score<0 ? 0 : score) %>
|
||||
<% unless score.nil? %>
|
||||
<div class="infoNi none width180">
|
||||
作品最终评分为
|
||||
<span class="c_red"> <%= student_work.final_score %> </span>分。
|
||||
迟交扣分
|
||||
<span class="c_red">
|
||||
<%= student_work.homework_common && student_work.homework_common.teacher_priority == 1 && student_work.teacher_score ? 0 : student_work.late_penalty %>
|
||||
</span>分,
|
||||
缺评扣分
|
||||
<span class="c_red">
|
||||
<%= student_work.homework_common && student_work.homework_common.teacher_priority == 1 && student_work.teacher_score ? 0 : student_work.absence_penalty %>
|
||||
</span>分,
|
||||
最终成绩为
|
||||
<span class="c_red"> <%= format("%.1f", score<0 ? 0 : score) %> </span>分。
|
||||
</div>
|
||||
<% end %>
|
||||
</td>
|
||||
<td>
|
||||
<div style="position:relative;">
|
||||
<div class="hworkTip" style="display: none" id="work_click_<%= student_work.id %>">
|
||||
<em></em><span></span><font class="fontGrey2">点击查看详情</font></div>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
@ -0,0 +1,44 @@
|
||||
<tr class="b_grey hworkH30">
|
||||
<th class="hworkList40 hworkH30 pl5 pr5">序号</th>
|
||||
<th class="hworkList50"> </th>
|
||||
<% if @homework.homework_detail_group.base_on_project == 1 %>
|
||||
<th class="hworkList130 pl5 pr5" style="text-align:left;">组长</th>
|
||||
<th class="<%= @homework.anonymous_comment == 1 ? 'hworkList140' : 'hworkList70' %>">
|
||||
<span class="c_dark f14 fb">关联项目</span>
|
||||
</th>
|
||||
<% elsif @homework.homework_detail_group.base_on_project == 0 %>
|
||||
<th class="<%= @homework.anonymous_comment == 1 ? 'hworkList270' : 'hworkList200' %> pl5 pr5" style="text-align:left;">组长</th>
|
||||
<% end %>
|
||||
<th class="hworkList130">
|
||||
<%= link_to "时间", @show_all ? student_work_index_path(:homework => @homework.id, :order => "created_at", :sort => @score, :name => @name, :group => @group) : "javascript:void(0)", :class => "c_dark f14 fb", :remote => true %>
|
||||
<% if @show_all && @order == "created_at" %>
|
||||
<%= link_to "", student_work_index_path(:homework => @homework.id, :order => "created_at", :sort => @score, :name => @name, :group => @group), :class => "#{@score == 'desc' ? 'sort_up' : 'sort_down'} float-none", :style => "line-height:30px; vertical-align:middle;", :remote => true %>
|
||||
<% end %>
|
||||
</th>
|
||||
<th class="hworkList70">
|
||||
<%= link_to "教师", @show_all ? student_work_index_path(:homework => @homework.id, :order => "teacher_score", :sort => @score, :name => @name, :group => @group) : "javascript:void(0)", :class => "c_dark f14 fb", :remote => true %>
|
||||
<% if @show_all && @order == "teacher_score" %>
|
||||
<%= link_to "", student_work_index_path(:homework => @homework.id, :order => "teacher_score", :sort => @score, :name => @name, :group => @group), :class => "#{@score == 'desc' ? 'sort_up' : 'sort_down'} float-none", :style => "line-height:30px; vertical-align:middle;", :remote => true %>
|
||||
<% end %>
|
||||
</th>
|
||||
<th class="hworkList70">
|
||||
<%= link_to "教辅", @show_all ? student_work_index_path(:homework => @homework.id, :order => "teaching_asistant_score", :sort => @score, :name => @name, :group => @group) : "javascript:void(0)", :class => "c_dark f14 fb", :remote => true %>
|
||||
<% if @show_all && @order == "teaching_asistant_score" %>
|
||||
<%= link_to "", student_work_index_path(:homework => @homework.id, :order => "teaching_asistant_score", :sort => @score, :name => @name, :group => @group), :class => "#{@score == 'desc' ? 'sort_up' : 'sort_down'} float-none", :style => "line-height:30px; vertical-align:middle;", :remote => true %>
|
||||
<% end %>
|
||||
</th>
|
||||
<% if @homework.anonymous_comment == 0 %>
|
||||
<th class="hworkList70">
|
||||
<%= link_to "匿评", @show_all ? student_work_index_path(:homework => @homework.id, :order => "student_score", :sort => @score, :name => @name, :group => @group) : "javascript:void(0)", :class => "c_dark f14 fb", :remote => true %>
|
||||
<% if @show_all && @order == "student_score" %>
|
||||
<%= link_to "", student_work_index_path(:homework => @homework.id, :order => "student_score", :sort => @score, :name => @name, :group => @group), :class => "#{@score == 'desc' ? 'sort_up' : 'sort_down'} float-none", :style => "line-height:30px; vertical-align:middle;", :remote => true %>
|
||||
<% end %>
|
||||
</th>
|
||||
<% end %>
|
||||
<th class="hworkList70">
|
||||
<%= link_to "成绩", @show_all ? student_work_index_path(:homework => @homework.id, :order => "score", :sort => @score, :name => @name, :group => @group) : "javascript:void(0)", :class => "c_dark f14 fb", :remote => true %>
|
||||
<% if @show_all && @order == "score" %>
|
||||
<%= link_to "", student_work_index_path(:homework => @homework.id, :order => "score", :sort => @score, :name => @name, :group => @group), :class => "#{@score == 'desc' ? 'sort_up' : 'sort_down'} float-none", :style => "line-height:30px; vertical-align:middle;", :remote => true %>
|
||||
<% end %>
|
||||
</th>
|
||||
</tr>
|
@ -0,0 +1,89 @@
|
||||
<tr class="hworkListRow" id="student_work_<%= student_work.id%>">
|
||||
<td class="none"><a name="<%= student_work.id%>"></a></td>
|
||||
<td class="hworkList40 pl5 pr5" id="work_num_<%=student_work.id %>"><%=index + 1 %></td>
|
||||
<td class="hworkPortrait pr10 float-none">
|
||||
<%= link_to(image_tag(url_to_avatar(student_work.user),:width =>"40",:height => "40",:style => "display:block;"),user_activities_path(student_work.user)) %>
|
||||
</td>
|
||||
<% if @homework.homework_detail_group.base_on_project == 1 %>
|
||||
<td class="hworkName float-none pr10 student_work_<%= student_work.id%> width130" style="cursor: pointer;" onclick="show_student_work('<%= student_work_path(student_work)%>');">
|
||||
<div>
|
||||
<%= link_to student_work.user.show_name,"javascript:void(0)" ,:title => student_work.user.show_name, :class => "linkGrey f14 StudentName break_word #{@homework.homework_type == 2 ? '' : 'width165'}"%>
|
||||
</div>
|
||||
</td>
|
||||
<% if student_work.project.is_public || User.current.member_of?(student_work.project) || User.current.admin? %>
|
||||
<td class="<%=@homework.anonymous_comment == 1 ? 'hworkPrName2' : 'hworkPrName'%> student_work_<%= student_work.id%>" title="项目名称">
|
||||
<%= link_to( student_work.project.name, project_path(student_work.project.id))%>
|
||||
</td>
|
||||
<% else %>
|
||||
<td class="<%=@homework.anonymous_comment == 1 ? 'hworkPrName2' : 'hworkPrName'%> student_work_<%= student_work.id%>" title="该项目是私有的">
|
||||
<%= student_work.project.name %>
|
||||
</td>
|
||||
<% end %>
|
||||
<% elsif @homework.homework_detail_group.base_on_project == 0 %>
|
||||
<td class="hworkName float-none pr10 student_work_<%= student_work.id%> <%=@homework.anonymous_comment == 1 ? 'width280' : 'width210' %>" style="cursor: pointer;" onclick="show_student_work('<%= student_work_path(student_work)%>');">
|
||||
<div>
|
||||
<%= link_to student_work.user.show_name,"javascript:void(0)" ,:title => student_work.user.show_name, :class => "linkGrey f14 StudentName break_word #{@homework.homework_type == 2 ? '' : 'width165'}"%>
|
||||
</div>
|
||||
</td>
|
||||
<% end %>
|
||||
<td class="hworkList130 c_grey student_work_<%= student_work.id%>" onclick="show_student_work('<%= student_work_path(student_work)%>');" style="cursor: pointer;">
|
||||
<% if student_work.created_at && @homework.end_time%>
|
||||
<%= Time.parse(format_time(student_work.created_at)).strftime("%m-%d %H:%M")%>
|
||||
<% if Time.parse(@homework.end_time.to_s).strftime("%Y-%m-%d") < Time.parse(format_time(student_work.created_at)).strftime("%Y-%m-%d") %>
|
||||
<span class="c_red">[迟交]</span>
|
||||
<% end %>
|
||||
<% end %>
|
||||
</td>
|
||||
<td class="hworkList70 <%= score_color student_work.teacher_score%>">
|
||||
<%= student_work.teacher_score.nil? ? "--" : format("%.1f",student_work.teacher_score)%>
|
||||
</td>
|
||||
<td class="hworkList70 <%= score_color student_work.teaching_asistant_score%>">
|
||||
<%= student_work.teaching_asistant_score.nil? ? "--" : format("%.1f",student_work.teaching_asistant_score)%>
|
||||
</td>
|
||||
<% if @homework.anonymous_comment == 0%>
|
||||
<td class="hworkList70 <%= score_color student_work.student_score%> student_score_info">
|
||||
<% if student_work.student_score.nil? %>
|
||||
<span title="该作品未被匿评">未参与</span>
|
||||
<% else %>
|
||||
<%=format("%.1f",student_work.student_score) %>
|
||||
<% end %>
|
||||
<% unless student_work.student_score.nil?%>
|
||||
<span class="linkBlue">
|
||||
(<%= student_work.student_works_scores.where(:reviewer_role => 3).group_by(&:user_id).count%>)
|
||||
</span>
|
||||
<div class="infoNi none">
|
||||
现共有
|
||||
<span class="c_red"> <%= student_work.student_works_scores.where(:reviewer_role => 3).group_by(&:user_id).count%> </span>
|
||||
名学生进行了匿评,平均分为
|
||||
<span class="c_red"> <%= format("%.1f",student_work.student_score)%> </span>分。
|
||||
</div>
|
||||
<% end%>
|
||||
</td>
|
||||
<% end %>
|
||||
<!-- 成绩 -->
|
||||
<% if student_work.homework_common && student_work.homework_common.teacher_priority == 1 && student_work.teacher_score %>
|
||||
<% score = student_work.respond_to?("score") ? student_work.score : student_work.teacher_score %>
|
||||
<% else %>
|
||||
<% score = student_work.respond_to?("score") ? student_work.score : (student_work.final_score || 0) - student_work.absence_penalty - student_work.late_penalty%>
|
||||
<% end %>
|
||||
<td class="hworkList70 <%= score_color score%> student_final_scor_info">
|
||||
<%= score.nil? ? "--" : format("%.1f",score<0 ? 0 : score)%>
|
||||
<% unless score.nil?%>
|
||||
<div class="infoNi none width180">
|
||||
作品最终评分为
|
||||
<span class="c_red"> <%= student_work.final_score%> </span>分。
|
||||
迟交扣分
|
||||
<span class="c_red">
|
||||
<%= student_work.homework_common && student_work.homework_common.teacher_priority == 1 && student_work.teacher_score ? 0 : student_work.late_penalty %>
|
||||
</span>分,
|
||||
缺评扣分
|
||||
<span class="c_red">
|
||||
<%= student_work.homework_common && student_work.homework_common.teacher_priority == 1 && student_work.teacher_score ? 0 : student_work.absence_penalty%>
|
||||
</span>分,
|
||||
最终成绩为
|
||||
<span class="c_red"> <%= format("%.1f",score<0 ? 0 : score)%> </span>分。
|
||||
</div>
|
||||
<% end%>
|
||||
</td>
|
||||
<td><div style="position:relative;"><div class="hworkTip" style="display: none" id="work_click_<%= student_work.id%>"><em></em><span></span><font class="fontGrey2">点击查看详情</font></div></div></td>
|
||||
</tr>
|
@ -0,0 +1,55 @@
|
||||
<tr class="b_grey hworkH30">
|
||||
<th class="hworkList40 hworkH30 pl5 pr5">序号</th>
|
||||
<th class="hworkList50"> </th>
|
||||
<th class="<%= @homework.anonymous_comment == 1 ? 'hworkList110' : 'hworkList60' %> pl5 pr5 hide-text">
|
||||
<%= link_to "姓名", @show_all ? student_work_index_path(:homework => @homework.id, :order => "lastname", :sort => @score, :name => @name, :group => @group) : "javascript:void(0)", :class => "c_dark f14 fb", :remote => true %>
|
||||
<% if @show_all && @order == "lastname" %>
|
||||
<%= link_to "", student_work_index_path(:homework => @homework.id, :order => "lastname", :sort => @score, :name => @name, :group => @group), :class => "#{@score == 'desc' ? 'sort_up' : 'sort_down'} float-none", :style => "line-height:30px; vertical-align:middle;", :remote => true %>
|
||||
<% end %>
|
||||
</th>
|
||||
<th class="<%= @homework.anonymous_comment == 1 ? 'hworkList100' : 'hworkList80' %> pl5 pr5 hide-text">
|
||||
<%= link_to "学号", @show_all ? student_work_index_path(:homework => @homework.id, :order => "student_id", :sort => @score, :name => @name, :group => @group) : "javascript:void(0)", :class => "c_dark f14 fb", :remote => true %>
|
||||
<% if @show_all && @order == "student_id" %>
|
||||
<%= link_to "", student_work_index_path(:homework => @homework.id, :order => "student_id", :sort => @score, :name => @name, :group => @group), :class => "#{@score == 'desc' ? 'sort_up' : 'sort_down'} float-none", :style => "line-height:30px; vertical-align:middle;", :remote => true %>
|
||||
<% end %>
|
||||
</th>
|
||||
|
||||
<th class="hworkList110">
|
||||
<%= link_to "时间", @show_all ? student_work_index_path(:homework => @homework.id, :order => "created_at", :sort => @score, :name => @name, :group => @group) : "javascript:void(0)", :class => "c_dark f14 fb", :remote => true %>
|
||||
<% if @show_all && @order == "created_at" %>
|
||||
<%= link_to "", student_work_index_path(:homework => @homework.id, :order => "created_at", :sort => @score, :name => @name, :group => @group), :class => "#{@score == 'desc' ? 'sort_up' : 'sort_down'} float-none", :style => "line-height:30px; vertical-align:middle;", :remote => true %>
|
||||
<% end %>
|
||||
</th>
|
||||
<th class="hworkList70">
|
||||
<%= link_to "教师", @show_all ? student_work_index_path(:homework => @homework.id, :order => "teacher_score", :sort => @score, :name => @name, :group => @group) : "javascript:void(0)", :class => "c_dark f14 fb", :remote => true %>
|
||||
<% if @show_all && @order == "teacher_score" %>
|
||||
<%= link_to "", student_work_index_path(:homework => @homework.id, :order => "teacher_score", :sort => @score, :name => @name, :group => @group), :class => "#{@score == 'desc' ? 'sort_up' : 'sort_down'} float-none", :style => "line-height:30px; vertical-align:middle;", :remote => true %>
|
||||
<% end %>
|
||||
</th>
|
||||
<th class="hworkList70">
|
||||
<%= link_to "教辅", @show_all ? student_work_index_path(:homework => @homework.id, :order => "teaching_asistant_score", :sort => @score, :name => @name, :group => @group) : "javascript:void(0)", :class => "c_dark f14 fb", :remote => true %>
|
||||
<% if @show_all && @order == "teaching_asistant_score" %>
|
||||
<%= link_to "", student_work_index_path(:homework => @homework.id, :order => "teaching_asistant_score", :sort => @score, :name => @name, :group => @group), :class => "#{@score == 'desc' ? 'sort_up' : 'sort_down'} float-none", :style => "line-height:30px; vertical-align:middle;", :remote => true %>
|
||||
<% end %>
|
||||
</th>
|
||||
<th class="hworkList70">
|
||||
<%= link_to "系统", @show_all ? student_work_index_path(:homework => @homework.id, :order => "system_score", :sort => @score, :name => @name, :group => @group) : "javascript:void(0)", :class => "c_dark f14 fb", :remote => true %>
|
||||
<% if @show_all && @order == "system_score" %>
|
||||
<%= link_to "", student_work_index_path(:homework => @homework.id, :order => "system_score", :sort => @score, :name => @name, :group => @group), :class => "#{@score == 'desc' ? 'sort_up' : 'sort_down'} float-none", :style => "line-height:30px; vertical-align:middle;", :remote => true %>
|
||||
<% end %>
|
||||
</th>
|
||||
<% if @homework.anonymous_comment == 0 %>
|
||||
<th class="hworkList70">
|
||||
<%= link_to "匿评", @show_all ? student_work_index_path(:homework => @homework.id, :order => "student_score", :sort => @score, :name => @name, :group => @group) : "javascript:void(0)", :class => "c_dark f14 fb", :remote => true %>
|
||||
<% if @show_all && @order == "student_score" %>
|
||||
<%= link_to "", student_work_index_path(:homework => @homework.id, :order => "student_score", :sort => @score, :name => @name, :group => @group), :class => "#{@score == 'desc' ? 'sort_up' : 'sort_down'} float-none", :style => "line-height:30px; vertical-align:middle;", :remote => true %>
|
||||
<% end %>
|
||||
</th>
|
||||
<% end %>
|
||||
<th class="hworkList70">
|
||||
<%= link_to "成绩", @show_all ? student_work_index_path(:homework => @homework.id, :order => "score", :sort => @score, :name => @name, :group => @group) : "javascript:void(0)", :class => "c_dark f14 fb", :remote => true %>
|
||||
<% if @show_all && @order == "score" %>
|
||||
<%= link_to "", student_work_index_path(:homework => @homework.id, :order => "score", :sort => @score, :name => @name, :group => @group), :class => "#{@score == 'desc' ? 'sort_up' : 'sort_down'} float-none", :style => "line-height:30px; vertical-align:middle;", :remote => true %>
|
||||
<% end %>
|
||||
</th>
|
||||
</tr>
|
@ -0,0 +1,83 @@
|
||||
<tr class="hworkListRow" id="student_work_<%= student_work.id %>">
|
||||
<td class="none"><a name="<%= student_work.id %>"></a></td>
|
||||
<td class="hworkList40 pl5 pr5" id="work_num_<%= student_work.id %>"><%= index + 1 %></td>
|
||||
<td class="hworkPortrait pr10 float-none">
|
||||
<%= link_to(image_tag(url_to_avatar(student_work.user), :width => "40", :height => "40", :style => "display:block;"), user_activities_path(student_work.user)) %>
|
||||
</td>
|
||||
<td class="<%= @homework.anonymous_comment == 1 ? 'hworkStName110' : 'hworkStName' %> pr10 float-none student_work_<%= student_work.id %>" title="<%= student_work.user.show_name %>" onclick="show_student_work('<%= student_work_path(student_work)%>');" style="cursor:pointer;">
|
||||
<%= student_work.user.show_name %>
|
||||
</td>
|
||||
<td class="<%= @homework.anonymous_comment == 1 ? 'hworkStID100' : 'hworkStID' %> pr10 float-none student_work_<%= student_work.id %>" title="<%= student_work.user.user_extensions.nil? ? "--" : student_work.user.user_extensions.student_id %>" onclick="show_student_work('<%= student_work_path(student_work)%>');" style="cursor:pointer;">
|
||||
<%= student_work.user.user_extensions.nil? ? "--" : student_work.user.user_extensions.student_id %>
|
||||
</td>
|
||||
<td class="hworkList110 c_grey student_work_<%= student_work.id %>" onclick="show_student_work('<%= student_work_path(student_work)%>');" style="cursor: pointer;">
|
||||
<% if student_work.created_at && @homework.end_time %>
|
||||
<%= Time.parse(format_time(student_work.created_at)).strftime("%m-%d %H:%M") %>
|
||||
<% if Time.parse(@homework.end_time.to_s).strftime("%Y-%m-%d") < Time.parse(format_time(student_work.created_at)).strftime("%Y-%m-%d") %>
|
||||
<span class="c_red">[迟交]</span>
|
||||
<% end %>
|
||||
<% end %>
|
||||
</td>
|
||||
<td class="hworkList70 <%= score_color student_work.teacher_score %>">
|
||||
<%= student_work.teacher_score.nil? ? "--" : format("%.1f", student_work.teacher_score) %>
|
||||
</td>
|
||||
<td class="hworkList70 <%= score_color student_work.teaching_asistant_score %>">
|
||||
<%= student_work.teaching_asistant_score.nil? ? "--" : format("%.1f", student_work.teaching_asistant_score) %>
|
||||
</td>
|
||||
<!-- 系统评分 -->
|
||||
<td class="hworkList70 <%= score_color student_work.system_score %>">
|
||||
<%= student_work.system_score.nil? ? "--" : format("%.1f", student_work.system_score) %>
|
||||
</td>
|
||||
<% if @homework.anonymous_comment == 0 %>
|
||||
<td class="hworkList70 <%= score_color student_work.student_score %> student_score_info">
|
||||
<% if student_work.student_score.nil? %>
|
||||
<span title="该作品未被匿评">未参与</span>
|
||||
<% else %>
|
||||
<%= format("%.1f", student_work.student_score) %>
|
||||
<% end %>
|
||||
<% unless student_work.student_score.nil? %>
|
||||
<span class="linkBlue">
|
||||
(<%= student_work.student_works_scores.where(:reviewer_role => 3).group_by(&:user_id).count %>)
|
||||
</span>
|
||||
|
||||
<div class="infoNi none">
|
||||
现共有
|
||||
<span class="c_red"> <%= student_work.student_works_scores.where(:reviewer_role => 3).group_by(&:user_id).count %> </span>
|
||||
名学生进行了匿评,平均分为
|
||||
<span class="c_red"> <%= format("%.1f", student_work.student_score) %> </span>分。
|
||||
</div>
|
||||
<% end %>
|
||||
</td>
|
||||
<% end %>
|
||||
<!-- 成绩 -->
|
||||
<% if student_work.homework_common && student_work.homework_common.teacher_priority == 1 && student_work.teacher_score %>
|
||||
<% score = student_work.respond_to?("score") ? student_work.score : student_work.teacher_score %>
|
||||
<% else %>
|
||||
<% score = student_work.respond_to?("score") ? student_work.score : (student_work.final_score || 0) - student_work.absence_penalty - student_work.late_penalty %>
|
||||
<% end %>
|
||||
<td class="hworkList70 <%= score_color score %> student_final_scor_info">
|
||||
<%= score.nil? ? "--" : format("%.1f", score<0 ? 0 : score) %>
|
||||
<% unless score.nil? %>
|
||||
<div class="infoNi none width180">
|
||||
作品最终评分为
|
||||
<span class="c_red"> <%= student_work.final_score %> </span>分。
|
||||
迟交扣分
|
||||
<span class="c_red">
|
||||
<%= student_work.homework_common && student_work.homework_common.teacher_priority == 1 && student_work.teacher_score ? 0 : student_work.late_penalty %>
|
||||
</span>分,
|
||||
缺评扣分
|
||||
<span class="c_red">
|
||||
<%= student_work.homework_common && student_work.homework_common.teacher_priority == 1 && student_work.teacher_score ? 0 : student_work.absence_penalty %>
|
||||
</span>分,
|
||||
最终成绩为
|
||||
<span class="c_red"> <%= format("%.1f", score<0 ? 0 : score) %> </span>分。
|
||||
</div>
|
||||
<% end %>
|
||||
</td>
|
||||
<td>
|
||||
<div style="position:relative;">
|
||||
<div class="hworkTip" style="display: none" id="work_click_<%= student_work.id %>">
|
||||
<em></em><span></span><font class="fontGrey2">点击查看详情</font></div>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
@ -1,77 +1,86 @@
|
||||
<table class="hwork-table-wrap" id="homework_table">
|
||||
<tr class="b_grey hworkH30">
|
||||
<th class="hworkList30 hworkH30 pl5 pr5">序号</th>
|
||||
<th class="hworkList50"> </th>
|
||||
<% if @homework.homework_type != 3 %>
|
||||
<th class="<%= @homework.homework_type == 2 ? 'hworkList80 pl5 pr5 hide-text' : 'hworkList130 pl5 pr5 hide-text'%>" style="text-align:left;">作品名称</th>
|
||||
<th class="<%=@homework.anonymous_comment == 1 ? 'hworkList100' : 'hworkList60'%> pl5 pr5 hide-text">
|
||||
<%= link_to "姓名",@show_all ? student_work_index_path(:homework => @homework.id,:order => "lastname", :sort => @score, :name => @name, :group => @group) : "javascript:void(0)",:class => "c_dark f14 fb" ,:remote => true%>
|
||||
<% if @show_all && @order == "lastname"%>
|
||||
<%= link_to "", student_work_index_path(:homework => @homework.id,:order => "lastname", :sort => @score, :name => @name, :group => @group) ,:class => "#{@score == 'desc' ? 'sort_up' : 'sort_down'} float-none" ,:style => "line-height:30px; vertical-align:middle;",:remote => true%>
|
||||
<% end%>
|
||||
</th>
|
||||
<th class="<%=@homework.anonymous_comment == 1 ? 'hworkList90' : 'hworkList80'%> pl5 pr5 hide-text">
|
||||
<%= link_to "学号",@show_all ? student_work_index_path(:homework => @homework.id,:order => "student_id", :sort => @score, :name => @name, :group => @group) : "javascript:void(0)",:class => "c_dark f14 fb" ,:remote => true%>
|
||||
<% if @show_all && @order == "student_id"%>
|
||||
<%= link_to "", student_work_index_path(:homework => @homework.id,:order => "student_id", :sort => @score, :name => @name, :group => @group) ,:class => "#{@score == 'desc' ? 'sort_up' : 'sort_down'} float-none" ,:style => "line-height:30px; vertical-align:middle;",:remote => true%>
|
||||
<% end%>
|
||||
</th>
|
||||
<% elsif @homework.homework_type == 3 && @homework.homework_detail_group.base_on_project == 1 %>
|
||||
<th class="hworkList130 pl5 pr5" style="text-align:left;">作品名称</th>
|
||||
<th class="<%=@homework.anonymous_comment == 1 ? 'hworkList210' : 'hworkList160'%>">
|
||||
<span class="c_dark f14 fb">关联项目</span>
|
||||
<%# if @homework.homework_type == 1 %>
|
||||
<%#= render :partial => 'evaluation_un_common_title' %>
|
||||
<%# elsif @homework.homework_type == 2 %>
|
||||
<%#= render :partial => 'evaluation_un_pro_title' %>
|
||||
<%# elsif @homework.homework_type == 3 %>
|
||||
<%#= render :partial => 'evaluation_un_group_title' %>
|
||||
<%# else %>
|
||||
<tr class="b_grey hworkH30">
|
||||
<th class="hworkList40 hworkH30 pl5 pr5">序号</th>
|
||||
<th class="hworkList50"> </th>
|
||||
<% if @homework.homework_type != 3 %>
|
||||
<th class="<%= @homework.homework_type == 1 ? (@homework.anonymous_comment == 1 ? 'hworkList130' : 'hworkList100') : (@homework.anonymous_comment == 1 ? 'hworkList110' : 'hworkList60') %> pl5 pr5 hide-text">
|
||||
<%= link_to "姓名", @show_all ? student_work_index_path(:homework => @homework.id, :order => "lastname", :sort => @score, :name => @name, :group => @group) : "javascript:void(0)", :class => "c_dark f14 fb", :remote => true %>
|
||||
<% if @show_all && @order == "lastname" %>
|
||||
<%= link_to "", student_work_index_path(:homework => @homework.id, :order => "lastname", :sort => @score, :name => @name, :group => @group), :class => "#{@score == 'desc' ? 'sort_up' : 'sort_down'} float-none", :style => "line-height:30px; vertical-align:middle;", :remote => true %>
|
||||
<% end %>
|
||||
</th>
|
||||
<th class="<%= @homework.homework_type == 1 ? (@homework.anonymous_comment == 1 ? 'hworkList130' : 'hworkList90') : (@homework.anonymous_comment == 1 ? 'hworkList100' : 'hworkList80') %> pl5 pr5 hide-text">
|
||||
<%= link_to "学号", @show_all ? student_work_index_path(:homework => @homework.id, :order => "student_id", :sort => @score, :name => @name, :group => @group) : "javascript:void(0)", :class => "c_dark f14 fb", :remote => true %>
|
||||
<% if @show_all && @order == "student_id" %>
|
||||
<%= link_to "", student_work_index_path(:homework => @homework.id, :order => "student_id", :sort => @score, :name => @name, :group => @group), :class => "#{@score == 'desc' ? 'sort_up' : 'sort_down'} float-none", :style => "line-height:30px; vertical-align:middle;", :remote => true %>
|
||||
<% end %>
|
||||
</th>
|
||||
<% else %>
|
||||
<% if @homework.homework_detail_group.base_on_project == 1 %>
|
||||
<th class="hworkList130 pl5 pr5" style="text-align:left;">组长</th>
|
||||
<th class="<%= @homework.anonymous_comment == 1 ? 'hworkList140' : 'hworkList70' %>">
|
||||
<span class="c_dark f14 fb">关联项目</span>
|
||||
</th>
|
||||
<% elsif @homework.homework_detail_group.base_on_project == 0 %>
|
||||
<th class="<%= @homework.anonymous_comment == 1 ? 'hworkList270' : 'hworkList200' %> pl5 pr5" style="text-align:left;">组长</th>
|
||||
<% end %>
|
||||
<% end %>
|
||||
<th class="<%= @homework.homework_type ==2 ? 'hworkList110' : 'hworkList130' %>">
|
||||
<%= link_to "状态", @show_all ? student_work_index_path(:homework => @homework.id, :order => "work_status", :sort => @score, :name => @name, :group => @group) : "javascript:void(0)", :class => "c_dark f14 fb", :remote => true %>
|
||||
<% if @show_all && @order == "work_status" %>
|
||||
<%= link_to "", student_work_index_path(:homework => @homework.id, :order => "work_status", :sort => @score, :name => @name, :group => @group), :class => "#{@score == 'desc' ? 'sort_up' : 'sort_down'} float-none", :style => "line-height:30px; vertical-align:middle;", :remote => true %>
|
||||
<% end %>
|
||||
</th>
|
||||
<% elsif @homework.homework_type == 3 && @homework.homework_detail_group.base_on_project == 0 %>
|
||||
<th class="<%=@homework.anonymous_comment == 1 ? 'hworkList340' : 'hworkList290' %> pl5 pr5" style="text-align:left;">作品名称</th>
|
||||
<% end %>
|
||||
<th class="hworkList130">
|
||||
<%= link_to "时间",@show_all ? student_work_index_path(:homework => @homework.id,:order => "created_at", :sort => @score, :name => @name, :group => @group) : "javascript:void(0)",:class => "c_dark f14 fb" ,:remote => true%>
|
||||
<% if @show_all && @order == "created_at"%>
|
||||
<%= link_to "", student_work_index_path(:homework => @homework.id,:order => "created_at", :sort => @score, :name => @name, :group => @group) ,:class => "#{@score == 'desc' ? 'sort_up' : 'sort_down'} float-none",:style => "line-height:30px; vertical-align:middle;",:remote => true%>
|
||||
<% end%>
|
||||
</th>
|
||||
<th class="hworkList50">
|
||||
<%= link_to "教师",@show_all ? student_work_index_path(:homework => @homework.id,:order => "teacher_score", :sort => @score, :name => @name, :group => @group) : "javascript:void(0)",:class => "c_dark f14 fb" ,:remote => true%>
|
||||
<% if @show_all && @order == "teacher_score"%>
|
||||
<%= link_to "", student_work_index_path(:homework => @homework.id,:order => "teacher_score", :sort => @score, :name => @name, :group => @group) ,:class => "#{@score == 'desc' ? 'sort_up' : 'sort_down'} float-none" ,:style => "line-height:30px; vertical-align:middle;",:remote => true%>
|
||||
<% end%>
|
||||
</th>
|
||||
<th class="hworkList50">
|
||||
<%= link_to "教辅",@show_all ? student_work_index_path(:homework => @homework.id,:order => "teaching_asistant_score", :sort => @score, :name => @name, :group => @group) : "javascript:void(0)",:class => "c_dark f14 fb",:remote => true%>
|
||||
<% if @show_all && @order == "teaching_asistant_score"%>
|
||||
<%= link_to "", student_work_index_path(:homework => @homework.id,:order => "teaching_asistant_score", :sort => @score, :name => @name, :group => @group) ,:class => "#{@score == 'desc' ? 'sort_up' : 'sort_down'} float-none",:style => "line-height:30px; vertical-align:middle;",:remote => true%>
|
||||
<% end%>
|
||||
</th>
|
||||
<% if @homework.homework_type == 2%>
|
||||
<th class="hworkList50">
|
||||
<%= link_to "系统",@show_all ? student_work_index_path(:homework => @homework.id,:order => "system_score", :sort => @score, :name => @name, :group => @group) : "javascript:void(0)",:class => "c_dark f14 fb",:remote => true%>
|
||||
<% if @show_all && @order == "system_score"%>
|
||||
<%= link_to "", student_work_index_path(:homework => @homework.id,:order => "system_score", :sort => @score, :name => @name, :group => @group) ,:class => "#{@score == 'desc' ? 'sort_up' : 'sort_down'} float-none",:style => "line-height:30px; vertical-align:middle;",:remote => true%>
|
||||
<% end%>
|
||||
<th class="hworkList70">
|
||||
<%= link_to "教师", @show_all ? student_work_index_path(:homework => @homework.id, :order => "teacher_score", :sort => @score, :name => @name, :group => @group) : "javascript:void(0)", :class => "c_dark f14 fb", :remote => true %>
|
||||
<% if @show_all && @order == "teacher_score" %>
|
||||
<%= link_to "", student_work_index_path(:homework => @homework.id, :order => "teacher_score", :sort => @score, :name => @name, :group => @group), :class => "#{@score == 'desc' ? 'sort_up' : 'sort_down'} float-none", :style => "line-height:30px; vertical-align:middle;", :remote => true %>
|
||||
<% end %>
|
||||
</th>
|
||||
<% end%>
|
||||
<% if @homework.anonymous_comment == 0%>
|
||||
<th class="hworkList50">
|
||||
<%= link_to "匿评",@show_all ? student_work_index_path(:homework => @homework.id,:order => "student_score", :sort => @score, :name => @name, :group => @group) : "javascript:void(0)",:class => "c_dark f14 fb",:remote => true%>
|
||||
<% if @show_all && @order == "student_score"%>
|
||||
<%= link_to "", student_work_index_path(:homework => @homework.id,:order => "student_score", :sort => @score, :name => @name, :group => @group) ,:class => "#{@score == 'desc' ? 'sort_up' : 'sort_down'} float-none",:style => "line-height:30px; vertical-align:middle;",:remote => true%>
|
||||
<% end%>
|
||||
<th class="hworkList70">
|
||||
<%= link_to "教辅", @show_all ? student_work_index_path(:homework => @homework.id, :order => "teaching_asistant_score", :sort => @score, :name => @name, :group => @group) : "javascript:void(0)", :class => "c_dark f14 fb", :remote => true %>
|
||||
<% if @show_all && @order == "teaching_asistant_score" %>
|
||||
<%= link_to "", student_work_index_path(:homework => @homework.id, :order => "teaching_asistant_score", :sort => @score, :name => @name, :group => @group), :class => "#{@score == 'desc' ? 'sort_up' : 'sort_down'} float-none", :style => "line-height:30px; vertical-align:middle;", :remote => true %>
|
||||
<% end %>
|
||||
</th>
|
||||
<% end %>
|
||||
<th class="hworkList50">
|
||||
<%= link_to "成绩",@show_all ? student_work_index_path(:homework => @homework.id,:order => "score", :sort => @score, :name => @name, :group => @group) : "javascript:void(0)",:class => "c_dark f14 fb",:remote => true%>
|
||||
<% if @show_all && @order == "score"%>
|
||||
<%= link_to "", student_work_index_path(:homework => @homework.id,:order => "score", :sort => @score, :name => @name, :group => @group) ,:class => "#{@score == 'desc' ? 'sort_up' : 'sort_down'} float-none",:style => "line-height:30px; vertical-align:middle;",:remote => true%>
|
||||
<% end%>
|
||||
</th>
|
||||
</tr>
|
||||
<% @stundet_works.each_with_index do |student_work, i|%>
|
||||
<%= render :partial => "evaluation_un_work", :locals => {:student_work => student_work, :index => i}%>
|
||||
<% if @homework.homework_type == 2 %>
|
||||
<th class="hworkList70">
|
||||
<%= link_to "系统", @show_all ? student_work_index_path(:homework => @homework.id, :order => "system_score", :sort => @score, :name => @name, :group => @group) : "javascript:void(0)", :class => "c_dark f14 fb", :remote => true %>
|
||||
<% if @show_all && @order == "system_score" %>
|
||||
<%= link_to "", student_work_index_path(:homework => @homework.id, :order => "system_score", :sort => @score, :name => @name, :group => @group), :class => "#{@score == 'desc' ? 'sort_up' : 'sort_down'} float-none", :style => "line-height:30px; vertical-align:middle;", :remote => true %>
|
||||
<% end %>
|
||||
</th>
|
||||
<% end %>
|
||||
<% if @homework.anonymous_comment == 0 %>
|
||||
<th class="hworkList70">
|
||||
<%= link_to "匿评", @show_all ? student_work_index_path(:homework => @homework.id, :order => "student_score", :sort => @score, :name => @name, :group => @group) : "javascript:void(0)", :class => "c_dark f14 fb", :remote => true %>
|
||||
<% if @show_all && @order == "student_score" %>
|
||||
<%= link_to "", student_work_index_path(:homework => @homework.id, :order => "student_score", :sort => @score, :name => @name, :group => @group), :class => "#{@score == 'desc' ? 'sort_up' : 'sort_down'} float-none", :style => "line-height:30px; vertical-align:middle;", :remote => true %>
|
||||
<% end %>
|
||||
</th>
|
||||
<% end %>
|
||||
<th class="hworkList70">
|
||||
<%= link_to "成绩", @show_all ? student_work_index_path(:homework => @homework.id, :order => "score", :sort => @score, :name => @name, :group => @group) : "javascript:void(0)", :class => "c_dark f14 fb", :remote => true %>
|
||||
<% if @show_all && @order == "score" %>
|
||||
<%= link_to "", student_work_index_path(:homework => @homework.id, :order => "score", :sort => @score, :name => @name, :group => @group), :class => "#{@score == 'desc' ? 'sort_up' : 'sort_down'} float-none", :style => "line-height:30px; vertical-align:middle;", :remote => true %>
|
||||
<% end %>
|
||||
</th>
|
||||
</tr>
|
||||
<%# end %>
|
||||
<% @stundet_works.each_with_index do |student_work, i| %>
|
||||
<%= render :partial => "evaluation_un_work", :locals => {:student_work => student_work, :index => i} %>
|
||||
<tr>
|
||||
<td colspan="12">
|
||||
<div id="about_hwork_<%= student_work.id%>">
|
||||
<div id="about_hwork_<%= student_work.id %>">
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
<% end%>
|
||||
<% end %>
|
||||
</table>
|
@ -0,0 +1,3 @@
|
||||
$("#syllabus_title_show").html("<%= escape_javascript render :partial => 'layouts/syllabus_title', :locals => {:syllabus => @syllabus} %>");
|
||||
$("#syllabus_title_show").show();
|
||||
$("#syllabus_title_edit").hide();
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in new issue