Merge branch 'develop' into dev_huang
This commit is contained in:
commit
ed1dd17ccb
|
|
@ -2,12 +2,12 @@
|
|||
class ChallengesController < ApplicationController
|
||||
layout "base_shixun"
|
||||
before_filter :check_authentication
|
||||
before_filter :find_shixun, :only => [:index, :new, :create, :destroy, :challenge_build]
|
||||
before_filter :find_challenge, :only => [:show, :edit, :update, :challenge_build, :index_up, :index_down, :destroy]
|
||||
before_filter :find_shixun, :only => [:index, :new, :create, :destroy, :challenge_build, :update_evaluation]
|
||||
before_filter :find_challenge, :only => [:show, :edit, :update, :challenge_build, :index_up, :index_down, :destroy, :update_evaluation]
|
||||
before_filter :build_challege_from_params, :only => [:new, :create]
|
||||
before_filter :tpi_manager_allowed, :only => [:challenge_build, :destroy, :edit, :new, :create]
|
||||
before_filter :allowed_view, :only => [:show]
|
||||
before_filter :query_challeges, :only => [:show, :edit, :update]
|
||||
before_filter :query_challeges, :only => [:show, :edit, :update, :update_evaluation]
|
||||
before_filter :find_shixun_language, :only => [:show, :new, :edit]
|
||||
|
||||
include ApplicationHelper
|
||||
|
|
@ -26,6 +26,13 @@ class ChallengesController < ApplicationController
|
|||
@challenge.position = challenge_count + 1
|
||||
@challenge.shixun = @shixun
|
||||
@challenge.user = User.current
|
||||
@challenge.save!
|
||||
|
||||
respond_to do |format|
|
||||
format.html {redirect_to edit_shixun_challenge_path(@challenge, :shixun_id => @shixun)}
|
||||
end
|
||||
|
||||
=begin
|
||||
ActiveRecord::Base.transaction do
|
||||
begin
|
||||
@challenge.save!
|
||||
|
|
@ -53,6 +60,7 @@ class ChallengesController < ApplicationController
|
|||
raise ActiveRecord::Rollback
|
||||
end
|
||||
end
|
||||
=end
|
||||
end
|
||||
|
||||
# 处理新建challenge返回的pipeline片段
|
||||
|
|
@ -84,6 +92,8 @@ class ChallengesController < ApplicationController
|
|||
end
|
||||
|
||||
def edit
|
||||
@tab = params[:tab].blank? ? 1 : params[:tab].to_i
|
||||
@editor = params[:editor] # 编辑模式
|
||||
end
|
||||
|
||||
def destroy
|
||||
|
|
@ -94,6 +104,9 @@ class ChallengesController < ApplicationController
|
|||
end
|
||||
|
||||
def update
|
||||
@challenge.update_attributes(params[:challenge])
|
||||
redirect_to edit_shixun_challenge_path(@challenge, :shixun_id => @shixun, :tab => params[:tab])
|
||||
=begin
|
||||
respond_to do |format|
|
||||
ActiveRecord::Base.transaction do
|
||||
@challenge.update_attributes(params[:challenge])
|
||||
|
|
@ -123,6 +136,40 @@ class ChallengesController < ApplicationController
|
|||
end
|
||||
end
|
||||
end
|
||||
=end
|
||||
end
|
||||
|
||||
def update_evaluation
|
||||
ActiveRecord::Base.transaction do
|
||||
@challenge.update_attributes(params[:challenge])
|
||||
begin
|
||||
if params[:tab].to_i == 2
|
||||
@test_sets.delete_all unless @test_sets.blank?
|
||||
if params[:test_set][:hidden].length > 0
|
||||
params[:test_set][:input].each_with_index do |input, index|
|
||||
unless (input[index] == params[:test_set][:output][index] && input[index].nil?)
|
||||
params[:test_set][:hidden][index].to_i == 0 ? open = 1 : open = 0
|
||||
TestSet.create(:challenge_id => @challenge.id, :input => input, :output => params[:test_set][:output][index], :is_public => open, :position => (index + 1))
|
||||
end
|
||||
end
|
||||
end
|
||||
elsif params[:tab].to_i == 5
|
||||
@challenge_tags.delete_all unless @challenge_tags.blank?
|
||||
unless params[:knowledge].blank?
|
||||
params[:knowledge][:input].each do |input|
|
||||
ChallengeTag.create(:name => input, :challenge_id => @challenge.id)
|
||||
end
|
||||
end
|
||||
end
|
||||
# 向jenkins端发送请求,构建公共测试用例
|
||||
add_shixun_modify_status(@shixun, 1)
|
||||
redirect_to edit_shixun_challenge_path(@challenge, :shixun_id => @shixun, :tab => params[:tab])
|
||||
rescue Exception => e
|
||||
flash[:error] = "#{e.message}"
|
||||
redirect_to edit_shixun_challenge_path(@challenge, :shixun_id => @shixun, :tab => params[:tab])
|
||||
raise ActiveRecord::Rollback
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
def index_down
|
||||
|
|
|
|||
|
|
@ -44,22 +44,29 @@ class CoursesController < ApplicationController
|
|||
@user = User.current
|
||||
@search = params[:search].nil? ? '' : params[:search]
|
||||
@select = params[:select].nil? ? '' : params[:select]
|
||||
# 全部课堂
|
||||
@is_end = params[:is_end].nil? ? 0 : params[:is_end].to_i #是否归档
|
||||
|
||||
@syllabuses_num = Course.where("is_end = 0 and is_delete = 0").count
|
||||
all_syllabuses = Course.where("is_end = 0 and is_delete = 0 and name like '%#{@search}%'").order("created_at desc")
|
||||
# 我参与的课堂
|
||||
join_syllabuses = @user.courses.where("is_end = 0 and is_delete = 0 and tea_id != #{@user.id} and name like '%#{@search}%'").order("created_at desc")
|
||||
#@syllabus_count = all_syllabuses.count
|
||||
# 我创建的课堂
|
||||
create_syllabuses = Course.where(:tea_id => @user.id).where("is_end = 0 and is_delete = 0 and name like '%#{@search}%'").order("created_at desc")
|
||||
@syllabus_count = all_syllabuses.count
|
||||
create_syllabuses = Course.where(:tea_id => @user.id).where("is_end = #{@is_end} and is_delete = 0 and name like '%#{@search}%'")
|
||||
# 我参与的课堂
|
||||
join_syllabuses = @user.courses.where("is_end = #{@is_end} and is_delete = 0 and tea_id != #{@user.id} and name like '%#{@search}%'")
|
||||
@join_syllabuses_count = join_syllabuses.count
|
||||
@create_syllabuses_count = create_syllabuses.count
|
||||
|
||||
# 页面筛选的课程
|
||||
if @select == "create"
|
||||
@syllabuses = create_syllabuses
|
||||
elsif @select == "join"
|
||||
@syllabuses = join_syllabuses
|
||||
elsif @select == "end"
|
||||
# 归档的课堂
|
||||
end_syllabuses = Course.where("is_end = #{@is_end} and name like '%#{@search}%'")
|
||||
@syllabuses = end_syllabuses
|
||||
else
|
||||
# 全部课堂
|
||||
all_syllabuses = Course.where("is_end = #{@is_end} and is_delete = 0 and name like '%#{@search}%'")
|
||||
@syllabuses = all_syllabuses
|
||||
end
|
||||
|
||||
|
|
|
|||
|
|
@ -200,8 +200,15 @@ class ShixunsController < ApplicationController
|
|||
shixun_ids = Myshixun.where(:user_id => User.current, :status => 1).map(&:shixun_id)
|
||||
@shixuns = @shixuns.where(:id => shixun_ids)
|
||||
end
|
||||
@shixuns = @shixuns.reorder(order_str)
|
||||
|
||||
if @order == "created_at"
|
||||
@shixuns =@shixuns.reorder(order_str)
|
||||
else
|
||||
# 最热排序
|
||||
@shixuns.each do |shixun|
|
||||
shixun[:myshixunCount] = shixun.myshixuns.count
|
||||
end
|
||||
@shixuns = @shixuns.sort{|x, y| y[:myshixunCount] <=> x[:myshixunCount]}
|
||||
end
|
||||
# @shixuns = Shixun.where(:authentication => 1).reorder(order)
|
||||
@shixuns_count = @shixuns.count
|
||||
@limit = 16
|
||||
|
|
@ -577,6 +584,7 @@ class ShixunsController < ApplicationController
|
|||
@myshixun = Myshixun.where(:id => params[:myshixun_id]).first
|
||||
@is_modify = ShixunModify.where(:myshixun_id => params[:myshixun_id], :shixun_id => @shixun.try(:id), :status => 1).first
|
||||
@mail = User.current.mail.blank?
|
||||
|
||||
end
|
||||
|
||||
private
|
||||
|
|
|
|||
|
|
@ -45,7 +45,7 @@ class UsersController < ApplicationController
|
|||
:user_courses4show,:user_projects4show,:user_contests4show,:user_course_activities,:user_project_activities,:user_feedback4show,:user_visitorlist,:user_messages,:edit_brief_introduction,
|
||||
:user_import_homeworks,:user_search_homeworks,:user_import_resource, :user_system_messages,:choose_user_course,:user_courselist,:user_projectlist,:sort_syllabus_list,
|
||||
:sort_project_list,:my_homeworks,:manage_or_receive_homeworks,:search_m_r_homeworks, :cancel_or_collect,:expand_courses,:homepage, :user_issues, :course_community, :project_community, :contest_community,
|
||||
:shixuns, :user_show_course_list]
|
||||
:shixuns, :user_show_course_list, :shixuns_or_courses_filter]
|
||||
before_filter :auth_user_extension, only: :show
|
||||
before_filter :show_system_message, :only => [:show]
|
||||
#before_filter :rest_user_score, only: :show
|
||||
|
|
@ -2030,6 +2030,7 @@ class UsersController < ApplicationController
|
|||
@user_fanlist_count = fan_query.count();
|
||||
@user_fanlist = fan_query.order("#{Watcher.table_name}.id desc").limit(12);
|
||||
|
||||
=begin
|
||||
# 合作者及创建者
|
||||
ids = Shixun.find_by_sql("select shixun_id from shixun_members where user_id=#{@user.id}")
|
||||
# 已挑战过
|
||||
|
|
@ -2038,12 +2039,13 @@ class UsersController < ApplicationController
|
|||
ids2 = ids2.map{|shixun| shixun.id} unless ids2.blank?
|
||||
id = ids + ids2
|
||||
id = id.uniq
|
||||
=end
|
||||
if @user == User.current
|
||||
@shixuns = Shixun.where(:id => id).order("created_at desc")
|
||||
@shixuns = Shixun.where(:user_id => @user).order("created_at desc")
|
||||
else
|
||||
@shixuns = Shixun.where(:status => [2, 3], :id => id).order("created_at desc")
|
||||
@shixuns = Shixun.where(:status => [2, 3], :id => @user).order("created_at desc")
|
||||
end
|
||||
@limit = 8
|
||||
@limit = 5
|
||||
@is_remote = true
|
||||
@shixuns_count = @shixuns.count
|
||||
@shixuns_pages = Paginator.new @shixuns_count, @limit, params['page'] || 1
|
||||
|
|
@ -2193,11 +2195,67 @@ class UsersController < ApplicationController
|
|||
end
|
||||
end
|
||||
|
||||
# @params: index表示 "实训" 或 "课程" 那个的筛选
|
||||
# filter 表示筛选的条件[challenge => "我挑战的", create => "我创建的", cooperative => "合作者"]
|
||||
def shixuns_or_courses_filter
|
||||
if params[:index] == "shixun"
|
||||
if params[:filter] == "challenge"
|
||||
# 已挑战过
|
||||
id = Shixun.find_by_sql("select id from shixuns where id in (select shixun_id from myshixuns where user_id = #{@user.id})")
|
||||
if @user == User.current
|
||||
@shixuns = Shixun.where(:id => id).order("created_at desc")
|
||||
else
|
||||
@shixuns = Shixun.where(:status => [2, 3], :id => id).order("created_at desc")
|
||||
end
|
||||
elsif params[:filter] == "create"
|
||||
if @user == User.current
|
||||
@shixuns = Shixun.where(:user_id => @user).order("created_at desc")
|
||||
else
|
||||
@shixuns = Shixun.where(:status => [2, 3], :id => @user).order("created_at desc")
|
||||
end
|
||||
elsif params[:filter] == "cooperative"
|
||||
# 合作者及创建者
|
||||
ids = Shixun.find_by_sql("select shixun_id from shixun_members where user_id=#{@user.id}")
|
||||
ids = ids.map{|shixun| shixun.shixun_id} unless ids.blank?
|
||||
# 我创建的id
|
||||
create_id = Shixun.where(:user_id => @user).pluck(:id)
|
||||
id = ids - create_id
|
||||
if @user == User.current
|
||||
@shixuns = Shixun.where(:id => id).order("created_at desc")
|
||||
else
|
||||
@shixuns = Shixun.where(:status => [2, 3], :id => id).order("created_at desc")
|
||||
end
|
||||
end
|
||||
@limit = 5
|
||||
@is_remote = true
|
||||
@shixuns_count = @shixuns.count
|
||||
@shixuns_pages = Paginator.new @shixuns_count, @limit, params['page'] || 1
|
||||
@offset ||= @shixuns_pages.offset
|
||||
@shixuns = paginateHelper @shixuns, @limit
|
||||
elsif params[:index] == "course"
|
||||
if params[:filter] == "manage"
|
||||
@courses = @user.courses.not_deleted_not_end.where(:tea_id => @user.id).order("updated_at desc")
|
||||
elsif params[:filter] == "join"
|
||||
@courses = @user.courses.not_deleted_not_end.where("tea_id != #{@user.id}").order("updated_at desc")
|
||||
end
|
||||
@limit = 5
|
||||
@is_remote = true
|
||||
@courses_count = @courses.count
|
||||
@courses_pages = Paginator.new @courses_count, @limit, params['page'] || 1
|
||||
@offset ||= @courses_pages.offset
|
||||
@courses = paginateHelper @courses, @limit
|
||||
end
|
||||
|
||||
respond_to do |format|
|
||||
format.js
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
def user_show_course_list
|
||||
@courses = @user.courses.not_deleted_not_end
|
||||
@courses = @user.courses.not_deleted_not_end.where(:tea_id => @user.id).order("updated_at desc")
|
||||
@courses_count = @courses.count
|
||||
@courses = @courses.select("courses.*,(SELECT MAX(updated_at) FROM `course_activities` WHERE course_activities.course_id = courses.id) AS updatetime").order("updatetime desc")
|
||||
@limit = 8
|
||||
@limit = 5
|
||||
@is_remote = true
|
||||
@courses_pages = Paginator.new @courses_count, @limit, params['page'] || 1
|
||||
@offset ||= @courses_pages.offset
|
||||
|
|
|
|||
|
|
@ -9,7 +9,7 @@ class Challenge < ActiveRecord::Base
|
|||
has_many :games, :dependent => :destroy
|
||||
|
||||
validates_presence_of :subject
|
||||
validates_presence_of :score
|
||||
# validates_presence_of :score
|
||||
validates_presence_of :task_pass
|
||||
validates_length_of :subject, :maximum => 255
|
||||
|
||||
|
|
|
|||
|
|
@ -58,9 +58,9 @@ class Myshixun < ActiveRecord::Base
|
|||
# 如果都完成,则当前任务为最后一个任务
|
||||
def current_task
|
||||
games = self.games
|
||||
current_game = games.select{|game| game.status==1 || game.status==0}.first
|
||||
current_game = games.select{|game| game.status == 1 || game.status == 0}.first
|
||||
if current_game.blank?
|
||||
passed_games = games.select{|game| game.status==2}
|
||||
passed_games = games.select{|game| game.status == 2}
|
||||
current_game = passed_games.first
|
||||
end
|
||||
return current_game
|
||||
|
|
|
|||
|
|
@ -0,0 +1,77 @@
|
|||
<%= stylesheet_link_tag '/editormd/css/editormd','/editormd/css/editormd.min.css' %>
|
||||
<%= javascript_include_tag '/editormd/editormd.min.js','/editormd/examples/js/jquery.min.js' %>
|
||||
<style>
|
||||
.CodeMirror-scroll{
|
||||
overflow: auto !important;
|
||||
margin-bottom: -30px;
|
||||
margin-right: -30px;
|
||||
padding-bottom: 30px;
|
||||
height: 100%;
|
||||
outline: none;
|
||||
position: relative;
|
||||
}
|
||||
</style>
|
||||
<div id="shixun_form">
|
||||
<li class="clearfix" style="line-height:1.9;">
|
||||
<label class=" panel-form-label fl"> 参考答案:</label>
|
||||
<div id="challenge_answer" class="new_li">
|
||||
<textarea name="challenge[answer]"><%= @challenge.answer %></textarea>
|
||||
</div>
|
||||
</li>
|
||||
<li class="clearfix">
|
||||
<a href="javascript:void(0);" class="task-btn task-btn-green fr" onclick="$('#challenge_shixun_answer_update').submit();">保存</a>
|
||||
<a href="javascript:void(0);" class="task-btn fr mr10" id="answer_cancel">取消</a>
|
||||
</li>
|
||||
</div>
|
||||
<script>
|
||||
answer_editormd = editormd("challenge_answer", {
|
||||
width : "89.6%",
|
||||
height : 600,
|
||||
syncScrolling : "single",
|
||||
//你的lib目录的路径,我这边用JSP做测试的
|
||||
path : "/editormd/lib/",
|
||||
tex : true,
|
||||
autoFocus: false,
|
||||
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,
|
||||
// 用于增加自定义工具栏的功能,可以直接插入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 => @shixun.id, :container_type => @shixun.class) %>"//url
|
||||
});
|
||||
window.onload = function(){
|
||||
$("#challenge_answer [type=\"latex\"]").bind("click", function(){
|
||||
answer_editormd.cm.replaceSelection("```latex");
|
||||
answer_editormd.cm.replaceSelection("\n");
|
||||
answer_editormd.cm.replaceSelection("\n");
|
||||
answer_editormd.cm.replaceSelection("```");
|
||||
var __Cursor = answer_editormd.cm.getDoc().getCursor();
|
||||
answer_editormd.cm.setCursor(__Cursor.line-1, 0);
|
||||
});
|
||||
|
||||
$("#challenge_answer [type=\"inline\"]").bind("click", function(){
|
||||
answer_editormd.cm.replaceSelection("$$$$");
|
||||
var __Cursor = answer_editormd.cm.getDoc().getCursor();
|
||||
answer_editormd.cm.setCursor(__Cursor.line, __Cursor.ch-2);
|
||||
answer_editormd.cm.focus();
|
||||
});
|
||||
$("[type=\"inline\"]").attr("title", "行内公式");
|
||||
$("[type=\"latex\"]").attr("title", "多行公式");
|
||||
|
||||
};
|
||||
$("#answer_cancel").click(function(){
|
||||
$("#answer_edit").hide();
|
||||
$("#edit_answer_show").show();
|
||||
})
|
||||
</script>
|
||||
|
|
@ -0,0 +1,41 @@
|
|||
<div class="panel-form">
|
||||
<% if @editor.blank? && @challenge.answer %>
|
||||
<div id="edit_answer_show">
|
||||
<div class="clearfix mb20">
|
||||
<p class="fr">
|
||||
<% if @shixun.status == 0 && User.current.manager_of_shixun?(@shixun) %>
|
||||
<a href="<%= edit_shixun_challenge_path(@challenge, :shixun_id => @shixun, :tab => 3, :editor => 3) %>" class="shixun-task-btn task-btn-green fr">编辑</a>
|
||||
<% end %>
|
||||
</p>
|
||||
</div>
|
||||
<ul>
|
||||
<li class="clearfix">
|
||||
<label class=" panel-form-label fl"> 参考答案:</label>
|
||||
<div class="fl task-bg-grey panel-box-sizing panel-form-width-690 new_li" id="tpm_answer_show" style="width: 90%">
|
||||
<textarea style="display:none;"><%= @challenge.answer.blank? ? "无" : (@challenge.answer) %></textarea>
|
||||
</div>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
<% end %>
|
||||
<% if @challenge.answer.blank? || !@editor.blank? %>
|
||||
<ul class="" id="answer_edit">
|
||||
<%= labelled_form_for @challenge, :url => shixun_challenge_path(@challenge, :shixun_id => @shixun, :tab => 3), :html => {:id => "challenge_shixun_answer_update"} do |f| %>
|
||||
<%= render :partial => "answer_form", :locals => {:f => f} %>
|
||||
<% end %>
|
||||
</ul>
|
||||
<% end %>
|
||||
</div>
|
||||
<script>
|
||||
$(document).ready(function() {
|
||||
editormd.loadKaTeX(function() {
|
||||
var answerMD = editormd.markdownToHTML("tpm_answer_show", {
|
||||
htmlDecode: "style,script,iframe", // you can filter tags decode
|
||||
taskList: true,
|
||||
tex: true, // 默认不解析
|
||||
flowChart: true, // 默认不解析
|
||||
sequenceDiagram: true // 默认不解析
|
||||
});
|
||||
});
|
||||
});
|
||||
</script>
|
||||
|
|
@ -0,0 +1,66 @@
|
|||
|
||||
<div class="panel-form">
|
||||
<div id="evaluating_show" class="<%= @challenge.evaluation_way == 0 ? "undis" : "" %>">
|
||||
<div class="clearfix mb20">
|
||||
<p class="fr">
|
||||
<% if @shixun.status == 0 && User.current.manager_of_shixun?(@shixun) %>
|
||||
<a href="javascript:void(0);" class="shixun-task-btn task-btn-green fr" id="edit_task_pass">编辑</a>
|
||||
<% end %>
|
||||
</p>
|
||||
</div>
|
||||
<ul>
|
||||
<li class="clearfix">
|
||||
<label class="panel-form-label fl">文件路径:</label>
|
||||
<div class="fl task-bg-grey panel-box-sizing panel-form-width-690">
|
||||
<%= @challenge.path.blank? ? "无" : (h @challenge.path.html_safe) %>
|
||||
</div>
|
||||
</li>
|
||||
<li class="clearfix">
|
||||
<label class="panel-form-label fl">执行文件:</label>
|
||||
<div class="fl task-bg-grey panel-box-sizing panel-form-width-690">
|
||||
<%= @challenge.exec_path.blank? ? "无" : (h @challenge.exec_path) %>
|
||||
</div>
|
||||
</li>
|
||||
<li class="clearfix">
|
||||
<label class="panel-form-label fl"><span class="c_red mr5">*</span>评测方式:</label>
|
||||
<div class="fl task-bg-grey panel-box-sizing panel-form-width-690">
|
||||
输入输出
|
||||
</div>
|
||||
</li>
|
||||
<li class="clearfix">
|
||||
<label class="panel-form-label fl">测试集设置:</label>
|
||||
<ul class="fl task-bg-grey panel-box-sizing panel-form-width-690">
|
||||
<% if @test_sets.count > 0 %>
|
||||
<% @test_sets.each_with_index do |test, index| %>
|
||||
<li class="clearfix">
|
||||
<p class="clearfix">
|
||||
<span class="color-green fb">测试集<%= index + 1 %></span>
|
||||
<% if test.is_public? %>
|
||||
<i class="fa fa-unlock-alt font-grey ml5" ></i>
|
||||
<% else %>
|
||||
<i class="fa fa-lock font-grey ml5" ></i>
|
||||
<% end %>
|
||||
</p>
|
||||
<div class="clearfix"><span class="fl fb">输入:</span><p class="fl"><%= test.input.gsub("\r\n", "<br />").html_safe unless test.input.blank? %></p></div>
|
||||
<div class="clearfix"><span class="fl fb">输出:</span><p class="fl"><%= test.output.gsub("\r\n", "<br />").html_safe unless test.output.blank? %></div>
|
||||
</li>
|
||||
<% end %>
|
||||
<% else %>
|
||||
无
|
||||
<% end %>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
<ul class="<%= @challenge.evaluation_way == 1 ? "undis" : "" %>" id="evaluating_edit">
|
||||
<%= labelled_form_for @challenge, :url => update_evaluation_shixun_challenge_path(@challenge, :shixun_id => @shixun, :tab => 2), :html => {:id => "challenge_evaluation_update"} do |f| %>
|
||||
<%= render :partial => "evaluating_form", :locals => {:f => f} %>
|
||||
<% end %>
|
||||
</ul>
|
||||
</div>
|
||||
<script>
|
||||
$("#edit_task_pass").click(function(){
|
||||
$("#evaluating_edit").show();
|
||||
$("#evaluating_show").hide();
|
||||
})
|
||||
</script>
|
||||
|
|
@ -0,0 +1,37 @@
|
|||
|
||||
<div class="panel-form">
|
||||
<div id="scroe_show" class="<%= @challenge.score.blank? ? "undis" : "" %>">
|
||||
<div class="clearfix mb20">
|
||||
<p class="fr">
|
||||
<% if @shixun.status == 0 && User.current.manager_of_shixun?(@shixun) %>
|
||||
<a href="javascript:void(0);" class="shixun-task-btn task-btn-green fr" id="edit_score">编辑</a>
|
||||
<% end %>
|
||||
</p>
|
||||
</div>
|
||||
<ul>
|
||||
<li class="clearfix">
|
||||
<label class="panel-form-label fl">难易度:</label>
|
||||
<div class="fl task-bg-grey panel-box-sizing panel-form-width-690">
|
||||
<%= @challenge.game_difficulty %>
|
||||
</div>
|
||||
</li>
|
||||
<li class="clearfix">
|
||||
<label class="panel-form-label fl"><span class="c_red mr5">*</span>奖励经验值:</label>
|
||||
<div class="fl task-bg-grey panel-box-sizing panel-form-width-690">
|
||||
<%= @challenge.score %>分
|
||||
</div>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
<ul class="<%= @challenge.score.blank? ? "" : "undis" %>" id="scoring_edit">
|
||||
<%= labelled_form_for @challenge, :url => shixun_challenge_path(@challenge, :shixun_id => @shixun, :tab => 4), :html => {:id => "challenge_score_update"} do |f| %>
|
||||
<%= render :partial => "score_form", :locals => {:f => f} %>
|
||||
<% end %>
|
||||
</ul>
|
||||
</div>
|
||||
<script>
|
||||
$("#edit_score").click(function(){
|
||||
$("#scoring_edit").show();
|
||||
$("#scroe_show").hide();
|
||||
})
|
||||
</script>
|
||||
|
|
@ -0,0 +1,36 @@
|
|||
<div class="panel-form">
|
||||
<div id="edit_skill_show" class="<%= @challenge_tags.blank? ? "undis" : "" %>">
|
||||
<div class="clearfix mb20">
|
||||
<p class="fr">
|
||||
<% if @shixun.status == 0 && User.current.manager_of_shixun?(@shixun) %>
|
||||
<a href="javascript:void(0);" class="shixun-task-btn task-btn-green fr" id="edit_skill">编辑</a>
|
||||
<% end %>
|
||||
</p>
|
||||
</div>
|
||||
<ul>
|
||||
<li class="clearfix">
|
||||
<% unless @challenge_tags.blank? %>
|
||||
<label class="panel-form-label fl"> 知识/技能点:</label>
|
||||
<div class="fl task-bd-grey panel-box-sizing panel-form-width-690">
|
||||
<% @challenge_tags.each do |tag| %>
|
||||
<div class="task-tag tag-grey mb10 mr10 fl">
|
||||
<%= tag.name %>
|
||||
</div>
|
||||
<% end %>
|
||||
</div>
|
||||
<% end %>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
<ul class="<%= @challenge_tags.blank? ? "" : "undis" %>" id="skill_edit">
|
||||
<%= labelled_form_for @challenge, :url => update_evaluation_shixun_challenge_path(@challenge, :shixun_id => @shixun, :tab => 5), :html => {:id => "challenge_skill_update"} do |f| %>
|
||||
<%= render :partial => "skill_form", :locals => {:f => f} %>
|
||||
<% end %>
|
||||
</ul>
|
||||
</div>
|
||||
<script>
|
||||
$("#edit_skill").click(function(){
|
||||
$("#edit_skill_show").hide();
|
||||
$("#skill_edit").show();
|
||||
});
|
||||
</script>
|
||||
|
|
@ -0,0 +1,48 @@
|
|||
<div class="panel-form">
|
||||
<% if @editor.blank? && @challenge.subject %>
|
||||
<div id="task_pass_show">
|
||||
<div class="clearfix mb20">
|
||||
<p class="fr">
|
||||
<% if @shixun.status == 0 && User.current.manager_of_shixun?(@shixun) %>
|
||||
<a href="<%= edit_shixun_challenge_path(@challenge, :shixun_id => @shixun, :editor => 1) %>" class="shixun-task-btn task-btn-green fr">编辑</a>
|
||||
<% end %>
|
||||
</p>
|
||||
</div>
|
||||
<ul>
|
||||
<li class="clearfix">
|
||||
<label class="panel-form-label fl">名称:</label>
|
||||
<div class="fl task-bg-grey panel-box-sizing panel-form-width-690">
|
||||
<%= @challenge.subject %>
|
||||
</div>
|
||||
</li>
|
||||
<li class="clearfix">
|
||||
<label class="panel-form-label fl"><span class="c_red mr5">*</span>过关任务:</label>
|
||||
<div class="fl task-bg-grey panel-box-sizing panel-form-width-690 new_li" id="challenge_task_pass_show" style="width: 90%">
|
||||
<textarea style="display:none;"><%= @challenge.task_pass %></textarea>
|
||||
</div>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
<% end %>
|
||||
<% if @challenge.subject.blank? || !@editor.blank? %>
|
||||
<ul class="" id="task_pass_edit">
|
||||
<%= labelled_form_for @challenge, :url => shixun_challenge_path(@challenge, :shixun_id => @shixun, :tab => 1), :html => {:id => "challenge_shixun_update"} do |f| %>
|
||||
<%= render :partial => "task_pass_form", :locals => {:f => f} %>
|
||||
<% end %>
|
||||
</ul>
|
||||
<% end %>
|
||||
</div>
|
||||
<script>
|
||||
$(document).ready(function() {
|
||||
editormd.loadKaTeX(function() {
|
||||
var taskPassMD = editormd.markdownToHTML("challenge_task_pass_show", {
|
||||
htmlDecode: "style,script,iframe", // you can filter tags decode
|
||||
taskList: true,
|
||||
tex: true, // 默认不解析
|
||||
flowChart: true, // 默认不解析
|
||||
sequenceDiagram: true // 默认不解析
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
</script>
|
||||
|
|
@ -0,0 +1,167 @@
|
|||
<script id="t:sample-answer-list" type="text/html">
|
||||
<li class="clearfix">
|
||||
<p class="clearfix">
|
||||
<span class="color-green fb fl" name="sample_inputs_label"></span>
|
||||
<input type="checkbox" name="test_set[lock][]" class="fl ml5 mr5 mt8" value=""><span class="fl mr5">锁定</span>
|
||||
<input type="hidden" name="test_set[hidden][]"/>
|
||||
<a href="javascript:void(0)" title="增加" class="sample_icon_add"><i class="fa fa-plus-circle color-grey font-16 ml10 fl mt7"></i></a>
|
||||
<a href="javascript:void(0)" title="删除" class="sample_icon_remove"><i class="fa fa-times-circle color-grey font-16 ml10 fl mt7"></i></a>
|
||||
</p>
|
||||
<textarea class="panel-form-width-40 panel-box-sizing" id="textarea_sample_input_test" name="test_set[input][]" placeholder="输入" ></textarea>
|
||||
<textarea class="panel-form-width-40 panel-box-sizing" id="textarea_sample_output_test" name="test_set[output][]" placeholder="希望输出" ></textarea>
|
||||
</li>
|
||||
</script>
|
||||
|
||||
<div id="shixun_form">
|
||||
<li class="clearfix">
|
||||
<label class="panel-form-label fl">文件路径:</label>
|
||||
<%= f.text_field :path, :class => "panel-form-width-690 panel-box-sizing fl", :no_label => true, :placeholder => "进入实训后将默认打开该文件,如:src/test/welcome.java", :maxlength => "256" %>
|
||||
</li>
|
||||
<li class="clearfix">
|
||||
<label class="panel-form-label fl">执行文件:</label>
|
||||
<%= f.text_field :exec_path, :class => "panel-form-width-690 panel-box-sizing fl", :no_label => true, :placeholder => "输入关卡需要执行的文件路径,如:src/test/main.java", :maxlength => "256" %>
|
||||
</li>
|
||||
<li class="clearfix">
|
||||
<label class="panel-form-label fl"><span class="c_red mr5">*</span>评测方式:</label>
|
||||
<%= select_tag :evaluation_way, options_for_select([["输入输出", 1]]), :name => 'challenge[evaluation_way]', :class => " fl", :style => "height: 40px; width:200px;" %>
|
||||
<span class="fl ml15 mt8">请选择自动检测学员是否完成本任务的评测标准</span>
|
||||
</li>
|
||||
<li class="clearfix">
|
||||
<% if params[:action] == "edit" && @challenge.test_sets.count > 0 %>
|
||||
<label class="panel-form-label fl">测试集设置:</label>
|
||||
<ul class="fl task-bg-grey panel-box-sizing" >
|
||||
<% @challenge.test_sets.each_with_index do |test_set, index| %>
|
||||
<li class="clearfix">
|
||||
<p class="clearfix">
|
||||
<span class="color-green fb fl" name="sample_inputs_label">组<%= index + 1 %></span>
|
||||
<% if test_set.is_public? %>
|
||||
<input type="checkbox" name="test_set[lock][]" class="fl ml5 mr5 mt8"><span class="fl mr5">锁定</span>
|
||||
<% else %>
|
||||
<input type="checkbox" name="test_set[lock][]" class="fl ml5 mr5 mt8" checked="checked"><span class="fl mr5">锁定</span>
|
||||
<% end %>
|
||||
<input type="hidden" name="test_set[hidden][]"/>
|
||||
<% if index == 0 %>
|
||||
<span class="color-grey fr" style="font-size:12px;">温馨提示:选中“锁定”,则对学员隐藏该条测试集,但在“提交评测”时也将被自动检测。</span>
|
||||
<% end %>
|
||||
<a href="javascript:void(0)" title="增加" class="sample_icon_add"><i class="fa fa-plus-circle color-grey font-16 ml10 fl mt7"></i></a>
|
||||
<% if index > 0 %>
|
||||
<a href="javascript:void(0)" title="删除" class="sample_icon_remove"><i class="fa fa-times-circle color-grey font-16 ml10 fl mt7"></i></a>
|
||||
<% end %>
|
||||
</p>
|
||||
<textarea class="panel-form-width-40 panel-box-sizing" id="textarea_sample_input_test" name="test_set[input][]" placeholder="输入"><%= test_set.input %></textarea>
|
||||
<textarea class="panel-form-width-40 panel-box-sizing" id="textarea_sample_output_test" name="test_set[output][]" placeholder="希望输出"><%= test_set.output %></textarea>
|
||||
</li>
|
||||
<% end %>
|
||||
</ul>
|
||||
<% else %>
|
||||
<label class="panel-form-label fl">测试集设置:</label>
|
||||
<ul class="fl task-bg-grey panel-box-sizing">
|
||||
<li class="clearfix">
|
||||
<p class="clearfix">
|
||||
<span class="color-green fb fl" name="sample_inputs_label">组1</span>
|
||||
<span class="color-grey fr" style="font-size:12px;">温馨提示:选中“锁定”,在“提交评测”时它也将被自动检测,但学员暂不可查看内容。</span>
|
||||
<input type="checkbox" name="test_set[lock][]" class="fl ml5 mr5 mt8" value=""><span class="fl mr5">锁定</span>
|
||||
<input type="hidden" name="test_set[hidden][]"/>
|
||||
<a href="javascript:void(0)" title="增加" class="sample_icon_add"><i class="fa fa-plus-circle color-grey font-16 ml10 fl mt7"></i></a>
|
||||
</p>
|
||||
<textarea class="panel-form-width-40 panel-box-sizing" id="textarea_sample_input_test" name="test_set[input][]" placeholder="输入" ></textarea>
|
||||
<textarea class="panel-form-width-40 panel-box-sizing" id="textarea_sample_output_test" name="test_set[output][]" placeholder="希望输出" ></textarea>
|
||||
</li>
|
||||
</ul>
|
||||
<% end %>
|
||||
</li>
|
||||
<li class="clearfix">
|
||||
<a href="javascript:void(0);" class="task-btn task-btn-green fr" onclick="submit_shixun_evaluating();">保存</a>
|
||||
<a href="javascript:void(0);" class="task-btn fr mr10" id="evaluating_cancel">取消</a>
|
||||
</li>
|
||||
</div>
|
||||
|
||||
<script type="text/javascript">
|
||||
$(function () {
|
||||
var bt = baidu.template;
|
||||
bt.LEFT_DELIMITER = '<!';
|
||||
bt.RIGHT_DELIMITER = '!>';
|
||||
|
||||
$("#shixun_form").on('click', 'a.test_icon_add', function () {
|
||||
var html = bt('t:test-answer-list', null);
|
||||
$(this).parent().parent('.clearfix').after(html);
|
||||
var inputs = document.getElementsByName("program[input][]");
|
||||
var outputs = document.getElementsByName("program[output][]");
|
||||
var inputs_labels = document.getElementsByName("inputs_label");
|
||||
for (var j = 0; j < inputs_labels.length; j++) {
|
||||
$(inputs_labels[j]).html("测试集"+ (j + 1));
|
||||
}
|
||||
if (inputs.length == outputs.length) {
|
||||
for (var i = 0; i < inputs.length; i++) {
|
||||
// autoTextarea2(inputs[i], outputs[i], 0, 140);
|
||||
// autoTextarea2(outputs[i], inputs[i], 0, 140);
|
||||
}
|
||||
}
|
||||
$(inputs[inputs.length - 1]).focus();
|
||||
});
|
||||
$("#shixun_form").on('click', 'a.test_icon_remove', function () {
|
||||
$(this).parent().parent('.clearfix').remove();
|
||||
var inputs_labels = document.getElementsByName("inputs_label");
|
||||
for (var j = 0; j < inputs_labels.length; j++) {
|
||||
$(inputs_labels[j]).html("测试集" + (j + 1));
|
||||
}
|
||||
});
|
||||
|
||||
$("#shixun_form").on('click', 'a.sample_icon_add', function () {
|
||||
var html = bt('t:sample-answer-list', null);
|
||||
$(this).parent().parent('.clearfix').after(html);
|
||||
var inputs = document.getElementsByName("test_set[input][]");
|
||||
var outputs = document.getElementsByName("test_set[output][]");
|
||||
var inputs_labels = document.getElementsByName("sample_inputs_label");
|
||||
for (var j = 0; j < inputs_labels.length; j++) {
|
||||
$(inputs_labels[j]).html("组" + (j + 1));
|
||||
}
|
||||
// 设置测试集的的输入与输出的回车自动调整宽度
|
||||
if (inputs.length == outputs.length) {
|
||||
for (var i = 0; i < inputs.length; i++) {
|
||||
autoTextarea(inputs[i], 0, 140);
|
||||
autoTextarea(outputs[i], 0, 140);
|
||||
}
|
||||
}
|
||||
$(inputs[inputs.length - 1]).focus();
|
||||
});
|
||||
$("#shixun_form").on('click', 'a.sample_icon_remove', function () {
|
||||
$(this).parent().parent('.clearfix').remove();
|
||||
var inputs_labels = document.getElementsByName("sample_inputs_label");
|
||||
for (var j = 0; j < inputs_labels.length; j++) {
|
||||
$(inputs_labels[j]).html("组" + (j + 1));
|
||||
}
|
||||
});
|
||||
|
||||
});
|
||||
// 设置textarea的宽度到140以后出现滚动条
|
||||
var test_set_inputs = document.getElementsByName("test_set[input][]");
|
||||
var test_set_outputs = document.getElementsByName("test_set[output][]");
|
||||
if (test_set_inputs.length == test_set_outputs.length) {
|
||||
for (var i = 0; i < test_set_inputs.length; i++) {
|
||||
autoTextarea(test_set_inputs[i], 0, 140);
|
||||
autoTextarea(test_set_outputs[i], 0, 140);
|
||||
}
|
||||
}
|
||||
// 判断测试集是否锁定, 0未锁定,1锁定
|
||||
function test_set_whether_lock(){
|
||||
var lock = document.getElementsByName("test_set[lock][]");
|
||||
var hid = document.getElementsByName("test_set[hidden][]");
|
||||
for(var o = 0; o < lock.length; o++){
|
||||
if($(lock[o]).prop("checked")){
|
||||
$(hid[o]).val(1);
|
||||
}else{
|
||||
$(hid[o]).val(0);
|
||||
}
|
||||
}
|
||||
}
|
||||
// 提交表单
|
||||
function submit_shixun_evaluating(){
|
||||
test_set_whether_lock();
|
||||
$('#challenge_evaluation_update').submit();
|
||||
}
|
||||
$("#evaluating_cancel").click(function(){
|
||||
$("#evaluating_edit").hide();
|
||||
$("#evaluating_show").show();
|
||||
})
|
||||
</script>
|
||||
|
|
@ -0,0 +1,81 @@
|
|||
<div id="shixun_form">
|
||||
<li class="clearfix">
|
||||
<label class="panel-form-label fl"><span class="c_red mr5">*</span>难易度:</label>
|
||||
<span class="mt10 fl"><%= radio_button_tag("challenge[difficulty]", 1, checked = (@challenge.difficulty ==1 ? true : false)) %></span><span class="ml5 fl mt8 mr15">简单</span>
|
||||
<span class="mt10 fl"><%= radio_button_tag("challenge[difficulty]", 2, checked = (@challenge.difficulty ==2 ? true : false)) %></span><span class="ml5 fl mt8 mr15">中等</span>
|
||||
<span class="mt10 fl"><%= radio_button_tag("challenge[difficulty]", 3, checked = (@challenge.difficulty ==3 ? true : false)) %></span><span class="ml5 fl mt8 mr15">困难 </span>
|
||||
<!-- <span class="fl color-orange ml30 mt8"><i class="fa fa-exclamation-circle mr5"></i>请选择难易度并设定通过本关后,学员得到的经验值</span>-->
|
||||
</li>
|
||||
|
||||
<li class="clearfix">
|
||||
<label class="panel-form-label fl"><span class="c_red mr5">*</span>奖励经验值:</label>
|
||||
<%#= f.text_field :score, :class => "panel-form-height-30 fl", :no_label => true, :style => "padding:5px;", :placeholder => "请输入分值(只能是数字)" %>
|
||||
<%= select_tag :challenge_score, options_for_select([100, 200]), :name => 'challenge[score]', :class => " fl", :style => "height: 40px; width:170px;" %>
|
||||
<div class="clear"></div>
|
||||
<span style="display: none" class="c_red ml90" id="new_shixun_score">分值设定不能为空</span>
|
||||
</li>
|
||||
|
||||
<div class="prop-notice-info mb10 ml95 w850">
|
||||
<ol>
|
||||
<li>如果学员查看了参考答案,则不能得到相应的经验值</li>
|
||||
<li>如果学员成功得到经验值,那么将同时获得等值的金币奖励,如:+100经验值、+100金币</li>
|
||||
</ol>
|
||||
</div>
|
||||
|
||||
<li class="clearfix">
|
||||
<a href="javascript:void(0);" class="task-btn task-btn-green fr" onclick="challenge_score_update();">保存</a>
|
||||
<a href="javascript:void(0);" class="task-btn fr mr10" id="score_cancel">取消</a>
|
||||
</li>
|
||||
</div>
|
||||
|
||||
<script type="text/javascript">
|
||||
// 根据难易程度设置不同的奖励经验值(适用新建与编辑模式)
|
||||
var list= $('input:radio[name="challenge[difficulty]"]:checked').val(); // 获取select的索引值
|
||||
if(list == 1){
|
||||
$("#challenge_score").empty();
|
||||
for(var i= 100; i <= 200; i += 100){
|
||||
$("#challenge_score").append("<option value="+ i + ">"+ i +"</option>");
|
||||
}
|
||||
}else if(list == 2){
|
||||
$("#challenge_score").empty();
|
||||
for(var i= 300; i <= 600; i += 100){
|
||||
$("#challenge_score").append("<option value="+ i + ">"+ i +"</option>");
|
||||
}
|
||||
}else if(list == 3){
|
||||
$("#challenge_score").empty();
|
||||
for(var i= 700; i <= 1000; i += 100){
|
||||
$("#challenge_score").append("<option value="+ i + ">"+ i +"</option>");
|
||||
}
|
||||
}
|
||||
$("#challenge_score").find("option[value='<%= @challenge.score %>']").attr("selected",true); // 设置option默认值
|
||||
$("#challenge_difficulty_1").click(function(){
|
||||
$("#challenge_score").empty();
|
||||
for(var i= 100; i <= 200; i += 100){
|
||||
$("#challenge_score").append("<option value="+ i + ">"+ i +"</option>");
|
||||
}
|
||||
});
|
||||
$("#challenge_difficulty_2").click(function(){
|
||||
$("#challenge_score").empty();
|
||||
for(var i= 300; i <= 600; i += 100){
|
||||
$("#challenge_score").append("<option value="+ i + ">"+ i +"</option>");
|
||||
}
|
||||
});
|
||||
$("#challenge_difficulty_3").click(function(){
|
||||
$("#challenge_score").empty();
|
||||
for(var i= 700; i <= 1000; i += 100){
|
||||
$("#challenge_score").append("<option value="+ i + ">"+ i +"</option>");
|
||||
}
|
||||
})
|
||||
function challenge_score_update(){
|
||||
if($("#challenge_score").val().trim()==""){
|
||||
$("#challenge_score").focus();
|
||||
$("#new_shixun_score").show();
|
||||
}else{
|
||||
$('#challenge_score_update').submit();
|
||||
}
|
||||
}
|
||||
$("#score_cancel").click(function(){
|
||||
$("#scoring_edit").hide();
|
||||
$("#scroe_show").show();
|
||||
})
|
||||
</script>
|
||||
|
|
@ -0,0 +1,63 @@
|
|||
<div id="shixun_form">
|
||||
<li class="clearfix" style="margin-bottom: 0;">
|
||||
<label class=" panel-form-label fl"> 技能标签:</label>
|
||||
<div class="fl task-bd-grey">
|
||||
<% if params[:action] == "edit" && @challenge_tags.count > 0 %>
|
||||
<% @challenge_tags.each do |tag| %>
|
||||
<div class="task-tag tag-grey mt5 mr10 fl">
|
||||
<button data-dismiss="alert" class="close fr mt3 ml5" type="button" onclick="close_tag(this)">×</button>
|
||||
<input class='knowledge_frame' name='knowledge[input][]' value="<%= tag.try(:name)%>" />
|
||||
</div>
|
||||
<% end %>
|
||||
<% end %>
|
||||
|
||||
<div class="task-tag tag-grey mt5 mr10 fl" id="add_shixun_skill">
|
||||
<button data-dismiss="alert" class="close fr mt3 ml5" type="button" onclick="$('#add_shixun_skill').slideToggle();">×</button>
|
||||
<input type="text" class="task-tag-input" onblur="add_tag();" id="shixun_skill_input" placeholder="请输入知识/技能点" />
|
||||
</div>
|
||||
<a href="javascript:void(0);" onclick="$('#add_shixun_skill').slideToggle();" id="add_knowledge" style="color: #627bfd;float: left;margin-top: 5px">+添加</a>
|
||||
</div>
|
||||
</li>
|
||||
<p class="color-red ml95" style="height: 25px;"><span id="stage_name_notice" style="display: none;"><i class="fa fa-exclamation-circle color-red mr5"></i>知识/技能点不能为空</span></p>
|
||||
<div class="prop-notice-info mb10 ml95 w850">
|
||||
<ol>
|
||||
<li>学员为参考答案通过了本阶段的评测时将获得技能,否则不能获得技能</li>
|
||||
</ol>
|
||||
</div>
|
||||
|
||||
<li class="clearfix">
|
||||
<a href="javascript:void(0);" class="task-btn task-btn-green fr" onclick="challenge_skill_update();">保存</a>
|
||||
<a href="<%= edit_shixun_challenge_path(@challenge, :shixun_id => @shixun, :tab => 5) %>" class="task-btn fr mr10" id="skill_cancel">取消</a>
|
||||
</li>
|
||||
</div>
|
||||
|
||||
<script type="text/javascript">
|
||||
function add_tag(){
|
||||
var num = $(".task-bd-grey").children('div').length;
|
||||
var val = $(".task-tag-input").val().trim();
|
||||
if (val != ""){
|
||||
testLength = $(".task-tag-input").val().trim().length;
|
||||
$("#add_knowledge").before("<div class='task-tag tag-grey mt5 mr10 fl' id='knowledge_" + num + "'>" +
|
||||
"<button data-dismiss='alert' class='close fr mt3 ml5' type='button' onclick='close_tag(this)'>×</button>" +
|
||||
"<input style='width:"+ testLength*12 +"px' class='knowledge_frame' name='knowledge[input][]' value='" + val +"'>" +
|
||||
" </div>");
|
||||
$(".task-tag-input").attr("value","");
|
||||
}
|
||||
$("#shixun_skill_input").val("");
|
||||
}
|
||||
|
||||
function close_tag(thisObj){
|
||||
// 获取父节点的id
|
||||
var obj = thisObj.parentNode.id;
|
||||
$("#"+obj).remove();
|
||||
}
|
||||
|
||||
function challenge_skill_update(){
|
||||
var nSkill = $(".knowledge_frame");
|
||||
if (nSkill.length > 0){
|
||||
$("#challenge_skill_update").submit();
|
||||
}else{
|
||||
$("#stage_name_notice").show();
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
|
@ -0,0 +1,107 @@
|
|||
<%= stylesheet_link_tag '/editormd/css/editormd','/editormd/css/editormd.min.css' %>
|
||||
<%= javascript_include_tag '/editormd/editormd.min.js','/editormd/examples/js/jquery.min.js' %>
|
||||
<style>
|
||||
.CodeMirror-scroll{
|
||||
overflow: auto !important;
|
||||
margin-bottom: -30px;
|
||||
margin-right: -30px;
|
||||
padding-bottom: 30px;
|
||||
height: 100%;
|
||||
outline: none;
|
||||
position: relative;
|
||||
}
|
||||
</style>
|
||||
|
||||
|
||||
<div id="shixun_form">
|
||||
<li class="clearfix">
|
||||
<label class="panel-form-label fl"><span class="c_red mr5">*</span>名称:</label>
|
||||
<%= f.text_field :subject, :class => "panel-form-width-690 fl panel-box-sizing", :no_label => true, :placeholder => "请输入当前任务的名称(此信息将提前泄露给学员)" %>
|
||||
<span style="display: none" class="c_red ml95" id="new_shixun_name">任务名称不能为空</span>
|
||||
</li>
|
||||
<li class="clearfix">
|
||||
<label class="panel-form-label fl"><span class="c_red mr5">*</span>过关任务:</label>
|
||||
<div id="challenge_task_pass" class="new_li">
|
||||
<textarea name="challenge[task_pass]"><%= @challenge.task_pass %></textarea>
|
||||
</div>
|
||||
<span style="display: none" class="c_red ml95" id="new_shixun_pass">过关任务不能为空</span>
|
||||
</li>
|
||||
<li class="clearfix">
|
||||
<a href="javascript:void(0);" class="task-btn task-btn-green fr" onclick="challenge_update()">保存</a>
|
||||
<a href="javascript:void(0);" class="task-btn fr mr10" id="task_pass_cancel">取消</a>
|
||||
</li>
|
||||
</div>
|
||||
|
||||
<script type="text/javascript">
|
||||
$(function() {
|
||||
taskpass_editormd = editormd("challenge_task_pass", {
|
||||
width : "89.6%",
|
||||
height : 600,
|
||||
syncScrolling : "single",
|
||||
//你的lib目录的路径,我这边用JSP做测试的
|
||||
path : "/editormd/lib/",
|
||||
tex : true,
|
||||
autoFocus: false,
|
||||
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,
|
||||
// 用于增加自定义工具栏的功能,可以直接插入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 => @shixun.id, :container_type => @shixun.class) %>"//url
|
||||
});
|
||||
});
|
||||
window.onload = function(){
|
||||
$("#challenge_task_pass [type=\"latex\"]").bind("click", function(){
|
||||
taskpass_editormd.cm.replaceSelection("```latex");
|
||||
taskpass_editormd.cm.replaceSelection("\n");
|
||||
taskpass_editormd.cm.replaceSelection("\n");
|
||||
taskpass_editormd.cm.replaceSelection("```");
|
||||
var __Cursor = taskpass_editormd.cm.getDoc().getCursor();
|
||||
taskpass_editormd.cm.setCursor(__Cursor.line-1, 0);
|
||||
});
|
||||
|
||||
$("#challenge_task_pass [type=\"inline\"]").bind("click", function(){
|
||||
taskpass_editormd.cm.replaceSelection("$$$$");
|
||||
var __Cursor = taskpass_editormd.cm.getDoc().getCursor();
|
||||
taskpass_editormd.cm.setCursor(__Cursor.line, __Cursor.ch-2);
|
||||
taskpass_editormd.cm.focus();
|
||||
});
|
||||
$("[type=\"inline\"]").attr("title", "行内公式");
|
||||
$("[type=\"latex\"]").attr("title", "多行公式");
|
||||
|
||||
};
|
||||
$("#challenge_subject").keydown(function(){
|
||||
$("#new_shixun_name").hide();
|
||||
});
|
||||
$("#challenge_subject").keydown(function(){
|
||||
$("#new_shixun_pass").hide();
|
||||
});
|
||||
|
||||
$("#task_pass_cancel").click(function(){
|
||||
$("#task_pass_show").show();
|
||||
$("#task_pass_edit").hide();
|
||||
});
|
||||
function challenge_update(){
|
||||
if($('#challenge_subject').val().trim() == ""){
|
||||
$("#challenge_subject").focus();
|
||||
$("#new_shixun_name").show();
|
||||
}else if($("#challenge_task_pass textarea").val().trim() == ""){
|
||||
$("#challenge_task_pass textarea").focus();
|
||||
$("#new_shixun_pass").show();
|
||||
}else{
|
||||
$('#challenge_shixun_update').submit();
|
||||
}
|
||||
}
|
||||
|
||||
</script>
|
||||
|
|
@ -1,22 +1,54 @@
|
|||
<%= content_for(:header_tags) do %>
|
||||
<%= import_ke(enable_at: true, prettify: false, init_activity: false) %>
|
||||
<%= javascript_include_tag "/assets/codemirror/codemirror_python_ruby_c" %>
|
||||
<%= stylesheet_link_tag "/assets/codemirror/codemirror" %>
|
||||
<% end %>
|
||||
<%= javascript_include_tag "/assets/codemirror/codemirror_python_ruby_c" %>
|
||||
<%= stylesheet_link_tag "/assets/codemirror/codemirror" %>
|
||||
|
||||
<%= 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' %>
|
||||
<style>
|
||||
.editormd-preview-container, .editormd-html-preview{
|
||||
text-align: left;
|
||||
font-size: 16px;
|
||||
line-height: 1.8;
|
||||
}
|
||||
.-task-ml80 .CodeMirror pre{
|
||||
font-size: 16px;
|
||||
}
|
||||
</style>
|
||||
|
||||
<div class="task-pm-content mb20">
|
||||
<div class="task-pm-box mt20">
|
||||
<div class="panel-header clearfix">
|
||||
<h3 class="fl mt5">编辑阶段(第<%= @challenge.position %>关)</h3>
|
||||
<h3 class="fl mt5">阶段编辑(第<%= @challenge.position %>关)</h3>
|
||||
</div>
|
||||
<div class=" panel-form ">
|
||||
<ul>
|
||||
<%= labelled_form_for @challenge, :url => shixun_challenge_path(@challenge, :shixun_id => @shixun) do |f| %>
|
||||
<%= render :partial => "form", :locals => {:f => f} %>
|
||||
<% end %>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<ul class="nav_check_item clearfix mt20" style="margin-bottom: 0;">
|
||||
<li class="fl <%= @tab == 1 ? "check_nav" : "" %>">
|
||||
<a href="<%= edit_shixun_challenge_path(@challenge, :shixun_id => @shixun, :tab => 1) %>" class="color-black">本关任务</a>
|
||||
</li>
|
||||
<li class="fl <%= @tab == 2 ? "check_nav" : "" %>">
|
||||
<a href="<%= edit_shixun_challenge_path(@challenge, :shixun_id => @shixun, :tab => 2) %>" class="color-black">评测设置</a>
|
||||
</li>
|
||||
<li class="fl <%= @tab == 3 ? "check_nav" : "" %>">
|
||||
<a href="<%= edit_shixun_challenge_path(@challenge, :shixun_id => @shixun, :tab => 3) %>" class="color-black">参考答案</a>
|
||||
</li>
|
||||
<li class="fl <%= @tab == 4 ? "check_nav" : "" %>">
|
||||
<a href="<%= edit_shixun_challenge_path(@challenge, :shixun_id => @shixun, :tab => 4) %>" class="color-black">评分设置</a>
|
||||
</li>
|
||||
<li class="fl <%= @tab == 5 ? "check_nav" : "" %>">
|
||||
<a href="<%= edit_shixun_challenge_path(@challenge, :shixun_id => @shixun, :tab => 5) %>" class="color-black">技能勋章</a>
|
||||
</li>
|
||||
</ul>
|
||||
<div class="task-pm-box">
|
||||
<% if @tab == 1 || @tab.blank? %>
|
||||
<%= render :partial => "edit_task_pass" %>
|
||||
<% elsif @tab == 2 %>
|
||||
<%= render :partial => "edit_evaluating" %>
|
||||
<% elsif @tab == 3 %>
|
||||
<%= render :partial => "edit_answer" %>
|
||||
<% elsif @tab == 4 %>
|
||||
<%= render :partial => "edit_scoring" %>
|
||||
<% elsif @tab == 5 %>
|
||||
<%= render :partial => "edit_skill" %>
|
||||
<% end %>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
|
|
|||
|
|
@ -1,5 +1,24 @@
|
|||
<%= javascript_include_tag "/assets/codemirror/codemirror_python_ruby_c" %>
|
||||
<%= stylesheet_link_tag "/assets/codemirror/codemirror" %>
|
||||
|
||||
|
||||
<div class="task-pm-box mt20">
|
||||
<div class="panel-header clearfix">
|
||||
<h3 class="fl mt5">新建阶段</h3>
|
||||
</div>
|
||||
<div class=" panel-form ">
|
||||
<ul>
|
||||
<%= labelled_form_for @challenge, :url => shixun_challenges_path(@shixun), :html => { :id => "challenge_shixun_update"} do |f| %>
|
||||
<%= render :partial => "task_pass_form", :locals => {:f => f} %>
|
||||
<% end %>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
<% if false %>
|
||||
<div class="task-pm-box mt20">
|
||||
<div class="panel-header clearfix">
|
||||
<h3 class="fl mt5">新建阶段</h3>
|
||||
|
|
@ -12,6 +31,6 @@
|
|||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<% end %>
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -8,15 +8,16 @@
|
|||
<ul class="task-index-head-info clearfix">
|
||||
<li><span class="color-orange font-bd"><%= @syllabuses_num %></span><br/><span >全部课堂</span></li>
|
||||
<li><span class="color-orange font-bd"><%= @create_syllabuses_count + @join_syllabuses_count %></span><br/><span>我的课堂</span></li>
|
||||
<!-- <li><span class="color-orange font-bd"><%#= @create_syllabuses_count %></span><br/><span>你已创建</span></li>-->
|
||||
<!-- <li><span class="color-orange font-bd"><%#= @create_syllabuses_count %></span><br/><span>你已创建</span></li>-->
|
||||
</ul>
|
||||
</div>
|
||||
<div class="clearfix mb15 fl">
|
||||
<a href="<%= courses_path(:select => "all", :search => @search) %>" id="courses_index_syllabuses_1" class="course_filtrate fl course_filtrate_bg" data-tab="all" data-remote="true">全部课堂</a>
|
||||
<a href="<%= courses_path(:select => "create", :search => @search) %>" id="courses_index_syllabuses_2" class="course_filtrate fl" data-tab="create" data-remote="true">我管理的</a>
|
||||
<a href="<%= courses_path(:select => "join", :search => @search) %>" id="courses_index_syllabuses_3" class="course_filtrate fl" data-tab="join" data-remote="true">我参与的</a>
|
||||
<a href="<%= courses_path(:select => "all", :is_end => @is_end,:search => @search) %>" id="courses_index_syllabuses_1" class="course_filtrate fl course_filtrate_bg" data-tab="all" data-remote="true">全部课堂</a>
|
||||
<a href="<%= courses_path(:select => "create", :is_end => @is_end, :search => @search) %>" id="courses_index_syllabuses_2" class="course_filtrate fl" data-tab="create" data-remote="true">我管理的</a>
|
||||
<a href="<%= courses_path(:select => "join", :is_end => @is_end, :search => @search) %>" id="courses_index_syllabuses_3" class="course_filtrate fl" data-tab="join" data-remote="true">我参与的</a>
|
||||
|
||||
<!-- <li class="edu-dropdown fl ml15 mr5" id="thirdly_select" style="width: 100px">
|
||||
|
||||
<!-- <li class="edu-dropdown fl ml15 mr5" id="thirdly_select" style="width: 100px">
|
||||
<a href="javascript:void(0);" class="edu-dropdown-toggle" id="all_syllabuses" >所有课程<i class="fa fa-caret-down ml20"></i></a>
|
||||
<ul class="edu-dropdown-menu" id="all_syllabuses_list">
|
||||
<li onclick="change_language(this);"><a id="courses_index_syllabuses_1" href="<%#= courses_path(:select => "all", :search => @search) %>" data-remote="true">所有课程</a></li>
|
||||
|
|
@ -29,6 +30,7 @@
|
|||
<div class="search-wrapper">
|
||||
<div class="input-holder">
|
||||
<input type="hidden" name="select" id="input_select_val" value="<%= @select %>">
|
||||
<input type="hidden" name="is_end" id="input_select_text" value="<%= @is_end %>">
|
||||
<input type="text" class="search-input" name="search" placeholder="输入课程关键字进行搜索" />
|
||||
<button class="search-icon" onclick="searchToggle(this, event);"><i class="fa fa-search font-16 mt5"></i></button>
|
||||
</div>
|
||||
|
|
@ -36,7 +38,8 @@
|
|||
</div>
|
||||
</form>
|
||||
</div>
|
||||
|
||||
<a href="<%= courses_path(:select => "end", :is_end => 1) %>" id="courses_index_syllabuses_4" class="color-grey fr" data-tab="end" data-remote="true">查看归档</a>
|
||||
<a href="<%= courses_path(:select => "return", :is_end => 0) %>" class="color-grey fr undis" id="courses_index_syllabuses_5" data-remote="true">返回</a>
|
||||
<div class="cl"></div>
|
||||
<div class="content clearfix" id="intelligence_course_list">
|
||||
<%= render :partial => 'courses/courseList' %>
|
||||
|
|
@ -62,9 +65,9 @@
|
|||
function submit_select_syllabuses(value){
|
||||
console.log(value);
|
||||
$.ajax({
|
||||
url: "<%= courses_path %>",
|
||||
remote: true,
|
||||
data: { select: value, search: $("#course_search").val() }
|
||||
url: "<%= courses_path %>",
|
||||
remote: true,
|
||||
data: { select: value, search: $("#course_search").val() }
|
||||
});
|
||||
}
|
||||
|
||||
|
|
@ -137,5 +140,21 @@
|
|||
$(".course_filtrate").removeClass("course_filtrate_bg");
|
||||
$(this).addClass("course_filtrate_bg");
|
||||
}
|
||||
})
|
||||
});
|
||||
|
||||
/* -------------------恢复标签到初始位置-------------------- */
|
||||
function reset_label_status(){
|
||||
$(".course_filtrate").removeClass("course_filtrate_bg");
|
||||
$("#courses_index_syllabuses_1").addClass("course_filtrate_bg");
|
||||
$("input[name='search']").val("");
|
||||
}
|
||||
/* ---------------点击查看归档的返回----------------- */
|
||||
$("#courses_index_syllabuses_5").on("click", function(){
|
||||
reset_label_status()
|
||||
});
|
||||
|
||||
/* ------------------查看归档----------------------- */
|
||||
$("#courses_index_syllabuses_4").on("click", function(){
|
||||
reset_label_status()
|
||||
});
|
||||
</script>
|
||||
|
|
|
|||
|
|
@ -1,5 +1,13 @@
|
|||
$("#intelligence_course_list").html("<%= j(render :partial => "courses/courseList") %>");
|
||||
$("#courses_index_syllabuses_1").attr('href','<%= courses_path(:select => "all", :search => @search) %>');
|
||||
$("#courses_index_syllabuses_2").attr('href','<%= courses_path(:select => "create", :search => @search) %>');
|
||||
$("#courses_index_syllabuses_3").attr('href','<%= courses_path(:select => "join", :search => @search) %>');
|
||||
$("#input_select_val").val('<%= @select %>');
|
||||
$("#courses_index_syllabuses_1").attr('href', '<%= courses_path(:select => "all", :is_end => @is_end, :search => @search) %>');
|
||||
$("#courses_index_syllabuses_2").attr('href', '<%= courses_path(:select => "create", :is_end => @is_end, :search => @search) %>');
|
||||
$("#courses_index_syllabuses_3").attr('href', '<%= courses_path(:select => "join", :is_end => @is_end, :search => @search) %>');
|
||||
<% if params[:select] == "end" %>
|
||||
$("#courses_index_syllabuses_4").hide();
|
||||
$("#courses_index_syllabuses_5").show();
|
||||
<% elsif params[:select] == "return" %>
|
||||
$("#courses_index_syllabuses_4").show();
|
||||
$("#courses_index_syllabuses_5").hide();
|
||||
<% end %>
|
||||
$("#input_select_val").val('<%= @select %>');
|
||||
$("#input_select_text").val('<%= @is_end %>');
|
||||
|
|
@ -84,7 +84,7 @@
|
|||
// 本地版
|
||||
var html_local ="<iframe src='http://127.0.0.1:9527?Host=106.75.96.108&Port=40054&Username=root&Password=123123&Gameid=" +data.game_id + "'" + " style='width:100%;border:0;' scrolling='no' id='game_webssh'></iframe>";
|
||||
console.log(html);
|
||||
$("#codotab_con_2").html(html);
|
||||
$("#codotab_con_2").html(html_local);
|
||||
var h = $("#games_repository_contents").height() - $("#top_repository").height() - 10;
|
||||
$("#game_webssh").css("min-height", h);
|
||||
HoverLi_new(2);
|
||||
|
|
|
|||
|
|
@ -43,7 +43,7 @@
|
|||
control = 0;
|
||||
}
|
||||
editor_CodeMirror.setSize("auto", "auto");
|
||||
var h = nGameRes.height() - $("#top_repository").height() - 10;
|
||||
var h = nGameRes.height() - $("#top_repository").height() - 50;
|
||||
nCode.css("min-height", h);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -19,7 +19,7 @@
|
|||
</ul>
|
||||
<ul class="saoma-box fl mr30">
|
||||
<li>
|
||||
<img src="/images/inner/img-back-qq.png" width="50" height="50" alt="高校智能化教学与实训平台" class="img-show" >
|
||||
<a target="_blank" href="//shang.qq.com/wpa/qunwpa?idkey=ef458840dfd0f60fbffff84ea9927a8e48954f8e73b2fb2c03feacdb4139076b"><img src="/images/inner/img-back-qq.png" width="50" height="50" alt="高校智能化教学与实训平台" class="img-show" ></a>
|
||||
<ul class="saoma-img-box">
|
||||
<font></font>
|
||||
<li>
|
||||
|
|
|
|||
|
|
@ -64,7 +64,7 @@
|
|||
</li>
|
||||
<li class="clearfix">
|
||||
<a href="javascript:void(0)" class="task-btn task-btn-blue fr" onclick="submit_new_project();">提交</a>
|
||||
<%= link_to "取消",user_activities_path(User.current.id),:class => "task-btn fr mr10" %>
|
||||
<%= link_to "取消", shixuns_path, :class => "task-btn fr mr10" %>
|
||||
</li>
|
||||
<% end %>
|
||||
</ul>
|
||||
|
|
|
|||
|
|
@ -77,10 +77,13 @@
|
|||
|
||||
//多选适用课程
|
||||
$("body").click(function(event){
|
||||
$(".lesson_checkbox").hide();
|
||||
$(".lesson_checkbox").attr("showul","0");
|
||||
event.stopPropagation();
|
||||
if ($(event.target).attr("id") != "shixun_operation"){
|
||||
$(".lesson_checkbox").hide();
|
||||
$(".lesson_checkbox").attr("showul","0");
|
||||
event.stopPropagation();
|
||||
}
|
||||
});
|
||||
|
||||
$(".lesson").click(function(event){
|
||||
if($("#shixun_major").val() == "0") {
|
||||
$("#shixun_major_course_notice").html("请先选择适用专业").show();
|
||||
|
|
|
|||
|
|
@ -2,10 +2,15 @@
|
|||
<% str = current_user == @user ? '我' : 'TA' %>
|
||||
<ul id="edu-user-tab-nav">
|
||||
<li class="edu-user-tab-hover new-tab-nav">
|
||||
<a href="javascript:void(0);" class="font-16 tab_type"><%= str %>的课堂 <%= @courses_count %></a>
|
||||
<a href="javascript:void(0);" class="font-16 tab_type"><%= str %>的课堂 <span id="user_course_count"> <%= @courses_count %></span></a>
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
<div class="user_bg_shadow">
|
||||
<div style="height: 40px; margin-top: 10px;margin-left: 12px;">
|
||||
<a href="<%= shixuns_or_courses_filter_user_path(@user, :index => "course", :filter => "manage") %>" class="course_filtrate_bg course_filtrate fl" data-remote="true">我管理的</a>
|
||||
<a href="<%= shixuns_or_courses_filter_user_path(@user, :index => "course", :filter => "join") %>" class="course_filtrate fl" data-remote="true">我参与的</a>
|
||||
</div>
|
||||
</div>
|
||||
<div class="lesson clearfix" id="my_courses_list">
|
||||
<%= render :partial => "my_homepage_courses_list" %>
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -11,8 +11,8 @@
|
|||
<p class="clearfix pl10">
|
||||
<a href="<%= course_path(course) %>" target="_blank" class="font-16 first link-color-grey03"><i class="fa fa-circle-o color-orange02 font-12 ml5 mr5" aria-hidden="true"></i><%= course.name %></a>
|
||||
<span class="font-14 hasmargin"><a href="<%= syllabus_path(course.syllabus) %>" target="_blank" class="link-color-grey03"><%= course.syllabus.title %></a></span>
|
||||
<span class="font-14 hasmargin"><a href="<%= user_path(course.syllabus.user_id) %>" class="link-color-grey03" target="_blank"><%= User.where(:id => course.syllabus.user_id).first.show_name %></a></span>
|
||||
<span class="font-14 mr25 color-grey fr"><%= format_time course.updatetime %></span>
|
||||
<span class="font-14 hasmargin"><a href="<%= user_path(course.syllabus.user_id) %>" class="link-color-grey03" target="_blank"><%= User.where(:id => course.tea_id).first.show_name %></a></span>
|
||||
<span class="font-14 mr25 color-grey fr"><%= format_time course.updated_at %></span>
|
||||
<span class="font-14 last cl" style="display: none;">分享 <i class="fa fa-weixin font-14 blue" aria-hidden="true"></i></span>
|
||||
</p>
|
||||
<% end %>
|
||||
|
|
|
|||
|
|
@ -0,0 +1,7 @@
|
|||
<% if params[:index] == "shixun" %>
|
||||
$("#my_shixuns_list").html("<%= j ( render :partial => "my_homepage_shixuns_list") %>");
|
||||
$("#user_shixun_count").html(" <%= @shixuns_count %>");
|
||||
<% elsif params[:index] == "course" %>
|
||||
$("#my_courses_list").html("<%= j (render :partial => "my_homepage_courses_list") %>");
|
||||
$("#user_course_count").html(" <%= @courses_count %>");
|
||||
<% end %>
|
||||
|
|
@ -40,28 +40,30 @@
|
|||
</span>
|
||||
<%# end %>--->
|
||||
<ul class="fl ml20">
|
||||
<% if @user.apply_user_authentication.blank? || @user.apply_user_authentication.last.try(:status) == 2 %>
|
||||
<li class="pr user-info-span" title="还未实名认证">
|
||||
<i class="fa fa-user u-color-light-grey" aria-hidden="true"></i><!--还未实名认证-->
|
||||
</li>
|
||||
<li class="pr user-info-span" title="还未职业认证">
|
||||
<i class="fa fa-list-alt u-color-light-grey" aria-hidden="true"></i><!--还未职业认证-->
|
||||
</li>
|
||||
<% elsif @user.apply_user_authentication.last.try(:status) == 0 %>
|
||||
<li class="pr user-info-span" title="实名认证中">
|
||||
<i class="fa fa-user u-color-light-red" aria-hidden="true"></i><!--实名认证中-->
|
||||
</li>
|
||||
<li class="pr user-info-span" title="职业认证中">
|
||||
<i class="fa fa-list-alt u-color-light-red" aria-hidden="true"></i><!--职业认证中-->
|
||||
</li>
|
||||
<% elsif @user.apply_user_authentication.last.try(:status) == 1 %>
|
||||
|
||||
<% if @user.authentications %>
|
||||
<li class="pr user-info-span" title="已实名认证">
|
||||
<i class="fa fa-user color-light-green" aria-hidden="true"></i><!--已实名认证-->
|
||||
</li>
|
||||
<li class="pr user-info-span" title="已职业认证">
|
||||
<i class="fa fa-list-alt color-light-green" aria-hidden="true"></i><!--已职业认证-->
|
||||
</li>
|
||||
<% elsif !@user.authentications %>
|
||||
<li class="pr user-info-span" title="还未实名认证">
|
||||
<i class="fa fa-user u-color-light-grey" aria-hidden="true"></i><!--还未实名认证-->
|
||||
</li>
|
||||
<li class="pr user-info-span" title="还未职业认证">
|
||||
<i class="fa fa-list-alt u-color-light-grey" aria-hidden="true"></i><!--还未职业认证-->
|
||||
</li>
|
||||
<% else %>
|
||||
<li class="pr user-info-span" title="实名认证中">
|
||||
<i class="fa fa-user u-color-light-red" aria-hidden="true"></i><!--实名认证中-->
|
||||
</li>
|
||||
<li class="pr user-info-span" title="职业认证中">
|
||||
<i class="fa fa-list-alt u-color-light-red" aria-hidden="true"></i><!--职业认证中-->
|
||||
</li>
|
||||
<% end %>
|
||||
|
||||
<% if @user.try(:phone).blank? %>
|
||||
<li class="pr user-info-span font-16" title="还未绑定手机">
|
||||
<i class="fa fa-mobile u-color-light-grey" aria-hidden="true"></i><!--还未绑定手机-->
|
||||
|
|
@ -224,10 +226,16 @@
|
|||
<% str = current_user ? '我' : 'TA' %>
|
||||
<ul id="edu-user-tab-nav">
|
||||
<li class="edu-user-tab-hover new-tab-nav">
|
||||
<a href="javascript:void(0);" class="tab_type font-16"><%= str %>的实训 <%= @shixuns_count %></a>
|
||||
<a href="javascript:void(0);" class="tab_type font-16"><%= str %>的实训<span id="user_shixun_count"> <%= @shixuns_count %></span></a>
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
<div class="user_bg_shadow">
|
||||
<div style="height: 40px; margin-top: 10px;margin-left: 12px;">
|
||||
<a href="<%= shixuns_or_courses_filter_user_path(@user, :index => "shixun", :filter => "create") %>" class="course_filtrate fl course_filtrate_bg" data-remote="true">我创建的</a>
|
||||
<a href="<%= shixuns_or_courses_filter_user_path(@user, :index => "shixun", :filter => "cooperative") %>" class="course_filtrate fl" data-remote="true">我合作的</a>
|
||||
<a href="<%= shixuns_or_courses_filter_user_path(@user, :index => "shixun", :filter => "challenge") %>" class="course_filtrate fl" data-remote="true">我挑战的</a>
|
||||
</div>
|
||||
</div>
|
||||
<div class="lesson clearfix user_bg_shadow" id="my_shixuns_list">
|
||||
<%= render :partial => "my_homepage_shixuns_list" %>
|
||||
</div>
|
||||
|
|
@ -286,4 +294,9 @@
|
|||
$('#edu-tab-con-'+n).removeClass('undis');
|
||||
$('#edu-tab-nav-'+n).addClass('edu-new-tab-hover');
|
||||
}
|
||||
/* --------------- 课程/实训 tab小图标的点击效果---------------------- */
|
||||
$(".course_filtrate").live("click", function(ev){
|
||||
$(this).parent().find(".course_filtrate_bg").removeClass("course_filtrate_bg");
|
||||
$(ev.target).addClass("course_filtrate_bg");
|
||||
})
|
||||
</script>
|
||||
|
|
@ -105,6 +105,7 @@ RedmineApp::Application.routes.draw do
|
|||
match 'game_build_result', :via => [:get, :post]
|
||||
get 'index_up'
|
||||
get 'index_down'
|
||||
match 'update_evaluation', :via => [:get, :post, :put]
|
||||
end
|
||||
end
|
||||
|
||||
|
|
@ -911,6 +912,7 @@ RedmineApp::Application.routes.draw do
|
|||
match 'watch_projects', :to => 'users#watch_projects', :via => :get
|
||||
get 'update_message_viewed'
|
||||
get 'change_user_email'
|
||||
get 'shixuns_or_courses_filter'
|
||||
#
|
||||
# added by bai
|
||||
match 'show_score', :to => 'users#show_score', :via => :get
|
||||
|
|
|
|||
|
|
@ -2835,7 +2835,7 @@ div.repos_explain{
|
|||
.upload_img img{max-width: 100%;}
|
||||
#activity .upload_img img{max-width: 580px;}
|
||||
|
||||
img,embed{max-width: 100%;}
|
||||
/*img,embed{max-width: 100%;}*/
|
||||
|
||||
img.school_avatar {
|
||||
background: rgb(245, 245, 245);
|
||||
|
|
|
|||
|
|
@ -4,7 +4,7 @@ html,body{ font-size:14px; line-height:2.0; height:100%;}
|
|||
.newContainer{ min-height:100%; height: auto !important; height: 100%; /*IE6不识别min-height*/position: relative;}
|
||||
.newMain{ margin: 0 auto; padding-bottom: 155px; }
|
||||
.newFooter{ position: absolute; bottom: 0; width: 100%; height: 155px;background: #323232; clear:both; min-width: 1200px}
|
||||
.newHeader{background: #24292E;width:100%; height: 50px; min-width: 1200px}
|
||||
.newHeader{background: #46484c;width:100%; height: 50px; min-width: 1200px}
|
||||
/* 2015-06-26 */
|
||||
body,h1,h2,h3,h4,h5,h6,hr,p,blockquote,dl,dt,dd,ul,ol,li,pre,form,fieldset,legend,button,input,textarea,th,td{ margin:0; padding:0;}
|
||||
body,table,input,textarea,select,button { font-family: "微软雅黑","宋体"; font-size:12px;line-height:2.0; background:#eaebec;}
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@ html,body{ font-size:14px; line-height:2.0; height:100%;}
|
|||
.newContainer{ min-height:100%; height: auto !important; height: 100%; /*IE6不识别min-height*/position: relative;}
|
||||
.newMain{ margin: 0 auto; padding-bottom: 155px; }
|
||||
.newFooter{ position: absolute; bottom: 0; width: 100%; height: 155px;background: #323232; clear:both; min-width: 1200px}
|
||||
.newHeader{background: #24292E;width:100%; height: 50px; min-width: 1200px}
|
||||
.newHeader{background: #46484c;width:100%; height: 50px; min-width: 1200px}
|
||||
/* 重置样式 */
|
||||
body,h1,h2,h3,h4,h5,h6,hr,p,blockquote,dl,dt,dd,ul,ol,li,pre,form,fieldset,legend,button,input,textarea,th,td,span{ margin:0; padding:0;}
|
||||
body,table,input,textarea,select,button { font-family: "微软雅黑","宋体"; font-size:14px;line-height:1.9; background:#f5f5f5;; color:#333;}
|
||||
|
|
@ -38,6 +38,7 @@ textarea{resize: none;}
|
|||
/*通用文字功能样式*/
|
||||
.font-bd{ font-weight: bold;}
|
||||
.color-red{ color:#d2322d!important;}
|
||||
.color-black{color:#333!important;}
|
||||
.color-green{color:#51a74f!important;}
|
||||
.color-light-green{color:#29bd8b!important;}
|
||||
.color-blue{color:#3498db!important;}
|
||||
|
|
@ -162,6 +163,7 @@ a.course-bth-blue{cursor: pointer;background-color:#199ed8 ;color: #ffffff;displ
|
|||
.pr {position:relative;}
|
||||
.w100{width: 100px;}
|
||||
.w150{width: 150px;}
|
||||
.w850{width: 850px;}
|
||||
.with10{ width: 10%;}.with15{ width: 15%;}
|
||||
.with20{ width: 20%;}.with25{ width: 25%;}
|
||||
.with30{ width: 30%;}.with35{ width: 35%;}
|
||||
|
|
@ -282,9 +284,9 @@ html>body #ajax-indicator { position: fixed; }
|
|||
|
||||
.white_bg {background: #fff}
|
||||
.user_tab_type {background: #FF6610}
|
||||
.course_filtrate{width: 70px;text-align: center;background: #fff;border-radius: 10px;margin-right: 10px}
|
||||
.course_filtrate:hover{background: #FFDAC1; color: #FF6610;}
|
||||
.course_filtrate_bg{background: #FFDAC1; color: #FF6610!important;}
|
||||
.course_filtrate{width: 70px;text-align: center;background: #fff;border-radius: 10px;margin-right: 10px; border:1px solid #ccc;}
|
||||
.course_filtrate:hover{background: #FFDAC1; color: #FF6610; border:1px solid #FFDAC1;}
|
||||
.course_filtrate_bg{background: #FFDAC1; color: #FF6610!important;border:1px solid #FFDAC1;}
|
||||
|
||||
|
||||
/*最新和最热导航条的公用样式*/
|
||||
|
|
|
|||
|
|
@ -22,7 +22,7 @@ select.header-search-select{ border:none; font-size:14px; padding:5px; backgroun
|
|||
.edu-unlogin-nav a:hover{ color:#3b94d6;}
|
||||
.edu-unlogin-nav{ font-size:12px; color:#fff; line-height:50px;}
|
||||
|
||||
.task-user-dropdown{font-size:12px; line-height: 1.9; width:120px; background-color:#fff; border-radius:3px; box-shadow: 0px 2px 8px rgba(146, 153, 169, 0.5); position:relative; top:5px; right:44px; display: none; z-index:999;}
|
||||
.task-user-dropdown{font-size:12px; line-height: 1.9; width:120px; background-color:#fff; border-radius:3px; box-shadow: 0px 2px 8px rgba(146, 153, 169, 0.5); position:relative; top:5px; right:44px; display: none; z-index:999;}
|
||||
.task-user-dropdown font{ border: 1px solid #dddddd; display: block; border-width: 8px; position: absolute; top: -13px;left:100px; border-style:solid; border-color: transparent transparent #fff transparent;font-size: 0;line-height: 0; box-shadow:2px rgba(146, 153, 169, 0.5); }
|
||||
.task-user-dropdown-nav { padding-top:5px; }
|
||||
.task-user-dropdown-nav li { display: inline-block; text-align: center; width:100%; height: 30px; line-height: 30px;}
|
||||
|
|
@ -270,3 +270,6 @@ a:hover.task-btn-line{ border:1px solid #3498db;background:#3498db;color: #fff;}
|
|||
|
||||
/*新增的公用样式*/
|
||||
.box-boxshadow{box-shadow: 3px 3px 10px rgba(146, 153, 169, 0.2);}
|
||||
.prop-notice-info{padding: 10px;border:1px solid #F3DDB3;background-color: #FFFEF4;}
|
||||
.prop-notice-info ol{list-style-type: disc;list-style-position:inside}
|
||||
.prop-notice-info ol li{list-style-type: disc;color: #ff6532;margin-bottom:0!important;}
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@ html,body{ font-size:14px; line-height:2.0; height:100%;}
|
|||
.newContainer{ min-height:100%; height: auto !important; height: 100%; /*IE6不识别min-height*/position: relative;}
|
||||
.newMain{ margin: 0 auto; padding-bottom: 155px; }
|
||||
.newFooter{ position: absolute; bottom: 0; width: 100%; height: 155px;background: #323232; clear:both; min-width: 1200px}
|
||||
.newHeader{background: #24292E;width:100%; height: 50px; min-width: 1200px}
|
||||
.newHeader{background: #46484c;width:100%; height: 50px; min-width: 1200px}
|
||||
.w20_center{ width: 20px;text-align: center; }
|
||||
.task-container{ min-width:1300px; margin:0 auto; background: #f5f9fc; position: relative;}
|
||||
/*左侧导航*/
|
||||
|
|
@ -324,4 +324,4 @@ a.shixun-task-ban-btn{background-color: #c2c4c6;display: inline-block;font-weigh
|
|||
.return_item{height: 20px;line-height: 20px;margin-top: 5px;}
|
||||
.comment-input{width: 90%;padding: 0px 10px;}
|
||||
.comment-input textarea{border: none !important;width:86%; outline: none;height: 30px;border-radius: 4px;margin-right: 10px;padding-left: 5px;float:left}
|
||||
.comment_position{ position: absolute;bottom: 8px;}
|
||||
.comment_position{ position: absolute;bottom: 8px;}
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@ html,body{ font-size:14px; line-height:2.0; height:100%;}
|
|||
.newContainer{ min-height:100%; height: auto !important; height: 100%; /*IE6不识别min-height*/position: relative;}
|
||||
.newMain{ margin: 0 auto; padding-bottom: 155px; }
|
||||
.newFooter{ position: absolute; bottom: 0; width: 100%; height: 155px;background: #323232; clear:both;}
|
||||
.newHeader{background: #24292E;width:100%; height: 50px}
|
||||
.newHeader{background: #46484c;width:100%; height: 50px}
|
||||
/* 2015-06-26 */
|
||||
body,h1,h2,h3,h4,h5,h6,hr,p,blockquote,dl,dt,dd,ul,ol,li,pre,form,fieldset,legend,button,input,textarea,th,td{ margin:0; padding:0;}
|
||||
body,table,input,textarea,select,button { font-family: "微软雅黑","宋体"; font-size:12px;line-height:1.5; background:#eaebec;}
|
||||
|
|
|
|||
Loading…
Reference in New Issue