dev_haigong
daiao 6 years ago
commit a5e64635e1

@ -76,48 +76,59 @@ class ApplicationController < ActionController::Base
# 包月+按license 9200109002 # 包月+按license 9200109002
# 云启训练场EduCoder院校版 产品编码appId 9200109 # 云启训练场EduCoder院校版 产品编码appId 9200109
def ecloud_auth subject_id
# euser = EcloudUser.where("userid =? and opttype not in(3, 5)", User.current.id).first # 如果不是Ecloud过来的用户则不改变用户的使用状态及权限按现有模式即可
# if euser.present? # 开通过业务 def ecloud_auth
# # 获取用户的套餐信息 euser = EcloudUser.where("userid =? and opttype not in(3, 5)", User.current.id).first
# e_service = euser.ecloud_services.where("opttype != 1")
# # 如果用户开通过服务 if euser.present? # 开通过业务
# if e_service.present? # 获取用户的套餐信息
# if e_service.count >1 # 说明有重复开通过业务 e_services = euser.ecloud_services.where("opttype != 1").order("ecloud_services.code desc")
# else # 如果用户开通过服务
# code = e_service.first.try(:code) if e_services.present?
# if e_services.count > 1 # 说明有重复开通过业务
# end # 开通多业务的话以最大的套餐排序如果最大套餐还可以用则直接返回true如果最大套餐不能用则轮询返回直到找到可用的套餐
# end e_services.each do |e_service|
# else # 使用期限内套餐才有效
# false # 没开通过服务,或者服务被禁用则不允许访问 ecloud_services_auth(e_service.code, e_service.begintime, e_service.endtime)
# end end
# else
# # 先看套餐,再看时间区间
# e_service = e_services.first
# ecloud_services_auth(e_service.code, e_service.begintime, e_service.endtime)
# if e_service.count > 1 # 说明有重复订购过套餐 end
# else else
# code = e_service.try(:code) false # 没开通过服务,或者服务被禁用则不允许访问
# end end
# service_count = euser.ecloud_services.where("opttype != 1").try(:code) end
#
# end
# 如果不是Ecloud过来的用户则不改变用户的使用状态及权限按现有模式即可
end end
# 根据业务确定权限 # 根据业务确定权限
def ecloud_services_auth code, subject_id def ecloud_services_auth code, begintime, endtime
subject = Subject.find(subject_id) # 如果当前实训不在实训课堂等级体系中,则不允许访问
subject_level = subject.subject_level_system.try(:level) subject_id = @shixun.stage_shixuns.map(&:subject_id)
# case code if subject_id.blank?
# when "9200108001" render_403
# subject_level.to_i == 1 ? true : false end
# when "9200108002" subject_level = Subject.find(subject_id).subject_level_system.try(:level)
# # 当前时间转毫秒
# end current_time = DateTime.now.strftime('%Q').to_i
# end if current_time - begintime > 0 && endtime - current_time > 0
case code
when "9200108001"
subject_level.to_i == 1 ? true : false
when "9200108002"
subject_level.to_i == 2 ? true : false
when "9200108003"
subject_level.to_i == 3 ? true : false
when "9200109001" # 企业用户
subject_level.to_i < 3 ? true : false
when "9200109002" # 企业用户
subject_level.to_i <= 3 ? true : false
end
else
false
end
end end

@ -13,7 +13,7 @@ class ChallengesController < ApplicationController
skip_before_filter :verify_authenticity_token, :only => [:create_choose_question, :update_choose_question] skip_before_filter :verify_authenticity_token, :only => [:create_choose_question, :update_choose_question]
#before_filter :find_shixun_language, :only => [:show, :new, :edit] #before_filter :find_shixun_language, :only => [:show, :new, :edit]
before_filter :base_index, :only => [:index, :index_down, :index_up, :destroy] before_filter :base_index, :only => [:index, :index_down, :index_up, :destroy]
before_filter :view_allow, :only => [:index, :show] before_filter :view_allow, :only => [:show]
include ApplicationHelper include ApplicationHelper

@ -1,10 +1,10 @@
#encoding: utf-8 #encoding: utf-8
class EcCoursesController < ApplicationController class EcCoursesController < ApplicationController
layout 'base_ec' layout 'base_ec'
before_filter :find_ec_course, :except => [:create, :get_calculation_data, :sync_all_course_data] before_filter :find_ec_course, :except => [:create, :get_calculation_data, :sync_all_course_data, :search_courses]
before_filter :find_year, :only => [:create, :get_calculation_data] before_filter :find_year, :only => [:create, :get_calculation_data]
before_filter :require_login before_filter :require_login, :except => [:search_courses, :correlation_course]
before_filter :ec_auth, :except => [:sync_all_course_data] before_filter :ec_auth, :except => [:sync_all_course_data, :search_courses, :correlation_course]
skip_before_filter :verify_authenticity_token, :only => [:crud_targets, :crud_score_level, :sync_all_course_data, :search_courses, skip_before_filter :verify_authenticity_token, :only => [:crud_targets, :crud_score_level, :sync_all_course_data, :search_courses,
:correlation_course, :delete_course] :correlation_course, :delete_course]
@ -349,11 +349,11 @@ class EcCoursesController < ApplicationController
if user.try(:admin?) if user.try(:admin?)
courses = Course.where(:is_delete => 0) courses = Course.where(:is_delete => 0)
else else
course_ids = Member.where("user_id = #{params[:user_id]} and course_id != -1").pluck(:course_id) course_ids = Member.where("user_id = #{user.try(:id)} and course_id != -1").pluck(:course_id)
courses = Course.where(:is_delete => 0, :id => course_ids) courses = Course.where(:is_delete => 0, :id => course_ids)
end end
if params[:search] && params[:search].strip != "" if params[:search] && params[:search].strip != ""
courses = courses.where("name like '%#{params[:search].strip}%'").reorder("created_at desc") courses = courses.where("name like ?", "%#{params[:search].strip}%").reorder("created_at desc")
else else
courses = courses.reorder("created_at desc") courses = courses.reorder("created_at desc")
end end

@ -31,12 +31,10 @@ class EcYearsController < ApplicationController
end end
@status = 1 @status = 1
end end
@major_manager = User.current.admin? || @major_manager = true
@major_school.school.ec_school_users.pluck(:user_id).include?(User.current.id) ||
@major_school.ec_major_school_users.pluck(:user_id).include?(User.current.id)
@btn_text = @major_school.template_major && User.current.admin? ? "立即配置" : @btn_text = @major_school.template_major && User.current.admin? ? "立即配置" :
(!@major_school.template_major && @major_manager ? "立即配置" : "查看") (!@major_school.template_major && @major_manager ? "立即配置" : "查看")
@years = @major_school.ec_years @years = EcYear.where(:ec_major_school_id => @major_school.id)
@years = paginateHelper @years, 10 @years = paginateHelper @years, 10
respond_to do |format| respond_to do |format|
format.js format.js

