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
# if euser.present? # 开通过业务
# # 获取用户的套餐信息
# e_service = euser.ecloud_services.where("opttype != 1")
# # 如果用户开通过服务
# if e_service.present?
# if e_service.count >1 # 说明有重复开通过业务
# else
# code = e_service.first.try(:code)
#
# end
# end
# else
# false # 没开通过服务,或者服务被禁用则不允许访问
# end
#
#
#
#
# if e_service.count > 1 # 说明有重复订购过套餐
# else
# code = e_service.try(:code)
# end
# service_count = euser.ecloud_services.where("opttype != 1").try(:code)
#
# end
# 如果不是Ecloud过来的用户则不改变用户的使用状态及权限按现有模式即可 # 如果不是Ecloud过来的用户则不改变用户的使用状态及权限按现有模式即可
def ecloud_auth
euser = EcloudUser.where("userid =? and opttype not in(3, 5)", User.current.id).first
if euser.present? # 开通过业务
# 获取用户的套餐信息
e_services = euser.ecloud_services.where("opttype != 1").order("ecloud_services.code desc")
# 如果用户开通过服务
if e_services.present?
if e_services.count > 1 # 说明有重复开通过业务
# 开通多业务的话以最大的套餐排序如果最大套餐还可以用则直接返回true如果最大套餐不能用则轮询返回直到找到可用的套餐
e_services.each do |e_service|
# 使用期限内套餐才有效
ecloud_services_auth(e_service.code, e_service.begintime, e_service.endtime)
end
else
# 先看套餐,再看时间区间
e_service = e_services.first
ecloud_services_auth(e_service.code, e_service.begintime, e_service.endtime)
end
else
false # 没开通过服务,或者服务被禁用则不允许访问
end
end
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
@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") @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,9 +340,6 @@ 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
result ? false : true
else
if User.current.manager_of_shixun?(shixun) if User.current.manager_of_shixun?(shixun)
result ? false : true result ? false : true
else else
@ -351,7 +348,6 @@ module ApplicationHelper
end end
end end
end end
end
# 判断TPM的代码是否被修改了 # 判断TPM的代码是否被修改了
# 判断依据是看tpm的最新提交记录和tpi数据库中存储的commit_id是否一致 # 判断依据是看tpm的最新提交记录和tpi数据库中存储的commit_id是否一致
@ -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 %>

@ -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,10 +5,6 @@
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">
@ -24,7 +20,7 @@
</p> </p>
<%= link_to "返回", poll_index_path(:course_id => @course.id), :class => "fr font-12 mr15 mt3 color-grey" %> <%= link_to "返回", poll_index_path(:course_id => @course.id), :class => "fr font-12 mr15 mt3 color-grey" %>
</div> </div>
<div class="edu-tab clearfix mb20"> <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>
@ -78,7 +74,7 @@
<% 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 %>
@ -104,9 +100,9 @@
<span class="fl mr25"> <span class="fl mr25">
<a href="javascript:void(0);" id="poll_status_no_limit" class="<%= @status.blank? ? 'check_on' : '' %> pl5 pr5">不限</a> <a href="javascript:void(0);" id="poll_status_no_limit" class="<%= @status.blank? ? 'check_on' : '' %> pl5 pr5">不限</a>
</span> </span>
<input id="work_status_1" class="magic-checkbox fl" type="checkbox" value="0" name="poll_status[]" <%= !@status.blank? && @status.include?('0') ? 'checked' : '' %>> <input id="work_status_1" class="magic-checkbox fl" type="checkbox" value="0" name="poll_status[]" <%= !@status.blank? && @status.include?('0') ? 'checked' : '' %> />
<label for="work_status_1" class="fl mr25">未提交(<%= un_commit_num @poll %>)</label> <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' : '' %>> <input id="work_status_2" class="magic-checkbox fl" type="checkbox" value="1" name="poll_status[]" <%= !@status.blank? && @status.include?('1') ? 'checked' : '' %> />
<label for="work_status_2" class="fl mr25">按时提交(<%= has_commit_num @poll %>)</label> <label for="work_status_2" class="fl mr25">按时提交(<%= has_commit_num @poll %>)</label>
</li> </li>
<li class="clearfix mb5"> <li class="clearfix mb5">
@ -121,7 +117,7 @@
<% groups = @course.course_groups %> <% groups = @course.course_groups %>
<% end %> <% end %>
<% groups.each do |group| %> <% 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' : '' %>> <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> <label for="group_<%= group.id %>" class="fl mr25"><%= group.name %>(<%= group.members.count %>)</label>
<% end %> <% end %>
<% if !@group_teacher %> <% if !@group_teacher %>
@ -134,7 +130,7 @@
<li class="clearfix mt5 mb10"> <li class="clearfix mt5 mb10">
<div class="edu-find fr mr20 with20 pr"> <div class="edu-find fr mr20 with20 pr">
<div class="edu-find-input"> <div class="edu-find-input">
<input type="text" class="with100 panel-box-sizing" maxlength="20" placeholder="姓名、学号关键字检索" value="<%= @name %>" id="student_user_name"> <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>--> <!--<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> <span class="edu-close" onclick="clear_searchbox();" data-tip-down="关闭">×</span>
</div> </div>
@ -235,11 +231,11 @@
<% poll_answers.each_with_index do |poll_answer, index| %> <% poll_answers.each_with_index do |poll_answer, index| %>
<li class="clearfix"> <li class="clearfix">
<% if poll_answer.answer_text != '' %> <% if poll_answer.answer_text != '' %>
<input class="magic-checkbox fl mt5 magic-checkbox_show" id="poll_<%= poll_answer.id %>_poll_answer_id" type="checkbox"> <input class="magic-checkbox fl mt5 magic-checkbox_show" id="poll_<%= poll_answer.id %>_poll_answer_id" type="checkbox"/>
<label class="fl color-grey3" for="poll_<%= poll_answer.id %>_poll_answer_id"><%= poll_answer.answer_text %></label> <label class="fl color-grey3" for="poll_<%= poll_answer.id %>_poll_answer_id"><%= poll_answer.answer_text %></label>
<% else %> <% else %>
<span class="fl mr5"> <span class="fl mr5">
<input class="ml-3 mr5 magic-checkbox" id="sx_<%= poll_answer.id %>" name="<%= poll_question %>" value="" type="checkbox"> <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> <label for="sx_<%= poll_answer.id %>">其它</label>
</span> </span>
<input type="text" readonly class="fl other_input with90 mt3"/> <input type="text" readonly class="fl other_input with90 mt3"/>
@ -257,7 +253,7 @@
</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>

@ -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