Merge branch 'cxt_course' of https://git.trustie.net/jacknudt/trustieforge into cxt_course

cxt_course
Tim 9 years ago
commit 4b62a39b15

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

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

@ -67,12 +67,15 @@ class AdminController < ApplicationController
def excellent_all_courses def excellent_all_courses
name = params[:name] name = params[:name]
@order = "" @order = ""
if params[:order] == 'asc' @sort = ""
courses = Course.find_by_sql("SELECT c.*,count(c.id) FROM courses c,course_activities ca WHERE c.id = ca.course_id AND c.name like '%#{name}%' GROUP BY c.id ORDER BY count(c.id) asc, c.id desc") if params[:sort] && (params[:order] == 'act')
courses = Course.find_by_sql("SELECT c.*,count(c.id) FROM courses c,course_activities ca WHERE c.id = ca.course_id AND c.name like '%#{name}%' GROUP BY c.id ORDER BY count(c.id) #{params[:sort]}, c.id desc")
@order = params[:order] @order = params[:order]
elsif params[:order] == 'desc' @sort = params[:sort]
courses = Course.find_by_sql("SELECT c.*,count(c.id) FROM courses c,course_activities ca WHERE c.id = ca.course_id AND c.name like '%#{name}%' GROUP BY c.id ORDER BY count(c.id) DESC, c.id desc") elsif params[:sort] && (params[:order] == 'time')
courses = Course.find_by_sql("SELECT * FROM courses WHERE name like '%#{name}%' ORDER BY time #{params[:sort]},id desc")
@order = params[:order] @order = params[:order]
@sort = params[:sort]
else else
courses = Course.like(name).order('created_at desc') courses = Course.like(name).order('created_at desc')
end end
@ -99,6 +102,22 @@ class AdminController < ApplicationController
end end
end end
#取消精品
def cancel_excellent_course
@course = Course.find params[:id]
unless @course.nil?
if @course.is_excellent == 1 || @course.excellent_option == 1
@course.update_column('is_excellent', 0)
@course.update_column('excellent_option', 0)
end
end
respond_to do |format|
format.html{
redirect_to excellent_courses_url
}
end
end
#管理员界面课程资源列表 #管理员界面课程资源列表
def course_resource_list def course_resource_list

@ -1096,7 +1096,8 @@ class StudentWorkController < ApplicationController
all_student_ids = "(" + pro.members.map{|member| member.user_id}.join(",") + ")" all_student_ids = "(" + pro.members.map{|member| member.user_id}.join(",") + ")"
end end
all_students = User.where("id in #{all_student_ids}") all_students = User.where("id in #{all_student_ids}")
@commit_student_ids = @homework.student_work_projects.map{|student| student.user_id} student_work_id = @homework.student_work_projects.where("user_id=?",User.current.id).empty? ? -1 : @homework.student_work_projects.where("user_id=?",User.current.id).first.student_work_id
@commit_student_ids = @homework.student_work_projects.where("student_work_id != #{student_work_id}").map{|student| student.user_id}
@users = searchstudent_by_name all_students,name @users = searchstudent_by_name all_students,name
respond_to do |format| respond_to do |format|
format.js format.js
@ -1115,6 +1116,20 @@ class StudentWorkController < ApplicationController
end end
end end
def get_user_infor
req = Hash.new(false)
user = User.where("id = #{params[:user_id].to_i}").first
if user
req[:id] = user.id
req[:name] = user.show_name
req[:student_id] = user.user_extensions.student_id
req[:valid] = true
else
req[:valid] = false
end
render :json => req
end
private private
def searchstudent_by_name users, name def searchstudent_by_name users, name
mems = [] mems = []

@ -0,0 +1,23 @@
class SyllabusesController < ApplicationController
before_filter :is_logged, :only => [:index, :show]
before_filter :find_syllabus, :only => [:show]
def index
user = User.current
@syllabuses = user.syllabuses
end
def show
@courses = @syllabus.courses
end
private
def find_syllabus
@syllabus = Syllabus.find params[:id]
end
def is_logged
redirect_to signin_path unless User.current.logged?
end
end

@ -130,8 +130,11 @@ class UsersController < ApplicationController
onclick_time = User.current.onclick_time.onclick_time onclick_time = User.current.onclick_time.onclick_time
messages.each do |message_all| messages.each do |message_all|
# 未读的消息存放在数组 # 未读的消息存放在数组
if (message_all.message_type != "SystemMessage"&& !message_all.message.nil? && message_all.message.viewed == 0) || (message_all.message_type == "SystemMessage"&& !message_all.message.nil? && message_all.message.created_at > onclick_time) mess = message_all.message
@message_alls << message_all.message if (message_all.message_type != "SystemMessage"&& !mess.nil? && (mess.viewed == 0 || !mess.viewed)) || (message_all.message_type == "SystemMessage"&& !mess.nil? && mess.created_at > onclick_time)
unless (message_all.message_type == 'CourseMessage' && mess && mess.course.is_delete == 1)
@message_alls << mess
end
break if @message_alls.length == 5 break if @message_alls.length == 5
end end
end end
@ -154,33 +157,41 @@ class UsersController < ApplicationController
update_message_viewed(@user) update_message_viewed(@user)
end end
# @new_message_count = forge_querys.count + forum_querys.count + course_querys.count + user_querys.count # @new_message_count = forge_querys.count + forum_querys.count + course_querys.count + user_querys.count
courses = @user.courses.where("is_delete = 1")
course_ids = courses.empty? ? "(-1)" : "(" + courses.map{|course| course.id}.join(",") + ")"
case params[:type] case params[:type]
when nil when nil
# 系统消息为管理员发送,我的消息中包含有系统消息 # 系统消息为管理员发送,我的消息中包含有系统消息
@message_alls = [] @message_alls = []
messages = MessageAll.where("(user_id =? and message_type !=?) or message_type =?" ,@user.id, "SystemMessage", "SystemMessage").includes(:message).order("created_at desc") messages = MessageAll.where("(user_id =? and message_type !=?) or message_type =?" ,@user.id, "SystemMessage", "SystemMessage").includes(:message).order("created_at desc")
messages.each do |message_all| messages.each do |message_all|
@message_alls << message_all.message mess = message_all.message
unless (message_all.message_type == 'CourseMessage' && mess && mess.course.is_delete == 1)
@message_alls << mess
end
end end
when 'unviewed' when 'unviewed'
@message_alls = [] @message_alls = []
messages = MessageAll.where("user_id =?", @user.id).includes(:message).order("created_at desc") messages = MessageAll.where("message_alls.user_id =?", @user.id).includes(:message).order("created_at desc")
messages.each do |message_all| messages.each do |message_all|
# 在点击或者刷新消息列表后未读的消息存放在数组 # 在点击或者刷新消息列表后未读的消息存放在数组
if message_all.message_type != "SystemMessage"&& !message_all.message.nil? && message_all.message.viewed == 0 mess = message_all.message
@message_alls << message_all.message if message_all.message_type != "SystemMessage"&& !mess.nil? && (mess.viewed == 0 || !mess.viewed)
unless (message_all.message_type == 'CourseMessage' && mess && mess.course.is_delete == 1)
@message_alls << mess
end
end end
end end
#课程相关消息 #课程相关消息
when 'homework' when 'homework'
@message_alls = CourseMessage.where("course_message_type in ('HomeworkCommon','StudentWorksScore','JournalsForMessage','StudentWork','Exercise') and user_id =?", @user.id).order("created_at desc") @message_alls = CourseMessage.where("course_message_type in ('HomeworkCommon','StudentWorksScore','JournalsForMessage','StudentWork','Exercise') and user_id =? and course_id NOT IN #{course_ids}", @user.id).order("created_at desc")
when 'course_message' when 'course_message'
@message_alls = CourseMessage.where("course_message_type =? and user_id =?", "Message", @user.id).order("created_at desc") @message_alls = CourseMessage.where("course_message_type =? and user_id =? and course_id NOT IN #{course_ids}", "Message", @user.id).order("created_at desc")
when 'course_news' when 'course_news'
# 课程通知包含发布的通知和回复的通知 # 课程通知包含发布的通知和回复的通知
@message_alls = CourseMessage.where("course_message_type in ('News', 'Comment') and user_id =?", @user.id).order("created_at desc") @message_alls = CourseMessage.where("course_message_type in ('News', 'Comment') and user_id =? and course_id NOT IN #{course_ids}", @user.id).order("created_at desc")
when 'poll' when 'poll'
@message_alls = CourseMessage.where("course_message_type =? and user_id =?", "Poll", @user.id).order("created_at desc") @message_alls = CourseMessage.where("course_message_type =? and user_id =? and course_id NOT IN #{course_ids}", "Poll", @user.id).order("created_at desc")
#项目相关消息 #项目相关消息
when 'issue' when 'issue'
@message_alls = ForgeMessage.where("forge_message_type in ('Issue', 'Journal') and user_id =?" , @user.id).order("created_at desc") @message_alls = ForgeMessage.where("forge_message_type in ('Issue', 'Journal') and user_id =?" , @user.id).order("created_at desc")

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

@ -147,7 +147,9 @@ module UsersHelper
# 统计未读消息数 # 统计未读消息数
def unviewed_message(user) def unviewed_message(user)
course_count = CourseMessage.where("user_id =? and viewed =?", user, 0).count courses = user.courses.where("is_delete = 1")
course_ids = courses.empty? ? "(-1)" : "(" + courses.map{|course| course.id}.join(",") + ")"
course_count = CourseMessage.where("user_id =? and viewed =? and course_id not in #{course_ids}", user, 0).count
forge_count = ForgeMessage.where("user_id =? and viewed =?", user, 0).count forge_count = ForgeMessage.where("user_id =? and viewed =?", user, 0).count
org_count = OrgMessage.where("user_id =? and viewed =?", user, 0).count org_count = OrgMessage.where("user_id =? and viewed =?", user, 0).count
user_feedback_count = UserFeedbackMessage.where("user_id =? and viewed =?", user, 0).count user_feedback_count = UserFeedbackMessage.where("user_id =? and viewed =?", user, 0).count