@ -791,7 +791,14 @@ class ManagementsController < ApplicationController
def shixun_feedback_message def shixun_feedback_message
@menu_type = 8 @menu_type = 8
@sub_type = 2 @sub_type = 2
@discusses = Discuss.where(:dis_type => "Shixun").reorder("created_at desc") @search = params[:search]
if @search.present?
shixun_ids = Shixun.where("name like ?", "%#{params[:search]}%").pluck(:id)
@discusses = Discuss.where(:dis_type => "Shixun", :dis_id => shixun_ids).reorder("created_at desc")
else
@discusses = Discuss.where(:dis_type => "Shixun").reorder("created_at desc")
end
@all_discusses = @discusses
@discusses_count = @discusses.count @discusses_count = @discusses.count
@limit = 20 @limit = 20
@is_remote = true @is_remote = true
@ -802,6 +809,11 @@ class ManagementsController < ApplicationController
respond_to do |format| respond_to do |format|
format.js format.js
format.html format.html
format.xls{
shixun_ids = @all_discusses.pluck(:dis_id).uniq
filename = "#{Time.now.strftime("%Y%m%d")}-实训反馈.xls"
send_data(shixun_feedback_xls(shixun_ids), :type => 'application/octet-stream', :filename => filename_for_content_disposition(filename))
}
end end
end end
@ -4045,6 +4057,41 @@ end
return sheet.rows return sheet.rows
end end
def shixun_feedback_xls shixun_ids
xls_report = StringIO.new
book = Spreadsheet::Workbook.new
sheet1 = book.create_worksheet :name => "实训反馈"
blue = Spreadsheet::Format.new :color => :blue, :weight => :bold, :size => 10
sheet1.row(0).default_format = blue
count_row = 1
shixuns = Shixun.where(:id => shixun_ids).includes(discusses: [:user])
sheet1.row(0).concat(["序号", "实训ID", "实训名称", "实训作者", "作者单位", "评论数", "评论内容", "关卡", "评论者", "评论者职业",
"评论者单位", "评论时间", "社区导师是否已回复"])
shixuns.each_with_index do |shixun, i|
discusses = shixun.discusses.where("user_id != ?", 1)
sheet1[count_row, 0] = i + 1
sheet1[count_row, 1] = shixun.identifier
sheet1[count_row, 2] = shixun.name
sheet1[count_row, 3] = shixun.owner.show_real_name
sheet1[count_row, 4] = shixun.owner.school_name
sheet1[count_row, 5] = discusses.count
discusses.each_with_index do |discuss, j|
user = discuss.user
sheet1[count_row, 6] = discuss.content.gsub(/<img.*\/>/, "【图片评论】").gsub(/!\[\].+\)/, "【图片评论】")
sheet1[count_row, 7] = "#{discuss.position}"
sheet1[count_row, 8] = user.show_real_name
sheet1[count_row, 9] = user.identity
sheet1[count_row, 10] = user.school_name
sheet1[count_row, 11] = format_time discuss.created_at
sheet1[count_row, 12] = discuss.children.pluck(:user_id).include?(1) ? "" : ""
count_row += 1
end
#count_row += 1
end
book.write xls_report
xls_report.string
end
def competition_member_xls members, competition def competition_member_xls members, competition
xls_report = StringIO.new xls_report = StringIO.new
book = Spreadsheet::Workbook.new book = Spreadsheet::Workbook.new

@ -2,13 +2,16 @@
# REDO: 创建版本库权限控制 # REDO: 创建版本库权限控制
class ShixunsController < ApplicationController class ShixunsController < ApplicationController
layout 'base_shixun' layout 'base_shixun'
before_filter :require_login, :except => [:ghook, :download_file] before_filter :require_login, :except => [:ghook, :download_file, :show, :index]
before_filter :check_authentication, :except => [:ghook, :download_file] before_filter :check_authentication, :except => [:ghook, :download_file, :show, :index]
before_filter :find_shixun, :except => [ :index, :new, :create, :index, :search, :shixun_courses, :new_disscuss, :shixun_migrate, :qrcode, :download_file, :departments, :get_mirror_script, :send_message_to_administrator] before_filter :find_shixun, :except => [ :index, :new, :create, :index, :search, :shixun_courses, :new_disscuss, :shixun_migrate, :qrcode, :download_file, :departments, :get_mirror_script, :send_message_to_administrator]
skip_before_filter :verify_authenticity_token, :only => [:ghook, :download_file] skip_before_filter :verify_authenticity_token, :only => [:ghook, :download_file]
before_filter :view_allow, :only => [:show, :collaborators, :propaedeutics, :shixun_discuss, :ranking_list] before_filter :view_allow, :only => [:collaborators, :propaedeutics, :shixun_discuss, :ranking_list]
before_filter :require_manager, :only => [ :settings, :add_script, :publish, :collaborators_delete, :shixun_members_added, :add_collaborators, :update, :destroy] before_filter :require_manager, :only => [ :settings, :add_script, :publish, :collaborators_delete, :shixun_members_added, :add_collaborators, :update, :destroy]
before_filter :validation_email, :only => [:new] before_filter :validation_email, :only => [:new]
# 移动云ToC模式权限控制
# before_filter :ecloud_auth, :except => [:show, :index]
include ApplicationHelper include ApplicationHelper
include ShixunsHelper include ShixunsHelper

@ -1,8 +1,8 @@
# encoding: utf-8 # encoding: utf-8
class SubjectsController < ApplicationController class SubjectsController < ApplicationController
layout 'base_subject' layout 'base_subject'
before_filter :require_login, :except => [:show] before_filter :require_login, :except => [:show, :index]
before_filter :check_authentication, :except => [:show] before_filter :check_authentication, :except => [:show, :index]
before_filter :find_subject, :except => [:index, :new, :create, :create_subject, :new_subject, :append_to_stage, :send_to_course] before_filter :find_subject, :except => [:index, :new, :create, :create_subject, :new_subject, :append_to_stage, :send_to_course]
include ApplicationHelper include ApplicationHelper

@ -54,7 +54,7 @@ class UsersController < ApplicationController
accept_api_auth :index, :show, :create, :update, :destroy, :tag_save, :tag_saveEx accept_api_auth :index, :show, :create, :update, :destroy, :tag_save, :tag_saveEx
#william #william
before_filter :require_login, :only => [:tag_save, :tag_saveEx] before_filter :require_login, :only => [:tag_save, :tag_saveEx, :search_user_course, :search_user_project]
#before_filter :refresh_changests, :only =>[:user_activities,:user_courses,:user_projects,:user_newfeedback] #before_filter :refresh_changests, :only =>[:user_activities,:user_courses,:user_projects,:user_newfeedback]
#visitor #visitor

@ -340,15 +340,11 @@ module ApplicationHelper
# TPM查看权限 # TPM查看权限
# result一般为页面权限 # result一般为页面权限
def shixun_view_allow shixun, result = nil def shixun_view_allow shixun, result = nil
if params[:openi].to_i == 1 if User.current.manager_of_shixun?(shixun)
result ? false : true result ? false : true
else else
if User.current.manager_of_shixun?(shixun) if shixun.status == 0 || (shixun.use_scope == 1 && !shixun.schools.map(&:name).include?(User.current.school_name))
result ? false : true result ? true : (render_403)
else
if shixun.status == 0 || (shixun.use_scope == 1 && !shixun.schools.map(&:name).include?(User.current.school_name))
result ? true : (render_403)
end
end end
end end
end end
@ -619,7 +615,7 @@ module ApplicationHelper
redirect_to user_info_path() redirect_to user_info_path()
Rails.logger.info("check_authentication end") Rails.logger.info("check_authentication end")
return return
elsif User.current.certification != 1 elsif User.current.certification != 1 # 系统没有授权
day_cer = UserDayCertification.where(:user_id => User.current.id).last day_cer = UserDayCertification.where(:user_id => User.current.id).last
unless (Time.now.to_i - day_cer.try(:created_at).to_i) < 86400 unless (Time.now.to_i - day_cer.try(:created_at).to_i) < 86400
redirect_to my_account_path() redirect_to my_account_path()

@ -1,3 +1,4 @@
# ket值license表示人数对应企业版duration表示月数对应个人版
class EcloudServieceServicepara < ActiveRecord::Base class EcloudServieceServicepara < ActiveRecord::Base
attr_accessible :key, :value, :ecloud_service_id attr_accessible :key, :value, :ecloud_service_id
belongs_to :ecloud_service belongs_to :ecloud_service

