diff --git a/web/src/main/java/com/ibeetl/jlw/web/ResourcesInfoController.java b/web/src/main/java/com/ibeetl/jlw/web/ResourcesInfoController.java
index 2d1e8f1f..f0c87f63 100644
--- a/web/src/main/java/com/ibeetl/jlw/web/ResourcesInfoController.java
+++ b/web/src/main/java/com/ibeetl/jlw/web/ResourcesInfoController.java
@@ -281,10 +281,7 @@ public class ResourcesInfoController {
if (resourcesInfo != null) {
view.addObject("resourcesInfo", resourcesInfo);
view.addObject("resourcesInfoContent", resourcesInfo.getResourcesInfoContent().replaceAll("\\\\", "/"));
- }
-
- // 开课资源
- else {
+ }else {
TeacherOpenCourseMergeResourcesInfo tocResourceInfo = teacherOpenCourseMergeResourcesInfoDao.single(resourcesInfoId);
// 用到的字段都是同名的,所以这里直接返回就可以了
view.addObject("resourcesInfo", tocResourceInfo);
diff --git a/web/src/main/java/com/ibeetl/jlw/web/TeacherOpenCourseHandsOnSimulationTasksController.java b/web/src/main/java/com/ibeetl/jlw/web/TeacherOpenCourseHandsOnSimulationTasksController.java
index 39966e4d..b18ab544 100644
--- a/web/src/main/java/com/ibeetl/jlw/web/TeacherOpenCourseHandsOnSimulationTasksController.java
+++ b/web/src/main/java/com/ibeetl/jlw/web/TeacherOpenCourseHandsOnSimulationTasksController.java
@@ -104,7 +104,7 @@ public class TeacherOpenCourseHandsOnSimulationTasksController{
@GetMapping(MODEL + "/add.do")
@Function("teacherOpenCourseHandsOnSimulationTasks.add")
- public ModelAndView add(Long taskId) {
+ public ModelAndView add(Long taskId, Long handsOnId,Long courseInfoId) {
ModelAndView view = new ModelAndView("/jlw/teacherOpenCourseHandsOnSimulationTasks/add.html");
if(null != taskId){
TeacherOpenCourseHandsOnSimulationTasks teacherOpenCourseHandsOnSimulationTasks = teacherOpenCourseHandsOnSimulationTasksService.queryById(taskId);
@@ -113,6 +113,8 @@ public class TeacherOpenCourseHandsOnSimulationTasksController{
}else {
view.addObject("teacherOpenCourseHandsOnSimulationTasks", new TeacherOpenCourseHandsOnSimulationTasks());
}
+ view.addObject("handsOnId",handsOnId);
+ view.addObject("courseInfoId", courseInfoId);
return view;
}
diff --git a/web/src/main/resources/static/js/jlw/handsOnSimulationTasks/add.js b/web/src/main/resources/static/js/jlw/handsOnSimulationTasks/add.js
index 84fae26b..ba0762ea 100644
--- a/web/src/main/resources/static/js/jlw/handsOnSimulationTasks/add.js
+++ b/web/src/main/resources/static/js/jlw/handsOnSimulationTasks/add.js
@@ -7,6 +7,12 @@ layui.define([ 'form','laytpl', 'laydate', 'table','element','handsOnSimulationT
element.render();
var layer = layui.layer;
var table = layui.table;
+ layedit.set({ //富文本上传图片
+ uploadImage: {
+ url: Common.ctxPath + "/jlw/file/update.do",
+ imgUrl:"http://localhost:9090/server"
+ }
+ });
var one = layedit.build('test-editor1'); //建立编辑器
var editor = null;
var resourcesQuestionTable =null;
diff --git a/web/src/main/resources/static/js/jlw/teacherOpenCourseHandsOnSimulationTasks/add.js b/web/src/main/resources/static/js/jlw/teacherOpenCourseHandsOnSimulationTasks/add.js
index fd9377e4..176a28cd 100644
--- a/web/src/main/resources/static/js/jlw/teacherOpenCourseHandsOnSimulationTasks/add.js
+++ b/web/src/main/resources/static/js/jlw/teacherOpenCourseHandsOnSimulationTasks/add.js
@@ -2,6 +2,365 @@ layui.define([ 'form', 'laydate', 'table','teacherOpenCourseHandsOnSimulationTas
var form = layui.form;
var teacherOpenCourseHandsOnSimulationTasksApi = layui.teacherOpenCourseHandsOnSimulationTasksApi;
var index = layui.index;
+ var laytpl = layui.laytpl;
+ var element = layui.element, upload = layui.upload, layedit = layui.layedit;
+
+ element.render();
+ var layer = layui.layer;
+ var table = layui.table;
+ layedit.set({ //富文本上传图片
+ uploadImage: {
+ url: Common.ctxPath + "/jlw/file/update.do",
+ imgUrl:"http://localhost:9090/server"
+ }
+ });
+ var one = layedit.build('test-editor1'); //建立编辑器
+ var editor = null;
+ var resourcesQuestionTable =null;
+ var resourcesQuestionTable1 = null;
+ var selectResourcesQuestion = [];
+ var tableData4 = [];
+ var resourcesQuestionIds = ""; //选中题目id
+
+ var courseInfoIds = $("input[name=courseInfoId_1]").val();
+ var typeInfo = $("#taskTypeInfo input[name='taskType']:checked").val(); //当前操作的类型
+ if (typeInfo == 1){
+ $(".progressCss_mp4 .closeInfo").unbind();
+ $(".progressCss_mp4 .closeInfo").click(function (){
+ $(this).parents(".progressCss_mp4").remove();
+ });
+ }else if(typeInfo == 2){
+ $(".progressCss_ppt .closeInfo").unbind();
+ $(".progressCss_ppt .closeInfo").click(function (){
+ $(this).parents(".progressCss_ppt").remove();
+ });;
+ }else if(typeInfo == 3){
+ getQuestionTotal();
+ resourcesQuestionIds = $("input[name='taskList']").val(); //选中的题目ID
+ }else if(typeInfo == 4){
+ if (editor === null) {
+ editor = Lib.editorMd("test-editor");
+ editor.setToolbarAutoFixed(false);
+ }
+ $("#tableData4_view .infoTr").each(function (){
+ tableData4.push({
+ handsOnId:$("#addForm input[name='handsOnId']").val(),//实操ID
+ handsOnSimulationTasksAssessmentQuestion:$(this).find(".handsOnSimulationTasksAssessmentQuestion").text(), //考核题目
+ handsOnSimulationTasksAssessmentAnswer:$(this).find("textarea[name='handsOnSimulationTasksAssessmentAnswer']").val(), //考核答案
+ handsOnSimulationTasksAssessmentScore:$(this).find("input[name='handsOnSimulationTasksAssessmentScore']").val(), //考核分值
+ });
+ });
+ getScoreInfo();
+ }else if (typeInfo == 5){
+ $(".progressCss_file .closeInfo").unbind();
+ $(".progressCss_file .closeInfo").click(function (){
+ $(this).parents(".progressCss_file").remove();
+ });
+ }
+
+ window.loadYl = function (){//富文本代码编辑器 产生变化时触发
+ yl();
+ }
+//普通图片上传
+ var uploadInst = upload.render({
+ elem: '#test-upload-normal'
+ ,url: Common.ctxPath +'/jlw/file/update.do'
+ ,accept:'video'
+ , progress: function(value) {
+ element.progress('progressBar',value + '%');
+ }
+ ,choose: function(obj){
+ $("#mp4Info").append('
\n' +
+ '
\n' +
+ '
\n' +
+ '
\n' +
+ '
\n' +
+ '
X\n' +
+ '
');
+ },
+ before: function(obj) {
+ obj.preview(function(index, file, result) {
+ //$('input[name="src"]').html(file.name);
+ $('.progressCss_mp4:last .nameV').html(file.name);
+ var size = (file.size/1014).toFixed(1)+'kb';
+ $('.progressCss_mp4:last .mv_m').html(size);
+ });
+ }
+ ,done: function(res){
+ //如果上传失败
+ if(res.code > 0){
+ return layer.msg('上传失败');
+ }else {
+ $('.progressCss_mp4:last .fileUrl').html(res.data.url);
+ $(".progressCss_mp4 .closeInfo").unbind();
+ $(".progressCss_mp4 .closeInfo").click(function (){
+ $(this).parents(".progressCss_mp4").remove();
+ })
+ }
+ //上传成功
+ }
+ ,error: function(){
+ //演示失败状态,并实现重传
+ var demoText = $('#test-upload-demoText');
+ demoText.html('上传失败 重试');
+ demoText.find('.demo-reload').on('click', function(){
+ uploadInst.upload();
+ });
+ }
+ });
+
+ var uploadInstPPT = upload.render({
+ elem: '#upload-normalPPT'
+ ,url: Common.ctxPath +'/jlw/file/update.do'
+ ,accept:'file'
+ ,exts:'ppt|pps|pptx|ppsx|pot|ppa'
+ , progress: function(value) {
+ element.progress('progressBarPPT',value + '%');
+ }
+ ,choose: function(obj){
+ $("#pptInfo").append('\n' +
+ '
\n' +
+ '
\n' +
+ '
\n' +
+ '
\n' +
+ '
X\n' +
+ '
');
+ },
+ before: function(obj) {
+ obj.preview(function(index, file, result) {
+ //$('input[name="src"]').html(file.name);
+ $('.progressCss_ppt:last .nameV').html(file.name);
+ var size = (file.size/1014).toFixed(1)+'kb';
+ $('.progressCss_ppt:last .mv_m').html(size);
+ });
+ }
+ ,done: function(res){
+ //如果上传失败
+ if(res.code > 0){
+ return layer.msg('上传失败');
+ }else {
+ if(!$.isEmpty(res.data.cvPDFUrl)){
+ $('.progressCss_ppt:last .fileUrl').html(res.data.cvPDFUrl);
+ }else {
+ $('.progressCss_ppt:last .fileUrl').html(res.data.url);
+ }
+ $(".progressCss_ppt .closeInfo").unbind();
+ $(".progressCss_ppt .closeInfo").click(function (){
+ $(this).parents(".progressCss_ppt").remove();
+ })
+ }
+ //上传成功
+ }
+ ,error: function(){
+ //演示失败状态,并实现重传
+ var demoText = $('#upload-demoTextPPT');
+ demoText.html('上传失败 重试');
+ demoText.find('.demo-reloadP').on('click', function(){
+ uploadInstPPT.upload();
+ });
+ }
+ });
+ var uploadInstFile = upload.render({
+ elem: '#upload-normalFile'
+ ,url: Common.ctxPath +'/jlw/file/update.do'
+ ,accept:'file'
+ , progress: function(value) {
+ element.progress('progressBarFile',value + '%');
+ },
+ choose: function(obj){
+ $("#fileInfo").append('\n' +
+ '
\n' +
+ '
\n' +
+ '
\n' +
+ '
\n' +
+ '
X\n' +
+ '
');
+ },
+ before: function(obj) {
+ obj.preview(function(index, file, result) {
+ //$('input[name="src"]').html(file.name);
+ $('.progressCss_file:last .nameV').html(file.name);
+ var size = (file.size/1014).toFixed(1)+'kb';
+ $('.progressCss_file:last .mv_m').html(size);
+ });
+ }
+ ,done: function(res){
+ //如果上传失败
+ if(res.code > 0){
+ return layer.msg('上传失败');
+ }else {
+ $('.progressCss_file:last .fileUrl').html(res.data.url);
+ $(".progressCss_file .closeInfo").unbind();
+ $(".progressCss_file .closeInfo").click(function (){
+ $(this).parents(".progressCss_file").remove();
+ });
+ }
+ //上传成功
+ }
+ ,error: function(){
+ //演示失败状态,并实现重传
+ var demoText = $('#upload-demoTextFile');
+ demoText.html('上传失败 重试');
+ demoText.find('.demo-reloadF').on('click', function(){
+ uploadInstFile.upload();
+ });
+ }
+ });
+
+ $('#manualProblemSetting1').click(function () {//手动出题
+ layer.open({
+ type: 1
+ , title: '选择题库'
+ ,fixed:false//固定页面后,弹出框随着滚动
+ , shadeClose: true
+ ,offset:'30px'
+ , scrollbar: true//滚动条
+ , content: $("#resourcesQuestionTable_demo")
+ , btn: ['保存','关闭']
+ ,success:function () {
+ resourcesQuestionTable();
+ Lib.getCourseInfo($("select[name='courseInfoId_1']"), courseInfoIds);
+ }
+ , yes: function (index, layero) {
+ var ret = Common.getAjax('/jlw/handsOnSimulationTasks/getObjectiveProblem.do?problemIds='+resourcesQuestionIds);
+ if (ret.length > 0){
+ var getTpl = kgtTable_demo.innerHTML
+ ,view = document.getElementById('kgtTable_view');
+ laytpl(getTpl).render({list:ret}, function(html){
+ view.innerHTML = html;
+ getQuestionTotal();
+ });
+ }
+ layer.close(index);
+ $('#resourcesQuestionTable_demo').hide();
+ }
+ , btn2: function (index, layero) {
+ layer.close(index);
+ $('#resourcesQuestionTable_demo').hide();
+ }
+ });
+ });
+ var btn = $("#searchFormQuestion");
+ btn.on('click', function () {
+ resourcesQuestionTable1.reload({
+ where: {
+ 'courseInfoParentId':courseInfoIds,
+ 'courseInfoId':$("#resourcesQuestionTable_demo select[name='courseInfoId_1']").find("option:selected").val(),
+ "questionStem":$("#resourcesQuestionTable_demo input[name='generalQuestionSettingName']").val(),
+ 'questionType':$("#resourcesQuestionTable_demo select[name='questionType']").find("option:selected").val()
+ },
+ });
+ });
+
+ table.on('checkbox(resourcesQuestionTable)', function(obj){ //test 是 table 标签对应的 lay-filter 属性
+ if (obj.checked) { //选中
+ if (obj.type == "all") {//全选
+ var checkStatus = table.checkStatus('resourcesQuestionTable').data;
+ for (var i = 0; i < checkStatus.length; i++) {
+ if (("," + resourcesQuestionIds + ",").indexOf(checkStatus[i].resourcesQuestionId) < 0) {
+ if (!$.isEmpty(resourcesQuestionIds)) {
+ resourcesQuestionIds += "," + checkStatus[i].resourcesQuestionId;
+ } else {
+ resourcesQuestionIds = checkStatus[i].resourcesQuestionId;
+ }
+ }
+ }
+ } else {
+ if (!$.isEmpty(resourcesQuestionIds)) {
+ resourcesQuestionIds += "," + obj.data.resourcesQuestionId;
+ } else {
+ resourcesQuestionIds = obj.data.resourcesQuestionId;
+ }
+ }
+ } else {//取消全选
+ if (obj.type == "all") {//全选
+ var checkStatus = table.cache["resourcesQuestionTable"];
+ for (var i = 0; i < checkStatus.length; i++) {
+ resourcesQuestionIds = Lib.stringRemove(resourcesQuestionIds, checkStatus[i].resourcesQuestionId);
+ }
+ } else {
+ resourcesQuestionIds = Lib.stringRemove(resourcesQuestionIds, obj.data.resourcesQuestionId);
+ }
+ }
+
+ $("#countQ").html(resourcesQuestionIds.split(',').length)
+ });
+
+ $("#del").click(function () {//清除已选
+ resourcesQuestionIds = [];
+ $("#countQ").html(0);
+ var param = {
+ 'courseInfoParentId':courseInfoIds,
+ 'courseInfoId':$("#resourcesQuestionTable_demo select[name='courseInfoId_1']").find("option:selected").val(),
+ "questionStem":$("#resourcesQuestionTable_demo input[name='generalQuestionSettingName']").val(),
+ 'questionType':$("#resourcesQuestionTable_demo select[name='questionType']").find("option:selected").val()
+ };
+ resourcesQuestionTable1.reload({
+ where: param,
+ page: {
+ curr: 1
+ }
+ });
+ });
+
+ resourcesQuestionTable= function(){
+ resourcesQuestionTable1=table.render({
+ elem: '#resourcesQuestionTable',
+ cellMinWidth: 100,
+ method: 'post',
+ even: true,
+ size: "sms",
+ url: Common.ctxPath + '/jlw/resourcesQuestion/list.json' // 数据接口
+ , page: Lib.tablePage // 开启分页
+ , limit: 8
+ , where: {"courseInfoParentId": courseInfoIds}
+ ,cols: [[ // 表头
+ {
+ type: 'checkbox', align: "center"
+ },
+ {
+ field: 'questionStem', width: 320,
+ title: '题干', align: "center"
+ },
+ {
+ field: 'questionType', align: "center", width: 80,
+ title: '题型', templet: function (d) {//(1单选 2多选 3判断 4填空 5分析)
+ return d.questionType == 1 ? '单选' : d.questionType == 2 ? '多选' : d.questionType == 3 ? '判断' : '-';
+ }
+ },
+ {
+ field: 'courseInfoParentName',
+ title: '归属课程', align: "center"
+ },
+ {
+ field: 'courseInfoName',
+ title: '归属章节', align: "center"
+ }
+ ]],done: function(res, curr, count){
+ //循环所有数据,找出对应关系,设置checkbox选中状态
+ for (var i = 0; i < res.data.length; i++) {
+ for (var j = 0; j < resourcesQuestionIds.split(',').length; j++) {
+ if (res.data[i].resourcesQuestionId == resourcesQuestionIds.split(',')[j]) {
+ //这里才是真正的有效勾选
+ res.data[i]["LAY_CHECKED"] = 'true';
+ //找到对应数据改变勾选样式,呈现出选中效果
+ var index = res.data[i]['LAY_TABLE_INDEX'];
+ $('.layui-table tr[data-index=' + index + '] input[type="checkbox"]').prop('checked', true);
+ $('.layui-table tr[data-index=' + index + '] input[type="checkbox"]').next().addClass('layui-form-checked');
+ }
+ }
+ }
+ }
+
+ });
+ }
+
var view = {
init:function(){
Lib.initGenrealForm($("#addForm"),form);
@@ -11,7 +370,146 @@ layui.define([ 'form', 'laydate', 'table','teacherOpenCourseHandsOnSimulationTas
$("#addButton").click(function(){
form.on('submit(form)', function(){
var taskId = $("#addForm input[name='taskId']").val();
- if(!$.isEmpty(taskId)){
+ var taskId = $("#addForm input[name='taskId']").val(),param = {},
+ handsOnId = $("#addForm input[name='handsOnId']").val();
+ var taskType = $("#taskTypeInfo input[name='taskType']:checked").val(); //得到当前操作的任务类型 1:观看视频 2:PPT 3:理论测评 4:实操 5:报告撰写
+ var key = $("#taskTypeContent .layui-show");
+ param.taskTitle = key.find("input[name='taskTitle']").val(); //标题
+ param.taskOrder = key.find("input[name='taskOrder']").val(); //顺序
+ if ($.isEmpty(param.taskTitle)){
+ Common.info("请输入标题!");
+ return;
+ }
+ // if ($.isEmpty(param.taskOrder)){
+ // Common.info("请输入顺序!");
+ // return;
+ // }
+ if (taskType == 1){ //视频
+ param.taskScore = key.find("input[name='taskScore']").val(); //分值
+ if ($.isEmpty(param.taskScore)){
+ Common.info("请输入分值!");
+ return;
+ }
+ param.assessmentRequirements = key.find("input[name='assessmentRequirements']").val(); //至少观看时长
+ param.assessmentTime = key.find("input[name='assessmentTime']").val(); //至少观看时长
+ if ($.isEmpty(param.assessmentRequirements)){
+ Common.info("请输入至少观看时长!");
+ return;
+ }
+ if ($.isEmpty(param.assessmentTime)){
+ Common.info("请输入间隔多少分钟出现一次弹窗!");
+ return;
+ }
+ var tasksFile = [];
+ $("#mp4Info .progressCss_mp4").each(function (){
+ tasksFile.push({
+ fileName:$(this).find(".nameV").html(),
+ fileUrl:$(this).find(".fileUrl").html()
+ });
+ });
+ if (tasksFile.length <= 0){
+ Common.info("请上传视频!");
+ return;
+ }
+ param.tasksFile = JSON.stringify(tasksFile);
+ }else if (taskType == 2){ //PPT
+ param.taskScore = key.find("input[name='taskScore']").val(); //分值
+ param.assessmentRequirements = key.find("input[name='assessmentRequirements']").val(); //至少观看时长
+ param.assessmentTime = key.find("input[name='assessmentTime']").val(); //至少观看时长
+ if ($.isEmpty(param.taskScore)){
+ Common.info("请输入分值!");
+ return;
+ }
+ if ($.isEmpty(param.assessmentRequirements)){
+ Common.info("请输入至少观看时长!");
+ return;
+ }
+ if ($.isEmpty(param.assessmentTime)){
+ Common.info("请输入间隔多少分钟出现一次弹窗!");
+ return;
+ }
+ var tasksFile = [];
+ $("#pptInfo .progressCss_ppt").each(function (){
+ tasksFile.push({
+ fileName:$(this).find(".nameV").html(),
+ fileUrl:$(this).find(".fileUrl").html()
+ });
+ });
+ if (tasksFile.length <= 0){
+ Common.info("请上传PPT!");
+ return;
+ }
+ param.tasksFile = JSON.stringify(tasksFile);
+ }else if (taskType == 3){ //理论测评
+ var tableQuestionData = [];
+ $("#kgtTable_view .infoTr").each(function (){
+ tableQuestionData.push({
+ questionType:$(this).find(".questionType").text(),
+ questionTypeName:$(this).find(".questionTypeName").text(),
+ questionNum:$(this).find(".questionNum").text(),
+ questionScore:$(this).find("input[name='questionScore']").val(),
+ questionTotal:$(this).find(".questionTotal").text(),
+ });
+
+ });
+ if (tableQuestionData.length <= 0){
+ Common.info("请选择客观题");
+ return;
+ }
+ param.taskList = resourcesQuestionIds;
+ param.taskScore = $(".questionTotalInfo").text(); //分值
+ param.handsOnTaskProblemVo = JSON.stringify(tableQuestionData);
+ }else if (taskType == 4){ //实操
+ param.assessmentContent = editor.getMarkdown(); //考核内容
+ param.taskScore = $(".scoreInfo").text(); //分值
+ if ($.isEmpty(param.assessmentContent)){
+ Common.info("请输入考核内容!");
+ return;
+ }
+ param.handsOnSimulationTasksAssessment = JSON.stringify(tableData4); //考核答案
+ }else if (taskType == 5){ //报告撰写
+ param.taskScore = key.find("input[name='taskScore']").val(); //分值
+ param.assessmentContent = layedit.getContent(one); //获取报告要求
+ if ($.isEmpty(param.taskScore)){
+ Common.info("请输入分值!");
+ return;
+ }
+ if ($.isEmpty(param.assessmentContent)){
+ Common.info("请输入报告要求!");
+ return;
+ }
+ var tasksFile = [];
+ $("#fileInfo .progressCss_file").each(function (){
+ tasksFile.push({
+ fileName:$(this).find(".nameV").html(),
+ fileUrl:$(this).find(".fileUrl").html()
+ });
+ });
+ if (tasksFile.length <= 0){
+ Common.info("请上传报告参考模板!");
+ return;
+ }
+ param.tasksFile = JSON.stringify(tasksFile);
+ }
+ param.taskType = taskType;
+ param.taskId = taskId;
+ param.handsOnId = handsOnId; //案例ID
+ var url = "/jlw/teacherOpenCourseHandsOnSimulationTasks/edit.json";
+ if($.isEmpty(taskId)){
+ url = "/jlw/teacherOpenCourseHandsOnSimulationTasks/add.json";
+ }
+ var ret = Common.postAjax(url,param);
+ layer.msg(ret.code == 0 ? "操作成功!" : ret.msg, {
+ offset: ['50%'],
+ icon: ret.code == 0 ? 1 : 2,
+ time: 1500 //2秒关闭(如果不配置,默认是3秒)
+ }, function () {
+ if (ret.code == 0) {
+ Lib.closeFrame();
+ parent.loadList();
+ }
+ });
+ /*if(!$.isEmpty(taskId)){
teacherOpenCourseHandsOnSimulationTasksApi.updateTeacherOpenCourseHandsOnSimulationTasks($('#addForm'),function(){
parent.window.dataReload();
Common.info("更新成功");
@@ -23,7 +521,7 @@ layui.define([ 'form', 'laydate', 'table','teacherOpenCourseHandsOnSimulationTas
Common.info("添加成功");
Lib.closeFrame();
});
- }
+ }*/
});
});
@@ -34,5 +532,79 @@ layui.define([ 'form', 'laydate', 'table','teacherOpenCourseHandsOnSimulationTas
}
}
+
+ form.on('radio(taskType)', obj => {
+ element.tabChange('demo', obj.value);
+ if (obj.value === "4") {
+ if (editor === null) {
+ editor = Lib.editorMd("test-editor");
+ editor.setToolbarAutoFixed(false);
+ }
+ }
+ // $("input[name='taskTitle']").val("");
+ // $("input[name='taskScore']").val("");
+ // $("input[name='taskOrder']").val("");
+ // $("input[name='assessmentRequirements']").val("");
+ // $("input[name='assessmentTime']").val("");
+});
+
+ //理论测评分值修改
+ function getQuestionTotal(){
+ $("#kgtTable_view input[name='questionScore']").unbind();
+ $("#kgtTable_view input[name='questionScore']").change(function (){
+ var questionScore = $(this).val();//当前输入的分值
+ var indexInfo = $(this).attr("indexInfo"); //当前操作的位置
+ var questionNum = $("#kgtTable_view .questionNum:eq("+indexInfo+")").text(); //题目数量
+ $("#kgtTable_view .questionTotal:eq("+indexInfo+")").text((Number(questionScore) * Number(questionNum)).toFixed(2)); //合计
+ $(".questionTotalInfo").text(0);
+ $("#kgtTable_view .questionTotal").each(function (){
+ $(".questionTotalInfo").text(Number($(this).text()) + Number($(".questionTotalInfo").text()));
+ })
+
+ });
+ }
+
+ //实操分值修改
+ function getScoreInfo(){
+ $("#tableData4_view input[name='handsOnSimulationTasksAssessmentScore']").unbind();
+ $("#tableData4_view input[name='handsOnSimulationTasksAssessmentScore']").change(function (){
+ var indexInfo = $(this).attr("indexInfo"); //当前操作的位置
+ tableData4[indexInfo].handsOnSimulationTasksAssessmentScore = $(this).val();
+ var score = 0;
+ $("#tableData4_view input[name='handsOnSimulationTasksAssessmentScore']").each(function (){
+ score = Number(score) + Number($(this).val());
+ })
+ $("#tableData4_view .scoreInfo").text(score);
+ });
+ $("#tableData4_view textarea[name='handsOnSimulationTasksAssessmentAnswer']").unbind();
+ $("#tableData4_view textarea[name='handsOnSimulationTasksAssessmentAnswer']").change(function (){
+ var indexInfo = $(this).attr("indexInfo"); //当前操作的位置
+ tableData4[indexInfo].handsOnSimulationTasksAssessmentAnswer = $(this).val();
+ });
+ }
+
+ function yl(){
+ var val = editor.getMarkdown();
+ if(!$.isEmpty(val) && val.indexOf("[---]") >= 0 ){
+ if(tableData4.length > val.split("[---]").length - 1){
+ tableData4 = tableData4.slice(0,val.split("[---]").length - 1);
+ }else if(tableData4.length < val.split("[---]").length - 1){
+ tableData4.push({
+ handsOnId:$("#addForm input[name='handsOnId']").val(),//实操ID
+ handsOnSimulationTasksAssessmentQuestion:Lib.chineseNum(tableData4.length,1), //考核题目
+ handsOnSimulationTasksAssessmentAnswer:"", //考核答案
+ handsOnSimulationTasksAssessmentScore:"", //考核分值
+ })
+ }
+ }else{
+ tableData4 = [];
+ }
+ var getTpl = tableData4_demo.innerHTML
+ ,view = document.getElementById('tableData4_view');
+ laytpl(getTpl).render({list:tableData4}, function(html){
+ view.innerHTML = html;
+ getScoreInfo();
+ });
+ }
exports('add',view);
});
diff --git a/web/src/main/resources/templates/jlw/teacherOpenCourseHandsOnSimulationTasks/add.html b/web/src/main/resources/templates/jlw/teacherOpenCourseHandsOnSimulationTasks/add.html
index b54031f3..aaff5288 100644
--- a/web/src/main/resources/templates/jlw/teacherOpenCourseHandsOnSimulationTasks/add.html
+++ b/web/src/main/resources/templates/jlw/teacherOpenCourseHandsOnSimulationTasks/add.html
@@ -32,8 +32,6 @@
}