dev_aliyun_beta
杨树明 5 years ago
parent 24514d668e
commit 66297cd551

@ -12,6 +12,7 @@
//= require jquery.cxselect
//= require bootstrap-datepicker
//= require bootstrap.viewer
//= require jquery.mloading
//= require echarts
//= require lib/codemirror

@ -0,0 +1,14 @@
$(document).on('turbolinks:load', function() {
var $modal = $('.modal.admin-message-modal');
if ($modal.length > 0) {
$modal.on('hide.bs.modal', function(){
$modal.find('.modal-body').html('');
});
}
});
function showMessageModal(html) {
var $modal = $('.modal.admin-message-modal');
$modal.find('.modal-body').html(html);
$modal.modal('show');
}

@ -117,5 +117,73 @@ $(document).on('turbolinks:load', function(){
});
}
});
// 导入学生
var $importUserModal = $('.modal.admin-import-user-modal');
var $importUserForm = $importUserModal.find('form.admin-import-user-form')
$importUserModal.on('show.bs.modal', function(){
$importUserModal.find('.file-names').html('选择文件');
$importUserModal.find('.upload-file-input').trigger('click');
});
$importUserModal.find('.upload-file-input').on('change', function(e){
var file = $(this)[0].files[0];
$importUserModal.find('.file-names').html(file ? file.name : '请选择文件');
})
var importUserFormValid = function(){
if($importUserForm.find('input[name="file"]').val() == undefined || $importUserForm.find('input[name="file"]').val().length == 0){
$importUserForm.find('.error').html('请选择文件');
return false;
}
return true;
};
var buildResultMessage = function(data){
var messageHtml = "<div>导入结果:成功" + data.success + "条,失败"+ data.fail.length + "条</div>";
if(data.fail.length > 0){
messageHtml += '<table class="table"><thead class="thead-light"><tr><th>数据</th><th>失败原因</th></tr></thead><tbody>';
data.fail.forEach(function(item){
messageHtml += '<tr><td>' + item.data + '</td><td>' + item.message + '</td></tr>';
});
messageHtml += '</tbody></table>'
}
return messageHtml;
}
$importUserModal.on('click', '.submit-btn', function(){
$importUserForm.find('.error').html('');
if (importUserFormValid()) {
$('body').mLoading({ text: '正在导入...' });
$.ajax({
method: 'POST',
dataType: 'json',
url: '/admins/import_users',
data: new FormData($importUserForm[0]),
processData: false,
contentType: false,
success: function(data){
$('body').mLoading('destroy');
$importUserModal.modal('hide');
showMessageModal(buildResultMessage(data));
},
error: function(res){
$('body').mLoading('destroy');
var data = res.responseJSON;
$importUserForm.find('.error').html(data.message);
}
});
}
});
}
});

@ -16,4 +16,3 @@
//= require jquery3
//= require popper
//= require bootstrap-sprockets
//= require_tree .

@ -0,0 +1,202 @@
/* Authormingyuhisoft@163.com
* Github:https://github.com/imingyu/jquery.mloading
* Npm:npm install jquery.mloading.js
* Date2016-7-4
*/
;(function (root, factory) {
'use strict';
if (typeof module === 'object' && typeof module.exports === 'object') {
factory(require('jquery'),root);
} if(typeof define ==="function"){
if(define.cmd){
define(function(require, exports, module){
var $ = require("jquery");
factory($,root);
});
}else{
define(["jquery"],function($){
factory($,root);
});
}
}else {
factory(root.jQuery,root);
}
} (typeof window !=="undefined" ? window : this, function ($, root, undefined) {
'use strict';
if(!$){
$ = root.jQuery || null;
}
if(!$){
throw new TypeError("必须引入jquery库方可正常使用");
}
var arraySlice = Array.prototype.slice,
comparison=function (obj1,obj2) {
var result=true;
for(var pro in obj1){
if(obj1[pro] !== obj2[obj1]){
result=true;
break;
}
}
return result;
}
function MLoading(dom,options) {
options=options||{};
this.dom=dom;
this.options=$.extend(true,{},MLoading.defaultOptions,options);
this.curtain=null;
this.render().show();
}
MLoading.prototype={
constructor:MLoading,
initElement:function () {
var dom=this.dom,
ops=this.options;
var curtainElement=dom.children(".mloading"),
bodyElement = curtainElement.children('.mloading-body'),
barElement = bodyElement.children('.mloading-bar'),
iconElement = barElement.children('.mloading-icon'),
textElement = barElement.find(".mloading-text");
if (curtainElement.length == 0) {
curtainElement = $('<div class="mloading"></div>');
dom.append(curtainElement);
}
if (bodyElement.length == 0) {
bodyElement = $('<div class="mloading-body"></div>');
curtainElement.append(bodyElement);
}
if (barElement.length == 0) {
barElement = $('<div class="mloading-bar"></div>');
bodyElement.append(barElement);
}
if (iconElement.length == 0) {
var _iconElement=document.createElement(ops.iconTag);
iconElement = $(_iconElement);
iconElement.addClass("mloading-icon");
barElement.append(iconElement);
}
if (textElement.length == 0) {
textElement = $('<span class="mloading-text"></span>');
barElement.append(textElement);
}
this.curtainElement=curtainElement;
this.bodyElement = bodyElement;
this.barElement = barElement;
this.iconElement = iconElement;
this.textElement = textElement;
return this;
},
render:function () {
var dom=this.dom,
ops=this.options;
this.initElement();
if(dom.is("html") || dom.is("body")){
this.curtainElement.addClass("mloading-full");
}else{
this.curtainElement.removeClass("mloading-full");
if(!dom.hasClass("mloading-container")){
dom.addClass("mloading-container");
}
}
if(ops.mask){
this.curtainElement.addClass("mloading-mask");
}else{
this.curtainElement.removeClass("mloading-mask");
}
if(ops.content!="" && typeof ops.content!="undefined"){
if(ops.html){
this.bodyElement.html(ops.content);
}else{
this.bodyElement.text(ops.content);
}
}else{
this.iconElement.attr("src",ops.icon);
if(ops.html){
this.textElement.html(ops.text);
}else{
this.textElement.text(ops.text);
}
}
return this;
},
setOptions:function (options) {
options=options||{};
var oldOptions = this.options;
this.options = $.extend(true,{},this.options,options);
if(!comparison(oldOptions,this.options)) this.render();
},
show:function () {
var dom=this.dom,
ops=this.options,
barElement=this.barElement;
this.curtainElement.addClass("active");
barElement.css({
"marginTop":"-"+barElement.outerHeight()/2+"px",
"marginLeft":"-"+barElement.outerWidth()/2+"px"
});
return this;
},
hide:function () {
var dom=this.dom,
ops=this.options;
this.curtainElement.removeClass("active");
if(!dom.is("html") && !dom.is("body")){
dom.removeClass("mloading-container");
}
return this;
},
destroy:function () {
var dom=this.dom,
ops=this.options;
this.curtainElement.remove();
if(!dom.is("html") && !dom.is("body")){
dom.removeClass("mloading-container");
}
dom.removeData(MLoading.dataKey);
return this;
}
};
MLoading.dataKey="MLoading";
MLoading.defaultOptions = {
text:"加载中...",
iconTag:"img",
icon:"data:image/gif;base64,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",
html:false,
content:"",//设置content后text和icon设置将无效
mask:true//是否显示遮罩(半透明背景)
};
$.fn.mLoading=function (options) {
var ops={},
funName="",
funArgs=[];
if(typeof options==="object"){
ops = options;
}else if(typeof options ==="string"){
funName=options;
funArgs = arraySlice.call(arguments).splice(0,1);
}
return this.each(function (i,element) {
var dom = $(element),
plsInc=dom.data(MLoading.dataKey);
if(!plsInc){
plsInc=new MLoading(dom,ops);
}
if(funName){
var fun = plsInc[funName];
if(typeof fun==="function"){
fun.apply(plsInc,funArgs);
}
}
});
}
}));

@ -5,6 +5,7 @@
@import "select2-bootstrap4.min";
@import "bootstrap-datepicker";
@import "bootstrap-datepicker.standalone";
@import "jquery.mloading";
@import "lib/codemirror";
@import "common";

@ -0,0 +1,94 @@
/* Authormingyuhisoft@163.com
* Github:https://github.com/imingyu/jquery.mloading
* Npm:npm install jquery.mloading.js
* Date2016-7-4
*/
.mloading-container {
position: relative;
min-height: 70px;
-webkit-transition: height 0.6s ease-in-out;
-o-transition: height 0.6s ease-in-out;
transition: height 0.6s ease-in-out;
}
.mloading {
position: absolute;
background: #E9E9E8;
font: normal 12px/22px "Microsoft Yahei", "微软雅黑", "宋体";
display: none;
z-index: 1600;
background: rgba(233, 233, 232, 0);
}
.mloading.active {
display: block;
}
.mloading.mloading-mask {
background: rgba(233, 233, 232, 0.75);
filter: progid:DXImageTransform.Microsoft.Alpha(opacity=75);
}
.mloading-full {
position: fixed;
width: 100%;
height: 100%;
top: 0;
left: 0;
}
.mloading-container > .mloading {
top: 0px;
left: 0px;
width: 100%;
height: 100%;
}
.mloading-body {
width: 100%;
height: 100%;
position: relative;
}
.mloading-bar {
width: 250px;
min-height: 22px;
text-align: center;
background: #fff;
box-shadow: 0 1px 2px rgba(0, 0, 0, 0.27);
border-radius: 7px;
padding: 20px 15px;
font-size: 14px;
color: #999;
position: absolute;
top: 50%;
left: 50%;
margin-left: -140px;
margin-top: -30px;
word-break: break-all;
}
@media (max-width: 300px) {
.mloading-bar {
width: 62px;
height: 56px;
margin-left: -30px !important;
margin-top: -30px !important;
padding: 0;
line-height: 56px;
}
.mloading-bar > .mloading-text {
display: none;
}
}
.mloading-bar-sm {
width: 62px;
height: 56px;
margin-left: -30px !important;
margin-top: -30px !important;
padding: 0;
line-height: 56px;
}
.mloading-bar-sm > .mloading-text {
display: none;
}
.mloading-icon {
width: 16px;
height: 16px;
vertical-align: middle;
}
.mloading-text {
margin-left: 10px;
}

@ -0,0 +1,10 @@
class Admins::ImportCourseMembersController < Admins::BaseController
def create
return render_error('请上传正确的文件') if params[:file].blank? || !params[:file].is_a?(ActionDispatch::Http::UploadedFile)
result = Admins::ImportCourseMemberService.call(params[:file].to_io)
render_ok(result)
rescue Admins::ImportCourseMemberService::Error => ex
render_error(ex)
end
end

@ -0,0 +1,10 @@
class Admins::ImportUsersController < Admins::BaseController
def create
return render_error('请上传正确的文件') if params[:file].blank? || !params[:file].is_a?(ActionDispatch::Http::UploadedFile)
result = Admins::ImportUserService.call(params[:file].to_io)
render_ok(result)
rescue Admins::ImportUserService::Error => ex
render_error(ex)
end
end

@ -144,9 +144,12 @@ class CoursesController < ApplicationController
@course.course_list_id = new_course_list.id
end
else
subject = Subject.find_by!(id: params[:subject_id])
@course.start_date = params[:start_date]
@course.subject_id = params[:subject_id]
@course.subject_id = subject.id
@course.excellent = true
course_list = CourseList.find_by(name: subject.name) || CourseList.create!(name: subject.name, user_id: current_user.id, is_admin: 0)
@course.course_list_id = course_list.id
end
@course.is_end = @course.end_date.present? && @course.end_date < Date.today
@ -1238,7 +1241,7 @@ class CoursesController < ApplicationController
tip_exception("开始时间不能为空") if params[:start_date].blank?
tip_exception("结束时间不能为空") if params[:end_date].blank?
tip_exception("结束时间必须晚于开始时间") if strf_date(params[:end_date]) <= strf_date(params[:start_date])
tip_exception("开始时间和结束时间不能与往期开课时间重叠") if @course.nil? && @subject.max_course_end_date && strf_date(params[:start_date]) <= strf_date(@subject.max_course_end_date)
tip_exception("开始时间和结束时间不能早于往期开课时间") if @course.nil? && @subject.max_course_end_date && strf_date(params[:start_date]) <= strf_date(@subject.max_course_end_date)
validate_start_end_date if @course.present?
tip_exception("开放课堂必须包含公告栏和在线学习模块") unless params[:course_module_types].include?("announcement") && params[:course_module_types].include?("online_learning")
end