@ -1 +1 @@
<!doctype html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width,initial-scale=1,shrink-to-fit=no"><meta name="theme-color" content="#000000"><meta name="renderer" content="webkit"/><meta name="force-rendering" content="webkit"/><meta http-equiv="X-UA-Compatible" content="IE=edge"/><link rel="manifest" href="/manifest.json"><link rel="shortcut icon" href="/favicon.ico"><title>Educoder</title><script type="text/javascript">window.__isR=!0</script><link rel="stylesheet" href="/react/build/css/css_min_all.css"><link rel="stylesheet" href="/assets/iconfont/iconfont.css"><link href="/react/build/./static/css/main.c95e49c6.css" rel="stylesheet"></head><body><noscript>You need to enable JavaScript to run this app.</noscript><div id="md_div" style="display:none"></div><div id="root" class="page -layout-v -fit"></div><div id="picture_display" style="display:none"></div><script type="text/javascript" src="/react/build/js/js_min_all.js"></script><script type="text/javascript" src="/assets/kindeditor/kindeditor.js"></script><script type="text/javascript" src="/react/build/js/create_kindeditor.js"></script><script type="text/javascript" src="/javascripts/educoder/edu_application.js"></script><script type="text/javascript" src="/react/build/./static/js/main.533264d5.js"></script></body></html> <!doctype html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width,initial-scale=1,shrink-to-fit=no"><meta name="theme-color" content="#000000"><meta name="renderer" content="webkit"/><meta name="force-rendering" content="webkit"/><meta http-equiv="X-UA-Compatible" content="IE=edge"/><link rel="manifest" href="/manifest.json"><link rel="shortcut icon" href="/favicon.ico"><title>Educoder</title><script type="text/javascript">window.__isR=!0</script><link rel="stylesheet" href="/react/build/css/css_min_all.css"><link rel="stylesheet" href="/assets/iconfont/iconfont.css"><link href="/react/build/./static/css/main.c95e49c6.css" rel="stylesheet"></head><body><noscript>You need to enable JavaScript to run this app.</noscript><div id="md_div" style="display:none"></div><div id="root" class="page -layout-v -fit"></div><div id="picture_display" style="display:none"></div><script type="text/javascript" src="/react/build/js/js_min_all.js"></script><script type="text/javascript" src="/assets/kindeditor/kindeditor.js"></script><script type="text/javascript" src="/react/build/js/create_kindeditor.js"></script><script type="text/javascript" src="/javascripts/educoder/edu_application.js"></script><script type="text/javascript" src="/react/build/./static/js/main.21bade1d.js"></script></body></html>

@ -17,7 +17,7 @@
</div> </div>
<li class="clearfix mt10 edu-txt-center"> <li class="clearfix mt10 edu-txt-center">
<a href="javascript:void(0);" class="task-btn mr10" onclick="hideModal()">取消</a> <a href="javascript:void(0);" class="task-btn mr10" onclick="hideModal()">取消</a>
<a href="javascript:void(0);" class="task-btn task-btn-orange ml20" onclick="submit_data();">确定</a> <a href="javascript:void(0);" class="task-btn task-btn-orange ml20" onclick="submit_data(); hideModal();">确定</a>
</li> </li>
</div> </div>
</div> </div>

@ -1,6 +1,7 @@
<% if @status.to_i == -1 %> <% if @status.to_i == -1 %>
notice_box("该界别已经存在,请勿重复创建") notice_box("该界别已经存在,请勿重复创建")
<% else %> <% else %>
$("#year_list").html('<%= j(render :partial => "ec_major_schools/year_list") %>') window.location.reload();
hideModal(); console.log("##########<%= @years.count %>")
//$("#year_list").html('<%#= j(render :partial => "ec_major_schools/year_list") %>')
<% end %> <% end %>

@ -5,7 +5,7 @@
<li class="<%= subjects_controller.include?(params[:controller]) ? " active" : "" %>"><%= link_to "实训课程", subjects_path %></li> <li class="<%= subjects_controller.include?(params[:controller]) ? " active" : "" %>"><%= link_to "实训课程", subjects_path %></li>
<li class="<%= course_controller.include?(params[:controller]) ? " active" : "" %>"><%= link_to "翻转课堂", courses_path %></li> <li class="<%= course_controller.include?(params[:controller]) ? " active" : "" %>"><%= link_to "翻转课堂", courses_path %></li>
<!-- 精选实训 --> <!-- 精选实训 -->
<li class="pr<%= shixuns_controller.include?(params[:controller]) ? " active" : "" %>"><%= link_to "开发社区", shixuns_path %><img src="/images/educoder/hot-h.png" class="nav-img" /></li> <li class="pr <%= shixuns_controller.include?(params[:controller]) ? " active" : "" %>"><%= link_to "开发社区", shixuns_path %><img src="/images/educoder/hot-h.png" class="nav-img" /></li>
<% careers = Career.published.order("created_at asc") %> <% careers = Career.published.order("created_at asc") %>
<% if careers.present? %> <% if careers.present? %>

@ -3,16 +3,14 @@
<div class="head-nav pr"> <div class="head-nav pr">
<ul id="header-nav"> <ul id="header-nav">
<li class="active" style="display: none"><%= link_to "首页", home_path %></li> <li class="active" style="display: none"><%= link_to "首页", home_path %></li>
<li><%= link_to "实训课程", subjects_path %></li> <li class="<%= subjects_controller.include?(params[:controller]) ? " active" : "" %>"><%= link_to "实训课程", subjects_path %></li>
<li><%= link_to "翻转课堂", courses_path %></li> <li class="<%= course_controller.include?(params[:controller]) ? " active" : "" %>"><%= link_to "翻转课堂", courses_path %></li>
<li class="pr <%= shixuns_controller.include?(params[:controller]) ? " active" : "" %>"><%= link_to "开发社区", shixuns_path %><img src="/images/educoder/hot-h.png" class="nav-img" /></li>
<li class="pr">
<%= link_to "开发社区", shixuns_path %>
<img src="/images/educoder/hot-h.png" class="nav-img" />
</li>
<% careers = Career.published.order("created_at asc") %> <% careers = Career.published.order("created_at asc") %>
<% if careers.present? %> <% if careers.present? %>
<li class="fl edu-menu-panel headIcon careershover" style="cursor: auto;"> <li class="fl edu-menu-panel headIcon careershover <%= params[:action] == "index" && params[:controller] == "careers" ? " active" : "" %>" style="cursor: auto;">
<p>职业路径</p> <p>职业路径</p>
<ul class="edu-menu-list edu-menu-listnew" style="top:60px"> <ul class="edu-menu-list edu-menu-listnew" style="top:60px">
<% careers.each do |career| %> <% careers.each do |career| %>
@ -21,8 +19,8 @@
</ul> </ul>
</li> </li>
<% end %> <% end %>
<li><%= link_to "竞赛", competitions_path %></li> <li class="<%= params[:controller] == "competitions" ? " active" : "" %>"><%= link_to "竞赛", competitions_path %></li>
<li><%= link_to "问答", forums_path %></li> <li class="<%= params[:controller] == "forums" ? " active" : "" %>"><%= link_to "问答", forums_path %></li>
<!--<li><%#= link_to "活动竞赛", competitions_path %></li>--> <!--<li><%#= link_to "活动竞赛", competitions_path %></li>-->
</ul> </ul>
<div class="posi-search unlogin" id="posi-search" style="display: none" > <div class="posi-search unlogin" id="posi-search" style="display: none" >
@ -89,21 +87,5 @@
window.onscroll=function(){ window.onscroll=function(){
var sl=-Math.max(document.body.scrollLeft,document.documentElement.scrollLeft); var sl=-Math.max(document.body.scrollLeft,document.documentElement.scrollLeft);
document.getElementById('nHeader').style.left=sl+'px'; document.getElementById('nHeader').style.left=sl+'px';
} };
$(function () {
var $header = $("#header-nav").children("li");
<% if params[:controller] == "welcome" %>
$("#header-nav").children("li").eq(0).addClass("active");
<% elsif subjects_controller.include?(params[:controller]) %>
$("#header-nav").children("li").eq(1).addClass("active");
<% elsif course_controller.include?(params[:controller]) %>
$("#header-nav").children("li").eq(2).addClass("active");
<% elsif shixuns_controller.include?(params[:controller]) %>
$header.length == 7 ? $header.eq(2).addClass("active") : $header.eq(3).addClass("active");
<% elsif params[:controller] == "competitions" %>
$header.length == 7 ? $header.eq(5).addClass("active") : $header.eq(4).addClass("active");
<% elsif params[:controller] == "forums" %>
$header.length == 7 ? $header.eq(6).addClass("active") : $header.eq(5).addClass("active");
<% end %>
})
</script> </script>

