Conflicts:
	app/helpers/users_helper.rb
	app/views/layouts/base_users_new.html.erb
This commit is contained in:
zhangshenjerry 2015-07-24 08:58:56 +08:00
commit d639942b82
40 changed files with 433 additions and 428 deletions

View File

@ -514,6 +514,8 @@ private
end
def has_login
render_403 unless User.current.logged?
unless @attachment && @attachment.container_type == "PhoneAppVersion"
render_403 unless User.current.logged?
end
end
end

View File

@ -20,11 +20,10 @@ class CoursesController < ApplicationController
menu_item l(:label_sort_by_influence), :only => :index
before_filter :can_show_course, :except => []
before_filter :logged_user_by_apptoken,:only => [:show,:new_homework,:feedback]
before_filter :find_course, :except => [ :index, :search,:list, :new,:join,:unjoin, :create, :copy, :statistics, :new_join, :course, :enterprise_course, :course_enterprise,:view_homework_attaches,:join_private_courses]
before_filter :authorize_course, :only => [:show, :settings, :edit, :update, :modules, :close, :reopen, :view_homework_attaches, :course]
before_filter :authorize_course_global, :only => [:view_homework_attaches, :new,:create]
before_filter :require_admin, :only => [:copy, :archive, :unarchive, :destroy, :calendar]
before_filter :logged_user_by_apptoken,:only => [:show,:feedback]
before_filter :find_course, :except => [ :index, :search, :new,:join,:unjoin, :create, :new_join, :course,:join_private_courses]
before_filter :authorize_course, :only => [:show, :settings, :update, :course]
before_filter :authorize_course_global, :only => [:new,:create]
before_filter :toggleCourse, :only => [:finishcourse, :restartcourse]
before_filter :require_login, :only => [:join, :unjoin]
@ -809,6 +808,12 @@ class CoursesController < ApplicationController
end
end
#删除课程
#删除课程只是将课程的is_delete状态改为falseis_delete为false状态的课程只有管理员可以看到
def destroy
end
private
def allow_join course
if course_endTime_timeout? course

View File

@ -18,31 +18,31 @@ class HomeworkCommonController < ApplicationController
end
def new
@homework_type = "1"
@homework = HomeworkCommon.new
@homework.safe_attributes = params[:homework_common]
@homework.late_penalty = 0
@homework.end_time = (Time.now + 3600 * 24).strftime('%Y-%m-%d')
@homework.publish_time = Time.now.strftime('%Y-%m-%d')
if @homework_type == "1"
#匿评作业相关属性
@homework_detail_manual = HomeworkDetailManual.new
@homework_detail_manual.ta_proportion = 0.6
@homework_detail_manual.absence_penalty = 0
@homework_detail_manual.evaluation_num = 3
@homework_detail_manual.evaluation_start = Time.now.strftime('%Y-%m-%d')
@homework_detail_manual.evaluation_end = (Time.now + 3600 * 24).strftime('%Y-%m-%d')
@homework.homework_detail_manual = @homework_detail_manual
elsif @homework_type == "2"
#编程作业相关属性
@homework_detail_programing = HomeworkDetailPrograming.new
@homework.homework_detail_programing = @homework_detail_programing
end
respond_to do |format|
format.html
end
# @homework_type = "1"
#
# @homework = HomeworkCommon.new
# @homework.safe_attributes = params[:homework_common]
# @homework.late_penalty = 0
# @homework.end_time = (Time.now + 3600 * 24).strftime('%Y-%m-%d')
# @homework.publish_time = Time.now.strftime('%Y-%m-%d')
#
# if @homework_type == "1"
# #匿评作业相关属性
# @homework_detail_manual = HomeworkDetailManual.new
# @homework_detail_manual.ta_proportion = 0.6
# @homework_detail_manual.absence_penalty = 0
# @homework_detail_manual.evaluation_num = 3
# @homework_detail_manual.evaluation_start = Time.now.strftime('%Y-%m-%d')
# @homework_detail_manual.evaluation_end = (Time.now + 3600 * 24).strftime('%Y-%m-%d')
# @homework.homework_detail_manual = @homework_detail_manual
# elsif @homework_type == "2"
# #编程作业相关属性
# @homework_detail_programing = HomeworkDetailPrograming.new
# @homework.homework_detail_programing = @homework_detail_programing
# end
# respond_to do |format|
# format.html
# end
end
#新建作业下一步
@ -93,7 +93,7 @@ class HomeworkCommonController < ApplicationController
if homework.homework_type == 2
homework_detail_programing = HomeworkDetailPrograming.new
homework_detail_programing.language = "C++"
homework_detail_programing.language = params[:language]
homework_detail_programing.standard_code = params[:standard_code]
homework_detail_programing.ta_proportion = params[:ta_proportion] || 0.6
question = {title:homework.name,content:homework.description}
@ -209,7 +209,7 @@ class HomeworkCommonController < ApplicationController
end
if @homework.homework_type == 2 && @homework_detail_programing #编程作业
@homework_detail_programing.language = "C++"
@homework_detail_programing.language = params[:language]
@homework_detail_programing.standard_code = params[:standard_code]
@homework_detail_programing.ta_proportion = params[:ta_proportion] || 0.6
homework_tests = @homework.homework_tests
@ -236,6 +236,25 @@ class HomeworkCommonController < ApplicationController
end
end
end
#发送修改作业的请求
question = {title:@homework.name,content:@homework.description}
question[:input] = []
question[:output] = []
@homework.homework_tests.each do |test|
question[:input] << test.input
question[:output] << test.output
end
uri = URI("http://192.168.80.21:8080/api/questions/#{@homework_detail_programing.question_id}.json")
body = question.to_json
res = Net::HTTP.new(uri.host, uri.port).start do |client|
request = Net::HTTP::Put.new(uri.path)
request.body = body
request["Content-Type"] = "application/json"
client.request(request)
end
result = JSON.parse(res.body)
homework_detail_programing.question_id = result["id"] if result["status"] && result["status"] == 0
end
@homework.save_attachments(params[:attachments])

View File

@ -73,8 +73,14 @@ class NewsController < ApplicationController
@news_count = scope.count
#@news_pages = Paginator.new @news_count, @limit, params['page']
#@offset ||= scope_page.offset
scope_order = scope.all(:include => [:author, :course],
:order => "#{News.table_name}.created_on DESC")
if params[:subject].nil?
scope_order = scope.all(:include => [:author, :course],
:order => "#{News.table_name}.created_on DESC")
else
scope_order = scope.where("news.title like '#{'%' << params[:subject].to_s << '%'}'").all(:include => [:author, :course],
:order => "#{News.table_name}.created_on DESC")
end
# :offset => @offset,
# :limit => @limit)
@newss = paginateHelper scope_order,10
@ -83,6 +89,7 @@ class NewsController < ApplicationController
@news = News.new
render :layout => 'base_courses'
}
format.js
format.api
format.atom { render_feed(@newss, :title => (@course ? @course.name : Setting.app_title) + ": #{l(:label_news_plural)}") }
end
@ -141,7 +148,7 @@ class NewsController < ApplicationController
ids = params[:asset_id].split(',')
update_kindeditor_assets_owner ids,@news.id,OwnerTypeHelper::NEWS
end
# 与我相关动态的记录add start
# <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ض<EFBFBD>̬<EFBFBD>ļ<EFBFBD>¼add start
teachers = searchTeacherAndAssistant(@course)
for teacher in teachers
if(teacher.user_id != User.current.id)
@ -155,7 +162,7 @@ class NewsController < ApplicationController
notify.save()
end
end
# 与我相关动态的记录add end
# <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ض<EFBFBD>̬<EFBFBD>ļ<EFBFBD>¼add end
render_attachment_warning_if_needed(@news)
flash[:notice] = l(:notice_successful_create)
redirect_to course_news_index_url(@course)

