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

dev_aliyun_beta
杨树明 6 years ago
commit ac5a69d635

@ -10,7 +10,6 @@ module GitCommon
# ------------------------ # ------------------------
# 版本库目录结构 # 版本库目录结构
def repository def repository
logger.info("ssssssseeeeeeee#{params}")
begin begin
@repo_url = repo_url @repo_path @repo_url = repo_url @repo_path
@trees = GitService.file_tree(repo_path: @repo_path, path: @path) @trees = GitService.file_tree(repo_path: @repo_path, path: @path)
@ -44,4 +43,16 @@ module GitCommon
end end
end end
# 为版本库添加文件
def add_file
@path, message, content = params[:path].strip, params[:message], params[:content]
author_name, author_email = current_user.real_name, current_user.current_user.git_mail
@content = GitService.update_file(repo_path: @repo_path,
file_path: path,
message: message,
content: content,
author_name: author_name,
author_email: author_email)
end
end end

@ -890,7 +890,7 @@ class CoursesController < ApplicationController
name = worksheet.cell(row, 1).to_s name = worksheet.cell(row, 1).to_s
if @course.course_groups.where(:name => name).blank? if @course.course_groups.where(:name => name).blank?
@course.course_groups << CourseGroup.new(:name => name) @course.course_groups << CourseGroup.new(:name => name, :position => @course.course_groups_count + 1)
group_count += 1 group_count += 1
end end
end end

@ -680,8 +680,9 @@ class ExerciseQuestionsController < ApplicationController
normal_status(-1,"已发布/已截止,不允许增删答案!") normal_status(-1,"已发布/已截止,不允许增删答案!")
elsif standard_answer.present? elsif standard_answer.present?
if @exercise_question.question_type == Exercise::COMPLETION if @exercise_question.question_type == Exercise::COMPLETION
exercise_answers_text = standard_answer.map{|a| a[:answer_text]}.sum.uniq # exercise_answers_text = standard_answer.map{|a| a[:answer_text]}.sum.uniq
unless (standard_answer.count == exercise_choice_ids.count) && (standard_answers_text.count == exercise_answers_text.count) # unless (standard_answer.count == exercise_choice_ids.count) && (standard_answers_text.count == exercise_answers_text.count)
unless standard_answer.count == exercise_choice_ids.count
normal_status(-1,"已发布/已截止,不允许增删标准答案!") normal_status(-1,"已发布/已截止,不允许增删标准答案!")
end end
elsif @exercise_question.question_type == Exercise::SUBJECTIVE elsif @exercise_question.question_type == Exercise::SUBJECTIVE

@ -392,59 +392,6 @@ class GamesController < ApplicationController
end end
end end
# # 文件更新;数据评测记录
# # 生成重新评测认证码
# # content_modified:0 表示文件没有更新content_modified:1 表示文件有更新
# def file_update
# path = params[:path].strip unless params[:path].blank?
# myshixun = @game.myshixun
# rev = params[:rev] ? params[:rev] : "master"
# @content_modified = 0
# # params[:evaluate] 实训评测时更新必须给的参数,需要依据该参数做性能统计,其它类型的更新可以跳过
# # 自动保存的时候evaluate为0点评测的时候为1
# if params[:evaluate] == 1
# record = EvaluateRecord.create!(:user_id => current_user.id, :shixun_id => myshixun.shixun_id, :game_id => @game.id)
# uid_logger("-- game is #{@game.id}, record id is #{record.id}, time is **** #{Time.now.strftime("%Y-%m-%d %H:%M:%S.%L")}")
# student_work_time = format("%.3f", (Time.now.to_f - record.created_at.to_f)).to_f
# record.update_attributes!(:student_work => student_work_time)
# end
# # 远程版本库文件内容
# last_content = GitService.file_content(repo_path: @repo_path, path: path)["content"]
# last_content = tran_base64_decode64(last_content)
#
# content = if @myshixun.mirror_name.select{|a| a.include?("MachineLearning") || a.include?("Python")}.present? && params[:content].present?
# params[:content].gsub(/\t/, ' ')
# else
# params[:content]
# end
# if content != last_content
# @content_modified = 1
# code_file = @g.edit_file(myshixun.gpid, current_user.login, :content => content, :file_path => path,
# :branch_name => rev, :commit_message => params[:evaluate] == 0 ? "auto commit" : "task commit")
# uid_logger("-- file update #{code_file}")
# # REDO更新失败的处理
# raise("文件更新失败") unless code_file
# end
#
# if record.present?
# consume_time = format("%.3f", (Time.now.to_f - record.created_at.to_f)).to_f
# record.update_attributes!(:file_update => consume_time)
# end
#
# # status为2说明是重新评测
# if @game.status == 2
# code = CODES.sample(8).join
# @resubmit = "#{code}_#{@myshixun.id}"
# end
#
# if content != last_content && code_file.blank?
# raise("实训平台繁忙繁忙等级81请稍后刷新并重试")
# end
# rescue Exception => e
# uid_logger("-- file update failed #{e.message}")
# raise Educoder::TipException.new("#{e.message}")
# end
# 恢复初始代码 # 恢复初始代码
# 注意path为当前打开文件的path # 注意path为当前打开文件的path
def reset_original_code def reset_original_code