@ -354,6 +354,7 @@ class ExercisesController < ApplicationController
# question_bank = QuestionBank.new ques_params
# question_bank.save
# end
exercise.update_attributes!(exercise_bank_id: current_ex_bank.id)
end
# 试卷的问题的输入
exercise.exercise_questions.each do |q|

@ -301,6 +301,7 @@ class GraduationTasksController < ApplicationController
course_list_id: @course.course_list_id)
task_bank.save!
task.update_attributes!(gtask_bank_id: task_bank.id)
end
task.attachments.each do |attachment|
att = attachment.copy

@ -1322,6 +1322,8 @@ class HomeworkCommonsController < ApplicationController
else
new_homework_bank = add_to_homework_bank_f homework
new_homework_bank.save!
homework.update_attributes!(homework_bank_id: new_homework_bank.id)
end
rescue Exception => e

@ -562,6 +562,7 @@ class PollsController < ApplicationController
question_bank = QuestionBank.new ques_params
question_bank.save
end
poll.update_attributes!(exercise_bank_id: current_ex_bank.id)
end
# 问卷的问题的输入
poll.poll_questions.each do |f|

@ -541,7 +541,7 @@ class StudentWorksController < ApplicationController
def destroy_score
score = @work.student_works_scores.find_by(id: params[:score_id])
tip_exception("该评阅记录不存在") unless score.present?
tip_exception("该评阅记录不能删除") unless score.allow_delete(@current_user, @user_course_identity)
tip_exception("该评阅记录不能删除") unless score.allow_delete(current_user)
begin
score.destroy
normal_status(0,"删除成功")

@ -0,0 +1,20 @@
class Admins::ImportCourseMemberExcel < BaseImportXlsx
Data = Struct.new(:student_id, :name, :course_id, :role, :course_group_name, :school_id)
def read_each(&block)
sheet.each_row_streaming(pad_cells: true, offset: 1) do |row|
data = row.map(&method(:cell_value))[0..5]
block.call Data.new(*data)
end
end
private
def check_sheet_valid!
raise_import_error('请按照模板格式导入') if sheet.row(1).size != 6
end
def cell_value(obj)
obj&.cell_value&.to_s&.strip
end
end

@ -0,0 +1,33 @@
class Admins::ImportUserExcel < BaseImportXlsx
UserData = Struct.new(:student_id, :name, :department_name, :identity, :technical_title, :phone)
def read_each(&block)
sheet.each_row_streaming(pad_cells: true, offset: 3) do |row|
data = row.map(&method(:cell_value))[0..5]
block.call UserData.new(*data)
end
end
def school
@school ||= begin
school_id = sheet.cell(1, 1).to_s.strip
school_name = sheet.cell(1, 2).to_s.strip
School.find_by(id: school_id, name: school_name)
end
end
def identifier
@_identifier ||= sheet.cell(2, 1).to_s.strip
end
private
def check_sheet_valid!
raise_import_error('请按照模板格式导入') if school.blank?
end
def cell_value(obj)
obj&.cell_value
end
end

@ -1,5 +1,11 @@
class ApplicationImport
Error = Class.new(StandardError)
def logger(msg)
Rails.logger.error(msg)
end
def raise_import_error(message)
raise Error, message
end
end

@ -0,0 +1,23 @@
class BaseImportXlsx < ApplicationImport
attr_reader :sheet
def initialize(path)
raise Error, '只支持xlsx格式' unless !path.is_a?(String) || path.end_with?('.xlsx')
begin
@sheet = Roo::Excelx.new(path)
rescue Exception => ex
Util.logger_error(ex)
raise Error, '打开文件失败'
end
check_sheet_valid!
end
def read_each(&block);end
private
def check_sheet_valid!;end
end

@ -13,9 +13,8 @@ belongs_to :student_work
identity < Course::STUDENT || self.user == user || self.reviewer_role != 3
end
def allow_delete current_user, identity
self.is_invalid && (current_user == self.user || identity < Course::STUDENT) ||
(self.score.nil? && current_user == self.user)
def allow_delete current_user
(self.is_invalid || self.score.nil?) && (current_user == self.user || current_user.admin?)
end
# 匿评分

@ -0,0 +1,63 @@
class Admins::ImportCourseMemberService < ApplicationService
Error = Class.new(StandardError)
attr_reader :file, :result
def initialize(file)
@file = file
@result = { success: 0, fail: [] }
end
def call
raise Error, '文件不存在' if file.blank?
excel = Admins::ImportCourseMemberExcel.new(file)
excel.read_each(&method(:create_course_member))
result
rescue ApplicationImport::Error => ex
raise Error, ex.message
end
private
def create_course_member(data)
raise '课堂角色必须为 2、3、4' unless [2, 3, 4].include?(data.role.to_i)
user = User.joins(:user_extension).where(user_extensions: { student_id: data.student_id, school_id: data.school_id }).first
raise '该学号的用户不存在' if user.blank?
course = Course.find_by(id: data.course_id)
raise '该课堂不存在' if course.blank?
course_group = nil
if data.course_group_name.present?
course_group = course.course_groups.find_or_create_by!(name: data.course_group_name)
end
member = course.course_members.find_by(user_id: user.id, role: data.role.to_i)
# 如果已是课堂成员且是学生身份and不在指定的分班则移动到该分班
if member.present? && member.role == :STUDENT && course_group && member.course_group_id != course_group&.id
member.update!(course_group_id: course_group&.id)
elsif member.blank?
course.course_members.create!(user_id: user.id, role: data.role.to_i, course_group_id: course_group&.id)
extra =
case data.role.to_i
when 2 then 9
when 3 then 7
else 10
end
Tiding.create!(user_id: user.id, trigger_user_id: course.tea_id, container_id: course.id,
container_type: 'TeacherJoinCourse', belong_container_id: course.id,
belong_container_type: 'Course', tiding_type: 'System', extra: extra)
end
result[:success] += 1
rescue Exception => ex
fail_data = data.as_json
fail_data[:data] = fail_data.values.join(',')
fail_data[:message] = ex.message
result[:fail] << fail_data
end
end

@ -0,0 +1,89 @@
class Admins::ImportUserService < ApplicationService
Error = Class.new(StandardError)
attr_reader :file, :school, :prefix, :result
def initialize(file)
@file = file
@result = { success: 0, fail: [] }
end
def call
raise Error, '文件不存在' if file.blank?
excel = Admins::ImportUserExcel.new(file)
@school = excel.school
@prefix = excel.identifier
excel.read_each(&method(:save_user))
result
rescue ApplicationImport::Error => ex
raise Error, ex.message
end
private
def save_user(data)
user = find_user(data)
if user.blank?
create_user(data)
else
user.update_column(:certification, 1)
end
result[:success] += 1
rescue Exception => ex
fail_data = data.as_json
fail_data[:data] = fail_data.values.join(',')
fail_data[:message] = ex.message
result[:fail] << fail_data
end
def create_user(data)
department = school.departments.find_by(name: data.department_name)
attr = {
status: User::STATUS_ACTIVE,
login: "#{prefix}#{data.student_id}",
firstname: '',
lastname: data.name,
nickname: data.name,
professional_certification: 1,
certification: 1,
password: '12345678',
phone: data.phone
}
ActiveRecord::Base.transaction do
user = User.create!(attr)
extension_attr = {
school_id: school.id, location: school.province, location_city: school.city,
gender: 0, identity: data.identity.to_i, department_id: department&.id, student_id: data.student_id
}
extension_attr[:technical_title] =
case data.identity.to_i
when 0 then %w(教授 副教授 讲师 助教).include?(data.technical_title) || '讲师'
when 2 then %w(企业管理者 部门管理者 高级工程师 工程师 助理工程师).include?(data.technical_title) || '助理工程师'
else nil
end
user.create_user_extension!(extension_attr)
end
end
def find_user(data)
users = User.joins(:user_extension).where(user_extensions: { identity: data.identity, school_id: school.id })
if data.identity.to_i == 1
users = users.where(user_extensions: { student_id: data.student_id })
else
users = users.where(user_extensions: { technical_title: data.technical_title }).where('CONCAT(users.lastname,users.firstname) = ?', data.name)
end
users.first
end
end

@ -9,7 +9,7 @@ class Ecs::ImportCourseService < ApplicationService
end
def call
raise_import_error('文件不存在') if attachment.blank?
raise Error, '文件不存在' if attachment.blank?
path = attachment.diskfile
excel = Ecs::ImportCourseExcel.new(path)

@ -9,7 +9,7 @@ class Ecs::ImportStudentService < ApplicationService
end
def call
raise_import_error('文件不存在') if attachment.blank?
raise Error, '文件不存在' if attachment.blank?
path = attachment.diskfile
excel = Ecs::ImportStudentExcel.new(path)

@ -0,0 +1,18 @@
<div class="modal fade admin-message-modal" 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">消息</h5>
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
<span aria-hidden="true">&times;</span>
</button>
</div>
<div class="modal-body" style="max-height: 300px; overflow-y: scroll;">
保存成功
</div>
<div class="modal-footer">
<button type="button" class="btn btn-primary" data-dismiss="modal">确认</button>
</div>
</div>
</div>
</div>

@ -3,7 +3,7 @@
<% end %>
<div class="box search-form-container user-list-form">
<%= form_tag(admins_users_path, method: :get, class: 'form-inline search-form', remote: true) do %>
<%= form_tag(admins_users_path, method: :get, class: 'form-inline search-form flex-1', remote: true) do %>
<div class="form-group mr-2">
<label for="status">状态:</label>
<% status_options = [['全部', ''], ['正常', User::STATUS_ACTIVE], ['未激活', User::STATUS_REGISTERED], ['已锁定', User::STATUS_LOCKED]] %>
@ -26,6 +26,8 @@
<%= text_field_tag(:school_name, params[:school_name], class: 'form-control col-sm-2', placeholder: '学校/单位检索') %>
<%= submit_tag('搜索', class: 'btn btn-primary ml-3', 'data-disable-with': '搜索中...') %>
<% end %>
<%= javascript_void_link '导入用户', class: 'btn btn-secondary btn-sm', data: { toggle: 'modal', target: '.admin-import-user-modal'} %>
</div>
<div class="box users-list-container">
@ -33,3 +35,4 @@
</div>
<%= render partial: 'admins/users/shared/reward_grade_modal' %>
<%= render partial: 'admins/users/shared/import_user_modal' %>

@ -0,0 +1,30 @@
<div class="modal fade admin-import-user-modal" 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">导入用户</h5>
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
<span aria-hidden="true">&times;</span>
</button>
</div>
<div class="modal-body">
<form class="admin-import-user-form" enctype="multipart/form-data">
<div class="input-group">
<div class="input-group-prepend">
<span class="input-group-text">文件</span>
</div>
<div class="custom-file">
<input type="file" name="file" class="upload-file-input" id="upload-file-input" accept="application/vnd.openxmlformats-officedocument.spreadsheetml.sheet">
<label class="custom-file-label file-names" for="upload-file-input">选择文件</label>
</div>
</div>
<div class="error text-danger"></div>
</form>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-secondary" data-dismiss="modal">取消</button>
<button type="button" class="btn btn-primary submit-btn">确认</button>
</div>
</div>
</div>
</div>