View File

@ -484,7 +484,18 @@ update
if params[:repository_id].present?
@repository = @project.repositories.find_by_identifier_param(params[:repository_id])
else
@repository = @project.repository
# 多版本库,如果一个版本库为空则去下一个
rep_count = @project.repositories.count
if @project.repository.nil?
for i in 0..rep_count
unless @project.repositories[i].nil?
@repository = @project.repositories[i]
break
end
end
else
@repository = @project.repository
end
end
(render_404; return false) unless @repository
@path = params[:path].is_a?(Array) ? params[:path].join('/') : params[:path].to_s

View File

@ -128,7 +128,7 @@ class StudentWorkController < ApplicationController
solutions = {
student_work_id:stundet_work.id,
src:Base64.encode64(stundet_work.description),
language:1
language:@homework.homework_detail_programing.language
}
uri = URI(url)
body = solutions.to_json
@ -157,7 +157,7 @@ class StudentWorkController < ApplicationController
end
def edit
if @homework.homework_type == 2 #编程作业不能修改作业
if !User.current.admin? && @homework.homework_type == 2 #编程作业不能修改作业
render_403
else
respond_to do |format|
@ -396,6 +396,7 @@ class StudentWorkController < ApplicationController
if student_work_test.result == 0
student_score_count += 1
end
student_work_test.error_msg = params[:compile_error_msg]
student_work_test.save!
end
end
@ -444,7 +445,7 @@ class StudentWorkController < ApplicationController
#判断是不是当前作品的提交者
#提交者 && (非匿评作业 || 未开启匿评) 可以编辑作品
def author_of_work
render_403 unless (User.current.id == @work.user_id || User.current.admin?) && (@homework.homework_type != 1 || @homework.homework_detail_manual.comment_status == 1 )
render_403 unless User.current.admin? || (User.current.id == @work.user_id && @homework.homework_type != 1 || @homework.homework_detail_manual.comment_status == 1 )
end
def teacher_of_course
@ -467,22 +468,60 @@ class StudentWorkController < ApplicationController
sheet1 = book.create_worksheet :name => "homework"
blue = Spreadsheet::Format.new :color => :blue, :weight => :bold, :size => 10
sheet1.row(0).default_format = blue
sheet1.row(0).concat([l(:excel_user_id),l(:excel_user_name),l(:excel_nickname),l(:excel_student_id),l(:excel_mail),l(:excel_homework_name),
l(:excel_t_score),l(:excel_ta_score),l(:excel_n_score),l(:excel_f_score),l(:excel_commit_time)])
count_row = 1
items.each do |homework|
sheet1[count_row,0]=homework.user.id
sheet1[count_row,1] = homework.user.lastname.to_s + homework.user.firstname.to_s
sheet1[count_row,2] = homework.user.login
sheet1[count_row,3] = homework.user.user_extensions.student_id
sheet1[count_row,4] = homework.user.mail
sheet1[count_row,5] = homework.name
sheet1[count_row,6] = homework.teacher_score.nil? ? l(:label_without_score) : format("%.2f",homework.teacher_score)
sheet1[count_row,7] = homework.teaching_asistant_score.nil? ? l(:label_without_score) : format("%.2f",homework.teaching_asistant_score)
sheet1[count_row,8] = homework.student_score.nil? ? l(:label_without_score) : format("%.2f",homework.student_score)
sheet1[count_row,9] = homework.respond_to?("score") ? homework.score.nil? ? l(:label_without_score) : format("%.2f",homework.score) : l(:label_without_score)
sheet1[count_row,10] = format_time(homework.created_at)
count_row += 1
if @homework.homework_type == 0 #普通作业
sheet1.row(0).concat([l(:excel_user_id),l(:excel_user_name),l(:excel_nickname),l(:excel_student_id),l(:excel_mail),l(:excel_homework_name),
l(:excel_t_score),l(:excel_ta_score),l(:excel_f_score),l(:excel_commit_time)])
count_row = 1
items.each do |homework|
sheet1[count_row,0]=homework.user.id
sheet1[count_row,1] = homework.user.lastname.to_s + homework.user.firstname.to_s
sheet1[count_row,2] = homework.user.login
sheet1[count_row,3] = homework.user.user_extensions.student_id
sheet1[count_row,4] = homework.user.mail
sheet1[count_row,5] = homework.name
sheet1[count_row,6] = homework.teacher_score.nil? ? l(:label_without_score) : format("%.2f",homework.teacher_score)
sheet1[count_row,7] = homework.teaching_asistant_score.nil? ? l(:label_without_score) : format("%.2f",homework.teaching_asistant_score)
# sheet1[count_row,8] = homework.student_score.nil? ? l(:label_without_score) : format("%.2f",homework.student_score)
sheet1[count_row,8] = homework.respond_to?("score") ? homework.score.nil? ? l(:label_without_score) : format("%.2f",homework.score) : l(:label_without_score)
sheet1[count_row,9] = format_time(homework.created_at)
count_row += 1
end
elsif @homework.homework_type == 1 #匿评作业
sheet1.row(0).concat([l(:excel_user_id),l(:excel_user_name),l(:excel_nickname),l(:excel_student_id),l(:excel_mail),l(:excel_homework_name),
l(:excel_t_score),l(:excel_ta_score), l(:excel_n_score),l(:excel_f_score),l(:excel_commit_time)])
count_row = 1
items.each do |homework|
sheet1[count_row,0]=homework.user.id
sheet1[count_row,1] = homework.user.lastname.to_s + homework.user.firstname.to_s
sheet1[count_row,2] = homework.user.login
sheet1[count_row,3] = homework.user.user_extensions.student_id
sheet1[count_row,4] = homework.user.mail
sheet1[count_row,5] = homework.name
sheet1[count_row,6] = homework.teacher_score.nil? ? l(:label_without_score) : format("%.2f",homework.teacher_score)
sheet1[count_row,7] = homework.teaching_asistant_score.nil? ? l(:label_without_score) : format("%.2f",homework.teaching_asistant_score)
sheet1[count_row,8] = homework.student_score.nil? ? l(:label_without_score) : format("%.2f",homework.student_score)
sheet1[count_row,9] = homework.respond_to?("score") ? homework.score.nil? ? l(:label_without_score) : format("%.2f",homework.score) : l(:label_without_score)
sheet1[count_row,10] = format_time(homework.created_at)
count_row += 1
end
elsif @homework.homework_type == 2 #编程作业
sheet1.row(0).concat([l(:excel_user_id),l(:excel_user_name),l(:excel_nickname),l(:excel_student_id),l(:excel_mail),l(:excel_homework_name),
l(:excel_t_score),l(:excel_ta_score), l(:excel_s_score),l(:excel_f_score),l(:excel_commit_time)])
count_row = 1
items.each do |homework|
sheet1[count_row,0]=homework.user.id
sheet1[count_row,1] = homework.user.lastname.to_s + homework.user.firstname.to_s
sheet1[count_row,2] = homework.user.login
sheet1[count_row,3] = homework.user.user_extensions.student_id
sheet1[count_row,4] = homework.user.mail
sheet1[count_row,5] = homework.name
sheet1[count_row,6] = homework.teacher_score.nil? ? l(:label_without_score) : format("%.2f",homework.teacher_score)
sheet1[count_row,7] = homework.teaching_asistant_score.nil? ? l(:label_without_score) : format("%.2f",homework.teaching_asistant_score)
sheet1[count_row,8] = homework.student_score.nil? ? l(:label_without_score) : format("%.2f",homework.student_score)
sheet1[count_row,9] = homework.respond_to?("score") ? homework.score.nil? ? l(:label_without_score) : format("%.2f",homework.score) : l(:label_without_score)
sheet1[count_row,10] = format_time(homework.created_at)
count_row += 1
end
end
book.write xls_report
xls_report.string

