Merge branches 'dev_aliyun' and 'issues25489' of https://bdgit.educoder.net/Hjqreturn/educoder into issues25489

issues25489
杨树林 5 years ago
commit 7ff5f2f44f

@ -78,12 +78,17 @@ class AccountsController < ApplicationController
return normal_status(-2, "违反平台使用规范,账号已被锁定") if @user.locked?
login_control = LimitForbidControl::UserLogin.new(@user)
return normal_status(-2, "登录密码出错已达上限,账号已被锁定, 请#{login_control.forbid_expires/60}分钟后重新登录或找回登录密码,") if login_control.forbid?
return normal_status(-2, "登录密码出错已达上限,账号已被锁定, 请#{login_control.forbid_expires/60}分钟后重新登录或找回密码") if login_control.forbid?
password_ok = @user.check_password?(params[:password].to_s)
unless password_ok
if login_control.remain_times-1 == 0
normal_status(-2, "登录密码出错已达上限,账号已被锁定, 请#{login_control.forbid_expires/60}分钟后重新登录或找回密码")
else
normal_status(-2, "你已经输错密码#{login_control.error_times+1}次,还剩余#{login_control.remain_times-1}次机会")
end
login_control.increment!
return normal_status(-2, "你已经输错密码#{login_control.error_times}次,还剩余#{login_control.remain_times}次机会")
return
end
successful_authentication(@user)

@ -191,6 +191,7 @@ class AttachmentsController < ApplicationController
candown = current_user.member_of_course?(course)
end
tip_exception(403, "您没有权限进入") if course.present? && !candown
tip_exception(403, "您没有权限进入") if @file.container.is_a?(ApplyUserAuthentication)
end
end
end

@ -46,7 +46,7 @@ class Competitions::CompetitionsController < Competitions::BaseController
@competition_modules = @competition.unhidden_competition_modules
# 未登录、未获奖用户,不展示获奖证书栏目
if !current_user.logged? || !current_competition.finished? || !current_competition.competition_prize_users.exists?(user: current_user)
if !current_user.logged? || !current_competition.finished? || (!current_competition.competition_prize_users.exists?(user: current_user) && !current_user.admin_or_business?)
@competition_modules = @competition_modules.select { |mod| mod.name != '获奖证书' }
end

@ -18,7 +18,7 @@ class CoursesController < ApplicationController
:left_banner, :top_banner, :apply_to_join_course, :exit_course, :course_groups]
before_action :set_course, only: [:show, :update, :destroy, :settings, :set_invite_code_halt,
:set_public_or_private, :search_teacher_candidate, :teachers, :apply_teachers,
:top_banner, :left_banner, :add_teacher_popup, :add_teacher,
:top_banner, :left_banner, :add_teacher_popup, :add_teacher, :inform_up, :inform_down,
:graduation_group_list, :create_graduation_group, :join_graduation_group,
:course_group_list, :set_course_group, :change_course_admin, :change_course_teacher,
:delete_course_teacher, :teacher_application_review, :students, :all_course_groups,
@ -41,7 +41,7 @@ class CoursesController < ApplicationController
:set_course_group, :create_group_by_importing_file,
:update_task_position, :tasks_list]
before_action :teacher_or_admin_allowed, only: [:graduation_group_list, :create_graduation_group, :join_graduation_group,
:change_course_teacher, :course_group_list, :change_member_role,
:change_course_teacher, :course_group_list, :change_member_role,:inform_up, :inform_down,
:teacher_application_review, :apply_teachers, :delete_course_teacher]
before_action :validate_course_name, only: [:create, :update]
before_action :find_board, only: :board_list
@ -281,13 +281,43 @@ class CoursesController < ApplicationController
end
def informs
@informs = @course.informs
@informs = @course.informs.order("position desc")
end
def inform_up
inform = @course.informs.find_by(id: params[:inform_id])
next_inform = inform.next_inform
ActiveRecord::Base.transaction do
if next_inform
render_error('已经到达最顶部')
else
inform.update_attribute(:position, (position + 1))
next_inform.update_attribute(:position, last_inform.position - 1)
render_ok
end
end
end
def inform_down
inform = @course.informs.find_by(id: params[:inform_id])
last_inform = inform.last_inform
ActiveRecord::Base.transaction do
if last_inform
render_error('已经到达最底部')
else
inform.update_attribute(:position, (position - 1))
last_inform.update_attribute(:position, last_inform.position + 1)
render_ok
end
end
end
def new_informs
inform = Inform.new(container: @course)
inform.name = params[:name]
inform.description = params[:description]
inform.position = @course.informs.maximum(:position) + 1
inform.save!
normal_status("创建成功")
end
@ -300,6 +330,7 @@ class CoursesController < ApplicationController
def delete_informs
inform = @course.informs.find_by(id: params[:inform_id])
@course.informs.where("position > ?", inform.position).update_all("position = position - 1")
inform.destroy!
normal_status("删除成功")
end

@ -16,6 +16,7 @@ class TrustieHacksController < ApplicationController
end
@hackathon_users_count = hacks ? 0 : hacks.sum(:hack_users_count)
@hacks_count = hacks.count
@hacks = hacks.page(page).per(limit)

@ -17,6 +17,6 @@ class Users::AuthenticationAppliesController < Users::BaseAccountController
private
def create_params
params.permit(:name, :gender, :id_number, :upload_image)
params.permit(:name, :gender, :id_number, :upload_image, attachment_ids: [])
end
end

@ -17,6 +17,6 @@ class Users::ProfessionalAuthAppliesController < Users::BaseAccountController
private
def create_params
params.permit(:school_id, :department_id, :identity, :extra, :upload_image)
params.permit(:school_id, :department_id, :identity, :extra, :upload_image, attachment_ids: [])
end
end

@ -1,10 +1,11 @@
class Users::ApplyAuthenticationForm
include ActiveModel::Model
attr_accessor :name, :id_number, :gender, :upload_image
attr_accessor :name, :id_number, :gender, :upload_image, :attachment_ids
validates :name, presence: true
validate :validate_ID_number
validate :validate_attachment_ids
def validate_ID_number
@ -12,4 +13,10 @@ class Users::ApplyAuthenticationForm
raise("身份证格式不对")
end
end
def validate_attachment_ids
unless attachment_ids.is_a?(Array) || attachment_ids.length != 1
raise("图片参数不对")
end
end
end

@ -1,10 +1,17 @@
class Users::ApplyProfessionalAuthForm
include ActiveModel::Model
attr_accessor :school_id, :department_id, :identity, :extra, :upload_image
attr_accessor :school_id, :department_id, :identity, :extra, :upload_image, :attachment_ids
validates :school_id, presence: true, numericality: { only_integer: true, greater_than: 0 }
validates :department_id, numericality: { only_integer: true, greater_than: 0 }, allow_blank: true
validates :identity, presence: true, inclusion: { in: %w(student teacher professional) }
validates :extra, presence: true
validate :validate_attachment_ids
def validate_attachment_ids
unless attachment_ids.is_a?(Array) || attachment_ids.length != 1
raise("图片参数不对")
end
end
end

@ -4,6 +4,7 @@ class ApplyUserAuthentication < ApplicationRecord
belongs_to :user
has_many :tidings, :as => :container, :dependent => :destroy
has_one :attachment, as: :container, dependent: :destroy
scope :real_name_auth, -> { where(auth_type: 1) }
scope :professional_auth, -> { where(auth_type: 2) }

@ -5,4 +5,13 @@ class Inform < ApplicationRecord
validates :description, length: { maximum: 5000 }
has_many :attachments, as: :container, dependent: :destroy
def next_inform
Inform.where(position: self.position+1, container_id: self.course_id, container_type: 'Course')
end
def last_inform
Inform.where(position: self.position-1, container_id: self.course_id, container_type: 'Course')
end
end

@ -14,7 +14,8 @@ class Admins::IdentityAuths::AgreeApplyService < ApplicationService
RewardGradeService.call(user, container_id: user.id, container_type: 'Authentication', score: 500)
deal_tiding!
delete_auth_file!
apply.attachment&.destroy
# delete_auth_file!
end
end

@ -12,7 +12,8 @@ class Admins::IdentityAuths::RefuseApplyService < ApplicationService
apply.update!(status: 2, remarks: reason)
deal_tiding!
delete_auth_file!
apply.attachment&.destroy
# delete_auth_file!
end
end