@ -15,7 +15,7 @@ json.comment_scores @comment_scores do |score|
json.score score.score
json.content score.comment
json.is_invalid score.is_invalid
json.delete @current_user == score.user && (score.is_invalid || score.score.nil?)
json.delete (@current_user == score.user || @current_user.admin?) && (score.is_invalid || score.score.nil?)
json.attachments score.attachments do |atta|
json.partial! "attachments/attachment_simple", locals: {attachment: atta, delete: false}
end

@ -35,5 +35,8 @@
</div>
<div class="admin-modal-container"></div>
<!-- message modal -->
<%= render 'admins/shared/modal/message_modal' %>
</body>
</html>

@ -23,7 +23,7 @@ json.comment_scores @comment_scores do |score|
json.content score.comment
json.appeal_status score.appeal_status
json.is_invalid score.is_invalid
json.delete score.allow_delete(@current_user, @user_course_identity)
json.delete score.allow_delete(@current_user)
json.attachments score.attachments do |atta|
json.partial! "attachments/attachment_simple", locals: {attachment: atta, delete: false}
end

@ -8,7 +8,7 @@ json.question_banks @question_banks do |question_bank|
json.is_public question_bank.is_public
json.quotes_count question_bank.quotes
json.creator_name question_bank.user.name
json.course_list_name question_bank.course_list.name
json.course_list_name question_bank.course_list&.name
json.updated_at question_bank.updated_at
json.solve_count @solve_count_map.fetch(question_bank.id, 0)
end

@ -803,6 +803,8 @@ Rails.application.routes.draw do
post :active
end
end
resource :import_users, only: [:create]
resource :import_course_members, only: [:create]
resources :library_applies, only: [:index] do
member do

@ -0,0 +1,12 @@
class MigrateExcellentCourseCourseList < ActiveRecord::Migration[5.2]
def change
courses = Course.where(excellent: true)
courses.each do |course|
if !course.course_list.present? && course.subject
subject = course.subject
course_list = CourseList.find_by(name: subject.name) || CourseList.create!(name: subject.name, user_id: course.tea_id, is_admin: 0)
course.update_attributes(course_list_id: course_list.id)
end
end
end
end

Binary file not shown.

File diff suppressed because one or more lines are too long