@ -1,14 +1,20 @@
<div class="edu-class-container"> <div class="edu-class-container">
<%#= form_tag(url_for(shixuns_managements_path), :id => "managements_shixuns_search", :method => "post", :remote => true ) do %> <%= form_tag(url_for(shixun_feedback_message_managements_path), :id => "managements_shixuns_search", :method => "post", :remote => true ) do %>
<!--<div class="edu-con-top clearfix mb20">--> <div class="edu-con-top clearfix mb20">
<!--<input class="fl task-form-20 task-height-30 ml25" id="shixun_Look_name" name="search" maxlength="" placeholder="输入实训名称关键字进行搜索" type="text" style="height: 21px;">--> <input class="fl task-form-20 task-height-30 ml25" id="shixun_Look_name" name="search" maxlength="" placeholder="输入实训名称关键字进行搜索" type="text" style="height: 21px;">
<!--<li class="fl ml10">--> <li class="fl ml10">
<!--<a href="javascript:void(0)" class="task-btn task-btn-orange" onclick="$('#managements_shixuns_search').submit();">搜索</a>--> <a href="javascript:void(0)" class="task-btn task-btn-orange" onclick="$('#managements_shixuns_search').submit();">搜索</a>
<!--<a href="javascript:clearSearchCondition();" class="task-btn mr10">清除</a>--> <a href="javascript:clearSearchCondition();" class="task-btn mr10">清除</a>
<!--</li>--> </li>
<!--</div>--> <a href="<%= shixun_feedback_message_managements_path(:search => @search, :format => "xls") %>" id="shixun_search" class="task-btn mr10 task-btn-orange fr">导出</a>
<%# end %> </div>
<% end %>
<div class="ex_container" id="management_shixun_feedback_list"> <div class="ex_container" id="management_shixun_feedback_list">
<%= render :partial => "shixun_feedback_list" %> <%= render :partial => "shixun_feedback_list" %>
</div> </div>
</div> </div>
<script>
function clearSearchCondition(){
$("#shixun_Look_name").val('')
}
</script>

@ -1 +1,2 @@
$("#management_shixun_feedback_list").html("<%= j(render :partial => 'shixun_feedback_list') %>"); $("#management_shixun_feedback_list").html("<%= j(render :partial => 'shixun_feedback_list') %>");
$("#shixun_search").attr("href", "<%= shixun_feedback_message_managements_path(:search => @search, :format => "xls") %>")

