123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921 |
- <?xml version="1.0" encoding="utf-8"?>
- <Script type="xscript4.0"><![CDATA[var condesNode = "ds_codes";
- var indent = 20;
- var tabWidth = 780;
- var qeustGap = 15;
- // div 안쪽에 있는 components의 부모를 포함한 전체 경로를 리턴한다 (예- div01.div02.comp01)
- function fGetComponentsFullIdToSting(prnt, id) {
- var result = "";
-
- var tempParent = prnt;
-
- while(tempParent != "[object Form]") {
- var separator = (result == "") ? "" : ".";
- result = tempParent.name + separator + result;
- tempParent = tempParent.parent;
- }
-
- result = result + "." + id;
-
- return result;
- }
- function fSetRef(prnt, ref, id, oCheckBox) {
- var refs = ref.split("/");
-
- // checkboxlist 는 bind가 안되므로 이렇게 값을 입력 해놓고 나중에 처리함
- if(!utlf_isNull(oCheckBox)) {
- oCheckBox.bindDsNm = refs[0];
- oCheckBox.bindColNm = refs[1];
- } else {
- var sCompFullId = fGetComponentsFullIdToSting(prnt, id);
- var objBindItem = new BindItem();
- objBindItem.init("item_" + id, sCompFullId, "value", refs[0], refs[1]);
- this.addChild("item_" + id, objBindItem);
- objBindItem.bind();
- }
- }
- // 라디오나 콤보에 사용하는 innerdataset을 바로 전에 만들어 놓은 중간데이터를 가지고 생성
- function makeNodeSet(parentNode, codes) {
- var sDs = dsf_createDs(parentNode, [{col:"label", type:"string", size:256}, {col:"value", type:"string", size:256}]);
- var oDs = this.objects[sDs];
-
- oDs.enableevent = false;
- for(var i = 0; i < codes.length; i++) {
- var nRow = oDs.addRow();
- oDs.setColumn(nRow, "label", (i + 1) + ") " + codes[i].label);
- oDs.setColumn(nRow, "value", codes[i].value);
- }
- oDs.enableevent = true;
- }
- // 라디오나 콤보에 innerdataset 및 컬럼 연결
- function makeItemset(control, nodeSetXPath) {
- if(control == "cp_checkboxList") {
- var sProp="col=" + control.col + ",row=" + control.row + ",cellspacing=4,vcellspacing=0,itemWidth=-1,itemHeight=20,overflow='visible'";
- control.setInitComp(sProp, this.objects[nodeSetXPath], "value", "label", "fn_checkbox_Event");
- } else {
- control.codecolumn = "value";
- control.datacolumn = "label";
- control.innerdataset = nodeSetXPath;
- }
- }
- // 체크박스에서 체크 또는 해제시 데이터셋에 값 입력 하는 부분
- function fn_checkbox_Event() {
- var sCompFullId = fGetComponentsFullIdToSting(objForm.parent, objForm.name);
- var oCheckbox = eval(sCompFullId);
- var checkedData = oCheckbox.getData();
- var oDs = this.objects[oCheckbox.bindDsNm];
- oDs.enableevent = false;
- oDs.setColumn(0, oCheckbox.bindColNm, checkedData.join([',']));
- oDs.enableevent = true;
- }
- // 라디오나 콤보에서 사용하는 innerdataset을 만들기 전 중간 데이터 생성
- function retriveNodeSet(ctrlInfos) {
- var nodeSet = new Array();
- for (var i = 0; i < ctrlInfos.length; i++) {
- nodeSet[i] = {"label":ctrlInfos[i].qestitemanswcnts , "value":ctrlInfos[i].answseqno};
- }
-
- return nodeSet;
- }
- // 라디오 버튼 생성
- function makeRadio(prnt, id, ref, parentNode, nodeSet, cols, left, top, width, height) {
- if(utlf_isNull(id)) {
- alert("id는 필수 입니다.");
- return;
- }
- if(utlf_isNull(ref)) {
- alert(" ref 는 필수 입니다.");
- return;
- }
-
- // nodeSet 생성
- var nodeSetXPath = parentNode + ("_radioNodeSet" + id);
- var length = 0;
-
- if(!utlf_isNull(nodeSet) && nodeSet.length > 0) {
- makeNodeSet(nodeSetXPath, nodeSet);
- length = nodeSet.length;
- }
- if(utlf_isNull(left)) {
- left = 0;
- }
-
- if(utlf_isNull(top)) {
- top = 0;
- }
-
- // 컬럼수
- if(utlf_isNull(cols)) {
- cols = 1;
- }
-
- // 넓이
- if(utlf_isNull(width)) {
- //width = 300; //
- width = prnt.position.width - left; // 항상 부모 크기까지 꽉 차도록 width 설정
- }
- //width = width * cols;
-
- // 행수 기본 1
- var tmpRows = 1;
- if(length > 0) {
- tmpRows = Math.floor((length / cols)) + ( (length % cols) == 0 ? 0 : 1);
- }
-
- // 높이
- if(utlf_isNull(height)) {
- height = 20;
- }
-
- height = ((height * tmpRows) - (2 * (tmpRows - 1)));
-
- var objRadio = new Radio(id, left, top, left + width, top + height);
- prnt.addChild(id, objRadio);
- objRadio.show();
-
- // 행이 하나 뿐일 때는 -1 값 적용하여 아이템간 간격 최적화
- if(tmpRows < 2) {
- tmpRows = -1;
- cols = -1;
- }
-
- objRadio.columncount = cols;
- objRadio.index = -1;
- objRadio.rowcount = tmpRows;
- objRadio.style.textpadding = "0 16 0 5";
-
- makeItemset(objRadio, nodeSetXPath);
-
- fSetRef(prnt, ref, id);
- return objRadio;
- }
- // 라디오 버튼 생성
- function makeRadioSingleItem(prnt, id, ref, parentNode, item, cols, left, top, width, height) {
- if(utlf_isNull(id)) {
- alert("id는 필수 입니다.");
- return;
- }
- if(utlf_isNull(ref)) {
- alert(" ref 는 필수 입니다.");
- return;
- }
-
- if(utlf_isNull(left)) {
- left = 0;
- }
-
- if(utlf_isNull(top)) {
- top = 0;
- }
-
- // 컬럼수
- if(utlf_isNull(cols)) {
- cols = 1;
- }
-
- // 넓이
- if(utlf_isNull(width)) {
- width = 300;
- }
-
- // 행수 기본 1
- var tmpRows = 1;
-
- // 높이
- if(utlf_isNull(height)) {
- height = 32;
- }
-
- height = ((height * tmpRows) - (2 * (tmpRows - 1)));
- var objRadio = new Radio(id, left, top, left + width, top + height);
- prnt.addChild(id, objRadio);
- objRadio.show();
-
- objRadio.columncount = cols;
- objRadio.index = -1;
- objRadio.rowcount = tmpRows;
- objRadio.style.textpadding = "0 16 0 5";
-
- var nodeSetXPath = dsf_createDsRow("ds_" + id, [{col:"value", type:"string", size:256, val:item.value}
- , {col:"label", type:"string", size:256, val:item.label}]);
-
- makeItemset(objRadio, nodeSetXPath);
-
- fSetRef(prnt, ref, id);
-
- return objRadio;
- }
- //10점척도 Radio
- function makeRadioSingleItem10(prnt, id, ref, parentNode, item, cols, left, top, width, height) {
- if(utlf_isNull(id)) {
- alert("id는 필수 입니다.");
- return;
- }
- if(utlf_isNull(ref)) {
- alert(" ref 는 필수 입니다.");
- return;
- }
-
- if(utlf_isNull(left)) {
- left = 0;
- }
-
- if(utlf_isNull(top)) {
- top = 0;
- }
-
- // 컬럼수
- if(utlf_isNull(cols)) {
- cols = 1;
- }
-
- // 넓이
- if(utlf_isNull(width)) {
- width = 30;
- }
-
- // 행수 기본 1
- var tmpRows = 1;
-
- // 높이
- if(utlf_isNull(height)) {
- height = 32;
- }
-
- height = ((height * tmpRows) - (2 * (tmpRows - 1)));
-
- var objRadio = new Radio(id, left, top, left + width, top + height);
- prnt.addChild(id, objRadio);
- objRadio.show();
-
- objRadio.columncount = cols;
- objRadio.index = -1;
- objRadio.rowcount = tmpRows;
- objRadio.style.textpadding = "0 16 0 5";
-
- var nodeSetXPath = dsf_createDsRow("ds_" + id, [{col:"value", type:"string", size:256, val:item.value}
- , {col:"label", type:"string", size:256, val:item.label}]);
-
- makeItemset(objRadio, nodeSetXPath);
-
- fSetRef(prnt, ref, id);
-
- return objRadio;
- }
- // 체크 박스 생성
- function makeCheckbox(prnt, id, ref, parentNode, nodeSet, cols, left, top, width, height) {
- if(utlf_isNull(id)) {
- alert("id는 필수 입니다.");
- return;
- }
- if(utlf_isNull(ref)) {
- alert(" ref 는 필수 입니다.");
- return;
- }
-
- // ndoeSet 생성
- var nodeSetXPath = parentNode +("_checkBoxNodeSet" + id);
- var length = 0;
- if(!utlf_isNull(nodeSet) && nodeSet.length > 0 ) {
- makeNodeSet(nodeSetXPath, nodeSet);
- length = nodeSet.length;
- } // end if
-
- if(utlf_isNull(left)) {
- left = 0;
- }
-
- if(utlf_isNull(top)) {
- top = 0;
- }
-
- // 컬럼수
- if(utlf_isNull(cols)) {
- cols = 1;
- }
-
- // 넓이
- var tmWidth = 300;
- if(utlf_isNull(width)) {
- //width = 300;
- width = prnt.position.width - left; // 항상 부모 크기까지 꽉 차도록 width 설정
- }
-
- // 행수 기본 1
- var tmpRows = 1;
- if(length > 0) {
- tmpRows = Math.floor((length / cols)) + ( (length % cols) == 0 ? 0 : 1);
- }
-
- // 높이
- if(utlf_isNull(height)) {
- height = 20;
- } // end if
-
- height = ((height * tmpRows) - (2 * (tmpRows - 1)));
-
- // 기본 스타일
- var objCheckbox = new cp_checkboxList(id, left, top, left + width, top + height);
- prnt.addChild(id, objCheckbox);
- objCheckbox.show();
-
- objCheckbox.col = cols;
- objCheckbox.row = tmpRows;
-
- makeItemset(objCheckbox, nodeSetXPath);
-
- fSetRef(prnt, ref, id, objCheckbox);
-
- return objCheckbox;
- }
- // Input 생성
- function makeInput(prnt, id, ref, left, top, width, height) {
- if(utlf_isNull(id)) {
- alert("id는 필수 입니다.");
- return;
- }
-
- if(utlf_isNull(ref)) {
- alert(" ref 는 필수 입니다.");
- return;
- }
-
- if(utlf_isNull(left)) {
- left = 0;
- }
-
- if(utlf_isNull(top)) {
- top = 0;
- }
-
-
- // 넓이
- var tmWidth = 400;
- if(utlf_isNull(width)) {
- width = 400;
- }
-
- // 높이
- if(utlf_isNull(height)) {
- height = 20;
- } // end if
-
- var objEdit = new Edit(id, left, top, left + width, top + height);
- prnt.addChild(id, objEdit);
- objEdit.show();
- objEdit.autoselect = true;
- objEdit.imemode = "hangul";
-
- fSetRef(prnt, ref, id);
- return objEdit;
- }
- // Textarea 생성
- function makeTextarea(prnt, id, ref, left, top, width, height) {
- if(utlf_isNull(id)) {
- alert("id는 필수 입니다.");
- return;
- }
-
- if(utlf_isNull(ref)) {
- alert(" ref 는 필수 입니다.");
- return;
- }
-
- if(utlf_isNull(left)) {
- left = 0;
- }
-
- if(utlf_isNull(top)) {
- top = 0;
- }
-
- // 넓이
- var tmWidth = 600;
- if(utlf_isNull(width)) {
- width = 600;
- }
-
- // 높이
- var tmpHeight = 60;
- if(utlf_isNull(height)) {
- height = 60;
- }
-
- var objTextArea = new TextArea(id, left, top, left + width, top + height);
- prnt.addChild(id, objTextArea);
- objTextArea.show();
- objTextArea.autoselect = true;
- objTextArea.imemode = "hangul";
-
- fSetRef(prnt, ref, id);
- return objTextArea;
- }
- // 출력 필요한 넓이 구하기
- var korCharWidth = 13; // 한글 자평
- var engCharWidth = 7; // 영어 자평
- var spaceCharWidth = 4; // 공백 자평
- function getNeedWidth(value) {
- var needWidth = 0;
- for (var i = 0; i < value.length; i++) {
- if(value.charCodeAt(i) > 255) {
- needWidth += korCharWidth;
- } else if(value.charCodeAt(i) == 32) {
- needWidth += spaceCharWidth;
- } else {
- needWidth += engCharWidth;
- } // end if
- } // end for
- return needWidth;
- }
- // Output 생성
- function makeOutput(prnt, value, objName, left, top, width, height) {
- if(utlf_isNull(value)) value = "";
- if(utlf_isNull(left)) left = 0;
- if(utlf_isNull(top)) top = 0;
- if(utlf_isNull(width)) width = tabWidth;
- if(utlf_isNull(height)) height = 18;
-
- // 문자열 맨끝에 붙는것에 대한 예외처리
- value = value.replace(String.fromCharCode(10), "");
-
- var needWidth = getNeedWidth(value);
- var rows = Math.floor(needWidth / width);
- if(rows < 1) rows = 1;
-
- height = height + (14 * rows);
- var objStatic = new Static(objName, left, top, left + width, top + height);
- prnt.addChild(objName, objStatic);
- objStatic.show();
- objStatic.wordwrap = "word";
- objStatic.linespace = 3;
- objStatic.text = value;
- return objStatic;
- }
- // Button 생성
- function makeButton(prnt, pos, value, left, top, width, height) {
- if(utlf_isNull(left)) {
- left = 0;
- }
-
- if(utlf_isNull(top)) {
- top = 0;
- }
- var needWidth = getNeedWidth(value) + 16; // 좌우 공백과 초기 이미지
- // 넓이
- width = needWidth;
-
- // 높이
- if(utlf_isNull(height)) {
- height = 20;
- } // end if
-
- if(pos > 0) {
- var button = prnt.components["Button_tab_" + (pos - 1)];
- left = button.position.right;
- }
-
- var objButton = new Button("Button_tab_" + pos, left, top, left + width, top + height);
- objButton.class = "btn_sw";
- prnt.addChild("Button_tab_" + pos, objButton);
- objButton.show();
-
- objButton.text = value;
- return objButton;
- }
- var nodeColumnNames = new Array("qpaprseqno", "qestitemgrupseqno", "qestseqno", "qpaprsortseq", "itemkindcd",
- "qestanswno", "qestmltlanswno", "divpnt", "descinptcnts", "descinptaddcnts",
- "qestrspsyn", "norpaddyn");
- // 데이타를 저장할 데이터셋 및 컬럼 생성
- function makeDataNode(ref, ctrlInfos) {
- var ctrlInfo = ctrlInfos[ctrlInfos.length - 1];
- var rowRef = ref + "_row" + ctrlInfo.qpaprsortseq;
- var sDs = dsf_createDs(rowRef);
- var oDs = this.objects[sDs];
-
- for(var i = 0; i < nodeColumnNames.length; i ++) {
- var colName = nodeColumnNames[i];
-
- if (colName == "qestanswno" || colName == "qestmltlanswno" || colName == "divpnt"){
- dsf_makeValue(oDs, colName, "string", "");
- } else {
- dsf_makeValue(oDs, colName, "string", ctrlInfo[colName]);
- }
- }
-
- return rowRef;
- }
- // 각 문항 마다 Div를 만들어서 그 안에 실제 문제를 생성
- function makeGroup(prnt, id, left, top, width, height) {
- if(utlf_isNull(left)) left = 0;
- if(utlf_isNull(top)) top = 0;
- if(utlf_isNull(width)) width = tabWidth;//width = 0;
- if(utlf_isNull(height)) height = 0;
-
- var objDivName = "Div" + id;
- var objDiv = new Div(objDivName, left, top, left + width, top + height);
- prnt.addChild(objDivName, objDiv);
- objDiv.show();
- return objDiv;
- }
- // Case 생성
- function makeCase(prnt, id, btnText) {
- var tabIndex = prnt.insertTabpage(id, 0, "", btnText);
-
- return prnt.components[tabIndex];
- }
- // 단일 선택
- function makeSingleSelect(prnt, ctrlInfos, ref, left, top) {
- // 문항을 묶을 Div
- var group = makeGroup(prnt, ctrlInfos[0].qpaprsortseq, left, top);
-
- var qestcnts = ctrlInfos[0].qpaprsortseq + ". " + ctrlInfos[0].qestcnts;
- var objName = "stt_qestcnts_" + ctrlInfos[0].qpaprsortseq;
- var output = makeOutput(group, qestcnts, objName, 0, 0, tabWidth);
-
- var inTop = output.position.height;
-
- var nodeSet = retriveNodeSet(ctrlInfos);
-
- var qestseqno = ctrlInfos[0].qestseqno; //
- var qestitemanswchoicolcnt = ctrlInfos[0].qestitemanswchoicolcnt; // clos 수
- var descinptyn = ctrlInfos[ctrlInfos.length - 1].descinptyn; // 서술 입력 필드 여부
-
- var rowRef = makeDataNode(ref, ctrlInfos);
-
- var radio = makeRadio(group, "rdo" + qestseqno, rowRef + "/qestanswno", condesNode, nodeSet, qestitemanswchoicolcnt, indent, inTop);
-
- inTop = inTop + radio.position.height;
-
- group.position.height = inTop + qeustGap;
-
- return group;
- }
- // 다중 선택
- function makeMultiSelect(prnt, ctrlInfos, ref, left, top) {
- var group = makeGroup(prnt, ctrlInfos[0].qpaprsortseq, left, top);
- var qestcnts = ctrlInfos[0].qpaprsortseq + ". " + ctrlInfos[0].qestcnts;
- var objName = "stt_qestcnts_" + ctrlInfos[0].qpaprsortseq;
- var output = makeOutput(group, qestcnts, objName, 0, 0, tabWidth);
- var inTop = output.position.height;
- var nodeSet = retriveNodeSet(ctrlInfos);
- var qestseqno = ctrlInfos[0].qestseqno;
- var qestitemanswchoicolcnt = ctrlInfos[0].qestitemanswchoicolcnt;
- var rowRef = makeDataNode(ref, ctrlInfos);
- var checkbox = makeCheckbox(group, "ch" + qestseqno, rowRef + "/qestmltlanswno", condesNode, nodeSet, qestitemanswchoicolcnt, indent, inTop);
- inTop = inTop + checkbox.position.height;
- var descinptyn = ctrlInfos[ctrlInfos.length - 1].descinptyn;
- if(descinptyn == "Y") {
- // var input = makeInput(group, "ip" + qestseqno, rowRef + "/descinptcnts", indent, inTop);
- // inTop = inTop + parseInt(input.attribute("height") ,10) ;
- }
- group.position.height = inTop + qeustGap;
- return group;
- }
- // 단답형
- function makeShortAnswer(prnt, ctrlInfos, ref, left, top) {
- var group = makeGroup(prnt, ctrlInfos[0].qpaprsortseq, left, top);
-
- var qestcnts = ctrlInfos[0].qpaprsortseq + ". " + ctrlInfos[0].qestcnts;
- var objName = "stt_qestcnts_" + ctrlInfos[0].qpaprsortseq;
- var output = makeOutput(group, qestcnts, objName, 0, 0, tabWidth);
- var inTop = output.position.height;
-
- var nodeSet = retriveNodeSet(ctrlInfos);
- var qestseqno = ctrlInfos[0].qestseqno;
- var qestitemanswcnts = ctrlInfos[0].answseqno + ") " + ctrlInfos[0].qestitemanswcnts;
-
- var addinptyn = ctrlInfos[0].addinptyn;
- var answaddcnts = ctrlInfos[0].answaddcnts;
- var width;
- var left = indent;
- if(qestitemanswcnts.length > 0) {
- width = qestitemanswcnts.length * 18;
- var objName = "stt_qestcnts_" + ctrlInfos[0].qpaprsortseq + "_" + ctrlInfos[0].answseqno;
- var output = makeOutput(group, qestitemanswcnts, objName, left, inTop, width);
- left = left + width;
- width = 100;
- }
-
- var rowRef = makeDataNode(ref, ctrlInfos);
- var input = makeInput(group, "ip" + qestseqno, rowRef + "/descinptcnts", left, inTop + 5, width);
-
- if(addinptyn == "Y") {
- left = input.position.right + 30;
-
- if(answaddcnts.length > 0) {
- width = answaddcnts.length * 18;
- objName = "stt_qestcnts_" + ctrlInfos[0].qpaprsortseq + "_" + ctrlInfos[0].answseqno + "_2";
- var output = makeOutput(group, answaddcnts, objName, left, inTop, width);
- left = left + width;
- }
-
- width = 100;
-
- var appInput = makeInput(group, "ipapp" + qestseqno, rowRef + "/descinptaddcnts", left, inTop + 5, width);
- }
-
- inTop = input.position.bottom;
- group.position.height = inTop + qeustGap;
-
- return group;
- }
- // 서술 입력
- function makeDescriptiveAnswer(prnt, ctrlInfos, ref, left, top) {
- var group = makeGroup(prnt, ctrlInfos[0].qpaprsortseq, left, top);
-
- var qestcnts = ctrlInfos[0].qpaprsortseq + ". " + ctrlInfos[0].qestcnts;
- var objName = "stt_qestcnts_" + ctrlInfos[0].qpaprsortseq;
- var output = makeOutput(group, qestcnts, objName, 0, 0, tabWidth);
- var inTop = output.position.height;
- var nodeSet = retriveNodeSet(ctrlInfos);
- var qestseqno = ctrlInfos[0].qestseqno;
-
- var rowRef = makeDataNode(ref, ctrlInfos);
- var textarea = makeTextarea(group, "ta" + qestseqno, rowRef + "/descinptcnts", indent, inTop);
- inTop = inTop + textarea.position.height;
- group.position.height = inTop + qeustGap;
- return group;
- }
- var cellWidth = 80; // 척도 컬럼 width
- // 척도 선택
- function makeMeasure(prnt, ctrlInfos, ref, left, top, isPrintTitle) {
- var group = makeGroup(prnt, ctrlInfos[0].qpaprsortseq, left, top);
- var nodeSet = retriveNodeSet(ctrlInfos);
-
- var rowIndex = ctrlInfos.length - 1;
- var qestcnts = ctrlInfos[rowIndex].qpaprsortseq + ". " + ctrlInfos[rowIndex].qestcnts;
- var qestseqno = ctrlInfos[rowIndex].qestseqno;
- var itemkindcd = ctrlInfos[rowIndex].itemkindcd;
- var qestitemanswchoicolcnt = ctrlInfos[rowIndex].qestitemanswchoicolcnt; // cols 수
- var norpaddyn = ctrlInfos[rowIndex].norpaddyn; // 무응답여부
- var width = tabWidth - (cellWidth * ctrlInfos.length);
- var inTop = 0;
- var inLeft = width;
-
- // 타이틀 출력
- if(isPrintTitle) {
- var headCells = new Array();
-
- var objName = "stt_qestcnts_" + ctrlInfos[0].qpaprsortseq + "_header";
- var titleOutput = makeOutput(group, "질문", objName, 0, inTop, width);
- headCells[0] = titleOutput;
- var maxHeadHeight = titleOutput.position.height;
-
- for (var i = 0; i < ctrlInfos.length; i++) {
- objName = "stt_qestcnts_" + ctrlInfos[i].qpaprsortseq + "_" + ctrlInfos[i].answseqno;
- titleOutput = makeOutput(group, nodeSet[i].label, objName, inLeft, inTop, cellWidth);
- headCells[i + 1] = titleOutput;
- var headHeight = titleOutput.position.height;
- maxHeadHeight = maxHeadHeight > headHeight ? maxHeadHeight: headHeight;
- inLeft += cellWidth;
- } // end for
- for (var i = 0; i < headCells.length; i++) {
- headCells[i].position.height = maxHeadHeight;
- headCells[i].style.border = "1 solid #000000";
- headCells[i].style.background = "#cce8ff";
- headCells[i].style.align = "center middle";
- } // end for
- inTop = inTop + maxHeadHeight;
- } // end if
- // 텍스트 출력
- var objName = "stt_qestcnts_" + ctrlInfos[0].qpaprsortseq;
- var output = makeOutput(group, qestcnts, objName, 0, inTop, width);
- output.style.border = "1 solid #000000";
-
- var inHeight = output.position.height;
-
- var rowRef = makeDataNode(ref, ctrlInfos);
- var colRef = rowRef + "/qestanswno";
-
- inLeft = width;
- var cellGroup;
- var radio;
- for (var i = 0; i < ctrlInfos.length; i++) {
- var answseqno = ctrlInfos[i].answseqno;
- var cellGroupId = ctrlInfos[i].qpaprsortseq + "_" + ctrlInfos[i].answseqno;
- cellGroup = makeGroup(group, cellGroupId, inLeft, inTop, cellWidth, inHeight);
- cellGroup.style.border = "1 solid #000000";
- radio = makeRadioSingleItem(cellGroup, "rd" + qestseqno + answseqno, colRef, condesNode, {label: "", value:nodeSet[i].value}, qestitemanswchoicolcnt, 0, inHeight / 2 - 18, cellWidth);
- radio.style.buttonalign = "center middle";
- inLeft += cellWidth;
- } // end for
- inTop = output.position.bottom;
- group.position.height = inTop;
- return group;
- }
- var cell10Width = 30; // 척도 컬럼 width
- // 10점 척도 선택
- function make10Measure(prnt, ctrlInfos, ref, left, top, isPrintTitle) {
- var group = makeGroup(prnt, ctrlInfos[0].qpaprsortseq, left, top);
- var nodeSet = retriveNodeSet(ctrlInfos);
-
- var rowIndex = ctrlInfos.length - 1;
- var qestcnts = ctrlInfos[rowIndex].qpaprsortseq + ". " + ctrlInfos[rowIndex].qestcnts;
- var qestseqno = ctrlInfos[rowIndex].qestseqno;
- var itemkindcd = ctrlInfos[rowIndex].itemkindcd;
- var qestitemanswchoicolcnt = ctrlInfos[rowIndex].qestitemanswchoicolcnt; // cols 수
- var norpaddyn = ctrlInfos[rowIndex].norpaddyn; // 무응답여부
- var width = tabWidth - (cell10Width * ctrlInfos.length);
- var inTop = 0;
- var inLeft = width;
-
- // 타이틀 출력
- if(isPrintTitle) {
- var headCells = new Array();
-
- var objName = "stt_qestcnts_" + ctrlInfos[0].qpaprsortseq + "_header";
- var titleOutput = makeOutput(group, "질문", objName, 0, inTop, width);
- headCells[0] = titleOutput;
- var maxHeadHeight = titleOutput.position.height;
-
- for (var i = 0; i < ctrlInfos.length; i++) {
- objName = "stt_qestcnts_" + ctrlInfos[i].qpaprsortseq + "_" + ctrlInfos[i].answseqno;
- titleOutput = makeOutput(group, nodeSet[i].label, objName, inLeft, inTop, cell10Width);
- headCells[i + 1] = titleOutput;
- var headHeight = titleOutput.position.height;
- maxHeadHeight = maxHeadHeight > headHeight ? maxHeadHeight: headHeight;
- inLeft += cell10Width;
- } // end for
-
- for (var i = 0; i < headCells.length; i++) {
- headCells[i].position.height = maxHeadHeight;
- headCells[i].style.border = "1 solid #000000";
- headCells[i].style.background = "#cce8ff";
- headCells[i].style.align = "center middle";
- } // end for
- inTop = inTop + maxHeadHeight;
- } // end if
- // 텍스트 출력
- var objName = "stt_qestcnts_" + ctrlInfos[0].qpaprsortseq;
- var output = makeOutput(group, qestcnts, objName, 0, inTop, width);
- output.style.border = "1 solid #000000";
-
- var inHeight = output.position.height;
-
- var rowRef = makeDataNode(ref, ctrlInfos);
- var colRef = rowRef + "/qestanswno";
-
- inLeft = width;
- var cellGroup;
- var radio;
- for (var i = 0; i < ctrlInfos.length; i++) {
- var answseqno = ctrlInfos[i].answseqno;
- var cellGroupId = ctrlInfos[i].qpaprsortseq + "_" + ctrlInfos[i].answseqno;
- cellGroup = makeGroup(group, cellGroupId, inLeft, inTop, cell10Width, inHeight);
- cellGroup.style.border = "1 solid #000000";
- radio = makeRadioSingleItem10(cellGroup, "rd" + qestseqno + answseqno, colRef, condesNode, {label: "", value:nodeSet[i].value}, qestitemanswchoicolcnt, 0, inHeight / 2 - 16, cell10Width);
- radio.style.buttonalign = "center middle";
- inLeft += cell10Width;
- } // end for
- inTop = output.position.bottom;
- group.position.height = inTop;
-
- return group;
- }
- // 설문 생성
- function createPoll(prnt, ctrlInfos, ref, left, top, isContinuous) {
- if(ctrlInfos.length < 1) {
- alert("설문이 없습니다");
- return;
- }
-
- var poll;
- var itemkindcd = ctrlInfos[0].itemkindcd;
- //trace("itemkindcd : " + itemkindcd + ", " + ctrlInfos);
- switch(itemkindcd) {
- case "1":
- poll = makeSingleSelect(prnt, ctrlInfos, ref, left, top);
- break;
- case "2":
- poll = makeMultiSelect(prnt, ctrlInfos, ref, left, top);
- break;
- // case "3":
- // poll = makePriority(prnt, ctrlInfos, ref, left, top);
- // break;
- case "4":
- poll = makeShortAnswer(prnt, ctrlInfos, ref, left, top);
- break;
- case "5":
- poll = makeDescriptiveAnswer(prnt, ctrlInfos, ref, left, top);
- break;
- case "6":
- case "7":
- case "8":
- poll = makeMeasure(prnt, ctrlInfos, ref, left, top, isContinuous);
- break;
- case "10":
- poll = make10Measure(prnt, ctrlInfos, ref, left, top, isContinuous);
- break;
- }
-
- return poll;
- }
- function isIdentical(arPreDatas, arDatas) {
- var identical = false;
- if (!utlf_isNull(arPreDatas)) {
- if(arPreDatas.length == arDatas.length) {
- for(var i = 0; i < arPreDatas.length; i ++) {
- if(arPreDatas[i].qestitemanswcnts == arDatas[i].qestitemanswcnts) {
- identical = true;
- } else {
- identical = false;
- break;
- }
- } // end for
- } else {
- identical = false;
- }
- } else {
- identical = false;
- } // end if
- return identical;
- }]]></Script>
|