@ -14,7 +14,8 @@ class Admins::ProfessionalAuths::AgreeApplyService < ApplicationService
RewardGradeService.call(user, container_id: user.id, container_type: 'Professional', score: 500)
deal_tiding!
delete_auth_file!
apply.attachment&.destroy
# delete_auth_file!
end
end

@ -12,7 +12,8 @@ class Admins::ProfessionalAuths::RefuseApplyService < ApplicationService
apply.update!(status: 2, remarks: reason)
deal_tiding!
delete_auth_file!
apply.attachment&.destroy
# delete_auth_file!
end
end

@ -22,9 +22,11 @@ class Users::ApplyAuthenticationService < ApplicationService
user.user_extension.update!(gender: params[:gender].to_i) if params[:gender].present?
user.apply_user_authentication.create!(auth_type: 1, status: 0)
apply = user.apply_user_authentication.create!(auth_type: 1, status: 0)
move_image_file! unless params[:upload_image].to_s == 'false'
Attachment.associate_container(params[:attachment_ids], apply.id, apply.class) if params[:attachment_ids]
# move_image_file! unless params[:upload_image].to_s == 'false'
end
# sms_notify_admin

@ -34,9 +34,11 @@ class Users::ApplyProfessionalAuthService < ApplicationService
user.save!
extension.save!
user.apply_user_authentication.create!(auth_type: 2, status: 0)
apply = user.apply_user_authentication.create!(auth_type: 2, status: 0)
move_image_file! unless params[:upload_image].to_s == 'false'
Attachment.associate_container(params[:attachment_ids], apply.id, apply.class) if params[:attachment_ids]
# move_image_file! unless params[:upload_image].to_s == 'false'
end
# sms_notify_admin

@ -51,8 +51,8 @@
<% unless is_processed %>
<td>
<% if File.exists?(disk_real_name_auth_filename(user.id)) %>
<%= image_tag(real_name_auth_file_url(user.id).to_s + "?#{Time.now.to_i}", width: 40, height: 40, class: 'preview-image auth-image', data: { toggle: 'tooltip', title: '点击预览' }) %>
<% if apply.attachment %>
<%= image_tag("/api/attachments/#{apply.attachment.id}", width: 40, height: 40, class: 'preview-image auth-image', data: { toggle: 'tooltip', title: '点击预览' }) %>
<% else %>
<%= content_tag(:span, '图片已删除', class: 'text-secondary') %>
<% end %>

@ -48,8 +48,8 @@
<% unless is_processed %>
<td>
<% if File.exists?(disk_professional_auth_filename(user.id)) %>
<%= image_tag(professional_auth_file_url(user.id).to_s + "?#{Time.now.to_i}", width: 40, height: 40, class: 'preview-image auth-image', data: { toggle: 'tooltip', title: '点击预览' }) %>
<% if apply.attachment %>
<%= image_tag("/api/attachments/#{apply.attachment.id}", width: 40, height: 40, class: 'preview-image auth-image', data: { toggle: 'tooltip', title: '点击预览' }) %>
<% else %>
<%= content_tag(:span, '图片已删除', class: 'text-secondary') %>
<% end %>

@ -5,7 +5,7 @@ json.students do
json.name student.user.try(:real_name)
json.name_link user_path(student.user)
json.student_id student.user.try(:student_id)
json.course_group_name student.course_group.try(:name)
json.course_group_name student.course_group_name
json.course_member_id student.id
if @user_course_identity < Course::ASSISTANT_PROFESSOR && !params[:course_group_id].present?
json.member_roles student.user.course_role(@course)

@ -3,7 +3,8 @@ json.author do
end
json.id message.id
json.content content_safe(message.contents_show(identity))
# json.content content_safe(message.contents_show(identity))
json.content message.contents_show(identity)
json.time time_from_now(message.created_at)
json.hidden message.hidden
# 主贴与子贴不一致

@ -2,7 +2,7 @@ json.hackathon do
json.(@hackathon, :id, :name, :description)
json.hackathon_users_count @hackathon_users_count
end
json.hacks_count @hacks_count
json.hacks @hacks do |hack|
json.(hack, :id, :name, :description, :hack_users_count)
json.entry_info hack.entry_info(current_user.id)

@ -381,6 +381,8 @@ Rails.application.routes.draw do
get 'work_score'
get 'act_score'
get 'statistics'
post :inform_up
post :inform_down
end
collection do

@ -0,0 +1,111 @@
class Migrate2808ExerciseScore < ActiveRecord::Migration[5.2]
def challenge_path(path)
cha_path = path.present? ? path.split("") : []
cha_path.reject(&:blank?)[0].try(:strip)
end
# 版本库文件内容,带转码
def git_fle_content(repo_path, path)
begin
Rails.logger.info("git file content: repo_path is #{repo_path}, path is #{path}")
content = GitService.file_content(repo_path: repo_path, path: path)
Rails.logger.info("git file content: content is #{content}")
decode_content = nil
if content.present?
content = content["content"] #6.24 -hs 这个为新增,因为当实训题里含有选择题时,这里会报错,undefined method `[]' for nil:NilClass
content = Base64.decode64(content)
cd = CharDet.detect(content)
Rails.logger.info "encoding: #{cd['encoding']} confidence: #{cd['confidence']}"
# 字符编码问题GB18030编码识别率不行
decode_content =
if cd["encoding"] == 'GB18030' && cd['confidence'] > 0.8
content.encode('UTF-8', 'GBK', {:invalid => :replace, :undef => :replace, :replace => ' '})
else
content.force_encoding('UTF-8')
end
end
decode_content
rescue Exception => e
Rails.logger.error(e.message)
raise Educoder::TipException.new("文档内容获取异常")
end
end
def calculate_student_score(exercise,user)
score5 = 0.0 #实训题
exercise_questions = exercise.exercise_questions.includes(:exercise_standard_answers,:exercise_shixun_challenges)
exercise_questions.each do |q|
if q.question_type == 5
q.exercise_shixun_challenges.each do |exercise_cha|
game = Game.user_games(user.id,exercise_cha.challenge_id)&.first #当前用户的关卡
if game.present?
exercise_cha_score = 0.0
answer_status = 0
# if game.status == 2 && game.final_score >= 0
if game.final_score > 0 && game.end_time < exercise.end_time
exercise_cha_score = game.real_score(exercise_cha.question_score)
# exercise_cha_score = exercise_cha.question_score #每一关卡的得分
answer_status = 1
end
ex_shixun_answer_content = exercise_cha.exercise_shixun_answers.where(user_id:user.id,exercise_question_id:q.id)
code = nil
if exercise_cha.challenge&.path.present?
cha_path = challenge_path(exercise_cha.challenge&.path)
game_challenge = game.game_codes.search_challenge_path(cha_path)&.first
if game_challenge.present?
game_code = game_challenge
code = game_code.try(:new_code)
else
begin
code = git_fle_content(game.myshixun.repo_path,cha_path)
rescue
code = ""
end
end
end
if ex_shixun_answer_content.blank? #把关卡的答案存入试卷的实训里
### Todo 实训题的_shixun_details里的代码是不是直接从这里取出就可以了涉及到code的多个版本库的修改
sx_option = {
:exercise_question_id => q.id,
:exercise_shixun_challenge_id => exercise_cha.id,
:user_id => user.id,
:score => exercise_cha_score.round(1),
:answer_text => code,
:status => answer_status
}
ExerciseShixunAnswer.create!(sx_option)
else
ex_shixun_answer_content.first.update_attributes!(score:exercise_cha_score.round(1),answer_text:code,status:answer_status)
end
score5 += exercise_cha_score
else
score5 += 0.0
end
end
end
end
score5
end
def change
exercise = Exercise.find_by(id: 2808)
if exercise
exercise_users = exercise.exercise_users.where("start_at is not null and commit_status = 0")
exercise_users.each do |exercise_user|
calculate_score = calculate_student_score(exercise, exercise_user.user)
subjective_score = exercise_user.subjective_score
total_score_subjective_score = subjective_score < 0.0 ? 0.0 : subjective_score
total_score = calculate_score + total_score_subjective_score
if exercise_user.end_at.nil?
exercise_user.update_attributes!(score:total_score,objective_score:calculate_score,end_at:exercise.end_time,commit_status:1,status:1,commit_method:3)
end
puts exercise_user.id
end
end
end
end

@ -0,0 +1,17 @@
class AddPositionForInforms < ActiveRecord::Migration[5.2]
def change
add_column :informs, :position, :integer, :default => 1
course_ids = Inform.where(container_type: 'Course').pluck(:container_id).uniq
courses = Course.where(id: course_ids)
courses.find_each do |course|
next if course.informs.count == 1
informs = course.informs.order("created_at asc")
informs.each_with_index do |inform, index|
inform.update_attribute(:position, index+1)
end
end
end
end