@ -901,9 +901,9 @@ class PollsController < ApplicationController
error_question = [] error_question = []
@poll_multi_questions.each do |q| @poll_multi_questions.each do |q|
poll_user_votes = current_user.poll_votes.where(poll_question_id:q.id)&.size poll_user_votes = current_user.poll_votes.where(poll_question_id:q.id)&.size
if q.max_choices.present? && (poll_user_votes > q.max_choices) if q.max_choices.present? && (q.max_choices > 0) && (poll_user_votes > q.max_choices)
error_messages = "#{q.question_number}题:超过最大选项限制" error_messages = "#{q.question_number}题:超过最大选项限制"
elsif q.min_choices.present? && (poll_user_votes < q.min_choices) elsif q.min_choices.present? && (q.min_choices > 0)&& (poll_user_votes < q.min_choices)
error_messages = "#{q.question_number}题:不得少于最小选项限制" error_messages = "#{q.question_number}题:不得少于最小选项限制"
else else
error_messages = nil error_messages = nil
@ -936,7 +936,7 @@ class PollsController < ApplicationController
def commit_result def commit_result
ActiveRecord::Base.transaction do ActiveRecord::Base.transaction do
begin begin
@poll_users = @poll.all_poll_users(current_user.id) @poll_users = @poll.all_poll_users(current_user.id).where(commit_status:1) # 问卷已提交的用户
@poll_commit_ids = @poll_users.commit_by_status(1).pluck(:user_id) #问卷提交用户的id @poll_commit_ids = @poll_users.commit_by_status(1).pluck(:user_id) #问卷提交用户的id
@page = params[:page] || 1 @page = params[:page] || 1
@limit = params[:limit] || 10 @limit = params[:limit] || 10

