| 788 | let resolvedCount = 0; |
| 789 | |
| 790 | function getType(options: HTMLElement[]) { |
| 791 | const radio_len = options |
| 792 | .map((o) => o.querySelector('[type="radio"]')) |
| 793 | .reduce((a, b) => { |
| 794 | return a + (b ? 1 : 0); |
| 795 | }, 0); |
| 796 | |
| 797 | return radio_len > 0 |
| 798 | ? radio_len === 2 |
| 799 | ? 'judgement' |
| 800 | : 'single' |
| 801 | : options.some((o) => o.querySelector('[type="checkbox"]')) |
| 802 | ? 'multiple' |
| 803 | : options.some((o) => o.querySelector('textarea')) |
| 804 | ? 'completion' |
| 805 | : options.some((o) => o.querySelector('.fillblank_input input')) |
| 806 | ? 'fill-blank' |
| 807 | : undefined; |
| 808 | } |
| 809 | |
| 810 | const worker = new OCSWorker({ |
| 811 | root: '.q_content', |