@ -0,0 +1,35 @@
项目里有许多其他地方也有marked.js除了js_min_all.js里的其他地方的marked.js都没被使用到。
// 说明:左边 --> 右边 左边被替换成了右边的内容
// 这里的替换是直接在marked.min.js中完成的。
1、 // b(i[1].replace(/^ *| *\| *$/g,"")) --> i[1].replace(/^ *| *\| *$/g, "").split(/ *\| */) table没识别的问题
2、 // header.length===a.align.length --> header.length table没识别的问题
3、 // 2个table b(a.cells[p],a.header.length) --> a.cells[p].replace(/^ *\| *| *\| *$/g, "").split(/ *\| */)
4、 // .replace(/(?: *\| *)?\n$/,"") --> .replace(/\n$/, "")
5、 // /^ *\|(.+)\n *\|?( *[-:]+[-| :]*)(?:\n((?: *[^>\n ].*(?:\n|$))*)\n*|$)/ --> /^ *\|(.+)\n *\|( *[-:]+[-| :]*)\n((?: *\|.*(?:\n|$))*)\n*/
如果要继续升级marked.min.js还是要注意上面所列的问题
issue列表中搜索md可以查看到部分的相关问题下面列举若干关键问题
table相关 1、2、3、4、5
https://www.trustie.net/issues/24398
https://www.trustie.net/issues/24448
https://www.trustie.net/issues/24336
/educoder/public/react/public/js/editormd/editormd.min.js
md编辑器公式相关修改修改上述文件并压缩然后替换到js_min_all.js的这个位置的
/*
* Editor.md
*
* @file editormd.js
* @version v1.5.0
* @description Open source online markdown editor.
* @license MIT License
* @author Pandao
* {@link https://github.com/pandao/editor.md}
* @updateTime 2015-06-09
*/
公式相关 修改在 /public/js/editormd/editormd.min.js
https://www.trustie.net/issues/23895

@ -2,6 +2,7 @@
/educoder/public/react/public/js/readme.txt 关于js_min_all
/educoder/educoder/public/react/scripts/readme-cdn.txt 关于CDN
/educoder/public/react/src/modules/page/readme.txt 关于TPI
/educoder/public/editormd/lib/readme-marked.txt 关于md编辑器 marked.js
1、 安装node v6.9.x此安装包含了node和npm。

