Merge branch 'develop' of https://bdgit.trustie.net/hushasha/bigdata into develop
This commit is contained in:
commit
d5fb001c1c
|
|
@ -536,6 +536,21 @@ class AccountController < ApplicationController
|
|||
redirect_to professional_certification_account_path
|
||||
end
|
||||
|
||||
# 修改资料时判断学号是否已使用
|
||||
def check_user_student_id
|
||||
data = {result:0, account:""}
|
||||
if params[:student_id] && params[:school_id]
|
||||
if UserExtensions.where("student_id = '#{params[:student_id]}' and school_id = #{params[:school_id]} and user_id != #{User.current.id}").count > 0
|
||||
user = User.where(:id => UserExtensions.where("student_id = '#{params[:student_id]}' and school_id = #{params[:school_id]} and user_id != #{User.current.id}").map(&:user_id)).first
|
||||
data[:account] = user.mail.blank? ? user.user_phone : user.user_mail
|
||||
else
|
||||
data[:result] = 1
|
||||
end
|
||||
end
|
||||
render :json => data
|
||||
end
|
||||
|
||||
# 实名认证时判断学号是否已使用
|
||||
def check_student_id
|
||||
data = {result:0, account:""}
|
||||
if params[:student_id] && params[:school_id]
|
||||
|
|
@ -555,6 +570,7 @@ class AccountController < ApplicationController
|
|||
render :json => data
|
||||
end
|
||||
|
||||
# 实名认证时判断证件号码是否已使用
|
||||
def check_id_number
|
||||
data = {result:0, account:""}
|
||||
if params[:id_number]
|
||||
|
|
|
|||
|
|
@ -89,7 +89,7 @@ class GamesController < ApplicationController
|
|||
# @praise 判断是否点赞
|
||||
# @tread 判断是否踩
|
||||
# git_repository_url @myshixun, "Myshixun"
|
||||
# @st 0 实践任务 1 多选任务 2 单选任务
|
||||
# @st 0 实践任务 1 选择题任务
|
||||
def show
|
||||
# 展示全部实训
|
||||
@is_subject = params[:is_subject]
|
||||
|
|
|
|||
|
|
@ -31,22 +31,22 @@ class HomeworkCommonController < ApplicationController
|
|||
end
|
||||
if @order.blank?
|
||||
if @is_teacher
|
||||
@homework_commons = @homework_commons.order("created_at desc")
|
||||
@homework_commons = @homework_commons.order("publish_time desc")
|
||||
else
|
||||
@homework_commons = @homework_commons.where("publish_time <= '#{Time.now}'").order("created_at desc")
|
||||
@homework_commons = @homework_commons.where("publish_time <= '#{Time.now}'").order("publish_time desc")
|
||||
end
|
||||
else
|
||||
case @order
|
||||
when '1'
|
||||
@homework_commons = @homework_commons.includes(:homework_detail_manual).where("homework_detail_manuals.comment_status = #{@order} and end_time > '#{Time.now}'").order("homework_commons.created_at desc")
|
||||
@homework_commons = @homework_commons.includes(:homework_detail_manual).where("homework_detail_manuals.comment_status = #{@order} and end_time > '#{Time.now}'").order("homework_commons.publish_time desc")
|
||||
when '3'
|
||||
@homework_commons = @homework_commons.includes(:homework_detail_manual).where("homework_detail_manuals.comment_status = #{@order} and homework_detail_manuals.evaluation_end > '#{Time.now}'").order("homework_commons.created_at desc")
|
||||
@homework_commons = @homework_commons.includes(:homework_detail_manual).where("homework_detail_manuals.comment_status = #{@order} and homework_detail_manuals.evaluation_end > '#{Time.now}'").order("homework_commons.publish_time desc")
|
||||
when '4'
|
||||
@homework_commons = @homework_commons.includes(:homework_detail_manual).where("(homework_detail_manuals.comment_status = #{@order} and homework_detail_manuals.appeal_time > '#{Time.now}')").order("homework_commons.created_at desc")
|
||||
@homework_commons = @homework_commons.includes(:homework_detail_manual).where("(homework_detail_manuals.comment_status = #{@order} and homework_detail_manuals.appeal_time > '#{Time.now}')").order("homework_commons.publish_time desc")
|
||||
when '5'
|
||||
@homework_commons = @homework_commons.includes(:homework_detail_manual).where("(homework_detail_manuals.comment_status = #{@order} and archive_time > '#{Time.now}')").order("homework_commons.created_at desc")
|
||||
@homework_commons = @homework_commons.includes(:homework_detail_manual).where("(homework_detail_manuals.comment_status = #{@order} and archive_time > '#{Time.now}')").order("homework_commons.publish_time desc")
|
||||
else
|
||||
@homework_commons = @homework_commons.includes(:homework_detail_manual).where("homework_detail_manuals.comment_status = #{@order}").order("homework_commons.created_at desc")
|
||||
@homework_commons = @homework_commons.includes(:homework_detail_manual).where("homework_detail_manuals.comment_status = #{@order}").order("homework_commons.publish_time desc")
|
||||
end
|
||||
end
|
||||
@is_student = User.current.logged? && (User.current.admin? || (User.current.member_of_course?(@course) && !@is_teacher))
|
||||
|
|
|
|||
|
|
@ -823,7 +823,7 @@ end
|
|||
@courselist= @courselist.where("name like '%#{search}%'")
|
||||
end
|
||||
end
|
||||
@courselist = @courselist.order("created_at #{@sx_order}")
|
||||
@courselist = @courselist.order("id #{@sx_order}")
|
||||
@courselist_count = @courselist.count
|
||||
limit = 20
|
||||
@is_remote = true
|
||||
|
|
|
|||
|
|
@ -4833,15 +4833,15 @@ def get_hw_index(hw,is_teacher,type=0)
|
|||
homework_commons = hw.course.homework_commons
|
||||
if is_teacher
|
||||
if type != 0
|
||||
homeworks = homework_commons.where("homework_commons.homework_type = #{type}").order("created_at asc")
|
||||
homeworks = homework_commons.where("homework_commons.homework_type = #{type}").order("publish_time desc")
|
||||
else
|
||||
homeworks = homework_commons.order("created_at asc")
|
||||
homeworks = homework_commons.order("publish_time desc")
|
||||
end
|
||||
else
|
||||
if type != 0
|
||||
homeworks = homework_commons.where("homework_commons.homework_type = #{type} and publish_time <= '#{Time.now}'").order("created_at asc")
|
||||
homeworks = homework_commons.where("homework_commons.homework_type = #{type} and publish_time <= '#{Time.now}'").order("publish_time desc")
|
||||
else
|
||||
homeworks = homework_commons.where("publish_time <= '#{Time.now}'").order("created_at asc")
|
||||
homeworks = homework_commons.where("publish_time <= '#{Time.now}'").order("publish_time desc")
|
||||
end
|
||||
end
|
||||
hw_ids = homeworks.map{|hw| hw.id} if !homeworks.blank?
|
||||
|
|
|
|||
|
|
@ -349,6 +349,7 @@
|
|||
var lens = contents.length;
|
||||
for(var i = 0; i < lens; i++){
|
||||
if($(contents[i]).val().trim() == ""){
|
||||
$(contents[i]).focus();
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
|
@ -358,6 +359,7 @@
|
|||
// 判断选择题选择答案的个数
|
||||
function judge_choice_answer(){
|
||||
var answer = document.getElementsByName("choice[answer][]");
|
||||
var contents = document.getElementsByName("question[cnt][]");
|
||||
var lens = answer.length;
|
||||
var num = 0;
|
||||
for(var i= 0; i < lens; i++){
|
||||
|
|
@ -365,6 +367,7 @@
|
|||
num += 1;
|
||||
}
|
||||
}
|
||||
$(contents[0]).focus();
|
||||
return num;
|
||||
}
|
||||
|
||||
|
|
@ -438,6 +441,7 @@
|
|||
if(st == "1"){
|
||||
if(judge_choice_contents()) {
|
||||
error.html("选项内容不能为空").show();
|
||||
|
||||
}else if(choice_num() < 2){
|
||||
error.html("单选题选项不能少于2个").show();
|
||||
}else if(judge_choice_answer() == 0){
|
||||
|
|
|
|||
|
|
@ -56,55 +56,9 @@
|
|||
<p class="fr">
|
||||
<span class="font-12 color-grey mb10" style="display: block;">温馨提示:[单选题]属于客观题将由系统自动评分,请设置标准答案</span>
|
||||
<a href="javascript:void(0)" class="fr task-btn task-btn-blue" onclick="edit_poll_question($(this),<%= exercise_question.id %>,1);">保存</a>
|
||||
<a href="javascript:void(0)" class="fr task-btn mr10" onclick="$(this).parent().parent().parent().parent().remove();">取消</a>
|
||||
<a href="javascript:void(0)" class="fr task-btn mr10" onclick="$('#edit_poll_questions_<%=exercise_question.id %>').hide();$('#show_poll_questions_<%=exercise_question.id %>').show();">取消</a>
|
||||
</p>
|
||||
</li>
|
||||
</div>
|
||||
</div>
|
||||
<% if false %>
|
||||
<div class="questionContainer" style="width: 680px;">
|
||||
<div class="mb10 ur_item">
|
||||
<label>分值<span class="ur_index"></span>: </label>
|
||||
<input id="poll_question_score_<%=exercise_question.id %>" value="<%=exercise_question.question_score %>" type="text" name="question_score" style="width:60px; text-align:center; padding-left:0px;">分
|
||||
<span class="fr c_red" style="width: 60px;" id="question_standard_answer_<%=exercise_question.id %>"><%=convert_to_char(exercise_question.exercise_standard_answers.first.exercise_choice_id.to_s) %></span>
|
||||
<span class="fr">标准答案:</span>
|
||||
<div class="cl"></div>
|
||||
</div>
|
||||
<div class="ur_editor_title">
|
||||
<label class="questionLabel mt8">问题: </label>
|
||||
<input name="question_type" value="<%=exercise_question.question_type %>" type="hidden">
|
||||
<textarea name="question_title" style="width: 625px;" 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>
|
||||
<div id="poll_answers_<%=exercise_question.id%>">
|
||||
<input style="display: none;" name="exercise_choice" id="exercise_choice_<%=exercise_question.id%>" value="<%= convert_to_char(exercise_question.exercise_standard_answers.first.exercise_choice_id.to_s) %>"/>
|
||||
<% exercise_question.exercise_choices.reorder("choice_position").each_with_index do |exercise_choice,index| %>
|
||||
<li class="ur_item new_answer">
|
||||
<a class="<%= (index + 1) == exercise_question.exercise_standard_answers.first.exercise_choice_id ? 'question_choice_blue' : 'question_choice_white' %> fl mr10 choice_btn" title="设为答案" href="javascript:void(0)" onclick="toggle_select($(this), 1, <%= exercise_question.id %>);"><%=convert_to_char (index+1).to_s %></a>
|
||||
<input maxlength="200" class="w600" type='text' name='question_answer[<%=exercise_choice.id %>]' placeholder='输入选项内容' value="<%=exercise_choice.choice_text %>">
|
||||
<a class="icon_remove" title="删除" onclick="remove_single_answer($(this))"></a>
|
||||
</li>
|
||||
<div class="cl"></div>
|
||||
<% end %>
|
||||
<li class="ur_item">
|
||||
<a class="question_choice_dash fl mr10 choice_btn"><%=convert_to_char (exercise_question.exercise_choices.count+1).to_s %></a>
|
||||
<div class="dash-block new-question w600" onclick='add_single_answer($(this), 1);'>新建选项</div>
|
||||
</li>
|
||||
<div class='cl'></div>
|
||||
</div>
|
||||
<div class="cl"></div>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
<div class="ur_editor_footer">
|
||||
<span class="fl c_red mt10">温馨提示:[单选题]属于客观题将由系统自动评分,请设置标准答案</span>
|
||||
<a class="big_blue_btn borderRadius fr" data-button="ok" onclick="edit_poll_question($(this),<%= exercise_question.id %>,1);">保存</a>
|
||||
<a class="big_grey_btn borderRadius fr mr10" data-button="cancel" onclick="resetQuestion<%=exercise_question.id%>();pollQuestionCancel(<%= exercise_question.id%>);">取消</a>
|
||||
</div>
|
||||
<div class="cl"></div>
|
||||
</div>
|
||||
<!--编辑单选 end-->
|
||||
<% end%>
|
||||
<% end%>
|
||||
|
|
@ -25,7 +25,6 @@
|
|||
<div class="clearfix">
|
||||
<p class="fl mt15 font-16 mb10">多选题</p>
|
||||
<input name="question_type" value="2" type="hidden">
|
||||
<input name="quest_id" id="quest_id" value="0" type="hidden">
|
||||
<label class="fr mt15">标准答案:<span class="color-orange current-option"id="question_standard_answer_<%=exercise_question.id %>"><%=convert_to_char(exercise_question.exercise_standard_answers.first.exercise_choice_id.to_s) %></span></label>
|
||||
<input style="display: none;" name="exercise_choice"/>
|
||||
</div>
|
||||
|
|
@ -62,57 +61,9 @@
|
|||
<p class="fr">
|
||||
<span class="font-12 color-grey mb10" style="display: block;">温馨提示:[多选题]属于客观题将由系统自动评分,请设置标准答案</span>
|
||||
<a href="javascript:void(0)" class="fr task-btn task-btn-blue" onclick="edit_poll_question($(this),<%= exercise_question.id %>,2);">保存</a>
|
||||
<a href="javascript:void(0)" class="fr task-btn mr10" onclick="$(this).parent().parent().parent().parent().remove();">取消</a>
|
||||
<a href="javascript:void(0)" class="fr task-btn mr10" onclick="$('#edit_poll_questions_<%=exercise_question.id %>').hide();$('#show_poll_questions_<%=exercise_question.id %>').show();">取消</a>
|
||||
</p>
|
||||
</li>
|
||||
</div>
|
||||
</div>
|
||||
<% if false %>
|
||||
<div class="questionContainer" style="width: 680px;">
|
||||
<div class="mb10 ur_item">
|
||||
<label>分值<span class="ur_index"></span>: </label>
|
||||
<input id="poll_question_score_<%=exercise_question.id %>" value="<%=exercise_question.question_score %>" type="text" name="question_score" style="width:60px; text-align:center; padding-left:0px;">分
|
||||
<span class="fr c_red" style="width: 60px;" id="question_standard_answer_<%=exercise_question.id %>"><%=convert_to_char(exercise_question.exercise_standard_answers.first.exercise_choice_id.to_s) %></span>
|
||||
<span class="fr">标准答案:</span>
|
||||
<div class="cl"></div>
|
||||
</div>
|
||||
<div class="ur_editor_title">
|
||||
<label class="questionLabel mt8">问题: </label>
|
||||
<input name="question_type" value="<%=exercise_question.question_type %>" type="hidden">
|
||||
<textarea name="question_title" style="width: 625px;" 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>
|
||||
<div id="poll_answers_<%=exercise_question.id%>">
|
||||
<input style="display: none;" name="exercise_choice" id="exercise_choice_<%=exercise_question.id%>" value="<%= convert_to_char(exercise_question.exercise_standard_answers.first.exercise_choice_id.to_s) %>"/>
|
||||
<% exercise_question.exercise_choices.reorder("choice_position").each_with_index do |exercise_choice,index| %>
|
||||
<li class="ur_item new_answer">
|
||||
<a class="<%= exercise_question.exercise_standard_answers.first.exercise_choice_id.to_s.include?((index+1).to_s) ? 'question_choice_blue' : 'question_choice_white' %> fl mr10 choice_btn" title="设为答案" href="javascript:void(0)" onclick="toggle_select($(this), 2, <%= exercise_question.id %>);"><%=convert_to_char (index+1).to_s %></a>
|
||||
<input maxlength="200" class="w600" type='text' name='question_answer[<%= exercise_choice.id %>]' placeholder='输入选项内容' value="<%=exercise_choice.choice_text %>">
|
||||
<a class="icon_remove" title="删除" onclick="remove_single_answer($(this))"></a>
|
||||
</li>
|
||||
<div class="cl"></div>
|
||||
<% end %>
|
||||
<li class="ur_item">
|
||||
<a class="question_choice_dash fl mr10 choice_btn"><%=convert_to_char (exercise_question.exercise_choices.count+1).to_s %></a>
|
||||
<div class="dash-block new-question w600" onclick='add_single_answer($(this), 2);'>新建选项</div>
|
||||
</li>
|
||||
<div class="cl"></div>
|
||||
</div>
|
||||
</ul>
|
||||
</div>
|
||||
<div class="ur_editor_footer">
|
||||
<span class="fl c_red mt10">温馨提示:[多选题]属于客观题将由系统自动评分,请设置标准答案</span>
|
||||
<a class="big_blue_btn borderRadius fr" data-button="ok" onclick="edit_poll_question($(this),<%= exercise_question.id %>,2);">
|
||||
保存
|
||||
</a>
|
||||
<a class="big_grey_btn borderRadius fr mr10" data-button="cancel" onclick="resetQuestion<%=exercise_question.id%>();pollQuestionCancel(<%= exercise_question.id%>);">
|
||||
<%= l(:button_cancel)%>
|
||||
</a>
|
||||
</div>
|
||||
<div class="cl"></div>
|
||||
</div>
|
||||
<!--编辑单选 end-->
|
||||
<% end %>
|
||||
<% end%>
|
||||
|
|
@ -10,7 +10,6 @@
|
|||
<div class="user_bg_shadow bor-grey-e pl15 pr30 mb20 answer_Temp" id="answer_Temp">
|
||||
<p class="fl mt15 font-16 mb10">简答题</p>
|
||||
<input name="question_type" value="4" type="hidden">
|
||||
<input name="quest_id" id="quest_id" value="0" type="hidden">
|
||||
<li class="clearfix pr mb20">
|
||||
<label class="panel-form-label fl"><span class="mr10">题目</span></label>
|
||||
<input name="question_type" value="<%=exercise_question.question_type %>" type="hidden">
|
||||
|
|
@ -28,40 +27,8 @@
|
|||
<span class="font-12 color-grey" style="display: block;">温馨提示:[简答题]属于主观题需要人工评分,未作答的情况下系统将自动评分</span>
|
||||
<span class="font-12 color-grey mb10 ml50" style="display: block;"> 参考答案仅作为人工评分的参考</span>
|
||||
<a href="javascript:void(0)" class="fr task-btn task-btn-blue" onclick="edit_poll_question($(this),<%= exercise_question.id %>,4);">保存</a>
|
||||
<a href="javascript:void(0)" class="fr task-btn mr10" onclick="$(this).parent().parent().parent().parent().remove();">取消</a>
|
||||
<a href="javascript:void(0)" class="fr task-btn mr10" onclick="$('#edit_poll_questions_<%=exercise_question.id %>').hide();$('#show_poll_questions_<%=exercise_question.id %>').show();">取消</a>
|
||||
</p>
|
||||
</li>
|
||||
</div>
|
||||
|
||||
<% if false %>
|
||||
<div class="questionContainer" style="width: 680px;">
|
||||
<div class="mb10 ur_item">
|
||||
<label class="ml25">分值<span class="ur_index"></span>: </label>
|
||||
<input id="poll_question_score_<%=exercise_question.id %>" value="<%=exercise_question.question_score %>" name="question_score" style="width:60px; text-align:center; padding-left:0px;">分
|
||||
<div class="cl"></div>
|
||||
</div>
|
||||
<div class="ur_editor_title">
|
||||
<label class="questionLabel mt8 ml25">问题: </label>
|
||||
<input name="question_type" value="<%=exercise_question.question_type %>" type="hidden">
|
||||
<textarea name="question_title" style="width: 600px;" id="poll_questions_title_<%=exercise_question.id %>" class="questionTitle" placeholder="请输入问答题的题干" onfocus="autoHeight('#poll_questions_title_<%=exercise_question.id %>',30)"><%=exercise_question.question_title %></textarea>
|
||||
</div>
|
||||
|
||||
<div class="ur_editor_content" id="edit_multi">
|
||||
<div id="poll_answers_<%=exercise_question.id%>" class="multi_input">
|
||||
<label name='candiate_items'>参考答案<span class="ur_index"></span>: </label>
|
||||
<textarea class="candiate_answer" style="width: 600px; height: 90px;" name="exercise_choice" id="poll_questions_answer_<%=exercise_question.id %>" placeholder="如有参考答案,请输入参考答案" type="text"><%=exercise_question.exercise_standard_answers.empty? ? '' : exercise_question.exercise_standard_answers.first.answer_text %></textarea>
|
||||
</div>
|
||||
<div class="cl"></div>
|
||||
</div>
|
||||
<div class="ur_editor_footer">
|
||||
<p class="fl c_red">温馨提示:[问答题]属于主观题需要人工评分,未作答的情况下系统将自动评零分<br><span class="ml60">参考答案作为人工评分时的参考</span></p>
|
||||
<a class="big_blue_btn borderRadius fr" data-button="ok" onclick="edit_poll_question($(this),<%= exercise_question.id %>,4);">保存</a>
|
||||
<a class="big_grey_btn borderRadius fr mr10" data-button="cancel" onclick="resetQuestion<%=exercise_question.id%>();pollQuestionCancel(<%= exercise_question.id%>);">
|
||||
<%= l(:button_cancel)%>
|
||||
</a>
|
||||
</div>
|
||||
<div class="cl"></div>
|
||||
</div>
|
||||
<!--编辑单选 end-->
|
||||
<% end%>
|
||||
<% end%>
|
||||
|
|
@ -24,7 +24,6 @@
|
|||
<p class="fl mt15 font-16 mb10">填空题</p>
|
||||
<li class="clearfix pr mb20">
|
||||
<input name="question_type" value="3" type="hidden">
|
||||
<input name="quest_id" id="quest_id" value="0" type="hidden">
|
||||
<label class="panel-form-label fl"><span class="mr10">题目</span></label>
|
||||
<input name="question_type" value="<%=exercise_question.question_type %>" type="hidden">
|
||||
<textarea maxlength="250" class="panel-form-width2-690 fl panel-box-sizing questionTitle" name="question_title" id="poll_questions_title_<%=exercise_question.id %>" placeholder="请输入填空题的题干(注意:目前仅支持一个空)" type="text" oninput="autoHeight('#poll_questions_title_<%=exercise_question.id %>',30)"><%=exercise_question.question_title %></textarea>
|
||||
|
|
@ -51,7 +50,7 @@
|
|||
<p class="fr">
|
||||
<span class="font-12 color-grey mb10" style="display: block;">温馨提示:[填空题]属于客观题将由系统自动评分,请设置标准答案</span>
|
||||
<a href="javascript:void(0)" class="fr task-btn task-btn-blue"onclick="edit_poll_question($(this),<%= exercise_question.id %>,3);">保存</a>
|
||||
<a href="javascript:void(0)" class="fr task-btn mr10" onclick="$(this).parent().parent().parent().parent().remove();">取消</a>
|
||||
<a href="javascript:void(0)" class="fr task-btn mr10" onclick="$('#edit_poll_questions_<%=exercise_question.id %>').hide();$('#show_poll_questions_<%=exercise_question.id %>').show();">取消</a>
|
||||
</p>
|
||||
</li>
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -15,8 +15,8 @@
|
|||
</div>
|
||||
<pre class="exercise_que_title pl15 mb10 pr15"><%= exercise_question.question_title %></pre>
|
||||
<div class="clearfix bor-top-greyE padding15 answer_con">
|
||||
<p>参考答案</p>
|
||||
<p style="text-align:justify;"><%= exercise_question.exercise_standard_answers.count > 0 ? exercise_question.exercise_standard_answers.first.answer_text : "无"%></p>
|
||||
<p>参考答案:</p>
|
||||
<pre class="exercise_que_title" style="text-align:justify;"><%= exercise_question.exercise_standard_answers.count > 0 ? exercise_question.exercise_standard_answers.first.answer_text : "无"%></pre>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
|
|
|||
|
|
@ -1,7 +1,10 @@
|
|||
<ul id="blacktab_nav">
|
||||
<li class="blacktab_con blacktab_hover">
|
||||
<li class="blacktab_con blacktab_hover" onclick="check_tab('blacktab_con','blacktab_hover',this);">
|
||||
<a href="javascript:void(0);" class="tab_type tab_color">测试结果</a>
|
||||
</li>
|
||||
<li class="blacktab_con" onclick="check_tab('blacktab_con','blacktab_hover',this);">
|
||||
<a href="javascript:void(0);" class="tab_type tab_color" >评测信息</a>
|
||||
</li>
|
||||
<a href="javascript:void(0);" onclick="valuation_extend_and_zoom();" id="valuation_extend_and_zoom"><i class="fa fa-expand font-16 color-grey fr mt10 mr15 fa-arrows-alt" ></i></a>
|
||||
<div class="cl"></div>
|
||||
</ul>
|
||||
|
|
@ -60,4 +63,33 @@
|
|||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div id="blacktab_con_2" class="undis" >
|
||||
<div class="fit -scroll">
|
||||
<div class="-layout-v -fit">
|
||||
<div class="-flex -scroll task-padding16 loading-center undis" id="info_ajax_loading"></div>
|
||||
<div class="-flex -scroll task-padding16" id="evaluating_info">
|
||||
<% unless @game.choose_correct_num == nil %>
|
||||
<% if @game.choose_correct_num != game_challenge.challenge_chooses.count %>
|
||||
<p class="-text-danger mb10">
|
||||
<i class="fa fa-exclamation-circle font-16" ></i><span class="ml5 mr5 -text-danger"><%= @game.choose_correct_num %>/<%= game_challenge.challenge_chooses.count %></span>共有<%= game_challenge.challenge_chooses.count %>题,其中有<%= game_challenge.challenge_chooses.count - @game.choose_correct_num %>题结果不匹配。
|
||||
</p>
|
||||
<% else %>
|
||||
<p class="color-light-green mb10">
|
||||
<i class="fa fa-check-circle font-16 " ></i><span class="ml5 mr5"><%= game_challenge.challenge_chooses.count %>/<%= game_challenge.challenge_chooses.count %></span> 全部通过
|
||||
</p>
|
||||
<% end %>
|
||||
<% end %>
|
||||
<div class="-task-ces-box mb10 clearfix">
|
||||
<div class="-task-ces-info">
|
||||
<ul>
|
||||
<li><span class="-task-ces-info-left ">选择题:</span><span class="color-light-green"><%= @game.choose_correct_num.nil? ? 0 : @game.choose_correct_num %>/<%= game_challenge.challenge_chooses.count %></span></li>
|
||||
<li><span class="-task-ces-info-left">经验值:</span><span class="color-light-green" id="experience_value">+ <%= @final_score %></span></li>
|
||||
<li><span class="-task-ces-info-left">金币:</span><span class="color-light-green" id="grade_value">+ <%= @final_score %></span></li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
|
@ -23,7 +23,7 @@
|
|||
<!--<td><%#= syllabus.syllabus_first_level_discipline == "" ? "--" : syllabus.syllabus_first_level_discipline %></td>-->
|
||||
<!--<td><%#= syllabus.syllabus_major == "" ? "--" : syllabus.syllabus_major %></td>-->
|
||||
<td class="edu-txt-left">
|
||||
<%= courselist.name %>
|
||||
<%= courselist.name %>
|
||||
</td>
|
||||
<td>
|
||||
<%= courselist.courses.count %>
|
||||
|
|
|
|||
|
|
@ -1,6 +1,5 @@
|
|||
<% content_for :header_tags do %>
|
||||
<%= import_ke(enable_at: false, prettify: false, init_activity: false) %>
|
||||
<% end %>
|
||||
<%= stylesheet_link_tag '/editormd/css/editormd' %>
|
||||
<%= javascript_include_tag '/editormd/editormd' %>
|
||||
<div class="active-class ">
|
||||
<p style="line-height: 42px;">
|
||||
<i class="fa fa-map-marker mr5 color-grey"></i>
|
||||
|
|
@ -9,40 +8,28 @@
|
|||
</p>
|
||||
<div class="box_bg_shandow bor-grey-e mb30">
|
||||
<div class="edu-con-top ">
|
||||
<span class="ml15 color-grey font-16">编辑实训路径</span>
|
||||
</div>
|
||||
<span class="ml15 color-grey font-16">编辑实训路径</span>
|
||||
</div>
|
||||
<div class="edu-bg createmain mb20 pt30 ">
|
||||
<%= labelled_form_for @subject do |f| %>
|
||||
<li class="clearfix pt20">
|
||||
<label class="panel-form-label label fl"><span class="color-orange">*</span> 名称</label>
|
||||
<input type="text" name="subject[name]" value="<%= @subject.name %>" id="new_subject_name" class="task task-height-40 panel-box-sizing task-form-70 fl color-grey ml20" maxlength="100" placeholder="例如:Python程序设计-从入门到精通">
|
||||
<div class="cl"></div>
|
||||
<span class="color-orange ml20 fl none" style="margin-left: 12%;" id="new_subject_name_notice"><i class="fa fa-exclamation-circle mr5" ></i>请输入名称</span>
|
||||
</li>
|
||||
<!--<li class="clearfix pt20">-->
|
||||
<%= labelled_form_for @subject do |f| %>
|
||||
<li class="clearfix pt20">
|
||||
<label class="panel-form-label label fl"><span class="color-orange">*</span> 名称</label>
|
||||
<input type="text" name="subject[name]" value="<%= @subject.name %>" id="new_subject_name" class="task task-height-40 panel-box-sizing task-form-80 fl color-grey ml20" maxlength="100" placeholder="例如:Python程序设计-从入门到精通">
|
||||
<div class="cl"></div>
|
||||
<span class="color-orange ml20 fl none" style="margin-left: 12%;" id="new_subject_name_notice"><i class="fa fa-exclamation-circle mr5" ></i>请输入名称</span>
|
||||
</li>
|
||||
<!--<li class="clearfix pt20">-->
|
||||
<!--<label class="panel-form-label label fl"><span class="color-orange">*</span> 描述</label>-->
|
||||
<!--<input type="text" name="subject[introduction]" value="<%#= @subject.introduction %>" id="new_subject_intro" class="task task-height-40 panel-box-sizing task-form-80 fl color-grey ml20" maxlength="50" placeholder="一句话描述一下,吸引更多人学习吧(不超过50个字符)">-->
|
||||
<!--<div class="cl"></div>-->
|
||||
<!--<span class="color-orange ml20 fl none" style="margin-left: 12%;" id="new_subject_intro_notice"><i class="fa fa-exclamation-circle mr5" ></i>请输入描述</span>-->
|
||||
<!--</li>-->
|
||||
<!--</li>-->
|
||||
<li class="clearfix pt20">
|
||||
<label class="panel-form-label label fl mr20"><span class="color-orange">*</span>简介</label>
|
||||
<%= hidden_field_tag :asset_id, params[:asset_id], :required => false, :style => 'display:none' %>
|
||||
<textarea class="panel-form-width-690 panel-form-height-150 fl panel-box-sizing" style="display: none"></textarea>
|
||||
<%= f.kindeditor :description, :editor_id => 'subject_description_editor',
|
||||
:owner_id => @subject.nil? ? 0: @subject.id,
|
||||
:owner_type => OwnerTypeHelper::SUBJECT,
|
||||
:local_storage_mdu => "subject_description_#{User.current.id}_#{@subject.id}",
|
||||
:local_storage_id => "desc",
|
||||
:width => '80%',
|
||||
:height => 200,
|
||||
:minHeight=>200,
|
||||
:placeholder => "请在此输入实训路径的简介",
|
||||
:class => 'talk_text fl',
|
||||
:input_html => { :id => 'new_subject_description',
|
||||
:class => 'talk_text fl',
|
||||
:maxlength => 5000 }
|
||||
%>
|
||||
<div id="shixun_introduction" class="new_li fl">
|
||||
<textarea class="panel-form-width-690 panel-form-height-150 fl panel-box-sizing" name="subject[description]" style="display: none"><%= @subject.description %></textarea>
|
||||
</div>
|
||||
<div class="cl"></div>
|
||||
<p id="e_tip_desc" style="margin-left: 140px" class="c_grey"></p>
|
||||
<p id="e_tips_desc" style="margin-left: 140px" class="c_grey"></p>
|
||||
|
|
@ -50,32 +37,116 @@
|
|||
</li>
|
||||
<li class="clearfix pt20">
|
||||
<label class="panel-form-label label fl mr20"><span class="color-orange">*</span> 学习须知</label>
|
||||
<textarea class="panel-form-width-690 panel-form-height-150 fl panel-box-sizing" style="display: none"></textarea>
|
||||
<%= f.kindeditor :learning_notes, :editor_id => 'subject_learning_notes_editor',
|
||||
:owner_id => @subject.nil? ? 0: @subject.id,
|
||||
:owner_type => OwnerTypeHelper::SUBJECT,
|
||||
:local_storage_mdu => "subject_notes_#{User.current.id}_#{@subject.id}",
|
||||
:local_storage_id => "notes",
|
||||
:width => '80%',
|
||||
:height => 200,
|
||||
:minHeight=>200,
|
||||
:placeholder => "请在此输入实训路径的学习须知",
|
||||
:class => 'talk_text fl',
|
||||
:input_html => { :id => 'new_learning_notes',
|
||||
:class => 'talk_text fl',
|
||||
:maxlength => 5000 }
|
||||
%>
|
||||
<div id="shixun_propaedeutics" class="new_li fl">
|
||||
<textarea class="panel-form-width-690 panel-form-height-150 fl panel-box-sizing" name="subject[learning_notes]" style="display: none"><%= @subject.learning_notes %></textarea>
|
||||
</div>
|
||||
<div class="cl"></div>
|
||||
<p id="e_tip_notes" style="margin-left: 140px" class="c_grey"></p>
|
||||
<p id="e_tips_notes" style="margin-left: 140px" class="c_grey"></p>
|
||||
<span class="color-orange ml20 fl none" style="margin-left: 12%;" id="new_learning_notes_notice"><i class="fa fa-exclamation-circle mr5" ></i>请输入学习须知</span>
|
||||
</li>
|
||||
<li class="clearfix pt20 pb20">
|
||||
<label class="panel-form-label label fl"> </label>
|
||||
<%= link_to "取消", subject_path(@subject), :class => "task-btn fl mr10 ml20" %>
|
||||
<a href="javascript:void(0);" onclick="submit_edit_subject(<%= @subject.id %>);" class="task-btn task-btn-blue fl">保存</a>
|
||||
</li>
|
||||
<% end %>
|
||||
<li class="clearfix pt20 pb20">
|
||||
<label class="panel-form-label label fl"> </label>
|
||||
<%= link_to "取消", subject_path(@subject), :class => "task-btn fl mr10 ml20" %>
|
||||
<a href="javascript:void(0);" onclick="submit_edit_subject(<%= @subject.id %>);" class="task-btn task-btn-blue fl">保存</a>
|
||||
</li>
|
||||
<% end %>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<script>
|
||||
/* ------------------------------- 简介md ------------------------------*/
|
||||
var shixun_editormd = editormd("shixun_introduction", {
|
||||
width : "80%",
|
||||
height : 600,
|
||||
syncScrolling : "single",
|
||||
//你的lib目录的路径,我这边用JSP做测试的
|
||||
path : "/editormd/lib/",
|
||||
tex : true,
|
||||
toolbarIcons : function() {
|
||||
// Or return editormd.toolbarModes[name]; // full, simple, mini
|
||||
// Using "||" set icons align right.
|
||||
return ["bold", "italic", "|", "list-ul", "list-ol", "|", "code", "code-block", "|", "testIcon", "testIcon1", '|', "image", "table", '|', "watch", "clear" ]
|
||||
},
|
||||
|
||||
toolbarCustomIcons : {
|
||||
testIcon : "<a type=\"inline\" class=\"latex\" ><div class='zbg'></div></a>",
|
||||
testIcon1 : "<a type=\"latex\" class=\"latex\" ><div class='zbg_latex'></div></a>"
|
||||
},
|
||||
//这个配置在simple.html中并没有,但是为了能够提交表单,使用这个配置可以让构造出来的HTML代码直接在第二个隐藏的textarea域中,方便post提交表单。
|
||||
saveHTMLToTextarea : true,
|
||||
autoFocus: false,
|
||||
// 用于增加自定义工具栏的功能,可以直接插入HTML标签,不使用默认的元素创建图标
|
||||
dialogMaskOpacity : 0.6,
|
||||
placeholder: "请在此输入实训路径的简介",
|
||||
imageUpload : true,
|
||||
imageFormats : ["jpg", "jpeg", "gif", "png", "bmp", "webp", "JPG", "JPEG", "GIF", "PNG", "BMP", "WEBP"],
|
||||
imageUploadURL : "<%= upload_with_markdown_path(:container_id => @subject.id, :container_type => @subject.class) %>" //url
|
||||
});
|
||||
|
||||
/* --------------------------------- 学习须知 -------------------------------------- */
|
||||
var shixun_propaedeutics = editormd("shixun_propaedeutics", {
|
||||
width : "80%",
|
||||
height : 600,
|
||||
syncScrolling : "single",
|
||||
//你的lib目录的路径,我这边用JSP做测试的
|
||||
path : "/editormd/lib/",
|
||||
tex : true,
|
||||
toolbarIcons : function() {
|
||||
// Or return editormd.toolbarModes[name]; // full, simple, mini
|
||||
// Using "||" set icons align right.
|
||||
return ["bold", "italic", "|", "list-ul", "list-ol", "|", "code", "code-block", "|", "testIcon", "testIcon1", '|', "image", "table", '|', "watch", "clear" ]
|
||||
},
|
||||
toolbarCustomIcons : {
|
||||
testIcon : "<a type=\"inline\" class=\"latex\" ><div class='zbg'></div></a>",
|
||||
testIcon1 : "<a type=\"latex\" class=\"latex\" ><div class='zbg_latex'></div></a>"
|
||||
},
|
||||
//这个配置在simple.html中并没有,但是为了能够提交表单,使用这个配置可以让构造出来的HTML代码直接在第二个隐藏的textarea域中,方便post提交表单。
|
||||
saveHTMLToTextarea : true,
|
||||
autoFocus: false,
|
||||
// 用于增加自定义工具栏的功能,可以直接插入HTML标签,不使用默认的元素创建图标
|
||||
dialogMaskOpacity : 0.6,
|
||||
placeholder: "请在此输入实训路径的学习须知",
|
||||
imageUpload : true,
|
||||
imageFormats : ["jpg", "jpeg", "gif", "png", "bmp", "webp", "JPG", "JPEG", "GIF", "PNG", "BMP", "WEBP"],
|
||||
imageUploadURL : "<%= upload_with_markdown_path(:container_id => @subject.id, :container_type => @subject.class) %>" //url
|
||||
});
|
||||
window.onload = function(){
|
||||
console.log(shixun_editormd);
|
||||
|
||||
$("#shixun_introduction [type=\"latex\"]").bind("click", function(){
|
||||
shixun_editormd.cm.replaceSelection("```latex");
|
||||
shixun_editormd.cm.replaceSelection("\n");
|
||||
shixun_editormd.cm.replaceSelection("\n");
|
||||
shixun_editormd.cm.replaceSelection("```");
|
||||
var __Cursor = shixun_editormd.cm.getDoc().getCursor();
|
||||
shixun_editormd.cm.setCursor(__Cursor.line-1, 0);
|
||||
});
|
||||
|
||||
$("#shixun_propaedeutics [type=\"latex\"]").bind("click", function(){
|
||||
shixun_propaedeutics.cm.replaceSelection("```latex");
|
||||
shixun_propaedeutics.cm.replaceSelection("\n");
|
||||
shixun_propaedeutics.cm.replaceSelection("\n");
|
||||
shixun_propaedeutics.cm.replaceSelection("```");
|
||||
var __Cursor = shixun_propaedeutics.cm.getDoc().getCursor();
|
||||
shixun_propaedeutics.cm.setCursor(__Cursor.line-1, 0);
|
||||
});
|
||||
|
||||
$("#shixun_introduction [type=\"inline\"]").bind("click", function(){
|
||||
shixun_editormd.cm.replaceSelection("$$$$");
|
||||
var __Cursor = shixun_editormd.cm.getDoc().getCursor();
|
||||
shixun_editormd.cm.setCursor(__Cursor.line, __Cursor.ch-2);
|
||||
shixun_editormd.cm.focus();
|
||||
});
|
||||
|
||||
$("#shixun_propaedeutics [type=\"inline\"]").bind("click", function(){
|
||||
shixun_propaedeutics.cm.replaceSelection("$$$$");
|
||||
var __Cursor = shixun_propaedeutics.cm.getDoc().getCursor();
|
||||
shixun_propaedeutics.cm.setCursor(__Cursor.line, __Cursor.ch-2);
|
||||
shixun_propaedeutics.cm.focus();
|
||||
});
|
||||
$("[type=\"inline\"]").attr("title", "行内公式");
|
||||
$("[type=\"latex\"]").attr("title", "多行公式");
|
||||
|
||||
};
|
||||
</script>
|
||||
|
|
@ -1,6 +1,6 @@
|
|||
<% content_for :header_tags do %>
|
||||
<%= import_ke(enable_at: false, prettify: false, init_activity: false) %>
|
||||
<% end %>
|
||||
<%= stylesheet_link_tag '/editormd/css/editormd' %>
|
||||
<%= javascript_include_tag '/editormd/editormd' %>
|
||||
|
||||
<div class="active-class ">
|
||||
<p style="line-height: 42px;">
|
||||
<i class="fa fa-map-marker mr5 color-grey"></i>
|
||||
|
|
@ -9,81 +9,57 @@
|
|||
</p>
|
||||
<div class="box_bg_shandow bor-grey-e mb30">
|
||||
<div class="edu-con-top">
|
||||
<span class="ml15 color-grey3 font-16">新建实训路径</span>
|
||||
</div>
|
||||
<span class="ml15 color-grey3 font-16">新建实训路径</span>
|
||||
</div>
|
||||
<div class="edu-bg createmain mb20 pt30 ">
|
||||
<%= labelled_form_for @subject do |f| %>
|
||||
<li class="clearfix pt20">
|
||||
<label class="panel-form-label label fl"><span class="color-orange">*</span> 名称</label>
|
||||
<input type="text" name="subject[name]" id="new_subject_name" class="task task-height-40 panel-box-sizing task-form-80 fl color-grey ml20" maxlength="50" placeholder="例如:Python程序设计-从入门到精通">
|
||||
<div class="cl"></div>
|
||||
<span class="color-orange ml20 fl none" style="margin-left: 12%;" id="new_subject_name_notice"><i class="fa fa-exclamation-circle mr5" ></i>请输入名称</span>
|
||||
</li>
|
||||
<!--<li class="clearfix pt20">-->
|
||||
<%= labelled_form_for @subject do |f| %>
|
||||
<li class="clearfix pt20">
|
||||
<label class="panel-form-label label fl"><span class="color-orange">*</span> 名称</label>
|
||||
<input type="text" name="subject[name]" id="new_subject_name" class="task task-height-40 panel-box-sizing task-form-80 fl color-grey ml20" maxlength="50" placeholder="例如:Python程序设计-从入门到精通">
|
||||
<div class="cl"></div>
|
||||
<span class="color-orange ml20 fl none" style="margin-left: 12%;" id="new_subject_name_notice"><i class="fa fa-exclamation-circle mr5" ></i>请输入名称</span>
|
||||
</li>
|
||||
<!--<li class="clearfix pt20">-->
|
||||
<!--<label class="panel-form-label label fl"><span class="color-orange">*</span> 描述</label>-->
|
||||
<!--<input type="text" name="subject[introduction]" id="new_subject_intro" class="task task-height-40 panel-box-sizing task-form-80 fl color-grey ml20" maxlength="50" placeholder="一句话描述一下,吸引更多人学习吧(不超过50个字符)">-->
|
||||
<!--<div class="cl"></div>-->
|
||||
<!--<span class="color-orange ml20 fl none" style="margin-left: 12%;" id="new_subject_intro_notice"><i class="fa fa-exclamation-circle mr5" ></i>请输入描述</span>-->
|
||||
<!--</li>-->
|
||||
<li class="clearfix pt20">
|
||||
<label class="panel-form-label label fl mr20"><span class="color-orange">*</span>简介</label>
|
||||
<%= hidden_field_tag :asset_id, params[:asset_id], :required => false, :style => 'display:none' %>
|
||||
<textarea class="panel-form-width-690 panel-form-height-150 fl panel-box-sizing" style="display: none"></textarea>
|
||||
<%= f.kindeditor :description, :editor_id => 'subject_description_editor',
|
||||
:owner_id => @subject.nil? ? 0: @subject.id,
|
||||
:owner_type => OwnerTypeHelper::SUBJECT,
|
||||
:local_storage_mdu => "subject_description_#{User.current.id}",
|
||||
:local_storage_id => "desc",
|
||||
:width => '80%',
|
||||
:height => 200,
|
||||
:minHeight=>200,
|
||||
:placeholder => "请在此输入实训路径的简介",
|
||||
:class => 'talk_text fl',
|
||||
:input_html => { :id => 'new_subject_description',
|
||||
:class => 'talk_text fl',
|
||||
:maxlength => 5000 }
|
||||
%>
|
||||
<div class="cl"></div>
|
||||
<p id="e_tip_desc" style="margin-left: 140px" class="c_grey"></p>
|
||||
<p id="e_tips_desc" style="margin-left: 140px" class="c_grey"></p>
|
||||
<span class="color-orange ml20 fl none" style="margin-left: 12%;" id="new_subject_description_notice"><i class="fa fa-exclamation-circle mr5" ></i>请输入简介</span>
|
||||
</li>
|
||||
<li class="clearfix pt20">
|
||||
<label class="panel-form-label label fl mr20"><span class="color-orange">*</span> 学习须知</label>
|
||||
<textarea class="panel-form-width-690 panel-form-height-150 fl panel-box-sizing" style="display: none"></textarea>
|
||||
<%= f.kindeditor :learning_notes, :editor_id => 'subject_learning_notes_editor',
|
||||
:owner_id => @subject.nil? ? 0: @subject.id,
|
||||
:owner_type => OwnerTypeHelper::SUBJECT,
|
||||
:local_storage_mdu => "subject_notes_#{User.current.id}",
|
||||
:local_storage_id => "notes",
|
||||
:width => '80%',
|
||||
:height => 200,
|
||||
:minHeight=>200,
|
||||
:placeholder => "请在此输入实训路径的学习须知",
|
||||
:class => 'talk_text fl',
|
||||
:input_html => { :id => 'new_learning_notes',
|
||||
:class => 'talk_text fl',
|
||||
:maxlength => 5000 }
|
||||
%>
|
||||
<!--textarea type="text" name="subject[learning_notes]" id="new_learning_notes" class="task task-height-220 panel-box-sizing task-form-70 fl color-grey ml20" placeholder=""></textarea>-->
|
||||
<div class="cl"></div>
|
||||
<p id="e_tip_notes" style="margin-left: 140px" class="c_grey"></p>
|
||||
<p id="e_tips_notes" style="margin-left: 140px" class="c_grey"></p>
|
||||
<span class="color-orange ml20 fl none" style="margin-left: 12%;" id="new_learning_notes_notice"><i class="fa fa-exclamation-circle mr5" ></i>请输入学习须知</span>
|
||||
</li>
|
||||
<!--<li class="clearfix pt20">
|
||||
<label class="panel-form-label label fl"><span class="color-orange">*</span> 学习须知</label>
|
||||
<textarea name="subject[base]" placeholder="例如:了解Python的基础知识" class="task task-height-220 panel-box-sizing task-form-80 fl color-grey ml20"></textarea>
|
||||
</li>-->
|
||||
<li class="clearfix pt20 pb20">
|
||||
<label class="panel-form-label label fl"> </label>
|
||||
<%= link_to "取消", subjects_path(), :class => "task-btn fl mr10 ml20" %>
|
||||
<a href="javascript:void(0);" onclick="submit_new_subject();" class="task-btn task-btn-blue fl">保存</a>
|
||||
</li>
|
||||
<% end %>
|
||||
</div>
|
||||
</div>
|
||||
<!--</li>-->
|
||||
<li class="clearfix pt20">
|
||||
<label class="panel-form-label label fl mr20"><span class="color-orange">*</span>简介</label>
|
||||
<%= hidden_field_tag :asset_id, params[:asset_id], :required => false, :style => 'display:none' %>
|
||||
<div id="shixun_introduction" class="new_li fl">
|
||||
<textarea class="panel-form-width-690 panel-form-height-150 fl panel-box-sizing" name="subject[description]" style="display: none"></textarea>
|
||||
</div>
|
||||
<div class="cl"></div>
|
||||
<p id="e_tip_desc" style="margin-left: 140px" class="c_grey"></p>
|
||||
<p id="e_tips_desc" style="margin-left: 140px" class="c_grey"></p>
|
||||
<span class="color-orange ml20 fl none" style="margin-left: 12%;" id="new_subject_description_notice"><i class="fa fa-exclamation-circle mr5" ></i>请输入简介</span>
|
||||
</li>
|
||||
<li class="clearfix pt20">
|
||||
<label class="panel-form-label label fl mr20"><span class="color-orange">*</span> 学习须知</label>
|
||||
<div id="shixun_propaedeutics" class="new_li fl">
|
||||
<textarea class="panel-form-width-690 panel-form-height-150 fl panel-box-sizing" name="subject[learning_notes]" style="display: none"></textarea>
|
||||
</div>
|
||||
<!--textarea type="text" name="subject[learning_notes]" id="new_learning_notes" class="task task-height-220 panel-box-sizing task-form-70 fl color-grey ml20" placeholder=""></textarea>-->
|
||||
<div class="cl"></div>
|
||||
<p id="e_tip_notes" style="margin-left: 140px" class="c_grey"></p>
|
||||
<p id="e_tips_notes" style="margin-left: 140px" class="c_grey"></p>
|
||||
<span class="color-orange ml20 fl none" style="margin-left: 12%;" id="new_learning_notes_notice"><i class="fa fa-exclamation-circle mr5" ></i>请输入学习须知</span>
|
||||
</li>
|
||||
<!--<li class="clearfix pt20">
|
||||
<label class="panel-form-label label fl"><span class="color-orange">*</span> 学习须知</label>
|
||||
<textarea name="subject[base]" placeholder="例如:了解Python的基础知识" class="task task-height-220 panel-box-sizing task-form-80 fl color-grey ml20"></textarea>
|
||||
</li>-->
|
||||
<li class="clearfix pt20 pb20">
|
||||
<label class="panel-form-label label fl"> </label>
|
||||
<%= link_to "取消", subjects_path(), :class => "task-btn fl mr10 ml20" %>
|
||||
<a href="javascript:void(0);" onclick="submit_new_subject();" class="task-btn task-btn-blue fl">保存</a>
|
||||
</li>
|
||||
<% end %>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<script>
|
||||
function rec_data(k,mdu,id){
|
||||
|
|
@ -96,4 +72,98 @@
|
|||
clear_data(k,mdu,id);
|
||||
}
|
||||
}
|
||||
</script>
|
||||
/* ------------------------------- 简介md ------------------------------*/
|
||||
var shixun_editormd = editormd("shixun_introduction", {
|
||||
width : "80%",
|
||||
height : 600,
|
||||
syncScrolling : "single",
|
||||
//你的lib目录的路径,我这边用JSP做测试的
|
||||
path : "/editormd/lib/",
|
||||
tex : true,
|
||||
toolbarIcons : function() {
|
||||
// Or return editormd.toolbarModes[name]; // full, simple, mini
|
||||
// Using "||" set icons align right.
|
||||
return ["bold", "italic", "|", "list-ul", "list-ol", "|", "code", "code-block", "|", "testIcon", "testIcon1", '|', "image", "table", '|', "watch", "clear" ]
|
||||
},
|
||||
|
||||
toolbarCustomIcons : {
|
||||
testIcon : "<a type=\"inline\" class=\"latex\" ><div class='zbg'></div></a>",
|
||||
testIcon1 : "<a type=\"latex\" class=\"latex\" ><div class='zbg_latex'></div></a>"
|
||||
},
|
||||
//这个配置在simple.html中并没有,但是为了能够提交表单,使用这个配置可以让构造出来的HTML代码直接在第二个隐藏的textarea域中,方便post提交表单。
|
||||
saveHTMLToTextarea : true,
|
||||
autoFocus: false,
|
||||
// 用于增加自定义工具栏的功能,可以直接插入HTML标签,不使用默认的元素创建图标
|
||||
dialogMaskOpacity : 0.6,
|
||||
placeholder: "请在此输入实训路径的简介",
|
||||
imageUpload : true,
|
||||
imageFormats : ["jpg", "jpeg", "gif", "png", "bmp", "webp", "JPG", "JPEG", "GIF", "PNG", "BMP", "WEBP"],
|
||||
imageUploadURL : "<%= upload_with_markdown_path(:container_id => @subject.id, :container_type => @subject.class) %>" //url
|
||||
});
|
||||
|
||||
/* --------------------------------- 学习须知 -------------------------------------- */
|
||||
var shixun_propaedeutics = editormd("shixun_propaedeutics", {
|
||||
width : "80%",
|
||||
height : 600,
|
||||
syncScrolling : "single",
|
||||
//你的lib目录的路径,我这边用JSP做测试的
|
||||
path : "/editormd/lib/",
|
||||
tex : true,
|
||||
toolbarIcons : function() {
|
||||
// Or return editormd.toolbarModes[name]; // full, simple, mini
|
||||
// Using "||" set icons align right.
|
||||
return ["bold", "italic", "|", "list-ul", "list-ol", "|", "code", "code-block", "|", "testIcon", "testIcon1", '|', "image", "table", '|', "watch", "clear" ]
|
||||
},
|
||||
toolbarCustomIcons : {
|
||||
testIcon : "<a type=\"inline\" class=\"latex\" ><div class='zbg'></div></a>",
|
||||
testIcon1 : "<a type=\"latex\" class=\"latex\" ><div class='zbg_latex'></div></a>"
|
||||
},
|
||||
//这个配置在simple.html中并没有,但是为了能够提交表单,使用这个配置可以让构造出来的HTML代码直接在第二个隐藏的textarea域中,方便post提交表单。
|
||||
saveHTMLToTextarea : true,
|
||||
autoFocus: false,
|
||||
// 用于增加自定义工具栏的功能,可以直接插入HTML标签,不使用默认的元素创建图标
|
||||
dialogMaskOpacity : 0.6,
|
||||
placeholder: "请在此输入实训路径的学习须知",
|
||||
imageUpload : true,
|
||||
imageFormats : ["jpg", "jpeg", "gif", "png", "bmp", "webp", "JPG", "JPEG", "GIF", "PNG", "BMP", "WEBP"],
|
||||
imageUploadURL : "<%= upload_with_markdown_path(:container_id => @subject.id, :container_type => @subject.class) %>" //url
|
||||
});
|
||||
window.onload = function(){
|
||||
console.log(shixun_editormd);
|
||||
|
||||
$("#shixun_introduction [type=\"latex\"]").bind("click", function(){
|
||||
shixun_editormd.cm.replaceSelection("```latex");
|
||||
shixun_editormd.cm.replaceSelection("\n");
|
||||
shixun_editormd.cm.replaceSelection("\n");
|
||||
shixun_editormd.cm.replaceSelection("```");
|
||||
var __Cursor = shixun_editormd.cm.getDoc().getCursor();
|
||||
shixun_editormd.cm.setCursor(__Cursor.line-1, 0);
|
||||
});
|
||||
|
||||
$("#shixun_propaedeutics [type=\"latex\"]").bind("click", function(){
|
||||
shixun_propaedeutics.cm.replaceSelection("```latex");
|
||||
shixun_propaedeutics.cm.replaceSelection("\n");
|
||||
shixun_propaedeutics.cm.replaceSelection("\n");
|
||||
shixun_propaedeutics.cm.replaceSelection("```");
|
||||
var __Cursor = shixun_propaedeutics.cm.getDoc().getCursor();
|
||||
shixun_propaedeutics.cm.setCursor(__Cursor.line-1, 0);
|
||||
});
|
||||
|
||||
$("#shixun_introduction [type=\"inline\"]").bind("click", function(){
|
||||
shixun_editormd.cm.replaceSelection("$$$$");
|
||||
var __Cursor = shixun_editormd.cm.getDoc().getCursor();
|
||||
shixun_editormd.cm.setCursor(__Cursor.line, __Cursor.ch-2);
|
||||
shixun_editormd.cm.focus();
|
||||
});
|
||||
|
||||
$("#shixun_propaedeutics [type=\"inline\"]").bind("click", function(){
|
||||
shixun_propaedeutics.cm.replaceSelection("$$$$");
|
||||
var __Cursor = shixun_propaedeutics.cm.getDoc().getCursor();
|
||||
shixun_propaedeutics.cm.setCursor(__Cursor.line, __Cursor.ch-2);
|
||||
shixun_propaedeutics.cm.focus();
|
||||
});
|
||||
$("[type=\"inline\"]").attr("title", "行内公式");
|
||||
$("[type=\"latex\"]").attr("title", "多行公式");
|
||||
|
||||
};
|
||||
</script>
|
||||
|
|
|
|||
|
|
@ -1,3 +1,6 @@
|
|||
<%= stylesheet_link_tag '/editormd/css/editormd','/editormd/css/editormd.min.css' %>
|
||||
<%= javascript_include_tag '/editormd/lib/marked.min.js','/editormd/lib/prettify.min.js','/editormd/lib/raphael.min.js','/editormd/lib/underscore.min.js','/editormd/lib/sequence-diagram.min.js',
|
||||
'/editormd/lib/flowchart.min.js','/editormd/lib/jquery.flowchart.min.js','/editormd/editormd.js'%>
|
||||
<div class="with75 fl pr15 mb20" style="box-sizing: border-box;width: 73%">
|
||||
<!--简介-->
|
||||
<% if !@subject.description.blank? || User.current.manager_of_subject?(@subject) %>
|
||||
|
|
@ -8,8 +11,10 @@
|
|||
<a href="<%= edit_subject_path(@subject) %>"><i class="fa fa-pencil fr mt10 mr5 color-grey-c edit-produce"data-tip-down="编辑"></i></a>
|
||||
<% end %>
|
||||
</p>
|
||||
<div class="color-grey3 <%= @subject.description.blank? ? 'color-light-grey' : '' %> justify">
|
||||
<pre class="pre_word font-15" style="font-family: '微软雅黑','宋体';"><%= @subject.description.blank? ? "暂未填写" : (@subject.description.html_safe) %></pre>
|
||||
<div class="color-grey3 <%= @subject.description.blank? ? 'color-light-grey' : '' %> ">
|
||||
<div id="shixuns_propaedeutics" class="new_li fl" style="margin-bottom: 20px;padding: 0px;text-align: justify;">
|
||||
<textarea name="subject[description]" style="display: none"><%= @subject.description.blank? ? "暂未填写" : (@subject.description) %></textarea>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<% end %>
|
||||
|
|
@ -142,7 +147,9 @@
|
|||
<a href="<%= edit_subject_path(@subject) %>"><i class="fa fa-pencil mt10 mr5 color-grey-c edit-produce font-12"data-tip-down="编辑" style="position: relative;top:-3px"></i></a>
|
||||
<% end %>
|
||||
</p>
|
||||
<div class="mt10 mb10 color-grey justify"><pre class="pre_word font-15" style="font-family: '微软雅黑','宋体';"><%= @subject.learning_notes.blank? ? "暂未填写" : @subject.learning_notes.html_safe %></pre></div>
|
||||
<div id="subject_learning_notes" class="new_li flmt10 mb10 color-grey" style="margin-bottom: 20px;padding: 0px;text-align: justify;">
|
||||
<textarea name="subject[learning_notes]" style="display: none"><%= @subject.learning_notes.blank? ? "暂未填写" : @subject.learning_notes %></textarea>
|
||||
</div>
|
||||
</div>
|
||||
<div class="edu-class-right-box ml15 bor-radius4 bor-grey01 pt20 mb40">
|
||||
<p class="font-18 mb20" style="text-align: center">教学团队
|
||||
|
|
@ -176,6 +183,22 @@
|
|||
</div>
|
||||
</div>
|
||||
<script>
|
||||
/* -------------- 简介Md -------------------- */
|
||||
var shixunPro = editormd.markdownToHTML("shixuns_propaedeutics", {
|
||||
htmlDecode: "style,script,iframe", // you can filter tags decode
|
||||
taskList: true,
|
||||
tex: true, // 默认不解析
|
||||
flowChart: true, // 默认不解析
|
||||
sequenceDiagram: true // 默认不解析
|
||||
});
|
||||
/* -------------- 简介Md -------------------- */
|
||||
var shixunPro = editormd.markdownToHTML("subject_learning_notes", {
|
||||
htmlDecode: "style,script,iframe", // you can filter tags decode
|
||||
taskList: true,
|
||||
tex: true, // 默认不解析
|
||||
flowChart: true, // 默认不解析
|
||||
sequenceDiagram: true // 默认不解析
|
||||
});
|
||||
var flag = true;
|
||||
$(function() {
|
||||
//初始化拖拽层
|
||||
|
|
|
|||
|
|
@ -832,6 +832,7 @@ RedmineApp::Application.routes.draw do
|
|||
match 'account/apply_auth', :to => 'account#apply_auth', :via => :post, :as => "apply_auth_account"
|
||||
match 'account/apply_pro_certification', :to => 'account#apply_pro_certification', :via => :post, :as => "apply_pro_certification_account"
|
||||
match 'account/check_student_id', :to => 'account#check_student_id', :via => :post
|
||||
match 'account/check_user_student_id', :to => 'account#check_user_student_id', :via => :post
|
||||
match 'account/cancel_pro_apply', :to => 'account#cancel_pro_apply', :via => :get, :as => "cancel_pro_apply_account"
|
||||
match 'account/check_id_number', :to => 'account#check_id_number', :via => :post
|
||||
match 'account/codepedia_login', :to => 'account#codepedia_login', :via => [:get, :post]
|
||||
|
|
|
|||
|
|
@ -0,0 +1,19 @@
|
|||
# encoding: utf-8
|
||||
class MigrateShixunMajorCourse < ActiveRecord::Migration
|
||||
def up
|
||||
c_courses = CourseList.where("name = 'C++程序设计' and id != 5")
|
||||
ShixunMajorCourse.where(:course_list_id => c_courses.map(&:id)).update_all(:course_list_id => 5)
|
||||
c_courses.destroy_all
|
||||
|
||||
c_courses = CourseList.where("id in (70, 86)")
|
||||
ShixunMajorCourse.where(:course_list_id => c_courses.map(&:id)).update_all(:course_list_id => 1)
|
||||
c_courses.destroy_all
|
||||
|
||||
c_courses = CourseList.where("id = 84")
|
||||
ShixunMajorCourse.where(:course_list_id => c_courses.map(&:id)).update_all(:course_list_id => 79)
|
||||
c_courses.destroy_all
|
||||
end
|
||||
|
||||
def down
|
||||
end
|
||||
end
|
||||
|
|
@ -246,7 +246,23 @@ function my_account_form_submit() {
|
|||
$("#school_name_hint").hide();
|
||||
}
|
||||
|
||||
$('#my_account_form').submit();
|
||||
if($("#user_student_id").parent().is(":visible") == true && $("#user_student_id").val() != ""){
|
||||
$.ajax({
|
||||
url: '/account/check_user_student_id',
|
||||
type: 'post',
|
||||
data: {student_id:$("#user_student_id").val(), school_id:$("input[name='occupation']").val()},
|
||||
success: function(data){
|
||||
if(data.result == 0){
|
||||
notice_box("该学号已被另一个账号(" + data.account + ")使用");
|
||||
}
|
||||
else if (data.result == 1){
|
||||
$('#my_account_form').submit();
|
||||
}
|
||||
}
|
||||
});
|
||||
} else{
|
||||
$('#my_account_form').submit();
|
||||
}
|
||||
}
|
||||
|
||||
//申请单位
|
||||
|
|
@ -728,7 +744,7 @@ function submit_pro_certification(){
|
|||
data: {student_id:$("#user_student_id").val(), school_id:$("input[name='occupation']").val()},
|
||||
success: function(data){
|
||||
if(data.result == 0){
|
||||
notice_box("该学号已被另一个账号用于(" + data.account + ")认证");
|
||||
notice_box("该学号已被另一个账号(" + data.account + ")用于认证");
|
||||
}
|
||||
else if (data.result == 1){
|
||||
$('#my_pro_certification_form').submit();
|
||||
|
|
@ -772,7 +788,7 @@ function submit_user_auth(){
|
|||
success: function(data){
|
||||
if(data.result == 0){
|
||||
$("#user_auth_submit_a").removeAttr("disabled");
|
||||
notice_box("该证件号码已被另一个账号用于(" + data.account + ")认证");
|
||||
notice_box("该证件号码已被另一个账号(" + data.account + ")用于认证");
|
||||
}
|
||||
else if (data.result == 1){
|
||||
$('#my_user_auth_form').submit();
|
||||
|
|
|
|||
|
|
@ -1199,21 +1199,19 @@ function submit_new_subject(){
|
|||
} else{
|
||||
$("#new_subject_name_notice").hide();
|
||||
}
|
||||
if(subject_description_editor.isEmpty()){
|
||||
if(shixun_editormd.getValue() == ""){
|
||||
check = false;
|
||||
$("#new_subject_description_notice").show();
|
||||
} else{
|
||||
$("#new_subject_description_notice").hide();
|
||||
}
|
||||
if(subject_learning_notes_editor.isEmpty()){
|
||||
if(shixun_propaedeutics.getValue() == ""){
|
||||
check = false;
|
||||
$("#new_learning_notes_notice").show();
|
||||
} else {
|
||||
$("#new_learning_notes_notice").hide();
|
||||
}
|
||||
if(check){
|
||||
subject_description_editor.sync();
|
||||
subject_learning_notes_editor.sync();
|
||||
$("#new_subject").submit();
|
||||
}
|
||||
}
|
||||
|
|
@ -1226,21 +1224,19 @@ function submit_edit_subject(id){
|
|||
} else{
|
||||
$("#new_subject_name_notice").hide();
|
||||
}
|
||||
if(subject_description_editor.isEmpty()){
|
||||
if(shixun_editormd.getValue() == ""){
|
||||
check = false;
|
||||
$("#new_subject_description_notice").show();
|
||||
} else{
|
||||
$("#new_subject_description_notice").hide();
|
||||
}
|
||||
if(subject_learning_notes_editor.isEmpty()){
|
||||
if(shixun_propaedeutics.getValue() == ""){
|
||||
check = false;
|
||||
$("#new_learning_notes_notice").show();
|
||||
} else {
|
||||
$("#new_learning_notes_notice").hide();
|
||||
}
|
||||
if(check){
|
||||
subject_description_editor.sync();
|
||||
subject_learning_notes_editor.sync();
|
||||
$("#edit_subject_"+id).submit();
|
||||
}
|
||||
}
|
||||
Loading…
Reference in New Issue