Skip to content

Commit

Permalink
17.0 RC3: hotfix gti indexing
Browse files Browse the repository at this point in the history
  • Loading branch information
miermontoto committed Nov 16, 2023
1 parent 03765c3 commit 03c245b
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/static/js/app/gti.js
Expand Up @@ -48,11 +48,12 @@ window.addEventListener('scroll', () => {

function recalc() {
let i = 1;
document.querySelectorAll('.question').forEach((q) => {
q.innerHTML = `<span class="number">${i++}.</span> ${q.innerHTML}`; // add index to each question title
document.querySelectorAll('.question-block').forEach((q) => {
let title = q.querySelector('.question');
title.innerHTML = `<span class="number">${i++}.</span> ${title.innerHTML}`; // add index to each question title

let j = 0;
block.querySelectorAll('.answer').forEach((ans) => { // for each answer
q.querySelectorAll('.answer').forEach((ans) => { // for each answer
let letter = String.fromCharCode(97 + j++); // convert index to letter
ans.innerHTML = `<span class="letter">${letter}.</span>${ans.innerHTML}`; // add letter to answer
});
Expand Down

0 comments on commit 03c245b

Please sign in to comment.