@ -5,167 +5,163 @@
SearchByName_poll(); SearchByName_poll();
} }
} }
$(function () {
});
</script> </script>
<div class="edu-class-container edu-position"> <div class="edu-class-container edu-position">
<p class="mb10 font-14"> <p class="mb10 font-14">
<%= link_to @course.name, course_path(@course),:class => "color-grey-9" %> &gt; <%= link_to "问卷列表", poll_index_path(:course_id => @course.id),:class => "color-grey-9" %> &gt; <%= link_to @course.name, course_path(@course),:class => "color-grey-9" %> &gt; <%= link_to "问卷列表", poll_index_path(:course_id => @course.id),:class => "color-grey-9" %> &gt;
#<%= get_poll_index(@poll, @course, @is_teacher) + 1 %> #<%= get_poll_index(@poll, @course, @is_teacher) + 1 %>
</p>
<div class="edu-con-top user_bg_shadow bor-grey-e clearfix mb20">
<p class="ml15 fl color-grey3">
<% unless @poll.is_public %>
<i id="poll_public_icon_<%= @poll.id %>" class="fa fa-lock color-grey-c fl mt8 mr15 font-18"></i>
<% end %>
<span><%= @poll.polls_name %></span>
</p> </p>
<%= link_to "返回", poll_index_path(:course_id => @course.id), :class => "fr font-12 mr15 mt3 color-grey" %> <div class="edu-con-top user_bg_shadow bor-grey-e clearfix mb20">
</div> <p class="ml15 fl color-grey3">
<div class="edu-tab clearfix mb20"> <% unless @poll.is_public %>
<i id="poll_public_icon_<%= @poll.id %>" class="fa fa-lock color-grey-c fl mt8 mr15 font-18"></i>
<% end %>
<span><%= @poll.polls_name %></span>
</p>
<%= link_to "返回", poll_index_path(:course_id => @course.id), :class => "fr font-12 mr15 mt3 color-grey" %>
</div>
<div class="clearfix mb20">
<ul id="edu-tab-nav" class="border-bottom-orange"> <ul id="edu-tab-nav" class="border-bottom-orange">
<li id="edu-tab-nav-1" class="new-tab-nav background-orange" onclick="HoverLi(1);"> <li id="edu-tab-nav-1" class="new-tab-nav background-orange" onclick="HoverLi(1);">
<a href="javascript:void(0);" class="tab_type">答题列表</a> <a href="javascript:void(0);" class="tab_type">答题列表</a>
</li> </li>
<% if @is_teacher || (@poll.show_result == 1 && @poll.polls_status == 3) %> <% if @is_teacher || (@poll.show_result == 1 && @poll.polls_status == 3) %>
<li id="edu-tab-nav-2" class="new-tab-nav" onclick="HoverLi(2);"> <li id="edu-tab-nav-2" class="new-tab-nav" onclick="HoverLi(2);">
<a href="javascript:void(0);" class="tab_type">统计结果</a> <a href="javascript:void(0);" class="tab_type">统计结果</a>
</li> </li>
<% end %> <% end %>
<% if @is_teacher %> <% if @is_teacher %>
<li id="edu-tab-nav-3" class="new-tab-nav" onclick="HoverLi(3);"> <li id="edu-tab-nav-3" class="new-tab-nav" onclick="HoverLi(3);">
<a href="javascript:void(0);" class="tab_type">问卷内容</a> <a href="javascript:void(0);" class="tab_type">问卷内容</a>
</li> </li>
<li id="edu-tab-nav-4" class="new-tab-nav" onclick="HoverLi(4);"> <li id="edu-tab-nav-4" class="new-tab-nav" onclick="HoverLi(4);">
<a href="javascript:void(0);" class="tab_type">设置</a> <a href="javascript:void(0);" class="tab_type">设置</a>
</li> </li>
<% if @poll.polls_status > 1 %> <% if @poll.polls_status > 1 %>
<%= link_to "导出统计", export_poll_poll_path(@poll, :course_id => @course.id, :format => 'xls'), :id => "export_poll_work", :class => "fr white-btn orange-btn mt10 ml15" %> <%= link_to "导出统计", export_poll_poll_path(@poll, :course_id => @course.id, :format => 'xls'), :id => "export_poll_work", :class => "fr white-btn orange-btn mt10 ml15" %>
<% end %> <% end %>
<% if @poll.polls_status < 3 %> <% if @poll.polls_status < 3 %>
<%= link_to "编辑问卷", edit_poll_path(@poll, :course_id => @course.id), :class => "fr white-btn orange-btn mt10 ml15" %> <%= link_to "编辑问卷", edit_poll_path(@poll, :course_id => @course.id), :class => "fr white-btn orange-btn mt10 ml15" %>
<% end %> <% end %>
<% if @poll.polls_status == 1 || @poll.poll_group_settings.where("publish_time is null or publish_time > '#{Time.now}'").count > 0 %> <% if @poll.polls_status == 1 || @poll.poll_group_settings.where("publish_time is null or publish_time > '#{Time.now}'").count > 0 %>
<%= link_to '立即发布', publish_notice_poll_path(@poll), :remote => true, :class => "white-btn orange-btn fr ml15 mt10" %> <%= link_to '立即发布', publish_notice_poll_path(@poll), :remote => true, :class => "white-btn orange-btn fr ml15 mt10" %>
<% end %> <% end %>
<% if (@poll.polls_status == 2 && @poll.end_time > Time.now) || @poll.poll_group_settings.where("publish_time < '#{Time.now}' and end_time > '#{Time.now}'").count > 0 %> <% if (@poll.polls_status == 2 && @poll.end_time > Time.now) || @poll.poll_group_settings.where("publish_time < '#{Time.now}' and end_time > '#{Time.now}'").count > 0 %>
<%= link_to '立即截止', end_notice_poll_path(@poll), :remote => true, :class => "white-btn orange-btn fr ml15 mt10" %> <%= link_to '立即截止', end_notice_poll_path(@poll), :remote => true, :class => "white-btn orange-btn fr ml15 mt10" %>
<% end %> <% end %>
<% if @poll.polls_status == 2 %> <% if @poll.polls_status == 2 %>
<a href="javascript:void(0)" class="white-btn orange-btn fr ml15 mt10" onclick="cancel_publish('<%= cancel_publish_poll_path(@poll) %>')">撤销发布</a> <a href="javascript:void(0)" class="white-btn orange-btn fr ml15 mt10" onclick="cancel_publish('<%= cancel_publish_poll_path(@poll) %>')">撤销发布</a>
<% end %> <% end %>
<% else %> <% else %>
<li id="edu-tab-nav-4" class="new-tab-nav" onclick="HoverLi(4);"> <li id="edu-tab-nav-4" class="new-tab-nav" onclick="HoverLi(4);">
<a href="javascript:void(0);" class="tab_type">查看设置</a> <a href="javascript:void(0);" class="tab_type">查看设置</a>
</li> </li>
<% if User.current.member_of_course?(@poll.course) %> <% if User.current.member_of_course?(@poll.course) %>
<p class="fr"> <p class="fr">
<% poll_user = @poll.poll_users.where(:user_id => User.current).first %> <% poll_user = @poll.poll_users.where(:user_id => User.current).first %>
<% member = @poll.course.members.where(:user_id => User.current.id).first %> <% member = @poll.course.members.where(:user_id => User.current.id).first %>
<% setting_time = poll_group_setting @poll, member.try(:course_group) %> <% setting_time = poll_group_setting @poll, member.try(:course_group) %>
<% if poll_user %> <% if poll_user %>
<% if poll_user.commit_status > 0 %> <% if poll_user.commit_status > 0 %>
<%= link_to '查看答题', poll_path(@poll, :user_id => User.current.id), :class => "white-btn orange-btn fr mt10 mr15" %> <%= link_to '查看答题', poll_path(@poll, :user_id => User.current.id), :class => "white-btn orange-btn fr mt10 mr15" %>
<% elsif setting_time.publish_time < Time.now && setting_time.end_time > Time.now %> <% elsif setting_time.publish_time < Time.now && setting_time.end_time > Time.now %>
<%= link_to (poll_user.start_at.nil? ? "开始答题" : "继续答题"), poll_path(@poll, :user_id => User.current.id), :class => "white-btn orange-btn fr mt10 mr15" %> <%= link_to (poll_user.start_at.nil? ? "开始答题" : "继续答题"), poll_path(@poll, :user_id => User.current.id), :class => "white-btn orange-btn fr mt10 mr15" %>
<% end %> <% end %>
<% elsif setting_time.publish_time < Time.now && setting_time.end_time > Time.now %> <% elsif setting_time.publish_time < Time.now && setting_time.end_time > Time.now %>
<%= link_to "开始答题", poll_path(@poll, :user_id => User.current.id), :class => "white-btn orange-btn fr mt10 mr15" %> <%= link_to "开始答题", poll_path(@poll, :user_id => User.current.id), :class => "white-btn orange-btn fr mt10 mr15" %>
<% end %> <% end %>
</p> </p>
<% end %> <% end %>
<% end %> <% end %>
</ul> </ul>
<div id="edu-tab-con-1"> <div id="edu-tab-con-1" class="edu-back-white">
<div id="list_count" class="user_bg_shadow bor-grey-e padding15"> <div id="list_count" class="user_bg_shadow bor-grey-e padding15">
<!--老师显示部分--> <!--老师显示部分-->
<% if @is_teacher %> <% if @is_teacher %>
<form id="poll_user_search_form"> <form id="poll_user_search_form">
<li class="clearfix mb5">
<!--样式edu-filter-btn-yellow等根据状态显示-->
<% poll_curr_status = poll_curr_time @poll %>
<% if poll_curr_status[:status] != "" %>
<span class="edu-filter-btn <%= homework_status_color poll_curr_status[:status] %> fl "><%= poll_curr_status[:status] %></span>
<% end %>
<% if @poll.try(:polls_status) == 1 && @poll.publish_time %>
<span class="color-grey fr font-12">将于&nbsp;<span class="color-orange font-12"><%= format_time(@poll.publish_time).to_s %></span>&nbsp;发布</span>
<% else %>
<span class="fr font-12 <%= @poll.try(:polls_status) == 3 ? 'color-grey' : 'color-orange' %>"><%= poll_curr_status[:time] %></span>
<% end %>
</li>
<input id="poll_id" type="hidden" value="<%= @poll.id %>">
<ul class="work_search_ul clearfix">
<li class="clearfix mb5"> <li class="clearfix mb5">
<span class="fl mr10 color-grey">答题状态:</span> <!--样式edu-filter-btn-yellow等根据状态显示-->
<span class="fl mr25"> <% poll_curr_status = poll_curr_time @poll %>
<a href="javascript:void(0);" id="poll_status_no_limit" class="<%= @status.blank? ? 'check_on' : '' %> pl5 pr5">不限</a> <% if poll_curr_status[:status] != "" %>
</span> <span class="edu-filter-btn <%= homework_status_color poll_curr_status[:status] %> fl "><%= poll_curr_status[:status] %></span>
<input id="work_status_1" class="magic-checkbox fl" type="checkbox" value="0" name="poll_status[]" <%= !@status.blank? && @status.include?('0') ? 'checked' : '' %>> <% end %>
<label for="work_status_1" class="fl mr25">未提交(<%= un_commit_num @poll %>)</label>
<input id="work_status_2" class="magic-checkbox fl" type="checkbox" value="1" name="poll_status[]" <%= !@status.blank? && @status.include?('1') ? 'checked' : '' %>> <% if @poll.try(:polls_status) == 1 && @poll.publish_time %>
<label for="work_status_2" class="fl mr25">按时提交(<%= has_commit_num @poll %>)</label> <span class="color-grey fr font-12">将于&nbsp;<span class="color-orange font-12"><%= format_time(@poll.publish_time).to_s %></span>&nbsp;发布</span>
<% else %>
<span class="fr font-12 <%= @poll.try(:polls_status) == 3 ? 'color-grey' : 'color-orange' %>"><%= poll_curr_status[:time] %></span>
<% end %>
</li> </li>
<li class="clearfix mb5">
<span class="fl mr10 color-grey">分班情况:</span> <input id="poll_id" type="hidden" value="<%= @poll.id %>">
<span class="fl mr25"> <ul class="work_search_ul clearfix">
<a href="javascript:void(0);" id="poll_group_no_limit" class="<%= @group.blank? ? 'check_on' : '' %> pl5 pr5">不限</a> <li class="clearfix mb5">
</span> <span class="fl mr10 color-grey">答题状态:</span>
<div class="fl mb5" style="max-width: 83%"> <span class="fl mr25">
<% if @group_teacher %> <a href="javascript:void(0);" id="poll_status_no_limit" class="<%= @status.blank? ? 'check_on' : '' %> pl5 pr5">不限</a>
<% groups = @course.course_groups.where(:id => @member.teacher_course_groups.pluck(:course_group_id)) %> </span>
<% else %> <input id="work_status_1" class="magic-checkbox fl" type="checkbox" value="0" name="poll_status[]" <%= !@status.blank? && @status.include?('0') ? 'checked' : '' %> />
<% groups = @course.course_groups %> <label for="work_status_1" class="fl mr25">未提交(<%= un_commit_num @poll %>)</label>
<% end %> <input id="work_status_2" class="magic-checkbox fl" type="checkbox" value="1" name="poll_status[]" <%= !@status.blank? && @status.include?('1') ? 'checked' : '' %> />
<% groups.each do |group| %> <label for="work_status_2" class="fl mr25">按时提交(<%= has_commit_num @poll %>)</label>
<input id="group_<%= group.id %>" class="magic-checkbox fl" type="checkbox" value="<%= group.id %>" name="poll_group[]" <%= !@group.blank? && @group.include?(group.id) ? 'checked' : '' %>> </li>
<label for="group_<%= group.id %>" class="fl mr25"><%= group.name %>(<%= group.members.count %>)</label> <li class="clearfix mb5">
<% end %> <span class="fl mr10 color-grey">分班情况:</span>
<% if !@group_teacher %> <span class="fl mr25">
<input id="group_0" class="magic-checkbox fl" type="checkbox" value="0" name="poll_group[]"> <a href="javascript:void(0);" id="poll_group_no_limit" class="<%= @group.blank? ? 'check_on' : '' %> pl5 pr5">不限</a>
<label for="group_0" class="fl mr25">未分班(<%= @no_group_count %>)</label> </span>
<% end %> <div class="fl mb5" style="max-width: 83%">
<% if @group_teacher %>
<% groups = @course.course_groups.where(:id => @member.teacher_course_groups.pluck(:course_group_id)) %>
<% else %>
<% groups = @course.course_groups %>
<% end %>
<% groups.each do |group| %>
<input id="group_<%= group.id %>" class="magic-checkbox fl" type="checkbox" value="<%= group.id %>" name="poll_group[]" <%= !@group.blank? && @group.include?(group.id) ? 'checked' : '' %> />
<label for="group_<%= group.id %>" class="fl mr25"><%= group.name %>(<%= group.members.count %>)</label>
<% end %>
<% if !@group_teacher %>
<input id="group_0" class="magic-checkbox fl" type="checkbox" value="0" name="poll_group[]">
<label for="group_0" class="fl mr25">未分班(<%= @no_group_count %>)</label>
<% end %>
</div>
</li>
</ul>
<li class="clearfix mt5 mb10">
<div class="edu-find fr mr20 with20 pr">
<div class="edu-find-input">
<input type="text" class="with100 panel-box-sizing" maxlength="20" placeholder="姓名、学号关键字检索" value="<%= @name %>" id="student_user_name" />
<!--<i class="fa fa-close mr5 color-grey edu-close" onclick="colse_searchbox();"></i>-->
<span class="edu-close" onclick="clear_searchbox();" data-tip-down="关闭">×</span>
</div>
<a href="javascript:void(0);" onclick="SearchByName_poll();" class="edu-open font-16 color-grey"><i class="fa fa-search"></i></a>
</div> </div>
</li> </li>
</ul> </form>
<li class="clearfix mt5 mb10">
<div class="edu-find fr mr20 with20 pr">
<div class="edu-find-input">
<input type="text" class="with100 panel-box-sizing" maxlength="20" placeholder="姓名、学号关键字检索" value="<%= @name %>" id="student_user_name">
<!--<i class="fa fa-close mr5 color-grey edu-close" onclick="colse_searchbox();"></i>-->
<span class="edu-close" onclick="clear_searchbox();" data-tip-down="关闭">×</span>
</div>
<a href="javascript:void(0);" onclick="SearchByName_poll();" class="edu-open font-16 color-grey"><i class="fa fa-search"></i></a>
</div>
</li>
</form>
<% elsif User.current.member_of_course?(@poll.course) %> <% elsif User.current.member_of_course?(@poll.course) %>
<!--学生显示部分--> <!--学生显示部分-->
<div class="clearfix mb10"> <div class="clearfix mb10">
<p class="fl"> <p class="fl">
<% poll_user = @poll.poll_users.where(:user_id => User.current).first %> <% poll_user = @poll.poll_users.where(:user_id => User.current).first %>
<% if poll_user %> <% if poll_user %>
<% if poll_user.commit_status > 0 %> <% if poll_user.commit_status > 0 %>
<span class="edu-filter-btn edu-filter-btn-orange">你已提交</span> <span class="edu-filter-btn edu-filter-btn-orange">你已提交</span>
<% else %> <% else %>
<span class="edu-filter-btn edu-filter-btn-orange">你未提交</span> <span class="edu-filter-btn edu-filter-btn-orange">你未提交</span>
<% end %>
<% end %> <% end %>
<% end %> </p>
</p>
<p class="fr font-12 mt8"> <p class="fr font-12 mt8">
<span class="fr color-grey ml10"><%= @has_commit_count %>人已交)</span> <span class="fr color-grey ml10"><%= @has_commit_count %>人已交)</span>
<% if @poll.polls_status == 2 && @poll.end_time > Time.now %> <% if @poll.polls_status == 2 && @poll.end_time > Time.now %>
<% end_time = @poll.end_time.to_time.to_i %> <% end_time = @poll.end_time.to_time.to_i %>
<span class="fr color-grey">答题剩余时间:<span class="color-orange03"><%= (end_time - Time.now.to_i) / (24 * 60 * 60) %></span>天<span class="color-orange03"><%= ((end_time - Time.now.to_i) % (24 * 60 * 60)) / (60 * 60) %></span>小时<span class="color-orange03"><%= (((end_time - Time.now.to_i) % (24 * 60 * 60)) % (60 * 60)) / 60 %></span>分</span> <span class="fr color-grey">答题剩余时间:<span class="color-orange03"><%= (end_time - Time.now.to_i) / (24 * 60 * 60) %></span>天<span class="color-orange03"><%= ((end_time - Time.now.to_i) % (24 * 60 * 60)) / (60 * 60) %></span>小时<span class="color-orange03"><%= (((end_time - Time.now.to_i) % (24 * 60 * 60)) % (60 * 60)) / 60 %></span>分</span>
<% elsif @poll.polls_status == 3 %> <% elsif @poll.polls_status == 3 %>
<span class="color-orange ml30">提交已截止</span> <span class="color-orange ml30">提交已截止</span>
<% end %> <% end %>
</p> </p>
</div> </div>
<% end %> <% end %>
<div id="poll_student_work_list"> <div id="poll_student_work_list">
@ -196,71 +192,71 @@
<div class="clearfix"> <div class="clearfix">
<% @poll.poll_questions.includes(:poll_answers).each_with_index do |poll_question, i| %> <% @poll.poll_questions.includes(:poll_answers).each_with_index do |poll_question, i| %>
<div class="question_item_con font-14 user_bg_shadow bor-grey-e mb20 pt15"> <div class="question_item_con font-14 user_bg_shadow bor-grey-e mb20 pt15">
<div class="clearfix pl15 pr15"> <div class="clearfix pl15 pr15">
<p class="fl font-15" id="mao<%= poll_question.question_number %>"> <p class="fl font-15" id="mao<%= poll_question.question_number %>">
<% if poll_question.try(:is_necessary) == 1 %> <% if poll_question.try(:is_necessary) == 1 %>
<span class="color-orange03">*</span> <span class="color-orange03">*</span>
<% end %> <% end %>
第<%= poll_question.question_number %> 第<%= poll_question.question_number %>
题:<span class="color-orange03">[<%= poll_question.question_type_name %>]</span> 题:<span class="color-orange03">[<%= poll_question.question_type_name %>]</span>
<% if poll_question.question_type == 2 && (poll_question.min_choices != 0 || poll_question.max_choices != 0) %> <% if poll_question.question_type == 2 && (poll_question.min_choices != 0 || poll_question.max_choices != 0) %>
<span class="ml10">可选 <%= poll_question.min_choices %> - <%= poll_question.max_choices %> 项</span> <span class="ml10">可选 <%= poll_question.min_choices %> - <%= poll_question.max_choices %> 项</span>
<% end %> <% end %>
</p> </p>
</div>
<div class="pl15 pr15 justify upload_img table_maxWidth break_word"><%= poll_question.question_title.html_safe %></div>
<% case poll_question.question_type %>
<% when 1 %>
<div class="pl15 pr15 mb15">
<% poll_answers = poll_question.poll_answers %>
<% poll_answers.each_with_index do |poll_answer, index| %>
<li class="clearfix">
<% if poll_answer.answer_text != '' %>
<input class="magic-radio fl mt5 magic-checkbox_show" id="poll_<%= poll_answer.id %>_poll_answer_id" type="radio">
<label class="fl color-grey3" for="poll_<%= poll_answer.id %>_poll_answer_id"><%= poll_answer.answer_text %></label>
<% else %>
<span class="fl mr5">
<input class="ml-3 mr5 magic-radio" id="sx_<%= poll_answer.id %>" name="<%= poll_question %>" value="" type="radio">
<label for="sx_<%= poll_answer.id %>">其它</label>
</span>
<input type="text" readonly class="fl other_input with90 mt3"/>
<% end %>
</li>
<% end %>
</div> </div>
<% when 2 %> <div class="pl15 pr15 justify upload_img table_maxWidth break_word"><%= poll_question.question_title.html_safe %></div>
<div class="pl15 pr15 mb15"> <% case poll_question.question_type %>
<% poll_answers = poll_question.poll_answers %> <% when 1 %>
<% poll_answers.each_with_index do |poll_answer, index| %> <div class="pl15 pr15 mb15">
<li class="clearfix"> <% poll_answers = poll_question.poll_answers %>
<% if poll_answer.answer_text != '' %> <% poll_answers.each_with_index do |poll_answer, index| %>
<input class="magic-checkbox fl mt5 magic-checkbox_show" id="poll_<%= poll_answer.id %>_poll_answer_id" type="checkbox"> <li class="clearfix">
<label class="fl color-grey3" for="poll_<%= poll_answer.id %>_poll_answer_id"><%= poll_answer.answer_text %></label> <% if poll_answer.answer_text != '' %>
<% else %> <input class="magic-radio fl mt5 magic-checkbox_show" id="poll_<%= poll_answer.id %>_poll_answer_id" type="radio">
<span class="fl mr5"> <label class="fl color-grey3" for="poll_<%= poll_answer.id %>_poll_answer_id"><%= poll_answer.answer_text %></label>
<input class="ml-3 mr5 magic-checkbox" id="sx_<%= poll_answer.id %>" name="<%= poll_question %>" value="" type="checkbox"> <% else %>
<label for="sx_<%= poll_answer.id %>">其它</label> <span class="fl mr5">
</span> <input class="ml-3 mr5 magic-radio" id="sx_<%= poll_answer.id %>" name="<%= poll_question %>" value="" type="radio">
<input type="text" readonly class="fl other_input with90 mt3"/> <label for="sx_<%= poll_answer.id %>">其它</label>
</span>
<input type="text" readonly class="fl other_input with90 mt3"/>
<% end %>
</li>
<% end %> <% end %>
</li> </div>
<% end %> <% when 2 %>
</div> <div class="pl15 pr15 mb15">
<% when 3 %> <% poll_answers = poll_question.poll_answers %>
<div class="pl15 pr15 mb15"> <% poll_answers.each_with_index do |poll_answer, index| %>
<textarea class="task-height-150 with100 pl15" style="box-sizing: border-box" placeholder="在此填入答案" disabled></textarea> <li class="clearfix">
</div> <% if poll_answer.answer_text != '' %>
<% end %> <input class="magic-checkbox fl mt5 magic-checkbox_show" id="poll_<%= poll_answer.id %>_poll_answer_id" type="checkbox"/>
</div> <label class="fl color-grey3" for="poll_<%= poll_answer.id %>_poll_answer_id"><%= poll_answer.answer_text %></label>
<% else %>
<span class="fl mr5">
<input class="ml-3 mr5 magic-checkbox" id="sx_<%= poll_answer.id %>" name="<%= poll_question %>" value="" type="checkbox"/>
<label for="sx_<%= poll_answer.id %>">其它</label>
</span>
<input type="text" readonly class="fl other_input with90 mt3"/>
<% end %>
</li>
<% end %>
</div>
<% when 3 %>
<div class="pl15 pr15 mb15">
<textarea class="task-height-150 with100 pl15" style="box-sizing: border-box" placeholder="在此填入答案" disabled></textarea>
</div>
<% end %>
</div>
<% end %> <% end %>
</div> </div>
</div> </div>
</div> </div>
<div id="edu-tab-con-4" class="user_bg_shadow bor-grey-e undis"> <div id="edu-tab-con-4" class="user_bg_shadow bor-grey-e undis edu-back-white">
<%= render :partial => "poll_setting" %> <%= render :partial => "poll_setting" %>
</div>
</div> </div>
</div>
</div> </div>
<script> <script>
$(function () { $(function () {

@ -101,7 +101,7 @@
<% end %> <% end %>
<a href="javascript:void(0);" class="fr user_default_btn edu-greyback-btn mr15 font-18">已关闭</a> <a href="javascript:void(0);" class="fr user_default_btn edu-greyback-btn mr15 font-18">已关闭</a>
<% end %> <% end %>
<% if @shixun.can_copy %> <% if @shixun.can_copy && User.current.logged? %>
<div href="javascript:void(0)" class="fr user_default_btn user_blue_btn mr20" style="display: flex;"> <div href="javascript:void(0)" class="fr user_default_btn user_blue_btn mr20" style="display: flex;">
<% if User.current.mail.blank? %> <% if User.current.mail.blank? %>
<a data-tip-down = "基于这个实训修改形成新的实训" <a data-tip-down = "基于这个实训修改形成新的实训"

@ -86,6 +86,7 @@
<% end %> <% end %>
</p> </p>
<% if User.current.logged? %>
<div class="homepagePostSetting" style="right: 4px;top: 5px;display: block"> <div class="homepagePostSetting" style="right: 4px;top: 5px;display: block">
<ul> <ul>
<li class="edu-position edu-position-hidebox"> <li class="edu-position edu-position-hidebox">
@ -105,6 +106,8 @@
</li> </li>
</ul> </ul>
</div> </div>
<% end %>
</div> </div>
</div> </div>
<% end %> <% end %>

@ -600,7 +600,7 @@ RedmineApp::Application.routes.draw do ## oauth相关
get 'create_departments' get 'create_departments'
post 'add_department' post 'add_department'
get 'shixun_feedback' get 'shixun_feedback'
get 'shixun_feedback_message' match 'shixun_feedback_message', :via => [:get, :post]
get 'leave_message' get 'leave_message'
get 'messages_list' get 'messages_list'
get 'course_messages_list' get 'course_messages_list'

@ -0,0 +1,8 @@
class MigratePollQuestionType < ActiveRecord::Migration
def up
change_column :poll_questions, :question_title, :text
end
def down
end
end

@ -17,8 +17,8 @@
"./static/js/15.0dcec662.chunk.js.map": "./static/js/15.0dcec662.chunk.js.map", "./static/js/15.0dcec662.chunk.js.map": "./static/js/15.0dcec662.chunk.js.map",
"./static/js/16.e8e3aa00.chunk.js": "./static/js/16.e8e3aa00.chunk.js", "./static/js/16.e8e3aa00.chunk.js": "./static/js/16.e8e3aa00.chunk.js",
"./static/js/16.e8e3aa00.chunk.js.map": "./static/js/16.e8e3aa00.chunk.js.map", "./static/js/16.e8e3aa00.chunk.js.map": "./static/js/16.e8e3aa00.chunk.js.map",
"./static/js/17.9edde574.chunk.js": "./static/js/17.9edde574.chunk.js", "./static/js/17.709dcd2a.chunk.js": "./static/js/17.709dcd2a.chunk.js",
"./static/js/17.9edde574.chunk.js.map": "./static/js/17.9edde574.chunk.js.map", "./static/js/17.709dcd2a.chunk.js.map": "./static/js/17.709dcd2a.chunk.js.map",
"./static/js/18.5fe45ac4.chunk.js": "./static/js/18.5fe45ac4.chunk.js", "./static/js/18.5fe45ac4.chunk.js": "./static/js/18.5fe45ac4.chunk.js",
"./static/js/18.5fe45ac4.chunk.js.map": "./static/js/18.5fe45ac4.chunk.js.map", "./static/js/18.5fe45ac4.chunk.js.map": "./static/js/18.5fe45ac4.chunk.js.map",
"./static/js/19.5f9a9263.chunk.js": "./static/js/19.5f9a9263.chunk.js", "./static/js/19.5f9a9263.chunk.js": "./static/js/19.5f9a9263.chunk.js",
@ -67,8 +67,8 @@
"./static/js/9.e77edf45.chunk.js.map": "./static/js/9.e77edf45.chunk.js.map", "./static/js/9.e77edf45.chunk.js.map": "./static/js/9.e77edf45.chunk.js.map",
"main.css": "./static/css/main.c95e49c6.css", "main.css": "./static/css/main.c95e49c6.css",
"main.css.map": "./static/css/main.c95e49c6.css.map", "main.css.map": "./static/css/main.c95e49c6.css.map",
"main.js": "./static/js/main.533264d5.js", "main.js": "./static/js/main.21bade1d.js",
"main.js.map": "./static/js/main.533264d5.js.map", "main.js.map": "./static/js/main.21bade1d.js.map",
"static/media/ERASBD.ttf": "static/media/ERASBD.d5213044.ttf", "static/media/ERASBD.ttf": "static/media/ERASBD.d5213044.ttf",
"static/media/background1.png": "static/media/background1.a34df396.png", "static/media/background1.png": "static/media/background1.a34df396.png",
"static/media/background2.png": "static/media/background2.22ee659e.png", "static/media/background2.png": "static/media/background2.22ee659e.png",

@ -1 +1 @@
<!doctype html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width,initial-scale=1,shrink-to-fit=no"><meta name="theme-color" content="#000000"><meta name="renderer" content="webkit"/><meta name="force-rendering" content="webkit"/><meta http-equiv="X-UA-Compatible" content="IE=edge"/><link rel="manifest" href="/manifest.json"><link rel="shortcut icon" href="/favicon.ico"><title>Educoder</title><script type="text/javascript">window.__isR=!0</script><link rel="stylesheet" href="/css/css_min_all.css"><link rel="stylesheet" href="http://testbdweb.educoder.net/assets/iconfont/iconfont.css"><link href="/react/build/./static/css/main.c95e49c6.css" rel="stylesheet"></head><body><noscript>You need to enable JavaScript to run this app.</noscript><div id="md_div" style="display:none"></div><div id="root" class="page -layout-v -fit"></div><div id="picture_display" style="display:none"></div><script type="text/javascript" src="/js/js_min_all.js"></script><script type="text/javascript" src="http://testbdweb.educoder.net/assets/kindeditor/kindeditor.js"></script><script type="text/javascript" src="/js/create_kindeditor.js"></script><script type="text/javascript" src="http://testbdweb.educoder.net/javascripts/educoder/edu_application.js"></script><script type="text/javascript" src="/react/build/./static/js/main.533264d5.js"></script></body></html> <!doctype html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width,initial-scale=1,shrink-to-fit=no"><meta name="theme-color" content="#000000"><meta name="renderer" content="webkit"/><meta name="force-rendering" content="webkit"/><meta http-equiv="X-UA-Compatible" content="IE=edge"/><link rel="manifest" href="/manifest.json"><link rel="shortcut icon" href="/favicon.ico"><title>Educoder</title><script type="text/javascript">window.__isR=!0</script><link rel="stylesheet" href="/css/css_min_all.css"><link rel="stylesheet" href="http://testbdweb.educoder.net/assets/iconfont/iconfont.css"><link href="/react/build/./static/css/main.c95e49c6.css" rel="stylesheet"></head><body><noscript>You need to enable JavaScript to run this app.</noscript><div id="md_div" style="display:none"></div><div id="root" class="page -layout-v -fit"></div><div id="picture_display" style="display:none"></div><script type="text/javascript" src="/js/js_min_all.js"></script><script type="text/javascript" src="http://testbdweb.educoder.net/assets/kindeditor/kindeditor.js"></script><script type="text/javascript" src="/js/create_kindeditor.js"></script><script type="text/javascript" src="http://testbdweb.educoder.net/javascripts/educoder/edu_application.js"></script><script type="text/javascript" src="/react/build/./static/js/main.21bade1d.js"></script></body></html>

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

@ -660,10 +660,11 @@ class ecCourseEvaluations extends Component {
let{checkevalue}=this.state; let{checkevalue}=this.state;
let ec_course_id=this.props.match.params.ec_course_id; let ec_course_id=this.props.match.params.ec_course_id;
let tuser_id=this.props.current_user.user_id;
let Url =`/ec_courses/`+ec_course_id+`/correlation_course.json`; let Url =`/ec_courses/`+ec_course_id+`/correlation_course.json`;
axios.post(Url,{ axios.post(Url,{
course_id:checkevalue, course_id:checkevalue,
user_id:this.props.current_user.user_id user_id:tuser_id
},{ },{
withCredentials: true withCredentials: true
} }
@ -701,10 +702,11 @@ class ecCourseEvaluations extends Component {
if(e.keyCode == 13){ if(e.keyCode == 13){
let {assclassvalue}=this.state; let {assclassvalue}=this.state;
let ec_course_id=this.props.match.params.ec_course_id; let ec_course_id=this.props.match.params.ec_course_id;
let tuser_id=this.props.current_user.user_id;
let Url =`/ec_courses/`+ec_course_id+`/search_courses.json`; let Url =`/ec_courses/`+ec_course_id+`/search_courses.json`;
axios.post(Url,{ axios.post(Url,{
search:assclassvalue, search:assclassvalue,
user_id:this.props.current_user.user_id user_id:tuser_id
},{ },{
withCredentials: true withCredentials: true
} }
@ -721,10 +723,11 @@ class ecCourseEvaluations extends Component {
assclassnamesearch=()=>{ assclassnamesearch=()=>{
let {assclassvalue}=this.state; let {assclassvalue}=this.state;
let ec_course_id=this.props.match.params.ec_course_id; let ec_course_id=this.props.match.params.ec_course_id;
let tuser_id=this.props.current_user.user_id;
let Url =`/ec_courses/`+ec_course_id+`/search_courses.json`; let Url =`/ec_courses/`+ec_course_id+`/search_courses.json`;
axios.post(Url,{ axios.post(Url,{
search:assclassvalue, search:assclassvalue,
user_id:this.props.current_user.user_id user_id:tuser_id
},{ },{
withCredentials: true withCredentials: true
} }
@ -870,8 +873,8 @@ class ecCourseEvaluations extends Component {
{/*课程考核方式与数据来源*/} {/*课程考核方式与数据来源*/}
{/* <span className="fl font-18 courseSystem"></span> */} {/* <span className="fl font-18 courseSystem"></span> */}
{/* <a href="javascript:void(0)" className="fr white-btn edu-blueback-btn mt4">导出培养目标</a> */} {/* <a href="javascript:void(0)" className="fr white-btn edu-blueback-btn mt4">导出培养目标</a> */}
<a class="white-btn edu-blueline-btn fr mr10 mt2 associatedclass" onClick={this.associatedclass} style={{display:course_url!=""&&ecmanager===true?"block":"none"}}>关联课堂</a> <a class="white-btn edu-blueline-btn fr mr10 mt2 associatedclass" onClick={this.associatedclass} style={{display:course_url===""&&ecmanager===true?"block":"none"}}>关联课堂</a>
<a class="white-btn edu-blueline-btn fr mr10 mt2 associatedclass" onClick={this.deleteassociatedclass} style={{display:course_url===""||ecmanager===true?"none":"block"}}>取消关联</a> <a class="white-btn edu-blueline-btn fr mr10 mt2 associatedclass" onClick={this.deleteassociatedclass} style={{display:course_url!=""&&ecmanager===true?"block":"none"}}>取消关联</a>
<span className="Importclassroomdata" style={{top: '22px',display:ecmanager===false?"none":""}}> <span className="Importclassroomdata" style={{top: '22px',display:ecmanager===false?"none":""}}>
<a className="white-btn edu-blueback-btn fr mb10 mr10" target="_blank" href={'/ec_courses/'+ec_course_id+'/export_ec_course_targets?format=xls'}>导出考核方法</a> <a className="white-btn edu-blueback-btn fr mb10 mr10" target="_blank" href={'/ec_courses/'+ec_course_id+'/export_ec_course_targets?format=xls'}>导出考核方法</a>
</span> </span>

Loading…
Cancel
Save