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

courseware
caicai8 5 years ago
commit 802ea06665

@ -379,6 +379,7 @@ class ExercisesController < ApplicationController
#试卷的提交设置
def commit_setting
tip_exception("助教无权限修改本试卷") if @user_course_identity == Course::ASSISTANT_PROFESSOR && !@exercise.assistant_auth
ActiveRecord::Base.transaction do
error_count = 0 # 判断循环里是否有已发布/已截止的,且时间更改了的分班。
# course_group_ids = @course.teacher_course_group_ids(current_user.id) #当前老师的班级id数组
@ -398,6 +399,7 @@ class ExercisesController < ApplicationController
choice_random = params[:choice_random] ? true : false
score_open = params[:score_open] ? true : false #分数是否公开
answer_open = params[:answer_open] ? true : false #答案是否公开
assistant_auth = params[:assistant_auth] ? true : false # 助教权限
# 统一设置或者分班为0则更新试卷并删除试卷分组
if unified_setting || (course_group_ids.size == 0)
@ -426,7 +428,8 @@ class ExercisesController < ApplicationController
:answer_open => answer_open,
:exercise_status => exercise_status_n,
:publish_time => params_publish_time,
:end_time => params_end_time
:end_time => params_end_time,
:assistant_auth => assistant_auth
}
@exercise.update!(exercise_params)
@exercise.exercise_group_settings.destroy_all

@ -1,5 +1,5 @@
json.course_is_end @course.is_end # true表示已结束false表示未结束
json.extract! @exercise, :id,:exercise_name,:exercise_description,:show_statistic
json.extract! @exercise, :id,:exercise_name,:exercise_description,:show_statistic,:assistant_auth
json.time (@user_left_time.to_i / 60)
json.exercise_status @ex_status

@ -2,7 +2,7 @@
if @exercises_count > 0
json.exercises do
json.array! @exercises do |exercise|
json.extract! exercise, :id, :exercise_name,:is_public,:created_at
json.extract! exercise, :id, :exercise_name,:is_public,:created_at,:assistant_auth
if @is_teacher_or == 2
second_left = get_exercise_left_time(exercise,@current_user_)
json.time second_left.present? ? (second_left / 60) : nil

@ -0,0 +1,5 @@
class AddAuthToExercise < ActiveRecord::Migration[5.2]
def change
add_column :exercises, :assistant_auth, :boolean, default: 1
end
end

@ -529,6 +529,7 @@ class Questionitem_banks extends Component {
}
handleShowUploadImage=(url)=>{
debugger
this.setState({
url:url
})
@ -550,7 +551,7 @@ class Questionitem_banks extends Component {
>
{url?
<QuestionModalPicture {...this.props} {...this.state} handleClose={()=>this.handleClose()}></QuestionModalPicture>
<QuestionModalPicture url={url} {...this.props} {...this.state} handleClose={()=>this.handleClose()}></QuestionModalPicture>
:
""
}

@ -176,7 +176,16 @@ class ChoquesEditor extends Component{
onCancel = () => {
this.props.onEditorCancel()
}
handleShowUploadImages=(url)=>{
this.setState({
url:url,
})
try {
this.props.handleShowUploadImage(url)
}catch (e) {
}
}
handleShowUploadImage = (url,i) => {
this.setState({
@ -466,6 +475,8 @@ class ChoquesEditor extends Component{
options={options}
value={question_title}
onContentChange={this.onContentChange}
showUploadImage={(url)=>this.handleShowUploadImages(url)}
/>
@ -577,6 +588,7 @@ class ChoquesEditor extends Component{
options={options}
value={question_titles}
onContentChange={this.onContentChanges}
showUploadImage={(url)=>this.handleShowUploadImages(url)}
/>

@ -58,6 +58,7 @@ class JudquestionEditor extends Component{
zqda:null,
item_banksedit:[],
mychoicess:[],
url:''
}
}
addOption = () => {
@ -334,6 +335,16 @@ class JudquestionEditor extends Component{
}
}
}
handleShowUploadImages=(url)=>{
this.setState({
url:url,
})
try {
this.props.handleShowUploadImage(url)
}catch (e) {
}
}
onContentChanges=(value,quill)=>{
const _text = quill.getText();
const reg = /^[\s\S]*.*[^\s][\s\S]*$/;
@ -437,6 +448,8 @@ class JudquestionEditor extends Component{
options={options}
value={question_title}
onContentChange={this.onContentChange}
showUploadImage={(url)=>this.handleShowUploadImages(url)}
/>
@ -487,6 +500,8 @@ class JudquestionEditor extends Component{
options={options}
value={question_titles}
onContentChange={this.onContentChanges}
showUploadImage={(url)=>this.handleShowUploadImages(url)}
/>
</div>

@ -251,6 +251,16 @@ class SingleEditor extends Component{
// standard_answers[index] = !standard_answers[index];
this.setState({ standard_answers })
}
handleShowUploadImages=(url)=>{
this.setState({
url:url,
})
try {
this.props.handleShowUploadImage(url)
}catch (e) {
}
}
handleShowUploadImage = (url,i) => {
@ -494,6 +504,7 @@ class SingleEditor extends Component{
options={options}
value={question_title}
onContentChange={this.onContentChange}
showUploadImage={(url)=>this.handleShowUploadImages(url)}
/>
<div className="mb10 mt10 sortinxdirection">
@ -603,6 +614,7 @@ class SingleEditor extends Component{
options={options}
value={question_titles}
onContentChange={this.onContentChanges}
showUploadImage={(url)=>this.handleShowUploadImages(url)}
/>
</div>

Loading…
Cancel
Save