@ -1,6 +1,7 @@
class QuestionBanksController < ApplicationController class QuestionBanksController < ApplicationController
before_action :require_login, :check_auth before_action :require_login, :check_auth
before_action :params_filter, except: [:my_courses] before_action :params_filter, except: [:my_courses]
before_action :teacher_or_admin, except: [:bank_list]
# 题库选用列表 # 题库选用列表
# object_type: # normal 普通作业题库; group 分组作业题库; poll问卷题库 exercise试卷题库; gtask 毕设选题题库gtopic 毕设任务 # object_type: # normal 普通作业题库; group 分组作业题库; poll问卷题库 exercise试卷题库; gtask 毕设选题题库gtopic 毕设任务
@ -81,24 +82,29 @@ class QuestionBanksController < ApplicationController
def my_courses def my_courses
@courses = current_user.manage_courses.where(is_delete: 0, is_end: 0) @courses = current_user.manage_courses.where(is_delete: 0, is_end: 0)
unless params[:search].blank?
@courses = @courses.where("name like ?", "%#{params[:search].strip}%")
end
end end
def send_to_course def send_to_course
bank = current_bank banks = object_banks
course = current_user.manage_courses.find_by(id: params[:course_id]) course = current_user.manage_courses.find_by!(id: params[:course_id])
case @object_type banks.each do |bank|
when 'HomeworkBank' # 作业 case @object_type
quote_homework_bank bank, course when 'HomeworkBank' # 作业
when 'ExerciseBank' quote_homework_bank bank, course
if bank.container_type == 'Exercise' # 试卷 when 'ExerciseBank'
quote_exercise_bank bank, course if bank.container_type == 'Exercise' # 试卷
else # 问卷 quote_exercise_bank bank, course
quote_poll_bank bank, course else # 问卷
quote_poll_bank bank, course
end
when 'GtaskBank'
quote_gtask_bank bank, course
when 'GtopicBank'
quote_gtopic_bank bank, course
end end
when 'GtaskBank'
quote_gtask_bank bank, course
when 'GtopicBank'
quote_gtopic_bank bank, course
end end
normal_status("发送成功") normal_status("发送成功")
end end
@ -106,7 +112,7 @@ class QuestionBanksController < ApplicationController
def destroy def destroy
bank = current_bank bank = current_bank
unless user.admin? || bank.user_id == user.id unless current_user.admin? || bank.user_id == current_user.id
render_forbidden render_forbidden
return return
end end
@ -121,11 +127,32 @@ class QuestionBanksController < ApplicationController
render_ok render_ok
end end
def multi_delete
@objects = object_banks
@objects.destroy_all
normal_status("删除成功")
end
def multi_public
@objects = object_banks
@objects.update_all(is_public: true)
normal_status("更新成功")
end
private private
def object_banks
banks ||= @object_type.classify.constantize.where(@object_filter).where(id: params[:object_id])
unless current_user.admin?
banks = banks.where(user_id: current_user.id)
end
banks
end
def current_bank def current_bank
@_current_bank ||= @object_type.classify.constantize.where(@object_filter).find(params[:id]) @_current_bank ||= @object_type.classify.constantize.where(@object_filter).find(params[:id])
end end
def params_filter def params_filter
type = ["normal", "group", "poll", "exercise", "gtask", "gtopic"] type = ["normal", "group", "poll", "exercise", "gtask", "gtopic"]
tip_exception("object_type类型不正确") unless type.include?(params[:object_type]) tip_exception("object_type类型不正确") unless type.include?(params[:object_type])
@ -152,6 +179,10 @@ class QuestionBanksController < ApplicationController
end end
end end
def teacher_or_admin
tip_exception(403, "无权限操作") unless current_user.is_certification_teacher || current_user.admin?
end
def quote_homework_bank homework, course def quote_homework_bank homework, course
ActiveRecord::Base.transaction do ActiveRecord::Base.transaction do
# 复制作业的基本信息 # 复制作业的基本信息

@ -18,8 +18,8 @@ class Users::QuestionBanksController < Users::BaseController
def load_question_banks_solve_count def load_question_banks_solve_count
question_bank_ids = @question_banks.map(&:id) question_bank_ids = @question_banks.map(&:id)
@solve_count_map = @solve_count_map =
case params[:category] case params[:object_type]
when 'common', 'group' then when 'normal', 'group' then
StudentWork.where(is_delete: false, work_status: [1, 2, 3]).joins(:homework_common) StudentWork.where(is_delete: false, work_status: [1, 2, 3]).joins(:homework_common)
.where(homework_commons: { homework_bank_id: question_bank_ids }) .where(homework_commons: { homework_bank_id: question_bank_ids })
.group('homework_commons.homework_bank_id').count .group('homework_commons.homework_bank_id').count
@ -42,14 +42,14 @@ class Users::QuestionBanksController < Users::BaseController
end end
def query_params def query_params
params.permit(:type, :category, :course_list_id, :sort_by, :sort_direction) params.permit(:type, :object_type, :course_list_id, :sort_by, :sort_direction)
end end
def check_query_params! def check_query_params!
params[:type] = 'personal' if params[:type].blank? || !%w(personal publicly).include?(params[:type]) params[:type] = 'personal' if params[:type].blank? || !%w(personal publicly).include?(params[:type])
if params[:category].blank? || !%w(common group exercise poll gtask gtopic).include?(params[:category]) if params[:object_type].blank? || !%w(normal group exercise poll gtask gtopic).include?(params[:object_type])
params[:category] = 'common' params[:object_type] = 'normal'
end end
if params[:sort_by].blank? || !%w(updated_at name contributor).include?(params[:sort_by]) if params[:sort_by].blank? || !%w(updated_at name contributor).include?(params[:sort_by])

