(size, arr=null)
| 113 | } |
| 114 | |
| 115 | function getRandomSubarray(size, arr=null) { |
| 116 | if (arr == null) { |
| 117 | arr = []; |
| 118 | for (let i = 1; i < 1001; i++) { |
| 119 | arr.push(i); |
| 120 | } |
| 121 | } |
| 122 | var shuffled = arr.slice(0), i = arr.length, temp, index; |
| 123 | while (i--) { |
| 124 | index = Math.floor((i + 1) * Math.random()); |
| 125 | temp = shuffled[index]; |
| 126 | shuffled[index] = shuffled[i]; |
| 127 | shuffled[i] = temp; |
| 128 | } |
| 129 | return shuffled.slice(0, size); |
| 130 | } |
| 131 | |
| 132 | function refresh_table(qids) { |
| 133 | let table = document.getElementById('result-table'); |