@ -24,6 +24,7 @@ class Course < ActiveRecord::Base
#belongs_to :project, :class_name => 'Course', :foreign_key => :extra, primary_key: :identifier #belongs_to :project, :class_name => 'Course', :foreign_key => :extra, primary_key: :identifier
belongs_to :teacher, :class_name => 'User', :foreign_key => :tea_id # 定义一个方法teacher该方法通过tea_id来调用User表 belongs_to :teacher, :class_name => 'User', :foreign_key => :tea_id # 定义一个方法teacher该方法通过tea_id来调用User表
belongs_to :school, :class_name => 'School', :foreign_key => :school_id #定义一个方法school该方法通过school_id来调用School表 belongs_to :school, :class_name => 'School', :foreign_key => :school_id #定义一个方法school该方法通过school_id来调用School表
belongs_to :syllabus
# has_many :bid # has_many :bid
has_many :members, :include => [:principal, :roles], :conditions => "#{Principal.table_name}.type='User' AND #{Principal.table_name}.status=#{Principal::STATUS_ACTIVE}" has_many :members, :include => [:principal, :roles], :conditions => "#{Principal.table_name}.type='User' AND #{Principal.table_name}.status=#{Principal::STATUS_ACTIVE}"
has_many :memberships, :class_name => 'Member' has_many :memberships, :class_name => 'Member'

@ -0,0 +1,5 @@
class Syllabus < ActiveRecord::Base
belongs_to :user
has_many :courses
attr_accessible :description, :title
end

@ -90,6 +90,7 @@ class User < Principal
has_many :homework_users has_many :homework_users
has_many :homework_attaches, :through => :homework_users has_many :homework_attaches, :through => :homework_users
has_many :homework_evaluations has_many :homework_evaluations
has_many :syllabuses, :dependent => :destroy
#问卷相关关关系 #问卷相关关关系
has_many :poll_users, :dependent => :destroy has_many :poll_users, :dependent => :destroy
has_many :poll_votes, :dependent => :destroy has_many :poll_votes, :dependent => :destroy

@ -27,6 +27,9 @@
<td class="center"> <td class="center">
<%= course.course_activities.count%> <%= course.course_activities.count%>
</td> </td>
<td class="center">
<%= course.time %>
</td>
<td class="buttons"> <td class="buttons">
<%= link_to( course.is_excellent == 1 || course.excellent_option == 1 ? "取消精品" : "设为精品", { :controller => 'admin', :action => 'set_excellent_course', :id => course.id },:remote=>true, :class => 'icon-del') %> <%= link_to( course.is_excellent == 1 || course.excellent_option == 1 ? "取消精品" : "设为精品", { :controller => 'admin', :action => 'set_excellent_course', :id => course.id },:remote=>true, :class => 'icon-del') %>
</td> </td>

@ -45,11 +45,14 @@
<th style="width: 25px;"> <th style="width: 25px;">
资源数 资源数
</th> </th>
<th style="width: 50px;"> <th style="width: 30px;">
帖子数 帖子数
</th> </th>
<th style="width: 50px;" class = "<%= @order == 'desc' ? 'st_up' : (@order == 'asc' ? 'st_down' : '') %>"> <th style="width: 30px;" class = "<%= @order == 'act' ? (@sort == 'desc' ? 'st_up' : (@sort == 'asc' ? 'st_down' : '')) : '' %>">
<%=link_to '动态数', excellent_all_courses_path(:order=> @order == "desc" ? 'asc' : 'desc') %> <%=link_to '动态数', excellent_all_courses_path(:sort=> @sort == "desc" ? 'asc' : 'desc', :order => 'act') %>
</th>
<th style="width: 40px;" class = "<%= @order == 'time' ? (@sort == 'desc' ? 'st_up' : (@sort == 'asc' ? 'st_down' : '')) : '' %>">
<%=link_to '开课学期', excellent_all_courses_path(:sort=> @sort == "desc" ? 'asc' : 'desc', :order => 'time') %>
</th> </th>
<th style="width: 40px;"> <th style="width: 40px;">
</tr> </tr>

@ -2,7 +2,7 @@
<h3> <h3>
<%=l(:label_excellent_courses_list)%> <%=l(:label_excellent_courses_list)%>
</h3> </h3>
<%= render 'tab_excellent_courses' %> <%= render 'admin/tab_excellent_courses' %>
<h3> <h3>
<%=l(:label_excellent_courses_list)%> <%=l(:label_excellent_courses_list)%>
@ -33,12 +33,14 @@
<th style="width: 25px;"> <th style="width: 25px;">
资源数 资源数
</th> </th>
<th style="width: 70px;"> <th style="width: 50px;">
帖子数 帖子数
</th> </th>
<th style="width: 70px;"> <th style="width: 50px;">
动态数 动态数
</th> </th>
<th style="width: 40px;">
</tr>
</tr> </tr>
</thead> </thead>
<tbody> <tbody>
@ -74,6 +76,9 @@
<td class="center"> <td class="center">
<%= course.course_activities.count%> <%= course.course_activities.count%>
</td> </td>
<td class="buttons">
<%= link_to( course.is_excellent == 1 || course.excellent_option == 1 ? "取消精品" : "设为精品", { :controller => 'admin', :action => 'cancel_excellent_course', :id => course.id }, :class => 'icon-del') %>
</td>
</tr> </tr>
<% end %> <% end %>
</tbody> </tbody>

@ -59,12 +59,12 @@
<td class="center"> <td class="center">
<%= format_date(journal.created_on) %> <%= format_date(journal.created_on) %>
</td> </td>
<td style="white-space: nowrap;overflow: hidden;text-overflow: ellipsis;" title='<%=journal.notes %>'> <td style="white-space: nowrap;overflow: hidden;text-overflow: ellipsis;" title='<%=strip_html(journal.notes) %>'>
<%case journal.jour_type %> <%case journal.jour_type %>
<% when 'Principal' %> <% when 'Principal' %>
<%= link_to(journal.notes.html_safe, feedback_path(journal.jour_id)) %> <%= link_to(strip_html(journal.notes), feedback_path(journal.jour_id)) %>
<% when 'Course' %> <% when 'Course' %>
<%= link_to(journal.notes.html_safe, course_feedback_path(journal.jour_id)) %> <%= link_to(strip_html(journal.notes), course_feedback_path(journal.jour_id)) %>
<% end %> <% end %>
</td> </td>
<td class="center"> <td class="center">

@ -1,3 +1,4 @@
<script src="/javascripts/i18n/jquery.ui.datepicker-zh-CN.js" type="text/javascript"></script>
<script type="text/javascript"> <script type="text/javascript">
$(function(){ $(function(){
$("#RSide").removeAttr("id"); $("#RSide").removeAttr("id");

@ -63,4 +63,11 @@
<%#end%> <%#end%>
<% end%> <% end%>
<li class="polls_date fr mr10">截止时间:<%= format_time(exercise.end_time.to_s)%></li> <li class="polls_date fr mr10">截止时间:<%= format_time(exercise.end_time.to_s)%></li>
<% if exercise.show_result == 1 %>
<% if exercise.end_time <= Time.now %>
<li><%= link_to l(:label_statistical_results), student_exercise_list_exercise_path(exercise.id,:course_id => @course.id), :class => "pollsbtn fr mr10"%></li>
<% else %>
<li class="pollsbtn fr mr10 pollsbtn_grey" title="截止时间未到,暂不能查看统计结果">统计结果</li>
<%end%>
<% end %>
<% end%> <% end%>

@ -20,7 +20,13 @@
<div class="testDesEdit mt5"><%= exercise.exercise_description.nil? ? "" : exercise.exercise_description.html_safe%></div> <div class="testDesEdit mt5"><%= exercise.exercise_description.nil? ? "" : exercise.exercise_description.html_safe%></div>
<div class="cl"></div> <div class="cl"></div>
</div> </div>
<div class="mb5">得分:<span class="c_red"><%=exercise_user.score %>分</span></div> <div>
<div class="fl mb5">得分:<span class="c_red"><%=exercise_user.score %>分</span></div>
<% if User.current.admin? || User.current.allowed_to?(:as_teacher,exercise.course) || (exercise.exercise_status == 3 && exercise.show_result == 1) %>
<%= link_to '返回统计列表>>',student_exercise_list_exercise_path(exercise.id,:course_id => exercise.course.id) , :class => "fr linkBlue" %>
<% end %>
</div>
<div class="cl"></div>
<% mc_question_list = exercise.exercise_questions.where("question_type=1") %> <% mc_question_list = exercise.exercise_questions.where("question_type=1") %>
<% mcq_question_list = exercise.exercise_questions.where("question_type=2") %> <% mcq_question_list = exercise.exercise_questions.where("question_type=2") %>
<% single_question_list = exercise.exercise_questions.where("question_type=3") %> <% single_question_list = exercise.exercise_questions.where("question_type=3") %>

@ -93,18 +93,33 @@
url: '<%= url_for(:controller => 'student_work', :action => 'search_course_students') %>'+'?homework='+<%=@homework.id %>, url: '<%= url_for(:controller => 'student_work', :action => 'search_course_students') %>'+'?homework='+<%=@homework.id %>,
type:'get' type:'get'
}); });
<% if defined?(edit_mode) && edit_mode %> var ids = $("#group_member_ids").val().split(',');
<% pro = @homework.student_work_projects.where("user_id = ?",User.current.id).first.project_id.to_i %> if (ids.length > 1){
<% members = @homework.student_work_projects.where("project_id = ? and is_leader =?",pro,0) %> for(var i=1; i<ids.length; i++) {
<% members.each do |member| %> if($("#choose_student_"+ids[i]).length == 0) {
var link = "<li id='choose_student_<%=member.user_id%>' onclick='delete_student(<%=member.user_id %>);'><%=member.user.show_name %>"; $.get(
<% unless member.user.user_extensions.student_id == "" %> '/student_work/get_user_infor',
link += "(<%=member.user.user_extensions.student_id %>)"; {
<% end %> user_id: ids[i]
link += "</li>"; },
$("#choose_students_list").append(link); function (data) {
<% end %> if (data.valid) {
<% end %> var link = "<li id='choose_student_"+data.id+"' onclick='delete_student("+data.id+");'>"+data.name;
if (data.student_id != "" ) {
link += "("+data.student_id+")";
}
link += "</li>";
$("#choose_students_list").append(link);
}
else
{
}
}
);
}
}
}
}); });
</script> </script>
<% end %> <% end %>

