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

This commit is contained in:
huang 2016-10-28 16:07:04 +08:00
commit 638205a7b7
57 changed files with 1084 additions and 664 deletions

View File

@ -395,6 +395,7 @@ class CoursesController < ApplicationController
page_from = params[:page].nil? ? 0 : (params[:page].to_i - 1)
@results = student_homework_score(0,page_from, 10,"desc")
end
@course_groups = @course.course_groups
@limit = 50
@page = params[:page].nil? ? 1 : params['page'].to_i
@members_count = @results.count

View File

@ -1,6 +1,6 @@
#encoding utf-8
class PollController < ApplicationController
before_filter :find_poll_and_course, :only => [:edit,:update,:destroy,:show,:statistics_result,:create_poll_question,:commit_poll,:commit_answer,:publish_poll,:republish_poll,:poll_result,:close_poll,:export_poll,:save_poll]
before_filter :find_poll_and_course, :only => [:edit,:update,:destroy,:show,:statistics_result,:create_poll_question,:commit_poll,:commit_answer,:publish_poll,:republish_poll,:poll_result,:close_poll,:export_poll,:save_poll,:update_question_num]
before_filter :find_container, :only => [:new,:create, :index]
before_filter :is_logged, :only => [:index, :show, :poll_result,:new,:create,:edit,:update,:destroy,:publish_poll,:republish_poll,:close_poll,:export_poll,:commit_answer,:commit_poll,:statistics_result,:save_poll]
before_filter :is_member_of_course, :only => [:index,:show,:poll_result]
@ -44,8 +44,7 @@ class PollController < ApplicationController
else
@can_edit_poll = (!has_commit_poll?(@poll.id,User.current.id)) || User.current.admin?
@percent = get_percent(@poll,User.current)
poll_questions = @poll.poll_questions
@poll_questions = paginateHelper poll_questions,5 #分页
@poll_questions = @poll.poll_questions
@left_nav_type = 7
respond_to do |format|
format.html {render :layout => 'base_courses'}
@ -133,16 +132,39 @@ class PollController < ApplicationController
def get_poll_everycount poll_answer
@every_answer_count = poll_answer.poll_votes.count
end
def update_question_num
@poll_question = PollQuestion.find params[:ques_id]
poll_questions = @poll.poll_questions
if @poll_question
if params[:opr] == 'up' && @poll_question.question_number > 1
@before_que = poll_questions.where("question_number = #{@poll_question.question_number - 1}").first
if @before_que && @poll_question.update_attribute('question_number', @poll_question.question_number - 1)
@before_que.update_attribute('question_number', @before_que.question_number + 1)
end
elsif params[:opr] == 'down' && @poll_question.question_number < poll_questions.count
@after_que = poll_questions.where("question_number = #{@poll_question.question_number + 1}").first
if @after_que && @poll_question.update_attribute('question_number', @poll_question.question_number + 1)
@after_que.update_attribute('question_number', @after_que.question_number - 1)
end
end
respond_to do |format|
format.js
end
end
end
#添加题目
def create_poll_question
@last_question = @poll.poll_questions.last
question_title = params[:poll_questions_title].nil? || params[:poll_questions_title].empty? ? l(:label_enter_single_title) : params[:poll_questions_title]
option = {
:is_necessary => (params[:is_necessary]=="true" ? 1 : 0),
:question_title => question_title,
:question_type => params[:question_type] || 1,
:question_number => @poll.poll_questions.count + 1
:question_number => @poll.poll_questions.count + 1,
:max_choices => params[:max_choices].to_i || 0,
:min_choices => params[:min_choices].to_i || 0,
}
@poll_questions = @poll.poll_questions.new option
if params[:question_answer]
@ -164,17 +186,20 @@ class PollController < ApplicationController
end
# 如果是插入的话那么从插入的这个id以后的question_num都将要+1
if params[:quest_id]
@is_insert = true
@poll.poll_questions.where("question_number > #{params[:quest_num].to_i}").update_all(" question_number = question_number + 1")
@poll_question_num = params[:quest_num].to_i
@poll_questions.question_number = params[:quest_num].to_i + 1
end
if @poll_questions.save
respond_to do |format|
format.js
end
insert_poll = PollQuestion.find params[:quest_id]
if insert_poll
@is_insert = true
ques_num = insert_poll.question_number
@poll.poll_questions.where("question_number > #{ques_num}").update_all(" question_number = question_number + 1")
@poll_question_num = ques_num
@poll_questions.question_number = ques_num + 1
end
end
if @poll_questions.save
respond_to do |format|
format.js
end
end
end
#修改题目
@ -183,6 +208,8 @@ class PollController < ApplicationController
#@poll = @poll_question.poll
@poll_question.is_necessary = params[:is_necessary]=="true" ? 1 : 0
@poll_question.question_title = params[:poll_questions_title].nil? || params[:poll_questions_title].empty? ? l(:label_enter_single_title) : params[:poll_questions_title]
@poll_question.max_choices = params[:max_choices].to_i || 0
@poll_question.min_choices = params[:min_choices].to_i || 0
################处理选项
if params[:question_answer]
@poll_question.poll_answers.each do |answer|
@ -299,24 +326,39 @@ class PollController < ApplicationController
pv = PollVote.find_by_poll_answer_id_and_user_id(params[:poll_answer_id],User.current.id)
if pv.nil?
#尚未答该题,添加答案
pv = PollVote.new
pv.user_id = User.current.id
pv.poll_question_id = params[:poll_question_id]
pv.poll_answer_id = params[:poll_answer_id]
pv.vote_text = params[:vote_text] if params[:vote_text]
if pv.save
@percent = get_percent(@poll,User.current)
render :json => {:text => "ok",:percent => format("%.2f" ,@percent)}
count = PollVote.where("poll_question_id = #{params[:poll_question_id].to_i} and user_id = #{User.current.id}").count
if pq.max_choices != 0 && count >= pq.max_choices
render :json => {:text => "over"}
else
render :json => {:text => "failure"}
pv = PollVote.new
pv.user_id = User.current.id
pv.poll_question_id = params[:poll_question_id]
pv.poll_answer_id = params[:poll_answer_id]
pv.vote_text = params[:vote_text] if params[:vote_text]
if pv.save
@percent = get_percent(@poll,User.current)
render :json => {:text => "ok",:percent => format("%.2f" ,@percent)}
else
render :json => {:text => "failure"}
end
end
else
#pv不为空则当前选项之前已被选择再次点击则是不再选择该项故删除该答案
if pv.delete
@percent = get_percent(@poll,User.current)
render :json => {:text => "false" ,:percent => format("%.2f" ,@percent)}
if params[:vote_text]
pv.vote_text = params[:vote_text]
if pv.save
@percent = get_percent(@poll,User.current)
render :json => {:text => "ok",:percent => format("%.2f" ,@percent)}
else
render :json => {:text => "failure"}
end
else
render :json => {:text => "failure"}
if pv.delete
@percent = get_percent(@poll,User.current)
render :json => {:text => "false" ,:percent => format("%.2f" ,@percent)}
else
render :json => {:text => "failure"}
end
end
end
elsif pq.question_type == 3
@ -564,16 +606,17 @@ class PollController < ApplicationController
end
@poll.save
end
@is_teacher = User.current.allowed_to?(:as_teacher,@course)
if @is_teacher
polls = Poll.where("polls_type = 'Course' and polls_group_id = #{@course.id}")
else
polls = Poll.where("polls_type = 'Course' and polls_group_id = #{@course.id} and polls_status = 2")
end
@polls = paginateHelper polls,20 #分页
respond_to do |format|
format.js
end
redirect_to poll_index_path(:polls_type => "Course", :polls_group_id => @course.id)
# @is_teacher = User.current.allowed_to?(:as_teacher,@course)
# if @is_teacher
# polls = Poll.where("polls_type = 'Course' and polls_group_id = #{@course.id}")
# else
# polls = Poll.where("polls_type = 'Course' and polls_group_id = #{@course.id} and polls_status = 2")
# end
# @polls = paginateHelper polls,20 #分页
# respond_to do |format|
# format.js
# end
end
private

View File

@ -36,7 +36,7 @@ module AttachmentsHelper
end
def link_to_attachment_project(container, options = {})
options.assert_valid_keys(:author, :thumbnails)
options.assert_valid_keys(:deletable, :author, :thumbnails)
if container.attachments.any?
options = {:deletable => container.attachments_deletable?, :author => true}.merge(options)

View File

@ -87,4 +87,21 @@ module PollHelper
s.html_safe
end
#问卷的多选题上下限
def min_or_max_choices_option pq
type = []
count = pq.poll_answers.count
option = []
option << '不限'
option << 0
type << option
for i in 1 .. count do
option = []
option << i
option << i
type << option
end
type
end
end

View File

@ -106,14 +106,14 @@
<% end %>
</p>
<% end %>
<div class="thumbnails">
<% if defined?(thumbnails) && thumbnails %>
<% if defined?(thumbnails) && thumbnails %>
<div class="thumbnails">
<% images = attachments.select(&:thumbnailable?) %>
<% if images.any? %>
<% images.each do |attachment| %>
<div class="pro_pic fl " width="100" height="73"><%= thumbnail_issue_tag(attachment) %></div>
<% end %>
<% end %>
<% end %>
</div>
</div>
<% end %>
</div>

View File

