阅读理解和完形填空的共同处理器
(searchInfos: SearchInformation[], list: HTMLElement[])
| 2194 | |
| 2195 | /** 阅读理解和完形填空的共同处理器 */ |
| 2196 | async function readerAndFillHandle(searchInfos: SearchInformation[], list: HTMLElement[]) { |
| 2197 | for (const answers of searchInfos.map((info) => info.results.map((res) => res.answer))) { |
| 2198 | let ans = answers; |
| 2199 | |
| 2200 | if (ans.length === 1) { |
| 2201 | ans = splitAnswer(ans[0]); |
| 2202 | } |
| 2203 | |
| 2204 | if (ans.filter(Boolean).length !== 0 && list.length !== 0) { |
| 2205 | for (let index = 0; index < ans.length; index++) { |
| 2206 | const item = list[index]; |
| 2207 | if (item) { |
| 2208 | /** 获取每个小题中的准确答案选项 并点击 */ |
| 2209 | $el(`span.saveSingleSelect[data="${ans[index]}"]`, item)?.click(); |
| 2210 | await $.sleep(200); |
| 2211 | } |
| 2212 | } |
| 2213 | |
| 2214 | return { finish: true }; |
| 2215 | } |
| 2216 | } |
| 2217 | |
| 2218 | return { finish: false }; |
| 2219 | } |
| 2220 | |
| 2221 | function hasFaceRecognition() { |
| 2222 | // 人脸元素有时候 src 属性为空字符串,所以这里需要判断 src 是否为空字符串,如是则人脸识别会出现。 |
no test coverage detected