Skip to content

Commit

Permalink
fix(script): 修复智慧职教MOOC自动答题的填空题无法填空的BUG
Browse files Browse the repository at this point in the history
  • Loading branch information
enncy committed Apr 24, 2023
1 parent b213884 commit 565f879
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion packages/scripts/src/projects/icve.ts
Original file line number Diff line number Diff line change
Expand Up @@ -318,7 +318,7 @@ function work({ answererWrappers, period, thread }: CommonWorkOptions) {
root: '.q_content',
elements: {
title: '.divQuestionTitle',
options: '.questionOptions .q_option'
options: '.questionOptions .q_option,.questionOptions.divTextarea '
},
/** 其余配置 */
requestPeriod: period ?? 3,
Expand Down Expand Up @@ -349,9 +349,16 @@ function work({ answererWrappers, period, thread }: CommonWorkOptions) {
}
} else if (type === 'completion' && answer.trim()) {
const text = option.querySelector('textarea');
const textIframe = option.querySelector<HTMLIFrameElement>('iframe[id*="ueditor"]');
if (text) {
text.value = answer;
}
if (textIframe) {
const view = textIframe.contentWindow?.document.querySelector<HTMLElement>('.view');
if (view) {
view.innerText = answer;
}
}
}
}
},
Expand Down

0 comments on commit 565f879

Please sign in to comment.