@ -22,8 +22,8 @@ class Users::QuestionBankService
course_lists = CourseList.joins(relation_name).where.not(relation_name => { id: nil }) course_lists = CourseList.joins(relation_name).where.not(relation_name => { id: nil })
category_condition = category_condition =
case params[:category] case params[:object_type]
when 'common' then { homework_type: 1 } when 'normal' then { homework_type: 1 }
when 'group' then { homework_type: 3 } when 'group' then { homework_type: 3 }
when 'exercise' then { container_type: 'Exercise' } when 'exercise' then { container_type: 'Exercise' }
when 'poll' then { container_type: 'Poll' } when 'poll' then { container_type: 'Poll' }
@ -47,8 +47,8 @@ class Users::QuestionBankService
def class_name def class_name
@_class_name ||= begin @_class_name ||= begin
case params[:category] case params[:object_type]
when 'common', 'group' then 'HomeworkBank' when 'normal', 'group' then 'HomeworkBank'
when 'exercise', 'poll' then 'ExerciseBank' when 'exercise', 'poll' then 'ExerciseBank'
when 'gtask' then 'GtaskBank' when 'gtask' then 'GtaskBank'
when 'gtopic' then 'GtopicBank' when 'gtopic' then 'GtopicBank'
@ -58,8 +58,8 @@ class Users::QuestionBankService
end end
def category_filter(relations) def category_filter(relations)
case params[:category] case params[:object_type]
when 'common' then when 'normal' then
relations.where(homework_type: 1) relations.where(homework_type: 1)
when 'group' then when 'group' then
relations.where(homework_type: 3) relations.where(homework_type: 3)

@ -17,15 +17,16 @@
</td> </td>
<td> <td>
<!-- 图片上传,稍后添加--> <!-- 图片上传,稍后添加-->
--
<a href="javascript:void(0);" id="object_upload_img_<%= shixun.id %>" onclick="$('#upload_img_<%= shixun.id %>').click();"> <!-- <a href="javascript:void(0);" id="object_upload_img_<%#= shixun.id %>" onclick="$('#upload_img_<%= shixun.id %>').click();">-->
<%= File.exist?(disk_filename("Shixun",shixun.id)) ? "重新上传" : "上传图片" %> <%#= File.exist?(disk_filename("Shixun",shixun.id)) ? "重新上传" : "上传图片" %>
</a> <!-- </a>-->
<% if File.exist?(disk_filename("Shixun",shixun.id)) %> <%# if File.exist?(disk_filename("Shixun",shixun.id)) %>
<%= image_tag(url_to_avatar(shixun), :class => "w80 h80 fl ml5 shixun_image_show", :id => "shixun_image_show_#{shixun.id}") %> <%#= image_tag(url_to_avatar(shixun), :class => "w80 h80 fl ml5 shixun_image_show", :id => "shixun_image_show_#{shixun.id}") %>
<% else %> <%# else %>
<img src="" class="w80 h80 fl ml5 shixun_image_show none" id="shixun_image_show_<%= shixun.id %>"/> <!-- <img src="" class="w80 h80 fl ml5 shixun_image_show none" id="shixun_image_show_<%#= shixun.id %>"/>-->
<% end %> <%# end %>
</td> </td>
<td><%= link_to shixun.owner.try(:show_real_name),"/users/#{shixun.owner.login}",target:'_blank' %></td> <td><%= link_to shixun.owner.try(:show_real_name),"/users/#{shixun.owner.login}",target:'_blank' %></td>

@ -31,6 +31,11 @@ else
json.question_status @question_status json.question_status @question_status
end end
exercise_type = 3
if @t_user_exercise_status == 3 && @exercise.answer_open
exercise_type = 4
end
json.partial! "exercises/exercise_scores" json.partial! "exercises/exercise_scores"
json.exercise_questions do json.exercise_questions do
@ -57,7 +62,7 @@ json.exercise_questions do
shixun_challenges: question.exercise_shixun_challenges, shixun_challenges: question.exercise_shixun_challenges,
user_answer: question_info[:answered_content], user_answer: question_info[:answered_content],
choices:question.exercise_choices, choices:question.exercise_choices,
exercise_type:3, exercise_type:exercise_type,
shixun_type:question_info[:shixun_type], shixun_type:question_info[:shixun_type],
ques_position: q[:ques_number], ques_position: q[:ques_number],
edit_type:nil edit_type:nil

@ -14,7 +14,7 @@ if @poll_questions_count > 0
json.array! @poll_questions do |question| json.array! @poll_questions do |question|
json.partial! "polls/commit_answers_result", question: question, json.partial! "polls/commit_answers_result", question: question,
answers:question.poll_answers, answers:question.poll_answers,
question_votes:question.poll_votes #问题的全部答案 question_votes:question.poll_votes.where(user_id:@poll_commit_ids) #问题的全部答案
end end
end end
else else

@ -0,0 +1,2 @@
json.content @content
json.path @path

@ -632,6 +632,8 @@ Rails.application.routes.draw do
post :save_banks post :save_banks
get :my_courses get :my_courses
post :send_to_course post :send_to_course
delete :multi_delete
post :multi_public
end end
end end

