Browse Source

获取答案选项

master
yanyan 3 years ago
parent
commit
75af002d25
  1. 33
      lib/EmergencyService/zdxtEmergencyBootStart/src/main/resources/templates/project/question/index.html

33
lib/EmergencyService/zdxtEmergencyBootStart/src/main/resources/templates/project/question/index.html

@ -300,20 +300,19 @@
break; break;
case 'template': case 'template':
var template = ` var guid = getUuid();
<div> var template =" <div> " +
<div class="title-box">答案</div> "<div class=\"title-box\">答案</div>" +
<div class="box"> "<div class=\"box\">" +
<select df-channel> "<select df-channel onchange=\"selectAnswer(\'" + guid + "\',this)\">" +
<option value="A">A</option> "<option value=\"A\">A</option>" +
<option value="B">B</option> "<option value=\"B\">B</option>" +
<option value="C">C</option> "<option value=\"C\">C</option>" +
<option value="D">D</option> "<option value=\"D\">D</option>" +
</select> "</select> " +
</div> "</div> " +
</div> "</div>";
`; editor.addNode(guid, 1, 1, pos_x, pos_y, 'template', {"option": 'A', "value": ''}, template);
editor.addNode('template', 1, 1, pos_x, pos_y, 'template', {"template": 'Write your template'}, template);
break; break;
case 'multiple': case 'multiple':
var multiple = ` var multiple = `
@ -412,6 +411,12 @@
$.modal.open("新增题目", "/small/project/question/addNew?guid="+guid+"&parentId=" + sceneRole.guid, 600, 450); $.modal.open("新增题目", "/small/project/question/addNew?guid="+guid+"&parentId=" + sceneRole.guid, 600, 450);
} }
function selectAnswer(guid,obj){
let val = $(obj).val();
//editor.getNodesFromName(guid).at(0).data = JSON.stringify(val);
}
function getUuid() { function getUuid() {
var s = []; var s = [];
var hexDigits = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ" var hexDigits = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ"

Loading…
Cancel
Save