@ -27613,6 +27613,209 @@ $.fn.bootstrapViewer.defaults = {
src: 'src'
}
;
/* Authormingyuhisoft@163.com
* Github:https://github.com/imingyu/jquery.mloading
* Npm:npm install jquery.mloading.js
* Date2016-7-4
*/
;(function (root, factory) {
'use strict';
if (typeof module === 'object' && typeof module.exports === 'object') {
factory(require('jquery'),root);
} if(typeof define ==="function"){
if(define.cmd){
define(function(require, exports, module){
var $ = require("jquery");
factory($,root);
});
}else{
define(["jquery"],function($){
factory($,root);
});
}
}else {
factory(root.jQuery,root);
}
} (typeof window !=="undefined" ? window : this, function ($, root, undefined) {
'use strict';
if(!$){
$ = root.jQuery || null;
}
if(!$){
throw new TypeError("必须引入jquery库方可正常使用");
}
var arraySlice = Array.prototype.slice,
comparison=function (obj1,obj2) {
var result=true;
for(var pro in obj1){
if(obj1[pro] !== obj2[obj1]){
result=true;
break;
}
}
return result;
}
function MLoading(dom,options) {
options=options||{};
this.dom=dom;
this.options=$.extend(true,{},MLoading.defaultOptions,options);
this.curtain=null;
this.render().show();
}
MLoading.prototype={
constructor:MLoading,
initElement:function () {
var dom=this.dom,
ops=this.options;
var curtainElement=dom.children(".mloading"),
bodyElement = curtainElement.children('.mloading-body'),
barElement = bodyElement.children('.mloading-bar'),
iconElement = barElement.children('.mloading-icon'),
textElement = barElement.find(".mloading-text");
if (curtainElement.length == 0) {
curtainElement = $('<div class="mloading"></div>');
dom.append(curtainElement);
}
if (bodyElement.length == 0) {
bodyElement = $('<div class="mloading-body"></div>');
curtainElement.append(bodyElement);
}
if (barElement.length == 0) {
barElement = $('<div class="mloading-bar"></div>');
bodyElement.append(barElement);
}
if (iconElement.length == 0) {
var _iconElement=document.createElement(ops.iconTag);
iconElement = $(_iconElement);
iconElement.addClass("mloading-icon");
barElement.append(iconElement);
}
if (textElement.length == 0) {
textElement = $('<span class="mloading-text"></span>');
barElement.append(textElement);
}
this.curtainElement=curtainElement;
this.bodyElement = bodyElement;
this.barElement = barElement;
this.iconElement = iconElement;
this.textElement = textElement;
return this;
},
render:function () {
var dom=this.dom,
ops=this.options;
this.initElement();
if(dom.is("html") || dom.is("body")){
this.curtainElement.addClass("mloading-full");
}else{
this.curtainElement.removeClass("mloading-full");
if(!dom.hasClass("mloading-container")){
dom.addClass("mloading-container");
}
}
if(ops.mask){
this.curtainElement.addClass("mloading-mask");
}else{
this.curtainElement.removeClass("mloading-mask");
}
if(ops.content!="" && typeof ops.content!="undefined"){
if(ops.html){
this.bodyElement.html(ops.content);
}else{
this.bodyElement.text(ops.content);
}
}else{
this.iconElement.attr("src",ops.icon);
if(ops.html){
this.textElement.html(ops.text);
}else{
this.textElement.text(ops.text);
}
}
return this;
},
setOptions:function (options) {
options=options||{};
var oldOptions = this.options;
this.options = $.extend(true,{},this.options,options);
if(!comparison(oldOptions,this.options)) this.render();
},
show:function () {
var dom=this.dom,
ops=this.options,
barElement=this.barElement;
this.curtainElement.addClass("active");
barElement.css({
"marginTop":"-"+barElement.outerHeight()/2+"px",
"marginLeft":"-"+barElement.outerWidth()/2+"px"
});
return this;
},
hide:function () {
var dom=this.dom,
ops=this.options;
this.curtainElement.removeClass("active");
if(!dom.is("html") && !dom.is("body")){
dom.removeClass("mloading-container");
}
return this;
},
destroy:function () {
var dom=this.dom,
ops=this.options;
this.curtainElement.remove();
if(!dom.is("html") && !dom.is("body")){
dom.removeClass("mloading-container");
}
dom.removeData(MLoading.dataKey);
return this;
}
};
MLoading.dataKey="MLoading";
MLoading.defaultOptions = {
text:"加载中...",
iconTag:"img",
icon:"data:image/gif;base64,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",
html:false,
content:"",//设置content后text和icon设置将无效
mask:true//是否显示遮罩(半透明背景)
};
$.fn.mLoading=function (options) {
var ops={},
funName="",
funArgs=[];
if(typeof options==="object"){
ops = options;
}else if(typeof options ==="string"){
funName=options;
funArgs = arraySlice.call(arguments).splice(0,1);
}
return this.each(function (i,element) {
var dom = $(element),
plsInc=dom.data(MLoading.dataKey);
if(!plsInc){
plsInc=new MLoading(dom,ops);
}
if(funName){
var fun = plsInc[funName];
if(typeof fun==="function"){
fun.apply(plsInc,funArgs);
}
}
});
}
}));
(function (global, factory) {
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports) :
typeof define === 'function' && define.amd ? define(['exports'], factory) :
@ -128220,6 +128423,21 @@ $(document).on('turbolinks:load', function() {
}
})
;
$(document).on('turbolinks:load', function() {
var $modal = $('.modal.admin-message-modal');
if ($modal.length > 0) {
$modal.on('hide.bs.modal', function(){
$modal.find('.modal-body').html('');
});
}
});
function showMessageModal(html) {
var $modal = $('.modal.admin-message-modal');
$modal.find('.modal-body').html(html);
$modal.modal('show');
}
;
$(document).on('turbolinks:load', function() {
if ($('body.admins-mirror-repositories-edit-page, body.admins-mirror-repositories-update-page').length > 0) {
var $form = $('form.edit-mirror');
@ -129182,6 +129400,74 @@ $(document).on('turbolinks:load', function(){
});
}
});
// 导入学生
var $importUserModal = $('.modal.admin-import-user-modal');
var $importUserForm = $importUserModal.find('form.admin-import-user-form')
$importUserModal.on('show.bs.modal', function(){
$importUserModal.find('.file-names').html('选择文件');
$importUserModal.find('.upload-file-input').trigger('click');
});
$importUserModal.find('.upload-file-input').on('change', function(e){
var file = $(this)[0].files[0];
$importUserModal.find('.file-names').html(file ? file.name : '请选择文件');
})
var importUserFormValid = function(){
if($importUserForm.find('input[name="file"]').val() == undefined || $importUserForm.find('input[name="file"]').val().length == 0){
$importUserForm.find('.error').html('请选择文件');
return false;
}
return true;
};
var buildResultMessage = function(data){
var messageHtml = "<div>导入结果:成功" + data.success + "条,失败"+ data.fail.length + "条</div>";
if(data.fail.length > 0){
messageHtml += '<table class="table"><thead class="thead-light"><tr><th>数据</th><th>失败原因</th></tr></thead><tbody>';
data.fail.forEach(function(item){
messageHtml += '<tr><td>' + item.data + '</td><td>' + item.message + '</td></tr>';
});
messageHtml += '</tbody></table>'
}
return messageHtml;
}
$importUserModal.on('click', '.submit-btn', function(){
$importUserForm.find('.error').html('');
if (importUserFormValid()) {
$('body').mLoading({ text: '正在导入...' });
$.ajax({
method: 'POST',
dataType: 'json',
url: '/admins/import_users',
data: new FormData($importUserForm[0]),
processData: false,
contentType: false,
success: function(data){
$('body').mLoading('destroy');
$importUserModal.modal('hide');
showMessageModal(buildResultMessage(data));
},
error: function(res){
$('body').mLoading('destroy');
var data = res.responseJSON;
$importUserForm.find('.error').html(data.message);
}
});
}
});
}
});
$(document).on('turbolinks:load', function() {
@ -129226,6 +129512,7 @@ $(document).on('turbolinks:load', function() {
$.ajaxSetup({

File diff suppressed because one or more lines are too long

@ -1,6 +1,7 @@
import React, { Component } from 'react';
import { SnackbarHOC } from 'educoder';
import {BrowserRouter as Router,Route,Switch} from 'react-router-dom';
import { withRouter } from 'react-router'
import Loadable from 'react-loadable';
import Loading from '../../Loading';
import axios from 'axios';
@ -263,7 +264,11 @@ const GraduationTasksSubmiteditApp=Loadable({
loader: () => import('./graduation/tasks/GraduationTasksSubmitedit'),
loading: Loading,
})
//排序
const Ordering=Loadable({
loader: () => import('../../modules/courses/ordering/Ordering'),
loading: Loading,
});
class CoursesIndex extends Component{
constructor(props) {
super(props)
@ -290,6 +295,13 @@ class CoursesIndex extends Component{
componentDidMount(){
// this.updataleftNav()
this.historyArray = []
this.props.history.listen( location => {
console.log(location)
this.historyArray.unshift(location.pathname)
this.historyArray.length = 2;
//Do your stuff here
});
}
updataleftNav=()=>{
@ -424,6 +436,7 @@ class CoursesIndex extends Component{
render() {
const common = {
previousPathName: this.historyArray && this.historyArray[1]
// isAdmin: this.isAdmin,
// isStudent: this.isStudent,
// isAdminOrStudent: this.isAdminOrStudent,
@ -442,27 +455,32 @@ class CoursesIndex extends Component{
// console.log(commons)
return (
<Switch {...this.props}>
{/*排序*/}
<Route path="/courses/:coursesId/ordering/:ordering_type/:main_id"
render={
(props) => (<Ordering {...this.props} {...props} {...this.state} />)
}
></Route>
{/* 资源列表页 */}
<Route path="/courses/:coursesId/file/:Id" exact
render={
(props) => (<ListPageIndex {...this.props} {...props} {...this.state} />)
(props) => (<ListPageIndex {...this.props} {...props} {...this.state} {...common}/>)
}
></Route>
<Route path="/courses/:coursesId/files/:main_id"
render={
(props) => (<ListPageIndex {...this.props} {...props} {...this.state} />)
(props) => (<ListPageIndex {...this.props} {...props} {...this.state} {...common}/>)
}
></Route>
<Route exact path="/courses/:coursesId/boards/:boardId"
render={
(props) => (<ListPageIndex {...this.props} {...props} {...this.state} />)
(props) => (<ListPageIndex {...this.props} {...props} {...this.state} {...common}/>)
}
></Route>
{/*课堂讨论*/}
<Route path="/courses/:coursesId/boards/:boardId"
render={
(props) => (<BoardIndex {...this.props} {...props} {...this.state} />)
(props) => (<BoardIndex {...this.props} {...props} {...this.state} {...common}/>)
}
></Route>
@ -470,19 +488,19 @@ class CoursesIndex extends Component{
{/* 毕设问答 */}
<Route path="/courses/:coursesId/graduation_topics/postwork/new"
render={
(props) => (<GraduateTopicPostWorksNew {...this.props} {...props} {...this.state} />)
(props) => (<GraduateTopicPostWorksNew {...this.props} {...props} {...this.state} {...common}/>)
}
></Route>
{/* 毕设选题新建页 */}
<Route path="/courses/:coursesId/graduation_topics/new"
render={
(props) => (<GraduateTopicNew {...this.props} {...props} {...this.state} />)
(props) => (<GraduateTopicNew {...this.props} {...props} {...this.state} {...common}/>)
}></Route>
{/* 毕设选题编辑页*/}
<Route path="/courses/:coursesId/graduation_topics/:topicId/edit"
render={
(props) => (<GraduateTopicNew {...this.props} {...props} {...this.state} />)
(props) => (<GraduateTopicNew {...this.props} {...props} {...this.state} {...common}/>)
}></Route>
{/* 毕设选题详情页 */}
@ -495,7 +513,7 @@ class CoursesIndex extends Component{
{/* 毕设选题列表 */}
<Route path="/courses/:coursesId/graduation_topics/:Id" exact
render={
(props) => (<ListPageIndex {...this.props} {...props} {...this.state} />)
(props) => (<ListPageIndex {...this.props} {...props} {...this.state} {...common}/>)
}></Route>
@ -503,21 +521,21 @@ class CoursesIndex extends Component{
{/* 作品评阅 https://www.trustie.net/issues/19981 */}
<Route path="/courses/:coursesId/graduation_tasks/:category_id/appraise"
render={
(props) => (<GraduationTasksappraise {...this.props} {...props} {...this.state} />)
(props) => (<GraduationTasksappraise {...this.props} {...props} {...this.state} {...common}/>)
}
></Route>
{/* 新建作品 */}
<Route path="/courses/:coursesId/graduation_tasks/:category_id/:task_Id/works/new"
render={
(props) => (<GraduationTasksSubmitnewApp {...this.props} {...props} {...this.state} />)
(props) => (<GraduationTasksSubmitnewApp {...this.props} {...props} {...this.state} {...common}/>)
}
></Route>
{/* 修改作品 */}
<Route path="/courses/:coursesId/graduation_tasks/:category_id/:work_Id/works/edit"
render={
(props) => (<GraduationTasksSubmiteditApp {...this.props} {...props} {...this.state} />)
(props) => (<GraduationTasksSubmiteditApp {...this.props} {...props} {...this.state} {...common}/>)
}
></Route>
@ -525,20 +543,20 @@ class CoursesIndex extends Component{
<Route path="/courses/:coursesId/graduation_tasks/:category_id/:task_Id/setting"
render={
(props) => (<GraduationTaskssetting {...this.props} {...props} {...this.state} />)
(props) => (<GraduationTaskssetting {...this.props} {...props} {...this.state} {...common}/>)
}
></Route>
<Route path="/courses/:coursesId/graduation_tasks/:category_id/:task_Id/questions"
render={
(props) => (<GraduationTasksquestions {...this.props} {...props} {...this.state} />)
(props) => (<GraduationTasksquestions {...this.props} {...props} {...this.state} {...common}/>)
}></Route>
<Route path="/courses/:coursesId/graduation_tasks/:category_id/:task_Id/list"
render={
(props) => (<GraduationTaskssettinglist {...this.props} {...props} {...this.state} />)
(props) => (<GraduationTaskssettinglist {...this.props} {...props} {...this.state} {...common}/>)
}
></Route>
@ -547,7 +565,7 @@ class CoursesIndex extends Component{
{/* 修改毕设任务 https://www.trustie.net/issues/19981 */}
<Route path="/courses/:coursesId/graduation_tasks/:category_id/edit"
render={
(props) => (<GraduationTaskseditApp {...this.props} {...props} {...this.state} />)
(props) => (<GraduationTaskseditApp {...this.props} {...props} {...this.state} {...common}/>)
}
></Route>
@ -555,7 +573,7 @@ class CoursesIndex extends Component{
{/* 新建毕设任务 https://www.trustie.net/issues/19981 */}
<Route path="/courses/:coursesId/graduation_tasks/:category_id/new"
render={
(props) => (<GraduationTasksnewApp {...this.props} {...props} {...this.state} />)
(props) => (<GraduationTasksnewApp {...this.props} {...props} {...this.state} {...common}/>)
}
></Route>
@ -563,87 +581,87 @@ class CoursesIndex extends Component{
{/* 毕设任务列表 https://www.trustie.net/issues/19981 */}
<Route path="/courses/:coursesId/graduation_tasks/:Id" exact
render={
(props) => (<ListPageIndex {...this.props} {...props} {...this.state} />)
(props) => (<ListPageIndex {...this.props} {...props} {...this.state} {...common}/>)
}
></Route>
{/*/!* 毕业设计主 https://www.trustie.net/issues/19981 *!/*/}
{/*<Route path="/courses/:coursesId/graduation"*/}
{/*render={*/}
{/*(props) => (<GraduationTopics {...this.props} {...props} {...this.state} />)*/}
{/*(props) => (<GraduationTopics {...this.props} {...props} {...this.state} {...common}/>)*/}
{/*}*/}
{/*></Route>*/}
{/*/!* 资源子目录 https://www.trustie.net/issues/19917 *!/*/}
{/*<Route path="/courses/:coursesId/attachment/attachment/:attachmentId"*/}
{/*render={*/}
{/*(props) => (<Files {...this.props} {...props} {...this.state} />)*/}
{/*(props) => (<Files {...this.props} {...props} {...this.state} {...common}/>)*/}
{/*}*/}
{/*></Route>*/}
{/* 教师列表*/}
<Route path="/courses/:coursesId/teachers"
render={
(props) => (<ListPageIndex {...this.props} {...props} {...this.state} />)
(props) => (<ListPageIndex {...this.props} {...props} {...this.state} {...common}/>)
}
></Route>
{/* 学生列表*/}
<Route path="/courses/:coursesId/students"
render={
(props) => (<ListPageIndex {...this.props} {...props} {...this.state} />)
(props) => (<ListPageIndex {...this.props} {...props} {...this.state} {...common}/>)
}
></Route>
{/* 分班列表 */}
<Route path="/courses/:coursesId/course_groups/:course_group_id"
render={
(props) => (<ListPageIndex {...this.props} {...props} {...this.state} />)
(props) => (<ListPageIndex {...this.props} {...props} {...this.state} {...common}/>)
}
></Route>
{/* 普通作业 */}
<Route path="/courses/:coursesId/common_homeworks/:category_id" exact
render={
(props) => (<ListPageIndex {...this.props} {...props} {...this.state} />)
(props) => (<ListPageIndex {...this.props} {...props} {...this.state} {...common}/>)
}
></Route>
{/* 分组作业 */}
<Route path="/courses/:coursesId/group_homeworks/:category_id" exact
render={
(props) => (<ListPageIndex {...this.props} {...props} {...this.state} />)
(props) => (<ListPageIndex {...this.props} {...props} {...this.state} {...common}/>)
}
></Route>
{/* 普通作业 */}
<Route path="/courses/:coursesId/common_homeworks/" strict
render={
(props) => (<CommonWork {...this.props} {...props} {...this.state} />)
(props) => (<CommonWork {...this.props} {...props} {...this.state} {...common}/>)
}
></Route>
{/* 分组作业 */}
<Route path="/courses/:coursesId/group_homeworks/" strict
render={
(props) => (<GroupWork {...this.props} {...props} {...this.state} />)
(props) => (<GroupWork {...this.props} {...props} {...this.state} {...common}/>)
}
></Route>
{/* 问卷答题 */}
<Route path="/courses/:coursesId/polls/:pollId/users/:login"
render={
(props) => (<PollInfo {...this.props} {...props} {...this.state} />)
(props) => (<PollInfo {...this.props} {...props} {...this.state} {...common}/>)
}
></Route>
{/* 问卷详情 */}
<Route path="/courses/:coursesId/polls/:pollId/detail"
render={
(props) => (<PollDetail {...this.props} {...props} {...this.state} />)
(props) => (<PollDetail {...this.props} {...props} {...this.state} {...common}/>)
}
></Route>
{/* 问卷新建 */}
<Route path="/courses/:coursesId/polls/:pollid/:news"
render={
(props) => (<PollNew {...this.props} {...props} {...this.state} />)
(props) => (<PollNew {...this.props} {...props} {...this.state} {...common}/>)
}
></Route>
{/*/!* 问卷编辑 *!/*/}
@ -655,7 +673,7 @@ class CoursesIndex extends Component{
{/* 问卷 */}
<Route path="/courses/:coursesId/polls/:Id"
render={
(props) => (<ListPageIndex {...this.props} {...props} {...this.state} />)
(props) => (<ListPageIndex {...this.props} {...props} {...this.state} {...common}/>)
}
></Route>
@ -663,20 +681,20 @@ class CoursesIndex extends Component{
{/* 试卷查看/评阅 */}
<Route exact path="/courses/:coursesId/exercises/:Id/users/:userId"
render={
(props)=>(<ExerciseReviewAndAnswer {...this.props} {...props} {...this.state} />)
(props)=>(<ExerciseReviewAndAnswer {...this.props} {...props} {...this.state} {...common}/>)
}
></Route>
{/*试卷新建 */}
<Route exact path="/courses/:coursesId/exercises/new"
render={
(props) => (<ExerciseNew {...this.props} {...props} {...this.state} />)
(props) => (<ExerciseNew {...this.props} {...props} {...this.state} {...common}/>)
}
></Route>
{/*试卷新建 */}
<Route exact path="/courses/:coursesId/exercises/:Id/edit"
render={
(props) => (<ExerciseNew {...this.props} {...props} {...this.state} />)
(props) => (<ExerciseNew {...this.props} {...props} {...this.state} {...common}/>)
}
></Route>
@ -684,7 +702,7 @@ class CoursesIndex extends Component{
<Route path="/courses/:coursesId/exercises/:Id/student_exercise_list"
render={
(props) => (<Testpapersettinghomepage {...this.props} {...props} {...this.state} />)
(props) => (<Testpapersettinghomepage {...this.props} {...props} {...this.state} {...common}/>)
}
></Route>
@ -693,14 +711,14 @@ class CoursesIndex extends Component{
<Route
path="/courses/:coursesId/exercises/:Id/Studentshavecompletedthelist"
render={
(props) => (<Studentshavecompletedthelist {...this.props} {...props} {...this.state} />)
(props) => (<Studentshavecompletedthelist {...this.props} {...props} {...this.state} {...common}/>)
}
>
</Route>
{/* 试卷 */}
<Route path="/courses/:coursesId/exercises/:Id"
render={
(props) => (<ListPageIndex {...this.props} {...props} {...this.state} />)
(props) => (<ListPageIndex {...this.props} {...props} {...this.state} {...common}/>)
}
></Route>
@ -708,65 +726,65 @@ class CoursesIndex extends Component{
{/*实训查重详情*/}
<Route path="/courses/:coursesId/shixun_homeworks/:homeworkid/review_detail/:userid"
render={
(props) => (<ShixunWorkDetails {...this.props} {...props} {...this.state} />)
(props) => (<ShixunWorkDetails {...this.props} {...props} {...this.state} {...common}/>)
}
></Route>
<Route path="/courses/:coursesId/shixun_homework/:homeworkid/review_detail/:userid"
render={
(props) => (<ShixunWorkDetails {...this.props} {...props} {...this.state} />)
(props) => (<ShixunWorkDetails {...this.props} {...props} {...this.state} {...common}/>)
}
></Route>
{/*实训查重列表*/}
<Route path="/courses/:coursesId/shixun_homeworks/:homeworkid/student_work"
render={
(props) => (<ShixunHomeworkPage {...this.props} {...props} {...this.state} />)
(props) => (<ShixunHomeworkPage {...this.props} {...props} {...this.state} {...common}/>)
}
></Route>
<Route path="/courses/:coursesId/shixun_homework/:homeworkid/student_work"
render={
(props) => (<ShixunHomeworkPage {...this.props} {...props} {...this.state} />)
(props) => (<ShixunHomeworkPage {...this.props} {...props} {...this.state} {...common}/>)
}
></Route>
{/*实训报告*/}
<Route path="/courses/:coursesId/shixun_homeworks/:homeworkid/shixun_work_report"
render={
(props) => (<ShixunWorkReport {...this.props} {...props} {...this.state} />)
(props) => (<ShixunWorkReport {...this.props} {...props} {...this.state} {...common}/>)
}
></Route>
<Route path="/courses/:coursesId/shixun_homework/:homeworkid/shixun_work_report"
render={
(props) => (<ShixunWorkReport {...this.props} {...props} {...this.state} />)
(props) => (<ShixunWorkReport {...this.props} {...props} {...this.state} {...common}/>)
}
></Route>
{/*教师列表*/}
<Route path="/courses/:coursesId/shixun_homeworks/:homeworkid/list"
render={
(props) => (<ShixunHomeworkPage {...this.props} {...props} {...this.state} />)
(props) => (<ShixunHomeworkPage {...this.props} {...props} {...this.state} {...common}/>)
}
></Route>
<Route path="/courses/:coursesId/shixun_homework/:homeworkid/list"
render={
(props) => (<ShixunHomeworkPage {...this.props} {...props} {...this.state} />)
(props) => (<ShixunHomeworkPage {...this.props} {...props} {...this.state} {...common}/>)
}
></Route>
{/*实训作业page*/}
<Route path="/courses/:coursesId/shixun_homeworks/:homeworkid/Page"
render={
(props) => (<ShixunHomeworkPage {...this.props} {...props} {...this.state} />)
(props) => (<ShixunHomeworkPage {...this.props} {...props} {...this.state} {...common}/>)
}
></Route>
{/*实训作业设置*/}
<Route path="/courses/:coursesId/shixun_homeworks/:homeworkid/settings"
render={
(props) => (<ShixunHomeworkPage {...this.props} {...props} {...this.state} />)
(props) => (<ShixunHomeworkPage {...this.props} {...props} {...this.state} {...common}/>)
}
></Route>
<Route path="/courses/:coursesId/shixun_homework/:homeworkid/settings"
render={
(props) => (<ShixunHomeworkPage {...this.props} {...props} {...this.state} />)
(props) => (<ShixunHomeworkPage {...this.props} {...props} {...this.state} {...common}/>)
}
></Route>
{/*/!*实训作品列表教师*!/*/}
@ -805,21 +823,21 @@ class CoursesIndex extends Component{
{/*实训作业问答主目录*/}
<Route path="/courses/:coursesId/shixun_homeworks/:homeworkid/questions"
render={
(props) => (<ShixunHomeworkPage {...this.props} {...props} {...this.state} />)
(props) => (<ShixunHomeworkPage {...this.props} {...props} {...this.state} {...common}/>)
}
></Route>
{/*实训作业问答子目录*/}
<Route path="/courses/:coursesId/shixun_homework/:homeworkid/questions"
render={
(props) => (<ShixunHomeworkPage {...this.props} {...props} {...this.state} />)
(props) => (<ShixunHomeworkPage {...this.props} {...props} {...this.state} {...common}/>)
}
></Route>
{/*新建课堂*/}
<Route path="/courses/new"
render={
(props) => (<WrappedCoursesNewApp {...this.props} {...props} {...this.state} />)
(props) => (<WrappedCoursesNewApp {...this.props} {...props} {...this.state} {...common}/>)
}
></Route>
{/*新建精品课堂*/}
@ -827,47 +845,47 @@ class CoursesIndex extends Component{
{/*id 是否是私有或者公有*/}
<Route path="/courses/news/:subjectid/newgold/:id"
render={
(props) => (<WrappedCoursesNewAppGoldclass {...this.props} {...props} {...this.state} />)
(props) => (<WrappedCoursesNewAppGoldclass {...this.props} {...props} {...this.state} {...common}/>)
}
></Route>
{/*修改精品课堂*/}
<Route path="/courses/:coursesId/newgolds/settings"
render={
(props) => (<WrappedCoursesNewAppGoldclass {...this.props} {...props} {...this.state} />)
(props) => (<WrappedCoursesNewAppGoldclass {...this.props} {...props} {...this.state} {...common}/>)
}
></Route>
{/*修改课堂*/}
<Route path="/courses/:coursesId/settings"
render={
(props) => (<WrappedCoursesNewApp {...this.props} {...props} {...this.state} />)
(props) => (<WrappedCoursesNewApp {...this.props} {...props} {...this.state} {...common}/>)
}
></Route>
{/* 实训作业子页面*/}
<Route path="/courses/:coursesId/shixun_homework/:category_id"
render={
(props) => (<ListPageIndex {...this.props} {...props} {...this.state} />)
(props) => (<ListPageIndex {...this.props} {...props} {...this.state} {...common}/>)
}
></Route>
{/* 实训作业页面*/}
<Route path="/courses/:coursesId/shixun_homeworks/:main_id"
render={
(props) => (<ListPageIndex {...this.props} {...props} {...this.state} />)
(props) => (<ListPageIndex {...this.props} {...props} {...this.state} {...common}/>)
}
></Route>
{/*/!*实训作业and课堂详情页*!/*/}
<Route path="/courses/:coursesId"
render={
(props) => (<ListPageIndex {...this.props} {...props} {...this.state} />)
(props) => (<ListPageIndex {...this.props} {...props} {...this.state} {...common}/>)
}
></Route>
{/*课堂首页*/}
<Route path="/courses"
render={
(props) => (<CoursesHome {...this.props} {...props} {...this.state} />)
(props) => (<CoursesHome {...this.props} {...props} {...this.state} {...common}/>)
}
></Route>
{/*<Route exact path="/courses" component={CoursesHome} {...this.props} {...props} {...this.state} ></Route>*/}
@ -877,4 +895,4 @@ class CoursesIndex extends Component{
}
}
export default ImageLayerOfCommentHOC({imgSelector: '.imageLayerParent img, .imageLayerParent .imageTarget', parentSelector: '.newMain'}) (CNotificationHOC() ( SnackbarHOC() ( TPMIndexHOC(CoursesIndex) )));
export default withRouter(ImageLayerOfCommentHOC({imgSelector: '.imageLayerParent img, .imageLayerParent .imageTarget', parentSelector: '.newMain'}) (CNotificationHOC() ( SnackbarHOC() ( TPMIndexHOC(CoursesIndex) ))));

@ -129,20 +129,21 @@ class CommonWorkDetailIndex extends Component{
})
}
}else {
this.props.showNotification(`正在下载中`);
this.setState({ donwloading: true })
downloadFile({
url: url,
successCallback: (url) => {
this.setState({ donwloading: false })
console.log('successCallback')
},
failCallback: (responseHtml, url) => {
this.setState({ donwloading: false })
console.log('failCallback')
}
})
this.props.slowDownload(url)
// this.props.showNotification(`正在下载中`);
// this.setState({ donwloading: true })
// downloadFile({
// url: url,
// successCallback: (url) => {
// this.setState({ donwloading: false })
// console.log('successCallback')
// },
// failCallback: (responseHtml, url) => {
// this.setState({ donwloading: false })
// console.log('failCallback')
// }
// })
// window.open("/api"+url, '_blank');
}
}).catch((error) => {

@ -81,11 +81,7 @@ class CommonWorkQuestion extends Component{
let category_id=this.props.match.params.category_id;
let task_Id=this.props.match.params.task_Id;
const isGroup = this.props.isGroup()
/**
<React.Fragment>
<a className={"fr color-blue font-16"} href={exportResultUrl}>导出成绩</a>
</React.Fragment>
*/
return(
<React.Fragment>
@ -105,12 +101,12 @@ class CommonWorkQuestion extends Component{
{isGroup && <div className="df mt10">
<div style={{flex: '0 0 160px'}}>
<div>分组要求 {group_info.min_num} ~ {group_info.max_num}</div>
<div>分组要求 {group_info.min_num} ~ {group_info.max_num}</div>
<div>{group_info.base_on_project ? '基于项目实施' : '不基于项目'}</div>
</div>
<div style={{color: '#9B9B9B'}}>
<div>学生提交作品时需要关联同组成员组内成员作品共享</div>
<div>{group_info.base_on_project ? '学生必须在本平台创建项目,项目管理员可以提交作品' : '无需平台创建项目,任意小组成员均可以提交作品'}</div>
<div>{group_info.base_on_project ? '学生必须在本平台创建项目,项目管理员可以提交作品' : '无需平台创建项目,任意小组成员均可以提交作品'}</div>
{/* <div>各小组必须在educoder平台创建项目</div> */}
</div>
</div>}

@ -63,8 +63,9 @@ class TabRightComponents extends Component{
})
}
}else {
this.props.showNotification(`正在下载中`);
window.open("/api"+url, '_blank');
this.props.slowDownload(url)
// this.props.showNotification(`正在下载中`);
// window.open("/api"+url, '_blank');
}
}).catch((error) => {
console.log(error)

@ -112,8 +112,13 @@ class CommonWorkAppraiseReply extends Component{
cancelText: '取消',
onOk: () => {
let category_id= this.props.match.params.category_id;
const url = `/graduation_works/${category_id}/delete_score.json?comment_id=${item.id}`
axios.delete(url).then((result)=>{
const task_id = this.props.task_id
// 作业是使用 task_id
const url = `/student_works/${task_id}/destroy_score.json`
axios.delete(url, { data: {
score_id: item.id
}
}).then((result)=>{
if(result.data.status == 0){
this.props.showNotification('删除成功')
this.fetchAllComments()

@ -258,6 +258,7 @@ class CCommentItem extends Component{
const isAnonymous = homework_status && homework_status.indexOf('匿评中') != -1
const isAppealing = homework_status && homework_status.indexOf('申诉中') != -1
const attachments = item.attachments;
const isAdmin = this.props.isAdmin()
return(
<div className="ccomment comment_item_cont df clearfix" key={item.id}>
@ -302,23 +303,29 @@ class CCommentItem extends Component{
{item.score !== null && <span className="score_area fl">{item.score}</span>}
{/* !item.is_invalid && */}
{/* { item.delete && <Tooltip title={ "" } >
{/* item.is_invalid && */}
{/* { item.delete && isAdmin && <Tooltip title={ "" } >
<i className="iconfont icon-shanchu mr5 fr" style={{marginLeft: '6px'}}
onClick={() => this.props.onDelete(item)}>
</i>
</Tooltip>} */}
{/* fr */}
{/* <WordsBtn style="blue" className="fr">回复</WordsBtn> */}
{ item.is_invalid ? <span className="validate_area fr">失效</span> :
<React.Fragment>
<WordsBtn style="blue" className="fr" onClick={this.state.show_reply ? this.cancelReply : this.showReply}>回复</WordsBtn>
{(isAppealing || isAnonymous) && item.can_appeal && item.appeal_status == 0 && <WordsBtn style="blue" className="fr mr20" onClick={this.state.show_appeal ? this.cancelAppeal : this.showAppeal}>申诉</WordsBtn>}
{(isAppealing || isAnonymous) && item.can_appeal && item.appeal_status == 0 &&
<WordsBtn style="blue" className="fr mr20" onClick={this.state.show_appeal ? this.cancelAppeal : this.showAppeal}>申诉</WordsBtn>}
</React.Fragment>
}
{item.delete && isAdmin
&& <WordsBtn style="blue" className="fr mr12"
onClick={() => this.props.onDelete(item)}>删除</WordsBtn>}
</div>
</div>

@ -78,3 +78,4 @@ p span{
.sourceTag a.active{
color: #FFFFFF;background-color:#4CACFF;
}

@ -151,8 +151,8 @@ class GraduationTasksappraiseMainEditor extends Component{
}
this.setState({ score: val })
}
same_score_change = (val) => {
this.setState({ same_score: !this.state.same_score })
same_score_change = (e) => {
this.setState({ same_score: e.target.checked }) //!this.state.same_score
}
render(){
let { total_count, comments, pageCount, fileList, score, same_score, errorMessage, numberErrorMessage } = this.state
@ -209,7 +209,7 @@ class GraduationTasksappraiseMainEditor extends Component{
<TPMMDEditor ref={this.mdRef} mdID={'appraiseEditor'} placeholder={placeholder || "请在此输入对本作品的评语最大限制2000个字符"}
watch={false} height={160} className={errorMessage ? 'editorInputError' : ''}></TPMMDEditor>
{ showSameScore == true && <div>
<Checkbox value={same_score} onChange={this.same_score_change}>整组同评</Checkbox>
<Checkbox checked={same_score} onChange={this.same_score_change}>整组同评</Checkbox>
<span className={"font-14 color-grey-9"}>(选中则本次评阅对象指小组全部成员否则仅评阅此成员1人 )</span>
</div> }
<Upload {...commentUploadProp} className="upload_mainEditor upload_1 newuploads">

@ -600,7 +600,7 @@ class studentsList extends Component{
font-size: 14px;
}
.drop_down_menu {
width: 93px;
/*width: 93px;*/
}
.drop_down_menu li {
width:100%;

@ -77,6 +77,7 @@ class CoursesNew extends Component {
this.setState({
datatime: data.end_date,
dataname:data.name,
is_public: data.is_public === 1 ? true : false,
Realnamecertification: data.authentication,
Professionalcertification:data.professional_certification,
@ -326,7 +327,7 @@ class CoursesNew extends Component {
}
goback = () => {
goback = (id) => {
// if(this.props.match.params.coursesId===undefined){
// this.props.history.push("/courses");
@ -334,7 +335,12 @@ class CoursesNew extends Component {
// this.props.history.push(this.props.current_user.first_category_url);
// }
// window.history.go(-1)
this.props.history.goBack()
if(id===undefined){
this.props.history.goBack()
}else{
this.props.history.push(this.props.current_user.first_category_url);
}
}
onCheckAllChange = (e) => {
@ -494,7 +500,7 @@ class CoursesNew extends Component {
this.applyForAddOrgForm.setVisible(true)
}
render() {
let {datatime,school,searchlistscholl,bordebool} = this.state;
let {datatime,school,searchlistscholl,bordebool,dataname} = this.state;
const {getFieldDecorator} = this.props.form;
const propsWithoutForm = Object.assign({}, this.props)
delete propsWithoutForm.form
@ -504,7 +510,7 @@ class CoursesNew extends Component {
// form合并了
// console.log("获取到的数据");
// console.log(this.state);
// console.log(this.props);
//console.log(this.props.current_user.first_category_url);
// console.log(this.props.current_user);
var addonAfterone=this.props.form&&this.props.form.getFieldValue('period');
var addonAfteronelen=0;
@ -537,7 +543,7 @@ class CoursesNew extends Component {
.color-green-light {
color: #45E660!important;
}
.line15{line-height: 15px;}
`
}
</style>
@ -562,15 +568,19 @@ class CoursesNew extends Component {
{/*</Breadcrumb>*/}
<p className="clearfix mb20 mt10">
<a className="btn colorgrey fl hovercolorblue " href="/courses">翻转课堂</a>
<a className="btn colorgrey fl hovercolorblue "
href={this.props.match.params.coursesId === undefined ?"/courses":this.props.current_user&&this.props.current_user.first_category_url}
>
{this.props.match.params.coursesId === undefined ?"翻转课堂":dataname}
</a>
<span className="color-grey-9 fl ml3 mr3">&gt;</span>
<WordsBtn className="fl">{this.props.match.params.coursesId === undefined ?"新建课堂":"编辑课堂"}</WordsBtn>
<WordsBtn className="fl cdefault">{this.props.match.params.coursesId === undefined ?"新建课堂":"编辑课堂"}</WordsBtn>
</p>
<div style={{width: '100%', height: '70px'}}>
<p className=" fl color-black mt18 summaryname">{this.props.match.params.coursesId === undefined ? "新建课堂" : "编辑课堂"}</p>
<a onClick={this.goback} className="color-grey-6 fr font-16 ml30 mt18 mr20">返回</a>
<div style={{width: '100%', height: '50px'}}>
<p className=" fl color-black summaryname">{this.props.match.params.coursesId === undefined ? "新建课堂" : "编辑课堂"}</p>
<a onClick={()=>this.goback(this.props.match.params.coursesId)} className="color-grey-6 fr font-16 ml30 line15 mr20">返回</a>
</div>
<style>
{`

@ -628,7 +628,7 @@ class Goldsubject extends Component {
this.applyForAddOrgForm.setVisible(true)
}
render() {
let {datatime,datatimetwo,school,bordebool,searchlistscholl,Whethertocreateanewclassroom,addonAfteronelenone,addonAfteronelentwo} = this.state;
let {datatime,datatimetwo,school,bordebool,searchlistscholl,Whethertocreateanewclassroom,addonAfteronelenone,addonAfteronelentwo,name} = this.state;
const {getFieldDecorator} = this.props.form;
const propsWithoutForm = Object.assign({}, this.props)
delete propsWithoutForm.form
@ -664,11 +664,11 @@ class Goldsubject extends Component {
{
`
.color-green-light {
color: #45E660!important;
}
`
.color-green-light {
color: #45E660!important;
}
.line15{line-height: 15px;}
`
}
</style>
<ApplyForAddOrgModal ref="applyForAddOrgModal" wrappedComponentRef={(form) => this.applyForAddOrgForm = form} schoolName={school}
@ -693,47 +693,50 @@ class Goldsubject extends Component {
{/* <Breadcrumb.Item>{Whethertocreateanewclassroom===true?"新建课堂":"编辑课堂"}</Breadcrumb.Item>*/}
{/*</Breadcrumb>*/}
<p className="clearfix mb20 mt10">
<a className="btn colorgrey fl hovercolorblue " href="/courses">翻转课堂</a>
<a className="btn colorgrey fl hovercolorblue " href={Whethertocreateanewclassroom===true?"/courses":this.props.current_user&&this.props.current_user.first_category_url}
>{Whethertocreateanewclassroom===true?"翻转课堂":name}</a>
<span className="color-grey-9 fl ml3 mr3">&gt;</span>
<WordsBtn className="fl">{Whethertocreateanewclassroom===true?"新建课堂":"编辑课堂"}</WordsBtn>
<WordsBtn className="fl cdefault">{Whethertocreateanewclassroom===true?"新建课堂":"编辑课堂"}</WordsBtn>
</p>
<div style={{width: '100%', height: '70px'}}>
<p className=" fl color-black mt18 summaryname">{Whethertocreateanewclassroom===true ? "新建课堂" : "编辑课堂"}</p>
<a onClick={this.goback} className="color-grey-6 fr font-16 ml30 mt18 mr20"></a>
<div style={{width: '100%', height: '50px'}}>
<p className=" fl color-black summaryname">{Whethertocreateanewclassroom===true ? "新建课堂" : "编辑课堂"}</p>
<a onClick={this.goback} className="color-grey-6 fr font-16 ml30 line15 mr20"></a>
</div>
<style>
{`
.ant-col-12{
width:800px;
}
`}
.ant-col-12{
width:800px;
}
`}
</style>
<Form onSubmit={this.handleSubmit} className={"edu-back-white newcourses"}>
{/*内容*/}
<style>
{`
.ant-select-dropdown{
// top: 221px !important;
// left: 115px !important;
height: 160px;
}
.ant-select-dropdown-menu{
height: 160px;
}
.construction .ant-input{
margin-left: 0px !important;
}
.construction {
margin-left: 11px;
}
.construction .ant-select-selection__placeholder, .ant-select-search__field__placeholder {
line-height: 28px;
z-index: 2000;
}
`}
.ant-select-dropdown{
// top: 221px !important;
// left: 115px !important;
height: 160px;
}
.ant-select-dropdown-menu{
height: 160px;
}
.construction .ant-input{
margin-left: 0px !important;
}
.construction {
margin-left: 11px;
}
.construction .ant-select-selection__placeholder, .ant-select-search__field__placeholder {
line-height: 28px;
z-index: 2000;
}
.line15{line-height: 15px;}
`}
</style>
{/*<div className="stud-class-set bor-bottom-greyE padding10200 ">*/}
@ -772,30 +775,30 @@ class Goldsubject extends Component {
<style>
{
`
.ml19{
margin-left:19px;
} }
`
.ml19{
margin-left:19px;
}
`
}
</style>
<div className="stud-class-set bor-bottom-greyE padding1020 ">
<style>{
`
.yslzxueshis .ant-input{
border-right: none !important;
height: 40px !important;
width: 655px !important;
}
.yslzxueshisy span .ant-input-group-addon{
width: 65px !important;
background-color: #fafafa!important;
}
.yslzxueshisy .ant-input-group-addon{
width: 65px !important;
background-color: #fafafa!important;
}
`
.yslzxueshis .ant-input{
border-right: none !important;
height: 40px !important;
width: 655px !important;
}
.yslzxueshisy span .ant-input-group-addon{
width: 65px !important;
background-color: #fafafa!important;
}
.yslzxueshisy .ant-input-group-addon{
width: 65px !important;
background-color: #fafafa!important;
}
`
}</style>
<style>
{bordebool===false?
@ -845,27 +848,27 @@ class Goldsubject extends Component {
<div className="stud-class-set bor-bottom-greyE padding1020 coursenavbox coursenavboxtow yslinputcourput">
<style>
{`
.ant-form-item{
margin-bottom: 10px !important;
}
`}
.ant-form-item{
margin-bottom: 10px !important;
}
`}
</style>
<style>{
`
.yslzxueshi .ant-input{
border-right: none !important;
height: 40px !important;
width: 236px !important
}
.yslzxueshi .ant-input-group {
width: 280px !important;
}
.yslzxueshi .ant-input-group-addon{
width: 44px !important;
background-color: #fafafa!important;
}
`
.yslzxueshi .ant-input{
border-right: none !important;
height: 40px !important;
width: 236px !important
}
.yslzxueshi .ant-input-group {
width: 280px !important;
}
.yslzxueshi .ant-input-group-addon{
width: 44px !important;
background-color: #fafafa!important;
}
`
}</style>
<Form.Item
label="总学时"
@ -911,19 +914,19 @@ class Goldsubject extends Component {
rules: [{type: 'object',required: true, message: "开始时间不能为空"}],
})(
<span className="fl mt5">
<DatePicker
showToday={false}
placeholder="请选择开始时间"
// showTime={{format: 'HH:mm'}}
locale={locale}
format={dateFormat}
width={"210px"}
value={datatimetwo === undefined ? "" :datatimetwo === null ? "" : moment(datatimetwo, dateFormat)}
disabledTime={disabledDateTime}
dropdownClassName="hideDisable"
onChange={this.onChangeTimepublishstwo}
/>
</span>
<DatePicker
showToday={false}
placeholder="请选择开始时间"
// showTime={{format: 'HH:mm'}}
locale={locale}
format={dateFormat}
width={"210px"}
value={datatimetwo === undefined ? "" :datatimetwo === null ? "" : moment(datatimetwo, dateFormat)}
disabledTime={disabledDateTime}
dropdownClassName="hideDisable"
onChange={this.onChangeTimepublishstwo}
/>
</span>
)}
</Form.Item>
<Form.Item
@ -934,19 +937,19 @@ class Goldsubject extends Component {
required: true, message: "结束时间不能为空"}],
})(
<span className="fl mt5">
<DatePicker
showToday={false}
placeholder="请选择结束时间"
// showTime={{format: 'HH:mm'}}
locale={locale}
format={dateFormat}
width={"210px"}
value={datatime === undefined ? "" :datatime === null ? "" : moment(datatime, dateFormat)}
disabledTime={disabledDateTime}
dropdownClassName="hideDisable"
onChange={this.onChangeTimepublishs}
/>
</span>
<DatePicker
showToday={false}
placeholder="请选择结束时间"
// showTime={{format: 'HH:mm'}}
locale={locale}
format={dateFormat}
width={"210px"}
value={datatime === undefined ? "" :datatime === null ? "" : moment(datatime, dateFormat)}
disabledTime={disabledDateTime}
dropdownClassName="hideDisable"
onChange={this.onChangeTimepublishs}
/>
</span>
)}
</Form.Item>
</div>

@ -0,0 +1,109 @@
.color4CACFF{
color: #4CACFF !important;
}
.orderingbox{
width:1200px;
height:80px;
background:rgba(255,255,255,1);
box-shadow:3px 3px 3px rgba(237,237,237,1);
opacity:1;
border-radius:2px 2px 0px 0px;
padding: 24px;
box-sizing: border-box;
line-height: 34px;
}
.orderingbtnright{
width: 90px;
height: 38px;
background: rgba(255,255,255,1);
border: 1px solid rgba(228,228,228,1);
box-shadow: 0px 1px 1px rgba(0,0,0,0.16);
opacity: 1;
border-radius: 4px;
}
.orderingbtnleft{
width: 90px;
height: 38px;
background: rgba(76,172,255,1);
box-shadow: 0px 1px 1px rgba(0,0,0,0.16);
opacity: 1;
border-radius: 4px;
}
.pd1323s{
padding: 10px 6px 25px 40px;
cursor: pointer;
}
.orderSection{
height: 80px;
padding-top: 16px;
}
.ordermidbox{
width: 960px;
height: 120px;
background: rgba(255,255,255,1);
/* border: 1px solid rgba(205,205,205,1); */
opacity: 1;
margin-left:142px;
}
.orderfonttop{
font-size: 16px !important;
font-family: Microsoft YaHei;
font-weight: bold;
line-height: 28px;
color: rgba(5,16,26,1);
opacity: 1;
}
.orderfontbom{
font-size:14px;
font-family:Microsoft YaHei;
font-weight:400;
line-height:25px;
color:rgba(153,153,153,1);
opacity:1;
}
.ordermidbox:hover {
box-shadow: 0px 2px 6px rgba(51,51,51,0.09);
opacity: 1;
}
.mb200{
margin-bottom: 200px;
}
.maxwidth865s{
max-width: 865px;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
.maxwidth795 {
max-width:795px;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
display: inline-block;
}
.ordermidbox:active{
background:rgba(248,247,255,1);
border:1px solid rgba(76,172,255,1);
}
.ordermidbox:focus{
background:rgba(248,247,255,1);
border:1px solid rgba(76,172,255,1);
}
.ordermiddiv{
min-height: 500px;
}

@ -0,0 +1,296 @@
import React,{ Component } from "react";
import { Input,Checkbox,Table, Pagination, Modal,Menu, Tooltip,Spin,Breadcrumb,Button } from "antd";
import { WordsBtn,on, off, trigger } from 'educoder';
import { DragDropContext,Draggable, Droppable} from 'react-beautiful-dnd';
import axios from'axios';
import Modals from '../../modals/Modals';
import '../css/members.css';
import '../css/busyWork.css';
import './Ordering.css';
import NoneData from "../coursesPublic/NoneData";
const reorder = (list, startIndex, endIndex) => {
const result = Array.from(list);
const [removed] = result.splice(startIndex, 1);
result.splice(endIndex, 0, removed);
return result;
};
class Ordering extends Component{
constructor(props){
super(props);
this.state={
isSpin:false,
antIcon:false,
datas:undefined,
windowsscrollTop:false,
newtask_ids:[]
}
}
componentDidMount() {
this.setState({
isSpin:true
})
let coursesId=this.props.match.params.coursesId;
let ordering_type=this.props.match.params.ordering_type;
let url=`/courses/${coursesId}/tasks_list.json`;
axios.get((url),{params:{
container_type:ordering_type
}}).then((result)=>{
if(result){
this.setState({
datas:result.data.tasks,
isSpin:false
})
}
}).catch((error)=>{
console.log(error);
this.setState({
isSpin:false
})
})
window.addEventListener('scroll', this.handleScroll.bind(this)) //监听滚动
// window.addEventListener('resize', this.handleResize.bind(this)) //监听窗口大小改变
}
// componentWillUnmount() { //一定要最后移除监听器以防多个组件之间导致this的指向紊乱
// window.removeEventListener('scroll', this.handleScroll.bind(this))
// window.removeEventListener('resize', this.handleResize.bind(this))
// }
handleScroll=(e)=>{
// console.log(
// '浏览器滚动事件',
// e.srcElement.scrollingElement.scrollTop,
// e.srcElement.scrollingElement.scrollHeight
// )
//e.srcElement.scrollingElement.scrollTop为距离滚动条顶部高度
// e.srcElement.scrollingElement.scrollHeight为整个文档高度
if(e.srcElement.scrollingElement.scrollTop>60){
this.setState({
windowsscrollTop:true,
})
}
if(e.srcElement.scrollingElement.scrollTop===0){
this.setState({
windowsscrollTop:false
})
}
}
//
// handleResize = e => {
// console.log('浏览器窗口大小改变事件', e.target.innerWidth)
// }
onDragEnd=(result)=>{
if(result.destination!=null&&result.destination!=undefined){
let {datas}=this.state;
if (!result.destination) {
console.log('dropped outside the list')
return;
}
if (result.destination.index === result.source.index) {
console.log('the same')
return;
}
const shixuns_list = reorder(
datas,
result.source.index,
result.destination.index
);
let newtask_ids=[]
shixuns_list.map((item,key)=>{
newtask_ids.push(item.task_id)
})
this.setState({
datas:shixuns_list,
newtask_ids:newtask_ids
})
}
}
updatalist=()=>{
let {datas,newtask_ids,isSpin}=this.state;
if(newtask_ids.length===0){
this.props.showNotification("请先移动需要排序的实训作业任务");
return
}
if(isSpin===true){
return
}
this.setState({
isSpin:true
})
let coursesId=this.props.match.params.coursesId;
let ordering_type=this.props.match.params.ordering_type;
let url=`/courses/${coursesId}/update_task_position.json`;
axios.post(url,{
container_type:ordering_type,
task_ids:newtask_ids
}).then((result)=>{
if(result.data.status===0){
this.props.showNotification(result.data.message);
this.setState({
isSpin:false,
datas:datas,
newtask_ids:[]
});
}else{
this.setState({
isSpin:false,
});
}
}).catch((error)=>{
this.setState({
isSpin:false,
});
})
}
goback=()=>{
window.location.href=`/courses/${this.props.match.params.coursesId}/shixun_homeworks/${this.props.match.params.main_id}`
}
render(){
let {
datas,
Modalstype,
windowsscrollTop,
}=this.state;
let main_id=this.props.match.params.main_id;
let category_id=this.props.match.params.category_id;
console.log(this.props)
console.log(window)
let positiontype=null;
if(windowsscrollTop===true){
positiontype={position:'fixed',zIndex:'9000',left:'20%',top: '0px'}
}else{
positiontype={}
}
return(
<div className={"mb200"}>
{/*提示*/}
{Modalstype&&Modalstype===true?<Modals
modalsType={this.state.Modalstype}
modalsTopval={this.state.Modalstopval}
modalCancel={this.state.ModalCancel}
modalSave={this.state.ModalSave}
modalsBottomval={this.state.ModalsBottomval}
loadtype={this.state.Loadtype}
antIcon={this.state.antIcon}
/>:""}
<div className="educontent clearfix">
{windowsscrollTop===false?<div className={"mt20 mb20"}>
<Breadcrumb separator=">">
<Breadcrumb.Item href={this.props.current_user&&this.props.current_user.first_category_url}>{this.props.current_user&&this.props.current_user.course_name}</Breadcrumb.Item>
<Breadcrumb.Item href={`/courses/${this.props.match.params.coursesId}/shixun_homeworks/${this.props.match.params.main_id}`}>实训作业</Breadcrumb.Item>
<Breadcrumb.Item>调整排序</Breadcrumb.Item>
</Breadcrumb>
</div>:""}
<p className="clearfix bor-bottom-greyE edu-back-white orderingbox"
style={positiontype}
>
<span>温馨提示请在列表中长按鼠标左键进行拖放排序完成排序后请点击保存</span>
<Button className="fr orderingbtnleft" type="primary" onClick={()=>this.updatalist()}>保存</Button>
<Button className="fr mr30 orderingbtnright" onClick={()=>this.goback()}>取消</Button>
</p>
</div>
<Spin size="large" spinning={this.state.isSpin} >
<DragDropContext onDragEnd={this.onDragEnd} >
<Droppable droppableId={this.props.match.params.ordering_type}>
{(provided, snapshot) => (
<div
ref={provided.innerRef}
{...provided.droppableProps}
className={"educontent mb50 mt40 droppableul ordermiddiv"}
onScroll={this.contentViewScrolledit}
>
{datas===undefined?"":
datas.map((item, index) => {
return (
<Draggable
key={item.task_id}
draggableId={item.task_id}
index={index}
className={"TabsWarps"}
>
{(provided, snapshot) => (
<div className={"mt30 edu-back-white pd1323s relativef ordermidbox"}
key={index}
ref={provided.innerRef}
{...provided.draggableProps}
{...provided.dragHandleProps}
>
<div className={"clearfix"}>
<div className={"item-body"}>
<div className={"clearfix ds pr orderSection"}>
<p title={item.task_name} className="font-16 color-dark maxwidth865s orderfonttop"
href={`/courses/${this.props.match.params.coursesId}/shixun_homeworks/${item.task_id}/list?tab=0`}>{item.task_name}</p>
<p className={"color-grey panel-lightgrey mt16 "}>
<span className="topicswidth400">
<span className="topsics100 color-grey9 orderfontbom mr20 maxwidth795">{item.user_name}</span>
<span className="mr50 color-grey9 orderfontbom maxwidth795">{item.category}</span>
</span>
</p>
</div>
</div>
</div>
</div>
)}
</Draggable>
)
})
}
</div>
)}
</Droppable>
</DragDropContext>
{
datas===undefined?"":datas.length===0? <NoneData></NoneData>:""
}
</Spin>
</div>
)
}
}
export default Ordering;

@ -92,8 +92,8 @@ class PollListItem extends Component{
{
IsAdmin &&
<ul className="fr">
<WordsBtn style="blue" className="mr20 font-16" to={`/courses/${coursesId}/polls/${item.id}/detail?tab=3`}>设置</WordsBtn>
<WordsBtn style="blue" className="font-16" to={`/courses/${coursesId}/polls/${item.id}/${"edit"}`}>编辑</WordsBtn>
<WordsBtn style="blue" className="ml20 font-16" to={`/courses/${coursesId}/polls/${item.id}/detail?tab=3`}>设置</WordsBtn>
</ul>
}
</p>

@ -1834,8 +1834,8 @@ class PollNew extends Component {
question_title: object.question.question_title,
question_type: number,
is_necessary: object.question.is_necessary,
max_choices: max_choicess===undefined?length:max_choicess===null?length:max_choicess===0?length:max_choicess,
min_choices: min_choicess===undefined?2:min_choicess===null?2:min_choicess===0?2:min_choicess,
max_choices: max_choicess===undefined||max_choicess===null||max_choicess===0||max_choicess==="0"?null:max_choicess,
min_choices: min_choicess===undefined||min_choicess===null||min_choicess===0||min_choicess==="0"?null:min_choicess,
question_answers: option,
question_other_answer: null,
insert_id: insert_id
@ -1911,8 +1911,8 @@ class PollNew extends Component {
question_title: object.question.question_title,
question_type: number,
is_necessary: object.question.is_necessary,
max_choices: max_choicess===undefined?length:max_choicess===null?length:max_choicess===0?length:max_choicess,
min_choices: min_choicess===undefined?2:min_choicess===null?2:min_choicess===0?2:min_choicess,
max_choices: max_choicess===undefined||max_choicess===null||max_choicess===0||max_choicess==="0"?null:max_choicess,
min_choices: min_choicess===undefined||min_choicess===null||min_choicess===0||min_choicess==="0"?null:min_choicess,
question_answers: option,
question_other_answer: null,
};
@ -2774,8 +2774,13 @@ class PollNew extends Component {
className="color-grey-9 fl">{item.question.question_type === 1 ? "(单选题)" : item.question.question_type === 2 ? "(多选题)" : "(主观题)"}</span>
<span
className="selectAnswer ml10">{item.question.is_necessary === 1 ? "必答" : item.question.question_type === 2 ? "选答" : "选答"}</span>
<span style={{color: "#4B4B4B"}}
className="font-16 mt10 ml10">{(item.question.min_choices === undefined && item.question.max_choices === undefined ? "" : item.question.min_choices === null && item.question.max_choices === null ? "" : item.question.min_choices === 0 && item.question.max_choices === 0 ? "" : "可选" + item.question.min_choices + "-" + item.question.max_choices + "项")}</span>
{
item.question.question_type === 2?
<span style={{color: "#4B4B4B"}}
className="font-16 mt10 ml10">{(item.question.min_choices === undefined && item.question.max_choices === undefined ? "不限制" : item.question.min_choices === null && item.question.max_choices === null ? "不限制" : item.question.min_choices === 0 && item.question.max_choices === 0 ? "": item.question.min_choices === "null" && item.question.max_choices === "null" ? "不限制" : "可选" +(item.question.min_choices===undefined||item.question.min_choices===null||item.question.min_choices===""||item.question.min_choices==="null"?2:item.question.min_choices) + "-" + (item.question.max_choices===undefined||item.question.max_choices===null||item.question.max_choices===""||item.question.max_choices==="null"?item.question.answers.length:item.question.max_choices) + "项")}</span>
: ""
}
{
polls_status === undefined || polls_status === 1 ?
<span className="fr">
@ -2963,7 +2968,7 @@ class PollNew extends Component {
<span
className="color-grey-6 mr20 font-16 lineh-40 fl">可选</span>
<div className="mr40 flex1 ">
{/*可选最小*/}
{/*可选最小1*/}
<style>
{
`
@ -2981,8 +2986,7 @@ class PollNew extends Component {
</style>
<Select className="fl w100"
onChange={(value) => this.HandleGradationGroupChangee(value, indexo, itemo.question.max_choices, itemo.question.answers.length)}
value={itemo.question.min_choices === 0 || itemo.question.min_choices === "0" ? "--" : itemo.question.min_choices === null ? "--" : itemo.question.min_choices === undefined ? "--" : itemo.question.min_choices}
value={itemo.question.min_choices === null || itemo.question.min_choices === undefined ||itemo.question.min_choices === "null"|| itemo.question.min_choices === 0 || itemo.question.min_choices === "0"?"0": itemo.question.min_choices}
>
<Option value={"0"}>--</Option>
{itemo.question.answers === undefined ? "" : itemo.question.answers.map((itemt, indext) => {
@ -2993,10 +2997,10 @@ class PollNew extends Component {
</Select>
<span
className="ml10 mr10 color-grey-6 lineh-40 fl">~</span>
{/*可选最大*/}
{/*可选最大2*/}
<Select className="fl w100"
onChange={(value) => this.HandleGradationGroupChangeee(value, indexo,itemo.question.min_choices,itemo.question.answers.length)}
value={itemo.question.max_choices === 0 || itemo.question.max_choices === "0" ? "--" : itemo.question.min_choices === null ? "--" : itemo.question.min_choices === undefined ? "--" : itemo.question.max_choices}
value={itemo.question.max_choices === null || itemo.question.max_choices === undefined ||itemo.question.max_choices === "null"|| itemo.question.max_choices === 0 || itemo.question.max_choices === "0"?"0": itemo.question.max_choices}
>
<Option value={"0"}>--</Option>
{itemo.question.answers === undefined ? "" : itemo.question.answers.map((itemt, indext) => {
@ -3224,8 +3228,7 @@ class PollNew extends Component {
</style>
<Select className="fl w100"
onChange={(value) => this.HandleGradationGroupChangee(value, indexo, itemo.question.max_choices, itemo.question.answers.length)}
value={itemo.question.min_choices === 0 || itemo.question.min_choices === "0" ? "--" : itemo.question.min_choices === null ? "--" : itemo.question.min_choices === undefined ? "--" : itemo.question.min_choices}
value={itemo.question.min_choices === null || itemo.question.min_choices === undefined ||itemo.question.min_choices === "null"|| itemo.question.min_choices === 0 || itemo.question.min_choices === "0"?"0": itemo.question.min_choices}
>
<Option value={String("0")}>--</Option>
{itemo.question.answers === undefined ? "" : itemo.question.answers.map((itemt, indext) => {
@ -3239,7 +3242,7 @@ class PollNew extends Component {
{/*可选最大*/}
<Select className="fl w100"
onChange={(value) => this.HandleGradationGroupChangeee(value, indexo,itemo.question.min_choices,itemo.question.answers.length)}
value={itemo.question.max_choices === 0 || itemo.question.max_choices === "0" ? "--" : itemo.question.min_choices === null ? "--" : itemo.question.min_choices === undefined ? "--" : itemo.question.max_choices}
value={itemo.question.max_choices === null || itemo.question.max_choices === undefined ||itemo.question.max_choices === "null"|| itemo.question.max_choices === 0 || itemo.question.max_choices === "0"?"0": itemo.question.max_choices}
>
<Option value={String("0")}>--</Option>
{itemo.question.answers === undefined ? "" : itemo.question.answers.map((itemt, indext) => {
@ -3476,8 +3479,7 @@ class PollNew extends Component {
</style>
<Select className="fl w100"
onChange={(value) => this.HandleGradationGroupChangee(value, indexo, itemo.question.max_choices, itemo.question.answers.length)}
value={itemo.question.min_choices === 0 || itemo.question.min_choices === "0" ? "--" : itemo.question.min_choices === null ? "--" : itemo.question.min_choices === undefined ? "--" : itemo.question.min_choices}
value={itemo.question.min_choices === null || itemo.question.min_choices === undefined ||itemo.question.min_choices === "null"|| itemo.question.min_choices === 0 || itemo.question.min_choices === "0"?"0": itemo.question.min_choices}
>
<Option value={String("0")}>--</Option>
{itemo.question.answers === undefined ? "" : itemo.question.answers.map((itemt, indext) => {
@ -3491,7 +3493,7 @@ class PollNew extends Component {
{/*可选最大*/}
<Select className="fl w100"
onChange={(value) => this.HandleGradationGroupChangeee(value, indexo,itemo.question.min_choices,itemo.question.answers.length)}
value={itemo.question.max_choices === 0 || itemo.question.max_choices === "0" ? "--" : itemo.question.min_choices === null ? "--" : itemo.question.min_choices === undefined ? "--" : itemo.question.max_choices}
value={itemo.question.max_choices === null || itemo.question.max_choices === undefined ||itemo.question.max_choices === "null"|| itemo.question.max_choices === 0 || itemo.question.max_choices === "0"?"0": itemo.question.max_choices}
>
<Option value={String("0")}>--</Option>
{itemo.question.answers === undefined ? "" : itemo.question.answers.map((itemt, indext) => {

@ -1,7 +1,7 @@
import React,{ Component } from "react";
import { Input,Checkbox,Table, Pagination, Modal,Menu, Tooltip,Spin } from "antd";
import { WordsBtn,on, off, trigger } from 'educoder';
import CourseLayoutcomponent from '../common/CourseLayoutComponent';
import {BrowserRouter as Router,Route,Switch,Link} from 'react-router-dom';
import axios from'axios';
import HomeworkModal from "../coursesPublic/HomeworkModal";
import ShixunModal from "../coursesPublic/ShixunModal";
@ -936,6 +936,7 @@ class ShixunHomework extends Component{
let main_id=this.props.match.params.main_id;
let category_id=this.props.match.params.category_id;
return(
<React.Fragment >
<div>
@ -1036,6 +1037,13 @@ class ShixunHomework extends Component{
{/*<span className="font-18 fl color-dark-21">{datas&&datas.category_name===undefined||datas&&datas.category_name===null?datas&&datas.main_category_name:datas&&datas.category_name+" 作业列表"}</span>*/}
<span className="font-18 fl color-dark-21">实训作业</span>
<li className="fr">
{this.props.isAdmin()===true?datas&&datas.category_name===undefined||datas&&datas.category_name===null?
<span>
<WordsBtn style="blue" className={"mr30 font-16"}>
<Link className="color4CACFF" to={`/courses/${this.props.match.params.coursesId}/ordering/shixun_homework/${main_id&&main_id}`}>调整排序</Link>
</WordsBtn>
</span>:"":""}
{this.props.isAdmin()===true?datas&&datas.category_name===undefined||datas&&datas.category_name===null?
<span>
<WordsBtn style="blue" onClick={()=>this.addDir()} className={"mr30 font-16"}>添加目录</WordsBtn>

@ -584,7 +584,7 @@ class MessagSub extends Component{
`
}
</style>
<p className="color-grey-6 break_word_firefox yslspansk markdown-body mt10" style={{wordBreak: "break-word"}} dangerouslySetInnerHTML={{__html: markdownToHTML(item.content).replace(/▁/g, "▁▁▁")}} ></p>
<p className="color-grey-6 yslspansk markdown-body mt10" style={{wordBreak: "break-word"}} dangerouslySetInnerHTML={{__html: markdownToHTML(item.content).replace(/▁/g, "▁▁▁")}} ></p>
</div>
<span className={item.new_tiding===true?"new-point fr mr40 mt22":""}></span>

@ -471,6 +471,9 @@ export function TPMIndexHOC(WrappedComponent) {
.indexHOC > .ant-spin-nested-loading {
background: #000;
}
.indexHOC > .ant-spin-nested-loading > div > .ant-spin .ant-spin-dot {
top: 50% !important;
}
.globalSpin .ant-spin-text {
text-shadow: none !important;

Loading…
Cancel
Save