@ -35,6 +35,8 @@
<div nhname='toolbar_container_' ></div>
<textarea placeholder="有问题或有建议,请直接给我留言吧!" nhname='new_message_textarea_' name="new_form[course_message]"></textarea>
<p nhname='contentmsg_'></p>
<p id="e_tip" class="c_grey"></p>
<p id="e_tips" class="c_grey"></p>
<a id="new_message_cancel_btn_" href="javascript:void(0)" class="grey_btn fr mt10 ml10 mb10">取消</a>
<a href="javascript:void(0);" class="blue_btn fr mt10" id="new_message_submit_btn_" >留言</a>
<% end %>
@ -53,7 +55,6 @@
<div style="display:none;"><a href="#" id="nhjump"></a></div>
<script type="text/javascript">
$(function(){
KindEditor.ready(function(K){
$("a[nhname='reply_btn']").live('click',function(){
@ -69,6 +70,7 @@
params.cancel_btn = $("input[nhname='cancel_btn']",params.div_form);
params.height = 55;
params.editor = init_editor(params);
course_feedback_editor = params.editor;
init_form(params);
params.cancel_btn.click(function(){
nh_reset_form(params);
@ -89,5 +91,11 @@
});
});
});
</script>
<script type="text/javascript">
$(function(){
setTimeout(function(){
elocalStorage(main_editor,'course_feedback_<%=User.current.id %>_<%=@course.id %>');
}, 10000);
});
</script>

View File

@ -116,7 +116,7 @@
<% if @course.course_groups.empty? %>
<%=member.course_group_id == 0 ? "暂无" : member.course_group.name %>
<% else %>
<%= form_tag({:controller => 'courses', :action => 'teacher_assign_group', :id => @course.id,:user_id => member.user_id, :group_id => @group ? @group.id : -1},:remote=>'true', :method => 'post', :id=>"join_group_form_#{member.id}", :class => 'query_form') do %>
<%= form_tag({:controller => 'courses', :action => 'teacher_assign_group', :id => @course.id,:user_id => member.user_id, :group_id => @group && @group != -1 ? @group.id : -1},:remote=>'true', :method => 'post', :id=>"join_group_form_#{member.id}", :class => 'query_form') do %>
<div class="select-class-option">
<span class="hidden" style="display:inline-block; vertical-align:middle; max-width:70px;"><%=member.course_group_id == 0 ? "暂无" : member.course_group.name %></span>
<a href="javascript:void(0)" class="sy_icons_edit pic_edit_icon" alt="编辑" style="background-position:0 5px;"></a>

View File

@ -1,47 +1,45 @@
<div class="project_r_h02">
<div class="project_r_h02" style="width: 980px;">
<h2 class="project_h2"><%= l(:permission_new_course)%></h2>
</div>
<div class="hwork_new">
<div class="hwork_new pr">
<ul>
<%= labelled_form_for @course do |f| %>
<li class="ml45 mb10">
<li class="mt5 ml45 mb10">
<label><span class="c_red">*</span>&nbsp;<%= l(:label_tags_syllabus_name)%>&nbsp;&nbsp;</label>
<% if @syllabus.nil? %>
<%= select_tag :syllabus_id,options_for_select(course_syllabus_option,@course.syllabus_id), {:id=>"new_syllabus_id", :class=>"syllabus_input"} %>
<span class="c_red" id="new_syllabus_notice">如果列表中没有对应的课程,请您先<%=link_to '创建课程', new_syllabus_path(),:target => '_blank', :class => 'ml5 green_btn_share c_white'%>,然后【刷新】</span>
<%= select_tag :syllabus_id,options_for_select(course_syllabus_option,@course.syllabus_id), {:id=>"new_syllabus_id", :class=>"syllabus_input w300 h28"} %>
<% else %>
<span><%=@syllabus.title %></span>
<input style="display: none;" name="syllabus_id" value="<%=@syllabus.id %>" />
<% end %>
</li>
<div class="cl"></div>
<li class="ml45">
<li class="mt10 ml45">
<label><span class="c_red">*</span>&nbsp;<%= l(:label_tags_course_name)%>&nbsp;&nbsp;</label>
<input type="text" name="course[name]" id="new_course_name" class="courses_input" maxlength="100" placeholder="例如计算机系2016秋季A班" onkeyup="regex_course_name('new');">
<input type="text" name="course[name]" id="new_course_name" class="courses_input w289" maxlength="100" placeholder="例如计算机系2016秋季A班" onkeyup="regex_course_name('new');">
<span class="c_red" id="new_course_name_notice" style="display: none;">班级名称不能为空且至少有两个字符</span>
</li>
<div class="cl"></div>
<li class="ml125 mb5 fontGrey3"><span class="success-icon mr25">正确示例计算机系2016秋季A班</span></li>
<li class="ml125 mb10 fontGrey3"><span class="error-icon">错误示例:软件工程 - 计算机系2016秋季A班</span></li>
<li class="ml125 mt10 mb10 fontGrey2" style="max-width: 544px;">班级是一个由教师、助教(教辅)和学生组成的临时的教学群体,在规定的时间内(如一个学期)完成一门课程规定的教学任务。本质上,一门课程就是一个教学计划。</li>
<li class="ml45">
<!--<li class="ml125 mt10 mb10 fontGrey2" style="max-width: 544px;">班级是一个由教师、助教(教辅)和学生组成的临时的教学群体,在规定的时间内(如一个学期)完成一门课程规定的教学任务。本质上,一门课程就是一个教学计划。</li>-->
<li class="mt10 ml45">
<label><span class="c_red">*</span>&nbsp;<%= l(:label_class_period)%>&nbsp;&nbsp;</label>
<input type="text" name="class_period" id="new_class_period" class="hwork_input02" onkeyup="regex_course_class_period('new');" placeholder="例如54" maxlength="6">
<input type="text" name="class_period" id="new_class_period" class="hwork_input02 w289" onkeyup="regex_course_class_period('new');" placeholder="例如54" maxlength="6">
<span class="c_red" id="new_course_class_period_notice" style="display: none;"></span>
</li>
<div class="cl"></div>
<li class="ml45 mb10">
<li class="mt10 ml45 mb10">
<label><span class="c_red">*</span>&nbsp;<%= l(:label_course_term)%>&nbsp;&nbsp;</label>
<%= select_tag :time,options_for_select(course_time_option(@course.time),Time.now.year), {:id=>"new_time"} %>
<%= select_tag :term,options_for_select(course_term_option,@course.term || cur_course_term),{:id=>"new_term"} %>
<%= select_tag :time,options_for_select(course_time_option(@course.time),Time.now.year), {:id=>"new_time", :class => "h28 w145 mr8"} %>
<%= select_tag :term,options_for_select(course_term_option,@course.term || cur_course_term),{:id=>"new_term", :class => "h28 w145"} %>
<span class="c_red" id="new_course_time_term_notice"></span>
</li>
<div class="cl"></div>
<li class="ml45 mb10">
<li class="mt5 ml45 mb10">
<label><span class="c_red">*</span>&nbsp;结束学期&nbsp;&nbsp;</label>
<%= select_tag :end_time,options_for_select(course_time_option(@course.end_time),Time.now.year), {:id=>"new_end_time"} %>
<%= select_tag :end_term,options_for_select(course_term_option,@course.end_term || cur_course_term),{:id=>"new_end_term"} %>
<span class="mr15 c_red">仅针对跨越多个学期的班级,否则与开始学期保持一致。</span>
<%= select_tag :end_time,options_for_select(course_time_option(@course.end_time),Time.now.year), {:id=>"new_end_time", :class => "h28 w145 mr8"} %>
<%= select_tag :end_term,options_for_select(course_term_option,@course.end_term || cur_course_term),{:id=>"new_end_term", :class => "h28 w145"} %>
</li>
<div class="cl"></div>
<!--<li class="ml45 mb10">
@ -53,36 +51,58 @@
<div class="cl"></div>
<span class="ml80 c_red">学生或其他成员申请加入课程时候需要使用该口令,该口令可以由老师在课堂上公布。</span>
</li>-->
<li class="ml45">
<label class="fl" >&nbsp;&nbsp;<%= l(:label_new_course_description)%>&nbsp;&nbsp;</label>
<textarea name="course[description]" placeholder="最多3000个汉字(或6000个英文字符)" class="courses_text fl" ></textarea>
<div class="cl"></div>
</li>
<li class=" mb5 ml80">
<!--<li class="ml45">-->
<!--<label class="fl" >&nbsp;&nbsp;<%#= l(:label_new_course_description)%>&nbsp;&nbsp;</label>-->
<!--<textarea name="course[description]" placeholder="最多3000个汉字(或6000个英文字符)" class="courses_text fl" ></textarea>-->
<!--<div class="cl"></div>-->
<!--</li>-->
<li class="mt10 mb5 ml78">
<label >公开&nbsp;&nbsp;</label>
<input id="course_is_public" name="course[is_public]" type="checkbox" value="1">
<span class="c_grey">(选中后对所有用户可见,否则仅对本班级成员可见)</span>
<div class="cl"></div>
</li>
<li class=" mb5 ml30">
<li class="mt5 mb5 ml30">
<label >学生列表公开&nbsp;&nbsp;</label>
<input id="course_open_student" name="course[open_student]" type="checkbox" value="1">
<span class="c_grey">(选中后对所有用户可见,否则仅对本班级成员可见)</span>
<div class="cl"></div>
</li>
<li class=" mb5 ml30">
<li class="mt5 mb5 ml30">
<label >学生上传资源&nbsp;&nbsp;</label>
<input <%= @course.publish_resource == 1 ? 'checked' : ''%> id="course_publish_resource" name="course[publish_resource]" type="checkbox" />
<span class="c_grey">(选中后允许学生上传班级资源,否则不允许)</span>
<div class="cl"></div>
</li>
<li class=" ml30" >
<li class="mt10 ml30" >
<a href="javascript:void(0)" class="blue_btn fl c_white" onclick="submit_new_course();" >提交</a>
<%= link_to "取消",user_activities_path(User.current.id),:class => "grey_btn fl c_white ml10"%>
<div class="cl"></div>
</li>
<% end%>
</ul>
<div class="ye_tips_box_inner" style="left: 460px; top: 0px; text-align: left;">
<em style="top: 5px;"></em>
<span style="top: 5px;"></span>
<p>
如果列表中没有对应的课程,请您先<%=link_to '创建课程', new_syllabus_path(),:target => '_blank', :class => 'ml5 green_btn_share c_white'%>,然后【刷新】
</p>
</div>
<div class="ye_tips_box_inner" style="left: 460px; top: 40px; text-align: left;">
<em style="top: 10px;"></em>
<span style="top: 10px;"></span>
<p>
班级是一个由教师、助教(教辅)和学生组成的临时的教学群体,在规定的时间内(如一个<br/>学期)完成一门课程规定的教学任务。本质上,一门课程就是一个教学计划。<br/><br/>
<font class="c_red">特别注意:</font>如果您同时开设了教学内容完全同步的多个班级,强烈建议您:只需创建一个班<br/>级,然后在这个班级中新建多个小班,这样您发布的所有信息就能够在不同小班中共享了。
</p>
</div>
<div class="ye_tips_box_inner" style="left: 460px; top: 223px; text-align: left;">
<em style="top: 5px;"></em>
<span style="top: 5px;"></span>
<p>
仅针对跨越多个学期的班级,否则与开始学期保持一致。
</p>
</div>
</div><!--talknew end-->
<div class="cl"></div>
<script>

View File

@ -2,4 +2,5 @@
* Created by Administrator on 2014/12/3.
*/
$("#search_members").html("<%= escape_javascript( render :partial => 'searchmembers')%>");
$("#st_groups").html("<%= escape_javascript( render :partial => 'new_groups_name', locals: {:course_groups => @course_groups})%>");
$("#member_content").html("<%= escape_javascript( render :partial => @render_file, :locals => {:members => @results})%>");

View File

@ -1,4 +1,6 @@
/**
* Created by Administrator on 2014/12/2.
*/
$('#new_group_name').hide();
$('#edit_group_form').hide();
$("#member_content").html("<%= escape_javascript( render :partial => 'new_member_list', :locals => {:members => @results})%>");

View File

@ -76,11 +76,11 @@
<div class="cl"></div>
<span class=" ml80 c_orange">学生或其他成员申请加入课程时候需要使用该口令,该口令可以由老师在课堂上公布。</span>
</li>-->
<li class="ml45">
<label class="fl" >&nbsp;&nbsp;<%= l(:label_new_course_description)%>&nbsp;&nbsp;</label>
<textarea name="course[description]" placeholder="最多3000个汉字(或6000个英文字符)" class="courses_text fl" maxlength="6000"><%= @course.description%></textarea>
<div class="cl"></div>
</li>
<!--<li class="ml45">-->
<!--<label class="fl" >&nbsp;&nbsp;<%#= l(:label_new_course_description)%>&nbsp;&nbsp;</label>-->
<!--<textarea name="course[description]" placeholder="最多3000个汉字(或6000个英文字符)" class="courses_text fl" maxlength="6000"><%#= @course.description%></textarea>-->
<!--<div class="cl"></div>-->
<!--</li>-->
<li class=" mb5 ml80">
<label >公开&nbsp;&nbsp;</label>
<input <%= @course.is_public == 1 ? 'checked' : ''%> id="course_is_public" name="course[is_public]" type="checkbox">
@ -99,7 +99,7 @@
<span class="c_grey">(选中后允许学生上传班级资源,否则不允许)</span>
<div class="cl"></div>
</li>
<li class=" ml90" >
<li class="mt10 ml90" >
<a href="javascript:void(0)" class="blue_btn fl c_white" onclick="submit_edit_course(<%= @course.id%>);" >提交</a>
<%= link_to l(:button_cancel), course_path(@course), :class => "grey_btn fl c_white ml10" %>
<div class="cl"></div>

View File

@ -3,7 +3,6 @@
<script type="text/javascript">
function resetQuestion<%=exercise_question.id%>()
{
$("#poll_questions_title_<%=exercise_question.id%>").val("<%= exercise_question.question_title%>")
$("#poll_question_score_<%=exercise_question.id %>").val("<%= exercise_question.question_score%>")
$("#poll_question_standard_answer_<%=exercise_question.id %>").val("<%= convert_to_char(exercise_question.exercise_standard_answers.first.exercise_choice_id.to_s)%>")
$("#poll_answers_<%=exercise_question.id%>").html("<% exercise_question.exercise_choices.reorder("choice_position").each_with_index do |exercise_choice,index| %>" +
@ -20,9 +19,9 @@
<div class="questionContainer" style="width: 680px;">
<div class="ur_editor_title">
<label>问题:&nbsp;&nbsp;</label>
<label class="questionLabel mt8">问题:&nbsp;&nbsp;</label>
<input name="question_type" value="<%=exercise_question.question_type %>" type="hidden">
<input name="question_title" id="poll_questions_title_<%=exercise_question.id %>" class="questionTitle" placeholder="请输入单选题题目" type="text" value="<%=exercise_question.question_title %>">
<textarea name="question_title" id="poll_questions_title_<%=exercise_question.id %>" class="questionTitle" placeholder="请输入单选题题目" type="text" onfocus="autoHeight('#poll_questions_title_<%=exercise_question.id %>',30)"><%=exercise_question.question_title %></textarea>
</div>
<div class="ur_editor_content">
<ul>

View File

@ -3,7 +3,6 @@
<script type="text/javascript">
function resetQuestion<%=exercise_question.id%>()
{
$("#poll_questions_title_<%=exercise_question.id%>").val("<%= exercise_question.question_title%>")
$("#poll_question_score_<%=exercise_question.id %>").val("<%= exercise_question.question_score%>")
$("#poll_question_standard_answer_<%=exercise_question.id %>").val("<%= convert_to_char(exercise_question.exercise_standard_answers.first.exercise_choice_id.to_s)%>")
$("#poll_answers_<%=exercise_question.id%>").html("<% exercise_question.exercise_choices.reorder("choice_position").each_with_index do |exercise_choice,index| %>" +
@ -20,9 +19,9 @@
<div class="questionContainer" style="width: 680px;">
<div class="ur_editor_title">
<label>问题:&nbsp;&nbsp;</label>
<label class="questionLabel mt8">问题:&nbsp;&nbsp;</label>
<input name="question_type" value="<%=exercise_question.question_type %>" type="hidden">
<input name="question_title" id="poll_questions_title_<%=exercise_question.id %>" class="questionTitle" placeholder="请输入多选题题目" type="text" value="<%=exercise_question.question_title %>">
<textarea name="question_title" id="poll_questions_title_<%=exercise_question.id %>" class="questionTitle" placeholder="请输入多选题题目" type="text" onfocus="autoHeight('#poll_questions_title_<%=exercise_question.id %>',30)"><%=exercise_question.question_title %></textarea>
</div>
<div class="ur_editor_content">
<ul>

View File

@ -3,7 +3,6 @@
<script type="text/javascript">
function resetQuestion<%=exercise_question.id%>()
{
$("#poll_questions_title_<%=exercise_question.id%>").val("<%= exercise_question.question_title%>")
$("#poll_question_score_<%=exercise_question.id %>").val("<%= exercise_question.question_score%>")
$("#poll_answers_<%=exercise_question.id%>").html("<% exercise_question.exercise_standard_answers.reorder("created_at").each_with_index do |exercise_choice,index| %>" +
"<li class='ur_item'>" +
@ -20,9 +19,9 @@
<div class="questionContainer" style="width: 680px;">
<div class="ur_editor_title">
<label>问题:&nbsp;&nbsp;</label>
<label class="questionLabel mt8">问题:&nbsp;&nbsp;</label>
<input name="question_type" value="<%=exercise_question.question_type %>" type="hidden">
<input name="question_title" id="poll_questions_title_<%=exercise_question.id %>" class="questionTitle" placeholder="请输入填空题的内容(注意:目前填空题暂时仅支持一个空)" type="text" value="<%=exercise_question.question_title %>">
<textarea name="question_title" id="poll_questions_title_<%=exercise_question.id %>" class="questionTitle" placeholder="请输入填空题的内容(注意:目前填空题暂时仅支持一个空)" type="text" onfocus="autoHeight('#poll_questions_title_<%=exercise_question.id %>',30)"><%=exercise_question.question_title %></textarea>
</div>
<div class="ur_editor_content" id="edit_single">
<ul>

View File

@ -4,9 +4,9 @@
:remote=>true ) do |f| %>
<div class="questionContainer">
<div class="ur_editor_title">
<label>问题:&nbsp;&nbsp;</label>
<label class="questionLabel mt8">问题:&nbsp;&nbsp;</label>
<input name="question_type" value="1" type="hidden">
<input name="question_title" id="poll_questions_title" class="questionTitle" placeholder="请输入单选题题目" type="text">
<textarea name="question_title" id="poll_questions_title" class="questionTitle" placeholder="请输入单选题题目" type="text" oninput="autoHeight('#poll_questions_title',30)"></textarea>
</div>
<div class="ur_editor_content">
<ul>

View File

@ -4,9 +4,9 @@
:remote=>true ) do |f| %>
<div class="questionContainer">
<div class="ur_editor_title">
<label>问题:&nbsp;&nbsp;</label>
<label class="questionLabel mt8">问题:&nbsp;&nbsp;</label>
<input name="question_type" value="2" type="hidden">
<input name="question_title" id="poll_questions_title" class="questionTitle" placeholder="请输入多选题题目" type="text">
<textarea name="question_title" id="poll_questions_title" class="questionTitle" placeholder="请输入多选题题目" type="text" oninput="autoHeight('#poll_questions_title',30)"></textarea>
</div>
<div class="ur_editor_content">
<ul>

View File

@ -4,9 +4,9 @@
:remote=>true ) do |f| %>
<div class="questionContainer">
<div class="ur_editor_title">
<label>问题:&nbsp;&nbsp;</label>
<label class="questionLabel mt8">问题:&nbsp;&nbsp;</label>
<input name="question_type" value="3" type="hidden">
<input maxlength="250" class="questionTitle" name="question_title" id="poll_questions_title" placeholder="请输入填空题的内容(注意:目前填空题暂时仅支持一个空)" type="text">
<textarea maxlength="250" class="questionTitle" name="question_title" id="poll_questions_title" placeholder="请输入填空题的内容(注意:目前填空题暂时仅支持一个空)" type="text" oninput="autoHeight('#poll_questions_title',30)"></textarea>
</div>
<div class="ur_editor_content" id="new_single">
<ul>

View File

@ -1,6 +1,7 @@
<div>
<div class="testEditTitle"> 第<%= exercise_question.question_number%>题.(<%= exercise_question.question_score %>分)<br />
<%= exercise_question.question_title %>
<div class="testEditTitle">
<div>第<%= exercise_question.question_number%>题.(<%= exercise_question.question_score %>分)</div>
<span class="formatContainer break_word" style="max-width:534px;"><%= exercise_question.question_title %></span>
<span class="ml10">(<%= convert_to_char(exercise_question.exercise_standard_answers.first.exercise_choice_id.to_s) %>)</span>
</div>
@ -46,7 +47,7 @@
'<input type="hidden" name="quest_id" value="'+quest_id+'"/>'+
'<input type="hidden" name="quest_num" value="'+quest_num+'"/>'+
'<input type="hidden" name="question_type" value="1"/>'+
'<input name="question_title" id="poll_questions_title" class="questionTitle" placeholder="请输入单选题题目" type="text"/>'+
'<textarea name="question_title" id="poll_questions_title" class="questionTitle" placeholder="请输入单选题题目" type="text"></textarea>'+
'</div>'+
'<div class="ur_editor_content">'+
'<ul>'+
@ -105,6 +106,11 @@
$("#add_new_question").one('click', function(){
add_poll_question($(this),1);
});
$(".questionTitle").on("input",function(){
$(this).height(30);
var scrollVal = $(this)[0].scrollHeight;
$(this).height(scrollVal);
});
}
}
else {

View File

@ -1,6 +1,7 @@
<div>
<div class="testEditTitle"> 第<%= exercise_question.question_number%>题.(<%= exercise_question.question_score %>分)<br />
<%= exercise_question.question_title %>
<div class="testEditTitle">
<div>第<%= exercise_question.question_number%>题.(<%= exercise_question.question_score %>分)</div>
<span class="formatContainer break_word" style="max-width:534px;"><%= exercise_question.question_title %></span>
<span class="ml10">(<%= convert_to_char(exercise_question.exercise_standard_answers.first.exercise_choice_id.to_s) %>)</span>
</div>
<%= link_to("", delete_exercise_question_exercise_index_path(:exercise_question => exercise_question.id, :quest_num => exercise_question.question_number),
@ -45,7 +46,7 @@
'<input type="hidden" name="quest_id" value="'+quest_id+'"/>'+
'<input type="hidden" name="quest_num" value="'+quest_num+'"/>'+
'<input type="hidden" name="question_type" value="2"/>'+
'<input name="question_title" id="poll_questions_title" class="questionTitle" placeholder="请输入多选题题目" type="text"/>'+
'<textarea name="question_title" id="poll_questions_title" class="questionTitle" placeholder="请输入多选题题目" type="text"></textarea>'+
'</div>'+
'<div class="ur_editor_content">'+
'<ul>'+
@ -104,6 +105,11 @@
$("#add_new_question").one('click', function(){
add_poll_question($(this),2);
});
$(".questionTitle").on("input",function(){
$(this).height(30);
var scrollVal = $(this)[0].scrollHeight;
$(this).height(scrollVal);
});
}
}else {
$("#insert_new_poll_question_"+quest_type+"_"+quest_id).html("");

View File

@ -1,6 +1,7 @@
<div>
<div class="testEditTitle"> 第<%= exercise_question.question_number%>题.(<%= exercise_question.question_score %>分)<br />
<%= exercise_question.question_title %>
<div class="testEditTitle">
<div>第<%= exercise_question.question_number%>题.(<%= exercise_question.question_score %>分)</div>
<span class="formatContainer break_word"><%= exercise_question.question_title %></span>
</div>
<%= link_to("", delete_exercise_question_exercise_index_path(:exercise_question => exercise_question.id, :quest_num => exercise_question.question_number),
method: :delete, :confirm => l(:text_are_you_sure), :remote => true, :class => "ur_icon_de",:title => "删除") %>
@ -33,7 +34,7 @@
'<input type="hidden" name="quest_id" value="'+quest_id+'"/>'+
'<input type="hidden" name="quest_num" value="'+quest_num+'"/>'+
'<input type="hidden" name="question_type" value="3"/>'+
'<input name="question_title" id="poll_questions_title" class="questionTitle" placeholder="请输入填空题的内容(注意:目前填空题暂时仅支持一个空)" type="text"/>'+
'<textarea name="question_title" id="poll_questions_title" class="questionTitle" placeholder="请输入填空题的内容(注意:目前填空题暂时仅支持一个空)" type="text"></textarea>'+
'</div>'+
'<div class="ur_editor_content" id="new_single">'+
'<ul>'+
@ -80,6 +81,11 @@
$("#add_new_question").one('click', function(){
add_poll_question($(this),3);
});
$(".questionTitle").on("input",function(){
$(this).height(30);
var scrollVal = $(this)[0].scrollHeight;
$(this).height(scrollVal);
});
}
} else {
$("#insert_new_poll_question_"+quest_type+"_"+quest_id).html("");

View File

@ -38,7 +38,7 @@
</style>
<div class="homepageRight mt0 ml10">
<div class="homepageRightBanner mb10">
<div class="homepageRightBanner">
<!--<div class="NewsBannerName">作业</div>-->
<div id="menu_r" class="NewsBannerName" style="margin-bottom: -10px;">
<ul class="menu_r b_w" style="padding-left: 0px; margin-top: -5px;">
@ -66,7 +66,7 @@
<% if @is_teacher%>
<!-- 老师身份才可以发布作业 -->
<div class="HomeWork mb10" nhname='homework_common_form'>
<div class="HomeWork mt10" nhname='homework_common_form'>
<%= labelled_form_for @new_homework,:url => user_new_homework_users_path,:method => "post" do |f| %>
<div id="HomeWorkCon">
<%= render :partial => 'users/user_homework_form', :locals => { :homework => @new_homework,:f => f,:edit_mode => false,:select_course => false } %>

View File

@ -4,7 +4,9 @@
<li id="board_children_<%=board.id %>">
<% count = board ? (board.topics.count + Message.where("board_id =? and parent_id is not ?", board.id, nil).count) : 0 %>
<a href="<%=course_boards_path(@course, :board_id =>board.id) %>"><font class="hidden dis" style="max-width: 120px;"><%=board.name %></font><span style="vertical-align: top;"><%=count %></span></a>
<%= link_to( "",course_boards_path(@course, :board_id =>board.id, :flag => true, :is_new => 1), :class => 'sy_class_add', :title =>"#{l(:label_message_new)}") %>
<% if User.current.logged? %>
<%= link_to( "",course_boards_path(@course, :board_id =>board.id, :flag => true, :is_new => 1), :class => 'sy_class_add', :title =>"#{l(:label_message_new)}") %>
<% end %>
</li>
<% end %>
</ul>

View File

@ -4,7 +4,9 @@
<li id="course_group_<%=group.id %>">
<% count = group.members.count %>
<a href="<%= group_member_course_path(course, :group_id => group.id) %>"><font class="hidden dis" style="max-width: 120px;"><%=group.name %></font><span style="vertical-align: top;"><%=count %></span></a>
<%#= link_to( "",course_boards_path(@course, :board_id =>board.id, :flag => true, :is_new => 1), :class => 'sy_class_add', :title =>"#{l(:label_message_new)}") %>
<% if is_teacher %>
<%= link_to '', search_not_group_member_course_path(@course,:group_id => group.id),:remote => true, :class => "sy_class_add", :title => "添加成员" %>
<% end %>
</li>
<% end %>
</ul>

View File

@ -121,7 +121,7 @@
<!--<a href="javascript:void(0);" class="sy_class_add"></a>-->
</li>
<div id="group_children_list">
<%= render :partial => 'layouts/group_children_list', :locals => {:course => @course} %>
<%= render :partial => 'layouts/group_children_list', :locals => {:course => @course, :is_teacher => is_teacher} %>
</div>
<% end %>
<% statistics_count = 0 %>

View File

@ -333,17 +333,19 @@
<% parents_rely = get_reply_parents parents_rely, comment %>
<% length = parents_rely.length %>
<div id="comment_reply_<%=comment.id %>">
<% if length <= 3 %>
<% if length <= 2 %>
<%=render :partial => 'users/comment_reply', :locals => {:comment => comment.parent} %>
<% else %>
<div class="orig_cont clearfix">
<div class="orig_cont clearfix">
<div id="comment_reply_<%=parents_rely[length - 1].id %>">
<%=render :partial => 'users/comment_reply', :locals => {:comment => parents_rely[length - 1]} %>
</div>
<%=render :partial => 'users/comment_reply_detail', :locals => {:comment => parents_rely[length - 2]} %>
<!--<div id="comment_reply_<%=parents_rely[length - 1].id %>">-->
<!--<%#=render :partial => 'users/comment_reply', :locals => {:comment => parents_rely[length - 1]} %>-->
<!--</div>-->
<%=render :partial => 'users/comment_reply_detail', :locals => {:comment => parents_rely[length - 1]} %>
</div>
<div class="orig_cont_hide clearfix"><span class="orig_icon" >&darr; </span><span class="orig_icon" style="display:none;" > &uarr;</span><%= link_to '点击展开隐藏楼层', show_all_replies_users_path(:comment => comment),:remote=>true %></div>
<div class="orig_cont_hide clearfix">
<span class="orig_icon" >&darr; </span><span class="">已经隐藏<%=(length - 2).to_s %>个楼层</span>
<span class="orig_icon" style="display:none;" > &uarr;</span><%= link_to '[点击展开]', show_all_replies_users_path(:comment => comment),:remote=>true, :class => 'linkBlue2' %></div>
<%=render :partial => 'users/comment_reply_detail', :locals => {:comment => parents_rely[0]} %>
</div>
<% end %>

View File

@ -52,6 +52,22 @@
<% end%>
</ul>
<ul>
<li class='ur_item'>
<div class="fl mr30">
<label>下限<span class='ur_index'></span>&nbsp;&nbsp;&nbsp;</label>
<%= select_tag :min_choices,options_for_select(min_or_max_choices_option(poll_question),poll_question.min_choices), {:id=>"min_choices", :class=>"poll-multiple-limit"} %>
<span class="fontGrey2">(可选)答题时最少选几项</span>
</div>
</li>
<div class="cl"></div>
<li class='ur_item'>
<div class="fl mr30">
<label>上限<span class='ur_index'></span>&nbsp;&nbsp;&nbsp;</label>
<%= select_tag :max_choices,options_for_select(min_or_max_choices_option(poll_question),poll_question.max_choices), {:id=>"max_choices", :class=>"poll-multiple-limit"} %>
<span class="fontGrey2">(可选)答题时最多选几项</span><span class="c_red ml10" id="choices_notice"></span>
</div>
</li>
<div class="cl"></div>
<li class="ur_item">
<div class="dash-block new-question" onclick='add_single_answer($(this));'>新建选项</div>
</li>

View File

@ -29,6 +29,32 @@
<div class='cl'></div>
</ul>
<ul>
<li class='ur_item'>
<div class="fl mr30">
<label>下限<span class='ur_index'></span>&nbsp;&nbsp;&nbsp;</label>
<select name="min_choices" class="poll-multiple-limit">
<option value="0">不限</option>
<option value="1">1</option>
<option value="2">2</option>
<option value="3">3</option>
</select>
<span class="fontGrey2">(可选)答题时最少选几项</span>
</div>
</li>
<div class="cl"></div>
<li class='ur_item'>
<div class="fl mr30">
<label>上限<span class='ur_index'></span>&nbsp;&nbsp;&nbsp;</label>
<select name="max_choices" class="poll-multiple-limit">
<option value="0">不限</option>
<option value="1">1</option>
<option value="2">2</option>
<option value="3">3</option>
</select>
<span class="fontGrey2">(可选)答题时最多选几项</span><span class="c_red ml10" id="choices_notice"></span>
</div>
</li>
<div class="cl"></div>
<li class="ur_item">
<div class="dash-block new-question" onclick='add_single_answer($(this));'>新建选项</div>
</li>

View File

@ -3,7 +3,7 @@
<div class="ur_editor_title">
<label for="ur_question_title" class="questionLabel mt8">问题:&nbsp;&nbsp;</label>
<input type="hidden" name="question_type" value="3"/>
<textarea maxlength="250" id="poll_questions_title_new" class="questionTitle w590" contenteditable="true" type="text" name="poll_questions_title" placeholder="请输入单行主观题" oninput="autoHeight('#poll_questions_title_new',30)"></textarea>
<textarea maxlength="250" id="poll_questions_title_new" class="questionTitle w590" contenteditable="true" type="text" name="poll_questions_title" placeholder="请输入主观题" oninput="autoHeight('#poll_questions_title_new',30)"></textarea>
<label>
<input name="is_necessary" value="true" checked type="checkbox">
必答

View File

@ -1,11 +1,10 @@
<div id="popbox_upload" style="margin-top: -30px;margin-left: -20px;margin-right: -10px;">
<div class="upload_con">
<h2>选择问卷导入本课程</h2>
<h2>选择问卷导入本班级</h2>
<div class="upload_box">
<div id="error_show" style="color: red;"></div>
<%= form_tag import_other_poll_poll_index_path,
method: :post,
remote: true,
id: "relation_file_form" do %>
<input type="hidden" name="course_id" value="<%= polls_group_id%>" />
<%= content_tag('div', poll_check_box_tags('polls[]', polls,polls_group_id), :id => 'courses',:style=> 'width: 300px;')%>

View File

@ -1,56 +1,26 @@
<% mc_question_list = poll.poll_questions.where("question_type=1") %>
<% mcq_question_list = poll.poll_questions.where("question_type=2") %>
<% single_question_list = poll.poll_questions.where("question_type=3") %>
<% multi_question_list = poll.poll_questions.where("question_type=4") %>
<div class="testStatus" id="mc_question_list" style="display: <%=mc_question_list.count > 0 ? "" : "none" %>">
<h3 class="fontGrey3">单选题</h3>
<% mc_question_list.each do |poll_question| %>
<div id="poll_questions_<%= poll_question.id%>">
<div id="show_poll_questions_<%= poll_question.id %>">
<%= render :partial => 'show_MC', :locals => {:poll_question => poll_question} %>
</div>
<div id="edit_poll_questions_<%= poll_question.id %>" style="display: none;">
<%= render :partial => 'edit_MC', :locals => {:poll_question => poll_question} %>
</div>
<% poll.poll_questions.each do |poll_question|%>
<div id="poll_questions_<%= poll_question.id%>">
<div id="show_poll_questions_<%= poll_question.id %>">
<% if poll_question.question_type == 1%>
<%= render :partial => 'show_MC', :locals => {:poll_question => poll_question} %>
<% elsif poll_question.question_type == 2%>
<%= render :partial => 'show_MCQ', :locals => {:poll_question => poll_question} %>
<% elsif poll_question.question_type == 3%>
<%= render :partial => 'show_single', :locals => {:poll_question => poll_question} %>
<% elsif poll_question.question_type == 4%>
<%= render :partial => 'show_mulit', :locals => {:poll_question => poll_question} %>
<% end%>
</div>
<% end %>
</div>
<div class="testStatus" id="mcq_question_list" style="display: <%=mcq_question_list.count > 0 ? "" : "none" %>">
<h3 class="fontGrey3">多选题</h3>
<% mcq_question_list.each do |poll_question| %>
<div id="poll_questions_<%= poll_question.id%>">
<div id="show_poll_questions_<%= poll_question.id %>">
<%= render :partial => 'show_MCQ', :locals => {:poll_question => poll_question} %>
</div>
<div id="edit_poll_questions_<%= poll_question.id %>" style="display: none;">
<%= render :partial => 'edit_MCQ', :locals => {:poll_question => poll_question} %>
</div>
<div id="edit_poll_questions_<%= poll_question.id %>" style="display: none;">
<% if poll_question.question_type == 1%>
<%= render :partial => 'edit_MC', :locals => {:poll_question => poll_question} %>
<% elsif poll_question.question_type == 2%>
<%= render :partial => 'edit_MCQ', :locals => {:poll_question => poll_question} %>
<% elsif poll_question.question_type == 3%>
<%= render :partial => 'edit_single', :locals => {:poll_question => poll_question} %>
<% elsif poll_question.question_type == 4%>
<%= render :partial => 'edit_mulit', :locals => {:poll_question => poll_question} %>
<% end%>
</div>
<% end %>
</div>
<div class="testStatus" id="single_question_list" style="display: <%=single_question_list.count > 0 ? "" : "none" %>">
<h3 class="fontGrey3">单行主观题</h3>
<% single_question_list.each do |poll_question| %>
<div id="poll_questions_<%= poll_question.id%>">
<div id="show_poll_questions_<%= poll_question.id %>">
<%= render :partial => 'show_single', :locals => {:poll_question => poll_question} %>
</div>
<div id="edit_poll_questions_<%= poll_question.id %>" style="display: none;">
<%= render :partial => 'edit_single', :locals => {:poll_question => poll_question} %>
</div>
</div>
<% end %>
</div>
<div class="testStatus" id="multi_question_list" style="display: <%=multi_question_list.count > 0 ? "" : "none" %>">
<h3 class="fontGrey3">多行主观题</h3>
<% multi_question_list.each do |poll_question| %>
<div id="poll_questions_<%= poll_question.id%>">
<div id="show_poll_questions_<%= poll_question.id %>">
<%= render :partial => 'show_mulit', :locals => {:poll_question => poll_question} %>
</div>
<div id="edit_poll_questions_<%= poll_question.id %>" style="display: none;">
<%= render :partial => 'edit_mulit', :locals => {:poll_question => poll_question} %>
</div>
</div>
<% end %>
</div>
</div>
<% end %>

View File

@ -62,7 +62,7 @@ function add_MC(){
}
}
function insert_MC(quest_type,quest_num,quest_id){
function insert_MC(quest_type,quest_id){
var forms = $("form.new_poll_question");
if($.trim($("#insert_new_poll_question_"+quest_type+"_"+quest_id).html()) == "") {
if(forms.length > 0){
@ -74,7 +74,6 @@ function add_MC(){
'<div class="ur_editor_title"> '+
'<label class="questionLabel mt8">问题:&nbsp;&nbsp;</label>'+
'<input type="hidden" name="quest_id" value="'+quest_id+'"/>'+
'<input type="hidden" name="quest_num" value="'+quest_num+'"/>'+
'<input type="hidden" name="question_type" value="1"/>'+
'<textarea maxlength="250" class="questionTitle w570" type="text" name="poll_questions_title" id="poll_questions_title" placeholder="请输入单选题题目"></textarea>'+
'<input type="checkbox" name="is_necessary" value="true" checked/>'+
@ -152,7 +151,7 @@ function add_MCQ(){
}
}
function insert_MCQ(quest_type,quest_num,quest_id){
function insert_MCQ(quest_type,quest_id){
var forms = $("form.new_poll_question");
if($.trim($("#insert_new_poll_question_"+quest_type+"_"+quest_id).html()) == "") {
if(forms.length > 0){
@ -164,7 +163,6 @@ function insert_MCQ(quest_type,quest_num,quest_id){
'<div class="ur_editor_title">'+
'<label class="questionLabel mt8">问题:&nbsp;&nbsp;</label>'+
'<input type="hidden" name="quest_id" value="'+quest_id+'"/>'+
'<input type="hidden" name="quest_num" value="'+quest_num+'"/>'+
'<input type="hidden" name="question_type" value="2"/>'+
'<textarea maxlength="250" class="questionTitle w570" type="text" name="poll_questions_title" id="poll_questions_title" placeholder="请输入多选题题目"></textarea>'+
'<input type="checkbox" name="is_necessary" value="true" checked/>'+
@ -193,6 +191,32 @@ function insert_MCQ(quest_type,quest_num,quest_id){
'</ul>'+
'<ul>'+
'<li class="ur_item">'+
'<div class="fl mr30">'+
'<label>下限<span class="ur_index"></span>&nbsp;&nbsp;&nbsp;</label>'+
'<select name="min_choices" class="poll-multiple-limit">'+
'<option value="0">不限</option>'+
'<option value="1">1</option>'+
'<option value="2">2</option>'+
'<option value="3">3</option>'+
'</select>'+
'<span class="fontGrey2">(可选)答题时最少选几项</span>'+
'</div>'+
'</li>'+
'<div class="cl"></div>'+
'<li class="ur_item">'+
'<div class="fl mr30">'+
'<label>上限<span class="ur_index"></span>&nbsp;&nbsp;&nbsp;</label>' +
'<select name="max_choices" class="poll-multiple-limit">'+
'<option value="0">不限</option>'+
'<option value="1">1</option>'+
'<option value="2">2</option>'+
'<option value="3">3</option>'+
'</select>'+
'<span class="fontGrey2">(可选)答题时最多选几项</span><span class="c_red ml10" id="choices_notice"></span>'+
'</div>' +
'</li>' +
'<div class="cl"></div>'+
'<li class="ur_item">'+
'<div class="dash-block new-question" onclick="add_single_answer($(this));">新建选项</div>'+
'</li>'+
'<div class="cl"></div>'+
@ -242,7 +266,7 @@ function insert_MCQ(quest_type,quest_num,quest_id){
}
}
function insert_SINGLE(quest_type,quest_num,quest_id){
function insert_SINGLE(quest_type,quest_id){
var forms = $("form.new_poll_question");
if($.trim($("#insert_new_poll_question_"+quest_type+"_"+quest_id).html()) == "") {
if(forms.length > 0){
@ -254,7 +278,6 @@ function insert_MCQ(quest_type,quest_num,quest_id){
'<div class="ur_editor_title">'+
'<label for="ur_question_title" class="questionLabel mt8">问题:&nbsp;&nbsp;</label>'+
'<input type="hidden" name="quest_id" value="'+quest_id+'"/>'+
'<input type="hidden" name="quest_num" value="'+quest_num+'"/>'+
'<input type="hidden" name="question_type" value="3"/>'+
'<textarea maxlength="250" id="poll_questions_title" class="questionTitle w570" contenteditable="true" type="text" name="poll_questions_title" placeholder="请输入单行主观题"></textarea>'+
'<input type="checkbox" name="is_necessary" value="true" checked/>'+
@ -299,7 +322,7 @@ function insert_MCQ(quest_type,quest_num,quest_id){
}
}
function insert_MULIT(quest_type,quest_num,quest_id){
function insert_MULIT(quest_type,quest_id){
var forms = $("form.new_poll_question");
if($.trim($("#insert_new_poll_question_"+quest_type+"_"+quest_id).html()) == "") {
if(forms.length > 0){
@ -311,7 +334,6 @@ function insert_MCQ(quest_type,quest_num,quest_id){
'<div class="ur_editor_title">'+
'<label for="ur_question_title" class="questionLabel mt8">问题:&nbsp;&nbsp;</label>'+
'<input type="hidden" name="quest_id" value="'+quest_id+'"/>'+
'<input type="hidden" name="quest_num" value="'+quest_num+'"/>'+
'<input type="hidden" name="question_type" value="4"/>'+
'<textarea maxlength="250" id="poll_questions_title" class="questionTitle w570" contenteditable="true" type="text" name="poll_questions_title" placeholder="请输入多行主观题的问题描述"></textarea>'+
'<label><input type="checkbox" name="is_necessary" value="true" checked/>'+
@ -388,7 +410,6 @@ function insert_MCQ(quest_type,quest_num,quest_id){
return;
}
}
}
//添加标题时确定按钮
@ -400,7 +421,13 @@ function insert_MCQ(quest_type,quest_num,quest_id){
doc.one('click', function(){
add_poll_question($(this));
});
}else if(doc.parent().parent().find("select[name='min_choices']").length > 0 && doc.parent().parent().find("select[name='min_choices']").find("option:selected").val() != '0' && doc.parent().parent().find("select[name='max_choices']").length > 0 && doc.parent().parent().find("select[name='max_choices']").find("option:selected").val() != '0' && parseInt(doc.parent().parent().find("select[name='min_choices']").find("option:selected").val()) > parseInt(doc.parent().parent().find("select[name='max_choices']").find("option:selected").val())){
doc.parent().parent().find("#choices_notice").html("下限不能大于上限");
doc.one('click', function(){
add_poll_question($(this));
});
}else{
doc.parent().parent().find("#choices_notice").html("");
doc.parent().parent().parent().submit();
}
}
@ -413,7 +440,14 @@ function insert_MCQ(quest_type,quest_num,quest_id){
doc.one('click', function(){
add_poll_question_new($(this));
});
}else{
}else if(doc.parent().parent().find("select[name='min_choices']").length > 0 && doc.parent().parent().find("select[name='min_choices']").find("option:selected").val() != '0' && doc.parent().parent().find("select[name='max_choices']").length > 0 && doc.parent().parent().find("select[name='max_choices']").find("option:selected").val() != '0' && parseInt(doc.parent().parent().find("select[name='min_choices']").find("option:selected").val()) > parseInt(doc.parent().parent().find("select[name='max_choices']").find("option:selected").val())){
doc.parent().parent().find("#choices_notice").html("下限不能大于上限");
doc.one('click', function(){
add_poll_question_new($(this));
});
}
else{
doc.parent().parent().find("#choices_notice").html("");
doc.parent().parent().parent().submit();
}
}
@ -421,7 +455,14 @@ function insert_MCQ(quest_type,quest_num,quest_id){
function edit_poll_question(doc,id)
{
var title = $.trim($("#poll_questions_title_" + id).val());
if(title.length == 0){alert("标题不能为空");}else{doc.parent().parent().parent().submit();}
if(title.length == 0){
alert("标题不能为空");
}else if(doc.parent().parent().find("select[name='min_choices']").length > 0 && doc.parent().parent().find("select[name='min_choices']").find("option:selected").val() != '0' && doc.parent().parent().find("select[name='max_choices']").length > 0 && doc.parent().parent().find("select[name='max_choices']").find("option:selected").val() != '0' && parseInt(doc.parent().parent().find("select[name='min_choices']").find("option:selected").val()) > parseInt(doc.parent().parent().find("select[name='max_choices']").find("option:selected").val())){
doc.parent().parent().find("#choices_notice").html("下限不能大于上限");
}else{
doc.parent().parent().find("#choices_notice").html("");
doc.parent().parent().parent().submit();
}
}
//问卷头
@ -463,9 +504,13 @@ function insert_MCQ(quest_type,quest_num,quest_id){
// doc.parent().before("<li class='ur_item new_answer'><label>选项<span class='ur_index'></span>&nbsp;&nbsp;&nbsp;</label><input maxlength='200' type='text' name='question_answer["+new Date().getTime()+"]' placeholder='输入选项内容'/>" +
// "<a class='icon_remove' title='删除' onclick='remove_single_answer($(this))'></a>"+
// "</li><div class='cl'></div>");
var count = doc.parent().parent().prev().children('li').length;
multiLimit(doc.parent().siblings("li").children("div").children("select:first"), count);
multiLimit(doc.parent().siblings("li").children("div").children("select:last"), count);
}
function remove_single_answer(doc)
{
var ul = doc.parent().parent();
if(doc.parent().siblings("li.new_answer").length == 0)
{
alert("至少有一个选项");
@ -474,7 +519,30 @@ function insert_MCQ(quest_type,quest_num,quest_id){
{
doc.parent().remove();
}
var count = ul.children('li').length;
multiLimit(ul.siblings("ul").children("li").children("div").children("select:first"), count);
multiLimit(ul.siblings("ul").children("li").children("div").children("select:last"), count);
}
//多选题答题限制数实时更新
function multiLimit(doc, count){
var upperLimit = $(".ur_editor_content .new_answer").size();
var option_count = doc.children('option').length;
if (option_count == 0){
doc.append("<option value='"+ 0 +"'>" + '' + "</option>");
}
var option_count = doc.children('option').length;
if(count > option_count - 1){
for(var i = option_count; i <= count; i++){
doc.append("<option value='"+ i +"'>" + i + "</option>");
}
} else if(count < option_count - 1){
for(var i = count + 1; i <= option_count - 1; i++){
doc.children("option[value='" + i + "']").remove();
}
}
}
//其他选项
function add_other_answer(doc)
{
@ -483,6 +551,10 @@ function insert_MCQ(quest_type,quest_num,quest_id){
"<a class='icon_remove' title='删除' onclick='remove_single_answer($(this))'></a>"+
"</li><div class='cl'></div>");
}
var count = doc.parent().parent().prev().children('li').length;
multiLimit(doc.parent().siblings("li").children("div").children("select:first"), count);
multiLimit(doc.parent().siblings("li").children("div").children("select:last"), count);
}
function poll_cancel()
{
@ -543,26 +615,26 @@ function insert_MCQ(quest_type,quest_num,quest_id){
<div class="testQuestion">
<span class="fl mt10 mr18">题型</span>
<ul class="tabs_list fl">
<li class="tab_item02 ">
<li class="tab_item02 mr95">
<a title="<%= l(:label_MC) %>" class="tab_icon icon_radio" onclick="add_MC();">
<%= l(:label_MC) %>
</a>
</li>
<li class="tab_item02 " >
<li class="tab_item02 mr95" >
<a title="<%= l(:label_MCQ) %>" class=" tab_icon icon_checkbox" onclick="add_MCQ();">
<%= l(:label_MCQ) %>
</a>
</li>
<li class="tab_item02 " >
<a title="<%= l(:label_single) %>" class="tab_icon icon_text" onclick="add_single();">
<%= l(:label_single) %>
</a>
</li>
<li class="tab_item02 " >
<a title="<%= l(:label_mulit)%>" class="tab_icon icon_textarea" onclick="add_mulit();">
<%= l(:label_mulit)%>
<a title="<%= l(:label_subjective) %>" class="tab_icon icon_text" onclick="add_single();">
<%= l(:label_subjective) %>
</a>
</li>
<!--<li class="tab_item02 " >-->
<!--<a title="<%#= l(:label_mulit)%>" class="tab_icon icon_textarea" onclick="add_mulit();">-->
<!--<%#= l(:label_mulit)%>-->
<!--</a>-->
<!--</li>-->
</ul>
<div class="cl"></div>
</div><!--选项 end-->

View File

@ -0,0 +1,24 @@
<p class="mt10 mb10">
<span class="questionLabel" id="poll_question_number_<%=poll_question.id %>"><%= poll_question.question_number%></span>
<%if poll_question.is_necessary == 1%>
<span class="c_red questionLabel ml5" title="必答">*</span>
<%end%>
</p>
<% poll = poll_question.poll %>
<% count = poll.poll_questions.count %>
<% unless poll_question.question_number == 1 %>
<%= link_to('', {:controller => 'poll', :action => 'update_question_num', :id => poll.id, :ques_id => poll_question.id, :opr => 'up'},:remote => true, :method => 'post', :class => "poll-up mb8", :title => '上移') %>
<% end %>
<% if poll_question.question_number < count %>
<%= link_to('', {:controller => 'poll', :action => 'update_question_num', :id => poll.id, :ques_id => poll_question.id, :opr => 'down'},:remote => true, :method => 'post', :class => "poll-down mb8", :title => '下移') %>
<% end %>
<div class="poll-add mb8 pr">
<ul class="poll-add-menu fontGrey3">
<li><a href="javascript:void(0);" onclick=" dismiss('<%=type %>',<%=poll_question.id%>);insert_MC('<%=type %>',<%=poll_question.id%>);">单选题</a></li>
<li><a href="javascript:void(0);" onclick=" dismiss('<%=type %>',<%=poll_question.id%>);insert_MCQ('<%=type %>',<%=poll_question.id%>);">多选题</a></li>
<li><a href="javascript:void(0);" onclick=" dismiss('<%=type %>',<%=poll_question.id%>);insert_SINGLE('<%=type %>',<%=poll_question.id%>);">主观题</a></li>
</ul>
</div>
<%= link_to("", delete_poll_question_poll_index_path(:poll_question => poll_question.id),
method: :delete, :confirm => l(:text_are_you_sure), :remote => true, :class => "poll-delete", :title => "删除") %>

View File

@ -1,41 +1,52 @@
<div>
<div class="testEditTitle">
<span class="questionLabel">第<%= poll_question.question_number%>题:</span>
<span class="formatContainer m_w500"><%= poll_question.question_title %></span>
<%if poll_question.is_necessary == 1%>
<span class="c_red questionLabel ml5" title="必答">*</span>
<%end%>
<div class="poll-container">
<div class="poll-tool-bar" id="poll_tool_bar_<%= poll_question.id%>">
<%= render :partial => "poll_tool_bar", :locals => {:type => 'mc', :poll_question => poll_question}%>
</div>
<div class="poll-content">
<div class="testEditTitle" style="padding-top:0;">
<span class="formatContainer m_w500"><%= poll_question.question_title %></span>
<span class="fontBlue">[单选题]</span>
</div>
<a class="poll-edit" title="编辑" onclick="pollQuestionEdit(<%= poll_question.id%>);"></a>
<div class="cl"></div>
<%= link_to("", delete_poll_question_poll_index_path(:poll_question => poll_question.id),
method: :delete, :confirm => l(:text_are_you_sure), :remote => true, :class => "ur_icon_de") %>
<a class="ur_icon_edit" title="编辑" onclick="pollQuestionEdit(<%= poll_question.id%>);"></a>
<a class='ur_icon_add' title='向下插入' id="add_mc_<%=poll_question.id%>" onclick="dismiss('mc',<%=poll_question.id%>);insert_MC('mc',<%=poll_question.question_number%>,<%=poll_question.id%>);"></a>
<div class="cl"></div>
<div class="ur_inputs">
<table class="ur_table" style="width:675px;">
<tbody>
<% poll_question.poll_answers.reorder("answer_position").each do |poll_answer| %>
<tr>
<td>
<% if poll_answer.answer_text != '' %>
<label>
<input class="ur_radio" type="radio" name="<%= poll_question %>" value="<%= poll_answer.answer_text%>" >
<%= poll_answer.answer_text%>
</label>
<% else %>
<label>
<input class="ur_radio" name="<%= poll_question %>" value="" type="radio">
</label>
<input placeholder="其它" readonly="readonly" class="disabled questionnaire-input w300" type="text">
<% end %>
</td>
</tr>
<% end %>
</tbody>
</table>
<div class="ur_inputs">
<table class="ur_table" style="width:647px;">
<tbody>
<% poll_question.poll_answers.reorder("answer_position").each do |poll_answer| %>
<tr>
<td>
<% if poll_answer.answer_text != '' %>
<label>
<input class="ur_radio" type="radio" name="<%= poll_question %>" value="<%= poll_answer.answer_text%>" >
<%= poll_answer.answer_text%>
</label>
<% else %>
<label>
<input class="ur_radio" name="<%= poll_question %>" value="" type="radio">
</label>
<input placeholder="其它" readonly="readonly" class="disabled questionnaire-input w300" type="text">
<% end %>
</td>
</tr>
<% end %>
</tbody>
</table>
</div>
</div>
</div><!--单选题显示 end-->
<!-- 新增问题 -->
<div id="insert_new_poll_question_mc_<%=poll_question.id%>">
</div>
<script>
$(".poll-add").mouseover(function(){
$(this).children('ul').show();
}).mouseout(function(){
$(this).children('ul').hide();
});
$(".poll-add-menu").mouseover(function(){
$(this).show();
}).mouseout(function(){
$(this).hide();
});
</script>

View File

@ -1,40 +1,62 @@
<div>
<div class="testEditTitle">
<span class="questionLabel">第<%= poll_question.question_number%>题:</span>
<span class="formatContainer m_w500"><%= poll_question.question_title %></span>
<%if poll_question.is_necessary == 1%>
<span class="ur_required questionLabel ml5" title="必答">*</span>
<%end%>
</div>
<%= link_to("", delete_poll_question_poll_index_path(:poll_question => poll_question.id),
method: :delete, :confirm => l(:text_are_you_sure), :remote => true, :class => "ur_icon_de") %>
<a class="ur_icon_edit" title="编辑" onclick="pollQuestionEdit(<%= poll_question.id%>);"></a>
<a class='ur_icon_add' title='向下插入' id="add_mcq_<%=poll_question.id%>" onclick="dismiss('mcq',<%=poll_question.id%>);insert_MCQ('mcq',<%=poll_question.question_number%>,<%=poll_question.id%>);"></a>
<div class="cl"></div>
<div class="ur_inputs" style="width:675px;">
<table class="ur_table" style="width:675px;">
<tbody>
<% poll_question.poll_answers.reorder("answer_position").each do |poll_answer| %>
<tr>
<td>
<% if poll_answer.answer_text != '' %>
<label>
<input class="ur_radio" type="checkbox" name="<%= poll_question %>" value="<%= poll_answer.answer_text%>" >
<%= poll_answer.answer_text%>
</label>
<% else %>
<label>
<input class="ur_radio" name="<%= poll_question %>" value="" type="checkbox">
</label>
<input placeholder="其它" readonly="readonly" class="disabled questionnaire-input w300" type="text">
<% end %>
</td>
</tr>
<% end %>
</tbody>
</table>
<div class="poll-container">
<div class="poll-tool-bar" id="poll_tool_bar_<%= poll_question.id%>">
<%= render :partial => "poll_tool_bar", :locals => {:type => 'mcq', :poll_question => poll_question}%>
</div>
<div class="poll-content">
<div class="testEditTitle" style="padding-top:0;">
<span class="formatContainer m_w500"><%= poll_question.question_title %></span>
<span class="fontBlue">[多选题]</span>
<% if poll_question.min_choices != 0 || poll_question.max_choices != 0 %>
<p class="fontGrey2">
<% if poll_question.min_choices != 0 && poll_question.max_choices != 0 %>
答题时最少选<%=poll_question.min_choices %>项、最多选<%=poll_question.max_choices %>项
<% elsif poll_question.min_choices != 0 %>
答题时最少选<%=poll_question.min_choices %>项
<% elsif poll_question.max_choices != 0 %>
答题时最多选<%=poll_question.max_choices %>项
<% end %>
</p>
<% end %>
</div>
<a class="poll-edit" title="编辑" onclick="pollQuestionEdit(<%= poll_question.id%>);"></a>
<div class="cl"></div>
<div class="ur_inputs">
<table class="ur_table" style="width:647px;">
<tbody>
<% poll_question.poll_answers.reorder("answer_position").each do |poll_answer| %>
<tr>
<td>
<% if poll_answer.answer_text != '' %>
<label>
<input class="ur_radio" type="checkbox" name="<%= poll_question %>" value="<%= poll_answer.answer_text%>" >
<%= poll_answer.answer_text%>
</label>
<% else %>
<label>
<input class="ur_radio" name="<%= poll_question %>" value="" type="checkbox">
</label>
<input placeholder="其它" readonly="readonly" class="disabled questionnaire-input w300" type="text">
<% end %>
</td>
</tr>
<% end %>
</tbody>
</table>
</div>
</div>
</div><!--多选题显示 end-->
<!-- 新增问题 -->
<div id="insert_new_poll_question_mcq_<%=poll_question.id%>">
</div>
</div>
<script>
$(".poll-add").mouseover(function(){
$(this).children('ul').show();
}).mouseout(function(){
$(this).children('ul').hide();
});
$(".poll-add-menu").mouseover(function(){
$(this).show();
}).mouseout(function(){
$(this).hide();
});
</script>

View File

@ -1,23 +1,35 @@
<div>
<div class="testEditTitle">
<span class="questionLabel">第<%= poll_question.question_number%>题:</span>
<span class="formatContainer m_w500"><%= poll_question.question_title %></span>
<%if poll_question.is_necessary == 1%>
<span class="ur_required questionLabel ml5" title="必答">*</span>
<%end%>
<div class="poll-container">
<div class="poll-tool-bar" id="poll_tool_bar_<%= poll_question.id%>">
<%= render :partial => "poll_tool_bar", :locals => {:type => 'mulit', :poll_question => poll_question}%>
</div>
<div class="poll-content">
<div class="testEditTitle" style="padding-top:0;">
<span class="formatContainer m_w500"><%= poll_question.question_title %></span>
<span class="fontBlue">[多行主观题]</span>
</div>
<a class="poll-edit" title="编辑" onclick="pollQuestionEdit(<%= poll_question.id%>);"></a>
<div class="cl"></div>
<% poll_question.poll_answers.reorder("answer_position").each_with_index do |poll_answer, i| %>
<div class="ml20 mb10">
<p class="mb10"><%= i + 1 %>.<%= poll_answer.answer_text%></p>
<input type="text" class="questionnaire-input" name="<%= poll_question %>" style="width:620px;" />
</div>
<% end %>
</div>
<%= link_to("", delete_poll_question_poll_index_path(:poll_question => poll_question.id),
method: :delete, :confirm => l(:text_are_you_sure), :remote => true, :class => "ur_icon_de") %>
<a class="ur_icon_edit" title="编辑" onclick="pollQuestionEdit(<%= poll_question.id%>);"></a>
<a class='ur_icon_add' title='向下插入' id="add_mulit_<%=poll_question.id%>" onclick="dismiss('mulit',<%=poll_question.id%>);insert_MULIT('mulit',<%=poll_question.question_number%>,<%=poll_question.id%>);"></a>
<div class="cl"></div>
<% poll_question.poll_answers.reorder("answer_position").each_with_index do |poll_answer, i| %>
<div class="ml40 mb10">
<p class="mb10"><%= i + 1 %>.<%= poll_answer.answer_text%></p>
<input type="text" class="questionnaire-input" name="<%= poll_question %>" style="width:652px;" />
</div>
<% end %>
</div><!--多行展示 end-->
<!-- 新增问题 -->
<div id="insert_new_poll_question_mulit_<%=poll_question.id%>">
</div>
</div>
<script>
$(".poll-add").mouseover(function(){
$(this).children('ul').show();
}).mouseout(function(){
$(this).children('ul').hide();
});
$(".poll-add-menu").mouseover(function(){
$(this).show();
}).mouseout(function(){
$(this).hide();
});
</script>

View File

@ -1,20 +1,32 @@
<div>
<div class="testEditTitle">
<span class="questionLabel">第<%= poll_question.question_number%>题:</span>
<span class="formatContainer m_w500"><%= poll_question.question_title %></span>
<%if poll_question.is_necessary == 1%>
<span class="ur_required questionLabel ml5" title="必答">*</span>
<%end%>
<div class="poll-container">
<div class="poll-tool-bar" id="poll_tool_bar_<%= poll_question.id%>">
<%= render :partial => "poll_tool_bar", :locals => {:type => 'single', :poll_question => poll_question}%>
</div>
<%= link_to("", delete_poll_question_poll_index_path(:poll_question => poll_question.id),
method: :delete, :confirm => l(:text_are_you_sure), :remote => true, :class => "ur_icon_de") %>
<a class="ur_icon_edit" title="编辑" onclick="pollQuestionEdit(<%= poll_question.id%>);"></a>
<a class='ur_icon_add' title='向下插入' id="add_single_<%=poll_question.id%>" onclick="dismiss('single',<%=poll_question.id%>);insert_SINGLE('single',<%=poll_question.question_number%>,<%=poll_question.id%>);"></a>
<div class="cl"></div>
<div class="ur_inputs">
<input class="questionnaire-input" type="text" size="" maxlength="" value="" style="width:692px;">
<div class="poll-content">
<div class="testEditTitle" style="padding-top:0;">
<span class="formatContainer m_w500"><%= poll_question.question_title %></span>
<span class="fontBlue">[主观题]</span>
</div>
<a class="poll-edit" title="编辑" onclick="pollQuestionEdit(<%= poll_question.id%>);"></a>
<div class="cl"></div>
<div class="ur_inputs">
<textarea type="text" size="" maxlength="" value="" style="width:640px; border:1px solid #ddd;" rows="3" readonly="readonly"></textarea>
</div>
</div>
</div><!--单行文字展示 end-->
<!-- 新增问题 -->
<div id="insert_new_poll_question_single_<%=poll_question.id%>">
</div>
</div>
<script>
$(".poll-add").mouseover(function(){
$(this).children('ul').show();
}).mouseout(function(){
$(this).children('ul').hide();
});
$(".poll-add-menu").mouseover(function(){
$(this).show();
}).mouseout(function(){
$(this).hide();
});
</script>

View File

@ -2,41 +2,39 @@
$("#poll_content").html('<%= escape_javascript(render :partial => 'poll_content', :locals => {:poll => @poll})%>');
<% else %>
$("#new_poll_question_new").html("");
<%if @poll_questions.question_type == 1%>
$("#mc_question_list").show().append("<div id='poll_questions_<%= @poll_questions.id%>'>" +
"<div id='show_poll_questions_<%= @poll_questions.id %>'>" +
"<%= escape_javascript(render :partial => 'show_MC', :locals => {:poll_question => @poll_questions}) %>" +
"</div>" +
"<div id='edit_poll_questions_<%= @poll_questions.id %>' style='display: none;'>" +
"<%= escape_javascript(render :partial => 'edit_MC', :locals => {:poll_question => @poll_questions}) %>" +
"</div>" +
"</div>");
<%elsif @poll_questions.question_type == 2%>
$("#mcq_question_list").show().append("<div id='poll_questions_<%= @poll_questions.id%>'>" +
"<div id='show_poll_questions_<%= @poll_questions.id %>'>" +
"<%= escape_javascript(render :partial => 'show_MCQ', :locals => {:poll_question => @poll_questions}) %>" +
"</div>" +
"<div id='edit_poll_questions_<%= @poll_questions.id %>' style='display: none;'>" +
"<%= escape_javascript(render :partial => 'edit_MCQ', :locals => {:poll_question => @poll_questions}) %>" +
"</div>" +
"</div>");
<%elsif @poll_questions.question_type == 3%>
$("#single_question_list").show().append("<div id='poll_questions_<%= @poll_questions.id%>'>" +
"<div id='show_poll_questions_<%= @poll_questions.id %>'>" +
"<%= escape_javascript(render :partial => 'show_single', :locals => {:poll_question => @poll_questions}) %>" +
"</div>" +
"<div id='edit_poll_questions_<%= @poll_questions.id %>' style='display: none;'>" +
"<%= escape_javascript(render :partial => 'edit_single', :locals => {:poll_question => @poll_questions}) %>" +
"</div>" +
"</div>");
<%elsif @poll_questions.question_type == 4%>
$("#multi_question_list").show().append("<div id='poll_questions_<%= @poll_questions.id%>'>" +
"<div id='show_poll_questions_<%= @poll_questions.id %>'>" +
"<%= escape_javascript(render :partial => 'show_mulit', :locals => {:poll_question => @poll_questions}) %>" +
"</div>" +
"<div id='edit_poll_questions_<%= @poll_questions.id %>' style='display: none;'>" +
"<%= escape_javascript(render :partial => 'edit_mulit', :locals => {:poll_question => @poll_questions}) %>" +
"</div>" +
"</div>");
<% if @last_question %>
<% if @last_question.question_type == 1%>
$("#show_poll_questions_<%= @last_question.id %>").html("<%= escape_javascript(render :partial => 'show_MC', :locals => {:poll_question => @last_question}) %>");
<% elsif @last_question.question_type == 2%>
$("#show_poll_questions_<%= @last_question.id %>").html("<%= escape_javascript(render :partial => 'show_MCQ', :locals => {:poll_question => @last_question}) %>");
<% elsif @last_question.question_type == 3%>
$("#show_poll_questions_<%= @last_question.id %>").html("<%= escape_javascript(render :partial => 'show_single', :locals => {:poll_question => @last_question}) %>");
<% elsif @last_question.question_type == 4%>
$("#show_poll_questions_<%= @last_question.id %>").html("<%= escape_javascript(render :partial => 'show_mulit', :locals => {:poll_question => @last_question}) %>");
<% end%>
<% end %>
$("#poll_content").append("<div id='poll_questions_<%= @poll_questions.id%>'>" +
"<div id='show_poll_questions_<%= @poll_questions.id %>'>" +
"<% if @poll_questions.question_type == 1%>" +
"<%= escape_javascript(render :partial => 'show_MC', :locals => {:poll_question => @poll_questions}) %>" +
"<% elsif @poll_questions.question_type == 2%>" +
"<%= escape_javascript(render :partial => 'show_MCQ', :locals => {:poll_question => @poll_questions}) %>" +
"<% elsif @poll_questions.question_type == 3%>" +
"<%= escape_javascript(render :partial => 'show_single', :locals => {:poll_question => @poll_questions}) %>" +
"<% elsif @poll_questions.question_type == 4%>" +
"<%= escape_javascript(render :partial => 'show_mulit', :locals => {:poll_question => @poll_questions}) %>" +
"<% end%>" +
"</div>" +
"<div id='edit_poll_questions_<%= @poll_questions.id %>' style='display: none;'>" +
"<% if @poll_questions.question_type == 1%>" +
"<%= escape_javascript(render :partial => 'edit_MC', :locals => {:poll_question => @poll_questions}) %>" +
"<% elsif @poll_questions.question_type == 2%>" +
"<%= escape_javascript(render :partial => 'edit_MCQ', :locals => {:poll_question => @poll_questions}) %>" +
"<% elsif @poll_questions.question_type == 3%>" +
"<%= escape_javascript(render :partial => 'edit_single', :locals => {:poll_question => @poll_questions}) %>" +
"<% elsif @poll_questions.question_type == 4%>" +
"<%= escape_javascript(render :partial => 'edit_mulit', :locals => {:poll_question => @poll_questions}) %>" +
"<% end%>" +
"</div>" +
"</div>");
<% end %>

View File

@ -1,303 +1,347 @@
<%= stylesheet_link_tag 'polls', :media => 'all' %>
<%= stylesheet_link_tag 'polls', :media => 'all' %>
<div class="homepageRight mt0 ml10">
<div class="resources" id="polls">
<div class="testStatus" >
<h1 class="ur_page_title">
<%= @poll.polls_name%>
</h1>
<div class="testDesEdit mt5"><%= @poll.polls_description.nil? ? "" : @poll.polls_description.html_safe%></div>
</div>
<div class="testStatus">
<h1 class="ur_page_title">
<%= @poll.polls_name %>
</h1>
<% mc_question_list = @poll.poll_questions.where("question_type=1") %>
<% mcq_question_list = @poll.poll_questions.where("question_type=2") %>
<% single_question_list = @poll.poll_questions.where("question_type=3") %>
<% multi_question_list = @poll.poll_questions.where("question_type=4") %>
<div class="testStatus" id="mc_question_list" style="display: <%=mc_question_list.count > 0 ? "" : "none" %>">
<h3 class="fontGrey3">单选题</h3>
<% mc_question_list.each_with_index do |pq, list_index| %>
<div id="poll_questions_<%= pq.id%>">
<div id="show_poll_questions_<%= pq.id %>">
<div>
<div class="testEditTitle">
<%= l(:label_question_number,:question_number => pq.question_number) %>
<%= pq.question_title %>
<% if pq.is_necessary == 1 %>
<span class="ur_required" title="<%= l(:label_must_answer) %>">*</span>
<% end %>
</div>
<div class="cl"></div>
<div class="ur_inputs">
<table class="ur_table" style="width:675px;">
<tbody>
<% pq.poll_answers.each do |pa| %>
<tr>
<td>
<label>
<script>
function onblur_<%= pa.id %>(obj)
{
$(window).unbind('beforeunload');
$.ajax({
type: "post",
url: "<%= commit_answer_poll_path(@poll) %>",
data: {
poll_question_id: <%= pq.id %>,
poll_answer_id: <%= pa.id %>,
vote_text: obj.value
},
success: function (data) {
var dataObj = eval(data);
document.getElementById("poll_vote_<%=pq.id %>poll_answer_id_<%=pa.id %>").checked = true;
var span = $('#percent');
span.html(dataObj.percent);
}
});
<div class="testDesEdit mt5"><%= @poll.polls_description.nil? ? "" : @poll.polls_description.html_safe %></div>
</div>
}
function click_<%= pa.id %>(obj)
{
$.ajax({
type: "post",
url: "<%= commit_answer_poll_path(@poll) %>",
data: {
poll_answer_id: <%= pa.id %>,
poll_question_id: <%= pq.id %>
},
success: function (data) {
var dataObj = eval(data);
if(dataObj.text == "ok")
{
obj.checked = true;
}
else
{
obj.checked = false;
}
var span = $('#percent');
span.html(dataObj.percent);
},
error: function () {
alert("网络异常,答题失败,请确认网络正常连接后再答题。");
}
});
}
</script>
<%= radio_button "poll_vote",pq.id.to_s+"poll_answer_id",pa.id,:class=>"ur_radio",:onclick =>"click_#{pa.id}(this);return false;",:checked => answer_be_selected?(pa,User.current),:disabled => !@can_edit_poll %>
<% if pa.answer_text == "" %>
<input class="ur_text ur_textbox" type="text" size="" maxlength="" style="width: 93%" value="<%= get_anwser_vote_text(pq.id,User.current.id).html_safe %>" onblur="onblur_<%= pa.id %>(this);" <%= @can_edit_poll?"":"disabled=disabled" %> placeholder="其他">
<% else %>
<%= pa.answer_text %>
<% end %>
</label>
</td>
</tr>
<% end %>
</tbody>
</table>
</div>
</div>
</div>
</div>
<% end %>
</div>
<div class="testStatus" id="mcq_question_list" style="display: <%=mcq_question_list.count > 0 ? "" : "none" %>">
<h3 class="fontGrey3">多选题</h3>
<% mcq_question_list.each do |pq| %>
<div id="poll_questions_<%= pq.id%>">
<div id="show_poll_questions_<%= pq.id %>">
<div>
<div class="testEditTitle">
<%= l(:label_question_number,:question_number => pq.question_number) %>
<%= pq.question_title %>
<% if pq.is_necessary == 1 %>
<span class="ur_required" title="<%= l(:label_must_answer) %>">*</span>
<% end %>
</div>
<div class="cl"></div>
<div class="ur_inputs">
<table class="ur_table" style="width:675px;">
<tbody>
<% pq.poll_answers.each do |pa| %>
<tr>
<td>
<label>
<script>
function onblur_<%= pa.id %>(obj)
{
$(window).unbind('beforeunload');
$.ajax({
type: "post",
url: "<%= commit_answer_poll_path(@poll) %>",
data: {
poll_question_id: <%= pq.id %>,
poll_answer_id: <%= pa.id %>,
vote_text: obj.value
},
success: function (data) {
var dataObj = eval(data);
document.getElementById("poll_vote_<%=pq.id %>poll_answer_id_<%=pa.id %>").checked = true;
var span = $('#percent');
span.html(dataObj.percent);
}
});
}
function click_<%= pa.id %>(obj)
{
$.ajax({
type: "post",
url: "<%= commit_answer_poll_path(@poll) %>",
data: {
poll_answer_id: <%= pa.id %>,
poll_question_id: <%= pq.id %>
},
success: function (data) {
var dataObj = eval(data);
if(dataObj.text == "ok")
{
obj.checked = true;
}
else
{
obj.checked = false;
}
var span = $('#percent');
span.html(dataObj.percent);
},
error: function () {
alert("网络异常,答题失败,请确认网络正常连接后再答题。");
}
});
}
</script>
<input class="ur_radio" id="poll_vote_<%=pq.id %>poll_answer_id_<%=pa.id %>" type="checkbox" onclick="click_<%= pa.id %>(this);return false;" <%= answer_be_selected?(pa,User.current) ? "checked":"" %> <%= @can_edit_poll?"":"disabled=disabled" %> >
<% if pa.answer_text == "" %>
<input class="ur_text ur_textbox" type="text" size="" maxlength="" style="width: 93%" value="<%= get_anwser_vote_text(pq.id,User.current.id).html_safe %>" onblur="onblur_<%= pa.id %>(this);" <%= @can_edit_poll?"":"disabled=disabled" %> placeholder="其他">
<% else %>
<%= pa.answer_text %>
<% end %>
</label>
</td>
</tr>
<% end %>
</tbody>
</table>
</div>
</div><!--多选题显示 end-->
</div>
</div>
<% end %>
</div>
<div class="testStatus" id="single_question_list" style="display: <%=single_question_list.count > 0 ? "" : "none" %>">
<h3 class="fontGrey3">单行主观题</h3>
<% single_question_list.each do |pq| %>
<div id="poll_questions_<%= pq.id%>">
<div id="show_poll_questions_<%= pq.id %>">
<div>
<div class="testEditTitle">
<%= l(:label_question_number,:question_number => pq.question_number) %>
<%= pq.question_title %>
<% if pq.is_necessary == 1 %>
<span class="ur_required" title="<%= l(:label_must_answer) %>">*</span>
<% end %>
</div>
<div class="cl"></div>
<% @poll_questions.each do |pq| %>
<% if pq.question_type == 1 %>
<!-- 单选题 -->
<div class="testStatus">
<div id="poll_questions_<%= pq.id %>">
<div id="show_poll_questions_<%= pq.id %>">
<div>
<script>
function onblur_<%= pq.id %>(obj)
{
$(window).unbind('beforeunload');
var val = $(obj).val().trim();
if(val != "") {
$.ajax({
type: "post",
url: "<%= commit_answer_poll_path(@poll) %>",
data: {
poll_question_id: <%= pq.id %> ,
vote_text: obj.value
},
success: function (data) {
var dataObj = eval(data);
obj.value = dataObj.text;
var span = $('#percent');
span.html(dataObj.percent);
},
error: function () {
alert("网络异常,答题失败,请确认网络正常连接后再答题。");
}
});
}
}
</script>
<input class="fillInput" placeholder="在此填入答案" type="text" value="<%= get_anwser_vote_text(pq.id,User.current.id).html_safe %>" onblur="onblur_<%= pq.id %>(this);" <%= @can_edit_poll?"":"disabled=disabled" %>>
<div class="testEditTitle">
<%= l(:label_question_number, :question_number => pq.question_number) %>
<%= pq.question_title %>
<span class="fontBlue">[单选题]</span>
<% if pq.is_necessary == 1 %>
<span class="ur_required" title="<%= l(:label_must_answer) %>">*</span>
<% end %>
</div>
<div class="cl"></div>
<div class="ur_inputs">
<table class="ur_table" style="width:675px;">
<tbody>
<% pq.poll_answers.each do |pa| %>
<tr>
<td>
<label>
<script>
function onblur_<%= pa.id %>(obj) {
$(window).unbind('beforeunload');
$.ajax({
type: "post",
url: "<%= commit_answer_poll_path(@poll) %>",
data: {
poll_question_id: <%= pq.id %>,
poll_answer_id: <%= pa.id %>,
vote_text: obj.value
},
success: function (data) {
var dataObj = eval(data);
//document.getElementById("poll_vote_<%#=pq.id %>poll_answer_id_<%#=pa.id %>").checked = true;
//var span = $('#percent');
//span.html(dataObj.percent);
}
});
}
function click_<%= pa.id %>(obj) {
$.ajax({
type: "post",
url: "<%= commit_answer_poll_path(@poll) %>",
data: {
poll_answer_id: <%= pa.id %>,
poll_question_id: <%= pq.id %>
},
success: function (data) {
var dataObj = eval(data);
if (dataObj.text == "ok") {
obj.checked = true;
$(obj).parent().parent().parent().parent().find("input[type='text']").attr("disabled", "disabled");
$(obj).next('input').removeAttr("disabled");
}
else {
obj.checked = false;
$(obj).next('input').attr("disabled", "disabled");
}
var span = $('#percent');
span.html(dataObj.percent);
},
error: function () {
alert("网络异常,答题失败,请确认网络正常连接后再答题。");
}
});
}
</script>
<%= radio_button "poll_vote", pq.id.to_s+"poll_answer_id", pa.id, :class => "ur_radio", :onclick => "click_#{pa.id}(this);return false;", :checked => answer_be_selected?(pa, User.current), :disabled => !@can_edit_poll %>
<% if pa.answer_text == "" %>
<input class="ur_text ur_textbox" type="text" size="" maxlength="" style="width: 93%" value="<%= get_anwser_vote_text(pq.id, User.current.id, pa.id).html_safe %>" onblur="onblur_<%= pa.id %>(this);" <%= (@can_edit_poll && answer_be_selected?(pa, User.current)) ? "" : "disabled=disabled" %> placeholder="其他">
<% else %>
<%= pa.answer_text %>
<% end %>
</label>
</td>
</tr>
<% end %>
</tbody>
</table>
</div>
</div>
</div>
</div>
</div>
<% end %>
</div>
<div class="testStatus" id="multi_question_list" style="display: <%=multi_question_list.count > 0 ? "" : "none" %>">
<h3 class="fontGrey3">多行主观题</h3>
<% multi_question_list.each do |pq| %>
<div id="poll_questions_<%= pq.id%>">
<div id="show_poll_questions_<%= pq.id %>">
<div>
<div class="testEditTitle">
<%= l(:label_question_number,:question_number => pq.question_number) %>
<%= pq.question_title %>
<% if pq.is_necessary == 1 %>
<span class="ur_required" title="<%= l(:label_must_answer) %>">*</span>
<% elsif pq.question_type == 2 %>
<!-- 多选题 -->
<div class="testStatus">
<div id="poll_questions_<%= pq.id %>">
<div id="show_poll_questions_<%= pq.id %>">
<div>
<div class="testEditTitle">
<%= l(:label_question_number, :question_number => pq.question_number) %>
<%= pq.question_title %>
<span class="fontBlue">[多选题]</span>
<% if pq.is_necessary == 1 %>
<span class="ur_required" title="<%= l(:label_must_answer) %>">*</span>
<% end %>
<% if pq.min_choices != 0 || pq.max_choices != 0 %>
<p class="fontGrey2">
<% if pq.min_choices != 0 && pq.max_choices != 0 %>
答题时最少选<%=pq.min_choices %>项、最多选<%=pq.max_choices %>项
<% elsif pq.min_choices != 0 %>
答题时最少选<%=pq.min_choices %>项
<% elsif pq.max_choices != 0 %>
答题时最多选<%=pq.max_choices %>项
<% end %>
<span class="c_red ml10" id="mcq_notice_<%=pq.id %>"></span>
</p>
<% end %>
</div>
<div class="cl"></div>
<div class="ur_inputs">
<table class="ur_table" style="width:675px;">
<tbody>
<% pq.poll_answers.each do |pa| %>
<tr>
<td>
<label>
<script>
function onblur_<%= pa.id %>(obj) {
$(window).unbind('beforeunload');
$.ajax({
type: "post",
url: "<%= commit_answer_poll_path(@poll) %>",
data: {
poll_question_id: <%= pq.id %>,
poll_answer_id: <%= pa.id %>,
vote_text: obj.value
},
success: function (data) {
var dataObj = eval(data);
//document.getElementById("poll_vote_<%#=pq.id %>poll_answer_id_<%#=pa.id %>").checked = true;
//var span = $('#percent');
//span.html(dataObj.percent);
}
});
}
function click_<%= pa.id %>(obj) {
$.ajax({
type: "post",
url: "<%= commit_answer_poll_path(@poll) %>",
data: {
poll_answer_id: <%= pa.id %>,
poll_question_id: <%= pq.id %>
},
success: function (data) {
var dataObj = eval(data);
if (dataObj.text == "ok") {
obj.checked = true;
$(obj).next('input').removeAttr("disabled");
$("#mcq_notice_<%=pq.id %>").html("");
}
else {
obj.checked = false;
$(obj).next('input').attr("disabled", "disabled");
if(dataObj.text == "over"){
$("#mcq_notice_<%=pq.id %>").html("该题最多只能选择<%=pq.max_choices %>个选项");
}else{
$("#mcq_notice_<%=pq.id %>").html("");
}
}
var span = $('#percent');
span.html(dataObj.percent);
},
error: function () {
alert("网络异常,答题失败,请确认网络正常连接后再答题。");
}
});
}
</script>
<input class="ur_radio" id="poll_vote_<%= pq.id %>poll_answer_id_<%= pa.id %>" type="checkbox" onclick="click_<%= pa.id %>(this);return false;" <%= answer_be_selected?(pa, User.current) ? "checked" : "" %> <%= @can_edit_poll ? "" : "disabled=disabled" %> >
<% if pa.answer_text == "" %>
<input class="ur_text ur_textbox" type="text" size="" maxlength="" style="width: 93%" value="<%= get_anwser_vote_text(pq.id, User.current.id, pa.id).html_safe %>" onblur="onblur_<%= pa.id %>(this);" <%= (@can_edit_poll && answer_be_selected?(pa, User.current)) ? "" : "disabled=disabled" %> placeholder="其他">
<% else %>
<%= pa.answer_text %>
<% end %>
</label>
</td>
</tr>
<% end %>
</tbody>
</table>
</div>
</div>
<!--多选题显示 end-->
</div>
</div>
</div>
<% elsif pq.question_type == 3 %>
<!-- 单行文字-->
<div class="testStatus">
<div id="poll_questions_<%= pq.id %>">
<div id="show_poll_questions_<%= pq.id %>">
<div>
<div class="testEditTitle">
<%= l(:label_question_number, :question_number => pq.question_number) %>
<%= pq.question_title %>
<span class="fontBlue">[主观题]</span>
<% if pq.is_necessary == 1 %>
<span class="ur_required" title="<%= l(:label_must_answer) %>">*</span>
<% end %>
</div>
<div class="cl"></div>
<div>
<script>
function onblur_<%= pq.id %>(obj) {
$(window).unbind('beforeunload');
var val = $(obj).val().trim();
if (val != "") {
$.ajax({
type: "post",
url: "<%= commit_answer_poll_path(@poll) %>",
data: {
poll_question_id: <%= pq.id %>,
vote_text: obj.value
},
success: function (data) {
var dataObj = eval(data);
obj.value = dataObj.text;
var span = $('#percent');
span.html(dataObj.percent);
},
error: function () {
alert("网络异常,答题失败,请确认网络正常连接后再答题。");
}
});
}
}
</script>
<input class="fillInput" placeholder="在此填入答案" type="text" value="<%= get_anwser_vote_text(pq.id, User.current.id).html_safe %>" onblur="onblur_<%= pq.id %>(this);" <%= @can_edit_poll ? "" : "disabled=disabled" %>>
</div>
</div>
</div>
</div>
</div>
<% elsif pq.question_type == 4 %>
<!-- 多行文字-->
<div class="testStatus">
<div id="poll_questions_<%= pq.id %>">
<div id="show_poll_questions_<%= pq.id %>">
<div>
<div class="testEditTitle">
<%= l(:label_question_number, :question_number => pq.question_number) %>
<%= pq.question_title %>
<span class="fontBlue">[多行主观题]</span>
<% if pq.is_necessary == 1 %>
<span class="ur_required" title="<%= l(:label_must_answer) %>">*</span>
<% end %>
</div>
<div class="cl"></div>
<% pq.poll_answers.each_with_index do |pa, i| %>
<div class="ml20 mb10">
<script>
function onblur_<%= pa.id %>(obj) {
$(window).unbind('beforeunload');
var val = $(obj).val().trim();
if (val != "") {
$.ajax({
type: "post",
url: "<%= commit_answer_poll_path(@poll) %>",
data: {
poll_question_id: <%= pq.id %>,
poll_answer_id: <%= pa.id %>,
vote_text: obj.value
},
success: function (data) {
var dataObj = eval(data);
obj.value = dataObj.text;
var span = $('#percent');
span.html(dataObj.percent);
},
error: function () {
alert("网络异常,答题失败,请确认网络正常连接后再答题。");
}
});
}
}
</script>
<p class="mb10"><%= i + 1 %>.<%= pa.answer_text %></p>
<input class="questionnaire-input" placeholder="在此填入答案" style="width: 99%" type="text" value="<%= get_anwser_vote_text(pq.id, User.current.id, pa.id).html_safe %>" onblur="onblur_<%= pa.id %>(this);" <%= @can_edit_poll ? "" : "disabled=disabled" %>>
</div>
<% end %>
</div>
<div class="cl"></div>
<% pq.poll_answers.each_with_index do |pa, i| %>
<div class="ml40 mb10">
<script>
function onblur_<%= pa.id %>(obj)
{
$(window).unbind('beforeunload');
var val = $(obj).val().trim();
if(val != "") {
$.ajax({
type: "post",
url: "<%= commit_answer_poll_path(@poll) %>",
data: {
poll_question_id: <%= pq.id %>,
poll_answer_id: <%= pa.id %>,
vote_text: obj.value
},
success: function (data) {
var dataObj = eval(data);
obj.value = dataObj.text;
var span = $('#percent');
span.html(dataObj.percent);
},
error: function () {
alert("网络异常,答题失败,请确认网络正常连接后再答题。");
}
});
}
}
</script>
<p class="mb10"><%= i + 1 %>.<%= pa.answer_text%></p>
<input class="questionnaire-input" placeholder="在此填入答案" style="width: 93%" type="text" value="<%= get_anwser_vote_text(pq.id,User.current.id,pa.id).html_safe %>" onblur="onblur_<%= pa.id %>(this);" <%= @can_edit_poll?"":"disabled=disabled" %>>
</div>
<% end %>
</div>
</div>
</div>
<% else %>
<!-- 未知题型 -->
<% end %>
</div>
<div class="ur_buttons" style="width: 77px;">
<% if @poll.polls_status == 2 %>
<%= link_to l(:button_submit),commit_poll_poll_path(@poll), :method => :post,:class => "BlueCirBtn",:format => 'js',:remote=>true %>
<% end %>
</div>
<div class="cl"></div>
<div class="ur_progress_text">
<%= l(:label_complete_question) %>
<strong class="ur_progress_number">
<span id="percent"><%= format "%.2f" ,@percent %></span>%
</strong>
</div>
</div><!--问卷内容end-->
</div>
<% end %>
<div class="ur_buttons" style="width: 77px;">
<% if @poll.polls_status == 2 %>
<a href="javascript:void(0)" class="BlueCirBtn" onclick="commit_poll();"><%=l(:button_submit) %></a>
<%#= link_to l(:button_submit), commit_poll_poll_path(@poll), :method => :post, :class => "BlueCirBtn", :format => 'js', :remote => true %>
<% end %>
</div>
<div class="cl"></div>
<div class="ur_progress_text">
<%= l(:label_complete_question) %>
<strong class="ur_progress_number">
<span id="percent"><%= format "%.2f", @percent %></span>%
</strong>
</div>
</div>
<!--问卷内容end-->
</div>
<script>
function check_mcq(){
var result = true;
<% @poll.poll_questions.where("question_type = 2").each do |pq| %>
$("#mcq_notice_<%=pq.id %>").html("");
<% if pq.min_choices != 0 %>
var count = $("#show_poll_questions_<%= pq.id %>").find("input[type='checkbox']:checked").length;
if(count < <%=pq.min_choices %>) {
$("#mcq_notice_<%=pq.id %>").html("该题最少选择<%=pq.min_choices %>个选项");
result = false;
} else{
$("#mcq_notice_<%=pq.id %>").html("");
}
<% end %>
<% end %>
if(!result){
alert("您的多选题答题不符合要求,请检查后再提交");
}
return result;
}
function commit_poll(){
if(check_mcq()){
$.post('<%=commit_poll_poll_path(@poll) %>');
}
}
</script>

View File

@ -0,0 +1,34 @@
//$("#poll_content").html('<%#= escape_javascript(render :partial => 'poll_content', :locals => {:poll => @poll})%>');
<% if @before_que %>
$("#poll_questions_<%= @poll_question.id%>").insertBefore($("#poll_questions_<%= @before_que.id%>"));
<% if @before_que.question_type == 1%>
$("#show_poll_questions_<%= @before_que.id %>").html("<%= escape_javascript(render :partial => 'show_MC', :locals => {:poll_question => @before_que}) %>");
<% elsif @before_que.question_type == 2%>
$("#show_poll_questions_<%= @before_que.id %>").html("<%= escape_javascript(render :partial => 'show_MCQ', :locals => {:poll_question => @before_que}) %>");
<% elsif @before_que.question_type == 3%>
$("#show_poll_questions_<%= @before_que.id %>").html("<%= escape_javascript(render :partial => 'show_single', :locals => {:poll_question => @before_que}) %>");
<% elsif @before_que.question_type == 4%>
$("#show_poll_questions_<%= @before_que.id %>").html("<%= escape_javascript(render :partial => 'show_mulit', :locals => {:poll_question => @before_que}) %>");
<% end%>
<% elsif @after_que %>
$("#poll_questions_<%= @poll_question.id%>").insertAfter($("#poll_questions_<%= @after_que.id%>"));
$("#poll_question_number_<%=@after_que.id %>").html("<%=@after_que.question_number %>");
<% if @after_que.question_type == 1%>
$("#show_poll_questions_<%= @after_que.id %>").html("<%= escape_javascript(render :partial => 'show_MC', :locals => {:poll_question => @after_que}) %>");
<% elsif @after_que.question_type == 2%>
$("#show_poll_questions_<%= @after_que.id %>").html("<%= escape_javascript(render :partial => 'show_MCQ', :locals => {:poll_question => @after_que}) %>");
<% elsif @after_que.question_type == 3%>
$("#show_poll_questions_<%= @after_que.id %>").html("<%= escape_javascript(render :partial => 'show_single', :locals => {:poll_question => @after_que}) %>");
<% elsif @after_que.question_type == 4%>
$("#show_poll_questions_<%= @after_que.id %>").html("<%= escape_javascript(render :partial => 'show_mulit', :locals => {:poll_question => @after_que}) %>");
<% end%>
<% end %>
<% if @poll_question.question_type == 1%>
$("#show_poll_questions_<%= @poll_question.id %>").html("<%= escape_javascript(render :partial => 'show_MC', :locals => {:poll_question => @poll_question}) %>");
<% elsif @poll_question.question_type == 2%>
$("#show_poll_questions_<%= @poll_question.id %>").html("<%= escape_javascript(render :partial => 'show_MCQ', :locals => {:poll_question => @poll_question}) %>");
<% elsif @poll_question.question_type == 3%>
$("#show_poll_questions_<%= @poll_question.id %>").html("<%= escape_javascript(render :partial => 'show_single', :locals => {:poll_question => @poll_question}) %>");
<% elsif @poll_question.question_type == 4%>
$("#show_poll_questions_<%= @poll_question.id %>").html("<%= escape_javascript(render :partial => 'show_mulit', :locals => {:poll_question => @poll_question}) %>");
<% end%>

View File

@ -79,9 +79,7 @@
<script type="text/javascript">
$(".student_work_<%= st.id%>").mouseenter(function(){
if($("#about_hwork_<%= st.id%>").html().trim() == "") {
$("#work_click_<%= st.id%>").show();
}
$("#work_click_<%= st.id%>").show();
}).mouseleave(function(){
$("#work_click_<%= st.id%>").hide();
}).mouse;

View File

@ -9,7 +9,7 @@
<%= render :partial => 'work_attachments_status', :locals => {:attachments => work.attachments.where("attachtype = 7"), :status => 2} %>
<span class="tit_fb">追加时间:</span><%=format_time revise_attachment.created_on.to_s %>&nbsp;&nbsp;(<%=revise_attachment_status @homework,revise_attachment %>)<br />
<% unless revise_attachment.description == "" %>
<span class="tit_fb">追加理由:</span><p class="showHworkP"><%=revise_attachment.description %></p>
<span class="tit_fb break_word">追加理由:</span><p class="showHworkP"><%=revise_attachment.description %></p>
<% end %>
</div>
<div class="cl"></div>
@ -24,7 +24,7 @@
<%= render :partial => 'work_attachments_status', :locals => {:attachments => work.attachments.where("attachtype = 7"), :status => 1} %>
<span class="tit_fb">追加时间:</span><%=format_time revise_attachment.created_on.to_s %><br />
<% unless revise_attachment.description == "" %>
<span class="tit_fb">追加理由:</span><p class="showHworkP"><%=revise_attachment.description %></p>
<span class="tit_fb break_word">追加理由:</span><p class="showHworkP"><%=revise_attachment.description %></p>
<% end %>
</div>
<% end %>

View File

@ -2,7 +2,7 @@
<span class="c_dark f14 fb fl mr15">
作品
<font class="f12 c_red">
(<span id="student_work_count"><%= @student_work_count%></span>人已交)
(<span id="student_work_count"><%= @student_work_count%></span><%=@homework.homework_type == 3 ? '组' : '' %>已交)
</font>
<%# my_work = @homework.student_works.where("user_id = #{User.current.id}").first %>
<% my_work = cur_user_works_for_homework @homework %>

View File

@ -1,7 +1,7 @@
<div class="project_r_h02">
<div class="project_r_h02" style="width: 980px;">
<h2 class="project_h2">新建课程</h2>
</div>
<div class="hwork_new">
<div class="hwork_new pr">
<ul>
<%= labelled_form_for @syllabus do |f| %>
<li class="ml45">
@ -11,19 +11,25 @@
</li>
<div class="cl"></div>
<li class="ml125 fontGrey3"><span class="success-icon mr25">正确示例:软件工程</span><span class="error-icon">错误示例2016软件工程</span></li>
<li class="ml125 mt10 mb10 fontGrey2">课程是针对一个具体的学科方向开展的教学内容与进程安排。<br/>本质上,一门课程就是一个教学计划。</li>
<li class="ml45">
<li class="mt10 ml45">
<label><span class="c_white">*</span>&nbsp;<%= l(:label_tags_course_eng_name)%>&nbsp;&nbsp;</label>
<input type="text" name="eng_name" id="new_syllabus_eng_name" placeholder="例如Software Engineering" class="name_input" maxlength="100">
<!--<span class="c_red" id="new_course_class_period_notice" style="display: none;"></span>-->
</li>
<div class="cl"></div>
<li class=" ml55" >
<li class="mt10 ml55" >
<a href="javascript:void(0)" class="blue_btn fl c_white" onclick="submit_new_syllabus();" >提交</a>
<%= link_to "取消",user_activities_path(User.current.id),:class => "grey_btn fl c_white ml10"%>
<div class="cl"></div>
</li>
<% end%>
</ul>
<div class="ye_tips_box_inner" style="left: 570px; top: -5px; text-align: left;">
<em style="top: 9px;"></em>
<span style="top: 9px;"></span>
<p>
课程是针对一个具体的学科方向开展的教学内容与进程安排。<br/>本质上,一门课程就是一个教学计划。
</p>
</div>
</div><!--talknew end-->
<div class="cl"></div>

View File

@ -16,5 +16,14 @@
%>
<div class="cl"></div>
<p id="jour_content_span"></p>
<p id="e_tip" class="c_grey"></p>
<p id="e_tips" class="c_grey"></p>
</li>
<div class="cl"></div>
<script type="text/javascript">
$(function(){
setTimeout(function(){
elocalStorage(jour_content_editor,'user_newfeedback_<%=User.current.id %>_<%=@user.id %>');
}, 10000);
});
</script>

View File

@ -7,20 +7,20 @@
<% parents_rely = get_reply_parents_no_root parents_rely, comment %>
<% length = parents_rely.length %>
<div id="comment_reply_<%=comment.id %>">
<% if length <= 3 %>
<% if length <= 2 %>
<%=render :partial => 'users/journal_comment_reply', :locals => {:comment => comment.parent} %>
<% else %>
<div class="orig_cont clearfix">
<div class="orig_cont clearfix">
<div>
<%=render :partial => 'users/journal_comment_reply', :locals => {:comment => parents_rely[length - 1]} %>
</div>
<%=render :partial => 'users/comment_reply_detail', :locals => {:comment => parents_rely[length - 2]} %>
<!--<div>-->
<!--<%#=render :partial => 'users/journal_comment_reply', :locals => {:comment => parents_rely[length - 1]} %>-->
<!--</div>-->
<%=render :partial => 'users/comment_reply_detail', :locals => {:comment => parents_rely[length - 1]} %>
</div>
<div class="orig_cont_hide clearfix">
<span class="orig_icon" >&darr; </span>
<span class="orig_icon" style="display:none;" > &uarr;</span>
<%= link_to '点击展开隐藏楼层', show_all_replies_users_path(:comment => comment, :type => comment.class),:remote=>true %>
<span class="orig_icon" style="display:none;" > &uarr;</span><span class="">已经隐藏<%=(length - 2).to_s %>个楼层</span>
<%= link_to '[点击展开]', show_all_replies_users_path(:comment => comment, :type => comment.class),:remote=>true, :class => 'linkBlue2' %>
</div>
<%=render :partial => 'users/comment_reply_detail', :locals => {:comment => parents_rely[0]} %>
</div>

View File

@ -7,20 +7,20 @@
<% parents_rely = get_reply_parents parents_rely, comment %>
<% length = parents_rely.length %>
<div id="comment_reply_<%=comment.id %>">
<% if length <= 3 %>
<% if length <= 2 %>
<%=render :partial => 'users/comment_reply', :locals => {:comment => comment.parent} %>
<% else %>
<div class="orig_cont clearfix">
<div class="orig_cont clearfix">
<div>
<%=render :partial => 'users/comment_reply', :locals => {:comment => parents_rely[length - 1]} %>
</div>
<%=render :partial => 'users/comment_reply_detail', :locals => {:comment => parents_rely[length - 2]} %>
<!--<div>-->
<!--<%#=render :partial => 'users/comment_reply', :locals => {:comment => parents_rely[length - 1]} %>-->
<!--</div>-->
<%=render :partial => 'users/comment_reply_detail', :locals => {:comment => parents_rely[length - 1]} %>
</div>
<div class="orig_cont_hide clearfix">
<span class="orig_icon" >&darr; </span>
<span class="orig_icon" style="display:none;" > &uarr;</span>
<%= link_to '点击展开隐藏楼层', show_all_replies_users_path(:comment => comment, :type => comment.class),:remote=>true %>
<span class="orig_icon" style="display:none;" > &uarr;</span><span class="">已经隐藏<%=(length - 2).to_s %>个楼层</span>
<%= link_to '[点击展开]', show_all_replies_users_path(:comment => comment, :type => comment.class), :remote=>true, :class => 'linkBlue2' %>
</div>
<%=render :partial => 'users/comment_reply_detail', :locals => {:comment => parents_rely[0]} %>
</div>

View File

@ -89,9 +89,18 @@
<% end %>
<% end %>
<div class="cl"></div>
<div class="mt10" style="font-weight:normal;">
<%= render :partial=>"attachments/activity_attach", :locals=>{:activity => activity} %>
</div>
<% if activity.attachments.any? %>
<div id="div_issue_attachment_<%=user_activity_id %>" style="margin-top: -10px; margin-bottom: -20px;">
<div>
<a href="javascript:void(0)" class="link_img fl">
<!--显示附件、图片-->
<%= link_to_attachment_project activity,:deletable => false, :author => true, :thumbnails => false %>
</a><br/>
<%= call_hook(:view_issues_show_description_bottom, :issue => activity) %>
</div><!--pro_pic_box end-->
<div class="cl"></div>
</div>
<% end %>
</div>
<div class="cl"></div>
</div>

View File

@ -2020,6 +2020,7 @@ zh:
label_MCQ: 多选题
label_single: 单行主观
label_mulit: 多行主观
label_subjective: 主观题
label_enter_single_title: 请输入单选题标题
label_new_answer: 新建选项
label_poll_title: 问卷标题

View File

@ -269,7 +269,7 @@ RedmineApp::Application.routes.draw do
get 'close_poll'
get 'export_poll'
get 'import_poll'
post 'update_question_num'
end
collection do
delete 'delete_poll_question'

View File

@ -0,0 +1,6 @@
class AddColumnToPollQuestions < ActiveRecord::Migration
def change
add_column :poll_questions, :max_choices, :integer, :default => 0
add_column :poll_questions, :min_choices, :integer, :default => 0
end
end

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.3 KiB

After

Width:  |  Height:  |  Size: 4.0 KiB

View File

@ -1277,7 +1277,6 @@ function disable_down(source, des, hint){
des.attr("checked", false);
des.attr("disabled", true);
hint.html("(私有组织不允许游客下载资源)");
}
}
@ -1296,13 +1295,18 @@ function getRootPath(){
}
//自动保存草稿
var editor2;
function elocalStorage(editor,mdu){
function elocalStorage(editor,mdu,id){
if (window.sessionStorage){
editor2 = editor;
var oc = window.sessionStorage.getItem('content'+mdu);
if(oc !== null ){
var h = '您上次有已保存的数据,是否<a style="cursor: pointer;" onclick="rec_data(\'content\',\''+ mdu + '\')">恢复</a> ? / <a style="cursor: pointer;" onclick="clear_data(\'content\',\''+ mdu + '\')">不恢复</a>';
$('#e_tips').html(h);
if(arguments[2]){
var h = '您上次有已保存的数据,是否<a style="cursor: pointer;" onclick="rec_data(\'content\',\''+ mdu + '\',' + id + ')">恢复</a> ? / <a style="cursor: pointer;" onclick="clear_data(\'content\',\''+ mdu + '\',' + id + ')">不恢复</a>';
$("#e_tips_"+id).html(h);
}else{
var h = '您上次有已保存的数据,是否<a style="cursor: pointer;" onclick="rec_data(\'content\',\''+ mdu + '\')">恢复</a> ? / <a style="cursor: pointer;" onclick="clear_data(\'content\',\''+ mdu + '\')">不恢复</a>';
$("#e_tips").html(h);
}
}
setInterval(function() {
d = new Date();
@ -1315,8 +1319,10 @@ function elocalStorage(editor,mdu){
editor.sync();
if(!editor.isEmpty()){
add_data("content",mdu,editor.html());
$('#e_tip').html(" 数据已于 " + h + ':' + m + ':' + s +" 保存 ");
//$('#e_tips').html("");
var id1 = arguments[2] ? "#e_tip_"+id : "#e_tip";
var id2 = arguments[2] ? "#e_tips_"+id : "#e_tips";
$(id1).html(" 数据已于 " + h + ':' + m + ':' + s +" 保存 ");
$(id2).html("");
}
},10000);
@ -1327,18 +1333,20 @@ function elocalStorage(editor,mdu){
function add_data(k,mdu,d){
window.sessionStorage.setItem(k+mdu,d);
}
function rec_data(k,mdu){
function rec_data(k,mdu,id){
if(window.sessionStorage.getItem(k+mdu) !== null){
editor2.html(window.sessionStorage.getItem(k+mdu));
clear_data(k,mdu);
clear_data(k,mdu,id);
}
}
function clear_data(k,mdu){
function clear_data(k,mdu,id){
window.sessionStorage.removeItem(k+mdu);
var id1 = arguments[2] ? "#e_tip_"+id : "#e_tip";
var id2 = arguments[2] ? "#e_tips_"+id : "#e_tips";
if(k == 'content'){
$("#e_tips").html("");
$(id2).html("");
}else{
$("#e_tip").html("");
$(id1).html("");
}
}

View File

@ -1,3 +1,4 @@
var main_editor;
function init_editor(params){
// var minHeight; //最小高度
var paramsHeight = params.height; //设定的高度
@ -34,6 +35,7 @@ function init_editor(params){
}
}).loadPlugin('paste');
main_editor = editor;
return editor;
}

View File

@ -132,6 +132,7 @@ h4{ font-size:14px;}/*color:#3b3b3b;*/
.ml60{ margin-left:60px;}
.ml65{ margin-left:65px;}
.ml70{margin-left: 70px;}
.ml78{ margin-left:78px;}
.ml80{ margin-left:80px;}
.ml85{margin-left:85px;}
.ml90{ margin-left:90px;}
@ -164,7 +165,8 @@ h4{ font-size:14px;}/*color:#3b3b3b;*/
.mr60 {margin-right:60px;}
.mr65 {margin-right:65px;}
.mr70{margin-right: 70px;}
.mr100 {margin-right:100px;}
.mr95 {margin-right:95px !important;}
.mr100 {margin-right:100px !important;}
.mr118 {margin-right:118px !important;}
.mr130 {margin-right:130px;}
.mr150 {margin-right:150px;}
@ -236,6 +238,7 @@ h4{ font-size:14px;}/*color:#3b3b3b;*/
.w128{ width:128px;}
.w130{ width:130px;}
.w140{ width:140px;}
.w145{ width:145px;}
.w150{ width:150px;}
.w170{width:170px;}
.w180{width:180px;}
@ -249,7 +252,8 @@ h4{ font-size:14px;}/*color:#3b3b3b;*/
.w265{ width: 265px;}
.w270{ width: 270px;}
.w280{ width:280px;}
.w300{ width:300px;}
.w289{ width:289px !important;}
.w300{ width:300px !important;}
.w305{ width:305px;}
.w350 {width:350px;}
.w362 {width:362px;}
@ -286,6 +290,7 @@ h4{ font-size:14px;}/*color:#3b3b3b;*/
.w720{width:721px;}
.w730{width:730px;}
.w770{ width:770px;}
.h28{height: 28px;}
.h20{height: 20px;}
.h22{ height:22px;}
.h26{ height:26px;}

View File

@ -90,7 +90,7 @@ a:hover.tijiao{ background:#0f99a9;}
.hwork_new{ color:#4c4c4c;}
.hwork_input{ border:1px solid #64bdd9; height:22px; width:88%; background:#fff; margin-bottom:10px; padding:5px;}
.hwork_input02{ border:1px solid #64bdd9; height:15px; width:140px; background:#fff; margin-bottom:10px; padding:5px;}
.hwork_input02{ border:1px solid #ddd; height:15px; width:140px; background:#fff; margin-bottom:10px; padding:5px;}
.hwork_text{ border:1px solid #64bdd9; height:100px;width:555px; background:#fff; margin-left:5px; padding:5px; margin-bottom:10px;}
.hwork_new ul li{ }
.hwork_ttl{height:24px;}
@ -270,7 +270,7 @@ a.hworkSearchIcon:hover {background:url(../images/nav_icon.png) -49px -1px no-re
/* 创建课程courses*/
.courses_input{ border:1px solid #64bdd9; height:16px; width:532px; background:#fff; margin-bottom:10px; padding:5px;}
.courses_input{ border:1px solid #ddd; height:16px; width:532px; background:#fff; margin-bottom:10px; padding:5px;}
.courses_input_w{ width:300px;}
.courses_text{ border:1px solid #64bdd9; height:100px;width:532px; background:#fff; margin-left:5px; padding:5px; margin-bottom:10px;}
.upimg{ border:1px solid #eaeaea; display:block; width:60px; height:60px; padding:1px;}
@ -559,3 +559,25 @@ a:hover.blueCir{ background:#3598db; color:#fff;}
.new-question {width:324px; height:30px; color:#888; background-color:#fff; padding-left:5px; margin-left:46px; cursor:pointer;}
.new-subjective {width:550px; height:30px; color:#888; background-color:#fff; padding-left:5px; margin-left:96px; cursor:pointer;}
.questionnaire-input {height:30px; border:1px solid #cbcbcb; padding-left:5px;}
/*20161026问卷调查增加toolbar*/
.poll-container {width:718px; border:1px solid #ddd; margin-bottom:10px; background-color:#fff; position:relative; color:#767676; border:1px solid #ddd;}
.poll-tool-bar {width:50px; position:absolute; top:0; left:0; text-align:center;}
.poll-content {min-height:150px; margin-left:50px; padding:10px; border-left:1px solid #ddd;}
.poll-up{ background:url(/images/course/icons.png) 0px -479px no-repeat; width:16px; height:20px; display:block; margin-left:auto; margin-right:auto;}
.poll-up:hover{background:url(/images/course/icons.png) -23px -479px no-repeat;}
.poll-down{ background:url(/images/course/icons.png) 0px -502px no-repeat; width:16px; height:20px; display:block; margin-left:auto; margin-right:auto;}
.poll-down:hover{background:url(/images/course/icons.png) -23px -502px no-repeat;}
.poll-add{ background:url(/images/course/icons.png) 2px -317px no-repeat; width:16px; height:20px; display:block; margin-left:auto; margin-right:auto;}
.poll-add:hover{background:url(/images/course/icons.png) -18px -317px no-repeat;}
.poll-delete{ background:url(/images/course/icons.png) 3px -343px no-repeat; width:16px; height:20px; display:block; margin-left:auto; margin-right:auto;}
.poll-delete:hover{ background:url(/images/course/icons.png) -17px -343px no-repeat;}
.poll-edit{ background:url(/images/course/icons.png) 0px -272px no-repeat; width:16px; height:27px; display:block;float:right;}
.poll-edit:hover{ background:url(/images/course/icons.png) -21px -272px no-repeat;}
.poll-add-menu {border:1px solid #eaeaea; background:#fff; padding:5px 8px; width:50px; left:0px; top:20px; position:absolute; z-index:9999; line-height:2; box-shadow: 0px 2px 8px rgba(146, 153, 169, 0.5); display:none;}
.poll-multiple-limit {width:70px; outline: none;}
/*黄色边框的提示信息 */
.ye_tips_box_inner{ position: absolute;line-height: 1.5;padding: 5px 10px; white-space: nowrap; background-color: #FFFEF4; left:30px; top: -5px; border: solid 1px #F3DDB3;}
.ye_tips_box_inner span { display: block; border-width: 10px;position: absolute;top: 15px; left: -18px; border-style: dashed solid dashed dashed;border-color: transparent #FFFEF4 transparent transparent;font-size: 0;line-height: 0;}
.ye_tips_box_inner em { display: block; border-width: 10px;position: absolute;top: 42px; left: -20px; border-style: dashed solid dashed dashed;border-color: transparent #F3DDB3 transparent transparent;font-size: 0;line-height: 0;}

View File

@ -1398,7 +1398,7 @@ a:hover.comment_ding_link{ color:#269ac9;}
.orig_textarea{width:90%; margin-bottom:10px;}
.orig_sub{ float:right; background-color:#269ac9; color:#fff; height:25px; line-height:25px; text-align:center; width:80px; border:none;}
.orig_sub:hover{ background:#297fb8;}
.orig_cont_hide{ text-align:center; width:624px; display:block; font-size:14px; color:#333; border-bottom:1px solid #F3DDB3; padding:8px 0;}
.orig_cont_hide{ text-align:center; width:624px; display:block; font-size:14px; color:#333; border-bottom:1px solid #F3DDB3; padding:5px 0;}
.orig_icon{ color:#888; margin-right:10px; font-size:14px; font-weight:bold;}
.relateText {font-size:16px; color:#269ac9; line-height:16px; padding-top:20px; display:inline-block; font-weight: bold;}

View File

@ -73,7 +73,7 @@ a.syllabus_class_title{ font-size:14px; color:#333; max-width:480px; margin-bott
/*新建页面*/
.name_input{ border:1px solid #64bdd9; height:16px; width:310px; background:#fff; margin-bottom:10px; padding:5px;}
.name_input{ border:1px solid #ddd; height:16px; width:400px; background:#fff; margin-bottom:10px; padding:5px;}
.homepageSyllabusName {font-size:16px; color:#484848; float:left; max-width:120px;}
.syllabusTitleTextarea {resize:none; width:120px; margin-left: 10px; height:80px; max-width:120px; max-height:80px; border:1px solid #d9d9d9; outline:none; margin:0px 0px 12px 0px;}
@ -640,4 +640,5 @@ a:hover.sy_class_ltitle{ color:#333;}
.sy_tips_box:hover .sy_tips_box_inner{ display: block;}
.sy_tips_box_inner{ position: absolute;line-height: 2.0;padding: 5px 10px; white-space: nowrap; background-color: #fff; left:30px; top: -5px; box-shadow: 0px 2px 8px rgba(146, 153, 169, 0.5);}
.sy_tips_box_inner span { display: block; border-width: 10px;position: absolute;top: 15px; left: -18px; border-style: dashed solid dashed dashed;border-color: transparent #fff transparent transparent;font-size: 0;line-height: 0;}
.sy_tips_box_inner em { display: block; border-width: 11px;position: absolute;top: 42px; left: -23px; border-style: dashed solid dashed dashed;border-color: transparent #eaeaea transparent transparent;font-size: 0;line-height: 0;}