Commit b44a96ab authored by yu's avatar yu

1

parent 3f35cef2
...@@ -93,7 +93,7 @@ export class FormComponent implements OnInit, OnChanges, OnDestroy { ...@@ -93,7 +93,7 @@ export class FormComponent implements OnInit, OnChanges, OnDestroy {
this.save(); this.save();
} }
onAudioName(e, item, key){ onAudioName(e, item, key) {
item[key] = e; item[key] = e;
this.save(); this.save();
} }
...@@ -146,4 +146,48 @@ export class FormComponent implements OnInit, OnChanges, OnDestroy { ...@@ -146,4 +146,48 @@ export class FormComponent implements OnInit, OnChanges, OnDestroy {
this.save(); this.save();
} }
isVisible = false;
deleteTitle = "是否删除题目";
deleteCallback = function () { };
openDelete(title, callback) {
this.deleteCallback = callback;
this.deleteTitle = title;
this.isVisible = true;
}
removeoption(i, j) {
this.openDelete("确定删除选项?", () => {
this.item.questions[i].options.splice(j, 1);
this.save();
})
}
copyoption(i, j) {
let data = this.item.questions[i].options[j];
this.item.questions[i].options.push(JSON.parse(JSON.stringify(data)));
this.save();
}
addoption(i) {
this.item.questions[i].options.push({
type: "",
image: "",
audio: "",
text: "",
duration: "",
right: false
});
this.save();
}
addquestion() {
this.item.questions.push({
options: [],
type: "",
audio: "",
audioName: ""
});
this.save();
}
ngChange(i, j) {
this.save();
}
} }
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