|
@@ -60,6 +60,7 @@
|
|
|
</div>
|
|
|
<div
|
|
|
ref="answerDiv"
|
|
|
+ @keydown="disableCtrl"
|
|
|
:contenteditable="true"
|
|
|
v-html="studentAnswer"
|
|
|
v-once
|
|
@@ -115,6 +116,14 @@ export default {
|
|
|
methods: {
|
|
|
...mapMutations(["updateExamQuestion"]),
|
|
|
...mapGetters(["examShouldShowAnswer"]),
|
|
|
+ disableCtrl(e) {
|
|
|
+ if (e.ctrlKey || e.metaKey || e.altKey) {
|
|
|
+ // .ctrlKey tells that ctrl key was pressed.
|
|
|
+ e.preventDefault();
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+ return true;
|
|
|
+ },
|
|
|
textCopy() {
|
|
|
var selElm = getSelection();
|
|
|
var selRange = selElm.getRangeAt(0);
|
|
@@ -175,6 +184,9 @@ export default {
|
|
|
.replace(/<sub><\/sub>/gi, "")
|
|
|
.replace(/<script/gi, "<script")
|
|
|
.replace(/script>/gi, "script>");
|
|
|
+ // .replace(/</gi, "<")
|
|
|
+ // .replace(/>/gi, ">")
|
|
|
+ // .replace(/<div><br><\/div>/gi, "<div><br></div>");
|
|
|
}
|
|
|
if (realAnswer !== this.examQuestion.studentAnswer) {
|
|
|
this.updateExamQuestion({
|