View File

@ -448,7 +448,7 @@ class UsersController < ApplicationController
def user_courses4show
query = Course.joins("join members m on #{Course.table_name}.id=m.course_id")
query = query.where("m.user_id = ?",@user.id)
query = query.where("m.user_id = ?",@user.id).order("#{Course.table_name}.id desc")
if User.current == @user #看自己
else
if @user.user_extensions!=nil && @user.user_extensions.identity == 0 #看老师
@ -456,13 +456,12 @@ class UsersController < ApplicationController
query = query.where("r.role_id in(3,7,9)")
end
query = query.where(Course.table_name+".is_public = 1")
# or exists (select 1 from courses c2,members m2 where c2.id=m2.course_id and c2.id=#{Course.table_name}.id and m2.user_id= User.current.id)
end
if params[:lastid]!=nil && !params[:lastid].empty?
query = query.where("( (#{Course.table_name}.updated_at=? and #{Course.table_name}.id < ?) or #{Course.table_name}.updated_at<?)",params[:lasttime],params[:lastid],params[:lasttime])
query = query.where(" #{Course.table_name}.id < ?",params[:lastid],)
end
@list = query.order("#{Course.table_name}.updated_at desc,#{Course.table_name}.id desc").limit(8).all
@list = query.limit(8)
render :layout=>nil
end

View File

@ -1824,7 +1824,9 @@ module ApplicationHelper
def attachment_candown attachment
candown = false
if attachment.container
if attachment.container.class.to_s != "HomeworkAttach" && attachment.container.class.to_s != "StudentWork" && (attachment.container.has_attribute?(:project) || attachment.container.has_attribute?(:project_id)) && attachment.container.project
if attachment.container.class.to_s=="PhoneAppVersion"
candown = true
elsif attachment.container.class.to_s != "HomeworkAttach" && attachment.container.class.to_s != "StudentWork" && (attachment.container.has_attribute?(:project) || attachment.container.has_attribute?(:project_id)) && attachment.container.project
project = attachment.container.project
candown= User.current.member_of?(project) || (project.is_public && attachment.is_public == 1)
elsif attachment.container.is_a?(Project)
@ -1850,8 +1852,7 @@ module ApplicationHelper
candown = true
elsif attachment.container.class.to_s=="StudentWork"
candown = true
elsif attachment.container.class.to_s=="PhoneAppVersion"
candown = true
elsif attachment.container_type == "Bid" && attachment.container && attachment.container.courses
course = attachment.container.courses.first
candown = User.current.member_of_course?(attachment.container.courses.first) || (course.is_public == 1 && attachment.is_public == 1)

View File

@ -27,6 +27,19 @@ module HomeworkCommonHelper
type
end
def programing_languages_options
type = []
option = []
option << "C"
option << 1
type << option
option_1 = []
option_1 << "C++"
option_1 << 2
type << option_1
type
end
#缺评扣分
def absence_penalty_option
type = []

View File

@ -20,9 +20,9 @@ module PraiseTreadHelper
# when 0
# return @record.tread_num.nil? ? 0 : @record.tread_num
# end
return (@record.praise_num.to_i-@record.tread_num.to_i)
return ((@record.praise_num.nil? ? 0 : @record.praise_num.to_i)-(@record.tread_num.nil? ? 0 : @record.tread_num.to_i))
else
return 0
return 0
end
end

View File

@ -328,73 +328,41 @@ module UsersHelper
return [0,[]]
end
list = query.order("updated_on desc").limit(10).all
return [count,list];
return [count,list]
end
def get_create_course_count(user)
return Course.where("tea_id = ?",user.id).count()
if user == User.current
user.courses.count
else
user.courses.where("is_public = 1").count
end
end
def get_join_course_count(user)
((user.coursememberships.count() - get_create_course_count(user)) < 0) ? 0 : user.coursememberships.count() - get_create_course_count(user)
user.coursememberships.count - get_create_course_count(user)
end
def get_homework_commons_count(user)
return HomeworkCommon.where("user_id = ?",user.id).count()
HomeworkCommon.where("user_id = ?",user.id).count
end
def get_projectandcourse_attachment_count(user)
return Attachment.where("author_id = ? and container_type in ('Project','Course')",user.id).count()
Attachment.where("author_id = ? and container_type in ('Project','Course')",user.id).count
end
def get_create_project_count(user)
return Project.where("user_id = ? and project_type = ?",user.id,Project::ProjectType_project).count()
Project.where("user_id = ? and project_type = ?",user.id,Project::ProjectType_project).count
end
def get_join_project_count(user)
return user.memberships.count(conditions: "projects.project_type = #{Project::ProjectType_project}") - get_create_project_count(user)
user.memberships.count(conditions: "projects.project_type = #{Project::ProjectType_project}") - get_create_project_count(user)
end
def get_create_issue_count(user)
return Issue.where("author_id = ?",user.id).count()
Issue.where("author_id = ?",user.id).count
end
def get_resolve_issue_count(user)
return Issue.where("assigned_to_id = ? and status_id=3",user.id).count()
Issue.where("assigned_to_id = ? and status_id=3",user.id).count
end
def get_anonymous_evaluation_count(user)
return StudentWorksScore.where("user_id = ? and reviewer_role=3",user.id).count()
StudentWorksScore.where("user_id = ? and reviewer_role=3",user.id).count
end
# def query_activities(query,type)
# query_rec_count = 8
# # query = query.where("act_type='JournalsForMessage'")
# #query = query.where("act_type not in (?)", ['JournalsForMessage','Message','HomeworkCommon','News','Issue','Journal','Poll'])
# list = query.order("id desc").limit(query_rec_count).all
#
# result = [];
# for item in list
# container = get_activity_container(item,type)
# if( activity_is_show(item,container) )
# result << { :item=>item,:e=>container }
# end
# end
# return [lastid,result]
# end
# def get_activity_container activity,type
# e = nil;
# if type == 'Project'
# if activity.act_type == 'Poll'
# # 项目没有问卷
# # e = Project.find_by_id(activity.act.polls_group_id)
# else
# e = activity.act.project if activity.act.respond_to?('project')
# end
# end
# if type == 'Course'
# if activity.act_type == 'Poll'
# e = Course.find_by_id(activity.act.polls_group_id)
# else
# e = activity.act.course if activity.act.respond_to?('course')
# end
# end
#
# return e;
# end
def query_activities(query)
list = query.limit(8).all
result = [];
@ -406,31 +374,8 @@ module UsersHelper
end
def get_activity_container activity
return activity.activity_container
# if type == 'Project'
# return activity.act.project if activity.act.respond_to?('project')
# end
# if type == 'Course'
# if activity.act_type == 'Poll'
# return Course.find_by_id(activity.act.polls_group_id)
# end
# return activity.act.course if activity.act.respond_to?('course')
# end
# return nil;
end
# def activity_is_show(activity,e)
# if(!e)
# return false
# end
#
# if activity.user_id == User.current.id
# return true
# end
# if( e.visible? )
# return true
# end
# return false
# end
def get_activity_act_showname_htmlclear(activity)
str = get_activity_act_showname(activity)
str = str.gsub(/<.*>/,'')

View File

