Commit 8c8c9939 authored by 李维's avatar 李维

增加判断对错题型的笑脸哭脸,TF配置

优化文字选项内容,可以填写显示名称
parent 0c3e3030
No preview for this file type
......@@ -28,12 +28,12 @@ export default class NewClass extends cc.Component {
start () {
this.node.active = false;
this.initSize();
this.initTitle();
this.initTitle(this.titleName);
this.initEventListener();
}
initTitle() {
cc.find("center/header/title", this.node).getComponent(cc.Label).string = this.titleName;
initTitle(title) {
cc.find("center/header/title", this.node).getComponent(cc.Label).string = title;
}
initSize() {
......@@ -91,6 +91,7 @@ export default class NewClass extends cc.Component {
const list = cc.find("center/list", this.node);
if(type == "textList") {
this.initTitle("请选择答案");
const listLayout = cc.find("center/list/layout_options", this.node);
const itemTemplate = cc.find("center/list/layout_options/item_tempate", this.node);
listLayout.active = true;
......@@ -115,10 +116,42 @@ export default class NewClass extends cc.Component {
center.height = option.length * this.optionHeight + this.headerHeight;
list.height = option.length * this.optionHeight;
listLayout.height = option.length * this.optionHeight;
} else if(type == "rightWrongIcon") {
} else {
const rightWrongLayout = cc.find("center/list/layout_right_wrong", this.node);
rightWrongLayout.active = true;
const rightIcon = cc.find("right/icon_right", rightWrongLayout);
const laughIcon = cc.find("right/icon_laugh", rightWrongLayout);
const textTrue = cc.find("right/text_true", rightWrongLayout);
const wrongIcon = cc.find("wrong/icon_wrong", rightWrongLayout);
const cryIcon = cc.find("wrong/icon_cry", rightWrongLayout);
const textFalse = cc.find("wrong/text_false", rightWrongLayout);
if(type == "rightWrong_icon") {
this.initTitle("请选择答案");
rightIcon.active = true;
laughIcon.active = false;
textTrue.active = false;
wrongIcon.active = true;
cryIcon.active = false;
textFalse.active = false;
} else if(type == "rightWrong_face") {
this.initTitle("请选择表情");
rightIcon.active = false;
laughIcon.active = true;
textTrue.active = false;
wrongIcon.active = false;
cryIcon.active = true;
textFalse.active = false;
} else if(type == "rightWrong_T_F") {
this.initTitle("请选择答案");
rightIcon.active = false;
laughIcon.active = false;
textTrue.active = true;
wrongIcon.active = false;
cryIcon.active = false;
textFalse.active = true;
}
rightWrongLayout.active = true;
center.height = 350 + this.headerHeight;
list.height = 350;
}
......
{
"ver": "2.3.5",
"uuid": "d1b6c05f-04e6-4b17-8386-4ad1c22dcd53",
"type": "sprite",
"wrapMode": "clamp",
"filterMode": "bilinear",
"premultiplyAlpha": false,
"genMipmaps": false,
"packable": true,
"width": 150,
"height": 150,
"platformSettings": {},
"subMetas": {
"icon_cry": {
"ver": "1.0.4",
"uuid": "85760c3d-ba73-4072-91ec-75ab759fd3e9",
"rawTextureUuid": "d1b6c05f-04e6-4b17-8386-4ad1c22dcd53",
"trimType": "auto",
"trimThreshold": 1,
"rotated": false,
"offsetX": 0.5,
"offsetY": -0.5,
"trimX": 6,
"trimY": 6,
"width": 139,
"height": 139,
"rawWidth": 150,
"rawHeight": 150,
"borderTop": 0,
"borderBottom": 0,
"borderLeft": 0,
"borderRight": 0,
"subMetas": {}
}
}
}
\ No newline at end of file
{
"ver": "2.3.5",
"uuid": "1e2d84e4-affb-4052-b020-92d4301071ff",
"type": "sprite",
"wrapMode": "clamp",
"filterMode": "bilinear",
"premultiplyAlpha": false,
"genMipmaps": false,
"packable": true,
"width": 150,
"height": 150,
"platformSettings": {},
"subMetas": {
"icon_laugh": {
"ver": "1.0.4",
"uuid": "f47db687-fa90-45c2-98bb-714cb160e9ba",
"rawTextureUuid": "1e2d84e4-affb-4052-b020-92d4301071ff",
"trimType": "auto",
"trimThreshold": 1,
"rotated": false,
"offsetX": 0,
"offsetY": 0,
"trimX": 6,
"trimY": 6,
"width": 138,
"height": 138,
"rawWidth": 150,
"rawHeight": 150,
"borderTop": 0,
"borderBottom": 0,
"borderLeft": 0,
"borderRight": 0,
"subMetas": {}
}
}
}
\ No newline at end of file
......@@ -7,8 +7,8 @@
"premultiplyAlpha": false,
"genMipmaps": false,
"packable": true,
"width": 120,
"height": 120,
"width": 130,
"height": 130,
"platformSettings": {},
"subMetas": {
"icon_right": {
......@@ -18,14 +18,14 @@
"trimType": "auto",
"trimThreshold": 1,
"rotated": false,
"offsetX": 0,
"offsetY": 0,
"trimX": 0,
"trimY": 0,
"width": 120,
"height": 120,
"rawWidth": 120,
"rawHeight": 120,
"offsetX": 0.5,
"offsetY": -0.5,
"trimX": 11,
"trimY": 17,
"width": 69,
"height": 57,
"rawWidth": 90,
"rawHeight": 90,
"borderTop": 0,
"borderBottom": 0,
"borderLeft": 0,
......
......@@ -7,8 +7,8 @@
"premultiplyAlpha": false,
"genMipmaps": false,
"packable": true,
"width": 120,
"height": 120,
"width": 90,
"height": 90,
"platformSettings": {},
"subMetas": {
"icon_wrong": {
......@@ -18,14 +18,14 @@
"trimType": "auto",
"trimThreshold": 1,
"rotated": false,
"offsetX": 0,
"offsetY": 0,
"trimX": 0,
"trimY": 0,
"width": 120,
"height": 120,
"rawWidth": 120,
"rawHeight": 120,
"offsetX": 0.5,
"offsetY": 0.5,
"trimX": 18,
"trimY": 10,
"width": 55,
"height": 69,
"rawWidth": 90,
"rawHeight": 90,
"borderTop": 0,
"borderBottom": 0,
"borderLeft": 0,
......
This diff is collapsed.
......@@ -642,6 +642,17 @@ export default class SceneComponent extends MyCocosSceneComponent {
return [result];
};
let showType = "rightWrong_icon";
switch(contentData.rightOrWrongStyleType) {
// 勾 叉
case "symbol": showType = "rightWrong_icon"; break;
// 笑 哭
case "iconFace": showType = "rightWrong_face"; break;
// T F
case "textTF": showType = "rightWrong_T_F"; break;
default: showType = "rightWrong_icon";
}
contentData.contentList.forEach((option, index) => {
const hotZoneData = this.data.hotZoneItemArr[option.selectHotZoneIndex];
const resultRect = this.newRectNode(hotZoneData, layer_2, debugMode);
......@@ -659,7 +670,7 @@ export default class SceneComponent extends MyCocosSceneComponent {
return;
}
let selectResult = await this.asyncShowSelectModal([], "rightWrongIcon");
let selectResult = await this.asyncShowSelectModal([], showType);
if(currentCheckList[index].checked != null) {
currentCheckList[index].mask.destroy();
......@@ -667,16 +678,47 @@ export default class SceneComponent extends MyCocosSceneComponent {
currentCheckList[index].checked = selectResult;
if(selectResult) {
// 哭脸笑脸 - FT - 对错号
if(contentData.rightOrWrongStyleType == "iconFace") {
const {sprNode, picNode} = this.newSprNodeByResName(hotZoneData, "icon_laugh", true);
picNode.zIndex = layer_3;
currentCheckList[index].mask = picNode;
sprNode.on("click", handleClick)
} else if(contentData.rightOrWrongStyleType == "textTF") {
const textParentNode = this.newRectNode(hotZoneData, layer_3, debugMode);
const textNode = this.newTextNode("T")
textNode.x = textParentNode.width / 2;
textNode.y = textParentNode.height / 2;
textParentNode.addChild(textNode)
currentCheckList[index].mask = textParentNode;
textParentNode.on("click", handleClick)
} else {
const {sprNode, picNode} = this.newSprNodeByResName(hotZoneData, "icon_right", true);
picNode.zIndex = layer_3;
currentCheckList[index].mask = picNode;
sprNode.on("click", handleClick)
}
} else {
if(contentData.rightOrWrongStyleType == "iconFace") {
const {sprNode, picNode} = this.newSprNodeByResName(hotZoneData, "icon_cry", true);
picNode.zIndex = layer_3;
currentCheckList[index].mask = picNode;
sprNode.on("click", handleClick)
} else if(contentData.rightOrWrongStyleType == "textTF") {
const textParentNode = this.newRectNode(hotZoneData, layer_3, debugMode);
const textNode = this.newTextNode("F")
textNode.x = textParentNode.width / 2;
textNode.y = textParentNode.height / 2;
textParentNode.addChild(textNode)
currentCheckList[index].mask = textParentNode;
textParentNode.on("click", handleClick)
} else {
const {sprNode, picNode} = this.newSprNodeByResName(hotZoneData, "icon_wrong", true);
picNode.zIndex = layer_3;
currentCheckList[index].mask = picNode;
sprNode.on("click", handleClick)
}
}
// 检查是否可以提交
this.checkCanSubmit();
}
......@@ -1541,7 +1583,7 @@ export default class SceneComponent extends MyCocosSceneComponent {
optionList.push({
index: index,
label: option.text,
label: option.optionShowText ? option.optionShowText : option.text,
value: option.text,
strikeOutNode: strikeOutHotZoneNode
})
......
This diff is collapsed.
{
"ver": "2.3.5",
"uuid": "11eabdee-1a08-4672-a192-a768bc7fb694",
"type": "sprite",
"wrapMode": "clamp",
"filterMode": "bilinear",
"premultiplyAlpha": false,
"genMipmaps": false,
"packable": true,
"width": 150,
"height": 150,
"platformSettings": {},
"subMetas": {
"icon_cry": {
"ver": "1.0.4",
"uuid": "a4fedcd3-3efd-4cff-91c4-d448d8af6389",
"rawTextureUuid": "11eabdee-1a08-4672-a192-a768bc7fb694",
"trimType": "auto",
"trimThreshold": 1,
"rotated": false,
"offsetX": 0.5,
"offsetY": -0.5,
"trimX": 6,
"trimY": 6,
"width": 139,
"height": 139,
"rawWidth": 150,
"rawHeight": 150,
"borderTop": 0,
"borderBottom": 0,
"borderLeft": 0,
"borderRight": 0,
"subMetas": {}
}
}
}
\ No newline at end of file
{
"ver": "2.3.5",
"uuid": "146f6f00-f014-4087-8382-da80e8361363",
"type": "sprite",
"wrapMode": "clamp",
"filterMode": "bilinear",
"premultiplyAlpha": false,
"genMipmaps": false,
"packable": true,
"width": 150,
"height": 150,
"platformSettings": {},
"subMetas": {
"icon_laugh": {
"ver": "1.0.4",
"uuid": "2fdb22fb-df24-4a6f-bcd5-6587531b831c",
"rawTextureUuid": "146f6f00-f014-4087-8382-da80e8361363",
"trimType": "auto",
"trimThreshold": 1,
"rotated": false,
"offsetX": 0,
"offsetY": 0,
"trimX": 6,
"trimY": 6,
"width": 138,
"height": 138,
"rawWidth": 150,
"rawHeight": 150,
"borderTop": 0,
"borderBottom": 0,
"borderLeft": 0,
"borderRight": 0,
"subMetas": {}
}
}
}
\ No newline at end of file
assets/DG_FAF/textures/icon_right.png

4.03 KB | W: | H:

assets/DG_FAF/textures/icon_right.png

2.16 KB | W: | H:

assets/DG_FAF/textures/icon_right.png
assets/DG_FAF/textures/icon_right.png
assets/DG_FAF/textures/icon_right.png
assets/DG_FAF/textures/icon_right.png
  • 2-up
  • Swipe
  • Onion skin
......@@ -7,8 +7,8 @@
"premultiplyAlpha": false,
"genMipmaps": false,
"packable": true,
"width": 120,
"height": 120,
"width": 130,
"height": 130,
"platformSettings": {},
"subMetas": {
"icon_right": {
......@@ -18,14 +18,14 @@
"trimType": "auto",
"trimThreshold": 1,
"rotated": false,
"offsetX": 0,
"offsetY": 0,
"trimX": 0,
"trimY": 0,
"width": 120,
"height": 120,
"rawWidth": 120,
"rawHeight": 120,
"offsetX": 0.5,
"offsetY": -0.5,
"trimX": 11,
"trimY": 17,
"width": 69,
"height": 57,
"rawWidth": 90,
"rawHeight": 90,
"borderTop": 0,
"borderBottom": 0,
"borderLeft": 0,
......
assets/DG_FAF/textures/icon_wrong.png

4.04 KB | W: | H:

assets/DG_FAF/textures/icon_wrong.png

2.29 KB | W: | H:

assets/DG_FAF/textures/icon_wrong.png
assets/DG_FAF/textures/icon_wrong.png
assets/DG_FAF/textures/icon_wrong.png
assets/DG_FAF/textures/icon_wrong.png
  • 2-up
  • Swipe
  • Onion skin
......@@ -7,8 +7,8 @@
"premultiplyAlpha": false,
"genMipmaps": false,
"packable": true,
"width": 120,
"height": 120,
"width": 90,
"height": 90,
"platformSettings": {},
"subMetas": {
"icon_wrong": {
......@@ -18,14 +18,14 @@
"trimType": "auto",
"trimThreshold": 1,
"rotated": false,
"offsetX": 0,
"offsetY": 0,
"trimX": 0,
"trimY": 0,
"width": 120,
"height": 120,
"rawWidth": 120,
"rawHeight": 120,
"offsetX": 0.5,
"offsetY": 0.5,
"trimX": 18,
"trimY": 10,
"width": 55,
"height": 69,
"rawWidth": 90,
"rawHeight": 90,
"borderTop": 0,
"borderBottom": 0,
"borderLeft": 0,
......
This source diff could not be displayed because it is too large. You can view the blob instead.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
......@@ -48,7 +48,7 @@
<h2 style="margin-top: 10px;">热区内容配置:</h2>
<div style="font-size: 16px; border: 2px solid #ccc; border-radius: 10px; padding: 10px;">
<div *ngFor="let it of item.hotZoneConfigArr; let i = index" style="border: 2px dashed #ddd; border-radius: 5px; padding: 10px; margin-bottom: 10px; position: relative;">
<div *ngFor="let it of item.hotZoneConfigArr; let i = index" style="border: 2px dashed #ddd; border-radius: 5px; padding: 10px 10px 50px 10px; margin-bottom: 10px; position: relative;">
<span style="position: absolute; right: 50px; top: 0px; font-size: 42px; font-weight: bold;">{{i + 1}}</span>
<div style="margin: 10px 10px;">
<span style="display: inline-block; text-align: right; width: 150px;">热区内容类型:</span>
......@@ -82,6 +82,7 @@
<th nzWidth="100px" nzAlign="center">序号</th>
<th nzWidth="100px" nzAlign="center">分数</th>
<th>文字</th>
<th>展示文字</th>
<th>正确热区</th>
<th>选择后划掉热区(可选)</th>
<th nzWidth="150px">操作</th>
......@@ -93,6 +94,7 @@
<td nzWidth="100px" nzAlign="center">{{ i + 1 }}</td>
<td nzWidth="100px" nzAlign="center">{{ data.score }}</td>
<td>{{ data.text }}</td>
<td>{{ data.optionShowText }}</td>
<td>
<span style="margin-left: 10px;">热区:{{item.hotZoneItemArr && item.hotZoneItemArr[data.selectHotZoneIndex] ? item.hotZoneItemArr[data.selectHotZoneIndex].itemName : "未配置"}}</span>
</td>
......@@ -113,6 +115,9 @@
<td>
<input type="text" nz-input [(ngModel)]="editCache[data.uuid].data.text" />
</td>
<td>
<input type="text" nz-input [(ngModel)]="editCache[data.uuid].data.optionShowText" />
</td>
<td>
<nz-select nzShowSearch nzAllowClear [(ngModel)]="editCache[data.uuid].data.selectHotZoneIndex" style="width: 180px;" (ngModelChange)="save()">
<nz-option *ngFor="let itOption of item.hotZoneItemArr" [nzValue]="itOption.index" [nzLabel]="itOption.itemName"></nz-option>
......@@ -476,7 +481,7 @@
</nz-table>
</div>
<div *ngIf="it.hotZoneType == AUDIO_PLAY" style="padding: 10px 0 10px 100px;">
<div *ngIf="it.hotZoneType == AUDIO_PLAY" style="padding: 20px 0 10px 150px;">
<app-audio-recorder
[audioUrl]="it.audio_url"
(audioUploaded)="onAudioUploadSuccess($event, 'audio_url', it)"
......@@ -500,6 +505,15 @@
</nz-radio-group>
</div>
<div *ngIf="it.hotZoneType == RIGHT_OR_WRONG" style="margin: 10px 10px;">
<span style="display: inline-block; text-align: right; width: 150px;">选中样式:</span>
<nz-radio-group [(ngModel)]="it.rightOrWrongStyleType" (ngModelChange)="save()">
<label nz-radio nzValue="symbol">对/错号</label>
<label nz-radio nzValue="iconFace">笑/哭脸</label>
<label nz-radio nzValue="textTF">T/F</label>
</nz-radio-group>
</div>
<div *ngIf="it.hotZoneType == TEXTINPUT" style="margin: 10px 10px;">
<span style="display: inline-block; text-align: right; width: 150px;">正确文字:</span>
<input type="text" nz-input [(ngModel)]="it.inputText" (blur)="save()" style="display: inline-block; width: 300px;">
......@@ -526,7 +540,7 @@
</nz-select>
</div>
<div *ngIf="it.hotZoneType != '' && it.hotZoneType != HOT_ZONE_CHECKBOX && it.hotZoneType != CONNECTION && it.hotZoneType != TEXT_SELECT && it.hotZoneType != RIGHT_OR_WRONG" style="margin: 10px 10px;">
<div *ngIf="it.hotZoneType != ''&& it.hotZoneType != AUDIO_PLAY && it.hotZoneType != HOT_ZONE_CHECKBOX && it.hotZoneType != CONNECTION && it.hotZoneType != TEXT_SELECT && it.hotZoneType != RIGHT_OR_WRONG" style="margin: 10px 10px;">
<span style="display: inline-block; text-align: right; width: 150px;">分数:</span>
<input type="text" nz-input [(ngModel)]="it.score" (blur)="save()" style="display: inline-block; width: 300px;">
</div>
......
......@@ -126,6 +126,7 @@ export class FormComponent implements OnInit, OnChanges, OnDestroy, AfterViewIni
score: "0",
unselectedStyle: "none",
selectedStyle: "border",
rightOrWrongStyleType: "symbol",
inputText: "",
contentList: [
......@@ -188,7 +189,8 @@ export class FormComponent implements OnInit, OnChanges, OnDestroy, AfterViewIni
getDefaultConfigContentItem() {
return {
uuid: uuidv4(),
text: "", // 文字选项
text: "", // 文字选项(值)
optionShowText: "", // 选项展示值
image_url: "", // 图片选项
hotZoneIndex: null, // 关联热区
score: 0, // 默认比分
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment