|
11 | 11 | <div class="items"> |
12 | 12 | <div id="bullseye-problems-autoplay">▶</div> |
13 | 13 | </div> |
| 14 | + <div class="items"> |
| 15 | + <div id="bullseye-problems-super-autoplay">▶▶</div> |
| 16 | + </div> |
14 | 17 | </div> |
15 | 18 | </div> |
16 | 19 | </div> |
@@ -238,6 +241,34 @@ $(() => { |
238 | 241 | localStorage.currentRound = current_round |
239 | 242 | location.href = "<%= url_for :action => 'play' %>#" + first_id + '&' + mode + '&' + schedule_ids.join(',') |
240 | 243 | }) |
| 244 | + |
| 245 | + $('#bullseye-problems-super-autoplay').click((e) => { |
| 246 | + if (confirm('PLAY ALL PROBLEMS, YES?') === false) { |
| 247 | + return |
| 248 | + } |
| 249 | + |
| 250 | + let current_round = getRound() |
| 251 | + let schedule_ids = [] |
| 252 | + for (let problem_id in PROBLEMS) { |
| 253 | + for (let schedule_team_id in PROBLEMS[problem_id]['round'][current_round]['team_result']) { |
| 254 | + schedule_id = PROBLEMS[problem_id]['round'][current_round]['team_result'][schedule_team_id] |
| 255 | + schedule_ids.push(schedule_id) |
| 256 | + setPlayed(schedule_team_id, schedule_id, problem_id, current_round) |
| 257 | + } |
| 258 | + } |
| 259 | + |
| 260 | + if (schedule_ids.length === 0) { |
| 261 | + alert('This round result not found') |
| 262 | + return |
| 263 | + } |
| 264 | + |
| 265 | + schedule_ids.sort(() => { return Math.random() - .5 }) // what?? |
| 266 | + let first_id = schedule_ids.shift() |
| 267 | + let mode = $('#bullseye-problems-mode').text() === 'play' ? 'play' : 'skip' |
| 268 | + |
| 269 | + localStorage.currentRound = current_round |
| 270 | + location.href = "<%= url_for :action => 'play' %>#" + first_id + '&' + mode + '&' + schedule_ids.join(',') |
| 271 | + }) |
241 | 272 |
|
242 | 273 | if (localStorage.currentProblemId !== undefined) { |
243 | 274 | selectProblem(localStorage.currentProblemId, localStorage.currentRound) |
|
0 commit comments