@ -1,7 +1,8 @@
<div id="popbox02"> <div id="popbox02">
<div class="ni_con"> <div class="ni_con">
<p> <p>
当前作品未进行评分,是否确定提交? <%#A if work.teacher_score.nil? || work. %>
您当次评阅未对作品进行评分,分数将取上次的评分结果,若没有评分记录则不评分,是否确定提交?
</p> </p>
<div class="ni_btn"> <div class="ni_btn">
<a href="javascript:" class="tijiao" onclick="submit_teacher_score(<%=work.id %>);" style="margin-bottom: 20px;" > <a href="javascript:" class="tijiao" onclick="submit_teacher_score(<%=work.id %>);" style="margin-bottom: 20px;" >

@ -2,12 +2,14 @@
<span class="uploadText">评分设置</span> <span class="uploadText">评分设置</span>
<div class="mt15"> <div class="mt15">
<span class="f14 fontGrey3 mr10">迟交扣分</span> <span class="f14 fontGrey3 mr10">迟交扣分</span>
<input type="text" name="late_penalty" id="late_penalty_num" placeholder="请输入0-50数值" class=" markInput" value="<%= homework.late_penalty%>" onkeyup="check_late_penalty('late_penalty_num')"/> <input type="text" name="late_penalty" id="late_penalty_num" placeholder="0-50" class=" markInput" value="<%= homework.late_penalty%>" onkeyup="check_late_penalty('late_penalty_num')"/>
<span class="f12 c_red ml10">请输入0-50数值</span>
</div> </div>
<% if homework.anonymous_comment == 0 %> <% if homework.anonymous_comment == 0 %>
<div> <div class="mt10">
<span class="f14 fontGrey3 mr10">缺评扣分</span> <span class="f14 fontGrey3 mr10">缺评扣分</span>
<input type="text" name="absence_penalty" id="absence_penalty_num" placeholder="请输入0-50数值" class="markInput" value="<%= homework.homework_detail_manual.absence_penalty%>" onkeyup="check_late_penalty('absence_penalty_num')"/> <input type="text" name="absence_penalty" id="absence_penalty_num" placeholder="0-50" class="markInput" value="<%= homework.homework_detail_manual.absence_penalty%>" onkeyup="check_late_penalty('absence_penalty_num')"/>
<span class="f12 c_red ml10">请输入0-50数值</span>
</div> </div>
<% end %> <% end %>
@ -55,11 +57,23 @@
</div> </div>
<div> <div>
<div class="courseSendSubmit"> <div class="courseSendSubmit">
<a href="javascript:void(0);" class="sendSourceText" onclick="$('#ajax-modal').find('form').submit();clickCanel();">确定</a> <a href="javascript:void(0);" class="sendSourceText" onclick="set_score_rule_submit();">确定</a>
</div> </div>
<div class="courseSendCancel"> <div class="courseSendCancel">
<a href="javascript:void(0);" class="sendSourceText linkGrey6" onclick="hideModal();">取消</a> <a href="javascript:void(0);" class="sendSourceText linkGrey6" onclick="hideModal();">取消</a>
</div> </div>
</div> </div>
<div class="cl"></div> <div class="cl"></div>
</div> </div>
<script type="text/javascript">
function set_score_rule_submit() {
if($("#late_penalty_num").val() == ""){
$("#late_penalty_num").val("0");
}
if($("#absence_penalty_num").val() == ""){
$("#absence_penalty_num").val("0");
}
$('#ajax-modal').find('form').submit();
clickCanel();
}
</script>

@ -4,14 +4,21 @@
<font class="f12 c_red"> <font class="f12 c_red">
(<%= @student_work_count%>人已交) (<%= @student_work_count%>人已交)
</font> </font>
<% my_work = @homework.student_works.where("user_id = #{User.current.id}").first %> <%# my_work = @homework.student_works.where("user_id = #{User.current.id}").first %>
<% my_work = cur_user_works_for_homework @homework %>
<% if !@is_teacher && my_work.nil? && User.current.member_of_course?(@course) %> <% if !@is_teacher && my_work.nil? && User.current.member_of_course?(@course) %>
<span class="f12 c_red">您尚未提交作品</span> <span class="f12 c_red">您尚未提交作品</span>
<%=link_to "提交作品", new_student_work_url_without_domain(@homework.id),:class => 'blueCir ml5 f12' %> <% unless @homework.homework_type == 3 && @homework.homework_detail_group.base_on_project == 1 %>
<%=link_to "提交作品", new_student_work_url_without_domain(@homework.id),:class => 'blueCir ml5 f12' %>
<% end %>
<% elsif !@is_teacher && my_work &&Time.parse(@homework.end_time.to_s).strftime("%Y-%m-%d") < Time.parse(Time.now.to_s).strftime("%Y-%m-%d") && !@stundet_works.empty?%> <% elsif !@is_teacher && my_work &&Time.parse(@homework.end_time.to_s).strftime("%Y-%m-%d") < Time.parse(Time.now.to_s).strftime("%Y-%m-%d") && !@stundet_works.empty?%>
<span class="f12 c_red">您已提交且不可再修改,因为截止日期已过</span> <span class="f12 c_red">已提交且不可再修改,因为截止日期已过</span>
<% elsif !@is_teacher && my_work &&Time.parse(@homework.end_time.to_s).strftime("%Y-%m-%d") >= Time.parse(Time.now.to_s).strftime("%Y-%m-%d") && !@stundet_works.empty?%> <% elsif !@is_teacher && my_work &&Time.parse(@homework.end_time.to_s).strftime("%Y-%m-%d") >= Time.parse(Time.now.to_s).strftime("%Y-%m-%d") && !@stundet_works.empty?%>
<span class="f12 c_red">您已提交,您还可以修改</span> <% if @homework.homework_type == 3 %>
<span class="f12 c_red">组长已提交,组长还可修改</span>
<% else %>
<span class="f12 c_red">您已提交,您还可以修改</span>
<% end %>
<% end %> <% end %>
</span> </span>
<%if @is_teacher || @homework.homework_detail_manual.comment_status == 3 || @homework.is_open == 1%> <%if @is_teacher || @homework.homework_detail_manual.comment_status == 3 || @homework.is_open == 1%>

@ -103,21 +103,11 @@
} }
function popupRegex(){ function popupRegex(){
if($("#group_member_ids").length > 0) { $('#ajax-modal').html("<div><p align='center' style='margin-top: 35px'>作品信息完整性校验中,请稍等...</p></div>");
if(regexStudentWorkMember(parseInt($.trim($("#min_num_member").html())),parseInt($.trim($("#max_num_member").html())))) { showModal('ajax-modal', '500px');
$('#ajax-modal').html("<div><p align='center' style='margin-top: 35px'>作品信息完整性校验中,请稍等...</p></div>"); $('#ajax-modal').siblings().remove();
showModal('ajax-modal', '500px'); $('#ajax-modal').parent().css("top","").css("left","").css("border","3px solid #269ac9");
$('#ajax-modal').siblings().remove(); $('#ajax-modal').parent().addClass("anonymos");
$('#ajax-modal').parent().css("top","").css("left","").css("border","3px solid #269ac9");
$('#ajax-modal').parent().addClass("anonymos");
}
} else {
$('#ajax-modal').html("<div><p align='center' style='margin-top: 35px'>作品信息完整性校验中,请稍等...</p></div>");
showModal('ajax-modal', '500px');
$('#ajax-modal').siblings().remove();
$('#ajax-modal').parent().css("top","").css("left","").css("border","3px solid #269ac9");
$('#ajax-modal').parent().addClass("anonymos");
}
} }
function nh_check_field(params){ function nh_check_field(params){
@ -140,6 +130,12 @@
params.contentmsg.html(''); params.contentmsg.html('');
} }
} }
if(!result) {
return result;
}
}
if($("#group_member_ids").length > 0) {
result=regexStudentWorkMember(parseInt($.trim($("#min_num_member").html())),parseInt($.trim($("#max_num_member").html())));
} }
return result; return result;
} }

