MCPcopy
hub / github.com/ocsjs/ocsjs / onElementSearched

Function onElementSearched

packages/scripts/src/projects/icourse.ts:562–574  ·  view source on GitHub ↗
(elements, root)

Source from the content-addressed store, hash-verified

560 }
561 },
562 onElementSearched(elements, root) {
563 elements.options.forEach((el) => {
564 optimizationElementWithImage(el);
565 const correct = el.querySelector<HTMLElement>('.u-icon-correct');
566 const wrong = el.querySelector<HTMLElement>('.u-icon-wrong');
567 if (correct) {
568 correct.replaceWith('对');
569 }
570 if (wrong) {
571 wrong.replaceWith('错');
572 }
573 });
574 },
575 /** 完成答题后 */
576 onResultsUpdate(curr, _, res) {
577 CommonProject.scripts.workResults.methods.setResults(simplifyWorkResult(res, titleTransform));

Callers

nothing calls this directly

Calls 1

Tested by

no test coverage detected