@ -4,9 +4,15 @@ const queryString = {
for (let key in params) {
// https://stackoverflow.com/questions/6566456/how-to-serialize-an-object-into-a-list-of-url-query-parameters
if (params[key] != undefined) {
if (params[key].constructor === Array) {
for (let singleArrIndex of params[key]) {
paramsUrl = paramsUrl + key + '[]=' + singleArrIndex + '&'
}
} else {
paramsUrl += `${key}=${encodeURIComponent(params[key])}&`
}
}
}
if (paramsUrl == '') {
return '';
}

@ -144,7 +144,8 @@ class CompetitionsIndex extends Component{
<span>报名截止时间{item.enroll_end_time}</span>,
]}
extra={
<div className={"pt50"} style={{"width":'305px'}}>
<div className={"pt50"} style={{"width":'314px'}}>
<Row gutter={16}>
<Col className="gutter-row" span={6}>
<div className="gutter-box CompetitionsIndexdadels">奖金</div>

@ -88,7 +88,8 @@
}
.CompetitionsIndex .gutter-row{
margin-right:20px;
/*margin-right:20px;*/
width: 33%;
}
.pt50{

@ -400,3 +400,7 @@
.color000{
color: #000;
}
.cursorpointer{
cursor: pointer;
}

@ -72,16 +72,19 @@ class CompetitionCommon extends Component{
}
//获取头部信息
getbannerdata=()=>{
let menuid=this.props.location.search.replace('?menu=', '');
// let menuid=this.props.location.search.replace('?menu=', '');
let query=this.props.location&&this.props.location.search;
const types = query.split('&')
const menuid = types[0].split('?menu=')
let url=`/competitions/${this.props.match.params.identifier}/common_header.json`;
axios.get(url).then((response) => {
if(response.status===200){
this.setState({
data: response.data,
thiskeys: menuid === undefined || menuid === "" ? response.data.competition_modules[0].id : menuid,
thiskeys: menuid[1] === undefined || menuid[1] === "" ? response.data.competition_modules[0].id : menuid[1],
mode: response.data.mode
})
if(menuid===undefined||menuid===""){
if(menuid[1]===undefined||menuid[1]===""){
this.getrightdata(
response.data.competition_modules[0].id,
response.data.competition_modules[0].module_type,
@ -91,7 +94,7 @@ class CompetitionCommon extends Component{
}else{
let newlist=response.data.competition_modules;
newlist.map((item,key)=>{
if(`${item.id}`===`${menuid}`){
if(`${item.id}`===`${menuid[1]}`){
this.getrightdata(
item.id,
item.module_type,
@ -224,6 +227,18 @@ class CompetitionCommon extends Component{
Competitionedittype:false
})
}
newgotocourse=(url)=>{
if(this.props.checkIfLogin()===false){
this.props.showLoginDialog()
return
}
if(this.props.checkIfProfileCompleted()===false){
this.props.showProfileCompleteDialog()
return
}
window.open(url);
}
gotocourse=(url)=>{
@ -255,7 +270,9 @@ class CompetitionCommon extends Component{
).then((response) => {
if (response.data.status === 0) {
// this.props.history.replace();
this.Personalregistration(`/courses/${data.course_id}`)
this.getbannerdata()
window.open(`/courses/${data.course_id}`);
}
})
@ -267,7 +284,7 @@ class CompetitionCommon extends Component{
let urls = `/competitions/${this.props.match.params.identifier}/enroll`;
this.Personalregistration(urls)
} else {
this.props.history.replace(url);
window.open(url);
}
}
@ -293,6 +310,7 @@ class CompetitionCommon extends Component{
if (response.data) {
this.props.showNotification(`报名成功,预祝您夺得桂冠!`);
// this.props.history.replace(urls);
this.getbannerdata()
window.open(urls)
}
}
@ -355,7 +373,15 @@ class CompetitionCommon extends Component{
className={"color000"}>{data && data.start_time}{data && data.end_time}</span></Col>
{/*<Col></Col>*/}
</Col>
<style>
{
`
.ant-col-6{
width: 30%;
}
`
}
</style>
<Col className={"competitionbannerdiv mt10"}>
<Row gutter={16}>
<Col className="gutter-row" span={6}>
@ -379,8 +405,24 @@ class CompetitionCommon extends Component{
className="gutter-box CompetitionsIndexbottomvalue Competitioncolor516">{data.competition_status === "nearly_published" ? "--" : data && data.visits_count}</div>
</Col>
<Col className="gutter-row rankbeicenter" span={6}>
{data.competition_status === "ended" ?
<div className={data.mode === 2 ?data.member_of_course==true?"gutter-box CompetitionsIndexbottomvalue Competitioncolor516 cursorpointer":"gutter-box CompetitionsIndexbottomvalue Competitioncolor516":"gutter-box CompetitionsIndexbottomvalue Competitioncolor516 cursorpointer"}
// 已结束onClick={data.competition_status === "nearly_published" ? "" : () => this.gotocourse(`/competitions/${this.props.match.params.identifier}/enroll`)}
onClick={ data.mode === 2 ?data.member_of_course==true?() => this.newgotocourse(`/courses/${data.course_id}`):"":() => this.newgotocourse(`/competitions/${this.props.match.params.identifier}/enroll`)}
>{data && data.member_count}</div>
:data.competition_status === "nearly_published" ?
<div className="gutter-box CompetitionsIndexbottomvalue Competitioncolor516"
onClick={data.competition_status === "nearly_published" ? "" : () => this.gotocourse(`/competitions/${this.props.match.params.identifier}/enroll`)}>{data.competition_status === "nearly_published" ? "--" : data && data.member_count}</div>
// onClick={data.competition_status === "nearly_published" ? "" : () => this.gotocourse(`/competitions/${this.props.match.params.identifier}/enroll`)}
>{"--"}</div> :
data.competition_status === "progressing" ?
data.mode === 2 ?
<div className="gutter-box CompetitionsIndexbottomvalue Competitioncolor516 cursorpointer" onClick={() => this.gotocourse()}>{data && data.member_count}</div> : signupdata && signupdata.personal === true ?
<div className="gutter-box CompetitionsIndexbottomvalue Competitioncolor516 cursorpointer" onClick={() => this.gotocourse("personal")}>{data && data.member_count}</div> : <div
className="gutter-box CompetitionsIndexbottomvalue Competitioncolor516 cursorpointer"
onClick={() => this.gotocourse(`/competitions/${this.props.match.params.identifier}/enroll`)}>{data && data.member_count}</div>
:""}
</Col>
</Row>
</Col>

@ -363,7 +363,7 @@ function buildColumns(that, student_works, studentData) {
{/*<React.Fragment>*/}
{/*</React.Fragment>*/}
{ isAdmin && <Tooltip placement="bottom" title={<pre>调整学生最终成绩<br/>其它历史评分将全部失效</pre>}>
<a style={{color:"#000"}}
<a style={{color: "#4CACFF"}}
onClick={() => that.showModulationModal(record)}
>调分</a>
</Tooltip> }
@ -748,11 +748,17 @@ class CommonWorkList extends Component{
isPublish={true} doWhenSuccess={this.doWhenSuccess}></PublishRightnow>
<PublishRightnow ref={this.endModal} showActionButton={false} {...this.props} checkBoxValues={[workId]}
isPublish={false} doWhenSuccess={this.doWhenSuccess}></PublishRightnow>
{
modulationModalVisible === true ?
<ModulationModal
visible={modulationModalVisible}
Cancel={this.cancelModulationModel}
Saves={(value,num)=>this.saveModulationModal(value,num)}
Saves={(value, num) => this.saveModulationModal(value, num)}
/>
: ""
}
{/* 内容区 */}

@ -728,18 +728,18 @@ class CommonWorkSetting extends Component{
course_id ,
unified_setting: unified_setting, // 统一设置
group_settings: group_settings_param,
publish_time: temp_end_time ? new Date(temp_publish_time) : temp_end_time, // 发布
end_time: temp_end_time ? new Date(temp_end_time) : temp_end_time, // 截止
publish_time: temp_end_time ? new Date(temp_publish_time.replace(/-/g, '/')) : temp_end_time, // 发布
end_time: temp_end_time ? new Date(temp_end_time.replace(/-/g, '/')) : temp_end_time, // 截止
late_penalty: late_penalty, // 迟交扣分
allow_late: allow_late, // 是否允许补交
late_time: late_time ? new Date(late_time) : late_time, // 补交截止时间
late_time: late_time ? new Date(late_time.replace(/-/g, '/')) : late_time, // 补交截止时间
anonymous_comment: anonymous_comment, // true: 启用匿评 false:未启用匿评
evaluation_start: evaluation_start ? new Date(evaluation_start) : evaluation_start, //匿评开始时间
evaluation_end: evaluation_end ? new Date(evaluation_end) : evaluation_end,
evaluation_start: evaluation_start ? new Date(evaluation_start.replace(/-/g, '/')) : evaluation_start, //匿评开始时间
evaluation_end: evaluation_end ? new Date(evaluation_end.replace(/-/g, '/')) : evaluation_end,
evaluation_num: evaluation_num, // 匿评数
absence_penalty: absence_penalty, // 匿评扣分
anonymous_appeal: anonymous_appeal, // true: 启用匿评申诉, false:未启用
appeal_time: appeal_time ? new Date(appeal_time) : appeal_time, // 申诉结束时间
appeal_time: appeal_time ? new Date(appeal_time.replace(/-/g, '/')) : appeal_time, // 申诉结束时间
appeal_penalty: appeal_penalty, // 违规匿评扣分
ta_mode: ta_mode, // 1:普通模式 0:复审模式
final_mode: final_mode, // true: 单项评分优先, false: 多项评分配比

@ -1,7 +1,9 @@
import React,{ Component } from "react";
import { Modal,Checkbox,Upload,Button,Icon,message,Input} from "antd";
import {Modal, Checkbox, Upload, Button, Icon, message, Input, Form} from "antd";
import { WordNumberTextarea } from 'educoder';
import './Newshixunmodel.css'
//调分
class ModulationModal extends Component{
constructor(props){
super(props);
@ -16,22 +18,32 @@ class ModulationModal extends Component{
Saves=()=>{
let {textareaval,Inputsval}=this.state;
if(textareaval===""||textareaval===undefined){
this.setState({
textareavaltype:true
})
return
}
// if(textareaval===""||textareaval===undefined){
// this.setState({
// textareavaltype:true
// })
// return
// }
this.setState({
textareavaltype: false
})
if(Inputsval===undefined||Inputsval===""){
this.setState({
Inputsvaltype:true
Inputsval: "",
Inputsvaltype: true,
Inputsvaltest: "请输入分数",
})
return
}
if (this.state.Inputsvaltype === true) {
return;
}
this.setState({
Inputsvaltype: false,
Inputsvaltest: "",
})
this.props.Saves(textareaval,Inputsval)
}
@ -43,21 +55,34 @@ class ModulationModal extends Component{
}
setInputs=(e)=>{
debugger
var value=parseInt(e.target.value)
if(isNaN(value)){
value=0
value = 0;
this.setState({
Inputsval: value,
Inputsvaltype: true,
Inputsvaltest: "请输入分数",
})
}else{
if(value<0||value>100){
value=0
value = 0;
this.setState({
Inputsval: value,
Inputsvaltype: true,
Inputsvaltest: "请输入0-100的分数",
})
}
}
this.setState({
Inputsval:value
Inputsval: value,
Inputsvaltype: false,
})
}
render(){
let {textareaval,Inputsval,textareavaltype,Inputsvaltype}=this.state;
let {textareaval, Inputsval, textareavaltype, Inputsvaltype, Inputsvaltest} = this.state;
return(
<div>
<Modal
@ -69,60 +94,144 @@ class ModulationModal extends Component{
footer={null}
destroyOnClose={true}
>
<div className="task-popup-content">
<p className="task-popup-text-center font-16 mb20">
<span className={"color-dark-21"}>该学生的最终成绩将不会按照评分规则进行计算</span>
</p>
<div className="clearfix" style={{
display: "-webkit-flex",
flexDirection: "column",
alignItems: "center",
}}>
<div style={{
marginTop: " 27px",
display: "flex",
flexDirection: "initial",
}}>
<span style={{
width: "70px",
textAlign: "center",
lineHeight: " 40px",
}}><span style={{
textAlign: "center",
lineHeight: " 40px",
color: " #f5222d",
}}>*</span></span>
<Input
className={Inputsvaltype === true ? "borerinput" : ""}
style={{
width: "335px",
height: "40px",
}}
placeholder="请填写分数"
value={Inputsval}
onInput={this.setInputs}
suffix={
<span
style={{
textAlign: "center",
lineHeight: " 40px",
}}
></span>
}
/>
</div>
{
Inputsvaltype === true ?
<p style={{color: "#DD1717", width: "268px"}}>{Inputsvaltest}</p>
: ""
}
<div style={{
display: "flex",
flexDirection: "initial",
<div className="clearfix">
{/*<textarea*/}
{/*className="winput-100-150"*/}
{/*placeholder="请填写您对作品调分的原因"*/}
{/*value={textareaval}*/}
{/*onInput={this.settextarea}*/}
{/*></textarea>*/}
}}>
<span style={{width: "70px"}}></span>
<p className=" mt3 font-14 " style={{color: "#666666"}}>调分后该学生的最终成绩将不会按照评分规则进行计算</p>
</div>
<div style={{
display: "flex",
flexDirection: "initial",
marginTop: "10px;",
}}>
<span style={{width: "70px", marginTop: "24px"}}>调分原因</span>
<WordNumberTextarea
placeholder={"请填写您对作品调分的原因"}
onInput={(e)=>this.settextarea(e)}
style={{width: "335px"}}
placeholder={"请输入调分原因(选填)"}
onInput={(e) => this.settextarea(e)}
value={textareaval}
maxlength={100}
/>
</div>
<li style={{height:"20px",lineHeight:"20px"}}><span className={textareavaltype===true?"color-red":"none"}>原因不能为空</span></li>
<div style={{
marginTop: "27px",
width: " 336px",
marginLeft: "70px",
marginBottom: "29px",
}}>
<a className="task-btn color-white mr30" style={{width: "72px",}}
onClick={this.props.Cancel}>{this.props.Cancelname || '取消'}</a>
<a className="task-btn task-btn-orange" style={{width: "72px",}}
onClick={this.Saves}>{this.props.Savesname || '保存'}</a>
</div>
<style>
{
</div>
`
.pdl10{
padding-left:10px;
}
`
}
</style>
<li className={"pdl10"}>
<Input style={{
width: '20%',
}}
placeholder="请填写分数"
value={Inputsval}
onInput={this.setInputs}/> <span className="ml10"></span>
</li>
<li style={{height:"20px",lineHeight:"20px"}}><span className={Inputsvaltype===true?"color-red":"none"}>分数不能为空</span></li>
<div className="clearfix edu-txt-center">
<a className="task-btn color-white mr30" onClick={this.props.Cancel}>{this.props.Cancelname || '取消'}</a>
<a className="task-btn task-btn-orange" onClick={this.Saves}>{this.props.Savesname || '保存'}</a>
</div>
</div>
</Modal>
</div>
)
}
}
export default ModulationModal;
// <div className="task-popup-content">
// <p className="task-popup-text-center font-16 mb20">
//
// <span className={"color-dark-21"}>该学生的最终成绩将不会按照评分规则进行计算</span>
//
// </p>
//
//
// <div className="clearfix">
// {/*<textarea*/}
// {/*className="winput-100-150"*/}
// {/*placeholder="请填写您对作品调分的原因"*/}
// {/*value={textareaval}*/}
// {/*onInput={this.settextarea}*/}
// {/*></textarea>*/}
//
// <WordNumberTextarea
// placeholder={"请填写您对作品调分的原因"}
// onInput={(e)=>this.settextarea(e)}
// value={textareaval}
// maxlength={100}
// />
//
// {/*<li style={{height:"20px",lineHeight:"20px"}}><span className={textareavaltype===true?"color-red":"none"}>原因不能为空</span></li>*/}
// <div style={{height:"20px",lineHeight:"20px"}}></div>
// </div>
//
// <style>
// {
//
// `
// .pdl10{
// padding-left:10px;
// }
// `
// }
// </style>
//
// <li className={"pdl10"}>
//
// </li>
// <li style={{height:"20px",lineHeight:"20px"}}><span className={Inputsvaltype===true?"color-red":"none"}>分数不能为空</span></li>
// <div className="clearfix edu-txt-center">
// <a className="task-btn color-white mr30" onClick={this.props.Cancel}>{this.props.Cancelname || '取消'}</a>
// <a className="task-btn task-btn-orange" onClick={this.Saves}>{this.props.Savesname || '保存'}</a>
{/* </div>*/
}
{/*</div>*/
}

@ -267,3 +267,61 @@
padding: 13px 30px;
box-sizing: border-box;
}
.displaymodulat {
display: flex;
display: -webkit-flex;
flex-direction: column;
align-items: center;
}
.WordNumberTextarea {
outline: none; /* 去掉输入字符时的默认样式 */
appearance: none;
-webkit-appearance: none;
-moz-appearance: none;
background-color: white;
text-shadow: none;
-webkit-writing-mode: horizontal-tb !important;
-webkit-tap-highlight-color: rgba(0, 0, 0, 0);
resize: none; /*禁止拉伸*/
border: none; /*去掉默认边框*/
width: 100%;
height: 130px;
border: none;
display: block;
}
.WordNumbernote {
padding: 0;
margin: 0;
list-style: none;
text-decoration: none;
box-sizing: border-box;
overflow: hidden;
height: auto;
border: 1px solid rgba(234, 234, 234, 1);
border-radius: 0.125rem;
margin: 10px 10px 0px 10px;
padding: 10px 10px 5px 10px;
backgroud: rgba(234, 234, 234, 1);
width: 335px;
}
.WordNumberTextarea-count {
display: inline-block;
float: right;
font-size: 16px;
color: #adadad;
padding-right: 0.25rem;
}
.borerinput {
border: 1px solid #DD1717 !important;
}
.borerinputs {
border: 1px solid #eee !important;
}

@ -23,6 +23,7 @@ import './yslexercisetable.css';
import {getImageUrl, toPath, sortDirections} from 'educoder';
import CheckBoxGroup from "../../page/component/CheckBoxGroup";
import NoneData from '../../../modules/courses/coursesPublic/NoneData'
import ModulationModal from "../coursesPublic/ModulationModal";
const Search = Input.Search;
const RadioGroup = Radio.Group;
const CheckboxGroup = Checkbox.Group;
@ -38,6 +39,7 @@ class Studentshavecompletedthelist extends Component {
datas: [],
page: 1,
limit: 20,
testpapergradingboll: false,
styletable: {
"display": "block"
},
@ -1028,11 +1030,9 @@ class Studentshavecompletedthelist extends Component {
render: (text, record) => (
<span>
{record.finalscore==="--"?
<span style={{textAlign: "center",color: '#999999'}}
>--</span>
:record.submitstate === "未提交"?
<span style={{textAlign: "center",color: '#999999'}}
>--</span>
<span className="color-blue" style={{textAlign: "center", cursor: "pointer"}}
onClick={() => this.Adjustment(record)}
>调分</span>
:
<a style={{textAlign: "center"}} className="color-blue"
target="_blank"
@ -1227,11 +1227,9 @@ class Studentshavecompletedthelist extends Component {
render: (text, record) => (
<span>
{record.finalscore==="--"?
<span style={{textAlign: "center",color: '#999999'}}
>--</span>
:record.submitstate === "未提交"?
<span style={{textAlign: "center",color: '#999999'}}
>--</span>
<span className="color-blue" style={{textAlign: "center", cursor: "pointer"}}
onClick={() => this.Adjustment(record)}
>调分</span>
:
<a style={{textAlign: "center"}} className="color-blue"
target="_blank"
@ -1244,9 +1242,10 @@ class Studentshavecompletedthelist extends Component {
],//columnsystwo 也会被columnsys当作参数接收
exercise_status:0,
order_type: "desc",
exeuserid: 0,
}
// console.log("Studentshavecompletedthelist");
// console.log(props.current_status);
// //console.log("Studentshavecompletedthelist");
// //console.log(props.current_status);
// columnsys 老师列表
// columnss 学生只能看自己的 未截止页面
// columnstwo 截止显示自己的
@ -1254,7 +1253,7 @@ class Studentshavecompletedthelist extends Component {
}
paginationonChange = (pageNumber) => {
// console.log('Page: ');
// //console.log('Page: ');
if (this.state.loadingstate === false) {
this.setState({
page: pageNumber,
@ -1271,7 +1270,7 @@ class Studentshavecompletedthelist extends Component {
}
paginationonChanges = (pageNumber) => {
// console.log('Page: ');
// //console.log('Page: ');
if (this.state.loadingstate === false) {
this.setState({
page: pageNumber,
@ -1292,12 +1291,12 @@ class Studentshavecompletedthelist extends Component {
componentDidMount() {
// if(this.props.isAdmin() === true){
// this.Teacherliststudentlistsy();
// console.log("1111111111111111");
// console.log(this.props.isAdmin());
// //console.log("1111111111111111");
// //console.log(this.props.isAdmin());
// }else {
this.Teacherliststudentlist();
// console.log("2222222222222");
// console.log(this.props.isAdmin());
// //console.log("2222222222222");
// //console.log(this.props.isAdmin());
// }
try {
this.props.triggerRef(this);
@ -1313,10 +1312,10 @@ class Studentshavecompletedthelist extends Component {
//试卷列表
Teacherliststudentlist = () => {
// console.log("Teacherliststudentlist"); // 764
// //console.log("Teacherliststudentlist"); // 764
var thiss = this;
var exercise_id = this.props.match.params.Id;
// console.log(731); // 764 935
// //console.log(731); // 764 935
var url = `/exercises/${exercise_id}/exercise_lists.json`;
axios.get((url), {
params: {
@ -1342,7 +1341,7 @@ class Studentshavecompletedthelist extends Component {
})
if (response.data.current_answer_user === undefined || response.data.current_answer_user === null) {
// 学生未截止
// console.log("试卷学生未截止");
// //console.log("试卷学生未截止");
this.Generatenewdatas(response.data.exercise_users);
if (response.data.exercise_types.subjective === 0) {
if (this.state.noclassroom === undefined || this.state.noclassroom === "" || this.state.noclassroom === null) {
@ -1389,7 +1388,7 @@ class Studentshavecompletedthelist extends Component {
}
} else {
//学生已截止
// console.log("试卷学生已截止");
// //console.log("试卷学生已截止");
if (response.data.exercise_types.subjective === 0) {
if (this.state.loadingstate === false) {
var arr =[];
@ -1469,22 +1468,22 @@ class Studentshavecompletedthelist extends Component {
}
//老师
else if (response.data.exercise_types.user_permission === 0) {
// console.log(response.data.exercise_users)
// console.log(response)
// console.log("试卷老师加载中");
// //console.log(response.data.exercise_users)
// //console.log(response)
// //console.log("试卷老师加载中");
if (thiss.state.loadingstate === false) {
thiss.setState({
loadingstate: true,
})
}
console.log(response);
console.log(1393);
//console.log(response);
//console.log(1393);
thiss.Generatenewdatasy(response.data.exercise_users, response);
}
}).catch((error) => {
// console.log(error);
// console.log("其实数据加载失败了");
// console.log("1111");
// //console.log(error);
// //console.log("其实数据加载失败了");
// //console.log("1111");
});
@ -1495,9 +1494,9 @@ class Studentshavecompletedthelist extends Component {
let datalist = [];
let datalisttwo = [];
var teacherlist = undefined;
// console.log("开始数据了");
// //console.log("开始数据了");
if (exercise_users !== undefined) {
// console.log("开始打印数据了");
// //console.log("开始打印数据了");
for (var i = 0; i < exercise_users.length; i++) {
if (exercise_users[i].commit_status === 1) {
datalist.push({
@ -1574,9 +1573,9 @@ class Studentshavecompletedthelist extends Component {
let datalist = [];
var teacherlist = undefined;
var noclassroom = undefined;
// console.log("开始数据了");
// //console.log("开始数据了");
if (exercise_users !== undefined) {
// console.log("开始打印数据了");
// //console.log("开始打印数据了");
for (var i = 0; i < exercise_users.length; i++) {
datalist.push({
myid: exercise_users[i].login,
@ -1610,7 +1609,7 @@ class Studentshavecompletedthelist extends Component {
}
TablePagination = (e) => {
// console.log(e.current);
// //console.log(e.current);
var teacherlist = { //分页
total: this.state.exercise_users.length, //数据总数量
pageSize: 20, //一页显示几条
@ -1623,7 +1622,7 @@ class Studentshavecompletedthelist extends Component {
}
TablePaginations = (e) => {
// console.log(e.current);
// //console.log(e.current);
var teacherlists = { //分页
total: this.state.exercise_users, //数据总数量
pageSize: 10, //一页显示几条
@ -1639,7 +1638,7 @@ class Studentshavecompletedthelist extends Component {
Searchdata = (order, commit_status, review, exercise_group_id, search, page, limit, order_type) => {
var exercise_id = this.props.match.params.Id;
// console.log(731); // 764 935
// //console.log(731); // 764 935
var url = `/exercises/${exercise_id}/exercise_lists.json`;
var params = {
order: order,
@ -1654,7 +1653,7 @@ class Studentshavecompletedthelist extends Component {
axios.get(url, {
params: params
}).then((response) => {
// console.log(JSON.stringify(response));
// //console.log(JSON.stringify(response));
this.setState({
Teacherliststudentlist: response.data,
review: response.data.review,
@ -1702,7 +1701,7 @@ class Studentshavecompletedthelist extends Component {
}
this.Generatenewdata(response.data.exercise_users, response.data.current_answer_user);
}).catch((error) => {
console.log(error)
//console.log(error)
this.setState({
loadingstate: false,
})
@ -1717,9 +1716,9 @@ class Studentshavecompletedthelist extends Component {
let datalist = [];
var indexi = 0;
var teacherlist = undefined;
// console.log("开始数据了");
// //console.log("开始数据了");
if (exercise_users !== undefined) {
// console.log("开始打印数据了");
// //console.log("开始打印数据了");
for (var i = 0; i < exercise_users.length; i++) {
if (exercise_users[i].commit_status === 1) {
datalist.push({
@ -1734,7 +1733,8 @@ class Studentshavecompletedthelist extends Component {
completion: exercise_users[i].objective_score === undefined ? "--" : exercise_users[i].objective_score === null ? "--" : exercise_users[i].objective_score === "" ? "--" : exercise_users[i].objective_score,
levelscore: exercise_users[i].subjective_score === undefined ? "--" : exercise_users[i].subjective_score === null ? "--" : exercise_users[i].subjective_score === "" ? "--" : exercise_users[i].subjective_score,
efficiencyscore: exercise_users[i].score === undefined ? "--" : exercise_users[i].score === null ? "--" : exercise_users[i].score === "" ? "--" : exercise_users[i].score,
finalscore: "评阅"
finalscore: "评阅",
user_id: exercise_users[i].user_id
})
} else {
datalist.push({
@ -1749,7 +1749,8 @@ class Studentshavecompletedthelist extends Component {
completion: exercise_users[i].objective_score === undefined ? "--" : exercise_users[i].objective_score === null ? "--" : exercise_users[i].objective_score === "" ? "--" : exercise_users[i].objective_score,
levelscore: exercise_users[i].subjective_score === undefined ? "--" : exercise_users[i].subjective_score === null ? "--" : exercise_users[i].subjective_score === "" ? "--" : exercise_users[i].subjective_score,
efficiencyscore: exercise_users[i].score === undefined ? "--" : exercise_users[i].score === null ? "--" : exercise_users[i].score === "" ? "--" : exercise_users[i].score,
finalscore: "--"
finalscore: "--",
user_id: exercise_users[i].user_id
})
indexi++;
}
@ -1767,7 +1768,7 @@ class Studentshavecompletedthelist extends Component {
if (indexi === exercise_users.length) {
//都没评论 不显示评论
if (response.data.exercise_types.groups_count > 0) {
// console.log("77771111111");
// //console.log("77771111111");
//分班大于0显示分班
//7ge
// this.state.columnsys.map((item,key)=>{
@ -1854,8 +1855,8 @@ class Studentshavecompletedthelist extends Component {
arr.push(item);
}
}
// console.log(thiss.state.columnsys);
// console.log(arr);
// //console.log(thiss.state.columnsys);
// //console.log(arr);
this.setState({
data: datalist,
@ -1908,7 +1909,7 @@ class Studentshavecompletedthelist extends Component {
} else {
//包括主观题
if (indexi === exercise_users.length) {
console.log("2548包含主观题不包含分班");
//console.log("2548包含主观题不包含分班");
if (response.data.exercise_types.groups_count > 0) {
var arr =[];
@ -1959,7 +1960,7 @@ class Studentshavecompletedthelist extends Component {
})
}
} else {
// console.log("2699包含主观题包含分班");
// //console.log("2699包含主观题包含分班");
if (response.data.exercise_types.groups_count > 0) {
this.setState({
data: datalist,
@ -2010,7 +2011,7 @@ class Studentshavecompletedthelist extends Component {
TablePaginationsy = (e) => {
// console.log(e.current);
// //console.log(e.current);
var teacherlist = { //分页
total: this.state.exercise_users.length, //数据总数量
pageSize: 20, //一页显示几条
@ -2037,19 +2038,19 @@ class Studentshavecompletedthelist extends Component {
order_type: order_type
}
}).then((response) => {
// console.log("528");
// console.log(JSON.stringify(response));
// //console.log("528");
// //console.log(JSON.stringify(response));
if(response===undefined){
return
}
this.setState({
loadingstate: false,
})
// console.log(response);
// console.log(1997);
// //console.log(response);
// //console.log(1997);
this.Generatenewdatasy(response.data.exercise_users, response);
}).catch((error) => {
// console.log(error)
// //console.log(error)
this.setState({
loadingstate: false,
})
@ -2101,9 +2102,9 @@ class Studentshavecompletedthelist extends Component {
this.Searchdatasys(this.state.order, undefined, this.state.review, this.state.checkedValuesineinfo, this.state.searchtext, 1, this.state.limit, this.state.order_type);
}
checkeboxstwo = (checkedValues, data) => {
// console.log(checkedValues)
// //console.log(checkedValues)
if (JSON.stringify(checkedValues) === "[]") {
// console.log(checkedValues);
// //console.log(checkedValues);
if (this.state.loadingstate === false) {
this.setState({
loadingstate: true,
@ -2138,7 +2139,7 @@ class Studentshavecompletedthelist extends Component {
this.Searchdatasys(this.state.order, checkedValues, this.state.review, this.state.checkedValuesineinfo, this.state.searchtext, 1, this.state.limit, this.state.order_type);
} else {
// console.log(checkedValues);
// //console.log(checkedValues);
this.Searchdatasys(this.state.order, checkedValues, this.state.review, this.state.checkedValuesineinfo, this.state.searchtext, 1, this.state.limit, this.state.order_type);
if (this.state.loadingstate === false) {
this.setState({
@ -2160,7 +2161,7 @@ class Studentshavecompletedthelist extends Component {
}
notlimitedst = () => {
// console.log();
// //console.log();
// var datas=this.state.course_groups;
// for(var ik=0;ik<datas.length;ik++){
// datas[ik].exercise_group_id=undefined;
@ -2182,7 +2183,7 @@ class Studentshavecompletedthelist extends Component {
if (JSON.stringify(checkedValues) === "[]") {
// console.log(checkedValues);
// //console.log(checkedValues);
if (this.state.loadingstate === false) {
this.setState({
unlimited: 0,
@ -2217,7 +2218,7 @@ class Studentshavecompletedthelist extends Component {
this.Searchdatasys(this.state.order, this.state.course_groupyslstwo, checkedValues, this.state.checkedValuesineinfo, this.state.searchtext, 1, this.state.limit, this.state.order_type);
} else {
// console.log(checkedValues);
// //console.log(checkedValues);
if (this.state.loadingstate === false) {
this.setState({
unlimited: 1,
@ -2260,9 +2261,9 @@ class Studentshavecompletedthelist extends Component {
}
funtaskstatustwo = (checkedValues, data) => {
// console.log(checkedValues);
// //console.log(checkedValues);
if (JSON.stringify(checkedValues) === "[]") {
// console.log(checkedValues);
// //console.log(checkedValues);
if (this.state.loadingstate === false) {
this.setState({
course_groupysls: undefined,
@ -2297,7 +2298,7 @@ class Studentshavecompletedthelist extends Component {
this.Searchdatasys(this.state.order, this.state.course_groupyslstwo, this.state.review, checkedValues, this.state.searchtext, 1, this.state.limit, this.state.order_type)
} else {
// console.log(checkedValues);
// //console.log(checkedValues);
if (this.state.loadingstate === false) {
this.setState({
checkedValuesineinfo: checkedValues,
@ -2325,7 +2326,7 @@ class Studentshavecompletedthelist extends Component {
onSearchKeywordKeyUp = (e) => {
if (e.keyCode === 13) {
// this.onSearch();
// console.log("使用了回车键");
// //console.log("使用了回车键");
// if(this.state.searchtext === ""){
// message.error("请输入姓名或学号搜索");
// return
@ -2356,7 +2357,7 @@ class Studentshavecompletedthelist extends Component {
this.Searchdatasys(this.state.order, this.state.course_groupyslstwo, this.state.review, this.state.checkedValuesineinfo, value, 1, this.state.limit, this.state.order_type);
// this.Startsorting(this.state.order,this.state.checkedValuesine,this.state.checkedValuesineinfo,value);
// console.log(value)
// //console.log(value)
};
@ -2375,7 +2376,7 @@ class Studentshavecompletedthelist extends Component {
//搜索学生 文字输入
inputSearchValues = (e) => {
// console.log(e.target.value)
// //console.log(e.target.value)
if (e.target.value === "") {
this.setState({
searchtext: undefined,
@ -2563,19 +2564,61 @@ class Studentshavecompletedthelist extends Component {
setExerciseReviewAndAnswer = () => {
}
// 调分
Adjustment = (e) => {
this.setState({
testpapergradingboll: true,
exeuserid: e.user_id,
})
}
//调分窗
Adjustments = () => {
//弹出弹框
this.setState({
testpapergradingboll: false
})
}
//试卷调分
Testpapergrading = (v, n) => {
var exercise_id = this.props.match.params.Id;
let url = `/exercises/${exercise_id}/adjust_score.json`;
axios.post(url, {
score: n,
user_id: this.state.exeuserid,
comment: v,
})
.then((response) => {
if (response.data.status == '0') {
this.setState({testpapergradingboll: false});
this.props.showNotification('调分成功');
this.Teacherliststudentlist();
}
})
.catch(function (error) {
console.log(error);
this.setState({testpapergradingboll: false})
});
}
render() {
const isAdmin = this.props.isAdmin();
let {data, datas, page, columns, course_groupyslsthree, columnstwo, styletable,exercise_status, course_groupyslstwodatas, limit, course_groupysls, course_groupyslstwodata, course_groupyslstwo, teacherlists, Teacherliststudentlist, order, columnss, course_groupsdatas, course_groups, Evaluationarray, unlimited, unlimiteds, unlimitedtwo, teacherlist, searchtext, loadingstate, review, nocomment, commented, unsubmitted, submitted, columnsys, exercise_users,mylistansum} = this.state;
// console.log("Studentshavecompletedthelist");
// console.log(this.props.current_status);
// console.log("获取到的数据");
// console.log(datas);
// console.log(data);
// console.log("this.props.Commonheadofthetestpaper.exercise_status");
// console.log(this.props.Commonheadofthetestpaper&&this.props.Commonheadofthetestpaper.exercise_status);
// console.log(exercise_status);
let {data, datas, page, columns, course_groupyslsthree, columnstwo, styletable, exercise_status, course_groupyslstwodatas, limit, course_groupysls, course_groupyslstwodata, course_groupyslstwo, teacherlists, Teacherliststudentlist, order, columnss, course_groupsdatas, course_groups, Evaluationarray, unlimited, unlimiteds, unlimitedtwo, teacherlist, searchtext, loadingstate, review, nocomment, commented, unsubmitted, submitted, columnsys, exercise_users, mylistansum, testpapergradingboll} = this.state;
// //console.log("Studentshavecompletedthelist");
// //console.log(this.props.current_status);
// //console.log("获取到的数据");
// //console.log(datas);
// //console.log(data);
// //console.log("this.props.Commonheadofthetestpaper.exercise_status");
// //console.log(this.props.Commonheadofthetestpaper&&this.props.Commonheadofthetestpaper.exercise_status);
// //console.log(exercise_status);
return (
isAdmin === true ?
(
@ -2591,6 +2634,11 @@ class Studentshavecompletedthelist extends Component {
</div>
:
<div>
{testpapergradingboll === true ? <ModulationModal
visible={testpapergradingboll}
Cancel={() => this.Adjustments()}
Saves={(value, num) => this.Testpapergrading(value, num)}
/> : ""}
<div className="edu-back-white" >
<ul className="clearfix" style={{padding: '10px 30px 10px 30px'}}>

@ -895,8 +895,10 @@ debugger
})
}
}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)

@ -718,8 +718,10 @@ class GraduationTaskssettinglist 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)
@ -900,7 +902,7 @@ class GraduationTaskssettinglist extends Component{
{tag.name}
</a>
:
<span style={{color:tag.name==="调分"?"#000":'#4CACFF',padding:"0px 5px"}}
<span style={{color: tag.name === "调分" ? "#4CACFF" : '#4CACFF', padding: "0px 5px"}}
onClick={tag.name==="调分"?()=>this.showModulationtype(tag.id):tag.name==="分配"?taskslistdata&&taskslistdata.cross_comment===true?"":"":""}>
{tag.name==="分配"?taskslistdata&&taskslistdata.cross_comment===true?"":"":tag.name}
</span>

@ -239,8 +239,10 @@ class GraduationTasksquestions 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)

@ -107,7 +107,7 @@ const buildColumns = (that,isParent) => {
}
];
if (course_groups && course_groups.length) {
if (that.hasGroupModule()) {
that.isStudentPage && columns.push({
title: '分班',
dataIndex: 'course_group_name',
@ -249,6 +249,13 @@ class studentsList extends Component{
console.log(error)
});
}
hasGroupModule = () => {
const { course_modules } = this.props;
const result = course_modules && course_modules.filter( item => {
return item.type == 'course_group'
})
return result && result.length > 0
}
Downloadcal=()=>{
this.setState({

@ -114,8 +114,10 @@ class PollDetailIndex 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)

@ -1174,7 +1174,9 @@ class Listofworksstudentone extends Component {
align: 'center',
className: 'font-14',
render: (text, record) => (
record.submitstate === "未提交" ? <span style={{color: '#9A9A9A'}}>--</span> :
record.submitstate === "未提交" ?
<span style={{textAlign: "center", cursor: "pointer"}} className="color-blue"
onClick={() => this.Adjustment(record)}>调分</span> :
<span>
<a style={{textAlign: "center"}} className="color-blue"
onMouseDown={(e) => this.Viewstudenttraininginformationtysl2(e, record)}
@ -1505,7 +1507,9 @@ class Listofworksstudentone extends Component {
align: 'center',
className: 'font-14',
render: (text, record) => (
record.submitstate === "未提交" ? <span style={{color: '#9A9A9A'}}>--</span> :
record.submitstate === "未提交" ?
<span style={{textAlign: "center", cursor: "pointer"}} className="color-blue"
onClick={() => this.Adjustment(record)}>调分</span> :
<span>
<a style={{textAlign: "center"}} className="color-blue"
onMouseDown={(e) => this.Viewstudenttraininginformationtysl2(e, record)}
@ -2812,14 +2816,14 @@ class Listofworksstudentone extends Component {
this.setState({visible: false})
}
// 调分
Viewstudenttraininginformations = (e) => {
// console.log("Viewstudenttraininginformations2");
Adjustment = (e) => {
// console.log("Adjustment");
// console.log(e.myid);
this.setState({
visible: true,
userid: e.myid,
// Tune
})
}
//确定
saveModulationModal = (value, num) => {
@ -3243,7 +3247,7 @@ class Listofworksstudentone extends Component {
<div className=" clearfix " style={{margin: "auto", minWidth: "1200px"}}>
{visible === true ? <ModulationModal
visible={visible}
Cancel={this.cancelModulationModel}
Cancel={() => this.cancelModulationModel()}
Saves={(value, num) => this.saveModulationModal(value, num)}
/> : ""}

@ -72,8 +72,10 @@ class ShixunWorkReport extends Component {
})
}
}else {
this.props.showNotification(`正在下载中`);
window.open("/api"+url+'?export=true', '_blank');
this.props.slowDownload(url)
// this.props.showNotification(`正在下载中`);
// window.open("/api"+url+'?export=true', '_blank');
this.setState({ isspinning: false })
}
}).catch((error) => {

@ -38,3 +38,32 @@
color:rgba(5,16,26,1);
line-height:24px;
}
.ant-input::-webkit-input-placeholder{
color: #999;
font-size: 14px;
}
.ant-input:-moz-placeholder {
color: #999;
font-size: 14px;
}
.ant-input::-moz-placeholder{
color: #999;
font-size: 14px;
}
.ant-input:-ms-input-placeholder{
color: #999;
font-size: 14px;
}
.Searchant-btn-primary .ant-btn-primary{
background: #4CACFF;
border-color: #4CACFF;
}
.Searchant-btn-primary .ant-input-group .ant-input{
height:42px;
}

@ -1,6 +1,6 @@
import React, {Component} from 'react';
import axios from 'axios';
import {SnackbarHOC, WordsBtn,getImageUrl} from 'educoder';
import {SnackbarHOC, WordsBtn,getImageUrl,markdownToHTML} from 'educoder';
import {Row, Col,Input,Divider,Card,Button} from 'antd';
import { TPMIndexHOC } from '../tpm/TPMIndexHOC';
import { CNotificationHOC } from '../courses/common/CNotificationHOC';
@ -11,13 +11,35 @@ class Osshackathon extends Component {
constructor(props) {
super(props)
this.state = {
page:1,
limit:10,
search:undefined,
data:undefined
}
}
componentDidMount() {
this.getosshackathon();
}
getosshackathon=()=>{
let {page,limit,search}=this.state;
let url=`/osshackathon.json`;
axios.get(url,{params:{
page:page,
limit:limit,
search:search,
}}).then((result)=>{
if(result.status==200){
console.log(result)
this.setState({
data:result.data
})
}
}).catch((error)=>{
console.log(error);
})
}
componentDidUpdate = (prevProps) => {
@ -25,10 +47,21 @@ class Osshackathon extends Component {
}
render() {
// let {} = this.state;
let{data}=this.state;
console.log(this.state.data)
return (
<div className="newMain clearfix newMainybot">
<style>
{
`
.ant-btn-primary{
background: #4CACFF;
border-color: #4CACFF;
}
`
}
</style>
<div className={"educontent mb20 persmstyle"} style={{width: "1200px", marginTop: "26px"}}>
@ -37,24 +70,28 @@ class Osshackathon extends Component {
></div>
<Row className={"mt20"}>
<Col span={6}>
<Search
className={"Searchant-btn-primary"}
placeholder="请输入项目名称进行搜索"
enterButton="搜索"
size="large"
onSearch={value => console.log(value)}
/>
</Col>
<Col span={3} className={"fr textright"}>
<div>
报名整数<span className={"color-red"}>280</span>
报名整数<span className={"color-red"}>{data&&data.hackathon.hackathon_users_count}</span>
</div>
</Col>
</Row>
<Row className={"mt20"}>
<Col span={6} className={"Osshackathonfont"}>
大赛介绍
{data&&data.hackathon.name}
</Col>
<Col span={3} className={"fr textright"}>
<Button type="primary">编辑</Button>
@ -73,12 +110,18 @@ class Osshackathon extends Component {
<Divider />
<p className={"Osshackathonfontlist mb30"}>
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed nonne merninisti licere mihi ista
probare, quae sunt a te dicta? Refert tamen, quo modo.
{data&&data.hackathon.description===null?"":<div className={"markdown-body"}
dangerouslySetInnerHTML={{__html: markdownToHTML(data&&data.hackathon.description).replace(/▁/g, "▁▁▁")}}></div>}
</p>
{
data&&data.hacks.length==0?"":data&&data.hacks.map((item,key)=>{
return(
<span></span>
)
})
}
{/*学生身份*/}
<Card className={"OsshackathonCard"}>
<Card className={"OsshackathonCard mb20"}>
<Row>
<Col span={6} className={"OsshackathonCardtitle"}>

@ -222,3 +222,7 @@ TPI SSH
VNCDisplay
使用的github上的代码 https://github.com/novnc/noVNC/
tpi拖拽改变视图大小代码
js_min_all.js中搜索 doc.live('mousemove touchmove',function(e){

@ -159,9 +159,10 @@ class Modifytext extends Component {
marginTop: "24px",
}}>
<Button style={{
background: "#CDCDCD !important",
border: "0.5px solid #CDCDCD"
}} type="primary grayBtn " onClick={() => this.hideUpdating()}>取消</Button>
border: "0.5px solid #C9C9C9",
background: "#C9C9C9",
color: "#fff",
}} type="primary " onClick={() => this.hideUpdating()}>取消</Button>
<Button style={{
marginLeft: "10px",
}} type="primary" onClick={() => this.Modifytext()}>确定</Button>

@ -685,7 +685,7 @@ class PathDetailIndex extends Component{
<i className={"iconfont icon-sandian fr color999"} style={{
width: "30px",
height: "30px",
textAlign: "center",
textAlign: "right",
}}></i>
</Popover>
</div>

@ -44,6 +44,7 @@ class RealNameCertificationModal extends Component{
this.state={
identity:"teacher",
departmentsName:undefined,
fileID:undefined,
filterSchoolList:undefined,
filterDepartments :undefined,
school:undefined,
@ -269,7 +270,8 @@ class RealNameCertificationModal extends Component{
axios.post((url),{
name:values.name || basicInfo.name,
gender:parseInt(values.sex),
id_number:values.credentials
id_number:values.credentials,
attachment_ids:[this.state.fileID]
}).then((result)=>{
if(result){
this.props.showNotification("申请已提交,请等待审核!");
@ -295,7 +297,8 @@ class RealNameCertificationModal extends Component{
school_id:this.state.school_id,
department_id:this.state.department_id,
identity:this.state.identity,
extra: values.job == "student" ? values.student_No : values.job == "teacher" ? values.job1 : values.job2
extra: values.job == "student" ? values.student_No : values.job == "teacher" ? values.job1 : values.job2,
attachment_ids:[this.state.fileID]
}).then((result)=>{
if(result){
this.props.showNotification("申请已提交,请等待审核!");
@ -328,19 +331,6 @@ class RealNameCertificationModal extends Component{
this.onSendOk()
}
handleChange = (info) => {
if (info.file.status === 'uploading') {
this.setState({ loading: true });
return;
}
if (info.file.status === 'done') {
// Get this url from response in real world.
getBase64(info.file.originFileObj, imageUrl => this.setState({
imageUrl,
loading: false,
}));
}
}
handleChange2 = (info) => {
if (info.file.status === 'uploading') {
this.setState({ loading: true });
@ -348,9 +338,11 @@ class RealNameCertificationModal extends Component{
}
if (info.file.status === 'done') {
// Get this url from response in real world.
console.log(info.file.response);
getBase64(info.file.originFileObj, imageUrl2 => this.setState({
imageUrl2,
loading: false,
fileID:info.file.response && info.file.response.id
}));
}
}

Loading…
Cancel
Save