@ -0,0 +1,11 @@
class MigrateCourseGroupPosition < ActiveRecord::Migration[5.2]
def change
Course.all.each do |course|
if course.course_groups.exists?(position: 0)
course.course_groups.each_with_index do |group, index|
group.update_attributes(position: index+1)
end
end
end
end
end

File diff suppressed because one or more lines are too long

@ -38362,46 +38362,37 @@ $(document).on('turbolinks:load', function() {
; ;
$(document).on('turbolinks:load', function() { $(document).on('turbolinks:load', function() {
if ($('body.admins-shixun-settings-index-page').length > 0) { if ($('body.admins-shixun-settings-index-page').length > 0) {
$(".shixun-settings-select").on("change", function () {
var s_value = $(this).val();
var s_name = $(this).attr("name");
var json = {};
json[s_name] = s_value;
$.ajax({
url: "/admins/shixun_settings",
type: "GET",
dataType:'script',
data: json
})
});
$(".shixun-setting-form").on("change",function () {
var s_id = $(this).attr("data-id");
var s_value = $(this).val();
var s_name = $(this).attr("name");
var json = {};
var s_index = $(this).parent("td").siblings(".shixun-line-no").text();
json[s_name] = s_value;
json["page_no"] = s_index;
$.ajax({
url: "/admins/shixun_settings/" + s_id,
type: "PUT",
dataType:'script',
data: json
})
})
} }
}); });
function update_change(target) {
var s_id = $(target).attr("data-id");
var s_value = $(target).val();
var s_name = $(target).attr("name");
var json = {};
var s_index = $(target).parent("td").siblings(".shixun-line-no").text();
json[s_name] = s_value;
json["page_no"] = s_index;
$.ajax({
url: "/admins/shixun_settings/" + s_id,
type: "PUT",
dataType:'script',
data: json,
success: function (data) {
}
})
}
function select_change(target) {
var s_value = $(target).val();
var s_name = $(target).attr("name");
var json = {};
json[s_name] = s_value;
$.ajax({
url: "/admins/shixun_settings/",
type: "GET",
dataType:'script',
data: json,
success: function (data) {
}
})
}
;
$(document).on('turbolinks:load', function() { $(document).on('turbolinks:load', function() {
$('select#tag-choosed').select2({ $('select#tag-choosed').select2({
placeholder: "请选择分类", placeholder: "请选择分类",

@ -18726,6 +18726,13 @@ input[type="checkbox"] {
border: 1px solid #eee !important; border: 1px solid #eee !important;
} }
/* line 10, app/assets/stylesheets/admins/shixun_settings.scss */
.setting-chosen {
font-weight: 400;
font-size: 10px;
color: #333;
}
/* line 1, app/assets/stylesheets/admins/sidebar.scss */ /* line 1, app/assets/stylesheets/admins/sidebar.scss */
#sidebar { #sidebar {
min-width: 200px; min-width: 200px;

@ -38362,46 +38362,37 @@ $(document).on('turbolinks:load', function() {
; ;
$(document).on('turbolinks:load', function() { $(document).on('turbolinks:load', function() {
if ($('body.admins-shixun-settings-index-page').length > 0) { if ($('body.admins-shixun-settings-index-page').length > 0) {
$(".shixun-settings-select").on("change", function () {
var s_value = $(this).val();
var s_name = $(this).attr("name");
var json = {};
json[s_name] = s_value;
$.ajax({
url: "/admins/shixun_settings",
type: "GET",
dataType:'script',
data: json
})
});
$(".shixun-setting-form").on("change",function () {
var s_id = $(this).attr("data-id");
var s_value = $(this).val();
var s_name = $(this).attr("name");
var json = {};
var s_index = $(this).parent("td").siblings(".shixun-line-no").text();
json[s_name] = s_value;
json["page_no"] = s_index;
$.ajax({
url: "/admins/shixun_settings/" + s_id,
type: "PUT",
dataType:'script',
data: json
})
})
} }
}); });
function update_change(target) {
var s_id = $(target).attr("data-id");
var s_value = $(target).val();
var s_name = $(target).attr("name");
var json = {};
var s_index = $(target).parent("td").siblings(".shixun-line-no").text();
json[s_name] = s_value;
json["page_no"] = s_index;
$.ajax({
url: "/admins/shixun_settings/" + s_id,
type: "PUT",
dataType:'script',
data: json,
success: function (data) {
}
})
}
function select_change(target) {
var s_value = $(target).val();
var s_name = $(target).attr("name");
var json = {};
json[s_name] = s_value;
$.ajax({
url: "/admins/shixun_settings/",
type: "GET",
dataType:'script',
data: json,
success: function (data) {
}
})
}
;
$(document).on('turbolinks:load', function() { $(document).on('turbolinks:load', function() {
$('select#tag-choosed').select2({ $('select#tag-choosed').select2({
placeholder: "请选择分类", placeholder: "请选择分类",

@ -18726,6 +18726,13 @@ input[type="checkbox"] {
border: 1px solid #eee !important; border: 1px solid #eee !important;
} }
/* line 10, app/assets/stylesheets/admins/shixun_settings.scss */
.setting-chosen {
font-weight: 400;
font-size: 10px;
color: #333;
}
/* line 1, app/assets/stylesheets/admins/sidebar.scss */ /* line 1, app/assets/stylesheets/admins/sidebar.scss */
#sidebar { #sidebar {
min-width: 200px; min-width: 200px;
@ -19421,6 +19428,13 @@ input[type="checkbox"] {
.select2 .select2-selection__choice { .select2 .select2-selection__choice {
border: 1px solid #eee !important; border: 1px solid #eee !important;
} }
/* line 10, app/assets/stylesheets/admins/shixun_settings.scss */
.setting-chosen {
font-weight: 400;
font-size: 10px;
color: #333;
}
/* line 1, app/assets/stylesheets/admins/sidebar.scss */ /* line 1, app/assets/stylesheets/admins/sidebar.scss */
#sidebar { #sidebar {
min-width: 200px; min-width: 200px;

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

@ -55,6 +55,9 @@ html, body {
.markdown-body p { .markdown-body p {
white-space: pre-wrap; white-space: pre-wrap;
} }
.markdown-body > p {
line-height: 25px;
}
/* https://www.educoder.net/courses/2346/group_homeworks/34405/question */ /* https://www.educoder.net/courses/2346/group_homeworks/34405/question */
.renderAsHtml.markdown-body p { .renderAsHtml.markdown-body p {
white-space: inherit; white-space: inherit;

@ -1566,7 +1566,7 @@ samp {
padding-left: 5px; padding-left: 5px;
} }
.padding10200{ .padding10200{
padding: 10px 20px 0px; padding: 10px 20px;
} }
.padding1020{ .padding1020{
padding: 10px 20px 10px; padding: 10px 20px 10px;

@ -129,7 +129,7 @@ class fillEmpty extends Component{
} }
{ {
// 答案公开,且试卷已经截止 // 答案公开,且试卷已经截止
isAdmin && questionType.standard_answer &&
<div> <div>
<p className="bor-top-greyE pt20 mt20 font-16 mb10">参考答案</p> <p className="bor-top-greyE pt20 mt20 font-16 mb10">参考答案</p>
{ questionType.standard_answer && questionType.standard_answer.map((item,k)=>{ { questionType.standard_answer && questionType.standard_answer.map((item,k)=>{

@ -85,9 +85,9 @@ class simpleAnswer extends Component{
</div> </div>
} }
{ {
isStudent && exercise.answer_open==true && exercise.exercise_status == 3 ? isStudent && questionType.standard_answer ?
<div className="bor-top-greyE pt20 mt20 standardAnswer"> <div className="bor-top-greyE pt20 mt20 standardAnswer">
<p>参考答案</p> <p className="mb10 font-16">参考答案</p>
{/* <li className="markdown-body answerStyle" dangerouslySetInnerHTML={{__html: markdownToHTML1(questionType.standard_answer && questionType.standard_answer[0])}}></li> */} {/* <li className="markdown-body answerStyle" dangerouslySetInnerHTML={{__html: markdownToHTML1(questionType.standard_answer && questionType.standard_answer[0])}}></li> */}
<MarkdownToHtml content={questionType.standard_answer && questionType.standard_answer[0]} selector={'simgle_standard2_' + (this.props.index + 1)} <MarkdownToHtml content={questionType.standard_answer && questionType.standard_answer[0]} selector={'simgle_standard2_' + (this.props.index + 1)}
className="answerStyle" className="answerStyle"

@ -152,16 +152,16 @@ class studentsList extends Component{
} }
}else { }else {
this.props.showNotification(`正在下载中`); this.props.showNotification(`正在下载中`);
// window.open("/api"+url, '_blank'); window.open("/api"+url, '_blank');
downloadFile({ // downloadFile({
url: url, // url: url,
successCallback: (url) => { // successCallback: (url) => {
console.log('successCallback') // console.log('successCallback')
}, // },
failCallback: (responseHtml, url) => { // failCallback: (responseHtml, url) => {
console.log('failCallback') // console.log('failCallback')
} // }
}) // })
} }
}).catch((error) => { }).catch((error) => {
console.log(error) console.log(error)
@ -606,13 +606,13 @@ class studentsList extends Component{
<li className="li_line drop_down fr color-blue font-16"> <li className="li_line drop_down fr color-blue font-16">
导出<i className="iconfont icon-xiajiantou font-12 ml2"></i> 导出<i className="iconfont icon-xiajiantou font-12 ml2"></i>
<ul className="drop_down_menu" style={{"right": "-20px", "left": "unset", "height": "auto"}}> <ul className="drop_down_menu" style={{"right": "-20px", "left": "unset", "height": "auto"}}>
<li onClick={(i) => this.confirmysl(exportUrltwo)}><a <li><a
onClick={(i) => this.confirmysl(exportUrltwo)}>课堂信息</a> onClick={(i) => this.confirmysl(exportUrltwo)}>课堂信息</a>
</li> </li>
<li onClick={(i) => this.confirmysl(exportUrlthree)}><a <li><a
onClick={(i) => this.confirmysl(exportUrlthree)}>活跃度</a> onClick={(i) => this.confirmysl(exportUrlthree)}>活跃度</a>
</li> </li>
<li onClick={(i) => this.confirmysl(exportUrl)}><a <li><a
onClick={(i) => this.confirmysl(exportUrl)}>总成绩</a> onClick={(i) => this.confirmysl(exportUrl)}>总成绩</a>
</li> </li>
</ul> </ul>

@ -606,7 +606,7 @@ class CoursesNew extends Component {
`} `}
</style> </style>
<div className="stud-class-set bor-bottom-greyE padding10200 "> <div className="stud-class-set bor-bottom-greyE padding1020 ">
<div className={"TabsWarpcourse"}> <div className={"TabsWarpcourse"}>
<style>{ <style>{
` `
@ -624,21 +624,7 @@ class CoursesNew extends Component {
background-color: #fafafa!important; background-color: #fafafa!important;
} }
.yslzxueshis .ant-select-dropdown{
width: 655px !important;
height:160px !important;
}
.yslzxueshisy .ant-select-dropdown{
width: 655px !important;
height:160px !important;
}
.yslzxueshis .ant-select-dropdown-menu{
width: 655px !important;
}
.ant-select-dropdown{
width: 655px !important;
height:160px !important;
}
` `
}</style> }</style>
<Form.Item label="课程名称"> <Form.Item label="课程名称">
@ -647,7 +633,7 @@ class CoursesNew extends Component {
})( })(
<AutoComplete <AutoComplete
style={{ width: 720}} style={{ width: 704}}
onSearch={this.handleSearch} onSearch={this.handleSearch}
onSelect={this.handleSearchsysl} onSelect={this.handleSearchsysl}
className="fl construction yslzxueshis " className="fl construction yslzxueshis "
@ -693,7 +679,7 @@ class CoursesNew extends Component {
} }
.yslzxueshiskmc .ant-input-group{ .yslzxueshiskmc .ant-input-group{
width: 720px !important; width: 704px !important;
} }
.yslzxueshisy span .ant-input-group-addon{ .yslzxueshisy span .ant-input-group-addon{
width: 65px !important; width: 65px !important;
@ -704,10 +690,10 @@ class CoursesNew extends Component {
background-color: #fafafa!important; background-color: #fafafa!important;
} }
.yslzxueshiskmc .ant-input-group-wrapper{ .yslzxueshiskmc .ant-input-group-wrapper{
width: 720px !important; width: 704px !important;
} }
.yslzxueshiskmcs .ant-input-group-wrapper{ .yslzxueshiskmcs .ant-input-group-wrapper{
width: 720px !important; width: 704px !important;
} }
` `
}</style> }</style>
@ -884,7 +870,7 @@ class CoursesNew extends Component {
<AutoComplete style={{ width: 280 }} <AutoComplete style={{ width: 280 }}
onSearch={this.handleSearchschool} onSearch={this.handleSearchschool}
// onChange={this.handleChangeschools} // onChange={this.handleChangeschools}
className={"fl construction mr10 "} className={"fl construction mr10 yslzxueshis2"}
placeholder="请输入并选择课本堂的所属单位" placeholder="请输入并选择课本堂的所属单位"
> >
{optionschool} {optionschool}

@ -794,18 +794,7 @@ class Goldsubject extends Component {
width: 65px !important; width: 65px !important;
background-color: #fafafa!important; background-color: #fafafa!important;
} }
.yslzxueshis .ant-select-dropdown{
width: 655px !important;
height:160px !important;
}
.yslzxueshis .ant-select-dropdown-menu{
width: 655px !important;
}
.ant-select-dropdown{
width: 655px !important;
height:160px !important;
}
` `
}</style> }</style>
<style> <style>
@ -828,7 +817,7 @@ class Goldsubject extends Component {
})( })(
<AutoComplete <AutoComplete
style={{width: 720}} style={{width: 704}}
onSearch={this.handleSearch} onSearch={this.handleSearch}
className={"fl construction yslzxueshis "} className={"fl construction yslzxueshis "}
dataSource={options} dataSource={options}
@ -1029,6 +1018,7 @@ class Goldsubject extends Component {
{/*</div>*/} {/*</div>*/}
<div className="stud-class-set padding10200 mb20"> <div className="stud-class-set padding10200 mb20">
<Form.Item label="课堂所属单位"> <Form.Item label="课堂所属单位">
{getFieldDecorator('school', { {getFieldDecorator('school', {
rules: [{required: true, message: "不能为空"}], rules: [{required: true, message: "不能为空"}],
@ -1036,7 +1026,7 @@ class Goldsubject extends Component {
<AutoComplete style={{ width: 280 }} <AutoComplete style={{ width: 280 }}
onSearch={this.handleSearchschool} onSearch={this.handleSearchschool}
// onChange={this.handleChangeschools} // onChange={this.handleChangeschools}
className={"fl construction mr10 "} className={"fl construction mr10 yslzxueshis2 "}
placeholder="请输入并选择课本堂的所属单位" placeholder="请输入并选择课本堂的所属单位"
> >
{optionschool} {optionschool}

@ -66,12 +66,14 @@ class PollDetailTabThird extends Component{
{ {
pollDetail && pollDetail.questions.map((item,key)=>{ pollDetail && pollDetail.questions.map((item,key)=>{
console.log("ddd");
console.log(item.question.min_choices);
return( return(
<div className="previewList"> <div className="previewList">
<p className="pl30 pr30 pt30 pb15 font-16 clearfix"> <p className="pl30 pr30 pt30 pb15 font-16 clearfix">
<span className="color-blue mr8 fl">{item.question.question_number}{map[item.question.question_type]}</span> <span className="color-blue mr8 fl">{item.question.question_number}{map[item.question.question_type]}</span>
{ item.question.is_necessary==1 ? <span className="mustAnswer fl ml10 mr10">必答</span>:<span className="mustAnswer fl ml10 mr10"></span> } { item.question.is_necessary==1 ? <span className="mustAnswer fl ml10 mr10">必答</span>:<span className="mustAnswer fl ml10 mr10"></span> }
{ item.question.question_type == 2 && item.question.min_choices && item.question.max_choices ? { item.question.question_type == 2 && item.question.min_choices != undefined && item.question.min_choices != null && item.question.max_choices != undefined && item.question.max_choices != null ?
<span className="color-grey-9 font-14 fl mt2"> <span className="color-grey-9 font-14 fl mt2">
{ {
item.question.min_choices == item.question.max_choices ? "可选"+item.question.max_choices+"项" : item.question.min_choices == item.question.max_choices ? "可选"+item.question.max_choices+"项" :

@ -54,7 +54,7 @@ class PollListItem extends Component{
} }
</p> </p>
<p className="color-grey-9 clearfix"> <p className="color-grey-9 clearfix">
{ item.author && <span className="mr20 fl">{item.author}</span> } { item.author && <span className="mr20 fl mt3">{item.author}</span> }
{ {
item.polls_status !=1 && item.polls_status !=1 &&
<span className="fl mt3"> <span className="fl mt3">

@ -2123,7 +2123,7 @@ class PollNew extends Component {
//最小值 //最小值
HandleGradationGroupChangee = (value, index, max, length) => { HandleGradationGroupChangee = (value, index, max, length) => {
// debugger
var minbool = false; var minbool = false;
var maxbool = false; var maxbool = false;
let arr = this.state.adddom; let arr = this.state.adddom;

Loading…
Cancel
Save