@ -2,5 +2,5 @@ class HomeworkTest < ActiveRecord::Base
attr_accessible :input, :output, :homework_common_id
belongs_to :homework_common
has_one :student_work_test
has_many :student_work_test
end

View File

@ -7,7 +7,7 @@ class StudentWork < ActiveRecord::Base
has_many :student_works_evaluation_distributions, :dependent => :destroy
has_many :student_works_scores, :dependent => :destroy
belongs_to :project
has_one :student_work_test
has_many :student_work_test
before_destroy :delete_praise

View File

@ -1,6 +1,6 @@
# encoding: utf-8
class StudentWorkTest < ActiveRecord::Base
attr_accessible :student_work_id, :homework_test_id, :result
attr_accessible :student_work_id, :homework_test_id, :result, :error_msg
belongs_to :homework_test
belongs_to :student_work

View File

@ -63,7 +63,7 @@
:member_id => member.id,
:remote => true},
:class => 'ml258 c_red' %>
<span class="ml65 c_grey"><%= format_date(member.created_on)%></span>
<span class="fr mr15 c_grey"><%= format_date(member.created_on)%></span>
<%= call_hook(:view_projects_settings_members_table_row, { :course => @course, :member => member}) %>
</div>
<div class="cl"></div>

View File

@ -56,9 +56,7 @@
<ul>
<li >
<label class="label02">&nbsp;开发语言:&nbsp;</label>
<select class="fl mb10 h26 w150" >
<option>C</option>
</select>
<%= select_tag :language,options_for_select(programing_languages_options,homework.homework_detail_programing.language.to_i), {:class => "fl mb10 h26 w70"} %>
<div class="cl"></div>
</li>

View File

@ -1,17 +1,27 @@
<%= javascript_include_tag "/assets/kindeditor/kindeditor" %>
<%= error_messages_for 'homework_common' %>
<div class="project_r_h">
<h2 class="project_h2">
<%= l(:label_course_homework_new)%>
</h2>
</div>
<div class="hwork_new">
<%= labelled_form_for @homework,:url => {:controller => 'homework_common',:action => 'create'} do |f| %>
<%= hidden_field_tag "course",@course.id%>
<%= render :partial => 'homework_common/homework_detail_manual_form', :locals => { :homework => @homework,:f => f,:edit_mode => false } %>
<a href="javascript:void(0)" class="blue_btn fl mr10" onClick="submit_homework('new_homework_common');" >提交</a>
<%#= link_to "上一步", new_homework_common_path(:course => @course.id), :class => "orange_btn_homework fl"%>
<%= link_to '取消',homework_common_index_path(:course => @course.id),:class => 'grey_btn fl'%>
<div class="hwork_new" id="hwork_new">
<%= form_for("new_homework_common",:url => next_step_homework_common_index_path) do |f|%>
<input type="hidden" name="course" value="<%= @course.id%>">
<h3 class="c_blue f16 mb10">
请选择将要发布的作业类型
</h3>
<input type="radio" class="mb10 fl" name="homework_common_type" value="1" id="homework_detail_manual_radio" checked/>
<span class="ml5 fl">
人工评分的作业(支持匿名互评、灵活设置评分比例)
</span>
<div class="cl"></div>
<input type="radio" class="mb20 fl" name="homework_common_type" value="2" id="homework_detail_programing_radio"/>
<span class="ml5 fl">
自动评测的编程作业支持C/C++程序的自动评分)
</span>
<div class="cl"></div>
<a href="javascript:void(0);" class=" orange_btn" onclick="$(this).parent().submit();">
下一步
</a>
<% end%>
</div><!--hwork_new end-->
<div class="cl"></div>

View File

