diff --git a/app/controllers/exercise_banks_controller.rb b/app/controllers/exercise_banks_controller.rb index dafaf131e..ce6259c19 100644 --- a/app/controllers/exercise_banks_controller.rb +++ b/app/controllers/exercise_banks_controller.rb @@ -74,7 +74,7 @@ class ExerciseBanksController < ApplicationController #判断实训是否已选择 def commit_shixun_present - question_shixun_ids = @exercise.exercise_bank_questions.pluck(:shixun_id).reject(&:blank?) + question_shixun_ids = @bank.exercise_bank_questions.pluck(:shixun_id).reject(&:blank?) shixun_id = params[:shixun_id] @shixun = Shixun.find_by(id: shixun_id) if shixun_id.present? && question_shixun_ids.include?(shixun_id) @@ -85,45 +85,47 @@ class ExerciseBanksController < ApplicationController end def get_exercise_question_count - @exercise_ques_count = @exercise_questions.size # 全部的题目数 - @exercise_ques_scores = @exercise_questions.pluck(:question_score).sum + exercise_questions = @bank.exercise_bank_questions + @exercise_ques_count = exercise_questions.size # 全部的题目数 + @exercise_ques_scores = exercise_questions.pluck(:question_score).sum #单选题的数量及分数 - exercise_single_ques = @exercise_questions.find_by_custom("question_type", Exercise::SINGLE) + exercise_single_ques = exercise_questions.find_by_custom("question_type", Exercise::SINGLE) @exercise_single_ques_count = exercise_single_ques.size @exercise_single_ques_scores = exercise_single_ques.pluck(:question_score).sum #多选题的数量及分数 - exercise_double_ques = @exercise_questions.find_by_custom("question_type", Exercise::MULTIPLE) + exercise_double_ques = exercise_questions.find_by_custom("question_type", Exercise::MULTIPLE) @exercise_double_ques_count = exercise_double_ques.size @exercise_double_ques_scores = exercise_double_ques.pluck(:question_score).sum # 判断题数量及分数 - exercise_ques_judge = @exercise_questions.find_by_custom("question_type", Exercise::JUDGMENT) + exercise_ques_judge = exercise_questions.find_by_custom("question_type", Exercise::JUDGMENT) @exercise_ques_judge_count = exercise_ques_judge.size @exercise_ques_judge_scores = exercise_ques_judge.pluck(:question_score).sum #填空题数量及分数 - exercise_ques_null = @exercise_questions.find_by_custom("question_type", Exercise::COMPLETION) + exercise_ques_null = exercise_questions.find_by_custom("question_type", Exercise::COMPLETION) @exercise_ques_null_count = exercise_ques_null.size @exercise_ques_null_scores = exercise_ques_null.pluck(:question_score).sum #简答题数量及分数 - exercise_ques_main = @exercise_questions.find_by_custom("question_type", Exercise::SUBJECTIVE) + exercise_ques_main = exercise_questions.find_by_custom("question_type", Exercise::SUBJECTIVE) @exercise_ques_main_count = exercise_ques_main.size @exercise_ques_main_scores = exercise_ques_main.pluck(:question_score).sum #实训题数量及分数 - exercise_ques_shixun = @exercise_questions.find_by_custom("question_type", Exercise::PRACTICAL) + exercise_ques_shixun = exercise_questions.find_by_custom("question_type", Exercise::PRACTICAL) @exercise_ques_shixun_count = exercise_ques_shixun.size @exercise_ques_shixun_scores = exercise_ques_shixun.pluck(:question_score).sum end def get_poll_question_count - @poll_questions_count = @exercise_questions&.size # 全部的题目数 - @poll_question_singles = @exercise_questions.find_by_custom("question_type", 1).size # 单选题 - @poll_question_doubles = @exercise_questions.find_by_custom("question_type", 2).size # 多选题 - @poll_question_mains = @exercise_questions.find_by_custom("question_type", 3).size #主观题 + exercise_questions = @bank.exercise_bank_questions + @poll_questions_count = exercise_questions&.size # 全部的题目数 + @poll_question_singles = exercise_questions.find_by_custom("question_type", 1).size # 单选题 + @poll_question_doubles = exercise_questions.find_by_custom("question_type", 2).size # 多选题 + @poll_question_mains = exercise_questions.find_by_custom("question_type", 3).size #主观题 end end diff --git a/app/controllers/games_controller.rb b/app/controllers/games_controller.rb index 2807a0215..940db2883 100644 --- a/app/controllers/games_controller.rb +++ b/app/controllers/games_controller.rb @@ -59,7 +59,7 @@ class GamesController < ApplicationController record_onsume_time: record_onsume_time, prev_game: prev_game, next_game: next_game, praise_count: praise_count, user_praise: user_praise, time_limit: time_limit, tomcat_url: edu_setting('cloud_tomcat_php'), is_teacher: is_teacher, - myshixun_manager: myshixun_manager} + myshixun_manager: myshixun_manager, git_url: (@shixun.vnc ? repo_url(@myshixun.repo_path) : "")} if @shixun.vnc begin shixun_tomcat = edu_setting('cloud_bridge') diff --git a/app/controllers/homework_banks_controller.rb b/app/controllers/homework_banks_controller.rb index 7e10509ba..7bdf425bf 100644 --- a/app/controllers/homework_banks_controller.rb +++ b/app/controllers/homework_banks_controller.rb @@ -57,8 +57,8 @@ class HomeworkBanksController < ApplicationController tip_exception("description参数不能为空") if params[:homework_bank][:description].blank? if @bank.homework_type == 3 tip_exception("base_on_project参数不能为空") if params[:homework_bank][:base_on_project].nil? - tip_exception("min_num参数不能为空") if params[:homework_bank][:min_num].blank? - tip_exception("max_num参数不能为空") if params[:homework_bank][:max_num].blank? + tip_exception("最小人数不能为空") if params[:homework_bank][:min_num].blank? + tip_exception("最大人数参数不能为空") if params[:homework_bank][:max_num].blank? tip_exception("最小人数不能小于1") if params[:homework_bank][:min_num].to_i < 1 tip_exception("最大人数不能小于最小人数") if params[:homework_bank][:max_num].to_i < params[:homework_bank][:min_num].to_i end diff --git a/app/controllers/student_works_controller.rb b/app/controllers/student_works_controller.rb index 7eef670fc..526535157 100644 --- a/app/controllers/student_works_controller.rb +++ b/app/controllers/student_works_controller.rb @@ -475,7 +475,7 @@ class StudentWorksController < ApplicationController # 实训作品的评阅 def shixun_work_comment tip_exception("评阅不能为空") if params[:comment].blank? - tip_exception("缺少is_hidden参数") if params[:is_hidden].blank? || ![true, false].include?(params[:is_hidden]) + tip_exception("缺少is_hidden参数") if params[:is_hidden].blank? || ![1, 0].include?(params[:is_hidden]) comment = @work.student_works_scores.shixun_comment.first || StudentWorksScore.new(student_work_id: @work.id, user_id: current_user.id) comment.comment = params[:comment] comment.is_hidden = params[:is_hidden] diff --git a/app/services/users/question_bank_service.rb b/app/services/users/question_bank_service.rb index 66dff2117..dbaa92e6e 100644 --- a/app/services/users/question_bank_service.rb +++ b/app/services/users/question_bank_service.rb @@ -85,7 +85,7 @@ class Users::QuestionBankService def custom_sort(relations, sort_by, sort_direction) case sort_by when 'updated_at' then - relations.order("updated_at #{sort_direction}, id desc") + relations.order("updated_at #{sort_direction}, id #{sort_direction}") when 'name' then relations.order("CONVERT(name USING gbk) COLLATE gbk_chinese_ci #{sort_direction}") when 'contributor' then diff --git a/app/views/games/show.json.jbuilder b/app/views/games/show.json.jbuilder index 607a57a15..28d8bb859 100644 --- a/app/views/games/show.json.jbuilder +++ b/app/views/games/show.json.jbuilder @@ -1,6 +1,6 @@ json.(@base_date, :st, :discusses_count, :game_count, :record_onsume_time, :prev_game, :next_game, :praise_count, :user_praise, :time_limit, :tomcat_url, :is_teacher, :myshixun_manager, :game, :challenge, - :shixun, :myshixun) + :shixun, :myshixun, :git_url) if @shixun.vnc json.vnc_url @vnc_url end diff --git a/app/views/student_works/shixun_work_report.json.jbuilder b/app/views/student_works/shixun_work_report.json.jbuilder index 0b5e4da45..29a5c1874 100644 --- a/app/views/student_works/shixun_work_report.json.jbuilder +++ b/app/views/student_works/shixun_work_report.json.jbuilder @@ -54,7 +54,7 @@ if @shixun json.passed_time @work.myshixun&.passed_time # 评阅信息 - json.work_comment @user_course_identity < Course::STUDENT ? @comment&.comment : nil + json.work_comment @user_course_identity < Course::STUDENT || !@comment&.is_hidden ? @comment&.comment : nil json.work_comment_hidden @comment&.is_hidden # 图形统计 diff --git a/app/views/users/question_banks/index.json.jbuilder b/app/views/users/question_banks/index.json.jbuilder index d5c580982..018e78254 100644 --- a/app/views/users/question_banks/index.json.jbuilder +++ b/app/views/users/question_banks/index.json.jbuilder @@ -1,6 +1,9 @@ json.count @count -json.course_list @course_lists, partial: 'users/question_banks/shared/course_list', as: :course_list +json.course_list @course_lists do |course_list| + json.id course_list.id + json.name course_list.name +end json.question_banks @question_banks do |question_bank| json.id question_bank.id diff --git a/public/react/config/webpack.config.dev.js b/public/react/config/webpack.config.dev.js index 1adf3aef9..15bba890a 100644 --- a/public/react/config/webpack.config.dev.js +++ b/public/react/config/webpack.config.dev.js @@ -32,7 +32,7 @@ module.exports = { // See the discussion in https://github.com/facebookincubator/create-react-app/issues/343.s // devtool: "cheap-module-eval-source-map", // 开启调试 - // devtool: "source-map", // 开启调试 + //devtool: "source-map", // 开启调试 // These are the "entry points" to our application. // This means they will be the "root" imports that are included in JS bundle. // The first two entry points enable "hot" CSS and auto-refreshes for JS. diff --git a/public/react/src/modules/courses/coursesPublic/AppraiseModal.js b/public/react/src/modules/courses/coursesPublic/AppraiseModal.js new file mode 100644 index 000000000..fc9427d27 --- /dev/null +++ b/public/react/src/modules/courses/coursesPublic/AppraiseModal.js @@ -0,0 +1,146 @@ +import React,{ Component } from "react"; +import { Modal,Checkbox,Upload,Button,Icon,message,Input,Radio} from "antd"; +import { WordNumberTextarea } from 'educoder'; +import axios from 'axios'; + +class AppraiseModal extends Component{ + constructor(props){ + super(props); + this.state={ + group_ids:[], + fileList:[], + textareaval:undefined, + Inputsval:undefined, + valuetype:0, + textareavaltype:false + } + } + + componentDidMount() { + + this.setState({ + valuetype:this.props.work_type===undefined?0:this.props.work_type, + textareaval:this.props.work_comment, + }) + + } + + onChanges=(e)=>{ + this.setState({ + valuetype:e.target.value + }) + } + + settextarea=(e)=>{ + this.setState({ + textareaval:e.target.value + }) + } + + Saves=()=>{ + let{textareaval,valuetype}=this.state; + + if(textareaval===undefined||textareaval===null||textareaval===""){ + this.setState({ + textareavaltype:true + }) + return + } + + let url=`/student_works/${this.props.match.params.homeworkid}/shixun_work_comment.json` + axios.post(url, { + comment:textareaval, + is_hidden:valuetype + }).then((response) => { + if(response.data.status===0){ + this.props.showNotification(response.data.message) + this.props.showCancel(textareaval,valuetype) + }else{ + this.props.showNotification(response.data.message) + } + }).catch((error) => { + console.log(error) + }); + } + + render(){ + let {textareaval,Inputsval,textareavaltype,Inputsvaltype}=this.state; + const radioStyle = { + display: 'block', + height: '30px', + lineHeight: '30px', + }; + + return( +
+ + +
+ +
+