@ -62,21 +62,11 @@
} }
// 作品校验 // 作品校验
function popupRegex(){ function popupRegex(){
if($("#group_member_ids").length > 0) { $('#ajax-modal').html("<div><p align='center' style='margin-top: 35px'>作品信息完整性校验中,请稍等...</p></div>");
if(regexStudentWorkMember(parseInt($.trim($("#min_num_member").html())),parseInt($.trim($("#max_num_member").html())))) { showModal('ajax-modal', '500px');
$('#ajax-modal').html("<div><p align='center' style='margin-top: 35px'>作品信息完整性校验中,请稍等...</p></div>"); $('#ajax-modal').siblings().remove();
showModal('ajax-modal', '500px'); $('#ajax-modal').parent().css("top","").css("left","").css("border","3px solid #269ac9");
$('#ajax-modal').siblings().remove(); $('#ajax-modal').parent().addClass("anonymos");
$('#ajax-modal').parent().css("top","").css("left","").css("border","3px solid #269ac9");
$('#ajax-modal').parent().addClass("anonymos");
}
} else {
$('#ajax-modal').html("<div><p align='center' style='margin-top: 35px'>作品信息完整性校验中,请稍等...</p></div>");
showModal('ajax-modal', '500px');
$('#ajax-modal').siblings().remove();
$('#ajax-modal').parent().css("top","").css("left","").css("border","3px solid #269ac9");
$('#ajax-modal').parent().addClass("anonymos");
}
} }
function nh_check_field(params){ function nh_check_field(params){
@ -99,6 +89,12 @@
params.contentmsg.html(''); params.contentmsg.html('');
} }
} }
if(!result) {
return result;
}
}
if($("#group_member_ids").length > 0) {
result=regexStudentWorkMember(parseInt($.trim($("#min_num_member").html())),parseInt($.trim($("#max_num_member").html())));
} }
return result; return result;
} }

@ -1,2 +1,3 @@
hideModal('#popbox02'); hideModal('#popbox02');
$("#homework_attachments").html("<%= escape_javascript(render :partial => 'users/user_homework_attachment', :locals => {:container => @student_work, :has_program=>false,:has_group=>false})%>"); $("#homework_attachments").html("<%= escape_javascript(render :partial => 'users/user_homework_attachment', :locals => {:container => @student_work, :has_program=>false,:has_group=>false})%>");
$("#group_member_ids").val("<%=User.current.id %>");