@ -19,77 +19,8 @@
<%= javascript_heads %>
<%= heads_for_theme %>
<%= call_hook :view_layouts_base_html_head %>
<!-- page specific tags -->
<%= yield :header_tags -%>
<!--
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>个人中心st</title>
<link href="css/public.css" rel="stylesheet" type="text/css" />
<link href="css/leftside.css" rel="stylesheet" type="text/css" />
<link href="css/users.css" rel="stylesheet" type="text/css" />
<script src="js/jquery-1.3.2.js" type="text/javascript"></script>
<script src="js/jquery-1.8.3-ui-1.9.2-ujs-2.0.3.js" type="text/javascript"></script>
<script type="text/javascript" src="js/sidebar.js"></script>
<script type="text/javascript" src="js/jquery.js"></script>
<script type="text/javascript" src="js/jquery-ui-1.8.4.custom.min.js"></script>
<script type="text/javascript" src="js/jQuery.peSlider.js"></script>
</script>
<script type="text/javascript">
//头部导航
var menuids=["TopUserNav"] //Enter id(s) of SuckerTree UL menus, separated by commas
function buildsubmenus(){
for (var i=0; i<menuids.length; i++){
var ultags=document.getElementById(menuids[i]).getElementsByTagName("ul")
for (var t=0; t<ultags.length; t++){
ultags[t].parentNode.getElementsByTagName("a")[0].className="subfolderstyle"
ultags[t].parentNode.onmouseover=function(){
this.getElementsByTagName("ul")[0].style.display="block"
}
ultags[t].parentNode.onmouseout=function(){
this.getElementsByTagName("ul")[0].style.display="none"
}
}
}
}
if (window.addEventListener)
window.addEventListener("load", buildsubmenus, false)
else if (window.attachEvent)
window.attachEvent("onload", buildsubmenus)
</script>
<script type="text/javascript">//侧导航
$(function(){
$(".subNav").click(function(){
$(this).toggleClass("currentDd").siblings(".subNav").removeClass("currentDd")
$(this).toggleClass("currentDt").siblings(".subNav").removeClass("currentDt")
// 修改数字控制速度, slideUp(500)控制卷起速度
$(this).next(".navContent").slideToggle(500).siblings(".navContent").slideUp(500);
})
})
</script>
<script type="text/javascript">
function show_window () {
$('#light').css('display','block');
$('#fade').css('display','block');
}
function close_window(){
$('#light').css('display','none');
$('#fade').css('display','none');
}
//弹框l
</script> -->
</head>
@ -103,12 +34,6 @@ $(".subNav").click(function(){
<%=link_to l(:field_homepage), home_path %> &gt; <%=link_to (@center_flag ? '个人中心' : '个人主页'), user_path(@user) %> &gt; <%=link_to @user.name, user_path(@user) %>
</p>
</div>
<!--<div class="search fl">-->
<!--<form class="search">-->
<!--<input type="text" name="serach" placeholder="输入关键词进行搜索" class="search_text fl">-->
<!--<a href="javascript:void(0);" class="search_btn fl f14 c_white" >搜 索</a>-->
<!--</form>-->
<!--</div>-->
</div><!--TopBar end-->
<div class="cl"></div>
@ -204,22 +129,18 @@ $(".subNav").click(function(){
<% if @center_flag %>
<div class="subNavBox ">
<div class="subNav "><a href="<%=url_for(:controller => 'users', :action => 'show',:id=>@user.id)%>" class=" f14 c_blue02">动态</a></div>
<div class="subNav"><a href="<%=url_for(:controller => 'users', :action => 'user_courses',:id=>@user.id)%>" class=" f14 c_blue02">我的课程<span style="font-weight:normal;font-size:12px;color:#FF5722;">(<%=@user.courses.count%>)</span></a></div>
<!--<ul class="navContent " >-->
<!--<li><a href="javascirpt:void();" >大学计算机基础</a></li>-->
<!--<li><a href="javascirpt:void();" >大牛软件核心知识开放课程</a></li>-->
<!--<li><a href="javascirpt:void();" >大学计算机基础</a></li>-->
<!--<li><a href="javascirpt:void();" >大牛软件核心知识开放课程</a></li>-->
<!--<li><a href="javascirpt:void();" >大学计算机基础</a></li>-->
<!--</ul>-->
<div class="subNav"><a href="<%=url_for(:controller => 'users', :action => 'user_projects',:id=>@user.id)%>" class=" f14 c_blue02">我的项目<span style="font-weight:normal;font-size:12px;color:#FF5722;">(<%=@user.projects.count%>)</span></a></div>
<!--<ul class="navContent " >-->
<!--<li><a href="javascirpt:void();" >Trustie-Forge</a></li>-->
<!--<li><a href="javascirpt:void();" >Trustie-weekly</a></li>-->
<!--<li><a href="javascirpt:void();" >大学计算机基础</a></li>-->
<!--<li><a href="javascirpt:void();" >大牛软件核心知识开放课程</a></li>-->
<!--<li><a href="javascirpt:void();" >大学计算机基础</a></li>-->
<!--</ul>-->
<div class="subNav subNav_jiantou">
<a href="<%=url_for(:controller => 'users', :action => 'user_courses',:id=>@user.id)%>" class=" f14 c_blue02">
我的课程
<span style="font-weight:normal;font-size:12px;color:#FF5722;">(<%=@user.courses.count%>)</span>
</a>
</div>
<div class="subNav subNav_jiantou">
<a href="<%=url_for(:controller => 'users', :action => 'user_projects',:id=>@user.id)%>" class=" f14 c_blue02">
我的项目
<span style="font-weight:normal;font-size:12px;color:#FF5722;">(<%=@user.projects.count%>)</span>
</a>
</div>
<div class="subNav "><a href="<%= url_for(:controller => 'my', :action => 'account') %>" class=" f14 c_blue02">编辑资料</a></div>
</div><!--侧导航 end-->
<% end %>

View File

@ -8,8 +8,9 @@
<% if @message.project %>
<%=h @message.board.project.name %> - <%=h @message.board.name %>: <%= link_to(h(@message.subject), @message_url,:style=>'color:#1b55a7; font-weight:bold;') %>
<% elsif @message.course %>
<%=h @message.board.course.name %> - <%=h @message.board.name %>: <%= link_to(h(@message.subject), @message_url,:style=>'color:#1b55a7; font-weight:bold;') %>
<% end %>
<%=h @message.board.course.name %> - <%=h @message.board.name %>:
<%= link_to(h(@message.subject), @message_url + "?topic_id=#{@message.id}&&parent_id=#{@message.parent_id ? @message.parent_id : @message.id}",:style=>'color:#1b55a7; font-weight:bold;') %>
<% end %>
</span><%= l(:mail_issue_title_active)%></p>
<div class="mail_box" style="border:1px solid #c8c8c8; width:570px; height: auto; padding:15px; margin-top:10px; margin-bottom:10px;">
<ul style="list-style-type:none; margin:0; padding:0;">

View File

@ -7,7 +7,9 @@
<%= javascript_include_tag "/assets/kindeditor/kindeditor",'/assets/kindeditor/pasteimg' %>
<div class="lz">
<!-- 在这里添加赞和踩-->
<span id="praise_tread" style="float: right"> <%= render :partial => "/praise_tread/praise_tread",:locals => {:obj => @memo,:show_flag => true,:user_id =>User.current.id,:horizontal => true}%> </span>
<span id="praise_tread" style="float: right">
<%= render :partial => "/praise_tread/praise_tread",:locals => {:obj => @memo,:show_flag => true,:user_id =>User.current.id,:horizontal => true}%>
</span>
<div class="lz-left">
<div>
<%= link_to image_tag(url_to_avatar(@memo.author), :class => "avatar"), user_path(@memo.author) %>

View File

@ -2,70 +2,39 @@
btn_tips = l(:label_news_notice)
label_tips = l(:label_course_news)
%>
<script>
function remote_search(){
$("#news_query_form").submit();
}
</script>
<div class="project_r_h">
<h2 class="project_h2"><%= label_tips %></h2>
</div>
<div class="talk_top">
<p class="fl">
<%= l(:label_total_news) %>
<span><%= @news_count %></span>
<%= l(:label_course_news_count) %>
</p>
<% if @course && User.current.allowed_to?(:manage_news, @course) %>
<%= link_to(btn_tips,new_course_news_path(@course),:class => 'problem_new_btn fl c_dorange')%>
<div class="cl"></div>
<div class="fl">
<p class="fl">
<%= l(:label_total_news) %>
<span><%= @news_count %></span>
<%= l(:label_course_news_count) %>
</p>
<% if @course && User.current.allowed_to?(:manage_news, @course) %>
<%= link_to(btn_tips,new_course_news_path(@course),:class => 'problem_new_btn fl c_dorange')%>
<div class="cl"></div>
<% end %>
<% end %>
</div>
<div class="problem_search fr" >
<%= form_tag({:controller => 'news', :action => 'index', :course_id => @course },:remote=>'true', :method => :get,:id=>"news_query_form", :class => 'query_form') do %>
<input class="problem_search_input fl" id="v_subject" placeholder="通知主题" type="text" name="subject" value="" onkeypress="" onkeydown="">
<a href="javascript:void(0)" class="problem_search_btn fl" onclick="remote_search();" >搜索</a>
<% end %>
</div><!--problem_search end-->
<div class="cl"></div>
</div>
<div id="news_list">
<%= render :partial => 'course_news_list', :locals=>{ :newss=>@newss,:obj_pages=>@obj_pages, :obj_count=>@obj_count} %>
<div>
<% if @newss.empty? %>
<p class="nodata">
<%= l(:label_no_data) %>
</p>
<% else %>
<% @newss.each do |news| %>
<div class="problem_main upload_img">
<%= link_to image_tag(url_to_avatar(news.author),:width => 42,:height => 42), user_path(news.author), :class => "problem_pic fl" %>
<div class="problem_txt fl mt5">
<%= link_to_user_header(news.author,false,{:class=> 'problem_name c_orange fl'}) if news.respond_to?(:author) %>
<span class="fl">
<%= l(:label_release_news) %>
</span>
<%= link_to h(news.title), news_path(news),:class => 'problem_tit fl fb c_dblue' %>
<%=link_to "<span class = 'pic_mes'>#{news.comments.all.count}</span>".html_safe, news_path(news.id), :class => "pro_mes_w" %>
<br />
<div class="cl mb5"></div>
<script>
$(function(){if($("#news_description_<%= news.id%>_content").height()>360){$("#news_foot_<%= news.id%>").show();}});
</script>
<div id="news_description_<%= news.id%>" class="news_description mt5">
<div id="news_description_<%= news.id%>_content" class="upload_img">
<%= news.description.html_safe %>
</div>
</div>
<div class="cl"></div>
<div class="news_foot currentDd fr" style="cursor:pointer;display: none;" onclick="news_show_more_des(<%= news.id %>);" id="news_foot_<%= news.id %>">
[展开]
</div>
<div class="cl mb5"></div>
<span class="fl"><%= l(:label_create_time)%><%= format_time(news.created_on)%></span>
<%= link_to_attachments_course news %>
<div class="cl"></div>
<%#= render :partial => 'student_work/work_attachments', :locals => {:attachments => news.attachments} %>
</div>
<div class="cl"></div>
</div><!--problem_main end-->
<% end %>
<% end %>
</div>
<!--end-->
<ul class="wlist">
<%= pagination_links_full @obj_pages, @obj_count, :per_page_links => false, :remote => false, :flag => true%>
</ul>
<% content_for :header_tags do %>
<%= auto_discovery_link_tag(:atom, params.merge({:format => 'atom', :page => nil, :key => User.current.rss_key})) %>
<%= stylesheet_link_tag 'scm' %>

View File

@ -0,0 +1,47 @@
<div>
<% if newss.empty? %>
<p class="nodata">
<%= l(:label_no_data) %>
</p>
<% else %>
<% newss.each do |news| %>
<div class="problem_main upload_img">
<%= link_to image_tag(url_to_avatar(news.author),:width => 42,:height => 42), user_path(news.author), :class => "problem_pic fl" %>
<div class="problem_txt fl mt5">
<%= link_to_user_header(news.author,false,{:class=> 'problem_name c_orange fl'}) if news.respond_to?(:author) %>
<span class="fl">
<%= l(:label_release_news) %>
</span>
<%= link_to h(news.title), news_path(news),:class => 'problem_tit fl fb c_dblue' %>
<%=link_to "<span class = 'pic_mes'>#{news.comments.all.count}</span>".html_safe, news_path(news.id), :class => "pro_mes_w" %>
<br />
<div class="cl mb5"></div>
<script>
$(function(){if($("#news_description_<%= news.id%>_content").height()>360){$("#news_foot_<%= news.id%>").show();}});
</script>
<div id="news_description_<%= news.id%>" class="news_description mt5">
<div id="news_description_<%= news.id%>_content" class="upload_img">
<%= news.description.html_safe %>
</div>
</div>
<div class="cl"></div>
<div class="news_foot currentDd fr" style="cursor:pointer;display: none;" onclick="news_show_more_des(<%= news.id %>);" id="news_foot_<%= news.id %>">
[展开]
</div>
<div class="cl mb5"></div>
<span class="fl"><%= l(:label_create_time)%><%= format_time(news.created_on)%></span>
<%= link_to_attachments_course news %>
<div class="cl"></div>
<%#= render :partial => 'student_work/work_attachments', :locals => {:attachments => news.attachments} %>
</div>
<div class="cl"></div>
</div><!--problem_main end-->
<% end %>
<% end %>
</div>
<!--end-->
<ul class="wlist">
<%= pagination_links_full obj_pages, obj_count, :per_page_links => false, :remote => false, :flag => true%>
</ul>

View File

@ -0,0 +1 @@
$("#news_list").html("<%= escape_javascript(render :partial => 'course_news_list', :locals=>{ :newss=>@newss,:obj_pages=>@obj_pages, :obj_count=>@obj_count})%>");

View File

@ -43,97 +43,69 @@
</li>
<li>
<% if User.current.admin? %>
<a href="http://tsr.sei.pku.edu.cn/KnowledgeBaseDC/semantic-search.jsp?projectName=jena
" target="_Blank">软件知识库</a>
<%#= link_to l(:label_project_soft_knowledge) ,soft_knowledge_project_path(@project) %>
<% end %>
</li>
<li>
<% if User.current.admin? %>
<a href="http://tsr.sei.pku.edu.cn/home.action" target="_Blank">软件资源库</a>
<%#= link_to l(:label_project_soft_file) ,soft_file_project_path(@project) %>
<% end %>
</li>
<li>
<% if User.current.admin? %>
<%= link_to l(:label_project_dts_new) ,dts_dep_project_path(@project), data: { confirm:'你确定要对本项目进行代码缺陷测试分析吗?' } %>
<% end %>
</li>
<li>
<% if User.current.admin? %>
<a href="http://www.seforge.org/pop-php/" target="_Blank">在线开发平台</a>
<%#= link_to l(:label_project_online_dev) ,online_dev_project_path(@project) %>
<% end %>
</li>
<li>
<% if User.current.admin? %>
<a href="http://www.seforge.org/sase/" target="_Blank">软工服务平台</a>
<a href="http://202.197.34.33:3005/wsManagement/" target="_Blank">QoS评估工具</a>
<%#= link_to l(:label_project_soft_service) ,soft_service_project_path(@project) %>
<% end %>
</li>
<li>
<% if User.current.admin? %>
<a href="http://segdev.nju.edu.cn:8080/internetware/main.jsp" target="_Blank">形式验证工具</a>
<a href="http://202.197.34.33:3005/wsManagement/" target="_Blank">QoS证据采集工具</a>
<%#= link_to l(:label_project_soft_service) ,soft_service_project_path(@project) %>
<% end %>
</li>
<li>
<% if User.current.admin? %>
<a href="http://202.197.34.33:3005/wsManagement/" target="_Blank">QoS 评估工具</a>
<a href="http://202.197.34.33:3005/wsManagement/" target="_Blank">QoS证据评估统计分析工具</a>
<%#= link_to l(:label_project_soft_service) ,soft_service_project_path(@project) %>
<% end %>
</li>
<li>
<% if User.current.admin? %>
<a href="http://202.197.34.33:3005/wsManagement/" target="_Blank">QoS 证据采集工具</a>
<%#= link_to l(:label_project_soft_service) ,soft_service_project_path(@project) %>
<%= link_to "代码缺陷测试工具(DTS)" ,dts_dep_project_path(@project), data: { confirm:'你确定要对本项目进行代码缺陷测试分析吗?' } %>
<% end %>
</li>
<li>
<% if User.current.admin? %>
<a href="http://www.seforge.org/sase/" target="_Blank">软工服务平台(SASSP)</a>
<% end %>
</li>
<li>
<% if User.current.admin? %>
<a href="http://tsr.sei.pku.edu.cn/home.action" target="_Blank">软件知识库(KnowledgeBase)</a>
<% end %>
</li>
<li>
<% if User.current.admin? %>
<a href="http://segdev.nju.edu.cn:8080/internetware/main.jsp" target="_Blank">可信评估工具(Evaluator)</a>
<% end %>
</li>
<li>
<% if User.current.admin? %>
<a href="http://segdev.nju.edu.cn:8080/internetware/main.jsp" target="_Blank">在线验证工具(BACH-Online)</a>
<% end %>
</li>
<li>
<% if User.current.admin? %>
<a href="http://segdev.nju.edu.cn:8080/internetware/main.jsp" target="_Blank">软件测试工具(SSCC-Web)</a>
<% end %>
</li>
<li>
<% if User.current.admin? %>
<a href="http://www.service4all.org.cn/servicexchange/" target="_Blank">服务资源共享平台(ServiceXchange)</a>
<% end %>
</li>
<li>
<% if User.current.admin? %>
<a href="http://www.service4all.org.cn/repository/ServiceCloud/MyServiceContainer.jsp" target="_Blank">在线服务开发平台(ServiceFoundry)</a>
<% end %>
</li>
<li>
<% if User.current.admin? %>
<a href="http://www.service4all.org.cn" target="_Blank">组合开发和运行演化平台(Service4All)</a>
<% end %>
</li>
<li>
<% if User.current.admin? %>
<a href="http://segdev.nju.edu.cn:8080/internetware/main.jsp" target="_Blank">可信度评估工具 SAS
</a>
<%#= link_to l(:label_project_soft_service) ,soft_service_project_path(@project) %>
<% end %>
</li>
<li>
<% if User.current.admin? %>
<a href="http://segdev.nju.edu.cn:8080/internetware/main.jsp" target="_Blank">可信评估工具 Evaluator</a>
<%#= link_to l(:label_project_soft_service) ,soft_service_project_path(@project) %>
<% end %>
</li>
<li>
<% if User.current.admin? %>
<a href="http://segdev.nju.edu.cn:8080/internetware/main.jsp" target="_Blank">软件测试工具 SSCC-Web</a>
<%#= link_to l(:label_project_soft_service) ,soft_service_project_path(@project) %>
<% end %>
</li>
<!--<li>-->
<!--<%# unless @project.enabled_modules.where("name = 'dts'").empty? %>-->
<!--<%#= link_to l(:project_module_dts) ,share_show_path(@project) %>-->
<!--<%# end %>-->
<!--</li>-->
<li>
<% if User.current.admin? %>
<a href="http://202.197.34.33:3005/wsManagement/" target="_Blank">QoS 证据评估统计分析工具</a>
<%#= link_to l(:label_project_soft_service) ,soft_service_project_path(@project) %>
<% end %>
</li>
<li>
<% if User.current.admin? %>
<a href="http://segdev.nju.edu.cn:8080/internetware/main.jsp" target="_Blank">在线验证工具 BACH-Online</a>
<%#= link_to l(:label_project_soft_service) ,soft_service_project_path(@project) %>
<% end %>
</li>

View File

@ -7,6 +7,8 @@
#out{}
#in{width:10px; height:20px;background:#15BCCF;color:white;text-align:center;}
#font_color{background:yellow;text-align:center;color:white;}
td.redBox {border:1px solid #b0b0b0; width:80px; background-color:#EAEAEA; }
td.redBox2 {border:1px solid #b0b0b0; width:120px; }
</style>
<div style="padding-left: 200px;">
<div id='out'>
@ -42,31 +44,34 @@
</div>
</div>
<div id="show_content_div" style="display: none;padding-top: 10px;">
<p class="fr f14 ">语言:<span style="color: red">Java</span> 总文件数:<span style="color: red">361</span> 代码行数:<span style="color: red">48662</span></p>
<div id="show_content_div" style="display: none;padding-top: 0px;">
<p class="fr f14 " style="padding-right: 32px;padding-bottom: 10px;">语言:<span style="color: red">Java</span> 总文件数:<span style="color: red">361</span> 代码行数:<span style="color: red">48662</span></p>
<% @dts.each do |dt| %>
<div style="padding-left: 35px;padding-top: 10px;">
<table width="600" border="0" style="padding-left: 30px;padding-top: 100px; border-spacing:0; border-collapse:collapse; border: 1px solid #b0b0b0;">
<tr>
<td align="center" class="redBox">错误变量</td>
<td class="redBox2"> &nbsp;<%= dt.Variable %></td>
<td align="center" class="redBox">起始行</td>
<td class="redBox2"> &nbsp;<%= dt.StartLine %></td>
<td align="center" class="redBox">IP行</td>
<td class="redBox2"> &nbsp;<%= dt.IPLine %></td>
</tr>
<tr>
<td align="center" class="redBox">缺陷代码</td>
<td colspan="5" class="redBox2"> &nbsp;<%= dt.IPLineCode %></td>
</tr>
<tr>
<td align="center" class="redBox">错误描述</td>
<td colspan="5" class="redBox2">&nbsp;<%= dt.Description %></td>
</tr>
<tr>
<td align="center" class="redBox">文件</td>
<td colspan="5" class="redBox2"> &nbsp;<%= dt.File %></td>
</tr>
</table>
</div>
<% end %>
<% @dts.each do |dt| %>
<table width="600" border="2" style="padding-top: 10px; padding-left: 30px;">
<tr>
<td align="center" bgcolor="#999999" style="width: 80px"><strong>错误变量</strong></td>
<td style="width: 120px"><%= dt.Variable %></td>
<td align="center" bgcolor="#999999" style="width: 80px"><strong>起始行</strong></td>
<td style="width: 120px"><%= dt.StartLine %></td>
<td align="center" bgcolor="#999999" style="width: 80px"><strong>IP行</strong></td>
<td><%= dt.IPLine %></td>
</tr>
<tr>
<td align="center" bgcolor="#999999"><strong>缺陷代码</strong></td>
<td colspan="5"><%= dt.IPLineCode %></td>
</tr>
<tr>
<td align="center" bgcolor="#999999"><strong>错误描述</strong></td>
<td colspan="5"><%= dt.Description %></td>
</tr>
<tr>
<td align="center" bgcolor="#999999"><strong>文件</strong></td>
<td colspan="5"><%= dt.File %></td>
</tr>
</table>
<% end %>
</div>

View File

@ -0,0 +1,3 @@
<div class="project_r_h">
<h2 class="project_h2"><%= l(:label_project_dts) %></h2>
</div>

View File

@ -42,6 +42,6 @@
</div>
<div id="show_content_div" style="display: none;padding-top: 0px; ">
<p class="pl10 f14 "><span style="color: #7f7f7f;font-size: 14px; ">点击进入</span>
<span><a href="http://rubyblog.forge.trustie.net/myblog" target="_Blank" style="color: #15BCCF;font-size: 14px;">云化部署平台</a></span></p>
<p class="pl10 f14 "><span style="color: #7f7f7f;font-size: 14px; ">所部署服务的网址</span>
<span><a href="http://rubyblog.forge.trustie.net/accounts/login" target="_Blank" style="color: #15BCCF;font-size: 14px;">http://rubyblog.forge.trustie.net/accounts/login</a></span></p>
</div>

View File

@ -9,7 +9,8 @@
<%= link_to student_work.user.show_name,user_path(student_work.user),:title => student_work.user.show_name, :class => "c_blue02"%>
</li>
<li class=" hwork_tit">
<%= link_to student_work.name, student_work_path(student_work.id),:remote => true,:title => student_work.name, :class => "c_blue02"%>
<% student_work_name = student_work.name.nil? || student_work.name.empty? ? student_work.user.show_name + '的作品' : student_work.name%>
<%= link_to student_work_name, student_work_path(student_work.id),:remote => true,:title => student_work.name, :class => "c_blue02"%>
</li>
<li class=" hwork_time_c">
<% if Time.parse(@homework.end_time.to_s).strftime("%Y-%m-%d") < Time.parse(student_work.created_at.to_s).strftime("%Y-%m-%d") %>

View File

@ -18,7 +18,8 @@
<% end%>
</li>
<li class=" hwork_tit_e" style="width: 410px">
<%= link_to student_work.name, student_work_path(student_work),:remote => true, :title => student_work.name, :class => "c_blue02"%>
<% student_work_name = student_work.name.nil? || student_work.name.empty? ? '匿名的作品' : student_work.name%>
<%= link_to student_work_name, student_work_path(student_work),:remote => true, :title => student_work.name, :class => "c_blue02"%>
</li>
<% my_score = student_work_score(student_work,User.current) %>
<li class=" hwork_code <%= my_score.nil? ? 'c_grey' : 'c_red'%>">

View File

@ -23,35 +23,45 @@
</div>
<div class="cl"></div>
</li>
<li ><span class="tit_fb ">测试结果:</span>
<table class="border_ce" cellpadding="0" cellspacing="0">
<tbody>
<!--<%#@work.student_work_test.each do |test|%>-->
<!--<tr class="<%#= cycle("", "b_grey") %>">-->
<!--<td class="td_tit">-->
<!--<%#= test.homework_test.input%>-->
<!--</td>-->
<!--<td class="td_tit">-->
<!--<%#= test.homework_test.output%>-->
<!--</td>-->
<!--<td class="td_50 c_red"><%#= test.status_to_s%></td>-->
<!--<td class="td_50 "><%#= test.test_score%></td>-->
<!--</tr>-->
<!--<%# end%>-->
<tr class=" b_lblue fb c_w">
<td class="td_tit ">输入</td>
<td class="td_tit border_l ">输出</td>
<td class="td_50 border_l ">测试结果</td>
</tr>
<%@homework.homework_tests.each do |test|%>
<tr class="<%= cycle("", "b_grey") %>">
<td class="td_tit">
<td class="td_tit hidden">
<%= test.input%>
</td>
<td class="td_tit">
<td class="td_tit border_l hidden">
<%= test.output%>
</td>
<td class="td_50 c_red"><%= test.student_work_test.nil? ? "正在编译" : test.student_work_test.status_to_s%></td>
<td class="td_50 "><%= test.student_work_test.nil? ? "0" : test.student_work_test.test_score%></td>
<input type="hidden" value="<%= test.student_work_test.result if test.student_work_test%>">
<% student_work_test = StudentWorkTest.where(:homework_test_id => test.id,:student_work_id => @work.id).first%>
<td class="td_50 c_red border_l"><%= student_work_test.nil? ? "正在编译" : student_work_test.status_to_s%></td>
<input type="hidden" value="<%= student_work_test.result if student_work_test%>">
</tr>
<% end%>
<% student_work_test = @work.student_work_test.first%>
<% if student_work_test && student_work_test.error_msg && !student_work_test.error_msg.empty?%>
<tr class="border_t" >
<td colspan="3" class="td_end" >
<%= student_work_test.error_msg%>
</td>
</tr>
<% end%>
</tbody>
</table>
<div class="cl"></div>
</li>
<li ><span class="tit_fb ">测试结果:</span>
<table class="border_ce" cellpadding="0" cellspacing="0">
<tbody>
</tbody>
</table>

View File

@ -36,7 +36,7 @@
<li >
<span class="tit_fb ">内容:</span>
<div class="show_hwork_p break_word">
<%= text_format @work.description%>
<%= text_format(@work.description) if @work.description%>
</div>
<div class="cl"></div>
</li>

View File

@ -9,7 +9,8 @@
<%= link_to student_work.user.show_name,user_path(student_work.user),:title => student_work.user.show_name, :class => "c_blue02"%>
</li>
<li class=" hwork_tit_une">
<%= link_to student_work.name, student_work_path(student_work),:remote => true,:title => student_work.name, :class => "c_blue02"%>
<% student_work_name = student_work.name.nil? || student_work.name.empty? ? student_work.user.show_name + '的作品' : student_work.name%>
<%= link_to student_work_name, student_work_path(student_work),:remote => true,:title => student_work.name, :class => "c_blue02"%>
</li>
<li class=" hwork_time_c">
<% if Time.parse(@homework.end_time.to_s).strftime("%Y-%m-%d") < Time.parse(student_work.created_at.to_s).strftime("%Y-%m-%d") %>

View File

@ -92,7 +92,7 @@ zh:
label_project_dts_new: DTS缺陷测试
label_project_dts_statics: DTS缺陷报告
label_project_dts_yun: 云化部署
label_project_dts_yun: 云化部署工具
label_project_soft_knowledge: 软件知识库
label_project_soft_file: 软件资源库
label_project_online_dev: 在线开发平台

View File

@ -1835,6 +1835,7 @@ zh:
excel_t_score: 教师评分
excel_ta_score: 教辅评分
excel_n_score: 匿名评分
excel_s_score: 系统评分
excel_f_score: 成绩
excel_commit_time: 提交时间
excel_homework_score: 作业积分

View File

@ -396,8 +396,9 @@ RedmineApp::Application.routes.draw do
get 'invite_members', :action=> 'invite_members'
get 'invite_members_by_mail', :action=> 'invite_members_by_mail'
# get 'dts_repos', :aciton => 'dts_repos'
get 'send_mail_to_member', :action => 'send_mail_to_member'
match 'user_watcherlist', :to => 'projects#watcherlist', :via => :get, :as => "watcherlist" #add by huang
match 'user_watcherlist', :to => 'projects#watcherlist', :via => :get, :as => "watcherlist"
#end
post 'modules'
post 'archive'

View File

@ -0,0 +1,9 @@
class AddErrormsgToStudenWorkTest < ActiveRecord::Migration
def up
add_column :student_work_tests,:error_msg,:text
end
def down
remove_column :student_work_tests,:error_msg
end
end

View File

@ -11,7 +11,7 @@
#
# It's strongly recommended to check this file into your version control system.
ActiveRecord::Schema.define(:version => 20150719092427) do
ActiveRecord::Schema.define(:version => 20150722015428) do
create_table "activities", :force => true do |t|
t.integer "act_id", :null => false
@ -1248,6 +1248,7 @@ ActiveRecord::Schema.define(:version => 20150719092427) do
t.integer "result"
t.datetime "created_at", :null => false
t.datetime "updated_at", :null => false
t.text "error_msg"
end
create_table "student_works", :force => true do |t|

View File

@ -685,12 +685,18 @@ input#score{ width:40px;}
.ui-slider .ui-slider-handle:hover,.ui-slider .ui-slider-handle:focus{background:#64bdd9;}
.ui-slider .ui-slider-handle:active{background-image:none;}
.ui-slider .ui-slider-range{position:absolute;z-index:1;font-size:.7em;display:block;border:0;top:0;height:100%;background:#64bdd9;left:0;}
/* 编程作品 */
.border_ce{ border:1px solid #e4e4e4; }
.border_ce tr td{ height:26px; }
.td_tit{width:155px; text-align:center;}
.td_50{width:50px; text-align:center;}
a.work_list_tit{width:610px; display:block; overflow:hidden; white-space: nowrap; text-overflow:ellipsis;}
.td_tit{width:170px; text-align:center;}
.td_50{width:60px; text-align:center;}
a.work_list_tit{width:580px; display:block; overflow:hidden; font-size:14px; font-weight:bold; white-space: nowrap; text-overflow:ellipsis;}
.work_list_pro{ width:670px;}
.border_l{border-left:1px solid #e4e4e4;}
.border_t{ border-top:1px solid #e4e4e4;}
.td_end{border-top:1px solid #e4e4e4; height:auto; padding:5px; }
.c_w{ color:#fff;}
.filename { background: url(../images/pic_file.png) 0 -25px no-repeat;color: #3ca5c6;max-width: 150px;border: none; padding-left: 20px;margin-right: 10px;margin-bottom: 5px; white-space: nowrap; text-overflow:ellipsis;}
.evaluation{position: relative;}
@ -708,3 +714,5 @@ a:hover.about_me{ color:#0781b4;}

View File

@ -15,6 +15,7 @@ a.pr_join_a{ color:#fff; display:block; padding:0 5px 0 3px; padding-top:2px; h
.pr_close{ display:block; background:url(../images/leftside.png) -1px -49px no-repeat; width:11px; height:11px; margin-top:3px; float:left; }
.pr_add{display:block; background:url(../images/leftside.png) 0px -71px no-repeat; width:11px; height:11px; margin-top:3px; float:left; }
.pr_arrow{display:block; background:url(../images/leftside.png) 0px -90px no-repeat; width:11px; height:11px; margin-top:3px; float:left; }
.pr_delete{ display:block; background:url(../images/leftside.png) -1px -157px no-repeat; width:11px; height:11px; margin-top:3px; float:left; }
.pr_info_name{ color:#3e4040; font-size:14px; line-height:1.5;}
a:hover.pr_info_name{ color:#3ca5c6;}
.pr_info_score{ font-size:14px; color:#3e4040; }

View File

@ -73,6 +73,7 @@ h4{ font-size:14px; color:#3b3b3b;}
.ml320{ margin-left:320px;}
.mr5{ margin-right:5px;}
.mr10{ margin-right:10px;}
.mr15 {margin-right: 15px;}
.mr20{ margin-right:20px;}
.mr30{ margin-right:30px;}
.mr40{ margin-right:40px;}