Merge branch 'dev_aliyun' of https://bdgit.educoder.net/Hjqreturn/educoder into dev_aliyun

dev_cs
daiao 5 years ago
commit efbbe8adc1

1
.gitignore vendored

@ -59,6 +59,7 @@ vendor/bundle/
.ruby-version
.ruby-gemset
/Users
/files
/public/images/avatars
/public/files

@ -54,8 +54,8 @@ GEM
tzinfo (~> 1.1)
acts-as-taggable-on (6.0.0)
activerecord (~> 5.0)
addressable (2.5.2)
public_suffix (>= 2.0.2, < 4.0)
addressable (2.7.0)
public_suffix (>= 2.0.2, < 5.0)
archive-zip (0.11.0)
io-like (~> 0.3.0)
arel (9.0.0)
@ -180,7 +180,7 @@ GEM
rack (>= 1.2, < 3)
pdfkit (0.8.4.1)
popper_js (1.14.5)
public_suffix (3.0.2)
public_suffix (4.0.1)
puma (3.12.0)
rack (2.0.5)
rack-cors (1.0.2)

@ -44,6 +44,14 @@ $.notifyDefaults({
delay: 2000
});
function show_success_flash(){
$.notify({
message: '操作成功'
},{
type: 'success'
});
}
$(document).on('turbolinks:load', function(){
$('[data-toggle="tooltip"]').tooltip({ trigger : 'hover' });
$('[data-toggle="popover"]').popover();

@ -0,0 +1,70 @@
$(document).on('turbolinks:load', function() {
if ($('body.admins-ec-templates-index-page').length > 0) {
var add_modal = $(".ec-templates-new-add");
var template_file_name = add_modal.find(".template-file-upload");
var attachment_id_input = add_modal.find(".template_attachment_id");
var template_container = $(".ec-templates-list-container");
//编辑附件
template_container.on("click", ".edit-template-content", function () {
var t_id = $(this).attr("data-id");
var t_name = $(this).attr("data-name");
var template_name = $(this).attr("data-template-name");
var t_msg = $(this).attr("data-msg");
var template_id = $(this).attr("data-template-id");
add_modal.modal("show");
add_modal.find(".template_add_title").html(t_msg);
attachment_id_input.val(template_id);
add_modal.find(".template_show_id").val(t_id);
add_modal.find("input[name='name']").val(t_name);
add_modal.find("i.delete-template-icon").attr("data-id", template_id);
if(template_id !== "-1"){
template_file_name.find("span.template-file-input").hide();
template_file_name.find("span.template_file_show").show();
template_file_name.find("span.template_file_show_title").html(template_name);
}
});
//删除附件
add_modal.on("click",".delete-template-icon",function () {
var attachment_id = $(this).attr("data-id");
$.ajax({
url: "/api/attachments/" + attachment_id,
type: "delete",
contentType:"application/json",
dataType:"json",
success: function (data) {
template_file_name.find("span.template-file-input").show();
template_file_name.find("span.template_file_show").hide();
attachment_id_input.attr("value","-1")
}
})
});
//上传附件
add_modal.on("change", "#upload_template_file",function () {
var template = document.getElementById('upload_template_file').files[0];
var file_content = new FormData();
file_content.append("file", template);
$.ajax({
type: "POST",
url: "/api/attachments",
data:file_content,
contentType: false,
processData: false,
success: function (data) {
template_file_name.find("span.template-file-input").hide();
template_file_name.find("span.template_file_show").show();
template_file_name.find("span.template_file_show_title").html(template.name);
template_file_name.find("i.delete-template-icon").attr("data-id",data.id);
attachment_id_input.val(data.id)
}
})
})
}
});

@ -0,0 +1,13 @@
$(document).on('turbolinks:load', function() {
if($(".admins-graduation-standards-index-page").length > 0){
$(".admin-body-container").on("click", ".standard-create-modal", function () {
var content = $(this).attr("data-content");
var g_id = $(this).attr("data-id");
var g_msg = $(this).attr("data-msg");
$("#graduation-modal-type").html(g_msg);
$("#graduation_standard_id").val(g_id);
$("textarea[name='content']").val(content);
})
}
});

@ -50,6 +50,4 @@ input.form-control {
right:20px;
position: absolute;
}
.position-r{position:relative;}
.color-grey-c{color:#ccc}
.inline-block{display:inline-block;}

@ -0,0 +1,22 @@
.admins-ec-templates-index-page{
.template-file-upload{
padding: 10px;
background: #fafafa;
border: 1px dashed #ccc;
text-align: center;
color: #999;
position: relative;
width: 100%;
}
input[name='file']{
opacity: 0;
position: absolute;
display: inline-block;
left: 0;
height: 43px;
top: 0;
width:100%;
cursor: pointer;
}
}

@ -38,3 +38,12 @@ input.form-control {
.width100 { width: 100%;}
.mb10 { margin-bottom: 10px ;}
.mt10 { margin-top: 10px ;}
.mr10{ margin-right: 10px; }
.textarea-width-100{width:100%; resize: none; border: 1px solid #ccc;}
.padding10{padding: 10px;}
.padding5-10{padding: 5px 10px;}
.position-r{position:relative;}
.color-grey-c{color:#ccc}
.inline-block{display:inline-block;}
.hide{display: none;}
.show{display: block;}

@ -10,6 +10,7 @@ class Admins::AuthSchoolsController < Admins::BaseController
ActiveRecord::Base.transaction do
school = School.where(id: params[:id]).first
school.destroy
render_success_js
end
end

@ -0,0 +1,41 @@
class Admins::EcTemplatesController < Admins::BaseController
def index
@params_page = params[:page] || 1
templates = EcTemplate.where(nil).includes(:attachments).order("updated_at desc")
@templates = paginate templates
end
def create_template
ActiveRecord::Base.transaction do
if params[:template_id] == "-1"
ec_template = EcTemplate.new(name: params[:name])
ec_template.save
else
ec_template = EcTemplate.find_by(id: params[:template_id])
end
if params[:attachment_id] != "-1"
attachment_id = params[:attachment_id]
attachment_tem = Attachment.find_by(id: attachment_id)
unless attachment_tem.container_id.present? && attachment_tem.container_id == ec_template&.id
attachment_tem.update_attributes(container_id: ec_template&.id, container_type: "EcTemplate")
end
end
@params_page = params[:page] || 1
templates = EcTemplate.where(nil).includes(:attachments).order("updated_at desc")
@templates = paginate templates
end
end
def destroy
ActiveRecord::Base.transaction do
template = EcTemplate.find_by(id: params[:id])
template.destroy
render_success_js
end
end
end

@ -0,0 +1,33 @@
class Admins::GraduationStandardsController < Admins::BaseController
def index
standards = EcGraduationStandard.all.order("updated_at desc")
@params_page = params[:page] || 1
@standards = paginate standards
end
def create_standard
ActiveRecord::Base.transaction do
if params[:graduation_id] == "-1"
content = params[:content]
EcGraduationStandard.create(:content => content)
else
graduation = EcGraduationStandard.find_by(id: params[:graduation_id])
graduation.update_attribute(:content, params[:content])
end
standards = EcGraduationStandard.all.order("updated_at desc")
@params_page = params[:page] || 1
@standards = paginate standards
end
end
def destroy
ActiveRecord::Base.transaction do
@graduation = EcGraduationStandard.find_by(id: params[:id])
@graduation.destroy
render_success_js
end
end
end

@ -25,7 +25,8 @@ class MyshixunsController < ApplicationController
begin
@shixun = Shixun.select(:id, :identifier, :challenges_count).find(@myshixun.shixun_id)
@myshixun.destroy!
StudentWork.where(:myshixun_id => @myshixun.id).update_all(:myshixun_id => 0, :work_status => 0)
StudentWork.where(:myshixun_id => @myshixun.id).update_all(myshixun_id: 0, work_status: 0, work_score: nil,
final_score: nil, efficiency: 0, eff_score: 0, calculation_time: nil, cost_time: 0, compelete_status: 0)
rescue Exception => e
logger.error("######reset_my_game_failed:#{e.message}")
raise("ActiveRecord::RecordInvalid")

@ -56,11 +56,6 @@ module ApplicationHelper
end
# 相关推荐
def relation_path(shixun)
shixun.subjects.where(hidden: 0).limit(2)
end
# shixun开启挑战对应的行为名及url
def task_operation_url current_myshixun, shixun
if current_myshixun.blank?

@ -240,6 +240,6 @@ module HomeworkCommonsHelper
def student_redo_work work, homework
publish_time = homework.homework_group_setting(work.user_id)&.publish_time
work.myshixun && publish_time && work.myshixun.games.where("status = 2 and answer_open = 1 and end_time <= '#{publish_time}'").count > 0
work.myshixun && publish_time && work.myshixun.games.where("status = 2 and answer_open = 1 and end_time <= '#{publish_time}'").count > 0 ? true : false
end
end

@ -0,0 +1,6 @@
class EcTemplate < ActiveRecord::Base
# attr_accessible :title, :body
# acts_as_attachable
has_many :attachments, as: :container
end

@ -280,6 +280,11 @@ class Shixun < ApplicationRecord
self.mirror_name.include?('JavaWeb') || self.mirror_name.include?('PHP') && self.mirror_name.include?('Mysql') || self.mirror_name.include?('Web')
end
# 所属实践课程
def relation_path
subjects.where(hidden: 0).uniq
end
private
def send_tiding

@ -106,7 +106,7 @@ a.decoration{text-decoration: underline}
.mr3{margin-right: 3px}.mr4{margin-right: 4px}.mr5{ margin-right: 5px;}.mr8{ margin-right: 8px;}.mr10{ margin-right: 10px;}.mr12{ margin-right:12px!important;}.mr15{ margin-right: 15px;}.mr18{ margin-right: 18px;}.mr20{ margin-right: 20px;}.mr24{ margin-right: 24px;}.mr25{ margin-right: 25px;}.mr30{ margin-right:30px;}.mr35{margin-right:35px;}.mr40{margin-right:40px;}.mr45{margin-right:45px;}.mr50{ margin-right: 50px;}.mr60{ margin-right:60px;}.mr70{ margin-right: 70px;}.mr75{ margin-right: 75px;}.mr80{ margin-right:80px;}.mr90{ margin-right:90px;}.mr100{ margin-right: 100px;}.mr110{ margin-right:110px;}.mr350{ margin-right:350px;}
.pt1{ padding-top:1px;}.pt3{ padding-top:3px!important;}.pt5{ padding-top:5px!important;}.pt10{ padding-top:10px;}.pt15{ padding-top:15px;}.pt17{ padding-top:17px;}.pt20{ padding-top:20px!important;}.pt25{ padding-top:25px;}.pt30{ padding-top:30px;}.pt35{ padding-top:35px;}.pt37{ padding-top:37px;}.pt40{ padding-top:40px;}.pt47{ padding-top:47px;}.pt49{ padding-top:49px;}.pt50{ padding-top:50px;}.pt60{ padding-top:60px;}.pt70{ padding-top:70px;}.pt80{ padding-top:80px;}.pt90{ padding-top:90px;}.pt100{padding-top:100px;}.pt110{ padding-top:110px;}.pt120{ padding-top:120px;}.pt130{padding-top:130px;}
.pb3{ padding-bottom:3px!important;}.pb5{ padding-bottom:5px!important;}.pb10{ padding-bottom:10px;}.pb15{ padding-bottom:15px;}.pb20{ padding-bottom:20px;}.pb25{ padding-bottom:20px;}.pb25{ padding-bottom:20px;}.pb30{ padding-bottom:30px;}.pb35{ padding-bottom:35px;}.pb40{ padding-bottom:40px;}.pb47{ padding-bottom:47px;}.pb50{ padding-bottom:50px;}.pb60{ padding-bottom:60px;}.pb70{ padding-bottom:70px;}.pb80{ padding-bottom:80px;}.pb90{ padding-bottom:90px;}.pb100{ padding-bottom:100px;}.pb110{ padding-bottom:110px;}.pb155{ padding-bottom:155px;}
.pb3{ padding-bottom:3px!important;}.pb5{ padding-bottom:5px!important;}.pb10{ padding-bottom:10px;}.pb15{ padding-bottom:15px;}.pb20{ padding-bottom:20px;}.pb25{ padding-bottom:20px;}.pb25{ padding-bottom:20px;}.pb28{ padding-bottom:28px;}.pb30{ padding-bottom:30px;}.pb35{ padding-bottom:35px;}.pb40{ padding-bottom:40px;}.pb47{ padding-bottom:47px;}.pb50{ padding-bottom:50px;}.pb60{ padding-bottom:60px;}.pb70{ padding-bottom:70px;}.pb80{ padding-bottom:80px;}.pb90{ padding-bottom:90px;}.pb100{ padding-bottom:100px;}.pb110{ padding-bottom:110px;}.pb155{ padding-bottom:155px;}
.pr2{ paddding-right:2px;}.pr5{ padding-right:5px;}.pr10{ padding-right:10px;}.pr15{ padding-right:15px;}.pr20{ padding-right:20px!important;}.pr30{ padding-right:30px!important;}.pr35{ padding-right:35px!important;}.pr42{ padding-right:42px;}.pr45{ padding-right:45px;}.pr48{ padding-right:48px;}.pr57{ padding-right:57px;}.pr60{ padding-right:60px;}.pr70{ padding-right:70px;}.pr72{ padding-right:72px;}.pr75{ padding-right:75px;}.pr88{ padding-right:88px;}
.pl0{ padding-left:0px!important;}.pl2{ padding-left:2px;}.pl5{ padding-left:5px;}.pl7{ padding-left:7px;}.pl8{ padding-left:8px;}.pl10{ padding-left:10px;}.pl15{ padding-left:15px;}.pl20{ padding-left:20px;}.pl22{ padding-left:22px;}.pl25{ padding-left:25px;}.pl28{ padding-left:28px;}.pl30{ padding-left:30px !important;}.pl33{padding-left: 33px}.pl35{ padding-left:35px;}.pl40{ padding-left:40px;}.pl42{ padding-left:42px;}.pl45{ padding-left:45px;}.pl50{ padding-left:50px;}.pl60{ padding-left:60px;}.pl70{padding-left:70px;}.pl75{padding-left:75px;}.pl80{padding-left:80px;}.pl88{ padding-left:88px;}.pl92{padding-left:92px;}.pl100{ padding-left:100px;}
@ -557,11 +557,6 @@ a.user_greybg_btn{background-color:#747A7F;color: #fff;}
.cdefault{cursor: default}
/*md编辑器恢复被覆盖样式*/
.new_li li{ list-style-type: disc!important; }
.new_li ol li{ list-style-type: decimal!important; }
.new_li li{ margin-bottom: 0!important; }
/*搜索框*/
#pollingPanel{position: relative;width: 248px;height: 32px;}
#pollingPanel > input{width: 100%;height: 100%;border:1px solid #eaeaea;border-radius: 4px;padding: 0px 30px 0px 5px;box-sizing: border-box;background-color: #F4F4F4;}

@ -4,3 +4,5 @@ if($(".auth-schools-user-add").length > 0){
<% if @school_users.size > 0 %>
$("#table-school-<%= @school_id %>").find(".school_user_list").html("<%= j render partial: "admins/auth_schools/shared/school_user_list", locals: {users: @school_users, school_id: @school_id} %> ")
<% end %>
show_success_flash()

@ -1,2 +1,4 @@
$(".auth-schools-list-container").html("<%= j render partial: "admins/auth_schools/shared/list", locals: {schools: @schools} %>")
$(".auth-schools-new-add").modal("hide")
show_success_flash()

@ -1 +0,0 @@
$("#table-school-<%= params[:id] %>").remove()

@ -1,2 +1,3 @@
$("#table-school-<%= params[:school_id] %>").find("#manager-<%= params[:user_id] %>").remove()
$("#table-school-<%= params[:school_id] %>").find("#manager-<%= params[:user_id] %>").remove()
show_success_flash()

@ -0,0 +1,3 @@
$(".ec-templates-new-add").modal("hide")
$(".ec-templates-list-container").html("<%= j render partial: "admins/ec_templates/shared/list", locals: {templates: @templates} %>")
show_success_flash()

@ -0,0 +1,15 @@
<% define_admin_breadcrumbs do %>
<% add_admin_breadcrumb('导入模板管理') %>
<% end %>
<div class="box search-form-container ec-templates-list-form">
<%= javascript_void_link '新增', class: 'btn btn-primary', data: { toggle: 'modal', target: '.ec-templates-new-add' } %>
</div>
<div class="box ec-templates-list-container">
<%= render(partial: 'admins/ec_templates/shared/list', locals: { templates: @templates }) %>
</div>
<%= render partial: "admins/ec_templates/shared/templates_add_modal" %>
<%#= render partial: "admins/auth_schools/shared/user_add_modal" %>

@ -0,0 +1 @@
$(".ec-templates-list-container").html("<%= j render partial: "admins/ec_templates/shared/list", locals: {templates: @templates} %>")

@ -0,0 +1,35 @@
<table class="table" cellspacing="0" cellpadding="0">
<thead>
<th width="8%">序号</th>
<th width="40%">模板名称</th>
<th width="40%">上传模板</th>
<th width="10%">操作</th>
</thead>
<tbody>
<% if templates.size > 0 %>
<% templates.each_with_index do |t, index| %>
<% attachment = t.attachments.first %>
<tr id="template-item-<%= t.id %>">
<td><%= list_index_no(@params_page.to_i, index) %></td>
<td><%= t.name %></td>
<td>
<% if attachment.present? %>
<%= link_to "#{attachment.try(:filename)}",attachment_path(attachment), target: "_blank" %>
<% end %>
</td>
<td>
<%= link_to "<i class='fa fa-edit color-grey-c fa-fw font-18 padding10-5'></i>".html_safe,
"javascript:void(0)", data: {"id": "#{t.id}", "template-id": "#{attachment.present? ? attachment.id : "-1"}",
msg: "编辑", name: "#{t.name}", "template_name": "#{attachment.try(:filename)}"}, class: "edit-template-content" %>
<%= link_to "<i class='fa fa-trash-o color-grey-c fa-fw font-18 padding10-5'></i>".html_safe, admins_ec_template_path(t.id), method: :delete, data: {confirm: "确认删除吗?"}, remote: true, title: "删除" %>
</td>
</tr>
<% end %>
<% else %>
<%= render 'admins/shared/no_data_for_table' %>
<% end %>
</tbody>
</table>
<%= render partial: 'admins/shared/paginate', locals: { objects: templates } %>

@ -0,0 +1,44 @@
<div class="modal fade ec-templates-new-add" tabindex="-1" role="dialog" aria-hidden="true">
<div class="modal-dialog modal-dialog-centered" role="document">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title"><span class="template_add_title">新建</span>导入模版</h5>
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
<span aria-hidden="true">&times;</span>
</button>
</div>
<%= form_tag(create_template_admins_ec_templates_path, method: :post, remote: true ) do %>
<%= hidden_field_tag(:attachment_id,"-1",class:"template_attachment_id") %>
<%= hidden_field_tag(:template_id,"-1",class:"template_show_id") %>
<div class="modal-body">
<div class="form-group d-flex">
<label for="template_name" class="col-form-label mr10">模板名称:</label>
<div class="d-flex flex-column-reverse w-75">
<%= text_field_tag("name","",class: "form-control", placeholder: "请输入模版名称", id: 'template_name') %>
</div>
</div>
<div class="form-group d-flex">
<label for="template_name" class="col-form-label mr10">上传文件:</label>
<div class="d-flex flex-column-reverse w-75">
<div class="template-file-upload">
<span class="template_file_show hide">
<span class="template_file_show_title">
</span>
<i class="fa fa-trash-o color-grey padding5-10 ml-5 delete-template-icon" title="删除"></i>
</span>
<span class="template-file-input">
<%= file_field_tag(:file, id: "upload_template_file") %>
<i class="fa fa-plus-circle font-20"></i> 上传文件
</span>
</div>
</div>
</div>
</div>
<div class="modal-footer">
<%= submit_tag("提交",class:"btn btn-primary", 'data-disable-with': "提交中...") %>
</div>
<% end %>
</div>
</div>
</div>

@ -0,0 +1,3 @@
$(".graduation-standards-add").removeClass("show").modal("hide")
$(".graduation-standards-list-container").html("<%= j render partial: "admins/graduation_standards/shared/list", locals: { standards: @standards } %>")
show_success_flash()

@ -0,0 +1,14 @@
<% define_admin_breadcrumbs do %>
<% add_admin_breadcrumb('毕业要求通用标准') %>
<% end %>
<div class="box search-form-container graduation-standards-list-form">
<%= javascript_void_link '新增', class: 'btn btn-primary standard-create-modal', data: { toggle: 'modal', target: '.graduation-standards-add',
id: "-1", content: "", msg: "添加" } %>
</div>
<div class="box graduation-standards-list-container">
<%= render(partial: 'admins/graduation_standards/shared/list', locals: { standards: @standards }) %>
</div>
<%= render partial: "admins/graduation_standards/shared/add_standard_modal" %>

@ -0,0 +1 @@
$(".graduation-standards-list-container").html("<%= j render partial: "admins/graduation_standards/shared/list", locals: { standards: @standards } %>")

@ -0,0 +1,22 @@
<div class="modal fade graduation-standards-add" tabindex="-1" role="dialog" aria-hidden="true">
<div class="modal-dialog modal-dialog-centered" role="document">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title"><span id="graduation-modal-type">添加</span>通用标准</h5>
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
<span aria-hidden="true">&times;</span>
</button>
</div>
<%= form_tag(create_standard_admins_graduation_standards_path, method: :post ,remote: true) do %>
<%= hidden_field_tag(:graduation_id, "", id: "graduation_standard_id") %>
<div class="modal-body">
<%= text_area_tag(:content,"",placeholder: "请输入通用标准内容", rows: "3", class: "textarea-width-100") %>
</div>
<div class="modal-footer">
<%= submit_tag("提交",class:"btn btn-primary", 'data-disable-with': "提交中...") %>
</div>
<% end %>
</div>
</div>
</div>

@ -0,0 +1,27 @@
<table class="table" cellspacing="0" cellpadding="0">
<thead>
<th width="8%">序号</th>
<th width="82%">通用标准</th>
<th width="10%">操作</th>
</thead>
<tbody>
<% if standards.size > 0 %>
<% standards.each_with_index do |standard, index| %>
<tr id="standard-item-<%= standard.id %>">
<td><%= list_index_no(@params_page.to_i, index) %></td>
<td><%= standard.content %></td>
<td>
<%= javascript_void_link "<i class='fa fa-edit color-grey-c fa-fw font-18 padding10-5'></i>".html_safe, class: 'standard-create-modal',
data: { toggle: 'modal', target: '.graduation-standards-add', id: "#{standard.id}", content: "#{standard.content}", msg: "编辑" }, title: "编辑" %>
<%= link_to "<i class='fa fa-trash-o color-grey-c fa-fw font-18 padding10-5'></i>".html_safe, admins_graduation_standard_path(standard), method: :delete, data: {confirm: "确认删除吗?"}, remote: true, title: "删除" %>
</td>
</tr>
<% end %>
<% else %>
<%= render 'admins/shared/no_data_for_table' %>
<% end %>
</tbody>
</table>
<%= render partial: 'admins/shared/paginate', locals: { objects: standards } %>

@ -70,6 +70,8 @@
<%= sidebar_item_group('#major-identification-submenu', '工程认证', icon: 'anchor') do %>
<li><%= sidebar_item(admins_major_informations_path, '本科专业目录', icon: 'outdent', controller: 'admins-major_informations') %></li>
<li><%= sidebar_item(admins_auth_schools_path, '认证单位列表', icon: 'th', controller: 'admins-auth_schools') %></li>
<li><%= sidebar_item(admins_graduation_standards_path, '毕业要求通用标准', icon: 'file-word-o', controller: 'admins-graduation_standards') %></li>
<li><%= sidebar_item(admins_ec_templates_path, '导入模板管理', icon: 'file-excel-o', controller: 'admins-ec_templates') %></li>
<% end %>
</li>

@ -7,6 +7,8 @@ json.attachments @attachments do |attachment|
json.partial! "attachments/attachment_simple", locals: {attachment: attachment}
end
json.cross_comment @task.cross_comment
json.comment_status @task.comment_status
if @user_course_identity == Course::STUDENT
json.work_id @task.user_work(@current_user.id).try(:id)

@ -31,7 +31,7 @@ elsif @user_course_identity == Course::STUDENT
json.left_time left_time @homework, @current_user.id
if @homework.homework_type == "practice"
json.(@work, :id, :work_status, :update_time, :ultimate_score, :myshixun_id)
json.(@work, :id, :work_status, :update_time, :ultimate_score)
json.calculation_time @work.calculation_time
json.late_penalty @work.late_penalty if @homework.allow_late
json.cost_time @work.myshixun.try(:total_spend_time)
@ -40,7 +40,8 @@ elsif @user_course_identity == Course::STUDENT
json.efficiency work_score_format(@work.efficiency, true, @score_open)
json.eff_score work_score_format(@work.eff_score, true, @score_open)
json.complete_count @work.myshixun.try(:passed_count)
json.redo_work @homework.end_or_late ? false : student_redo_work(@work, @homework)
json.redo_work (@homework.end_or_late ? false : student_redo_work(@work, @homework))
json.myshixun_identifier @work.myshixun&.identifier
else
json.(@work, :id, :work_status, :update_time, :ultimate_score)

@ -3,14 +3,14 @@ json.creator do
json.partial! 'users/user', locals: { user: shixun.owner }
end
# 推荐实训
json.recommands do
json.partial! 'shap_shixun', locals: { shixuns: recommend_shixun(shixun) }
end
# 相关路径
json.paths do
json.partial! 'subjects/subject', locals: {subjects: relation_path(shixun)}
json.partial! 'subjects/subject', locals: {subjects: shixun.relation_path}
end
# 推荐实训
json.recommands do
json.partial! 'shap_shixun', locals: { shixuns: shixun.relation_path.size > 0 ? recommend_shixun(shixun) : [] }
end
# 技能标签

@ -811,6 +811,16 @@ Rails.application.routes.draw do
namespace :admins do
get '/', to: 'dashboards#index'
resources :major_informations, only: [:index]
resources :ec_templates, only: [:index, :destroy] do
collection do
post :create_template
end
end
resources :graduation_standards, only: [:index, :destroy] do
collection do
post :create_standard
end
end
resources :auth_schools, only: [:index, :destroy] do
collection do
get :search_school

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

@ -27818,6 +27818,7 @@ $.fn.bootstrapViewer.defaults = {
}));
function createMDEditor(element, opts){
var defaults = {
height: 600,
path: '/editormd/lib/',
syncScrolling: "single",
tex: true,
@ -133765,6 +133766,13 @@ $(document).on('turbolinks:load', function() {
}
})
;
function show_add_manager(id) {
$(".auth-schools-user-add").modal("show");
$(".auth-schools-user-add").find("#school_id_input").val(id)
}
;
$(document).on('turbolinks:load', function() {
var $refuseModal = $('.admin-common-refuse-modal');
if ($refuseModal.length > 0) {
@ -134181,6 +134189,89 @@ $(document).on('turbolinks:load', function() {
});
}
});
$(document).on('turbolinks:load', function() {
if ($('body.admins-ec-templates-index-page').length > 0) {
var add_modal = $(".ec-templates-new-add");
var template_file_name = add_modal.find(".template-file-upload");
var attachment_id_input = add_modal.find(".template_attachment_id");
var template_container = $(".ec-templates-list-container");
//编辑附件
template_container.on("click", ".edit-template-content", function () {
var t_id = $(this).attr("data-id");
var t_name = $(this).attr("data-name");
var template_name = $(this).attr("data-template-name");
var t_msg = $(this).attr("data-msg");
var template_id = $(this).attr("data-template-id");
add_modal.modal("show");
add_modal.find(".template_add_title").html(t_msg);
attachment_id_input.val(template_id);
add_modal.find(".template_show_id").val(t_id);
add_modal.find("input[name='name']").val(t_name);
add_modal.find("i.delete-template-icon").attr("data-id", template_id);
if(template_id !== "-1"){
template_file_name.find("span.template-file-input").hide();
template_file_name.find("span.template_file_show").show();
template_file_name.find("span.template_file_show_title").html(template_name);
}
});
//删除附件
add_modal.on("click",".delete-template-icon",function () {
var attachment_id = $(this).attr("data-id");
$.ajax({
url: "/api/attachments/" + attachment_id,
type: "delete",
contentType:"application/json",
dataType:"json",
success: function (data) {
template_file_name.find("span.template-file-input").show();
template_file_name.find("span.template_file_show").hide();
attachment_id_input.attr("value","-1")
}
})
});
//上传附件
add_modal.on("change", "#upload_template_file",function () {
var template = document.getElementById('upload_template_file').files[0];
var file_content = new FormData();
file_content.append("file", template);
$.ajax({
type: "POST",
url: "/api/attachments",
data:file_content,
contentType: false,
processData: false,
success: function (data) {
template_file_name.find("span.template-file-input").hide();
template_file_name.find("span.template_file_show").show();
template_file_name.find("span.template_file_show_title").html(template.name);
template_file_name.find("i.delete-template-icon").attr("data-id",data.id);
attachment_id_input.val(data.id)
}
})
})
}
});
$(document).on('turbolinks:load', function() {
if($(".admins-graduation-standards-index-page").length > 0){
$(".admin-body-container").on("click", ".standard-create-modal", function () {
var content = $(this).attr("data-content");
var g_id = $(this).attr("data-id");
var g_msg = $(this).attr("data-msg");
$("#graduation-modal-type").html(g_msg);
$("#graduation_standard_id").val(g_id);
$("textarea[name='content']").val(content);
})
}
});
$(document).on('turbolinks:load', function() {
if ($('body.admins-help-centers-edit-page, body.admins-help-centers-update-page').length > 0) {
createMDEditor('help-center-editor', {});
@ -134229,6 +134320,19 @@ $(document).on('turbolinks:load', function() {
}
})
;
$(document).on('turbolinks:load', function() {
if ($('body.admins-major-informations-index-page').length > 0) {
var box_contain = $(".major-informations-list-container");
box_contain.on("click",".collapse-item",function () {
var a_fa = $(this).find("i");
if(a_fa.hasClass("fa-caret-right")){
a_fa.removeClass("fa-caret-right").addClass("fa-caret-down");
}else{
a_fa.removeClass("fa-caret-down").addClass("fa-caret-right");
}
});
}
});
$(document).on('turbolinks:load', function() {
var $modal = $('.modal.admin-message-modal');
var $submitBtn = $modal.find('.submit-btn');
@ -135432,6 +135536,14 @@ $.notifyDefaults({
delay: 2000
});
function show_success_flash(){
$.notify({
message: '操作成功'
},{
type: 'success'
});
}
$(document).on('turbolinks:load', function(){
$('[data-toggle="tooltip"]').tooltip({ trigger : 'hover' });
$('[data-toggle="popover"]').popover();

@ -10,7 +10,6 @@ body,h1,h2,h3,h4,h5,h6,hr,p,blockquote,dl,dt,dd,ul,ol,li,pre,form,fieldset,legen
table,input,textarea,select,button { font-family: "微软雅黑","宋体"; font-size:14px;line-height:1.9; background:#f5f5f5; color:#333;}
div,img,tr,td,table{ border:0;}
table,tr,td{border:0;}
ol,ul,li{ list-style-type:none}
a:link,a:visited{text-decoration:none;color:#898989; }
a:hover {color:#4CACFF;}
a:hover.fa{color:#4CACFF;}
@ -117,7 +116,7 @@ a:hover.link-color-grey03{color:#3498db!important;}
.mr3{margin-right: 3px}.mr4{margin-right: 4px}.mr5{ margin-right: 5px;}.mr8{ margin-right: 8px;}.mr10{ margin-right: 10px;}.mr12{ margin-right:12px!important;}.mr15{ margin-right: 15px;}.mr18{ margin-right: 18px;}.mr20{ margin-right: 20px;}.mr25{ margin-right: 25px;}.mr30{ margin-right:30px;}.mr35{margin-right:35px;}.mr40{margin-right:40px;}.mr45{margin-right:45px;}.mr50{ margin-right: 50px;}.mr60{ margin-right:60px;}.mr350{ margin-right:350px;}.pt5{ padding-top:5px;}.pt10{ padding-top:10px;}.pt15{ padding-top:15px;}.pt20{ padding-top:20px;}.pt30{ padding-top:30px;}.pt40{ padding-top:40px;}.pt47{ padding-top:47px;}.pt100{padding-top:100px;}.pt130{padding-top:130px;}
.pt1{ padding-top:1px;}.pt5{ padding-top:5px;}.pt10{ padding-top:10px;}.pt15{ padding-top:15px;}.pt20{ padding-top:20px;}.pt30{ padding-top:30px;}.pt40{ padding-top:40px;}
.pb5{ padding-bottom:5px;}.pb10{ padding-bottom:10px;}.pb15{ padding-bottom:15px;}.pb20{ padding-bottom:20px;}.pb30{ padding-bottom:30px;}.pb40{ padding-bottom:40px;}.pb47{ padding-bottom:47px;}.pb50{ padding-bottom:50px;}.pb155{ padding-bottom:155px;}
.pb5{ padding-bottom:5px;}.pb10{ padding-bottom:10px;}.pb15{ padding-bottom:15px;}.pb20{ padding-bottom:20px;}.pb28{ padding-bottom:28px;}.pb30{ padding-bottom:30px;}.pb40{ padding-bottom:40px;}.pb47{ padding-bottom:47px;}.pb50{ padding-bottom:50px;}.pb155{ padding-bottom:155px;}
.pl2{ padding-left:2px;}.pl5{ padding-left:5px;}.pl8{ padding-left:8px;}.pl10{ padding-left:10px;}.pl15{ padding-left:15px;}.pl20{ padding-left:20px;}.pl28{ padding-left:28px;}.pl30{ padding-left:30px;}.pl33{padding-left: 33px}.pl40{ padding-left:40px;}.pl42{ padding-left:42px;}.pl45{ padding-left:45px;}.pl50{ padding-left:50px;}.pl100{ padding-left:100px;}.pl35{ padding-left:35px;}.pl50{padding-left:50px;}.pl70{padding-left:70px;}.pl80{padding-left:80px;}.pl92{padding-left:92px;}
.pr2{ paddding-right:2px;}.pr5{ padding-right:5px;}.pr10{ padding-right:10px;}.pr15{ padding-right:15px;}.pr20{ padding-right:20px!important;}.pr30{ padding-right:30px!important;}.pr42{ padding-right:42px;}.pr45{ padding-right:45px;}
@ -1416,9 +1415,6 @@ a.sortArrowActiveD {background:url(../images/post_image_list.png) -0px -20px no-
a.sortArrowActiveU {background:url(../images/post_image_list.png) -17px -20px no-repeat; width:7px; height:9px; float:left; margin-left:5px; margin-top:10px;}
.postSort {width:75px; float:right}
.shixunPostSort {width:60px; float:right}
.new_li li{ list-style-type: disc!important; }
.new_li ol li{ list-style-type: decimal!important; }
.new_li li{ margin-bottom: 0!important; }
.remove_li li{ list-style-type: none!important;}
a.shixun-task-btn { display: inline-block;font-weight: bold;border: none;padding: 0 12px;color: #666;letter-spacing: 1px;text-align: center;font-size: 14px;height: 30px;line-height: 30px;border-radius: 3px; }

@ -10,7 +10,6 @@ body,h1,h2,h3,h4,h5,h6,hr,p,blockquote,dl,dt,dd,ul,ol,li,pre,form,fieldset,legen
table,input,textarea,select,button { font-family: "微软雅黑","宋体"; font-size:14px;line-height:1.9; background:#f5f5f5; color:#333;}
div,img,tr,td,table{ border:0;}
table,tr,td{border:0;}
ol,ul,li{ list-style-type:none}
a:link,a:visited{text-decoration:none;color:#898989; }
a:hover {color:#FF7500;}
a:hover.fa{color:#FF7500;}
@ -117,7 +116,7 @@ a:hover.link-color-grey03{color:#3498db!important;}
.mr3{margin-right: 3px}.mr4{margin-right: 4px}.mr5{ margin-right: 5px;}.mr8{ margin-right: 8px;}.mr10{ margin-right: 10px;}.mr12{ margin-right:12px!important;}.mr15{ margin-right: 15px;}.mr18{ margin-right: 18px;}.mr20{ margin-right: 20px;}.mr25{ margin-right: 25px;}.mr30{ margin-right:30px;}.mr35{margin-right:35px;}.mr40{margin-right:40px;}.mr45{margin-right:45px;}.mr50{ margin-right: 50px;}.mr60{ margin-right:60px;}.mr350{ margin-right:350px;}.pt5{ padding-top:5px;}.pt10{ padding-top:10px;}.pt15{ padding-top:15px;}.pt20{ padding-top:20px;}.pt30{ padding-top:30px;}.pt40{ padding-top:40px;}.pt47{ padding-top:47px;}.pt100{padding-top:100px;}.pt130{padding-top:130px;}
.pt1{ padding-top:1px;}.pt5{ padding-top:5px;}.pt10{ padding-top:10px;}.pt15{ padding-top:15px;}.pt20{ padding-top:20px;}.pt30{ padding-top:30px;}.pt40{ padding-top:40px;}
.pb5{ padding-bottom:5px;}.pb10{ padding-bottom:10px;}.pb15{ padding-bottom:15px;}.pb20{ padding-bottom:20px;}.pb30{ padding-bottom:30px;}.pb40{ padding-bottom:40px;}.pb47{ padding-bottom:47px;}.pb50{ padding-bottom:50px;}.pb155{ padding-bottom:155px;}
.pb5{ padding-bottom:5px;}.pb10{ padding-bottom:10px;}.pb15{ padding-bottom:15px;}.pb20{ padding-bottom:20px;}.pb28{ padding-bottom:28px;}.pb30{ padding-bottom:30px;}.pb40{ padding-bottom:40px;}.pb47{ padding-bottom:47px;}.pb50{ padding-bottom:50px;}.pb155{ padding-bottom:155px;}
.pl2{ padding-left:2px;}.pl5{ padding-left:5px;}.pl8{ padding-left:8px;}.pl10{ padding-left:10px;}.pl15{ padding-left:15px;}.pl20{ padding-left:20px;}.pl28{ padding-left:28px;}.pl30{ padding-left:30px;}.pl33{padding-left: 33px}.pl40{ padding-left:40px;}.pl42{ padding-left:42px;}.pl45{ padding-left:45px;}.pl50{ padding-left:50px;}.pl100{ padding-left:100px;}.pl35{ padding-left:35px;}.pl50{padding-left:50px;}.pl70{padding-left:70px;}.pl80{padding-left:80px;}.pl92{padding-left:92px;}
.pr2{ paddding-right:2px;}.pr5{ padding-right:5px;}.pr10{ padding-right:10px;}.pr15{ padding-right:15px;}.pr20{ padding-right:20px!important;}.pr30{ padding-right:30px!important;}.pr42{ padding-right:42px;}.pr45{ padding-right:45px;}

@ -296,9 +296,6 @@ a.sortArrowActiveD {background:url(../images/post_image_list.png) -0px -20px no-
a.sortArrowActiveU {background:url(../images/post_image_list.png) -17px -20px no-repeat; width:7px; height:9px; float:left; margin-left:5px; margin-top:10px;}
.postSort {width:75px; float:right}
.shixunPostSort {width:60px; float:right}
.new_li li{ list-style-type: disc!important; }
.new_li ol li{ list-style-type: decimal!important; }
.new_li li{ margin-bottom: 0!important; }
.remove_li li{ list-style-type: none!important;}
a.shixun-task-btn { display: inline-block;font-weight: bold;border: none;padding: 0 12px;color: #666;letter-spacing: 1px;text-align: center;font-size: 14px;height: 30px;line-height: 30px;border-radius: 3px; }

@ -1,10 +1,10 @@
const isDev = window.location.port == 3007;
export const TEST_HOST = "https://pre-newweb.educoder.net"
export const TEST_HOST = "https://test-newweb.educoder.net"
export function getImageUrl(path) {
// https://www.educoder.net
// https://testbdweb.trustie.net
// const local = 'http://localhost:3000'
const local = 'https://pre-newweb.educoder.net'
const local = 'https://test-newweb.educoder.net'
if (isDev) {
return `${local}/${path}`
}
@ -12,7 +12,7 @@ export function getImageUrl(path) {
}
export function setImagesUrl(path){
const local = 'https://pre-newweb.educoder.net'
const local = 'https://test-newweb.educoder.net'
let firstStr=path.substr(0,1);
// console.log(firstStr);
if(firstStr=="/"){
@ -31,7 +31,7 @@ export function getUrl(path, goTest) {
// testbdweb.educoder.net testbdweb.trustie.net
// const local = goTest ? 'https://testeduplus2.educoder.net' : 'http://localhost:3000'
// const local = 'https://testeduplus2.educoder.net'
const local = 'https://pre-newweb.educoder.net'
const local = 'https://test-newweb.educoder.net'
if (isDev) {
return `${local}${path?path:''}`
}

@ -32,7 +32,7 @@ import _ from 'lodash'
import TPIContext from './TPIContext'
import { EDU_ADMIN, EDU_SHIXUN_MANAGER, EDU_SHIXUN_MEMBER, EDU_CERTIFICATION_TEACHER
, EDU_GAME_MANAGER, EDU_TEACHER, EDU_NORMAL, EDU_BUSINESS} from 'educoder'
, EDU_GAME_MANAGER, EDU_TEACHER, EDU_NORMAL, EDU_BUSINESS, CNotificationHOC } from 'educoder'
import { MuiThemeProvider, createMuiTheme, withStyles } from 'material-ui/styles';
import MUIDialogStyleUtil from '../modules/page/component/MUIDialogStyleUtil'
@ -877,6 +877,7 @@ pop_box_new(htmlvalue, 480, 182);
return (
<TPIContext.Provider
value={{
...this.props,
...this.state,
resetTestSetsExpandedArray: this.resetTestSetsExpandedArray,
onRunCodeTestFinish: this.onRunCodeTestFinish,
@ -961,7 +962,7 @@ pop_box_new(htmlvalue, 480, 182);
}
}
export default withStyles(styles) (TPIContextProvider);
export default CNotificationHOC() (withStyles(styles) (TPIContextProvider));

@ -296,11 +296,11 @@ class CoursesIndex extends Component{
componentDidMount(){
// this.updataleftNav()
this.historyArray = [location.pathname];
this.historyArray = [window.location.pathname];
this.props.history.listen( location => {
console.log(location);
this.historyArray.unshift(location.pathname);
this.historyArray.unshift(window.location.pathname);
this.historyArray.length = 2;
//Do your stuff here
});

@ -77,9 +77,21 @@ class ListPageIndex extends Component{
super(props);
this.state={
yslGuideone:undefined,
yslElearning:false,
}
}
comyslElearning(bool){
if(bool===true){
this.setState({
yslElearning:true,
})
}else {
this.setState({
yslElearning:false,
})
}
}
componentDidMount(){
console.log("77");
var yslGuideone = window.localStorage.getItem('yslGuideone');
@ -175,7 +187,7 @@ class ListPageIndex extends Component{
{/*left_nav*/}
<div className={"with22 fl setleft"} style={{width:'264px',minHeight:'500px'}}>
<Coursesleftnav {...this.props} {...this.state}/>
<Coursesleftnav {...this.props} {...this.state} comyslElearning={(i)=>this.comyslElearning(i)}/>
</div>
{/*right_concent*/}
@ -258,7 +270,7 @@ class ListPageIndex extends Component{
<Route
path="/courses/:coursesId/online_learning"
render={
(props) => (<Elearning {...this.props} {...props} {...this.state} />)
(props) => (<Elearning {...this.props} {...props} {...this.state} comyslElearning={(i)=>this.comyslElearning(i)} />)
}
>
</Route>

@ -109,7 +109,7 @@ export function CNotificationHOC(options = {}) {
const { title, content,subContent, onOk, onCancel, okText } = object;
this.onCancel = onCancel
this.onOk = onOk
this.okText = okText || ''
this.okText = okText || '确定'
this.setState({ title, content , subContent , dialogOpen: true })
}
onDialogOkBtnClick = () => {
@ -146,7 +146,15 @@ export function CNotificationHOC(options = {}) {
return (
<React.Fragment>
<style>
{`
.confirmModal .task-popup-content {
padding: 0px;
}
`}
</style>
<Modals
className="confirmModal"
modalsType={dialogOpen}
modalsTopval={
content

@ -6,6 +6,7 @@ import { DragDropContext,Draggable, Droppable} from 'react-beautiful-dnd';
import Modals from '../../modals/Modals';
import { on, off, trigger } from 'educoder';
import './MainLeftNav.css';
import MyEduChapterupdate from './MyEduChapterupdate';
const CheckboxGroup = Checkbox.Group;
@ -57,7 +58,8 @@ class Coursesleftnav extends Component{
toopvisible:false,
toopvisibleindex:undefined,
sandiantypes:undefined,
antIcon:false
antIcon:false,
chapterupdate:false,
}
}
@ -755,7 +757,15 @@ class Coursesleftnav extends Component{
{/*分班*/}
{/*{item.type==="course_group"? :""}*/}
<div onClick={e=>this.Navmodalnames(e,3,"editname",item.id,item.name)}>重命名</div>
{/*online_learning*/}
{/*{*/}
{/* this.props.isClassManagement()===true?*/}
{/* (*/}
{/* item.type==="online_learning"?*/}
{/* <div onClick={e=>this.Chapterediting(e,item.id,item.url)}>章节编辑</div>*/}
{/* :""*/}
{/* )*/}
{/* :""}*/}
<div onClick={e=>this.edithidden(e,item.id)}>隐藏</div>
<div onClick={e=>this.editSetup(e,item.id)}>置顶</div>
</div>)
@ -773,10 +783,25 @@ class Coursesleftnav extends Component{
{item.type==="board"?<div onClick={e=>this.Navmodalnames(e,7,"editSecondname",iem.category_id,iem.category_name)}>重命名</div>:""}
{item.type==="board"?<div onClick={e=>this.deleteSecondary(e,3,iem.category_id,item.category_url)}>删除</div>:""}
</div>)
}
};
//章节编辑
Chapterediting=(e,id,url)=> {
e.stopPropagation();//阻止冒泡
console.log(url);
console.log(id);
//页面刷新
this.setState({
chapterupdate:true,
})
// this.props.history.replace( url );
// this.props.comyslElearning(true);
};
setchapterupdatefalse =()=>{
this.setState({
chapterupdate:false,
})
}
render(){
let {
twosandiantype,
@ -815,6 +840,27 @@ class Coursesleftnav extends Component{
>
</Modals>
{/*{*/}
{/* this.state.chapterupdate===true?*/}
{/* <div>*/}
{/* <style>*/}
{/* {*/}
{/* `*/}
{/* .ant-modal-body{*/}
{/* padding-left: 33px !important;*/}
{/* padding-right: 33px !important;*/}
{/* padding-top: 27px !important;*/}
{/* padding-bottom: 21px !important;*/}
{/* }*/}
{/* `*/}
{/* }*/}
{/* </style>*/}
{/* <MyEduChapterupdate {...this.props} {...this.state} chapterupdate={this.state.chapterupdate} setchapterupdatefalse={this.setchapterupdatefalse}>*/}
{/* </MyEduChapterupdate>*/}
{/* </div>*/}
{/* :*/}
{/* ""*/}
{/*}*/}
{
Navmodalnametype===true?<style>

@ -0,0 +1,211 @@
import React, { Component } from 'react';
import {getImageUrl} from 'educoder';
import { Modal,Checkbox,Tree} from 'antd';
import axios from 'axios';
import './chapterupdate.css'
const { TreeNode } = Tree;
//立即章节选择
const treeData = [
{
title: '0-0',
key: '0-0',
children: [
{
title: '0-0-0',
key: '0-0-0',
children: [
{ title: '0-0-0-0', key: '0-0-0-0' },
{ title: '0-0-0-1', key: '0-0-0-1' },
{ title: '0-0-0-2', key: '0-0-0-2' },
],
},
{
title: '0-0-1',
key: '0-0-1',
children: [
{ title: '0-0-1-0', key: '0-0-1-0' },
{ title: '0-0-1-1', key: '0-0-1-1' },
{ title: '0-0-1-2', key: '0-0-1-2' },
],
},
{
title: '0-0-2',
key: '0-0-2',
},
],
},
{
title: '0-1',
key: '0-1',
children: [
{ title: '0-1-0-0', key: '0-1-0-0' },
{ title: '0-1-0-1', key: '0-1-0-1' },
{ title: '0-1-0-2', key: '0-1-0-2' },
{ title: '0-1-0-3', key: '0-1-0-3' },
{ title: '0-1-0-4', key: '0-1-0-4' },
{ title: '0-1-0-5', key: '0-1-0-5' },
{ title: '0-1-0-6', key: '0-1-0-6' },
{ title: '0-1-0-7', key: '0-1-0-7' },
{ title: '0-1-0-8', key: '0-1-0-8' },
{ title: '0-1-0-9', key: '0-1-0-9' },
{ title: '0-1-0-10', key: '0-1-0-10' },
{ title: '0-1-0-11', key: '0-1-0-11' },
{ title: '0-1-0-12', key: '0-1-0-12' },
{ title: '0-1-0-13', key: '0-1-0-13' },
{ title: '0-1-0-14', key: '0-1-0-15' },
{ title: '0-1-0-16', key: '0-1-0-16' },
{ title: '0-1-0-17', key: '0-1-0-17' },
{ title: '0-1-0-18', key: '0-1-0-18' },
],
},
{
title: '0-2',
key: '0-2',
},
];
class MyEduChapterupdate extends Component {
//树状图
constructor(props) {
super(props);
this.state={
myeduchecked:false,
expandedKeys: ['0-0-0', '0-0-1'],
autoExpandParent: true,
checkedKeys:[],
selectedKeys: [],
}
}
//取消按钮
modalCancel=()=>{
//外部传进来的参数
this.props.setchapterupdatefalse();
}
//确认按钮
setDownload=()=>{
//外部传进来的参数
this.props.setchapterupdatefalse();
}
//点击了选项
onChange=(e)=> {
this.setState({
myeduchecked:e.target.checked,
})
// console.log(`checked = ${e.target.checked}`);
if(e.target.checked===true){
this.setState({
checkedKeys:['0-0','0-1','0-2'],
})
}else {
this.setState({
checkedKeys:[],
})
}
}
onExpand =(expandedKeys) => {
console.log('onExpand', expandedKeys);
// if not set autoExpandParent to false, if children expanded, parent can not collapse.
// or, you can remove all expanded children keys.
this.setState({
expandedKeys,
autoExpandParent: false,
});
};
onCheck = (checkedKeys) => {
console.log('onCheck', checkedKeys);
this.setState({ checkedKeys });
};
onSelect = (selectedKeys, info) => {
console.log('onSelect', info);
this.setState({ selectedKeys });
};
renderTreeNodes = (data) =>
data.map(item => {
if (item.children) {
return (
<TreeNode title={item.title} key={item.key} dataRef={item}>
{this.renderTreeNodes(item.children)}
</TreeNode>
);
}
return <TreeNode key={item.key} {...item} />;
});
render() {
return(
<Modal
keyboard={false}
closable={false}
footer={null}
destroyOnClose={true}
title={"章节编辑"}
centered={true}
visible={this.props.chapterupdate}
width="600px"
heigth="658px"
>
<div className="educouddiv" style={{
heigth:"578px",
width:"100%"
}}>
<div style={{
width:"100%",
}}
className="private-listtwo heigth459px"
>
<style>
{
`
span {
max-width: 500px;
overflow:hidden;
text-overflow:ellipsis;
white-space:nowrap;
cursor: default;
}
`
}
</style>
<Tree
checkable
onExpand={this.onExpand}
expandedKeys={this.state.expandedKeys}
autoExpandParent={this.state.autoExpandParent}
onCheck={this.onCheck}
checkedKeys={this.state.checkedKeys}
onSelect={this.onSelect}
selectedKeys={this.state.selectedKeys}
>
{this.renderTreeNodes(treeData)}
</Tree>
</div>
</div>
<div className="yslcheckbox mt40">
<div className="mr15"><Checkbox onChange={(e) => this.onChange(e)} checked={this.state.myeduchecked}></Checkbox></div>
<div style={{
width:"100%"
}}><span style={{color:"#999999"}}>已选择</span><span style={{color:"#E65656"}}>3</span><span style={{color:"#999999"}}> </span><span style={{color:"#E65656"}}>5</span><span style={{color:"#999999"}}></span></div>
<div className="yslcheckbox2" style={{ width:"100%"}}><span className="font-14" style={{
color:"#A3A3A3",
}}>勾选则在课堂中显示否则不显示</span></div>
</div>
<div className="clearfix edu-txt-center pt37 pb28" >
<a className="task-btn mr30" style={{width:"100px",heigth:"38px"}} onClick={()=>this.modalCancel()}>取消</a>
<a className="task-btn task-btn-orange"style={{width:"100px",heigth:"38px"}} onClick={()=>this.setDownload()}>确定</a>
</div>
</Modal>
)
}
}
export default MyEduChapterupdate;

@ -0,0 +1,34 @@
.yslcheckbox{
display: flex;
flex-direction: row;
}
.yslcheckbox2{
display: flex;
flex-direction: row-reverse;
}
.heigth459px{
max-height:459px;
}
.private-listtwo{
overflow-y: auto;
overflow-x: hidden;
}
/*滚动条*/
.private-listtwo::-webkit-scrollbar {
width: 8px;
height: 8px;
}
.private-listtwo::-webkit-scrollbar-thumb {
background-color: #E3EBF4;
box-shadow: 0px 0px black;
}
.private-listtwo::-webkit-scrollbar-track {
border-radius:3px;
-webkit-box-shadow: inset 0 0 6px rgba(0, 0, 0, 0);
background-color: white;
}

@ -14,9 +14,6 @@ i.iconfont {
}
/* BASICS */
.editormd-preview ol li {
list-style-type: decimal ;
}
.CodeMirror {
/* Set height, width, borders, and global font properties here */
font-family: monospace;
@ -1656,8 +1653,9 @@ input.ant-input-number-input:focus {
}
/* md代码类样式渲染 */
.markdown-body li{ list-style-type: disc!important;margin-bottom: 0!important; }
.markdown-body ol li{ list-style-type: decimal!important; }
.new_li .markdown-body ul > li{ list-style-type: disc!important;margin-bottom: 0!important; }
.new_li .markdown-body ol > li{ list-style-type: decimal!important; }
.new_li li{ margin-bottom: 0!important; }
/* 有不少问题,没有出现'数据已于 09:24:53 保存'时靠太近,和红字提示重叠 */
.upload_under_markdown_editor {

@ -28,29 +28,36 @@ class Elearning extends Component{
isSpins:false,
userlogin:"",
isRender:false,
subject_id:0,
}
}
componentDidMount() {
// 记得删除退出课堂
console.log("获取到数据");
console.log(this.props);
// console.log("获取到数据");
// console.log(this.props);
this.getdata();
}
getdata=()=>{
console.log("更新了数据了");
let url = `/courses/${this.props.match.params.coursesId}/online_learning.json`;
// //
axios.get(url).then((response) => {
if(response){
if(response.data){
console.log("获取到到数据");
console.log(response);
this.setState({
description: response.data.description,
start_learning:response.data.start_learning,
learned:response.data.learned,
last_shixun:response.data.last_shixun,
stages:response.data.stages,
});
}
// console.log("获取到到数据");
// console.log(response);
this.setState({
description: response.data.description,
start_learning:response.data.start_learning,
learned:response.data.learned,
last_shixun:response.data.last_shixun,
stages:response.data.stages,
subject_id:response.data.subject_id,
});
}
}
this.setState({
isSpin:false,
@ -71,13 +78,11 @@ class Elearning extends Component{
console.log("12312312312")
console.log(e);
}
}
componentDidUpdate = (prevProps) => {
console.log("componentDidUpdate");
console.log(prevProps);
console.log(this.props);
console.log("componentDidUpdate");
// console.log(prevProps);
// console.log(this.props);
if(prevProps.current_user!=this.props.current_user){
if(this.props.current_user!==undefined){
// console.log(this.props.current_user.login);
@ -87,6 +92,17 @@ class Elearning extends Component{
})
}
}
if(prevProps.yslElearning===this.props.yslElearning) {
if(prevProps.yslElearning===true && this.props.yslElearning===true){
// console.log("=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-");
// console.log(prevProps.yslElearning);
// console.log(this.props.yslElearning);
this.getdata();
this.props.comyslElearning(false);
}
}
}
@ -274,6 +290,8 @@ class Elearning extends Component{
};
render(){
console.log("Elearning++++++++");
// console.log(this.props.Chapterupdate);
let{description,whethertoedit,isSpin,start_learning,hidestartshixunsreplacevalues,learned,last_shixun,stages,isRender} =this.state;
const isNotMembers=this.props.isNotMember();//非课堂成员
const antIcon = <Icon type="loading" style={{ fontSize: 24 }} spin />;
@ -376,16 +394,13 @@ class Elearning extends Component{
<Spin size="large" spinning={isSpin} id={"cdiv"}>
<div className=" clearfix" style={this.props.isAdmin()===true?{marginTop:"0px"}:{marginTop:"20px"}}>
{
stages===undefined||stages===JSON.stringify("[]")||stages.length===0?
<NoneData></NoneData>
:
<div>
{/*开始学习*/}
<YslDetailCards {...this.state} {...this.props} Startlearningtwo={()=>this.Startlearningtwo()} Myreload={()=>this.Myreload()} Tojoinclass={()=>this.Tojoinclass()}></YslDetailCards>
<YslDetailCards {...this.state} {...this.props} Startlearningtwo={()=>this.Startlearningtwo()} Myreload={()=>this.Myreload()} Tojoinclass={()=>this.Tojoinclass()} getPathCardsList={()=>this.getdata()}></YslDetailCards>
</div>
}
</div>
</Spin>

@ -4,7 +4,10 @@ import { Tooltip,Modal,Icon,Spin,message} from 'antd';
import '../../paths/ShixunPaths.css';
import axios from 'axios';
import { BrowserRouter as Router, Route, Link } from "react-router-dom";
import DetailCardsEditAndEdit from '../../paths/PathDetail/DetailCardsEditAndEdit';
import DetailCardsEditAndAdd from "../../paths/PathDetail/DetailCardsEditAndAdd";
import Modals from "../../modals/Modals";
import NoneData from "../coursesPublic/NoneData";
class YslDetailCards extends Component{
constructor(props){
super(props)
@ -17,7 +20,23 @@ class YslDetailCards extends Component{
shixunsmessage:"",
startshixunCombattype:false,
isSpin:false,
idsum:undefined,
pathCardsedittype:false,
pathid:undefined,
editbuttomtype:false,
editbuttomtypeadd:false,
pathlistedit:undefined,
delecttype:false,
Modalstype:false,
Modalstopval:'',
Modalsbottomval:'',
}
//idsum 是否点击这个
//pathCardsedittype 是否是在编辑模式
//editbuttomtypeadd 是否已经是编辑模式
//pathid课堂id
//pathlistedit 编辑返回的数据
}
showparagraph =(key,index)=>{
@ -90,6 +109,10 @@ class YslDetailCards extends Component{
};
componentDidMount(){
let pathid=this.props.match.params.coursesId;
this.setState({
pathid:pathid
})
}
@ -125,14 +148,192 @@ class YslDetailCards extends Component{
this.setState({
startshixunCombattype:false
})
};
// 关卡的上移下移操作
operations = (url) => {
let newurl = url+".json"
axios.get(newurl).then((response) => {
if(response.data.status===1){
this.props.getPathCardsList();
}
}).catch((error) => {
console.log(error);
})
};
//章节下移
chapterdown=(id)=>{
let url=`/course_stages/${id}/down_position.json`;
axios.post(url).then((response) => {
if(response){
if(response.data){
if(response.data.status===0){
this.props.showNotification(`下移成功`);
this.props.getPathCardsList();
}else{
this.props.showNotification(`下移失败`);
}
}else{
this.props.showNotification(`下移失败`);
}
}else {
this.props.showNotification(`下移失败`);
}
}).catch((error) => {
console.log(error)
});
};
//章节上移
chapterup=(id)=>{
let url=`/course_stages/${id}/up_position.json`;
axios.post(url).then((response) => {
if(response){
if(response.data){
if(response.data.status===0){
this.props.showNotification(`上移成功`);
this.props.getPathCardsList();
}else{
this.props.showNotification(`上移失败`);
}
}else{
this.props.showNotification(`上移失败`);
}
}else{
this.props.showNotification(`上移失败`);
}
}).catch((error) => {
console.log(error)
});
};
//取消的
updatapathCardsedit=()=>{
this.setState({
idsum:undefined,
pathCardsedittype:false,
editbuttomtype:false,
editbuttomtypeadd:false
})
this.props.getPathCardsList();
// this.props.updatadetailInfoLists();
};
//确认的
editeditbuttomtypecanle=()=>{
this.setState({
editbuttomtype:true,
editbuttomtypeadd:false
})
}
//编辑用
pathCardsedit=(key,pathid)=>{
let url=`/course_stages/${pathid}/edit.json`;
axios.get(url).then((result)=>{
if(result){
if(result.status===200){
this.setState({
idsum:key,
pathCardsedittype:true,
pathlistedit:result.data,
editbuttomtype:true,
editbuttomtypeadd:true
})
}
}
}).catch((error)=>{
console.log(error);
})
};
//删除用的
delectpathCardsedit=(id)=>{
this.setState({
Modalstype:true,
Modalstopval:'是否删除该章节?',
Modalsbottomval:'',
editdelectid:id,
delecttype:true,
})
}
cardsModalcancel=()=>{
this.setState({
Modalstype:false,
Modalstopval:'',
Modalsbottomval:'',
editdelectid:undefined
})
}
cardsModalsave=()=>{
debugger
this.setState({
Modalstype:false,
Modalstopval:'',
Modalsbottomval:'',
editdelectid:undefined
})
}
delectpathCardseditfun=()=>{
let {delecttype,editdelectid}=this.state;
let id=editdelectid;
if(delecttype===true){
let url =`/course_stages/${id}.json`
axios.delete(url).then((response) => {
if(response){
if(response.data){
if(response.data.status===0){
this.setState({
idsum:undefined,
pathCardsedittype:false,
Modalstype:false,
Modalstopval:'',
Modalsbottomval:'',
delecttype:false,
editdelectid:undefined
})
this.updatapathCardsedit()
this.props.showNotification(`删除成功`);
}else {
this.props.showNotification(`删除失败`);
}
}else{
this.props.showNotification(`删除失败`);
}
}else {
this.props.showNotification(`删除失败`);
}
}).catch((error) => {
console.log(error)
})
}
}
render(){
let{showparagraph,showparagraphkey,showparagraphindex,hidestartshixunsreplacevalue} =this.state;
let { stages }=this.props;
let{showparagraph,showparagraphkey,showparagraphindex,hidestartshixunsreplacevalue,idsum,pathCardsedittype,pathid,Modalstype,Modalstopval,Modalsbottomval,delecttype,pathlistedit,editbuttomtypeadd,editbuttomtype} =this.state;
let { stages ,subject_id}=this.props;
const antIcon = <Icon type="loading" style={{ fontSize: 24 }} spin />;
// console.log("pathCardsedittype");
// console.log(pathCardsedittype);
// console.log(editbuttomtype);
// console.log("this.props.isAdmin");
// console.log(this.props.isAdmin());
// console.log(this.state.delecttype);
return(
<div className="lesson-saved-list">
<div>
{
stages===undefined||stages===JSON.stringify("[]")||stages.length===0?
""
:
<div className="lesson-saved-list">
<Modal
keyboard={false}
title="提示"
@ -171,6 +372,15 @@ class YslDetailCards extends Component{
</div>
</Spin>
</Modal>
<Modals
modalsType={Modalstype}
modalsTopval={Modalstopval}
modalsBottomval={Modalsbottomval}
modalCancel={this.cardsModalcancel}
modalSave={delecttype===true?this.delectpathCardseditfun:this.cardsModalsave}
>
</Modals>
<style>{
`
.lesson-saved-list-item {
@ -180,30 +390,84 @@ class YslDetailCards extends Component{
}
`
}</style>
{
stages && stages.map((item,key)=>{
return(
<div className={"lesson-saved-list-item"} key={key} id={"stage_div_"+key} >
<p className="clearfix title-line">
<a className="fl ring-blue mr10 mt2">
<img src={getImageUrl("images/educoder/icon/charpter-white.svg")} className="fl ml3 mt3"/>
</a>
<span className="font-18 font-bd lessonvalue" title={item.stage_name}>{item.stage_name}</span>
{
this.props.isStudent()===true&&(stages===undefined||stages===JSON.stringify("[]")||stages.length===0)?
<NoneData></NoneData>
:
""
}
{
stages && stages.map((item,key)=>{
return(
<div className={"lesson-saved-list-item"} key={key} id={"stage_div_"+key} >
<p className="clearfix title-line">
</p>
<div className="detail_for_paragraph clearfix" id={"detail_for_paragraph_"+key}>
<p className="color-dark-grey mt20 mb25 ml20 mr20 pl28 justify font-15">{item.stage_description}</p>
<a className="fl ring-blue mr10 mt2">
<img src={getImageUrl("images/educoder/icon/charpter-white.svg")} className="fl ml3 mt3"/>
</a>
<span className="font-18 font-bd lessonvalue" title={item.stage_name}>{item.stage_name}</span>
{
idsum===key&&pathCardsedittype===true?'':
this.props.isAdmin()==true?
<a>
<a className="fr mtf3">
{ editbuttomtype===true?'':
<Tooltip placement="bottom" title="编辑"
onClick={() => this.pathCardsedit(key, item.stage_id)}>
<i className="iconfont icon-bianjidaibeijing font-22 color-green"></i>
</Tooltip>
}
</a>
{
stages.length=== key+1?"":<a className="fr ring-op-green mr20" onClick={()=>this.chapterdown(item.stage_id)}>
<Tooltip placement="bottom" title="向下移动">
<img src={getImageUrl("images/educoder/icon/movedown.svg")} className="fl mt2 ml4"/>
</Tooltip>
</a>
}
{key===0?"":
<a className="fr ring-op-green mr20" onClick={()=>this.chapterup(item.stage_id)}>
<Tooltip placement="bottom" title="向上移动">
<img src={getImageUrl("images/educoder/icon/moveup.svg")} className="fl mt2 ml4"/>
</Tooltip>
</a>}
<div>
</a>:""
}
{
item.shixuns_list && item.shixuns_list.map((line,index)=>{
return(
<div className="clearfix paragraph lineh-30" key={index} onMouseEnter={()=>this.showparagraph(key,index)} onMouseLeave={this.hideparagraph}>
idsum === key && pathCardsedittype === true ?
this.props.isAdmin()===true?
<a className="fr" onClick={()=>this.delectpathCardsedit(item.stage_id)}>
<Tooltip placement="bottom" title="删除">
<i className="iconfont icon-shanchu color-grey-c font-14 font-n"></i>
</Tooltip>
</a>:""
: ''
}
</p>
{
idsum===key&&pathCardsedittype===true?'':
<div className="detail_for_paragraph clearfix" id={"detail_for_paragraph_"+key}>
<p className="color-dark-grey mt20 mb25 ml20 mr20 pl28 justify font-15">{item.stage_description}</p>
<li className="fl li-width63">
<div>
{
item.shixuns_list && item.shixuns_list.map((line,index)=>{
return(
<div className="clearfix paragraph lineh-30" key={index} onMouseEnter={()=>this.showparagraph(key,index)} onMouseLeave={this.hideparagraph}>
<li className="fl li-width63">
<span className="progressRing mr10">
{
@ -211,36 +475,70 @@ class YslDetailCards extends Component{
:<i className="iconfont icon-bofang progressRing-part font-18 mt10"></i>
}
</span>
<span className={this.props.current_user&&this.props.current_user.admin===false&&line.shixun_status==="暂未公开"?"paragraph_name color204":"paragraph_name color-grey3"}>
<span className={this.props.current_user&&this.props.current_user.admin===false&&line.shixun_status==="暂未公开"?"paragraph_name color204":"paragraph_name color-grey3"}>
<span className="subject_stage_shixun_index">{key+1}</span>-{index+1}&nbsp;&nbsp;{line.shixun_name}
</span>
</li>
{
this.props.current_user&&this.props.current_user.admin===false&&line.shixun_status==="暂未公开"?
<li className="fr status_li"><span className="fr color204">暂未公开</span></li>
:
<li className={showparagraph===false?"none":"fr status_li"}>
</li>
{
showparagraphkey===key&&showparagraphindex===index?<div>
<Link to={'/shixuns/'+line.identifier+'/challenges'} className="mr30 color-blue_4C shixun_detail pointer fl" target="_blank">查看详情</Link>
{line.shixun_status==="暂未公开"?"":<a onClick={()=>this.startgameid(line.identifier)} className="btn_auto user_bluebg_btn fl" id="shixun_operation" >开始学习</a>}
</div>:""
this.props.current_user&&this.props.current_user.admin===false&&line.shixun_status==="暂未公开"?
<li className="fr status_li"><span className="fr color204">暂未公开</span></li>
:
<li className={showparagraph===false?"none":"fr status_li"}>
{
showparagraphkey===key&&showparagraphindex===index?<div>
<Link to={'/shixuns/'+line.identifier+'/challenges'} className="mr30 color-blue_4C shixun_detail pointer fl" target="_blank">查看详情</Link>
{line.shixun_status==="暂未公开"?"":<a onClick={()=>this.startgameid(line.identifier)} className="btn_auto user_bluebg_btn fl" id="shixun_operation" >开始学习</a>}
</div>:""
}
</li>
}
</div>)
})
}
</div>
</div>
}
{
this.props.isAdmin()===true?
<DetailCardsEditAndEdit
idsum={idsum}
keys={key}
pathCardsedittype={pathCardsedittype}
updatapathCardsedits={this.updatapathCardsedit}
pathlisteditlist={pathlistedit}
stageid={item.stage_id}
ysldetailcards={"ysldetailcards"}
pathid={subject_id}
coursesId={pathid}
></DetailCardsEditAndEdit>
:""
}
</li>
}
</div>)
})
}
</div>
</div>
</div>
)
})
}
)
})
}
</div>
}
{ editbuttomtypeadd===true?'':this.props.isAdmin()===true?
<DetailCardsEditAndAdd
{...this.props}
sum={stages && stages.length+1}
pathid={subject_id}
coursesId={pathid}
detailInfoList={this.props.detailInfoList}
getPathCardsLists={this.updatapathCardsedit}
editeditbuttomtypes={this.editeditbuttomtypecanle}
ysldetailcards={"ysldetailcards"}
></DetailCardsEditAndAdd>
:""
}
</div>
)
}
}
export default YslDetailCards;
export default YslDetailCards;
// detailInfoList以前实训课堂做权限判断的作用 this.props.subject_id

@ -85,28 +85,28 @@ class Groupjobbandetails extends Component {
{/* )*/}
{/*})}*/}
{datas.attachments === undefined ?
(datas.description === undefined || datas.description === undefined || datas.description === "" ?
(datas.description === undefined || datas.description === null || datas.description === "" ?
<NoneData></NoneData>
:
""
)
:
datas.attachments=== "" ?
(datas.description === undefined || datas.description === undefined || datas.description === "" ?
(datas.description === undefined || datas.description === null || datas.description === "" ?
<NoneData></NoneData>
:
""
)
:
datas.attachments=== null ?
(datas.description === undefined || datas.description === undefined || datas.description === "" ?
(datas.description === undefined || datas.description === null || datas.description === "" ?
<NoneData></NoneData>
:
""
)
:
datas.attachments.length === 0 ?
(datas.description === undefined || datas.description === undefined || datas.description === "" ?
(datas.description === undefined || datas.description === null || datas.description === "" ?
<NoneData></NoneData>
:
""

@ -213,7 +213,7 @@ class AddStudentModal extends Component{
{/* <Divider /> */}
<p className="clearfix mb2" style={{ margin: '0px 15px 6px' }}>
<p className="clearfix mb2" style={{ margin: '0px 20px 6px' }}>
<Checkbox className="fl" style={{ visibility: 'hidden' }} ></Checkbox>
<span className="fl task-hide with25" style={{"maxWidth":"208px;"}}>{'姓名'}</span>
<span className="fl task-hide with25" style={{"maxWidth":"208px;"}}>{'学号'}</span>
@ -224,7 +224,7 @@ class AddStudentModal extends Component{
<Spin size="large" spinning={isSpin}>
{ loading || users.length ? <div>
{/* https://github.com/CassetteRocks/react-infinite-scroller/issues/70 */}
<div className="edu-back-skyblue padding10-15" style={{"height":"300px", overflowY: "scroll", overflowAnchor: 'none' }}>
<div className="edu-back-skyblue padding10-15" style={{height:"300px", overflowY: "scroll", overflowAnchor: 'none' }}>
<InfiniteScroll
threshold={10}
initialLoad={false}
@ -239,22 +239,17 @@ class AddStudentModal extends Component{
return (
<p className="clearfix mb7" key={candidate.id}>
<Checkbox className="fl" value={candidate.id} key={candidate.id} disabled={candidate.added}></Checkbox>
<span className="fl task-hide with25 ml5" style={{"maxWidth":"208px;"}}>
<ConditionToolTip title={candidate.name} condition={candidate.name && candidate.name.length > 12 }>
<span className="fl task-hide with25 ml5">
{ candidate.name ?
<a href={`/users/${candidate.login}`} target="_blank">
<a href={`/users/${candidate.login}`} title={candidate.name} target="_blank">
{ candidate.name }
</a> : <span> </span> }
</ConditionToolTip>
</a> : <span> </span> }
</span>
<span className="fl task-hide with25" style={{"maxWidth":"208px;"}}>
<ConditionToolTip title={candidate.student_id} condition={candidate.student_id && candidate.student_id.length > 12 }>
{candidate.student_id || ' '}
</ConditionToolTip>
<span className="fl task-hide with25" title={candidate.student_id} style={{ width: '145px' , height : "20px" }}>
{candidate.student_id || ' '}
</span>
<span className="fl task-hide with35" style={{"maxWidth":"208px;"}}>{candidate.school_name}</span>
<span className="fl task-hide with35" title={candidate.school_name} style={{ width: '204px' , height : "20px" }}>{candidate.school_name}</span>
<span className="fl task-hide with10" style={{"maxWidth":"48px", color: theme.foreground_select }}>{candidate.added ? '已加入' : ''}</span>
</p>
)
}) }

@ -262,7 +262,7 @@ class AddTeacherModal extends Component{
{/* graduation_groups && !!graduation_groups.length */}
<p className="clearfix mb2" style={{ margin: '0px 15px 6px' }}>
<p className="clearfix mb2" style={{ margin: '0px 20px 6px' }}>
<Checkbox className="fl" style={{ visibility: 'hidden' }} ></Checkbox>
<span className="fl task-hide with25" style={{"maxWidth":"208px;"}}>{'姓名'}</span>
<span className="fl task-hide with25" style={{"maxWidth":"208px;"}}>{'昵称'}</span>
@ -287,20 +287,15 @@ class AddTeacherModal extends Component{
return (
<p className="clearfix mb7" key={candidate.id}>
<Checkbox className="fl" value={candidate.id} key={candidate.id} disabled={candidate.added}></Checkbox>
<span className="fl task-hide with25 ml5" style={{"maxWidth":"208px;"}}>
{/* "color":"#4c4c4c" */}
<ConditionToolTip title={candidate.name} condition={candidate.name && candidate.name.length > 12 }>
<a href={`/users/${candidate.login}`} target="_blank"
style={{}}
>{candidate.name}</a>
</ConditionToolTip>
<span className="fl task-hide with25 ml5" style={{ width: '145px' , height : "20px" }}>
<a href={`/users/${candidate.login}`} target="_blank" title={candidate.name}>{candidate.name}</a>
</span>
<span className="fl task-hide with25" style={{"maxWidth":"208px;"}}>
<ConditionToolTip title={candidate.nickname} condition={candidate.nickname && candidate.nickname.length > 12 }>
{candidate.nickname || ' '}
</ConditionToolTip>
<span className="fl task-hide with25" title={candidate.nickname} style={{ width: '145px' , height : "20px" }}>
{candidate.nickname}
</span>
<span className="fl task-hide with35" title={candidate.school_name} style={{ width: '145px' , height : "20px" }}>
{candidate.school_name}
</span>
<span className="fl task-hide with35" style={{"maxWidth":"208px;"}}>{candidate.school_name}</span>
<span className="fl task-hide with10 color-blue" style={{"maxWidth":"48px;"}}>{candidate.added ? '已加入' : ''}</span>
</p>
)

@ -97,28 +97,28 @@ class Generaljobanswer extends Component {
}
{datas.reference_attachments === undefined ?
(datas.reference_answer===undefined || datas.reference_answer===undefined|| datas.reference_answer===""?
(datas.reference_answer===undefined || datas.reference_answer===null|| datas.reference_answer===""?
<NoneData></NoneData>
:
""
)
:
datas.reference_attachments === "" ?
(datas.reference_answer===undefined || datas.reference_answer===undefined|| datas.reference_answer===""?
(datas.reference_answer===undefined || datas.reference_answer===null|| datas.reference_answer===""?
<NoneData></NoneData>
:
""
)
:
datas.reference_attachments === null ?
(datas.reference_answer===undefined || datas.reference_answer===undefined|| datas.reference_answer===""?
(datas.reference_answer===undefined || datas.reference_answer===null|| datas.reference_answer===""?
<NoneData></NoneData>
:
""
)
:
datas.reference_attachments.length === 0 ?
(datas.reference_answer===undefined || datas.reference_answer===undefined|| datas.reference_answer===""?
(datas.reference_answer===undefined || datas.reference_answer===null|| datas.reference_answer===""?
<NoneData></NoneData>
:
""

@ -73,28 +73,28 @@ class Generaljobdetails extends Component {
// <div id="MakedownHTML "className="markdown-body yslquesHeigth yslquesmarkdowntext" dangerouslySetInnerHTML={{__html: markdownToHTML(datas.description).replace(/▁/g, "▁▁▁")}}/>
}
{datas.attachments === undefined ?
(datas.description === undefined || datas.description === undefined || datas.description === "" ?
(datas.description === undefined || datas.description === null || datas.description === "" ?
<NoneData></NoneData>
:
""
)
:
datas.attachments=== "" ?
(datas.description === undefined || datas.description === undefined || datas.description === "" ?
(datas.description === undefined || datas.description === null || datas.description === "" ?
<NoneData></NoneData>
:
""
)
:
datas.attachments=== null ?
(datas.description === undefined || datas.description === undefined || datas.description === "" ?
(datas.description === undefined || datas.description === null || datas.description === "" ?
<NoneData></NoneData>
:
""
)
:
datas.attachments.length === 0 ?
(datas.description === undefined || datas.description === undefined || datas.description === "" ?
(datas.description === undefined || datas.description === null || datas.description === "" ?
<NoneData></NoneData>
:
""

@ -1489,6 +1489,11 @@ class Listofworksstudentone extends Component {
// this.Gettitleinformation(homeworkid);
this.Getalistofworks(homeworkid);
}
Isupdatass = () => {
var homeworkid = this.props.match.params.homeworkid;
// this.Gettitleinformation(homeworkid);
this.Getalistofworks(homeworkid);
}
/////////老师操作
// tearchar=()=>{
// var homeworkid = this.props.match.params.homeworkid;

@ -113,10 +113,21 @@ class ShixunHomeworkPage extends Component {
}
/// 重做的确认
ModalSaves=()=>{
this.setState({
ModalsType:false,
Modalstopval:""
})
});
if(this.state.teacherdatapage){
this.resetshixunCombat(this.state.teacherdatapage.myshixun_identifier);
}
try {
console.log("this.child");
console.log(this.child);
}catch (e) {
}
};
//取消重做
ModalCancels=()=>{
@ -133,6 +144,18 @@ class ShixunHomeworkPage extends Component {
ModalsType:true,
})
}
//重置按钮
resetshixunCombat=(id)=>{
console.log(id);
let zrl=`/myshixuns/${id}/reset_my_game.json`;
axios.get(zrl).then((response) => {
// window.location.href = "/shixuns/" + response.data.shixun_identifier + "/challenges";
this.child.Isupdatass();
this.props.showNotification("重置成功");
}).catch((error) => {
console.log(error)
});
}
bindRef = ref => { this.child = ref }
///////////////教师截止
gotohome=()=>{
@ -151,15 +174,15 @@ class ShixunHomeworkPage extends Component {
return (
<div className="newMain clearfix ">
{/*<Modals*/}
{/* modalsType={this.state.ModalsType}*/}
{/* modalsTopval={this.state.Modalstopval}*/}
{/* modalsBottomval={this.state.ModalsBottomval}*/}
{/* modalSave={this.ModalSaves}*/}
{/* modalCancel={this.ModalCancels}*/}
{/* loadtype={false}*/}
{/*>*/}
{/*</Modals>*/}
<Modals
modalsType={this.state.ModalsType}
modalsTopval={this.state.Modalstopval}
modalsBottomval={this.state.ModalsBottomval}
modalSave={this.ModalSaves}
modalCancel={this.ModalCancels}
loadtype={false}
>
</Modals>
<div className={"educontent mt10 mb20"} style={{width: "1200px"}}>
@ -278,13 +301,18 @@ class ShixunHomeworkPage extends Component {
<a className="fr color-blue font-16"
href={`/courses/${this.props.match.params.coursesId}/${jobsettingsdatapage === undefined ? "" : jobsettingsdatapage.data.category.main === 1 ? "shixun_homeworks" :"shixun_homework"}/${teacherdatapage === undefined ? "" : teacherdatapage.id}/commitsummary/${this.props.match.params.homeworkid}`}>{teacherdatapage.commit_des}</a>
}
{this.props.isStudent() ?
(
teacherdatapage&&teacherdatapage.redo_work===true?
<a className="fr color-blue font-16" onClick={()=>this.Modalcancelss()}>重做</a>
:""
)
: "" }
{teacherdatapage === undefined ? "" : <Startshixuntask
{...this.props}
data={teacherdatapage}
/>}
{/*{this.props.isStudent() ?*/}
{/* <a className="fr color-blue font-16" onClick={()=>this.Modalcancelss()}>重做</a>*/}
{/* : "" }*/}
</div>
</div>
</div>

@ -48,7 +48,11 @@ function startechart(data){
xAxis: [
{
type : 'value',
name: '学生效率位置',
name: '学生效率',
nameTextStyle: {
color: '#000',
fontSize: 12
},
scale:true,
axisLabel : {
formatter: ' ',

@ -13,6 +13,7 @@ render() {
const antIcons = <Icon type="loading" style={{ fontSize: 24 }} spin />
return(
<Modal
className={this.props.className}
keyboard={false}
title="提示"
visible={this.props.modalsType===undefined?false:this.props.modalsType}

@ -210,6 +210,8 @@ class Index extends Component {
{/* 区分下repo和evaluate模块的以及子模块的 */}
<MainContentContainer
confirm={context.confirm}
onDrawerButtonClick={this.onDrawerButtonClick}
grade={context.grade}
allowed_unlock={context.allowed_unlock}

@ -21,7 +21,8 @@ class VNCContainer extends Component {
this.state = {
fileTreeSelectedKeys: [],
repositoryCode: ''
repositoryCode: '',
displayKey: 1
}
}
componentDidMount() {
@ -114,6 +115,43 @@ class VNCContainer extends Component {
showCodeEvaluate = () => {
this.setState({ bottomDrawer: true })
}
onResetVNC = () => {
// 桌面系统将恢复到初始状态,您在系统中创建的数据可能会丢失
// 请确保您的数据已保存(如:版本库代码已推送到服务器)
// 是否确认重置?
this.props.confirm({
content: <div style={{textAlign: 'center'}}>
<div>桌面系统将恢复到初始状态您在系统中创建的数据可能会丢失</div>
<div>请确保您的数据已保存版本库代码已推送到服务器</div>
<div>是否确认重置</div>
</div>,
onOk: () => {
const url = `/tasks/${this.props.game.identifier}/reset_vnc_link.json`
axios.get(url, {
}).then((response) => {
if (response.data.data && response.data.data.vnc_url) {
// reset
this.setState({
displayKey: this.state.displayKey + 1,
vnc_url: response.data.data.vnc_url
})
} else {
}
// this.setState({ isEditablePath, currentPath: path });
}).catch(error =>{
console.log(error)
this.setState({ readingCodeLoading: false });
this.props.showSnackbar(`服务端异常,请联系管理员!`);
})
console.log('doooo')
},
onCancel() {
console.log('Cancel');
},
})
}
/*
selectedKeys={fileTreeSelectedKeys}
@ -191,6 +229,30 @@ class VNCContainer extends Component {
.codeInDrawer .ant-spin-nested-loading > div > .ant-spin .ant-spin-text {
text-shadow: none;
}
.resetVNC {
top: 30px;
writing-mode: initial;
left: calc(100% - 120px);
background-image: none;
width: auto;
background: #081516;
height: 30px;
padding: 0 6px;
border-radius: 4px;
}
.resetVNC .text {
top: 0px;
writing-mode: initial;
left: unset;
}
.resetVNC .text span {
vertical-align: middle;
margin-left: 2px;
}
.float_button:hover .text {
color: #4CACFF;
}
`}</style>
<div style={{ 'padding': '16px', 'border-bottom': '1px solid #3A383A' }}>
<div style={{ color: '#888888' }}>网址克隆</div>
@ -207,9 +269,14 @@ class VNCContainer extends Component {
></RepoTree>
</SecondDrawer>
{/* <FloatButton></FloatButton> */}
<FloatButton className="resetVNC" onClick={this.onResetVNC}>
<i className="iconfont icon-zhongzhi2 font-16 "></i>
<span>重置桌面系统</span>
</FloatButton>
<VNCDisplay
{...this.props}
key={this.state.displayKey}
vnc_url={this.state.vnc_url || this.props.vnc_url}
>
<Drawer

@ -6,6 +6,7 @@ const $ = window.$;
// const showIframeContent = window.location.search.indexOf('vnc=1') != -1;
class VNCDisplay extends Component {
componentDidMount() {
console.log('vnc init')
console.log(RFB)
let rfb;

@ -531,6 +531,7 @@ class DetailCards extends Component{
{ editbuttomtypeadd===true?'':
<DetailCardsEditAndAdd
{...this.props}
sum={ pathCardsList && pathCardsList.length+1}
pathid={pathid}
detailInfoList={this.props.detailInfoList}

@ -94,21 +94,27 @@ class DetailCardsEditAndAdd extends Component{
axios.post(url,{
shixun_id:patheditarry
}).then((response) => {
let newshixun_lists=response.data.shixun_lists;
if(response){
if(response.data){
let newshixun_lists=response.data.shixun_lists;
for(var z=0; z<newshixun_lists.length; z++){
newshixuns_listedit.push(newshixun_lists[z]);
}
for(var i=0; i<newshixun_lists.length; i++){
list.push(newshixun_lists[i].shixun_id);
}
this.setState({
shixuns_listedit:newshixuns_listedit,
shixuns_listeditlist:list,
patheditarry:[],
selectShixun:false,
page:1,
})
}
for(var z=0; z<newshixun_lists.length; z++){
newshixuns_listedit.push(newshixun_lists[z]);
}
for(var i=0; i<newshixun_lists.length; i++){
list.push(newshixun_lists[i].shixun_id);
}
this.setState({
shixuns_listedit:newshixuns_listedit,
shixuns_listeditlist:list,
patheditarry:[],
selectShixun:false,
page:1,
})
}).catch((error) => {
console.log(error)
});
@ -276,7 +282,12 @@ class DetailCardsEditAndAdd extends Component{
let pathId=this.props.pathid;
let url='/stages.json?subject_id='+pathId
let url;
if(this.props.ysldetailcards===undefined){
url='/stages.json?subject_id='+pathId;
}else{
url=`/courses/${this.props.coursesId}/course_stages.json`;
}
axios.post(url, {
name:stage_names,
description:newstage_descriptions,
@ -400,7 +411,7 @@ class DetailCardsEditAndAdd extends Component{
{ editPanel &&
<div className="lesson-edit-content mb10">
<div className="clearfix edu-back-white pt30">
<div className="clearfix edu-back-white pt30 pb30">
<p className="clearfix mb30 font-18 font-bd pl25 pr25">
<a className="fl ring-blue mr10 mt2">
<img src={getImageUrl("images/educoder/icon/charpter-white.svg")} className="fl ml3 mt3"/>
@ -632,6 +643,9 @@ class DetailCardsEditAndAdd extends Component{
{this.props.detailInfoList===undefined?"":this.props.detailInfoList.allow_statistics===true?editPanel===false?<div className="click_add color-grey-9" onClick={this.addStage}>
<span className="color-blue_4C" >+点击新建阶段</span>1
</div>:'':''}
{this.props.detailInfoList===undefined&&this.props.isAdmin()&&editPanel===false?<div className="click_add color-grey-9" onClick={this.addStage}>
<span className="color-blue_4C" >+点击新建阶段</span>1
</div>:''}
</div>
)
}

@ -236,10 +236,12 @@ class DetailCardsEditAndEdit extends Component{
}else{
newstage_descriptions=""
}
let url='/stages/'+stageid+'.json'
let url;
if(this.props.ysldetailcards===undefined){
url='/stages/'+stageid+'.json';
}else{
url=`/course_stages/${this.props.coursesId}.json`;
}
axios.put(url, {
name:stage_name,
description:newstage_descriptions,

@ -166,7 +166,7 @@ class DetailCards extends Component{
})
}
</div>
<DetailCardsEditAndAdd></DetailCardsEditAndAdd>
<DetailCardsEditAndAdd {...this.props}></DetailCardsEditAndAdd>
</div>
)
}

@ -11,7 +11,7 @@ if(window.wx) {
title: ' title', // 分享标题
desc: 'hello world', // 分享描述
link: 'https://www.educoder.net', // 分享链接该链接域名或路径必须与当前页面对应的公众号JS安全域名一致
imgUrl: 'https://pre-newweb.educoder.net/images/educoder/headNavLogo.png', // 分享图标
imgUrl: 'https://test-newweb.educoder.net/images/educoder/headNavLogo.png', // 分享图标
success: function () {
// 设置成功
}

@ -9,7 +9,6 @@ body,h1,h2,h3,h4,h5,h6,hr,p,blockquote,dl,dt,dd,ul,ol,li,pre,form,fieldset,legen
table,input,textarea,select,button { font-family: "微软雅黑","宋体"; font-size:14px;line-height:1.9; background:#f5f5f5; color:#333;}
div,img,tr,td,table{ border:0;}
table,tr,td{border:0;}
ol,ul,li{ list-style-type:none}
a:link,a:visited{text-decoration:none;color:#898989; }
a:hover {color:#FF7500;}
a:hover.fa{color:#FF7500;}
@ -122,7 +121,7 @@ a:hover.link-color-grey03{color:#3498db!important;}
.mr3{margin-right: 3px}.mr4{margin-right: 4px}.mr5{ margin-right: 5px;}.mr8{ margin-right: 8px;}.mr10{ margin-right: 10px;}.mr12{ margin-right:12px!important;}.mr15{ margin-right: 15px;}.mr18{ margin-right: 18px;}.mr20{ margin-right: 20px;}.mr25{ margin-right: 25px;}.mr30{ margin-right:30px;}.mr35{margin-right:35px;}.mr40{margin-right:40px;}.mr45{margin-right:45px;}.mr50{ margin-right: 50px;}.mr60{ margin-right:60px;}.mr350{ margin-right:350px;}.pt5{ padding-top:5px;}.pt10{ padding-top:10px;}.pt15{ padding-top:15px;}.pt20{ padding-top:20px;}.pt30{ padding-top:30px;}.pt40{ padding-top:40px;}.pt47{ padding-top:47px;}.pt100{padding-top:100px;}.pt130{padding-top:130px;}
.pt1{ padding-top:1px;}.pt5{ padding-top:5px;}.pt10{ padding-top:10px;}.pt15{ padding-top:15px;}.pt20{ padding-top:20px;}.pt30{ padding-top:30px;}.pt40{ padding-top:40px;}
.pb5{ padding-bottom:5px;}.pb10{ padding-bottom:10px;}.pb15{ padding-bottom:15px;}.pb20{ padding-bottom:20px;}.pb30{ padding-bottom:30px;}.pb40{ padding-bottom:40px;}.pb47{ padding-bottom:47px;}.pb50{ padding-bottom:50px;}.pb155{ padding-bottom:155px;}
.pb5{ padding-bottom:5px;}.pb10{ padding-bottom:10px;}.pb15{ padding-bottom:15px;}.pb20{ padding-bottom:20px;}.pb28{ padding-bottom:28px;}.pb30{ padding-bottom:30px;}.pb40{ padding-bottom:40px;}.pb47{ padding-bottom:47px;}.pb50{ padding-bottom:50px;}.pb155{ padding-bottom:155px;}
.pl2{ padding-left:2px;}.pl5{ padding-left:5px;}.pl8{ padding-left:8px;}.pl10{ padding-left:10px;}.pl15{ padding-left:15px;}.pl20{ padding-left:20px;}.pl28{ padding-left:28px;}.pl30{ padding-left:30px;}.pl33{padding-left: 33px}.pl40{ padding-left:40px;}.pl42{ padding-left:42px;}.pl45{ padding-left:45px;}.pl50{ padding-left:50px;}.pl100{ padding-left:100px;}.pl35{ padding-left:35px;}.pl50{padding-left:50px;}.pl70{padding-left:70px;}.pl80{padding-left:80px;}.pl92{padding-left:92px;}
.pr2{ paddding-right:2px;}.pr5{ padding-right:5px;}.pr10{ padding-right:10px;}.pr15{ padding-right:15px;}.pr20{ padding-right:20px!important;}.pr30{ padding-right:30px!important;}.pr42{ padding-right:42px;}.pr45{ padding-right:45px;}

@ -109,7 +109,7 @@ a.decoration{text-decoration: underline}
}
.pt1{ padding-top:1px;}.pt3{ padding-top:3px!important;}.pt5{ padding-top:5px!important;}.pt10{ padding-top:10px;}.pt15{ padding-top:15px;}.pt17{ padding-top:17px;}.pt20{ padding-top:20px!important;}.pt25{ padding-top:25px;}.pt30{ padding-top:30px;}.pt35{ padding-top:35px;}.pt37{ padding-top:37px;}.pt40{ padding-top:40px;}.pt47{ padding-top:47px;}.pt49{ padding-top:49px;}.pt50{ padding-top:50px;}.pt60{ padding-top:60px;}.pt70{ padding-top:70px;}.pt80{ padding-top:80px;}.pt90{ padding-top:90px;}.pt100{padding-top:100px;}.pt110{ padding-top:110px;}.pt120{ padding-top:120px;}.pt130{padding-top:130px;}
.pb3{ padding-bottom:3px!important;}.pb5{ padding-bottom:5px!important;}.pb10{ padding-bottom:10px;}.pb15{ padding-bottom:15px;}.pb20{ padding-bottom:20px;}.pb25{ padding-bottom:20px;}.pb25{ padding-bottom:20px;}.pb30{ padding-bottom:30px;}.pb35{ padding-bottom:35px;}.pb40{ padding-bottom:40px;}.pb47{ padding-bottom:47px;}.pb50{ padding-bottom:50px;}.pb60{ padding-bottom:60px;}.pb70{ padding-bottom:70px;}.pb80{ padding-bottom:80px;}.pb90{ padding-bottom:90px;}.pb100{ padding-bottom:100px;}.pb110{ padding-bottom:110px;}.pb155{ padding-bottom:155px;}
.pb3{ padding-bottom:3px!important;}.pb5{ padding-bottom:5px!important;}.pb10{ padding-bottom:10px;}.pb15{ padding-bottom:15px;}.pb20{ padding-bottom:20px;}.pb25{ padding-bottom:20px;}.pb25{ padding-bottom:20px;}.pb28{ padding-bottom:28px;}.pb30{ padding-bottom:30px;}.pb35{ padding-bottom:35px;}.pb40{ padding-bottom:40px;}.pb47{ padding-bottom:47px;}.pb50{ padding-bottom:50px;}.pb60{ padding-bottom:60px;}.pb70{ padding-bottom:70px;}.pb80{ padding-bottom:80px;}.pb90{ padding-bottom:90px;}.pb100{ padding-bottom:100px;}.pb110{ padding-bottom:110px;}.pb155{ padding-bottom:155px;}
.pr2{ paddding-right:2px;}.pr5{ padding-right:5px;}.pr10{ padding-right:10px;}.pr15{ padding-right:15px;}.pr20{ padding-right:20px!important;}.pr30{ padding-right:30px!important;}.pr35{ padding-right:35px!important;}.pr42{ padding-right:42px;}.pr45{ padding-right:45px;}.pr48{ padding-right:48px;}.pr57{ padding-right:57px;}.pr60{ padding-right:60px;}.pr70{ padding-right:70px;}.pr72{ padding-right:72px;}.pr75{ padding-right:75px;}.pr88{ padding-right:88px;}
.pl0{ padding-left:0px!important;}.pl2{ padding-left:2px;}.pl5{ padding-left:5px;}.pl7{ padding-left:7px;}.pl8{ padding-left:8px;}.pl10{ padding-left:10px;}.pl15{ padding-left:15px;}.pl20{ padding-left:20px;}.pl22{ padding-left:22px;}.pl25{ padding-left:25px;}.pl28{ padding-left:28px;}.pl30{ padding-left:30px !important;}.pl33{padding-left: 33px}.pl35{ padding-left:35px;}.pl40{ padding-left:40px;}.pl42{ padding-left:42px;}.pl45{ padding-left:45px;}.pl50{ padding-left:50px;}.pl60{ padding-left:60px;}.pl70{padding-left:70px;}.pl75{padding-left:75px;}.pl80{padding-left:80px;}.pl88{ padding-left:88px;}.pl92{padding-left:92px;}.pl100{ padding-left:100px;}
@ -582,8 +582,8 @@ a.user_greybg_btn{background-color:#747A7F;color: #fff;}
/*md编辑器恢复被覆盖样式*/
.new_li li{ list-style-type: disc!important; }
.new_li ol li{ list-style-type: decimal!important; }
.new_li .markdown-body ul > li{ list-style-type: disc!important;margin-bottom: 0!important; }
.new_li .markdown-body ol > li{ list-style-type: decimal!important; }
.new_li li{ margin-bottom: 0!important; }
/*搜索框*/

Loading…
Cancel
Save