|
|
@ -146,7 +146,7 @@
|
|
|
|
data: [],
|
|
|
|
data: [],
|
|
|
|
initValue:[xmSeInitValue],
|
|
|
|
initValue:[xmSeInitValue],
|
|
|
|
on: function(data){
|
|
|
|
on: function(data){
|
|
|
|
getQuestionTypeGroupInfo(Common.concatBatchId(data.arr,'id'));
|
|
|
|
getQuestionTypeGroupInfo(Common.concatBatchId(data.arr,'id'),{});
|
|
|
|
}
|
|
|
|
}
|
|
|
|
});
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
@ -306,7 +306,7 @@
|
|
|
|
|
|
|
|
|
|
|
|
//添加考试信息
|
|
|
|
//添加考试信息
|
|
|
|
function addGeneral(data){
|
|
|
|
function addGeneral(data){
|
|
|
|
getQuestionTypeGroupInfo($.isEmpty(data.generalQuestionSettingId)?xmSeInitValue:data.sourceCourseInfoIds);
|
|
|
|
getQuestionTypeGroupInfo($.isEmpty(data.generalQuestionSettingId)?xmSeInitValue:data.sourceCourseInfoIds,data);
|
|
|
|
if (courseInfoList.length <= 0){
|
|
|
|
if (courseInfoList.length <= 0){
|
|
|
|
var ret = Common.getAjax("/jlw/courseInfo/getValues.json",{"courseLabelType":"考证课程类","courseInfoStatus":1,courseInfoType:1});
|
|
|
|
var ret = Common.getAjax("/jlw/courseInfo/getValues.json",{"courseLabelType":"考证课程类","courseInfoStatus":1,courseInfoType:1});
|
|
|
|
if (ret.code == 0){
|
|
|
|
if (ret.code == 0){
|
|
|
@ -324,7 +324,7 @@
|
|
|
|
}else{
|
|
|
|
}else{
|
|
|
|
demo1.update({
|
|
|
|
demo1.update({
|
|
|
|
data: courseInfoList,
|
|
|
|
data: courseInfoList,
|
|
|
|
initValue: [data.sourceCourseInfoIds]
|
|
|
|
initValue: $.isEmpty(data.sourceCourseInfoIds)?[]:data.sourceCourseInfoIds.split(",")
|
|
|
|
});
|
|
|
|
});
|
|
|
|
}
|
|
|
|
}
|
|
|
|
layer.open({
|
|
|
|
layer.open({
|
|
|
@ -407,7 +407,12 @@
|
|
|
|
param.generalQuestionSettingEndShowTrueFalse = generalQuestionSettingEndShowTrueFalse;
|
|
|
|
param.generalQuestionSettingEndShowTrueFalse = generalQuestionSettingEndShowTrueFalse;
|
|
|
|
param.generalQuestionSettingName = generalQuestionSettingName;
|
|
|
|
param.generalQuestionSettingName = generalQuestionSettingName;
|
|
|
|
param.generalQuestionSettingDoCount = generalQuestionSettingDoCount;
|
|
|
|
param.generalQuestionSettingDoCount = generalQuestionSettingDoCount;
|
|
|
|
var ret = Common.postJSON("/api/generalQuestionSetting/addQuestionByType.do",JSON.stringify(param));
|
|
|
|
param.generalQuestionSettingId = data.generalQuestionSettingId;
|
|
|
|
|
|
|
|
var url = "/api/generalQuestionSetting/addQuestionByType.do";
|
|
|
|
|
|
|
|
if (!$.isEmpty(param.generalQuestionSettingId)){
|
|
|
|
|
|
|
|
url = "/jlw/generalQuestionSetting/edit.json";
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
var ret = Common.postJSON(url,JSON.stringify(param));
|
|
|
|
layer.msg(ret.code == 0 ? "保存成功!" : ret.msg, {
|
|
|
|
layer.msg(ret.code == 0 ? "保存成功!" : ret.msg, {
|
|
|
|
offset: ['50%'],
|
|
|
|
offset: ['50%'],
|
|
|
|
icon: ret.code == 0 ? 1 : 2,
|
|
|
|
icon: ret.code == 0 ? 1 : 2,
|
|
|
@ -426,12 +431,31 @@
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
//根据课程ID获取相应的题目数量及类型
|
|
|
|
//根据课程ID获取相应的题目数量及类型
|
|
|
|
function getQuestionTypeGroupInfo(ids){
|
|
|
|
function getQuestionTypeGroupInfo(ids,item){
|
|
|
|
|
|
|
|
var map = {};
|
|
|
|
|
|
|
|
if (!$.isEmpty(item.questionSettingOptions)){
|
|
|
|
|
|
|
|
item.questionSettingOptions.forEach(function (it,i){
|
|
|
|
|
|
|
|
map[it.questionType] = it;
|
|
|
|
|
|
|
|
})
|
|
|
|
|
|
|
|
}
|
|
|
|
var ret = Common.postAjax("/api/resourcesQuestion/questionTypeGroupInfo.do",{courseInfoIdPlural:ids,courseLabelTypePlural:"考证课程类"});
|
|
|
|
var ret = Common.postAjax("/api/resourcesQuestion/questionTypeGroupInfo.do",{courseInfoIdPlural:ids,courseLabelTypePlural:"考证课程类"});
|
|
|
|
if(ret.code == 0){
|
|
|
|
if(ret.code == 0){
|
|
|
|
|
|
|
|
var ctNum = "",hjNum = "";
|
|
|
|
|
|
|
|
if (!$.isEmpty(ret.data)){
|
|
|
|
|
|
|
|
ctNum = 0,hjNum = 0;
|
|
|
|
|
|
|
|
ret.data.forEach(function (it,i){
|
|
|
|
|
|
|
|
if (!$.isEmpty(map[it.questionType])){
|
|
|
|
|
|
|
|
ctNum = ctNum + map[it.questionType].selectCount;
|
|
|
|
|
|
|
|
hjNum = hjNum + map[it.questionType].singleTypeTotalScore;
|
|
|
|
|
|
|
|
it.selectCount = map[it.questionType].selectCount;
|
|
|
|
|
|
|
|
it.singleScore = map[it.questionType].singleScore;
|
|
|
|
|
|
|
|
it.singleTypeTotalScore = map[it.questionType].singleTypeTotalScore;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
}
|
|
|
|
var getTpl = question_demo.innerHTML
|
|
|
|
var getTpl = question_demo.innerHTML
|
|
|
|
,view = document.getElementById('question_view');
|
|
|
|
,view = document.getElementById('question_view');
|
|
|
|
laytpl(getTpl).render({list:ret.data}, function(html){
|
|
|
|
laytpl(getTpl).render({list:ret.data,ctNum:ctNum,hjNum:hjNum}, function(html){
|
|
|
|
view.innerHTML = html;
|
|
|
|
view.innerHTML = html;
|
|
|
|
$("input[name='tnum'],input[name='tfnum']").unbind();
|
|
|
|
$("input[name='tnum'],input[name='tfnum']").unbind();
|
|
|
|
$("input[name='tnum'],input[name='tfnum']").change(function (){
|
|
|
|
$("input[name='tnum'],input[name='tfnum']").change(function (){
|
|
|
|