Merge branch 'develop' of https://git.trustie.net/jacknudt/trustieforge into develop
This commit is contained in:
commit
b6389a22f3
|
@ -36,7 +36,7 @@ module Mobile
|
|||
principal_types = "JournalsForMessage"
|
||||
watched_user_ids = User.watched_by(user.id).count == 0 ? " " : ("," + User.watched_by(user.id).map{|u| u.id.to_s }.join(','))
|
||||
user_ids = "(" + user.id.to_s + watched_user_ids + ")"
|
||||
watched_user_blog_ids = Blog.select("id").where("author_id in #{user_ids}").count == 0 ? " " :Blog.select("id").where("author_id in #{user_ids}").map { |blog| blog.id}.join(",")
|
||||
watched_user_blog_ids = Blog.select("id").where("author_id in #{user_ids}").count == 0 ? "-1" :Blog.select("id").where("author_id in #{user_ids}").map { |blog| blog.id}.join(",")
|
||||
blog_ids = "(" + watched_user_blog_ids + ")"
|
||||
|
||||
if container_type == "Course"
|
||||
|
|
|
@ -73,6 +73,12 @@ module Mobile
|
|||
elsif ac.container_type == "Blog"
|
||||
"发表博客"
|
||||
end
|
||||
when :syllabus_title
|
||||
if ac.container_type == "Course"
|
||||
course = get_course(ac.container_id)
|
||||
name = course.syllabus.nil? ? "":course.syllabus.title
|
||||
name
|
||||
end
|
||||
when :course_project_id
|
||||
if ac.container_type == "Course"
|
||||
ac.container_id
|
||||
|
@ -145,6 +151,7 @@ module Mobile
|
|||
act_expose :latest_update #最新更新时间
|
||||
act_expose :course_project_id #课程/项目ID
|
||||
act_expose :course_project_name #课程/项目名字
|
||||
act_expose :syllabus_title #课程名字
|
||||
act_expose :activity_type_name #课程问答区/项目缺陷等
|
||||
expose :has_praise , if: lambda { |instance, options| options[:user] } do |instance, options|
|
||||
if instance.act_type == "HomeworkCommon" || instance.act_type == "News" || instance.act_type == "Message" || instance.act_type == "BlogComment" || instance.act_type == "JournalsForMessage" || instance.act_type == "Issue"
|
||||
|
|
|
@ -107,6 +107,7 @@ module Mobile
|
|||
course_expose :current_user_is_member
|
||||
course_expose :current_user_is_teacher
|
||||
course_expose :work_unit
|
||||
course_expose :syllabus_title
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
|
@ -85,7 +85,8 @@ class HomeworkCommonController < ApplicationController
|
|||
homework_detail_manual = @homework.homework_detail_manual || HomeworkDetailManual.new
|
||||
@homework.end_time = params[:homework_common][:end_time] || Time.now
|
||||
@homework.course_id = params[:course_id]
|
||||
anonymous = params[:homework_common][:anonymous_comment] ? params[:homework_common][:anonymous_comment].to_i : 0
|
||||
@homework.homework_type = params[:homework_type].to_i || @homework.homework_type
|
||||
anonymous = params[:homework_common][:anonymous_comment] ? params[:homework_common][:anonymous_comment].to_i : 1
|
||||
if anonymous != @homework.anonymous_comment
|
||||
if anonymous == 1
|
||||
homework_detail_manual.ta_proportion = @homework.homework_type == 1 ? 1.0 : 0.4
|
||||
|
@ -111,7 +112,7 @@ class HomeworkCommonController < ApplicationController
|
|||
if @homework.homework_type == 2
|
||||
@homework.homework_detail_programing ||= HomeworkDetailPrograming.new
|
||||
@homework_detail_programing = @homework.homework_detail_programing
|
||||
@homework_detail_programing.language = params[:language_type].to_i
|
||||
@homework_detail_programing.language = params[:language_type].to_i if params[:language_type]
|
||||
if anonymous != @homework.anonymous_comment
|
||||
if anonymous == 1
|
||||
@homework_detail_programing.ta_proportion = 0.6
|
||||
|
@ -120,8 +121,8 @@ class HomeworkCommonController < ApplicationController
|
|||
end
|
||||
end
|
||||
|
||||
@homework.homework_tests.delete_all
|
||||
inputs = params[:program][:input]
|
||||
@homework.homework_tests.delete_all if params[:program]
|
||||
inputs = params[:program][:input] if params[:program]
|
||||
if Array === inputs
|
||||
inputs.each_with_index do |val, i|
|
||||
@homework.homework_tests << HomeworkTest.new(
|
||||
|
@ -136,12 +137,12 @@ class HomeworkCommonController < ApplicationController
|
|||
if @homework.homework_type == 3
|
||||
@homework.homework_detail_group ||= HomeworkDetailGroup.new
|
||||
@homework_detail_group = @homework.homework_detail_group
|
||||
@homework_detail_group.min_num = params[:min_num].to_i
|
||||
@homework_detail_group.max_num = params[:max_num].to_i
|
||||
@homework_detail_group.base_on_project = params[:base_on_project].to_i
|
||||
@homework_detail_group.min_num = params[:min_num].to_i if params[:min_num]
|
||||
@homework_detail_group.max_num = params[:max_num].to_i if params[:max_num]
|
||||
@homework_detail_group.base_on_project = params[:base_on_project].to_i if params[:base_on_project]
|
||||
end
|
||||
|
||||
@homework.anonymous_comment = params[:homework_common][:anonymous_comment] ? params[:homework_common][:anonymous_comment].to_i : 0
|
||||
@homework.anonymous_comment = params[:homework_common][:anonymous_comment] ? params[:homework_common][:anonymous_comment].to_i : 1
|
||||
if @homework.save
|
||||
homework_detail_manual.save if homework_detail_manual
|
||||
@homework_detail_programing.save if @homework_detail_programing
|
||||
|
|
|
@ -220,7 +220,8 @@ class NewsController < ApplicationController
|
|||
if count == 0
|
||||
ws = WechatService.new
|
||||
content = @news.title
|
||||
ws.class_notice m.user_id, "course_notice", @news.id, "#{l(:label_new_notice_template)}", @news.course.name, @news.author.show_name, format_time(@news.created_on), content, "点击查看通知详情"
|
||||
name = @news.course.syllabus.nil? ? @news.course.name : @news.course.syllabus.title+" • "+@news.course.name
|
||||
ws.class_notice m.user_id, "course_notice", @news.id, "#{l(:label_new_notice_template)}", name, @news.author.show_name, format_time(@news.created_on), content, "点击查看通知详情"
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
|
@ -456,7 +456,7 @@ class StudentWorkController < ApplicationController
|
|||
elsif @order == 'student_id'
|
||||
@stundet_works = search_homework_member @homework.student_works.no_copy.select("student_works.*,student_works.work_score as score").joins("join user_extensions on student_works.user_id = user_extensions.user_id").order("#{@order} #{@b_sort}"),@name
|
||||
else
|
||||
@stundet_works = search_homework_member @homework.student_works.no_copy.select("student_works.*,student_works.work_score as score").order("#{@order} #{@b_sort}"),@name
|
||||
@stundet_works = search_homework_member @homework.student_works.no_copy.select("student_works.*,student_works.work_score as score").includes(:user => {:user_extensions => []}, :project => {}, :student_works_scores => {}).order("#{@order} #{@b_sort}"),@name
|
||||
end
|
||||
@show_all = true
|
||||
elsif User.current.member_of_course?(@course)
|
||||
|
@ -820,17 +820,29 @@ class StudentWorkController < ApplicationController
|
|||
render_attachment_warning_if_needed(@new_score)
|
||||
|
||||
if @new_score.save
|
||||
if @homework.homework_type == 3
|
||||
@is_group_leader = !@work.student_work_projects.empty?
|
||||
end
|
||||
case @new_score.reviewer_role
|
||||
when 1 #教师评分:最后一个教师评分为最终评分
|
||||
@work.teacher_score = @new_score.score
|
||||
if @is_group_leader
|
||||
add_score_to_member @work, @homework, 1, 'teacher_score', @new_score.score
|
||||
end
|
||||
when 2 #教辅评分 教辅评分显示平均分
|
||||
#@work.teaching_asistant_score = @work.student_works_scores.where(:reviewer_role => 2).average(:score).try(:round, 2).to_f
|
||||
ts_score = StudentWorksScore.find_by_sql("SELECT AVG(score) AS score FROM (SELECT * FROM (SELECT * FROM student_works_scores WHERE student_work_id = #{@work.id} AND reviewer_role = 2 AND score IS NOT NULL ORDER BY created_at DESC) AS t GROUP BY user_id) AS a")
|
||||
@work.teaching_asistant_score = ts_score.first.score.nil? ? nil : ts_score.first.score.try(:round, 2).to_f
|
||||
if @is_group_leader
|
||||
add_score_to_member @work, @homework, 2, 'teaching_asistant_score', @work.teaching_asistant_score
|
||||
end
|
||||
when 3 #学生评分 学生评分显示平均分
|
||||
#@work.student_score = @work.student_works_scores.where(:reviewer_role => 3).average(:score).try(:round, 2).to_f
|
||||
stu_score = StudentWorksScore.find_by_sql("SELECT AVG(score) AS score FROM (SELECT * FROM (SELECT * FROM student_works_scores WHERE student_work_id = #{@work.id} AND reviewer_role = 3 ORDER BY created_at DESC) AS t GROUP BY user_id) AS a")
|
||||
@work.student_score = stu_score.first.score.try(:round, 2).to_f
|
||||
if @is_group_leader
|
||||
add_score_to_member @work, @homework, 3, 'student_score', @work.student_score
|
||||
end
|
||||
end
|
||||
@homework.update_column('updated_at', Time.now)
|
||||
update_course_activity(@homework.class,@homework.id)
|
||||
|
@ -1553,10 +1565,6 @@ class StudentWorkController < ApplicationController
|
|||
end
|
||||
end
|
||||
end
|
||||
if homework.homework_type == 3
|
||||
student_works = group_student_works student_work, homework
|
||||
student_works.update_all(:final_score => student_work.final_score,:teacher_score => student_work.teacher_score,:student_score => student_work.student_score,:teaching_asistant_score => student_work.teaching_asistant_score,:work_score => student_work.work_score)
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
|
@ -1052,7 +1052,7 @@ class UsersController < ApplicationController
|
|||
else
|
||||
homework.publish_time = params[:homework_common][:publish_time]
|
||||
end
|
||||
homework.anonymous_comment = params[:homework_common][:anonymous_comment] ? params[:homework_common][:anonymous_comment] : 0
|
||||
homework.anonymous_comment = params[:homework_common][:anonymous_comment] ? params[:homework_common][:anonymous_comment].to_i : 1
|
||||
homework.homework_type = params[:homework_type].to_i || 1
|
||||
homework.late_penalty = 10
|
||||
homework.teacher_priority = 1
|
||||
|
|
|
@ -8,13 +8,13 @@ class WechatsController < ActionController::Base
|
|||
# default text responder when no other match
|
||||
on :text do |request, content|
|
||||
#邀请码
|
||||
if join_class_request(request)
|
||||
sendBindClass(request, {invite_code: content})
|
||||
elsif join_project_request(request)
|
||||
sendBindProject(request, {invite_code: content})
|
||||
else
|
||||
# if join_class_request(request)
|
||||
# sendBindClass(request, {invite_code: content})
|
||||
# elsif join_project_request(request)
|
||||
# sendBindProject(request, {invite_code: content})
|
||||
# else
|
||||
request.reply.text "您的意见已收到,非常感谢~ \n更多问题可以通过以下方式联系我们:\n官方QQ群:173184401\n我们会认真聆听您的意见和建议。"
|
||||
end
|
||||
# end
|
||||
end
|
||||
|
||||
# When receive 'help', will trigger this responder
|
||||
|
@ -456,10 +456,20 @@ class WechatsController < ActionController::Base
|
|||
|
||||
session[:wechat_openid] = open_id
|
||||
if params[:code]
|
||||
# if params[:state].match("review_class_member") || params[:state].match("review_project_member")
|
||||
if !(params[:state] == "invite_code" || params[:state] == "project_invite_code" || params[:state] == "blog_comment" || params[:state] == "course_notice" || params[:state] == "project_discussion" || params[:state] == "course_discussion" || params[:state] == "homework" || params[:state] == "issues" || params[:state] == "journal_for_message")
|
||||
uw = user_binded?(open_id)
|
||||
if uw
|
||||
user = uw.user
|
||||
lastname = user.lastname
|
||||
end
|
||||
end
|
||||
|
||||
if lastname && lastname == ""
|
||||
@path = '/edit_userinfo'
|
||||
else
|
||||
@path = params[:state].split('/')[0]
|
||||
useridstr = params[:state].split('/')[1]
|
||||
# end
|
||||
|
||||
if useridstr
|
||||
redirect_to "/wechat/user_activities##{@path}?id=#{params[:id]}&#{useridstr}" and return
|
||||
elsif params[:id]
|
||||
|
@ -470,6 +480,7 @@ class WechatsController < ActionController::Base
|
|||
# redirect_to "/wechat/user_activities##{@path}?id=#{params[:id]}" and return
|
||||
end
|
||||
end
|
||||
end
|
||||
render 'wechats/user_activities', layout: nil
|
||||
end
|
||||
|
||||
|
|
|
@ -3531,3 +3531,21 @@ def get_forge_act_message(act, type)
|
|||
format_time(forge_act.nil? ? act.created_on : forge_act.try(:updated_at))
|
||||
end
|
||||
|
||||
#作业类型
|
||||
def homework_type_option
|
||||
type = []
|
||||
option1 = []
|
||||
option1 << "普通作业"
|
||||
option1 << 1
|
||||
option2 = []
|
||||
option2 << "编程作业"
|
||||
option2 << 2
|
||||
option3 = []
|
||||
option3 << "分组作业"
|
||||
option3 << 3
|
||||
type << option1
|
||||
type << option2
|
||||
type << option3
|
||||
type
|
||||
end
|
||||
|
||||
|
|
|
@ -184,18 +184,6 @@ module CoursesHelper
|
|||
# garble count
|
||||
# end
|
||||
|
||||
def homework_type_option
|
||||
type = []
|
||||
option1 = []
|
||||
option2 = []
|
||||
option1 << l(:label_task_submit_form_accessory)
|
||||
option1 << 1
|
||||
option2 << l(:label_task_submit_form_project)
|
||||
option2 << 2
|
||||
type << option1
|
||||
type << option2
|
||||
end
|
||||
|
||||
def proportion_option
|
||||
type = []
|
||||
i = 0
|
||||
|
|
|
@ -225,19 +225,6 @@ module ProjectsHelper
|
|||
Project.tagged_with(tag_name).order('updated_on desc')
|
||||
end
|
||||
|
||||
# added by fq
|
||||
def homework_type_option
|
||||
type = []
|
||||
option1 = []
|
||||
option2 = []
|
||||
option1 << l(:label_task_submit_form_accessory)
|
||||
option1 << 1
|
||||
option2 << l(:label_task_submit_form_project)
|
||||
option2 << 2
|
||||
type << option1
|
||||
type << option2
|
||||
end
|
||||
|
||||
#是否启动互评下拉框
|
||||
def is_evaluation_option
|
||||
type = []
|
||||
|
|
|
@ -165,4 +165,13 @@ module StudentWorkHelper
|
|||
student_works = homework.student_works.where("user_id in #{user_ids}")
|
||||
return student_works
|
||||
end
|
||||
|
||||
def add_score_to_member student_work, homework, role, score_type, score
|
||||
student_works = group_student_works student_work, homework
|
||||
student_works.each do |st_work|
|
||||
if st_work.student_works_scores.where("reviewer_role = #{role} and score is not null").empty?
|
||||
st_work.update_attribute("#{score_type}", score)
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
|
@ -77,7 +77,8 @@ class HomeworkCommon < ActiveRecord::Base
|
|||
count = ShieldWechatMessage.where("container_type='User' and container_id=#{m.user_id} and shield_type='Course' and shield_id=#{self.course_id}").count
|
||||
if count == 0
|
||||
ws = WechatService.new
|
||||
ws.homework_message_notice(m.user_id, "homework", self.id, "#{m.user.show_name},#{l(:label_new_homework_template)}", self.course.name, "新作业:"+ self.name.html_safe, "作业内容请点击“详情”查看。")
|
||||
name = self.course.syllabus.nil? ? self.course.name : self.course.syllabus.title+" • "+self.course.name
|
||||
ws.homework_message_notice(m.user_id, "homework", self.id, "#{m.user.show_name},#{l(:label_new_homework_template)}", name, "新作业:"+ self.name.html_safe, "作业内容请点击“详情”查看。")
|
||||
end
|
||||
# end
|
||||
end
|
||||
|
|
|
@ -170,12 +170,6 @@ class StudentWork < ActiveRecord::Base
|
|||
end
|
||||
end
|
||||
end
|
||||
if homework.homework_type == 3
|
||||
pros = student_work.student_work_projects.where("is_leader = 0")
|
||||
user_ids = pros.empty? ? "(-1)" : "(" + pros.map{|stu|stu.user_id}.join(",") + ")"
|
||||
student_works = homework.student_works.where("user_id in #{user_ids}")
|
||||
student_works.update_all(:final_score => student_work.final_score,:teacher_score => student_work.teacher_score,:student_score => student_work.student_score,:teaching_asistant_score => student_work.teaching_asistant_score,:work_score => student_work.work_score)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
|
|
|
@ -332,7 +332,7 @@ class CoursesService
|
|||
# unless (course.is_public == 1 || current_user.member_of_course?(course) || current_user.admin?)
|
||||
# raise '403'
|
||||
# end
|
||||
{:course => course,:work_unit => work_unit, :img_url => url_to_avatar(course),:current_user_is_member => current_user.nil? ? false : current_user.member_of_course?(course),:current_user_is_teacher => current_user.nil? ? false : is_course_teacher(current_user,course),:course_student_num => course ? course.student.count.to_s : 0}
|
||||
{:course => course,:syllabus_title => course.syllabus.nil? ? "":course.syllabus.title ,:work_unit => work_unit, :img_url => url_to_avatar(course),:current_user_is_member => current_user.nil? ? false : current_user.member_of_course?(course),:current_user_is_teacher => current_user.nil? ? false : is_course_teacher(current_user,course),:course_student_num => course ? course.student.count.to_s : 0}
|
||||
end
|
||||
|
||||
#创建课程
|
||||
|
@ -554,8 +554,10 @@ class CoursesService
|
|||
uid = user.id
|
||||
type = "review_class_member"
|
||||
end
|
||||
|
||||
name = course.syllabus.nil? ? course.name : course.syllabus.title+" • "+course.name
|
||||
ws = WechatService.new
|
||||
ws.class_notice user.id, type, course.id, title, course.name, user.show_name, format_time(Time.now), content, remark,uid
|
||||
ws.class_notice user.id, type, course.id, title,name, user.show_name, format_time(Time.now), content, remark,uid
|
||||
|
||||
end
|
||||
end
|
||||
|
@ -650,8 +652,9 @@ class CoursesService
|
|||
|
||||
rolename = role_ids.include?("7") ? "助教" : "教师"
|
||||
content = current_user.show_name + "申请以"+rolename+"身份加入班级,等待您的审批。"
|
||||
name = course.syllabus.nil? ? course.name : course.syllabus.title+" • "+course.name
|
||||
ws = WechatService.new
|
||||
ws.class_notice tea_user.id, "review_class_member", course.id, "班级成员审批通知。", course.name, tea_user.show_name, format_time(Time.now), content, "点击查看申请详情。",current_user.id
|
||||
ws.class_notice tea_user.id, "review_class_member", course.id, "班级成员审批通知。", name, tea_user.show_name, format_time(Time.now), content, "点击查看申请详情。",current_user.id
|
||||
end
|
||||
end
|
||||
#--------------------------------------------
|
||||
|
|
|
@ -69,7 +69,8 @@ class SyllabusesService
|
|||
if count == 0
|
||||
ws = WechatService.new
|
||||
title = "恭喜您创建班级成功。"
|
||||
ws.create_class_notice user.id, "create_course_notice", course.id,title, course.name, user.show_name, 1, "点击查看班级详情。"
|
||||
name = course.syllabus.nil? ? course.name : course.syllabus.title+" • "+course.name
|
||||
ws.create_class_notice user.id, "create_course_notice", course.id,title, name, user.show_name, 1, "点击查看班级详情。"
|
||||
end
|
||||
end
|
||||
|
||||
|
|
|
@ -91,8 +91,8 @@
|
|||
|
||||
<% end %>
|
||||
<% if options[:author] %>
|
||||
<span class="author" title="<%= attachment.author%>">
|
||||
<%= link_to h(truncate(attachment.author.name, length: 10, omission: '...')),user_path(attachment.author),:class => "link-blue" %>,
|
||||
<span class="author" title="<%= attachment.author.show_name%>">
|
||||
<%= link_to h(truncate(attachment.author.show_name, length: 10, omission: '...')),user_path(attachment.author),:class => "link-blue" %>,
|
||||
<%= format_time(attachment.created_on) %>
|
||||
</span>
|
||||
<% end %>
|
||||
|
|
|
@ -41,6 +41,20 @@
|
|||
|
||||
<!-- 老师身份才可以发布作业 -->
|
||||
<div class="HomeWork mb10 ml10" nhname='homework_common_form'>
|
||||
<% committed_work_count = @homework.student_works.has_committed.count %>
|
||||
<% stu_pro_count = @homework.student_work_projects.count %>
|
||||
<% if committed_work_count != 0 %>
|
||||
<% if @homework.homework_type == 1 %>
|
||||
<p class="c_red mb5">已有<%=committed_work_count %>个学生提交作品,不允许再修改作业类型。</p>
|
||||
<% elsif @homework.homework_type == 2 %>
|
||||
<p class="c_red mb5">已有<%=committed_work_count %>个学生提交作品,不允许再修改作业类型和测试集。</p>
|
||||
<% elsif @homework.homework_type == 3 %>
|
||||
<p class="c_red mb5">已有<%=committed_work_count %>个学生提交作品,不允许再修改作业类型和分组设置。</p>
|
||||
<% end %>
|
||||
<% elsif stu_pro_count != 0 && @homework.homework_type == 3 %>
|
||||
<p class="c_red mb5">已有<%=stu_pro_count %>个学生关联项目,不允许再修改作业类型。</p>
|
||||
<% end %>
|
||||
|
||||
<%= form_for @homework do |f| %>
|
||||
<input type="text" name="is_in_course" class="none" value="<%= @is_in_course%>"/>
|
||||
<input type="text" name="course_activity" class="none" value="<%= @course_activity%>"/>
|
||||
|
|
|
@ -3,13 +3,13 @@
|
|||
$("#homework_name").val("");
|
||||
$("#homework_publish_time").val("");
|
||||
$("#homework_end_time").val("");
|
||||
document.getElementById("anonymous_comment").checked = true;
|
||||
$("#course_id").val($("#option_select").val());
|
||||
$("#homeworkSetting").addClass("undis");
|
||||
$("#homeworkSetting").html("");
|
||||
$("#homework_attachments").html("<%= escape_javascript(render :partial => 'users/user_homework_attachment', :locals => { :container => HomeworkCommon.new,:has_program => true,:has_group => true})%>");
|
||||
//homework_description_editor.html("");
|
||||
$("#homework_name_span").text("");
|
||||
$("#homework_end_time_span").text("");
|
||||
$("#homework_end_time_span").text("");
|
||||
$("#homework_course_id_span").text("");
|
||||
$("#homework_editor").toggle();
|
||||
}
|
||||
|
|
|
@ -90,7 +90,7 @@
|
|||
</div>
|
||||
<div class="homepagePostReplyDes">
|
||||
<div class="homepagePostReplyPublisher"><a href="<%=user_path(reply.author)%>" class="newsBlue mr10 f14"><%= reply.author.name%></a><%= format_date(reply.created_at) %></div>
|
||||
<div class="homepagePostReplyContent break_word" id="activity_description_<%= reply.id %>"><%= h reply.content.html_safe %></div>
|
||||
<div class="homepagePostReplyContent break_word" id="activity_description_<%= reply.id %>"><%= reply.content.gsub(/script/, "script ").html_safe %></div>
|
||||
</div>
|
||||
<script type="text/javascript">
|
||||
$(function(){
|
||||
|
|
|
@ -29,7 +29,7 @@
|
|||
我的评分
|
||||
</th>
|
||||
</tr>
|
||||
<% @stundet_works.includes(:user => {:user_extensions => []}, :project => {}).each_with_index do |student_work, i|%>
|
||||
<% @stundet_works.each_with_index do |student_work, i|%>
|
||||
<%= render :partial => "evaluation_work", :locals => {:student_work => student_work, :index => i}%>
|
||||
<tr>
|
||||
<td colspan="12">
|
||||
|
|
|
@ -0,0 +1,26 @@
|
|||
<div class="syllabus_courses_box">
|
||||
<% @stundet_works.each_with_index do |student_work, i| %>
|
||||
<div class="syllabus_courses_list" id="student_work_<%= student_work.id%>">
|
||||
<%= render :partial => 'evaluation_un_group_work', :locals => {:student_work => student_work} %>
|
||||
</div>
|
||||
<div id="about_hwork_<%= student_work.id %>"></div>
|
||||
|
||||
<div id="group_member_work_<%= student_work.id%>" class="undis">
|
||||
<%= render :partial => 'group_member_work', :locals => {:student_work => student_work} %>
|
||||
</div>
|
||||
<% end %>
|
||||
</div>
|
||||
<div class="cl"></div>
|
||||
|
||||
<script>
|
||||
$(".icons_sy_close").live('click',function(){
|
||||
$(this).parent().parent().next().next().show();
|
||||
$(this).removeClass("icons_sy_close");
|
||||
$(this).addClass("icons_sy_open");
|
||||
});
|
||||
$(".icons_sy_open").live('click',function(){
|
||||
$(this).parent().parent().next().next().hide();
|
||||
$(this).addClass("icons_sy_close");
|
||||
$(this).removeClass("icons_sy_open");
|
||||
});
|
||||
</script>
|
|
@ -0,0 +1,82 @@
|
|||
<ul id="syllabus_course_ul">
|
||||
<li class="syllabus_class_list" style="line-height:44px; vertical-align:middle;">
|
||||
<div class="syllabus_class_w fontGrey3">
|
||||
<%= link_to(image_tag(url_to_avatar(st.user),:width =>"40",:height => "40", :style => "display:block;"),user_activities_path(st.user), :class => "fl") %>
|
||||
<% if !st.student_work_projects.empty? %>
|
||||
<span class="fl student_work_<%= st.id%>" style="width:135px;">
|
||||
<span class="fl hidden ml5" style="max-width:90px;"><%= st.user.show_name %></span>
|
||||
<span class="fl">(组长)</span>
|
||||
</span>
|
||||
<span class="fl mr15 hidden student_work_<%= st.id%>" style="width:90px;">
|
||||
<span class="fontGrey2">学号</span>:<%= st.user.user_extensions.nil? ? "--" : st.user.user_extensions.student_id%>
|
||||
</span>
|
||||
<% else %>
|
||||
<span class="fl student_work_<%= st.id%>" style="width:135px; cursor: pointer;" onclick="show_student_work('<%= student_work_path(st)%>');">
|
||||
<span class="fl hidden ml5" style="max-width:90px;"><%= st.user.show_name %></span>
|
||||
</span>
|
||||
<span class="fl student_work_<%= st.id%> mr15 hidden" style="width:90px; cursor: pointer;" onclick="show_student_work('<%= student_work_path(st)%>');">
|
||||
<span class="fontGrey2">学号</span>:<%= st.user.user_extensions.nil? ? "--" : st.user.user_extensions.student_id%>
|
||||
</span>
|
||||
<% end %>
|
||||
<div class="flex-container fl" style="width:365px;">
|
||||
<div class="flex-cell"><span class="<%= score_color st.teacher_score%> ml35"><%= st.teacher_score.nil? ? "--" : format("%.1f",st.teacher_score)%></span></div>
|
||||
<div class="flex-cell"><span class="<%= score_color st.teaching_asistant_score%> ml35"><%= st.teaching_asistant_score.nil? ? "--" : format("%.1f",st.teaching_asistant_score)%></span></div>
|
||||
<% if @homework.anonymous_comment == 0 %>
|
||||
<div class="flex-cell">
|
||||
<div class="<%= score_color st.student_score%> student_score_info ml35 pr">
|
||||
<% if st.student_score.nil? %>
|
||||
<span title="该作品未被匿评">未参与</span>
|
||||
<% else %>
|
||||
<%= format("%.1f", st.student_score) %>
|
||||
<% end %>
|
||||
<% unless st.student_score.nil? %>
|
||||
<span class="linkBlue">
|
||||
(<%= anon_count %>)
|
||||
</span>
|
||||
<div class="g_infoNi none">
|
||||
现共有
|
||||
<span class="c_red"> <%= anon_count %> </span>
|
||||
名学生进行了匿评,平均分为
|
||||
<span class="c_red"> <%= format("%.1f", st.student_score) %> </span>分。
|
||||
</div>
|
||||
<% end %>
|
||||
</div>
|
||||
</div>
|
||||
<% end %>
|
||||
<div class="flex-cell">
|
||||
<% score = st.work_score %>
|
||||
<div class="<%= score_color score%> student_final_scor_info ml35 pr" style="display: inline">
|
||||
<%= score.nil? ? "--" : format("%.1f",score<0 ? 0 : score)%>
|
||||
<% unless score.nil?%>
|
||||
<div class="g_infoNi none width180">
|
||||
作品最终评分为
|
||||
<span class="c_red"> <%= st.final_score%> </span>分。
|
||||
迟交扣分
|
||||
<span class="c_red">
|
||||
<%= st.homework_common && st.homework_common.teacher_priority == 1 && st.teacher_score ? 0 : st.late_penalty %>
|
||||
</span>分,
|
||||
缺评扣分
|
||||
<span class="c_red">
|
||||
<%= st.homework_common && st.homework_common.teacher_priority == 1 && st.teacher_score ? 0 : st.absence_penalty%>
|
||||
</span>分,
|
||||
最终成绩为
|
||||
<span class="c_red"> <%= format("%.1f",score<0 ? 0 : score)%> </span>分。
|
||||
</div>
|
||||
<% end%>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="hworkTip" style="display: none" id="work_click_<%= st.id%>"><em></em><span></span><font class="fontGrey2"><%= !st.student_work_projects.empty? ? '大作品评分即组长的评分' : '点击查看详情' %></font></div>
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
<script type="text/javascript">
|
||||
$(".student_work_<%= st.id%>").mouseenter(function(){
|
||||
if($("#about_hwork_<%= st.id%>").html().trim() == "") {
|
||||
$("#work_click_<%= st.id%>").show();
|
||||
}
|
||||
}).mouseleave(function(){
|
||||
$("#work_click_<%= st.id%>").hide();
|
||||
}).mouse;
|
||||
</script>
|
|
@ -1,75 +1,57 @@
|
|||
<tr class="hworkListRow" id="student_work_<%= student_work.id%>">
|
||||
<td class="none"><a name="<%= student_work.id%>"></a></td>
|
||||
<td class="hworkList40 pl5 pr5" id="work_num_<%=student_work.id %>"><%=index + 1 %></td>
|
||||
<td class="hworkPortrait pr10 float-none">
|
||||
<%= link_to(image_tag(url_to_avatar(student_work.user),:width =>"40",:height => "40",:style => "display:block;"),user_activities_path(student_work.user)) %>
|
||||
</td>
|
||||
<div class="sy_courses_open f14 fontGrey3">
|
||||
<span class="icons_sy_close fl mr5" title="点击展开/收起详情"></span>
|
||||
<span class="fl" style="width:280px;">
|
||||
<span class="hidden fl" style="max-width:240px;"><%=student_work.name %></span>
|
||||
<span class="fontGrey2 ml5 fl">
|
||||
<% if student_work.work_status%>
|
||||
<%=get_status student_work.work_status %>
|
||||
<% end %>
|
||||
</span>
|
||||
</span>
|
||||
<% if @homework.homework_detail_group.base_on_project == 1 %>
|
||||
<td class="hworkName float-none pr10 student_work_<%= student_work.id%> width130" style="cursor: pointer;" onclick="show_student_work('<%= student_work_path(student_work)%>');">
|
||||
<div>
|
||||
<%= link_to student_work.user.show_name,"javascript:void(0)" ,:title => student_work.user.show_name, :class => "linkGrey f14 StudentName break_word #{@homework.homework_type == 2 ? '' : 'width165'}"%>
|
||||
</div>
|
||||
</td>
|
||||
<span class="ml15 fl">关联项目:</span>
|
||||
<% if student_work.project.is_public || User.current.member_of?(student_work.project) || User.current.admin? %>
|
||||
<td class="<%=@homework.anonymous_comment == 1 ? 'hworkPrName2' : 'hworkPrName'%> student_work_<%= student_work.id%>" title="项目名称">
|
||||
<%= link_to( student_work.project.name, project_path(student_work.project.id))%>
|
||||
</td>
|
||||
<%= link_to student_work.project.name, project_path(student_work.project.id), :class => 'link-blue fl hidden', :style => "width:200px;", :title => "项目名称"%>
|
||||
<% else %>
|
||||
<td class="<%=@homework.anonymous_comment == 1 ? 'hworkPrName2' : 'hworkPrName'%> student_work_<%= student_work.id%>" title="该项目是私有的">
|
||||
<%= student_work.project.name %>
|
||||
</td>
|
||||
<% end %>
|
||||
<% elsif @homework.homework_detail_group.base_on_project == 0 %>
|
||||
<td class="hworkName float-none pr10 student_work_<%= student_work.id%> <%=@homework.anonymous_comment == 1 ? 'width280' : 'width210' %>" style="cursor: pointer;" onclick="show_student_work('<%= student_work_path(student_work)%>');">
|
||||
<div>
|
||||
<%= link_to student_work.user.show_name,"javascript:void(0)" ,:title => student_work.user.show_name, :class => "linkGrey f14 StudentName break_word #{@homework.homework_type == 2 ? '' : 'width165'}"%>
|
||||
</div>
|
||||
</td>
|
||||
<% end %>
|
||||
<td class="hworkList130 c_grey student_work_<%= student_work.id%>" onclick="show_student_work('<%= student_work_path(student_work)%>');" style="cursor: pointer;">
|
||||
<% if student_work.created_at && @homework.end_time%>
|
||||
<%= Time.parse(format_time(student_work.created_at)).strftime("%m-%d %H:%M")%>
|
||||
<% if Time.parse(@homework.end_time.to_s).strftime("%Y-%m-%d") < Time.parse(format_time(student_work.created_at)).strftime("%Y-%m-%d") %>
|
||||
<span class="c_red">[迟交]</span>
|
||||
<span class="fontBlue fl hidden" style="width:200px;" title="该项目是私有的"><%= student_work.project.name %></span>
|
||||
<% end %>
|
||||
<% end %>
|
||||
</td>
|
||||
<td class="hworkList70 <%= score_color student_work.teacher_score%>">
|
||||
<%= student_work.teacher_score.nil? ? "--" : format("%.1f",student_work.teacher_score)%>
|
||||
</td>
|
||||
<td class="hworkList70 <%= score_color student_work.teaching_asistant_score%>">
|
||||
<%= student_work.teaching_asistant_score.nil? ? "--" : format("%.1f",student_work.teaching_asistant_score)%>
|
||||
</td>
|
||||
<% if @homework.anonymous_comment == 0%>
|
||||
<td class="hworkList70 <%= score_color student_work.student_score%> student_score_info">
|
||||
<a href="javascript:void(0)" onclick="show_student_work('<%= student_work_path(student_work)%>');" class="link-blue fr">评分</a>
|
||||
<div class="cl"></div>
|
||||
</div>
|
||||
<div class="fl sy_p_grey">
|
||||
<span class="fl" style="width:296px;">提交时间:<%=format_date(student_work.commit_time) %></span>
|
||||
<div class="flex-container fl" style="width:368px;">
|
||||
<div class="flex-cell">教师:<span class="<%= score_color student_work.teacher_score%>"><%= student_work.teacher_score.nil? ? "--" : format("%.1f",student_work.teacher_score)%></span></div>
|
||||
<div class="flex-cell">助教:<span class="<%= score_color student_work.teaching_asistant_score%>"><%= student_work.teaching_asistant_score.nil? ? "--" : format("%.1f",student_work.teaching_asistant_score)%></span></div>
|
||||
<% if @homework.anonymous_comment == 0 %>
|
||||
<div class="flex-cell">匿评:
|
||||
<div class="<%= score_color student_work.student_score%> student_score_info" style="display: inline">
|
||||
<% if student_work.student_score.nil? %>
|
||||
<span title="该作品未被匿评">未参与</span>
|
||||
<% else %>
|
||||
<%=format("%.1f",student_work.student_score) %>
|
||||
<%= format("%.1f", student_work.student_score) %>
|
||||
<% end %>
|
||||
<% unless student_work.student_score.nil?%>
|
||||
<% unless student_work.student_score.nil? %>
|
||||
<span class="linkBlue">
|
||||
(<%= student_work.student_works_scores.where(:reviewer_role => 3).group_by(&:user_id).count%>)
|
||||
(<%= student_work.student_works_scores.where(:reviewer_role => 3).group_by(&:user_id).count %>)
|
||||
</span>
|
||||
<div class="infoNi none">
|
||||
<div class="g_infoNi none">
|
||||
现共有
|
||||
<span class="c_red"> <%= student_work.student_works_scores.where(:reviewer_role => 3).group_by(&:user_id).count%> </span>
|
||||
<span class="c_red"> <%= student_work.student_works_scores.where(:reviewer_role => 3).group_by(&:user_id).count %> </span>
|
||||
名学生进行了匿评,平均分为
|
||||
<span class="c_red"> <%= format("%.1f",student_work.student_score)%> </span>分。
|
||||
<span class="c_red"> <%= format("%.1f", student_work.student_score) %> </span>分。
|
||||
</div>
|
||||
<% end%>
|
||||
</td>
|
||||
<% end %>
|
||||
<!-- 成绩 -->
|
||||
<% if student_work.homework_common && student_work.homework_common.teacher_priority == 1 && student_work.teacher_score %>
|
||||
<% score = student_work.respond_to?("score") ? student_work.score : student_work.teacher_score %>
|
||||
<% else %>
|
||||
<% score = student_work.respond_to?("score") ? student_work.score : (student_work.final_score || 0) - student_work.absence_penalty - student_work.late_penalty%>
|
||||
</div>
|
||||
</div>
|
||||
<% end %>
|
||||
<td class="hworkList70 <%= score_color score%> student_final_scor_info">
|
||||
<div class="flex-cell">成绩:
|
||||
<% score = student_work.work_score %>
|
||||
<div class="<%= score_color score%> student_final_scor_info" style="display: inline">
|
||||
<%= score.nil? ? "--" : format("%.1f",score<0 ? 0 : score)%>
|
||||
<% unless score.nil?%>
|
||||
<div class="infoNi none width180">
|
||||
<div class="g_infoNi none width180">
|
||||
作品最终评分为
|
||||
<span class="c_red"> <%= student_work.final_score%> </span>分。
|
||||
迟交扣分
|
||||
|
@ -84,6 +66,8 @@
|
|||
<span class="c_red"> <%= format("%.1f",score<0 ? 0 : score)%> </span>分。
|
||||
</div>
|
||||
<% end%>
|
||||
</td>
|
||||
<td><div style="position:relative;"><div class="hworkTip" style="display: none" id="work_click_<%= student_work.id%>"><em></em><span></span><font class="fontGrey2">点击查看详情</font></div></div></td>
|
||||
</tr>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="cl"></div>
|
|
@ -74,7 +74,7 @@
|
|||
</th>
|
||||
</tr>
|
||||
<%# end %>
|
||||
<% @stundet_works.includes(:user => {:user_extensions => []}, :project => {}, :student_works_scores => {}).each_with_index do |student_work, i| %>
|
||||
<% @stundet_works.each_with_index do |student_work, i| %>
|
||||
<%= render :partial => "evaluation_un_work", :locals => {:student_work => student_work, :index => i} %>
|
||||
<tr>
|
||||
<td colspan="12">
|
||||
|
|
|
@ -0,0 +1,11 @@
|
|||
<% user_ids = student_work.student_work_projects.empty? ? "(-1)" : "(" + student_work.student_work_projects.map{|st| st.user_id}.join(",") + ")" %>
|
||||
<% student_work_groups = @homework.student_works.where("user_id in #{user_ids}").order("created_at asc") %>
|
||||
<% anon_count = student_work.student_works_scores.where(:reviewer_role => 3).group_by(&:user_id).count %>
|
||||
<% student_work_groups.each_with_index do |st, j| %>
|
||||
<div class="syllabus_class_box" id="student_work_<%= st.id%>">
|
||||
<%= render :partial => 'evaluation_un_group_member_work', :locals => {:st => st, :anon_count => anon_count} %>
|
||||
</div>
|
||||
<% if j != 0 %>
|
||||
<div id="about_hwork_<%= st.id %>"></div>
|
||||
<% end %>
|
||||
<% end %>
|
|
@ -0,0 +1,145 @@
|
|||
<div class="show_hwork_arrow"></div>
|
||||
<div class="showHwork">
|
||||
<% is_teacher = User.current.allowed_to?(:as_teacher, @homework.course) || User.current.admin? %>
|
||||
<% pro = @homework.student_work_projects.where(:user_id => User.current.id).first %>
|
||||
<% is_my_work = pro && pro.student_work_id == work.id%>
|
||||
<ul>
|
||||
<li class="fl" >
|
||||
<span class="tit_fb">上交时间:</span>
|
||||
<%=format_time work.created_at %>
|
||||
</li>
|
||||
|
||||
<% if work.user == User.current && Time.parse(@homework.end_time.to_s).strftime("%Y-%m-%d") >= Time.now.strftime("%Y-%m-%d") %>
|
||||
<!-- 我的作业 && 匿评作业 && 未开启匿评,显示编辑和删除按钮 -->
|
||||
<li class="fr" >
|
||||
<%= link_to("", student_work_path(work),:method => 'delete', :confirm => l(:text_are_you_sure), :class => "pic_del",:title=>"删除") %>
|
||||
</li>
|
||||
<li class="fr mr5" >
|
||||
<%= link_to "",edit_student_work_path(work),:class => "pic_edit",:title => "修改"%>
|
||||
</li>
|
||||
<% end%>
|
||||
<% if @homework.homework_detail_manual.comment_status == 3 && !is_my_work %>
|
||||
<!-- 匿评结束阶段,显示点赞按钮 -->
|
||||
<li class="fr" id="student_work_praise_<%= work.id%>">
|
||||
<%= render :partial => 'student_work_praise',:locals => {:work => work} %>
|
||||
</li>
|
||||
<% end%>
|
||||
<div class="cl"></div>
|
||||
|
||||
<!--<li ><span class="tit_fb"> 参与人员:</span>程梦雯 王强</li>-->
|
||||
|
||||
<% if work.student_work_projects && (@homework.homework_detail_manual.comment_status != 2 || is_my_work || is_teacher ) %>
|
||||
<div class="cl"></div>
|
||||
<li>
|
||||
<span class="tit_fb"> 参与人员:</span>
|
||||
<%= link_to(work.user.show_name+"(组长)", user_path(work.user.id), :class => "linkBlue" )%>
|
||||
<% members = work.student_work_projects.where("is_leader = 0") %>
|
||||
<% members.each do |member| if !members.empty? %>
|
||||
、<%=link_to((User.find member.user_id).show_name, user_path(member.user.id), :class => "linkBlue" ) %>
|
||||
<% end %>
|
||||
<% end %>
|
||||
</li>
|
||||
<% if @homework.homework_detail_group.base_on_project == 1 %>
|
||||
<li>
|
||||
<span class="tit_fb"> 关联项目:</span>
|
||||
<% if work.project_id == 0 || work.project_id.nil? %>
|
||||
<span>暂无</span>
|
||||
<% elsif work.project.is_public || User.current.member_of?(work.project) || User.current.admin? %>
|
||||
<%= link_to( work.project.name, project_path(work.project.id), :class => "linkBlue" )%>
|
||||
<span class="ml5">(综合评分:<font class="c_red"><%=static_project_score(work.project.project_score).to_i %></font>)</span>
|
||||
<% else %>
|
||||
<span title ="该项目是私有的"><%=work.project.name %></span>
|
||||
<span class="ml5">(综合评分:<font class="c_red"><%=static_project_score(work.project.project_score).to_i %></font>)</span>
|
||||
<% end %>
|
||||
<%#= link_to( work.project.name, project_path(work.project.id), :class => "linkBlue" )%>
|
||||
</li>
|
||||
<% end %>
|
||||
<li >
|
||||
<span class="tit_fb ">内容:</span>
|
||||
<div class="showHworkP break_word upload_img" id="student_work_img_<%=work.id %>">
|
||||
<%= work.description.html_safe if work.description%>
|
||||
</div>
|
||||
<div class="cl"></div>
|
||||
</li>
|
||||
<li >
|
||||
<span class="tit_fb"> 附件:</span>
|
||||
<% com_attachments = work.attachments.where("attachtype IS NULL OR attachtype <> 7") %>
|
||||
<% if com_attachments.empty?%>
|
||||
<span style="color: #999999">尚未提交附件</span>
|
||||
<% else%>
|
||||
<div class="fl" style="width: 90%;">
|
||||
<%= render :partial => 'work_attachments_status', :locals => {:attachments => com_attachments, :status => @homework.homework_detail_manual.comment_status} %>
|
||||
</div>
|
||||
<% end%>
|
||||
<div class="cl"></div>
|
||||
</li>
|
||||
<% end%>
|
||||
|
||||
<li>
|
||||
<% if @is_teacher || (@homework.homework_detail_manual.comment_status == 2 && !is_my_work)%>
|
||||
<!-- 老师 || 开启匿评状态 && 不是当前用户自己的作品 -->
|
||||
<div id="add_student_score_<%= work.id%>" class="mt10 evaluation">
|
||||
<%= render :partial => 'add_score',:locals => {:work => work,:score => score}%>
|
||||
</div>
|
||||
<% end%>
|
||||
<div class="cl"></div>
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
<div id="revise_attachment">
|
||||
<%= render :partial => 'student_work/revise_attachment', :locals => {:work => work} %>
|
||||
</div>
|
||||
<div class="cl"></div>
|
||||
|
||||
<div class="ping_box fl" id="score_list_<%= work.id%>" style="<%= work.student_works_scores.empty? ? 'padding:0px;' : ''%>">
|
||||
<%student_work_scores.each do |student_score|%>
|
||||
<div id="work_score_<%= student_score.id%>">
|
||||
<%= render :partial => 'student_work_score',:locals => {:score => student_score,:is_last => student_score == student_work_scores.last}%>
|
||||
</div>
|
||||
<% end%>
|
||||
</div>
|
||||
<div class="cl"></div>
|
||||
<!---ping_box end--->
|
||||
<a href="javascript:void(0);" class="linkBlue mt5 mb5" style="margin-left:auto; margin-right: auto; display:block; width: 24px;" onclick="$('#about_hwork_<%= work.id%>').html('');">收起</a>
|
||||
<div class="cl"></div>
|
||||
</div>
|
||||
<script type="text/javascript">
|
||||
$(function(){
|
||||
showNormalImage('student_work_img_<%=work.id %>');
|
||||
<% if defined?(is_focus) && is_focus.to_i == 1 %>
|
||||
$("#upload_revise_attachment").click();
|
||||
<% end %>
|
||||
});
|
||||
function show_upload(){
|
||||
$("#ajax-modal").html('<%= escape_javascript( render :partial => 'student_work/upload_attachment' ,:locals => {:work=>work})%>');
|
||||
showModal('ajax-modal', '452px');
|
||||
$('#ajax-modal').siblings().remove();
|
||||
$('#ajax-modal').before("<a href='javascript:void(0)' onclick='closeModal();' style='margin-left: 435px;' class='resourceClose'></a>");
|
||||
$('#ajax-modal').parent().css("top","40%").css("left","46%");
|
||||
$('#ajax-modal').parent().addClass("resourceUploadPopup");
|
||||
$('#ajax-modal').css("padding-left","16px").css("padding-bottom","16px");
|
||||
}
|
||||
function regex_des() {
|
||||
if ($.trim($("#attachment_des").val()) == "") {
|
||||
$("#hint_message").text("附件描述不能为空");
|
||||
$("#hint_message").css('color','#ff0000');
|
||||
return false;
|
||||
} else {
|
||||
$("#hint_message").text("");
|
||||
return true;
|
||||
}
|
||||
}
|
||||
function submit_revise_files(){
|
||||
if (regex_des()) {
|
||||
$("#upload_form").submit();
|
||||
}
|
||||
}
|
||||
function closeModal(){
|
||||
hideModal($(".uploadBoxContainer"));
|
||||
}
|
||||
function disable_choose(){
|
||||
if ($("#attachments_fields .attachment").size() >= 1) {
|
||||
$("#choose_revise_attach").attr("onclick","return false;").addClass(disable_link);
|
||||
}
|
||||
}
|
||||
</script>
|
|
@ -7,6 +7,8 @@
|
|||
<% pro = @homework.student_work_projects.where(:user_id => User.current.id).first %>
|
||||
<% is_my_work = pro && pro.student_work_id == work.id%>
|
||||
<% end %>
|
||||
<% is_member_work = @homework.homework_type == 3 && work.student_work_projects.empty? %>
|
||||
<% if !is_member_work %>
|
||||
<ul>
|
||||
<li class="fl" >
|
||||
<span class="tit_fb">上交时间:</span>
|
||||
|
@ -31,7 +33,6 @@
|
|||
<div class="cl"></div>
|
||||
|
||||
<!--<li ><span class="tit_fb"> 参与人员:</span>程梦雯 王强</li>-->
|
||||
|
||||
<% if @homework.homework_type == 3 && work.student_work_projects && (@homework.homework_detail_manual.comment_status != 2 || is_my_work || is_teacher ) %>
|
||||
<div class="cl"></div>
|
||||
<li>
|
||||
|
@ -60,14 +61,14 @@
|
|||
<% end %>
|
||||
<% end%>
|
||||
|
||||
<li >
|
||||
<li>
|
||||
<span class="tit_fb ">内容:</span>
|
||||
<div class="showHworkP break_word upload_img" id="student_work_img_<%=work.id %>">
|
||||
<%= work.description.html_safe if work.description%>
|
||||
</div>
|
||||
<div class="cl"></div>
|
||||
</li>
|
||||
<li >
|
||||
<li>
|
||||
<span class="tit_fb"> 附件:</span>
|
||||
<% com_attachments = work.attachments.where("attachtype IS NULL OR attachtype <> 7") %>
|
||||
<% if com_attachments.empty?%>
|
||||
|
@ -94,6 +95,19 @@
|
|||
<%= render :partial => 'student_work/revise_attachment', :locals => {:work => work} %>
|
||||
</div>
|
||||
<div class="cl"></div>
|
||||
<% else %>
|
||||
<ul>
|
||||
<li >
|
||||
<% if @is_teacher %>
|
||||
<!-- 老师 -->
|
||||
<div id="add_student_score_<%= work.id%>" class="mt10 evaluation">
|
||||
<%= render :partial => 'add_score',:locals => {:work => work,:score => score}%>
|
||||
</div>
|
||||
<% end%>
|
||||
<div class="cl"></div>
|
||||
</li>
|
||||
</ul>
|
||||
<% end %>
|
||||
|
||||
<div class="ping_box fl" id="score_list_<%= work.id%>" style="<%= work.student_works_scores.empty? ? 'padding:0px;' : ''%>">
|
||||
<%student_work_scores.each do |student_score|%>
|
||||
|
@ -101,6 +115,9 @@
|
|||
<%= render :partial => 'student_work_score',:locals => {:score => student_score,:is_last => student_score == student_work_scores.last}%>
|
||||
</div>
|
||||
<% end%>
|
||||
<% if is_member_work && student_work_scores.empty? && !@is_teacher %>
|
||||
<p class="c_red" style="text-align: center">暂无评分</p>
|
||||
<% end %>
|
||||
</div>
|
||||
<div class="cl"></div>
|
||||
<!---ping_box end--->
|
||||
|
|
|
@ -36,11 +36,19 @@
|
|||
<div class="cl"></div>
|
||||
|
||||
<div class="fl">
|
||||
<% if @is_evaluation && !@stundet_works.empty?%>
|
||||
<% if @homework.homework_type != 3%>
|
||||
<% if @is_evaluation && !@stundet_works.empty? %>
|
||||
<%= render :partial => "evaluation_title"%>
|
||||
<% else%>
|
||||
<%= render :partial => "evaluation_un_title"%>
|
||||
<% end%>
|
||||
<% else %>
|
||||
<% if !@is_teacher && @is_evaluation && !@stundet_works.empty? %>
|
||||
<%= render :partial => "evaluation_title"%>
|
||||
<% else %>
|
||||
<%= render :partial => "evaluation_un_group"%>
|
||||
<% end%>
|
||||
<% end %>
|
||||
</div>
|
||||
<div class="cl"></div>
|
||||
|
||||
|
|
|
@ -11,8 +11,18 @@ var num = $("#work_num_<%= @work.id%>").html();
|
|||
$("#score_list_<%= @work.id%>").removeAttr("style");
|
||||
|
||||
<% if @is_teacher %>
|
||||
<% if @homework.homework_type == 3 %>
|
||||
<% if @is_group_leader %>
|
||||
$("#student_work_<%= @work.id%>").html("<%= escape_javascript(render :partial => 'evaluation_un_group_work', :locals => {:student_work => @work}) %>");
|
||||
$("#group_member_work_<%= @work.id%>").html("<%= escape_javascript(render :partial => 'group_member_work', :locals => {:student_work => @work}) %>");
|
||||
<% else %>
|
||||
<% anon_count = @work.student_works_scores.where(:reviewer_role => 3).group_by(&:user_id).count %>
|
||||
$("#student_work_<%= @work.id%>").html("<%= escape_javascript(render :partial => 'evaluation_un_group_member_work', :locals => {:st => @work, :anon_count => anon_count}) %>");
|
||||
<% end %>
|
||||
<% else %>
|
||||
$("tr[id='student_work_<%= @work.id%>']").replaceWith("<%= escape_javascript(render :partial => 'evaluation_un_work',:locals => {:student_work => @work, :index => 1}) %>");
|
||||
$("#work_num_<%= @work.id%>").html(num);
|
||||
<% end %>
|
||||
<% else %>
|
||||
$("tr[id='student_work_<%= @work.id%>']").replaceWith("<%= escape_javascript(render :partial => 'evaluation_work',:locals => {:student_work => @work, :index => 1}) %>");
|
||||
$("#work_num_<%= @work.id%>").html(num);
|
||||
|
|
|
@ -43,7 +43,7 @@
|
|||
</div>
|
||||
<div class="ml15 mt10 f12">
|
||||
<span class="grayTxt">
|
||||
发帖人:<%=(u.try(:realname) != " " ? u.lastname + u.firstname : u.try(:login)) %>
|
||||
发帖人:<%=(u.try(:realname) != " " ? u.try(:lastname) + u.try(:firstname) : u.try(:login)) unless u.nil? %>
|
||||
</span>
|
||||
<span class="grayTxt">更新:<%= format_time(activity.children.any? ? activity.children.last[:created_on] : activity[:created_on] ) %></span>
|
||||
<% all_comments = []%>
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
<% unless activity.author.nil? %>
|
||||
<div class="resources mt10" id="user_activity_<%= user_activity_id%>">
|
||||
<div class="homepagePostBrief">
|
||||
<div class="homepagePostPortrait">
|
||||
|
@ -103,3 +104,4 @@
|
|||
user_card_show_hide();
|
||||
});
|
||||
</script>
|
||||
<% end %>
|
|
@ -1,27 +1,27 @@
|
|||
<span class="f16 fontBlue">分组设置</span>
|
||||
<a href="javascript:void(0);" class="popClose" title="关闭弹框"></a>
|
||||
<div class="mt10">
|
||||
<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 %>" />人
|
||||
<span class="c_red undis" id="min_num_notice"></span>
|
||||
</div>
|
||||
<div class="mt10">
|
||||
<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 %>" />人
|
||||
<span class="c_red undis" id="max_num_notice"></span>
|
||||
</div>
|
||||
<p class="c_red undis" id="min_max_num_notice"></p>
|
||||
<div class="mb10 mt10">
|
||||
<div id="groupHomework">
|
||||
<div> <span class="f14 mt5 fl fontGrey3 mr10">分组设置:</span>
|
||||
<div class="mr50 fl"> <span class="f14 fontGrey3 mr5">每组最小人数:</span>
|
||||
<input id="min_num" type="text" name="min_num" class="markInput" value="<%=(edit_mode && homework.is_group_homework?) ? homework.homework_detail_group.min_num : 2 %>" <%=not_allow_select ? 'disabled' : '' %>/>人
|
||||
</div>
|
||||
<div class="fl"> <span class="f14 fontGrey3 mr5">每组最大人数:</span>
|
||||
<input id="max_num" type="text" name="max_num" class="markInput" value="<%=(edit_mode && homework.is_group_homework?) ? homework.homework_detail_group.max_num : 10 %>" <%=not_allow_select ? 'disabled' : '' %>/>人
|
||||
</div>
|
||||
<span class="c_red undis ml20 mt7 fl" id="min_max_num_notice"></span>
|
||||
<div class="cl"></div>
|
||||
<div class="ml80">
|
||||
<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" <%=not_allow_select ? 'disabled' : '' %>/>
|
||||
<span class="f14 fontGrey3 mr10">基于项目实施</span>
|
||||
</label>
|
||||
<p class="c_red">提醒:勾选后各小组必须在Trustie平台创建项目,教师可随时观察平台对各小组最新进展的实时统计</p>
|
||||
</div>
|
||||
<div class="courseSendSubmit">
|
||||
<a href="javascript:void(0);" class="group_save_btn sendSourceText">确定</a>
|
||||
</div>
|
||||
<div class="courseSendCancel">
|
||||
<a href="javascript:void(0);" class="sendSourceText linkGrey6" id="cancel_group">取消</a>
|
||||
</div>
|
||||
<div class="cl"></div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="cl"></div>
|
||||
|
||||
<script>
|
||||
if($.trim($("#base_on_project").val()) == 1) {
|
||||
$("#base_on_project").attr('checked','checked');
|
||||
}
|
||||
</script>
|
|
@ -71,17 +71,6 @@
|
|||
<!-- , user_import_resource_user_path(User.current.id,:homework_id=>container.id) -->
|
||||
<a href="javascript:void(0);" class="AnnexBtn fl mt3 mr15" onclick="$('#_file').click();" title="请选择文件上传">上传附件</a>
|
||||
<%= link_to "资源库", user_ref_resource_search_user_path(User.current.id, :homework_id => container.id), :class => "FilesBtn fl mt3 mr15", :title => "请从资源库中选择文件作为作业的附件", :remote => true %>
|
||||
<% if defined?(has_program) && has_program %>
|
||||
<div id="program_setting" class="fl">
|
||||
<a href="javascript:void(0);" class="ProBtn fl mt3"title="请设置编程语言和输入测试集">编程</a>
|
||||
<span class="fl C_lgrey mt3 program_detail_info mr15"></span>
|
||||
</div>
|
||||
<% end %>
|
||||
<% if defined?(has_group) && has_group %>
|
||||
<div id="group_setting" class="fl">
|
||||
<a href="javascript:void(0);" class="groupBtn fl mt3" title="请设置分组作业的相关参数">分组</a>
|
||||
</div>
|
||||
<% end %>
|
||||
</div>
|
||||
|
||||
<% content_for :header_tags do %>
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
<% not_allow_select = edit_mode && homework.student_works.has_committed.count != 0 %>
|
||||
<% content_for :header_tags do %>
|
||||
<%= import_ke(enable_at: true, prettify: false, init_activity: false) %>
|
||||
|
||||
|
@ -5,14 +6,31 @@
|
|||
<script type="text/javascript">
|
||||
var first_click = true;
|
||||
$(function(){
|
||||
$("#homework_type_option").on("change",function(){
|
||||
var type = $(this).children('option:selected').val()
|
||||
if(type == "1"){
|
||||
$("#homeworkSetting").addClass("undis");
|
||||
$("#homeworkSetting").html("");
|
||||
}else if(type == "2"){
|
||||
$("#homeworkSetting").removeClass("undis");
|
||||
$("#homeworkSetting").html("<%=escape_javascript(render :partial => 'users/user_programing_attr', :locals => {:edit_mode => edit_mode, :homework=>homework, :not_allow_select => not_allow_select}) %>");
|
||||
}else{
|
||||
$("#homeworkSetting").removeClass("undis");
|
||||
$("#homeworkSetting").html("<%=escape_javascript(render :partial => 'users/user_group_attr', :locals => {:edit_mode => edit_mode, :homework=>homework, :not_allow_select => not_allow_select}) %>");
|
||||
}
|
||||
});
|
||||
if($.trim($("#anonymous_comment").val()) == 1) {
|
||||
$("#anonymous_comment").attr('checked',true);
|
||||
} else {
|
||||
$("#anonymous_comment").attr('checked',false);
|
||||
} else {
|
||||
$("#anonymous_comment").attr('checked',true);
|
||||
}
|
||||
if($.trim($("#base_on_project").val()) == 1) {
|
||||
$("#base_on_project").attr('checked','checked');
|
||||
}
|
||||
<% if edit_mode && homework.homework_type == 2 %>
|
||||
$("#homeworkSetting").removeClass("undis");
|
||||
$("#homeworkSetting").html("<%=escape_javascript(render :partial => 'users/user_programing_attr', :locals => {:edit_mode => edit_mode, :homework=>homework, :not_allow_select => not_allow_select}) %>");
|
||||
<% elsif edit_mode && homework.homework_type == 3 %>
|
||||
$("#homeworkSetting").removeClass("undis");
|
||||
$("#homeworkSetting").html("<%=escape_javascript(render :partial => 'users/user_group_attr', :locals => {:edit_mode => edit_mode, :homework=>homework, :not_allow_select => not_allow_select}) %>");
|
||||
<% end %>
|
||||
<% if edit_mode && homework.is_program_homework? %>
|
||||
$("#BluePopupBox a.BlueCirBtn").click();
|
||||
<% end %>
|
||||
|
@ -21,15 +39,15 @@
|
|||
<% end %>
|
||||
<% if edit_mode %>
|
||||
$("#anonymous_comment").on('click',function(){
|
||||
$("#anonymous_hint").show();
|
||||
$("#homework_end_time_span").html("更改后评分比例将恢复默认值");
|
||||
});
|
||||
<% end %>
|
||||
});
|
||||
function checked_val() {
|
||||
if ($("#anonymous_comment").is(":checked")) {
|
||||
$("#anonymous_comment").val(1);
|
||||
} else {
|
||||
$("#anonymous_comment").val(0);
|
||||
} else {
|
||||
$("#anonymous_comment").val(1);
|
||||
}
|
||||
}
|
||||
function nh_reset_homework_form(params){
|
||||
|
@ -63,6 +81,10 @@
|
|||
else if(!regex_course_id()){
|
||||
$("#course_id").focus();
|
||||
}
|
||||
else if($("#homework_type_option").val() == 2 && !regex_program_attr()) {
|
||||
}
|
||||
else if($("#homework_type_option").val() == 3 && !regex_group_attr()) {
|
||||
}
|
||||
else{
|
||||
params.textarea.html(params.editor.html());
|
||||
params.editor.sync();
|
||||
|
@ -154,28 +176,32 @@
|
|||
<div class="HomeWorkCon">
|
||||
<a id="submit_homework"></a>
|
||||
<div>
|
||||
<input type="text" name="homework_common[name]" id="homework_name" class="InputBox w701" maxlength="255" onfocus="$('#homework_editor').show()" onkeyup="regex_homework_name();" placeholder="发布作业,请先输入作业标题" value="<%= homework.name%>" >
|
||||
<input type="text" name="homework_common[name]" id="homework_name" class="InputBox fl <%= edit_mode ? 'w701' : 'w603' %>" maxlength="255" onfocus="$('#homework_editor').show()" onkeyup="regex_homework_name();" placeholder="发布作业,请先输入作业标题" value="<%= homework.name%>" >
|
||||
<%= link_to("从题库选用", user_import_homeworks_user_path(User.current.id,:select_course => defined?(select_course)),:class => "BlueCirBtn fr",:remote => true,:title=>"导入自己发布过的作业,或者共享题库中的作业") unless edit_mode%>
|
||||
<% unless edit_mode %>
|
||||
<input type="hidden" name="quotes" id="ref_homework_id" value=""/>
|
||||
<% end %>
|
||||
<div class="cl"></div>
|
||||
<p id="homework_name_span" class="c_red mt5"></p>
|
||||
</div>
|
||||
<div class="cl"></div>
|
||||
|
||||
<div class=" mt10">
|
||||
<%= link_to("从题库选用", user_import_homeworks_user_path(User.current.id,:select_course => defined?(select_course)),:class => "BlueCirBtn fl mr10",:remote => true,:title=>"导入自己发布过的作业,或者共享题库中的作业") unless edit_mode%>
|
||||
<% unless edit_mode %>
|
||||
<input type="hidden" name="quotes" id="ref_homework_id" value=""/>
|
||||
<div class="mt10">
|
||||
<% group_pro = homework.homework_type == 3 && homework.student_work_projects.count != 0 %>
|
||||
<select class="homework-type-option fl mr10" name="homework_type" <%=(not_allow_select || group_pro) ? 'disabled' : '' %> id="homework_type_option">
|
||||
<%= options_for_select(homework_type_option,homework.homework_type) %>
|
||||
</select>
|
||||
<% if not_allow_select || group_pro %>
|
||||
<input type="text" style="display: none" name="homework_type" value="<%=homework.homework_type %>"/>
|
||||
<% end %>
|
||||
<%# if edit_mode %>
|
||||
<label class="fl c_grey f14" style="margin-top: 4px;">截止日期:</label>
|
||||
<%# end %>
|
||||
<label class="fl c_grey f14 mt5">截止日期:</label>
|
||||
<div class="calendar_div fl mr10">
|
||||
<input type="text" name="homework_common[end_time]" id="homework_end_time" class="InputBox fl W120 calendar_input" readonly="readonly" value="<%= homework.end_time%>" >
|
||||
<% if homework.homework_detail_manual.comment_status.to_i < 2 %>
|
||||
<%= calendar_for('homework_end_time')%>
|
||||
<% end %>
|
||||
</div>
|
||||
<%# if edit_mode %>
|
||||
<label class="fl c_grey f14" style="margin-top: 4px;">发布日期(可选):</label>
|
||||
<%# end %>
|
||||
<label class="fl c_grey f14 mt5" style="margin-top: 4px;">发布日期(可选):</label>
|
||||
<div class="calendar_div fl">
|
||||
<% allow_edit = homework.student_works.has_committed.count == 0 && homework.student_work_projects.count ==0 %>
|
||||
<input title="<%=allow_edit ? '' : '已有学生提交作品或关联项目,发布日期不可再编辑' %>" type="text" name="homework_common[publish_time]" id="homework_publish_time" class="InputBox fl W120 calendar_input" readonly="readonly" value="<%= homework.publish_time%>" >
|
||||
|
@ -184,10 +210,10 @@
|
|||
<% end %>
|
||||
</div>
|
||||
<% if !edit_mode || edit_mode && homework.homework_detail_manual.comment_status < 2 %>
|
||||
<div class="fl f14 ml10" style="margin-top: 4px;">
|
||||
<div class="fr f14 ml10" style="margin-top: 4px;">
|
||||
<input type="checkbox" name="homework_common[anonymous_comment]" value="<%=edit_mode ? homework.anonymous_comment : 1 %>" id="anonymous_comment"/>
|
||||
<span class="f14 c_grey">禁用匿评</span>
|
||||
<span id="anonymous_hint" style="display: none; font-size: 12px;" class="c_red">更改后评分比例将恢复默认值</span>
|
||||
<span class="f14 c_grey">启用匿评</span>
|
||||
<!--<span id="anonymous_hint" style="display: none; font-size: 12px;" class="c_red">更改后评分比例将恢复默认值</span>-->
|
||||
</div>
|
||||
<% end %>
|
||||
</div>
|
||||
|
@ -216,9 +242,13 @@
|
|||
<p id="e_tips" class="c_grey"></p>
|
||||
<div class="cl"></div>
|
||||
|
||||
<div class="mt10 b_grey undis" style="padding:10px;" id="homeworkSetting">
|
||||
|
||||
</div>
|
||||
|
||||
<div id="homework_attachments">
|
||||
<!-- 编辑作业 && 作业类型为匿评作业 时没有编程选项-->
|
||||
<%= render :partial => 'users/user_homework_attachment', :locals => {:container => homework, :has_program=>!(edit_mode && homework.homework_type != 2), :has_group=>(!(edit_mode && homework.homework_type != 3))&& homework.student_works.empty?,:show_member => true} %>
|
||||
<!-- 编辑作业 && 作业类型为匿评作业时没有编程选项-->
|
||||
<%= render :partial => 'users/user_homework_attachment', :locals => {:container => homework, :show_member => true} %>
|
||||
</div>
|
||||
|
||||
<div class="mt5">
|
||||
|
@ -234,50 +264,21 @@
|
|||
<% end %>
|
||||
<div class="cl"></div>
|
||||
</div>
|
||||
|
||||
<input type="hidden" name="homework_type" value="<%= edit_mode ? homework.homework_type : 1 %>">
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<div class="cl"></div>
|
||||
|
||||
<script id="t:test-answer-list" type="text/html">
|
||||
<div class="mt10">
|
||||
<label class="fl mt5" name="inputs_label"> </label>
|
||||
<textarea class="InputBox W320 fl mr10" placeholder="测试输入" name="program[input][]"></textarea>
|
||||
<textarea class="InputBox W320 fl mr5" placeholder="测试输出" name="program[output][]"></textarea>
|
||||
<div class="mt10" style="margin-left:63px;">
|
||||
<label class="fl fontGrey2 mr10 mt5" name="inputs_label"> </label>
|
||||
<textarea class="InputBox w265 fl mr10" placeholder="测试输入" name="program[input][]"></textarea>
|
||||
<textarea class="InputBox w265 fl mr5" placeholder="测试输出" name="program[output][]"></textarea>
|
||||
<a href="javascript:void(0);" class=" fl icon_add" title="增加测试组"></a>
|
||||
<a href="javascript:void(0);" class=" fl icon_remove" title="删除测试组"></a>
|
||||
<div class="cl"></div>
|
||||
</div>
|
||||
</script>
|
||||
|
||||
<script type="text/html" id="t:program-input-list">
|
||||
<div class="program-input">
|
||||
<input type="hidden" name="language_type" value="<!= language_type !>" />
|
||||
<! for(var i=0; i< input_groups.length; ++i) { !>
|
||||
<input name="program[input][]" type="hidden" value="<!= input_groups[i].input !>" />
|
||||
<input name="program[output][]" type="hidden" value="<!= input_groups[i].output !>" />
|
||||
<! } !>
|
||||
</div>
|
||||
</script>
|
||||
|
||||
<script id="t:group-input-list" type="text/html">
|
||||
<div class="group-input">
|
||||
<input type="hidden" name="min_num" value="<!= min_num !>" />
|
||||
<input type="hidden" name="max_num" value="<!= max_num !>" />
|
||||
<input type="hidden" name="base_on_project" value="<!= base_on_project !>" />
|
||||
</div>
|
||||
</script>
|
||||
|
||||
<div class="BluePopupBox" id="BluePopupBox" style="display:none;">
|
||||
<%= render :partial => 'users/user_programing_attr', :locals => {:edit_mode => edit_mode, :homework=>homework} %>
|
||||
</div><!----BluePopupBox end-->
|
||||
|
||||
<div class="BluePopupBox" style="display:none;" id="GroupPopupBox">
|
||||
<%= render :partial => 'users/user_group_attr', :locals => {:edit_mode => edit_mode, :homework=>homework}%>
|
||||
</div>
|
||||
|
||||
<% unless edit_mode %>
|
||||
<div class="BluePopupBox" style="display:none;" id="NoticePopupBox">
|
||||
<%= render :partial => 'users/homework_type_notice', :locals => {:edit_mode => edit_mode, :homework=>homework}%>
|
||||
|
|
|
@ -1,46 +1,63 @@
|
|||
<a href="javascript:void(0);" class="CloseBtn" title="关闭弹框"></a>
|
||||
<h2 class="BluePopuph2 fl">编程作业的测试集设置</h2>
|
||||
<div class="cl"></div>
|
||||
<div class="HomeWorkCon">
|
||||
<div class="mt15">
|
||||
<select class="InputBox W120 language_type" >
|
||||
<div id="programHomework">
|
||||
<span class="f14 mt5 fl fontGrey3 mr10">测试集设置:</span>
|
||||
<select class="InputBox W120 language_type" name="language_type" <%=not_allow_select ? 'disabled' : '' %>>
|
||||
<%= options_for_select({"C语言"=>1, "C++"=>2, "Python"=>3, "Java"=>4}, (edit_mode && homework.is_program_homework?) ? homework.language : 1) %>
|
||||
</select>
|
||||
</div>
|
||||
<div style="height: 320px; overflow-y:auto; width:756px;">
|
||||
<span class="f12 c_red mt5 fr">温馨提示:您可以在发布作业后,在作业"模拟答题"中进行标准代码的检测。</span>
|
||||
<div class="cl"></div>
|
||||
<% if edit_mode && homework.is_program_homework? %>
|
||||
<% homework.homework_tests.each_with_index do |test, index| %>
|
||||
<div class="mt10">
|
||||
<label class="fl mt5" name="inputs_label"><%=index+1 %> </label>
|
||||
<textarea class="InputBox W320 fl mr10" placeholder="测试输入" name="program[input][]"><%= test.input %></textarea>
|
||||
<textarea class="InputBox W320 fl mr5" placeholder="测试输出" name="program[output][]"><%= test.output %></textarea>
|
||||
<div class="mt10" style="margin-left:63px;">
|
||||
<label class="fl fontGrey2 mr10 mt5" name="inputs_label"><%=index+1 %> </label>
|
||||
<textarea class="InputBox w265 fl mr10" placeholder="测试输入" name="program[input][]" <%=not_allow_select ? 'disabled' : '' %>><%= test.input %></textarea>
|
||||
<textarea class="InputBox w265 fl mr5" placeholder="测试输出" name="program[output][]" <%=not_allow_select ? 'disabled' : '' %>><%= test.output %></textarea>
|
||||
<% unless not_allow_select %>
|
||||
<a href="javascript:void(0);" class=" fl icon_add" title="增加测试组"></a>
|
||||
<% if index != 0 %>
|
||||
<a href="javascript:void(0);" class=" fl icon_remove" title="删除测试组"></a>
|
||||
<% end %>
|
||||
<% end %>
|
||||
<div class="cl"></div>
|
||||
</div>
|
||||
<% end %>
|
||||
<% else %>
|
||||
<div class="mt10">
|
||||
<label class="fl mt5" name="inputs_label">1 </label>
|
||||
<textarea class="InputBox W320 fl mr10" placeholder="测试输入" name="program[input][]" id="textarea_input_test"></textarea>
|
||||
<textarea class="InputBox W320 fl mr5" placeholder="测试输出" name="program[output][]" id="textarea_output_test"></textarea>
|
||||
<div class="mt10" style="margin-left:63px;">
|
||||
<label class="fl fontGrey2 mr10 mt5" name="inputs_label">1 </label>
|
||||
<textarea class="InputBox w265 fl mr10" placeholder="测试输入" name="program[input][]" id="textarea_input_test"></textarea>
|
||||
<textarea class="InputBox w265 fl mr5" placeholder="测试输出" name="program[output][]" id="textarea_output_test"></textarea>
|
||||
<a href="javascript:void(0);" class=" fl icon_add" title="增加测试组"></a>
|
||||
<div class="cl"></div>
|
||||
</div>
|
||||
<% end %>
|
||||
</div>
|
||||
|
||||
<div class="mt10">
|
||||
<span class="f12 c_red db mt5 fl">温馨提示:您可以在发布作业后,在作业“模拟答题”中进行标准代码的检测。</span>
|
||||
<a href="#submit_homework" class="BlueCirBtn fr">确 定</a>
|
||||
<div class="cl"></div>
|
||||
</div>
|
||||
|
||||
</div><!----HomeWorkCon end-->
|
||||
</div>
|
||||
|
||||
<script>
|
||||
$(function(){
|
||||
var bt=baidu.template;
|
||||
bt.LEFT_DELIMITER='<!';
|
||||
bt.RIGHT_DELIMITER='!>';
|
||||
|
||||
$("#programHomework").on('click', 'a.icon_add', function(){
|
||||
var html = bt('t:test-answer-list', null);
|
||||
$(this).parent('.mt10').after(html);
|
||||
var inputs = document.getElementsByName("program[input][]");
|
||||
var outputs = document.getElementsByName("program[output][]");
|
||||
var inputs_labels = document.getElementsByName("inputs_label");
|
||||
for(var j= 0; j<inputs_labels.length; j++){
|
||||
$(inputs_labels[j]).html(j + 1 + " " );
|
||||
}
|
||||
if (inputs.length == outputs.length) {
|
||||
for (var i=0; i<inputs.length; i++) {
|
||||
autoTextarea2(inputs[i], outputs[i]);
|
||||
autoTextarea2(outputs[i], inputs[i]);
|
||||
}
|
||||
}
|
||||
$(inputs[inputs.length - 1]).focus();
|
||||
});
|
||||
$("#programHomework").on('click', 'a.icon_remove', function(){
|
||||
$(this).parent('.mt10').remove();
|
||||
});
|
||||
});
|
||||
<% if !edit_mode %>
|
||||
var text = document.getElementById("textarea_input_test");
|
||||
var text2 = document.getElementById("textarea_output_test");
|
||||
|
|
|
@ -10,11 +10,11 @@ $("#homework_attachments").html("<%= escape_javascript(render :partial => 'users
|
|||
homework_description_editor.html("<%= escape_javascript(@homework.description.html_safe)%>");
|
||||
//$("input[name='homework_type']").val("<%#= @homework.homework_type%>");
|
||||
<% if @homework_detail_programing %>
|
||||
$("#BluePopupBox").html("<%=escape_javascript( render :partial => 'users/user_programing_attr', :locals => {:edit_mode => true, :homework => @homework})%>");
|
||||
$("#BluePopupBox a.BlueCirBtn").click();
|
||||
$("#homeworkSetting").removeClass("undis");
|
||||
$("#homeworkSetting").html("<%=escape_javascript(render :partial => 'users/user_programing_attr', :locals => {:edit_mode => true, :homework=>@homework, :not_allow_select => false}) %>");
|
||||
<% elsif @homework_detail_group %>
|
||||
$('span.group_detail_info').text('分组人数:<%=@homework_detail_group.min_num %>-<%=@homework_detail_group.max_num %> 人');
|
||||
$("#GroupPopupBox").html("<%=escape_javascript( render :partial => 'users/user_group_attr', :locals => {:edit_mode => true, :homework => @homework})%>");
|
||||
$("#GroupPopupBox a.group_save_btn").click();
|
||||
$("#homeworkSetting").removeClass("undis");
|
||||
$("#homeworkSetting").html("<%=escape_javascript(render :partial => 'users/user_group_attr', :locals => {:edit_mode => true, :homework=>@homework, :not_allow_select => false}) %>");
|
||||
<% end %>
|
||||
$("#homework_type_option option[value='<%=@homework.homework_type %>']").attr("selected",true);
|
||||
$("#homework_editor").show();
|
||||
|
|
|
@ -11,7 +11,7 @@
|
|||
|
||||
<form name="regFrm" novalidate>
|
||||
|
||||
<div class="course-list-row f13 c-grey3 mt10"><span class="fl ml15 c-grey3">姓名</span><input class="new-class-input ml25" ng-model="lastname" placeholder="请输入您的姓名全称" maxlength="30" /></div>
|
||||
<div class="course-list-row f13 c-grey3 mt10"><span class="fl ml15 c-grey3">姓名</span><input class="new-class-input ml25" ng-model="lastname" placeholder="请输入您的真实姓名" maxlength="30" /></div>
|
||||
<div class="course-list-row f13 c-grey3 mt10" style="height:auto;">
|
||||
<div class="mt5" style="line-height:20px">
|
||||
<span class="ml15 c-grey3">性别</span>
|
||||
|
@ -33,6 +33,12 @@
|
|||
<span class="f12 c-red fl ml15" ng-show="regFrm.email.$error.email">电子邮箱地址不合法</span>
|
||||
</div>
|
||||
</div>
|
||||
<div ng-show="lastname == '' " class="f12 c-grey6 mt10 ml15">
|
||||
<span class="f13 c-grey3">提示</span>
|
||||
<ul class="mb15 mt5 ml10 new-tip">
|
||||
<li><span class="project-intro-dot">•</span>您尚未完善您的基本资料,完善后可使用更多功能</li>
|
||||
</ul>
|
||||
</div>
|
||||
<div class="bottom-tab-wrap mt10">
|
||||
<a ng-click="cancel()" class="weixin-tab c-grey border-top">取消</a>
|
||||
<a ng-click="confirm(regFrm)" ng-class="[{'btn-disabled':!regFrm.$valid} ]" class="weixin-tab link-blue2 border-top">确定</a>
|
||||
|
|
|
@ -4,13 +4,13 @@
|
|||
<form name="loginFrm" novalidate>
|
||||
<div class="blue-title">绑定<span class="f13 blue-title-sub" ng-click="goReg()">注册</span></div>
|
||||
<div class="input-box-wrap login-wrap mt30">
|
||||
<input name="login" ng-model="user.login" required class="input-box" placeholder="请输入电子邮箱地址或登录名" />
|
||||
<input name="login" ng-model="user.login" required class="input-box" placeholder="请输入平台上的注册邮箱或登录名" />
|
||||
<div ng-show="loginFrm.$submitted || loginFrm.login.$touched">
|
||||
<span ng-show="loginFrm.login.$error.required" class="c-red fl f12">电子邮箱地址或登录名不能为空</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="input-box-wrap login-wrap mt10 mb20">
|
||||
<input class="input-box" placeholder="请输入密码" name="password" type="password" ng-model="user.password" required />
|
||||
<input class="input-box" placeholder="请输入帐号的登录密码" name="password" type="password" ng-model="user.password" required />
|
||||
<div ng-show="loginFrm.$submitted || loginFrm.password.$touched">
|
||||
<span ng-show="loginFrm.password.$error.required" class="c-red fl f12">密码不能为空</span>
|
||||
</div>
|
||||
|
|
|
@ -815,6 +815,58 @@ function regex_course_id(){
|
|||
}
|
||||
}
|
||||
|
||||
//验证分组作业的参数
|
||||
function regex_group_attr(){
|
||||
var min = $.trim($("#min_num").val());
|
||||
var max = $.trim($("#max_num").val());
|
||||
var regex = /^\d+$/;
|
||||
if(!regex.test(min) || parseInt(min) <= 0) {
|
||||
$("#min_max_num_notice").html("人数为正整数");
|
||||
$("#min_max_num_notice").show();
|
||||
$("#min_num").focus();
|
||||
return false;
|
||||
} else {
|
||||
$("#min_max_num_notice").html("");
|
||||
$("#min_max_num_notice").hide();
|
||||
}
|
||||
if(!regex.test(max) || parseInt(max) <= 0) {
|
||||
$("#min_max_num_notice").html("人数为正整数");
|
||||
$("#min_max_num_notice").show();
|
||||
$("#max_num").focus();
|
||||
return false;
|
||||
} else {
|
||||
$("#min_max_num_notice").html("");
|
||||
$("#min_max_num_notice").hide();
|
||||
}
|
||||
if(parseInt(min) > parseInt(max)) {
|
||||
$("#min_max_num_notice").html("最小人数不得大于最大人数");
|
||||
$("#min_max_num_notice").show();
|
||||
$("#max_num").focus();
|
||||
return false;
|
||||
} else {
|
||||
$("#min_max_num_notice").html("");
|
||||
$("#min_max_num_notice").hide();
|
||||
}
|
||||
if ($("#base_on_project").is(":checked")) {
|
||||
$("#base_on_project").val(1);
|
||||
} else {
|
||||
$("#base_on_project").val(0);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
//验证编程作业的参数
|
||||
function regex_program_attr() {
|
||||
var result = true;
|
||||
$.each($('#programHomework textarea.InputBox'), function(i, val){
|
||||
if (result && $(val).val().length<=0) {
|
||||
$(val)[0].focus();
|
||||
result = false;
|
||||
}
|
||||
});
|
||||
return result;
|
||||
}
|
||||
|
||||
function regexHomeworkCommonName()
|
||||
{
|
||||
var name = $.trim($("#homework_attach_name").val());
|
||||
|
|
|
@ -194,6 +194,58 @@ function regex_course_id(){
|
|||
}
|
||||
}
|
||||
|
||||
//验证分组作业的参数
|
||||
function regex_group_attr(){
|
||||
var min = $.trim($("#min_num").val());
|
||||
var max = $.trim($("#max_num").val());
|
||||
var regex = /^\d+$/;
|
||||
if(!regex.test(min) || parseInt(min) <= 0) {
|
||||
$("#min_max_num_notice").html("人数为正整数");
|
||||
$("#min_max_num_notice").show();
|
||||
$("#min_num").focus();
|
||||
return false;
|
||||
} else {
|
||||
$("#min_max_num_notice").html("");
|
||||
$("#min_max_num_notice").hide();
|
||||
}
|
||||
if(!regex.test(max) || parseInt(max) <= 0) {
|
||||
$("#min_max_num_notice").html("人数为正整数");
|
||||
$("#min_max_num_notice").show();
|
||||
$("#max_num").focus();
|
||||
return false;
|
||||
} else {
|
||||
$("#min_max_num_notice").html("");
|
||||
$("#min_max_num_notice").hide();
|
||||
}
|
||||
if(parseInt(min) > parseInt(max)) {
|
||||
$("#min_max_num_notice").html("最小人数不得大于最大人数");
|
||||
$("#min_max_num_notice").show();
|
||||
$("#max_num").focus();
|
||||
return false;
|
||||
} else {
|
||||
$("#min_max_num_notice").html("");
|
||||
$("#min_max_num_notice").hide();
|
||||
}
|
||||
if ($("#base_on_project").is(":checked")) {
|
||||
$("#base_on_project").val(1);
|
||||
} else {
|
||||
$("#base_on_project").val(0);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
//验证编程作业的参数
|
||||
function regex_program_attr() {
|
||||
var result = true;
|
||||
$.each($('#programHomework textarea.InputBox'), function(i, val){
|
||||
if (result && $(val).val().length<=0) {
|
||||
$(val)[0].focus();
|
||||
result = false;
|
||||
}
|
||||
});
|
||||
return result;
|
||||
}
|
||||
|
||||
//老师导入作业时查询作业
|
||||
function search_homework_by_name(url){
|
||||
$.get(
|
||||
|
|
|
@ -155,7 +155,7 @@ app.controller('ProjectController', ['$scope', 'config','$http','$timeout', 'aut
|
|||
vm.currentTab = rms.get('tab_num');
|
||||
|
||||
//
|
||||
if(!vm.currentTab){
|
||||
if(!vm.currentTab || !vm.project){
|
||||
$http.get(config.apiUrl+ 'projects/'+projectid+"?token="+auth.token()).then(
|
||||
function(response) {
|
||||
console.log(response.data);
|
||||
|
|
|
@ -36,7 +36,8 @@ app.controller('RegController', ['$scope', '$http', '$location', 'alertService',
|
|||
vm.successDialog.showMessage("提示","注册且绑定微信成功", function(){
|
||||
// $location.path("/activities");
|
||||
// window.WeixinJSBridge.call('closeWindow');
|
||||
wx.closeWindow();
|
||||
// wx.closeWindow();
|
||||
$location.path("/edit_userinfo");
|
||||
});
|
||||
}
|
||||
}, function (response) {
|
||||
|
|
|
@ -270,6 +270,7 @@ h4{ font-size:14px;}/*color:#3b3b3b;*/
|
|||
.w350{ width:350px;}
|
||||
.w610{ width:610px;}
|
||||
.w600{ width:600px !important;}
|
||||
.w603{ width:603px !important;}
|
||||
.w606{ width:606px; }
|
||||
.w620{ width:620px;}
|
||||
.w680{ width: 680px;}
|
||||
|
|
|
@ -234,6 +234,7 @@ a.hworkExport {background:url(/images/homepage_icon2.png) -10px -401px no-repeat
|
|||
a.hworkSetting {background:url(/images/homepage_icon2.png) -10px -450px no-repeat; padding-left:23px;}
|
||||
.hworkInfor {font-size:12px; color:#269ac9; width:80px; height:40px; vertical-align:middle; float:left; line-height:40px; text-align:center; font-weight:bold;}
|
||||
.infoNi{ width:100px; padding:5px;-moz-border-radius:3px; -webkit-border-radius:3px; border-radius:3px; box-shadow:0px 0px 5px #194a81; color:#666; background:#fff; text-align:left; line-height:2; position:absolute; margin-top:-24px;margin-left: 40px; z-index:99;}
|
||||
.g_infoNi{ width:100px; padding:5px;-moz-border-radius:3px; -webkit-border-radius:3px; border-radius:3px; box-shadow:0px 0px 5px #194a81; color:#666; background:#fff; text-align:left; line-height:2; position:absolute; left:0; z-index:99;}
|
||||
.problemTxt {width:660px; margin-left:10px; color:#777777; position:relative;}
|
||||
.rTxtTit{width:560px; overflow:hidden; white-space: nowrap; text-overflow:ellipsis;color:#15bccf; float:left; color:#269ac9; font-size:14px;}
|
||||
.hworkSearchBox {border:1px solid #e6e6e6; width:185px; float:left; background-color:#ffffff;}
|
||||
|
|
|
@ -1455,3 +1455,7 @@ a:hover.sy_btn_green{ background: #51a74f;}
|
|||
.invite_code_tip_box em {display:block; border-width:10px; position:absolute;top:26px; left:-20px; border-style:dashed solid dashed dashed; border-color:transparent #eaeaea transparent transparent; font-size:0; line-height:0;}
|
||||
.invite_code_tip_box span {display:block; border-width:10px; position:absolute;top:26px; left:-18px; border-style:dashed solid dashed dashed; border-color:transparent #fff transparent transparent; font-size:0; line-height:0;}
|
||||
|
||||
/*flex布局*/
|
||||
.flex-container {display:flex;}
|
||||
.flex-cell {flex:1;}
|
||||
.flex-cell:last-child {text-align:right;}
|
||||
|
|
Loading…
Reference in New Issue