@@ -140,6 +145,7 @@ import { editListItem } from '@/hooks/useClassTask'
import MyQuestion from '@/views/classTask/newClassTaskAssign/myQuestion/index.vue'
import SchoolQuestion from '@/views/classTask/newClassTaskAssign/schoolQuestion/index.vue'
import SearchQuestion from '@/views/classTask/newClassTaskAssign/searchQuestion/index.vue'
+import ExperimentQuestion from "@/views/classTask/newClassTaskAssign/experimentQuestion/index.vue";
import whiteboard from '@/components/whiteboard/whiteboard.vue'
import FileUpload from "@/components/FileUpload/index.vue";
import Right from './Right/index.vue'
@@ -258,6 +264,16 @@ watch(() => props.currentCourse, (newVal, oldVal) => {
}
console.log(newVal,'newval');
},{deep:true})
+
+// ------------科学实验
+const getExpObj = (obj)=>{
+ // obj:{
+ // fileurl: "https://phet.colorado.edu/sims/html/number-compare/latest/number-compare_zh_CN.html"
+ // label: "数量比较"
+ // subject: "math"
+ // }
+ classWorkForm.fileHomeworkList = [obj];
+}
//---------作业设计---
const handleItemClick = (itemName) => {
console.log('itemName', itemName);
@@ -582,6 +598,32 @@ const handleClassWorkFormQuizRemove = (index) =>{
fileLoading.value = false
}
}
+ else if(classWorkForm.worktype === "科学实验"){
+ if (classWorkForm.fileHomeworkList.length == 0) return ElMessage({ type: 'warning', message: '请选择科学实验的课程!'});
+ cform.workcodes = JSON.stringify(classWorkForm.fileHomeworkList);
+ cform.entpcourseworklist = JSON.stringify([{'id':-3, 'score': '10'}]);
+ try {
+ console.log(cform,'科学实验')
+ addClassworkReturnId(cform).then((res) => {
+ ElMessage({ type: 'success', message: '作业设计成功!'});
+ // 重置提交表单
+ classWorkForm.worktype = "科学实验";
+ classWorkForm.uniquekey = ''; // props.propsformobj.uniquekey, // 作业唯一标识 作业名称
+ classWorkForm.title = "";
+ classWorkForm.quizlist = [], // 作业习题列表内容
+
+ // 情况选择的资源缓存
+ classWorkForm.chooseWorkLists = []; // 框架梳理list
+ classWorkForm.whiteboardObj = ''; // ? // 清空白板
+ classWorkForm.fileHomeworkList = []; // 常规作业list
+ classWorkForm.id = res
+ emits('getData',classWorkForm)
+ // TODO 科学实验 待完善
+ })
+ } finally{
+ //
+ }
+ }
else {
// 正常新任务
var ll = [];
@@ -667,7 +709,10 @@ const editWork = async (cform) =>{
}else{
if (classWorkForm.fileHomeworkList.length == 0) return ElMessage({ type: 'warning', message: '请上传常规作业附件!'});
}
- }else {
+ }else if( classWorkForm.worktype == '科学实验') {
+ if (classWorkForm.fileHomeworkList.length == 0) return ElMessage({ type: 'warning', message: '请选择科学实验科目!'});
+ }
+ else {
if (classWorkForm.chooseWorkLists.length == 0) {
// 框架梳理
ElMessage.error('请先添加作业资源!');
@@ -759,6 +804,10 @@ const editWork = async (cform) =>{
// 1.更新作业任务下的课堂展示内容 (这里未做校验, 直接将当前文件对象更新过去)
cform.workcodes = JSON.stringify(classWorkForm.fileHomeworkList);
}
+ else if (classWorkForm.worktype=='科学实验') { //TODO 注意,fileHomeworkList字段与常规作业共用
+ // 1.更新作业任务下的课堂展示内容 (这里未做校验, 直接将当前文件对象更新过去)
+ cform.workcodes = JSON.stringify(classWorkForm.fileHomeworkList);
+ }
// 3.更新作业任务本身
let res = await updateClasswork(cform);
@@ -865,6 +914,11 @@ const editWork = async (cform) =>{
padding: 20px;
box-sizing: border-box;
}
+
+ .experiment-homework{
+ padding: 15px;
+ height: 100%;
+ }
}
.page-right {
overflow: hidden;