@ -7,7 +7,8 @@ $("#all_students_list").empty();
link += "</li>"; link += "</li>";
$("#all_students_list").append(link); $("#all_students_list").append(link);
var str = ""; var str = $("#group_member_ids").val();
/*var str = "";
var lists = $("#choose_students_list li"); var lists = $("#choose_students_list li");
if(lists.length > 0) { if(lists.length > 0) {
for(var i=0; i<lists.length; i++) { for(var i=0; i<lists.length; i++) {
@ -17,7 +18,7 @@ $("#all_students_list").empty();
str += ","; str += ",";
} }
} }
} }*/
<% if user.id.to_i != User.current.id.to_i && (@commit_student_ids.find{|e| e.to_i == user.id.to_i}).nil? && user.member_of_course?(@course) %> <% if user.id.to_i != User.current.id.to_i && (@commit_student_ids.find{|e| e.to_i == user.id.to_i}).nil? && user.member_of_course?(@course) %>
if (str.indexOf(<%=user.id.to_s %>) < 0) { if (str.indexOf(<%=user.id.to_s %>) < 0) {
$("#student_<%=user.id %>").one("click",function choose_student() { $("#student_<%=user.id %>").one("click",function choose_student() {

@ -14,13 +14,23 @@
<% course=Course.find(activity.jour_id) %> <% course=Course.find(activity.jour_id) %>
<%= link_to course.name.to_s+" | 课程留言", course_feedback_path(course), :class => "newsBlue ml15" %> <%= link_to course.name.to_s+" | 课程留言", course_feedback_path(course), :class => "newsBlue ml15" %>
</div> </div>
<div class="homepagePostTitle break_word list_style upload_img"> <!--<div class="homepagePostTitle break_word list_style upload_img">
<% if activity.parent %> <%# if activity.parent %>
<%= link_to activity.parent.notes.html_safe, course_feedback_path(course), :class => "postGrey" %> <%#= link_to activity.parent.notes.html_safe, course_feedback_path(course), :class => "postGrey" %>
<% else %> <%# else %>
<%= link_to activity.notes.html_safe, course_feedback_path(course), :class => "postGrey" %> <%#= link_to activity.notes.html_safe, course_feedback_path(course), :class => "postGrey" %>
<% end %> <%# end %>
</div> </div>-->
<% if activity.parent %>
<% content = activity.parent.notes %>
<% else %>
<% content = activity.notes %>
<% end %>
<%=render :partial =>"users/intro_content", :locals=>{:user_activity_id =>user_activity_id, :content=>content} %>
<div class="cl"></div>
<div id="intro_content_show_<%= user_activity_id%>" class="fr" style="display:none;"><a href="javascript:void(0);" class="linkBlue">[展开]</a></div>
<div id="intro_content_hide_<%= user_activity_id%>" class="fr" style="display:none;"><a href="javascript:void(0);" class="linkBlue">[收起]</a></div>
<div class="cl"></div>
<div class="homepagePostDate fl"> <div class="homepagePostDate fl">
留言时间:<%= format_time(activity.created_on) %> 留言时间:<%= format_time(activity.created_on) %>
</div> </div>

@ -1,4 +1,4 @@
<% if AtMessage === ma && ma.at_valid? %> <% if ma.class == AtMessage && ma.at_valid? %>
<ul class="homepageNewsList fl"> <ul class="homepageNewsList fl">
<li class="homepageNewsPortrait fl"><a href="javascript:void(0);"><%=link_to image_tag(url_to_avatar(ma.author), :width => "30", :height => "30"),user_path(ma.author) %></a></li> <li class="homepageNewsPortrait fl"><a href="javascript:void(0);"><%=link_to image_tag(url_to_avatar(ma.author), :width => "30", :height => "30"),user_path(ma.author) %></a></li>
<li class="homepageNewsPubType fl"> <li class="homepageNewsPubType fl">

@ -3,11 +3,14 @@
<div class="mt10"> <div class="mt10">
<span class="f14 fontGrey3 mr5">每组最小人数:</span> <span class="f14 fontGrey3 mr5">每组最小人数:</span>
<input id="min_num" type="text" name="" class="markInput" value="<%=(edit_mode && homework.is_group_homework?) ? homework.homework_detail_group.min_num : 2 %>" />人 <input id="min_num" type="text" name="" class="markInput" value="<%=(edit_mode && homework.is_group_homework?) ? homework.homework_detail_group.min_num : 2 %>" />人
<span class="c_red undis" id="min_num_notice"></span>
</div> </div>
<div class="mt10"> <div class="mt10">
<span class="f14 fontGrey3 mr5">每组最大人数:</span> <span class="f14 fontGrey3 mr5">每组最大人数:</span>
<input id="max_num" type="text" name="" class="markInput" value="<%=(edit_mode && homework.is_group_homework?) ? homework.homework_detail_group.max_num : 10 %>" />人 <input id="max_num" type="text" name="" class="markInput" value="<%=(edit_mode && homework.is_group_homework?) ? homework.homework_detail_group.max_num : 10 %>" />人
<span class="c_red undis" id="max_num_notice"></span>
</div> </div>
<p class="c_red undis" id="min_max_num_notice"></p>
<div class="mb10 mt10"> <div class="mb10 mt10">
<label> <label>
<input type="checkbox" class="mr5" name="base_on_project" value="<%=(edit_mode && homework.is_group_homework?) ? homework.homework_detail_group.base_on_project : 1 %>" id="base_on_project"/> <input type="checkbox" class="mr5" name="base_on_project" value="<%=(edit_mode && homework.is_group_homework?) ? homework.homework_detail_group.base_on_project : 1 %>" id="base_on_project"/>

@ -16,22 +16,26 @@
<% end %> <% end %>
<% end %> <% end %>
</div> </div>
<% if is_activity.to_i == 1 %> <%# if is_activity.to_i == 1 %>
<div class="homepagePostTitle break_word list_style upload_img"> <!--<div class="homepagePostTitle break_word list_style upload_img">
<% if activity.parent %> <%# if activity.parent %>
<%= link_to activity.parent.notes.html_safe, feedback_path(activity.jour, :host=> Setting.host_user), :class => "postGrey" %> <%#= link_to activity.parent.notes.html_safe, feedback_path(activity.jour, :host=> Setting.host_user), :class => "postGrey" %>
<% else %> <%# else %>
<%= link_to activity.notes.html_safe, feedback_path(activity.jour, :host=> Setting.host_user), :class => "postGrey" %> <%#= link_to activity.notes.html_safe, feedback_path(activity.jour, :host=> Setting.host_user), :class => "postGrey" %>
<% end %> <%# end %>
</div> </div>-->
<% else %> <%# else %>
<% if activity.parent %> <% if activity.parent %>
<% content = activity.parent.notes %> <% content = activity.parent.notes %>
<% else %> <% else %>
<% content = activity.notes %> <% content = activity.notes %>
<% end %> <% end %>
<%=render :partial =>"users/intro_content", :locals=>{:user_activity_id =>user_activity_id, :content=>content} %> <%=render :partial =>"users/intro_content", :locals=>{:user_activity_id =>user_activity_id, :content=>content} %>
<% end %> <div class="cl"></div>
<div id="intro_content_show_<%= user_activity_id%>" class="fr" style="display:none;"><a href="javascript:void(0);" class="linkBlue">[展开]</a></div>
<div id="intro_content_hide_<%= user_activity_id%>" class="fr" style="display:none;"><a href="javascript:void(0);" class="linkBlue">[收起]</a></div>
<div class="cl"></div>
<%# end %>
<div class="homepagePostDate fl"> <div class="homepagePostDate fl">
留言时间:<%= format_time(activity.created_on) %> 留言时间:<%= format_time(activity.created_on) %>
</div> </div>

@ -5,7 +5,7 @@
<%if jours %> <%if jours %>
<% jours.each do |jour|%> <% jours.each do |jour|%>
<% unless jour.private == 1 && (!User.current || (User.current && jour.jour_id != User.current.id && jour.user_id != User.current.id)) %> <% unless jour.private == 1 && (!User.current || (User.current && jour.jour_id != User.current.id && jour.user_id != User.current.id && !User.current.admin?)) %>
<script type="text/javascript"> <script type="text/javascript">
$(function(){ $(function(){
sd_create_editor_from_data(<%= jour.id%>, null, "100%", "<%=jour.class.to_s%>"); sd_create_editor_from_data(<%= jour.id%>, null, "100%", "<%=jour.class.to_s%>");

@ -7,6 +7,15 @@
$(function(){ $(function(){
$("#RSide").removeAttr("id"); $("#RSide").removeAttr("id");
$("#Container").css("width","1000px"); $("#Container").css("width","1000px");
<%if @homework.anonymous_comment == 0 && @homework.homework_detail_manual.comment_status != 1%>
$('#ajax-modal').html('<%= escape_javascript(render :partial => 'student_work/new_student_work_alert') %>');
showModal('ajax-modal', '360px');
$('#ajax-modal').siblings().remove();
$('#ajax-modal').before("<span style='float: right;cursor:pointer;'>" +
"<a href='javascript:' onclick='clickCanel();'><img src='/images/bid/close.png' width='26px' height='26px' /></a></span>");
$('#ajax-modal').parent().css("top","65%").css("left","60%").css("border","3px solid #269ac9");
$('#ajax-modal').parent().addClass("anonymos_work");
<% end%>
}); });
</script> </script>
<!-- 模板1开始可以使用scripttype设置为text/html来存放模板片段并且用id标示 --> <!-- 模板1开始可以使用scripttype设置为text/html来存放模板片段并且用id标示 -->

@ -4,8 +4,9 @@
<% if (!@message_alls.nil? && @message_alls.count >0) %> <% if (!@message_alls.nil? && @message_alls.count >0) %>
<% if params[:type].nil? || params[:type] == "unviewed" %> <% if params[:type].nil? || params[:type] == "unviewed" %>
<div class="newsReadSetting"> <div class="newsReadSetting">
有&nbsp;<span class="c_red"><%= unviewed_message(@user) %></span>&nbsp;条未读 <% count = unviewed_message(@user) %>
<% unless (unviewed_message(@user) == 0 || User.current != @user) %> 有&nbsp;<span class="c_red"><%= count %></span>&nbsp;条未读
<% unless (count == 0 || User.current != @user) %>
<a href="javascript:void(0);" class="ml15"><%= link_to "全部设为已读", user_message_path(User.current, :viewed => 'all') %></a> <a href="javascript:void(0);" class="ml15"><%= link_to "全部设为已读", user_message_path(User.current, :viewed => 'all') %></a>
<% end %> <% end %>
</div> </div>

@ -329,6 +329,7 @@ RedmineApp::Application.routes.draw do
post 'last_codecomparetime' post 'last_codecomparetime'
post 'set_score_rule' post 'set_score_rule'
get 'work_canrepeat' get 'work_canrepeat'
get 'get_user_infor'
end end
end end
@ -1019,6 +1020,7 @@ RedmineApp::Application.routes.draw do
get 'admin/excellent_courses', as: :excellent_courses get 'admin/excellent_courses', as: :excellent_courses
get 'admin/excellent_all_courses', as: :excellent_all_courses get 'admin/excellent_all_courses', as: :excellent_all_courses
match 'admin/set_excellent_course/:id', :to => 'admin#set_excellent_course' match 'admin/set_excellent_course/:id', :to => 'admin#set_excellent_course'
match 'admin/cancel_excellent_course/:id', :to => 'admin#cancel_excellent_course'
get 'admin/course_resource_list' get 'admin/course_resource_list'
get 'admin/project_resource_list' get 'admin/project_resource_list'
match 'admin/users', :via => :get match 'admin/users', :via => :get

@ -0,0 +1,12 @@
class CreateSyllabuses < ActiveRecord::Migration
def change
create_table :syllabuses do |t|
t.string :title
t.text :description
t.references :user
t.timestamps
end
add_index :syllabuses, :user_id
end
end

@ -0,0 +1,6 @@
class AddSyllabusToCourse < ActiveRecord::Migration
def change
add_column :courses, :syllabus_id, :integer
add_index :courses, :syllabus_id
end
end

@ -11,7 +11,7 @@
# #
# It's strongly recommended to check this file into your version control system. # It's strongly recommended to check this file into your version control system.
ActiveRecord::Schema.define(:version => 20160601073753) do ActiveRecord::Schema.define(:version => 20160613065840) do
create_table "activities", :force => true do |t| create_table "activities", :force => true do |t|
t.integer "act_id", :null => false t.integer "act_id", :null => false
@ -52,28 +52,6 @@ ActiveRecord::Schema.define(:version => 20160601073753) do
add_index "api_keys", ["access_token"], :name => "index_api_keys_on_access_token" add_index "api_keys", ["access_token"], :name => "index_api_keys_on_access_token"
add_index "api_keys", ["user_id"], :name => "index_api_keys_on_user_id" add_index "api_keys", ["user_id"], :name => "index_api_keys_on_user_id"
create_table "application_settings", :force => true do |t|
t.integer "default_projects_limit"
t.boolean "signup_enabled"
t.boolean "signin_enabled"
t.boolean "gravatar_enabled"
t.text "sign_in_text"
t.datetime "created_at"
t.datetime "updated_at"
t.string "home_page_url"
t.integer "default_branch_protection", :default => 2
t.boolean "twitter_sharing_enabled", :default => true
t.text "restricted_visibility_levels"
t.boolean "version_check_enabled", :default => true
t.integer "max_attachment_size", :default => 10, :null => false
t.integer "default_project_visibility"
t.integer "default_snippet_visibility"
t.text "restricted_signup_domains"
t.boolean "user_oauth_applications", :default => true
t.string "after_sign_out_path"
t.integer "session_expire_delay", :default => 10080, :null => false
end
create_table "applied_projects", :force => true do |t| create_table "applied_projects", :force => true do |t|
t.integer "project_id", :null => false t.integer "project_id", :null => false
t.integer "user_id", :null => false t.integer "user_id", :null => false
@ -178,20 +156,6 @@ ActiveRecord::Schema.define(:version => 20160601073753) do
t.string "typeName", :limit => 50 t.string "typeName", :limit => 50
end end
create_table "audit_events", :force => true do |t|
t.integer "author_id", :null => false
t.string "type", :null => false
t.integer "entity_id", :null => false
t.string "entity_type", :null => false
t.text "details"
t.datetime "created_at"
t.datetime "updated_at"
end
add_index "audit_events", ["author_id"], :name => "index_audit_events_on_author_id"
add_index "audit_events", ["entity_id", "entity_type"], :name => "index_audit_events_on_entity_id_and_entity_type"
add_index "audit_events", ["type"], :name => "index_audit_events_on_type"
create_table "auth_sources", :force => true do |t| create_table "auth_sources", :force => true do |t|
t.string "type", :limit => 30, :default => "", :null => false t.string "type", :limit => 30, :default => "", :null => false
t.string "name", :limit => 60, :default => "", :null => false t.string "name", :limit => 60, :default => "", :null => false
@ -289,17 +253,6 @@ ActiveRecord::Schema.define(:version => 20160601073753) do
add_index "boards", ["last_message_id"], :name => "index_boards_on_last_message_id" add_index "boards", ["last_message_id"], :name => "index_boards_on_last_message_id"
add_index "boards", ["project_id"], :name => "boards_project_id" add_index "boards", ["project_id"], :name => "boards_project_id"
create_table "broadcast_messages", :force => true do |t|
t.text "message", :null => false
t.datetime "starts_at"
t.datetime "ends_at"
t.integer "alert_type"
t.datetime "created_at"
t.datetime "updated_at"
t.string "color"
t.string "font"
end
create_table "bug_to_osps", :force => true do |t| create_table "bug_to_osps", :force => true do |t|
t.integer "osp_id" t.integer "osp_id"
t.integer "relative_memo_id" t.integer "relative_memo_id"
@ -597,11 +550,10 @@ ActiveRecord::Schema.define(:version => 20160601073753) do
t.integer "excellent_option", :default => 0 t.integer "excellent_option", :default => 0
t.integer "is_copy", :default => 0 t.integer "is_copy", :default => 0
t.integer "visits", :default => 0 t.integer "visits", :default => 0
t.integer "syllabus_id"
end end
add_index "courses", ["id"], :name => "id", :unique => true add_index "courses", ["syllabus_id"], :name => "index_courses_on_syllabus_id"
add_index "courses", ["tea_id"], :name => "tea_id"
add_index "courses", ["visits"], :name => "visits"
create_table "custom_fields", :force => true do |t| create_table "custom_fields", :force => true do |t|
t.string "type", :limit => 30, :default => "", :null => false t.string "type", :limit => 30, :default => "", :null => false
@ -664,15 +616,6 @@ ActiveRecord::Schema.define(:version => 20160601073753) do
add_index "delayed_jobs", ["priority", "run_at"], :name => "delayed_jobs_priority" add_index "delayed_jobs", ["priority", "run_at"], :name => "delayed_jobs_priority"
create_table "deploy_keys_projects", :force => true do |t|
t.integer "deploy_key_id", :null => false
t.integer "project_id", :null => false
t.datetime "created_at"
t.datetime "updated_at"
end
add_index "deploy_keys_projects", ["project_id"], :name => "index_deploy_keys_projects_on_project_id"
create_table "discuss_demos", :force => true do |t| create_table "discuss_demos", :force => true do |t|
t.string "title" t.string "title"
t.text "body" t.text "body"
@ -722,16 +665,6 @@ ActiveRecord::Schema.define(:version => 20160601073753) do
t.datetime "created_at" t.datetime "created_at"
end end
create_table "emails", :force => true do |t|
t.integer "user_id", :null => false
t.string "email", :null => false
t.datetime "created_at"
t.datetime "updated_at"
end
add_index "emails", ["email"], :name => "index_emails_on_email", :unique => true
add_index "emails", ["user_id"], :name => "index_emails_on_user_id"
create_table "enabled_modules", :force => true do |t| create_table "enabled_modules", :force => true do |t|
t.integer "project_id" t.integer "project_id"
t.string "name", :null => false t.string "name", :null => false
@ -754,25 +687,6 @@ ActiveRecord::Schema.define(:version => 20160601073753) do
add_index "enumerations", ["id", "type"], :name => "index_enumerations_on_id_and_type" add_index "enumerations", ["id", "type"], :name => "index_enumerations_on_id_and_type"
add_index "enumerations", ["project_id"], :name => "index_enumerations_on_project_id" add_index "enumerations", ["project_id"], :name => "index_enumerations_on_project_id"
create_table "events", :force => true do |t|
t.string "target_type"
t.integer "target_id"
t.string "title"
t.text "data"
t.integer "project_id"
t.datetime "created_at"
t.datetime "updated_at"
t.integer "action"
t.integer "author_id"
end
add_index "events", ["action"], :name => "index_events_on_action"
add_index "events", ["author_id"], :name => "index_events_on_author_id"
add_index "events", ["created_at"], :name => "index_events_on_created_at"
add_index "events", ["project_id"], :name => "index_events_on_project_id"
add_index "events", ["target_id"], :name => "index_events_on_target_id"
add_index "events", ["target_type"], :name => "index_events_on_target_type"
create_table "exercise_answers", :force => true do |t| create_table "exercise_answers", :force => true do |t|
t.integer "user_id" t.integer "user_id"
t.integer "exercise_question_id" t.integer "exercise_question_id"
@ -875,15 +789,6 @@ ActiveRecord::Schema.define(:version => 20160601073753) do
add_index "forge_messages", ["forge_message_id", "forge_message_type"], :name => "index_forge_messages_on_forge_message_id_and_forge_message_type" add_index "forge_messages", ["forge_message_id", "forge_message_type"], :name => "index_forge_messages_on_forge_message_id_and_forge_message_type"
add_index "forge_messages", ["user_id", "project_id", "created_at"], :name => "index_forge_messages_on_user_id_and_project_id_and_created_at" add_index "forge_messages", ["user_id", "project_id", "created_at"], :name => "index_forge_messages_on_user_id_and_project_id_and_created_at"
create_table "forked_project_links", :force => true do |t|
t.integer "forked_to_project_id", :null => false
t.integer "forked_from_project_id", :null => false
t.datetime "created_at"
t.datetime "updated_at"
end
add_index "forked_project_links", ["forked_to_project_id"], :name => "index_forked_project_links_on_forked_to_project_id", :unique => true
create_table "forums", :force => true do |t| create_table "forums", :force => true do |t|
t.string "name", :null => false t.string "name", :null => false
t.text "description" t.text "description"
@ -1013,17 +918,6 @@ ActiveRecord::Schema.define(:version => 20160601073753) do
t.datetime "updated_at", :null => false t.datetime "updated_at", :null => false
end end
create_table "identities", :force => true do |t|
t.string "extern_uid"
t.string "provider"
t.integer "user_id"
t.datetime "created_at"
t.datetime "updated_at"
end
add_index "identities", ["created_at", "id"], :name => "index_identities_on_created_at_and_id"
add_index "identities", ["user_id"], :name => "index_identities_on_user_id"
create_table "invite_lists", :force => true do |t| create_table "invite_lists", :force => true do |t|
t.integer "project_id" t.integer "project_id"
t.integer "user_id" t.integer "user_id"
@ -1167,20 +1061,6 @@ ActiveRecord::Schema.define(:version => 20160601073753) do
t.integer "private", :default => 0 t.integer "private", :default => 0
end end
create_table "keys", :force => true do |t|
t.integer "user_id"
t.datetime "created_at"
t.datetime "updated_at"
t.text "key"
t.string "title"
t.string "type"
t.string "fingerprint"
t.boolean "public", :default => false, :null => false
end
add_index "keys", ["created_at", "id"], :name => "index_keys_on_created_at_and_id"
add_index "keys", ["user_id"], :name => "index_keys_on_user_id"
create_table "kindeditor_assets", :force => true do |t| create_table "kindeditor_assets", :force => true do |t|
t.string "asset" t.string "asset"
t.integer "file_size" t.integer "file_size"
@ -1192,27 +1072,6 @@ ActiveRecord::Schema.define(:version => 20160601073753) do
t.integer "owner_type", :default => 0 t.integer "owner_type", :default => 0
end end
create_table "label_links", :force => true do |t|
t.integer "label_id"
t.integer "target_id"
t.string "target_type"
t.datetime "created_at"
t.datetime "updated_at"
end
add_index "label_links", ["label_id"], :name => "index_label_links_on_label_id"
add_index "label_links", ["target_id", "target_type"], :name => "index_label_links_on_target_id_and_target_type"
create_table "labels", :force => true do |t|
t.string "title"
t.string "color"
t.integer "project_id"
t.datetime "created_at"
t.datetime "updated_at"
end
add_index "labels", ["project_id"], :name => "index_labels_on_project_id"
create_table "member_roles", :force => true do |t| create_table "member_roles", :force => true do |t|
t.integer "member_id", :null => false t.integer "member_id", :null => false
t.integer "role_id", :null => false t.integer "role_id", :null => false
@ -1263,47 +1122,23 @@ ActiveRecord::Schema.define(:version => 20160601073753) do
t.integer "viewed_count", :default => 0 t.integer "viewed_count", :default => 0
end end
create_table "merge_request_diffs", :force => true do |t| create_table "mess", :id => false, :force => true do |t|
t.string "state" t.string "课程名"
t.text "st_commits", :limit => 2147483647 t.integer "课程ID", :default => 0, :null => false
t.text "st_diffs", :limit => 2147483647 t.string "教师姓", :default => "", :null => false
t.integer "merge_request_id", :null => false t.string "教师名", :limit => 30, :default => "", :null => false
t.datetime "created_at" t.string "主贴名", :default => "", :null => false
t.datetime "updated_at" t.integer "主贴或回帖ID", :default => 0, :null => false
end t.integer "回帖对应主贴ID"
t.integer "帖子点赞数"
add_index "merge_request_diffs", ["merge_request_id"], :name => "index_merge_request_diffs_on_merge_request_id", :unique => true t.integer "主贴回复数", :default => 0, :null => false
t.text "主贴或回帖内容"
create_table "merge_requests", :force => true do |t| t.datetime "发帖时间", :null => false
t.string "target_branch", :null => false t.integer "发帖或回帖用户ID", :default => 0, :null => false
t.string "source_branch", :null => false t.string "发帖或回帖用户姓", :default => "", :null => false
t.integer "source_project_id", :null => false t.string "发帖或回帖用户名", :limit => 30, :default => "", :null => false
t.integer "author_id"
t.integer "assignee_id"
t.string "title"
t.datetime "created_at"
t.datetime "updated_at"
t.integer "milestone_id"
t.string "state"
t.string "merge_status"
t.integer "target_project_id", :null => false
t.integer "iid"
t.text "description"
t.integer "position", :default => 0
t.datetime "locked_at"
end end
add_index "merge_requests", ["assignee_id"], :name => "index_merge_requests_on_assignee_id"
add_index "merge_requests", ["author_id"], :name => "index_merge_requests_on_author_id"
add_index "merge_requests", ["created_at", "id"], :name => "index_merge_requests_on_created_at_and_id"
add_index "merge_requests", ["created_at"], :name => "index_merge_requests_on_created_at"
add_index "merge_requests", ["milestone_id"], :name => "index_merge_requests_on_milestone_id"
add_index "merge_requests", ["source_branch"], :name => "index_merge_requests_on_source_branch"
add_index "merge_requests", ["source_project_id"], :name => "index_merge_requests_on_source_project_id"
add_index "merge_requests", ["target_branch"], :name => "index_merge_requests_on_target_branch"
add_index "merge_requests", ["target_project_id", "iid"], :name => "index_merge_requests_on_target_project_id_and_iid", :unique => true
add_index "merge_requests", ["title"], :name => "index_merge_requests_on_title"
create_table "message_alls", :force => true do |t| create_table "message_alls", :force => true do |t|
t.integer "user_id" t.integer "user_id"
t.integer "message_id" t.integer "message_id"
@ -1338,39 +1173,6 @@ ActiveRecord::Schema.define(:version => 20160601073753) do
add_index "messages", ["last_reply_id"], :name => "index_messages_on_last_reply_id" add_index "messages", ["last_reply_id"], :name => "index_messages_on_last_reply_id"
add_index "messages", ["parent_id"], :name => "messages_parent_id" add_index "messages", ["parent_id"], :name => "messages_parent_id"
create_table "milestones", :force => true do |t|
t.string "title", :null => false
t.integer "project_id", :null => false
t.text "description"
t.date "due_date"
t.datetime "created_at"
t.datetime "updated_at"
t.string "state"
t.integer "iid"
end
add_index "milestones", ["created_at", "id"], :name => "index_milestones_on_created_at_and_id"
add_index "milestones", ["due_date"], :name => "index_milestones_on_due_date"
add_index "milestones", ["project_id", "iid"], :name => "index_milestones_on_project_id_and_iid", :unique => true
add_index "milestones", ["project_id"], :name => "index_milestones_on_project_id"
create_table "namespaces", :force => true do |t|
t.string "name", :null => false
t.string "path", :null => false
t.integer "owner_id"
t.datetime "created_at"
t.datetime "updated_at"
t.string "type"
t.string "description", :default => "", :null => false
t.string "avatar"
end
add_index "namespaces", ["created_at", "id"], :name => "index_namespaces_on_created_at_and_id"
add_index "namespaces", ["name"], :name => "index_namespaces_on_name", :unique => true
add_index "namespaces", ["owner_id"], :name => "index_namespaces_on_owner_id"
add_index "namespaces", ["path"], :name => "index_namespaces_on_path", :unique => true
add_index "namespaces", ["type"], :name => "index_namespaces_on_type"
create_table "news", :force => true do |t| create_table "news", :force => true do |t|
t.integer "project_id" t.integer "project_id"
t.string "title", :limit => 60, :default => "", :null => false t.string "title", :limit => 60, :default => "", :null => false
@ -1396,31 +1198,6 @@ ActiveRecord::Schema.define(:version => 20160601073753) do
t.datetime "updated_at", :null => false t.datetime "updated_at", :null => false
end end
create_table "notes", :force => true do |t|
t.text "note"
t.string "noteable_type"
t.integer "author_id"
t.datetime "created_at"
t.datetime "updated_at"
t.integer "project_id"
t.string "attachment"
t.string "line_code"
t.string "commit_id"
t.integer "noteable_id"
t.boolean "system", :default => false, :null => false
t.text "st_diff", :limit => 2147483647
end
add_index "notes", ["author_id"], :name => "index_notes_on_author_id"
add_index "notes", ["commit_id"], :name => "index_notes_on_commit_id"
add_index "notes", ["created_at", "id"], :name => "index_notes_on_created_at_and_id"
add_index "notes", ["created_at"], :name => "index_notes_on_created_at"
add_index "notes", ["noteable_id", "noteable_type"], :name => "index_notes_on_noteable_id_and_noteable_type"
add_index "notes", ["noteable_type"], :name => "index_notes_on_noteable_type"
add_index "notes", ["project_id", "noteable_type"], :name => "index_notes_on_project_id_and_noteable_type"
add_index "notes", ["project_id"], :name => "index_notes_on_project_id"
add_index "notes", ["updated_at"], :name => "index_notes_on_updated_at"
create_table "notificationcomments", :force => true do |t| create_table "notificationcomments", :force => true do |t|
t.string "notificationcommented_type" t.string "notificationcommented_type"
t.integer "notificationcommented_id" t.integer "notificationcommented_id"
@ -1430,49 +1207,6 @@ ActiveRecord::Schema.define(:version => 20160601073753) do
t.datetime "updated_at", :null => false t.datetime "updated_at", :null => false
end end
create_table "oauth_access_grants", :force => true do |t|
t.integer "resource_owner_id", :null => false
t.integer "application_id", :null => false
t.string "token", :null => false
t.integer "expires_in", :null => false
t.text "redirect_uri", :null => false
t.datetime "created_at", :null => false
t.datetime "revoked_at"
t.string "scopes"
end
add_index "oauth_access_grants", ["token"], :name => "index_oauth_access_grants_on_token", :unique => true
create_table "oauth_access_tokens", :force => true do |t|
t.integer "resource_owner_id"
t.integer "application_id"
t.string "token", :null => false
t.string "refresh_token"
t.integer "expires_in"
t.datetime "revoked_at"
t.datetime "created_at", :null => false
t.string "scopes"
end
add_index "oauth_access_tokens", ["refresh_token"], :name => "index_oauth_access_tokens_on_refresh_token", :unique => true
add_index "oauth_access_tokens", ["resource_owner_id"], :name => "index_oauth_access_tokens_on_resource_owner_id"
add_index "oauth_access_tokens", ["token"], :name => "index_oauth_access_tokens_on_token", :unique => true
create_table "oauth_applications", :force => true do |t|
t.string "name", :null => false
t.string "uid", :null => false
t.string "secret", :null => false
t.text "redirect_uri", :null => false
t.string "scopes", :default => "", :null => false
t.datetime "created_at"
t.datetime "updated_at"
t.integer "owner_id"
t.string "owner_type"
end
add_index "oauth_applications", ["owner_id", "owner_type"], :name => "index_oauth_applications_on_owner_id_and_owner_type"
add_index "oauth_applications", ["uid"], :name => "index_oauth_applications_on_uid", :unique => true
create_table "onclick_times", :force => true do |t| create_table "onclick_times", :force => true do |t|
t.integer "user_id" t.integer "user_id"
t.datetime "onclick_time" t.datetime "onclick_time"
@ -1630,23 +1364,6 @@ ActiveRecord::Schema.define(:version => 20160601073753) do
t.integer "allow_teacher", :default => 0 t.integer "allow_teacher", :default => 0
end end
create_table "permissions", :force => true do |t|
t.string "controller", :limit => 30, :default => "", :null => false
t.string "action", :limit => 30, :default => "", :null => false
t.string "description", :limit => 60, :default => "", :null => false
t.boolean "is_public", :default => false, :null => false
t.integer "sort", :default => 0, :null => false
t.boolean "mail_option", :default => false, :null => false
t.boolean "mail_enabled", :default => false, :null => false
end
create_table "permissions_roles", :id => false, :force => true do |t|
t.integer "permission_id", :default => 0, :null => false
t.integer "role_id", :default => 0, :null => false
end
add_index "permissions_roles", ["role_id"], :name => "permissions_roles_role_id"
create_table "phone_app_versions", :force => true do |t| create_table "phone_app_versions", :force => true do |t|
t.string "version" t.string "version"
t.text "description" t.text "description"
@ -1729,11 +1446,6 @@ ActiveRecord::Schema.define(:version => 20160601073753) do
t.datetime "updated_at", :null => false t.datetime "updated_at", :null => false
end end
create_table "project_import_data", :force => true do |t|
t.integer "project_id"
t.text "data"
end
create_table "project_infos", :force => true do |t| create_table "project_infos", :force => true do |t|
t.integer "project_id" t.integer "project_id"
t.integer "user_id" t.integer "user_id"
@ -1824,16 +1536,6 @@ ActiveRecord::Schema.define(:version => 20160601073753) do
add_index "projects_trackers", ["project_id", "tracker_id"], :name => "projects_trackers_unique", :unique => true add_index "projects_trackers", ["project_id", "tracker_id"], :name => "projects_trackers_unique", :unique => true
add_index "projects_trackers", ["project_id"], :name => "projects_trackers_project_id" add_index "projects_trackers", ["project_id"], :name => "projects_trackers_project_id"
create_table "protected_branches", :force => true do |t|
t.integer "project_id", :null => false
t.string "name", :null => false
t.datetime "created_at"
t.datetime "updated_at"
t.boolean "developers_can_push", :default => false, :null => false
end
add_index "protected_branches", ["project_id"], :name => "index_protected_branches_on_project_id"
create_table "queries", :force => true do |t| create_table "queries", :force => true do |t|
t.integer "project_id" t.integer "project_id"
t.string "name", :default => "", :null => false t.string "name", :default => "", :null => false
@ -1968,25 +1670,6 @@ ActiveRecord::Schema.define(:version => 20160601073753) do
t.integer "is_teacher_score", :default => 0 t.integer "is_teacher_score", :default => 0
end end
create_table "services", :force => true do |t|
t.string "type"
t.string "title"
t.integer "project_id"
t.datetime "created_at"
t.datetime "updated_at"
t.boolean "active", :default => false, :null => false
t.text "properties"
t.boolean "template", :default => false
t.boolean "push_events", :default => true
t.boolean "issues_events", :default => true
t.boolean "merge_requests_events", :default => true
t.boolean "tag_push_events", :default => true
t.boolean "note_events", :default => true, :null => false
end
add_index "services", ["created_at", "id"], :name => "index_services_on_created_at_and_id"
add_index "services", ["project_id"], :name => "index_services_on_project_id"
create_table "settings", :force => true do |t| create_table "settings", :force => true do |t|
t.string "name", :default => "", :null => false t.string "name", :default => "", :null => false
t.text "value" t.text "value"
@ -2025,26 +1708,6 @@ ActiveRecord::Schema.define(:version => 20160601073753) do
t.datetime "updated_at", :null => false t.datetime "updated_at", :null => false
end end
create_table "snippets", :force => true do |t|
t.string "title"
t.text "content", :limit => 2147483647
t.integer "author_id", :null => false
t.integer "project_id"
t.datetime "created_at"
t.datetime "updated_at"
t.string "file_name"
t.datetime "expires_at"
t.string "type"
t.integer "visibility_level", :default => 0, :null => false
end
add_index "snippets", ["author_id"], :name => "index_snippets_on_author_id"
add_index "snippets", ["created_at", "id"], :name => "index_snippets_on_created_at_and_id"
add_index "snippets", ["created_at"], :name => "index_snippets_on_created_at"
add_index "snippets", ["expires_at"], :name => "index_snippets_on_expires_at"
add_index "snippets", ["project_id"], :name => "index_snippets_on_project_id"
add_index "snippets", ["visibility_level"], :name => "index_snippets_on_visibility_level"
create_table "softapplications", :force => true do |t| create_table "softapplications", :force => true do |t|
t.string "name" t.string "name"
t.text "description" t.text "description"
@ -2117,9 +1780,9 @@ ActiveRecord::Schema.define(:version => 20160601073753) do
t.integer "absence_penalty", :default => 0 t.integer "absence_penalty", :default => 0
t.float "system_score", :default => 0.0 t.float "system_score", :default => 0.0
t.boolean "is_test", :default => false t.boolean "is_test", :default => false
t.float "work_score"
t.integer "simi_id" t.integer "simi_id"
t.integer "simi_value" t.integer "simi_value"
t.float "work_score"
end end
add_index "student_works", ["homework_common_id", "user_id"], :name => "index_student_works_on_homework_common_id_and_user_id" add_index "student_works", ["homework_common_id", "user_id"], :name => "index_student_works_on_homework_common_id_and_user_id"
@ -2167,13 +1830,13 @@ ActiveRecord::Schema.define(:version => 20160601073753) do
create_table "sub_domains", :force => true do |t| create_table "sub_domains", :force => true do |t|
t.integer "org_subfield_id" t.integer "org_subfield_id"
t.integer "priority" t.integer "priority", :default => 0
t.string "name" t.string "name"
t.string "field_type" t.string "field_type"
t.integer "hide" t.integer "hide", :default => 0
t.integer "status" t.integer "status", :default => 0
t.datetime "created_at", :null => false t.datetime "created_at", :null => false
t.datetime "updated_at", :null => false t.datetime "updated_at", :null => false
end end
create_table "subfield_subdomain_dirs", :force => true do |t| create_table "subfield_subdomain_dirs", :force => true do |t|
@ -2183,16 +1846,15 @@ ActiveRecord::Schema.define(:version => 20160601073753) do
t.datetime "updated_at", :null => false t.datetime "updated_at", :null => false
end end
create_table "subscriptions", :force => true do |t| create_table "syllabuses", :force => true do |t|
t.string "title"
t.text "description"
t.integer "user_id" t.integer "user_id"
t.integer "subscribable_id" t.datetime "created_at", :null => false
t.string "subscribable_type" t.datetime "updated_at", :null => false
t.boolean "subscribed"
t.datetime "created_at"
t.datetime "updated_at"
end end
add_index "subscriptions", ["subscribable_id", "subscribable_type", "user_id"], :name => "subscriptions_user_id_and_ref_fields", :unique => true add_index "syllabuses", ["user_id"], :name => "index_syllabuses_on_user_id"
create_table "system_messages", :force => true do |t| create_table "system_messages", :force => true do |t|
t.integer "user_id" t.integer "user_id"
@ -2434,17 +2096,6 @@ ActiveRecord::Schema.define(:version => 20160601073753) do
add_index "users", ["id", "type"], :name => "index_users_on_id_and_type" add_index "users", ["id", "type"], :name => "index_users_on_id_and_type"
add_index "users", ["type"], :name => "index_users_on_type" add_index "users", ["type"], :name => "index_users_on_type"
create_table "users_star_projects", :force => true do |t|
t.integer "project_id", :null => false
t.integer "user_id", :null => false
t.datetime "created_at"
t.datetime "updated_at"
end
add_index "users_star_projects", ["project_id"], :name => "index_users_star_projects_on_project_id"
add_index "users_star_projects", ["user_id", "project_id"], :name => "index_users_star_projects_on_user_id_and_project_id", :unique => true
add_index "users_star_projects", ["user_id"], :name => "index_users_star_projects_on_user_id"
create_table "versions", :force => true do |t| create_table "versions", :force => true do |t|
t.integer "project_id", :default => 0, :null => false t.integer "project_id", :default => 0, :null => false
t.string "name", :default => "", :null => false t.string "name", :default => "", :null => false
@ -2496,23 +2147,6 @@ ActiveRecord::Schema.define(:version => 20160601073753) do
t.datetime "updated_at", :null => false t.datetime "updated_at", :null => false
end end
create_table "web_hooks", :force => true do |t|
t.string "url"
t.integer "project_id"
t.datetime "created_at"
t.datetime "updated_at"
t.string "type", :default => "ProjectHook"
t.integer "service_id"
t.boolean "push_events", :default => true, :null => false
t.boolean "issues_events", :default => false, :null => false
t.boolean "merge_requests_events", :default => false, :null => false
t.boolean "tag_push_events", :default => false
t.boolean "note_events", :default => false, :null => false
end
add_index "web_hooks", ["created_at", "id"], :name => "index_web_hooks_on_created_at_and_id"
add_index "web_hooks", ["project_id"], :name => "index_web_hooks_on_project_id"
create_table "wechat_logs", :force => true do |t| create_table "wechat_logs", :force => true do |t|
t.string "openid", :null => false t.string "openid", :null => false
t.text "request_raw" t.text "request_raw"

@ -550,7 +550,7 @@ function check_late_penalty(id)
} }
else else
{ {
obj.val("0"); obj.val("");
} }
} }

@ -194,9 +194,11 @@ $(function(){
$("#GroupPopupBox").dialog("open"); $("#GroupPopupBox").dialog("open");
$(".ui-dialog-titlebar").hide(); $(".ui-dialog-titlebar").hide();
$("a.popClose").on('click', function(){ $("a.popClose").on('click', function(){
reset_group_attr();
$("#GroupPopupBox" ).dialog("close"); $("#GroupPopupBox" ).dialog("close");
}); });
$("#cancel_group").on('click', function(){ $("#cancel_group").on('click', function(){
reset_group_attr();
$("#GroupPopupBox" ).dialog("close"); $("#GroupPopupBox" ).dialog("close");
}); });
$('#min_num').focus(); $('#min_num').focus();
@ -351,29 +353,67 @@ $(function(){
$("#GroupPopupBox").dialog("open"); $("#GroupPopupBox").dialog("open");
$(".ui-dialog-titlebar").hide(); $(".ui-dialog-titlebar").hide();
$("a.popClose").on('click', function () { $("a.popClose").on('click', function () {
reset_group_attr();
$("#GroupPopupBox").dialog("close"); $("#GroupPopupBox").dialog("close");
}); });
$("#cancel_group").on('click', function () { $("#cancel_group").on('click', function () {
reset_group_attr();
$("#GroupPopupBox").dialog("close"); $("#GroupPopupBox").dialog("close");
}); });
$('#min_num').focus(); $('#min_num').focus();
} }
}); });
var reset_group_attr = function() {
$("#min_num_notice").hide();
$("#min_max_num_notice").hide();
$("#max_num_notice").hide();
if($("input[name=min_num]").length > 0 && $("input[name=max_num]").length > 0) {
$("#min_num").val($("input[name=min_num]").val());
$("#max_num").val($("input[name=max_num]").val());
} else {
$("#min_num").val(2);
$("#max_num").val(10);
}
};
var saveGroupAttr = function() { var saveGroupAttr = function() {
var valid = true; var valid = true;
var base_on_project = 0; var base_on_project = 0;
var min = $.trim($("#min_num").val()); var min = $.trim($("#min_num").val());
var max = $.trim($("#max_num").val()); var max = $.trim($("#max_num").val());
if(min.length <= 0) { var regex = /^\d+$/;
if(!regex.test(min) || parseInt(min) <= 0) {
$("#min_num_notice").html("请输入正整数");
$("#max_num_notice").html("");
$("#min_max_num_notice").html("");
$("#min_num_notice").show();
$("#min_num").focus(); $("#min_num").focus();
valid = false;
return false; return false;
} else {
$("#min_num_notice").html("");
$("#min_num_notice").hide();
}
if(!regex.test(max) || parseInt(max) <= 0) {
$("#max_num_notice").html("请输入正整数");
$("#min_num_notice").html("");
$("#min_max_num_notice").html("");
$("#max_num_notice").show();
$("#max_num").focus();
return false;
} else {
$("#max_num_notice").html("");
$("#max_num_notice").hide();
} }
if(max.length <= 0) { if(parseInt(min) > parseInt(max)) {
$("#min_max_num_notice").html("最小人数不得大于最大人数");
$("#min_num_notice").html("");
$("#max_num_notice").html("");
$("#min_max_num_notice").show();
$("#max_num").focus(); $("#max_num").focus();
valid = false;
return false; return false;
} else {
$("#min_max_num_notice").html("");
$("#min_max_num_notice").hide();
} }
if ($("#base_on_project").is(":checked")) { if ($("#base_on_project").is(":checked")) {
base_on_project = 1; base_on_project = 1;

@ -259,6 +259,24 @@ function regex_evaluation_end(){
} }
} }
//处理迟交、缺评扣分
function check_late_penalty(id)
{
var obj = $("#" + id);
var regex = /^\d+$/;
if(regex.test(obj.val()))
{
if(obj.val() > 50)
{
obj.val("50");
}
}
else
{
obj.val("");
}
}
//验证匿评数量 //验证匿评数量
function regex_evaluation_num(){ function regex_evaluation_num(){
var evaluation_num = $.trim($("#evaluation_num").val()); var evaluation_num = $.trim($("#evaluation_num").val());

@ -0,0 +1,5 @@
require 'rails_helper'
RSpec.describe SyllabusesController, :type => :controller do
end

@ -0,0 +1,9 @@
# Read about factories at https://github.com/thoughtbot/factory_girl
FactoryGirl.define do
factory :syllabus do
title "MyString"
description "MyText"
user nil
end
end

@ -0,0 +1,5 @@
require 'rails_helper'
RSpec.describe Syllabus, :type => :model do
pending "add some examples to (or delete) #{__FILE__}"
end
Loading…
Cancel
Save