+ 权限: +

+ + 可见 (学生查看老师的评阅内容) + 不可见 (仅对课堂老师可见) + + +

+ 内容: +

+ this.settextarea(e)} + value={textareaval} + maxlength={500} + /> + +
  • 评阅内容不能为空
  • +
    + +
    + this.props.Cancel()}>{this.props.Cancelname || '取消'} + {this.props.Savesname || '确定'} +
    +
    +
    +
    + ) + } +} +export default AppraiseModal; \ No newline at end of file diff --git a/public/react/src/modules/courses/css/Courses.css b/public/react/src/modules/courses/css/Courses.css index d0a43af9e..72ea16378 100644 --- a/public/react/src/modules/courses/css/Courses.css +++ b/public/react/src/modules/courses/css/Courses.css @@ -848,7 +848,7 @@ a.white-btn.use_scope-btn:hover{ font-family: MicrosoftYaHei; font-weight: 400; color: rgba(51,51,51,1); - cursor: pointer; + /*cursor: pointer;*/ max-width: 825px; overflow: hidden; text-overflow: ellipsis; diff --git a/public/react/src/modules/courses/members/studentsList.js b/public/react/src/modules/courses/members/studentsList.js index 47d387e5d..e82d417c2 100644 --- a/public/react/src/modules/courses/members/studentsList.js +++ b/public/react/src/modules/courses/members/studentsList.js @@ -355,12 +355,12 @@ class studentsList extends Component{ searchValue: e.target.value }) - if (this.timeoutHandler) { - clearTimeout(this.timeoutHandler) - } - this.timeoutHandler = setTimeout(() => { - this.fetchAll(1) - }, 1200) + // if (this.timeoutHandler) { + // clearTimeout(this.timeoutHandler) + // } + // this.timeoutHandler = setTimeout(() => { + // this.fetchAll(1) + // }, 1200) } onSortTypeChange = (order) => { this.setState({ order: order }, () => { diff --git a/public/react/src/modules/courses/poll/PollNew.js b/public/react/src/modules/courses/poll/PollNew.js index c95ff844e..c944da4ef 100644 --- a/public/react/src/modules/courses/poll/PollNew.js +++ b/public/react/src/modules/courses/poll/PollNew.js @@ -19,7 +19,7 @@ const CheckboxGroup = Checkbox.Group const Option = Select.Option; const maps = {1: "未发布", 2: "提交中", 3: "已截止"} const confirm = Modal.confirm; - +const $ = window.$; class PollNew extends Component { // 问卷新建和编辑 // diff --git a/public/react/src/modules/courses/shixunHomework/Listofworksstudentone.js b/public/react/src/modules/courses/shixunHomework/Listofworksstudentone.js index bba76386a..57a58f6eb 100644 --- a/public/react/src/modules/courses/shixunHomework/Listofworksstudentone.js +++ b/public/react/src/modules/courses/shixunHomework/Listofworksstudentone.js @@ -1077,13 +1077,13 @@ class Listofworksstudentone extends Component { // debugger let urll = `/homework_commons/${homeworkid}/works_list.json`; var datasysl = { - search: "", - order: "", + search: this.state.searchtext, + order: this.state.orders, b_order: "desc", - page: 1, - limit: 20, - work_status: "", - course_group: "", + page: this.state.page, + limit: this.state.limit, + work_status: this.state.course_groupyslstwo, + course_group: this.state.checkedValuesineinfo, } axios.post(urll, datasysl).then((result) => { console.log("980000000____________________"); @@ -1449,7 +1449,9 @@ class Listofworksstudentone extends Component { this.setState({ userids: e.myid, }) - this.viewtraining(e.myid); + + window.open(`/courses/${this.state.props.match.params.coursesId}/shixun_homeworks/${e.myid}/shixun_work_report`, '_blank'); + // this.viewtraining(e.myid); } viewtraining = (userids) => { // console.log("viewtraining") @@ -2104,7 +2106,8 @@ class Listofworksstudentone extends Component { this.setState({ userids: e.myid, }) - this.viewtrainingt(e.myid); + // this.viewtrainingt(e.myid); + window.open(`/courses/${this.state.props.match.params.coursesId}/shixun_homeworks/${e.myid}/shixun_work_report`, '_blank'); } // 关闭调分 cancelModulationModels = () => { @@ -2600,29 +2603,31 @@ class Listofworksstudentone extends Component { color:rgba(255,104,0,1); } - .computeTime{ - width: 73px; - height: 24px; - display: inline-block; - padding: 5px; - text-align: center; - line-height: 13px; - color: #4CACFF; - border: 1px solid #4CACFF; - cursor: pointer; - } + .computeTime { + width: 122px; + height: 31px; + display: inline-block; + padding: 5px; + text-align: center; + line-height: 20px; + color: #FE6B21; + border: 1px solid #FE6B21; + cursor: pointer; + border-radius: 4px; + } - .computeTimes{ - width: 73px; - height: 24px; - display: inline-block; - padding: 5px; - text-align: center; - line-height: 13px; - color: #C5C5C5; - border: 1px solid #EDEDED; - background:#EDEDED; - cursor: pointer; + .computeTimes{ + width: 122px; + height: 31px; + display: inline-block; + padding: 5px; + text-align: center; + line-height: 20px; + color: #C5C5C5; + border: 1px solid #EDEDED; + background:#EDEDED; + cursor: pointer; + border-radius: 4px; } .shixunSpin{ color:#FF6801; @@ -2641,19 +2646,21 @@ class Listofworksstudentone extends Component {