(function(){'use strict';const questions=[{"d":"BASIC","q":"Which is greater: 2/5 or 3/5?","o":["2/5","3/5","They are equal","Cannot be compared"],"a":1,"e":"The denominators match, so compare the numerators: 3 is greater than 2.","v":"rational-number-comparison"},{"d":"BASIC","q":"Which is greater: −1/4 or −3/4?","o":["−1/4","−3/4","They are equal","Both are positive"],"a":0,"e":"Among negative numbers, the number closer to zero is greater.","v":"rational-number-comparison"},{"d":"BASIC","q":"Compare 2/3 and 3/4.","o":["2/3 > 3/4","2/3 < 3/4","2/3 = 3/4","Cannot be compared"],"a":1,"e":"Using denominator 12 gives 8/12 and 9/12, so 2/3 is smaller.","v":"rational-number-comparison"},{"d":"BASIC","q":"Which rational number lies between 1/3 and 2/3?","o":["1/4","1/2","3/4","5/6"],"a":1,"e":"One-half is greater than one-third and less than two-thirds.","v":"rational-number-comparison"},{"d":"BASIC","q":"Arrange −1/2 and 1/3 in ascending order.","o":["1/3, −1/2","−1/2, 1/3","They are equal","Cannot be ordered"],"a":1,"e":"Every negative number is less than every positive number.","v":"rational-number-comparison"},{"d":"BASIC","q":"Which is the smallest number?","o":["−2/5","−1/5","0","1/5"],"a":0,"e":"Among these, −2/5 is the most negative.","v":"rational-number-comparison"},{"d":"BASIC","q":"Compare −5/6 and −4/6.","o":["−5/6 > −4/6","−5/6 < −4/6","They are equal","Both are positive"],"a":1,"e":"With equal denominators, −5 is less than −4.","v":"rational-number-comparison"},{"d":"BASIC","q":"Which fraction is equivalent to 3/4 and can be used to compare with 5/8?","o":["6/8","5/8","3/8","4/8"],"a":0,"e":"Multiplying numerator and denominator of 3/4 by 2 gives 6/8.","v":"rational-number-comparison"},{"d":"BASIC","q":"Which number is greater than −2/7?","o":["−3/7","−4/7","−1/7","−5/7"],"a":2,"e":"Among these negative fractions with denominator 7, −1/7 is closest to zero.","v":"rational-number-comparison"},{"d":"BASIC","q":"Which is the greatest number?","o":["−1/2","0","−1/4","−3/4"],"a":1,"e":"Zero is greater than every negative number.","v":"rational-number-comparison"},{"d":"MEDIUM","q":"Compare 5/12 and 3/8.","o":["5/12 < 3/8","5/12 > 3/8","5/12 = 3/8","Cannot be compared"],"a":1,"e":"With denominator 24, the fractions are 10/24 and 9/24.","v":"rational-number-comparison"},{"d":"MEDIUM","q":"Arrange −2/3, −1/6, and −1/2 in ascending order.","o":["−1/6, −1/2, −2/3","−2/3, −1/2, −1/6","−1/2, −2/3, −1/6","−2/3, −1/6, −1/2"],"a":1,"e":"In sixths they are −4/6, −3/6, and −1/6.","v":"rational-number-comparison"},{"d":"MEDIUM","q":"Which rational number lies between 2/5 and 3/5?","o":["1/3","1/2","2/3","4/5"],"a":1,"e":"One-half equals 0.5, which lies between 0.4 and 0.6.","v":"rational-number-comparison"},{"d":"MEDIUM","q":"Which comparison is correct?","o":["−7/10 > −2/3","−7/10 < −2/3","−7/10 = −2/3","−7/10 > 0"],"a":1,"e":"Using denominator 30 gives −21/30 and −20/30; −21/30 is smaller.","v":"rational-number-comparison"},{"d":"MEDIUM","q":"Which is the greatest fraction?","o":["4/9","5/12","3/7","1/2"],"a":3,"e":"One-half is greater than 4/9, 5/12, and 3/7.","v":"rational-number-comparison"},{"d":"MEDIUM","q":"If x = −3/8 and y = −5/8, which statement is true?","o":["x < y","x > y","x = y","x is positive"],"a":1,"e":"Since −3/8 is closer to zero than −5/8, x is greater.","v":"rational-number-comparison"},{"d":"MEDIUM","q":"A student compares 7/9 and 5/6. Which is greater?","o":["7/9","5/6","They are equal","Both are negative"],"a":1,"e":"With denominator 18, 7/9 = 14/18 and 5/6 = 15/18.","v":"rational-number-comparison"},{"d":"MEDIUM","q":"Which number lies between −1/3 and 0?","o":["−1/2","−1/6","1/6","−2/3"],"a":1,"e":"−1/6 is negative but closer to zero than −1/3.","v":"rational-number-comparison"},{"d":"MEDIUM","q":"Arrange 1/2, 2/3, and 3/5 in descending order.","o":["1/2, 3/5, 2/3","2/3, 3/5, 1/2","3/5, 1/2, 2/3","2/3, 1/2, 3/5"],"a":1,"e":"In thirtieths, the fractions are 15/30, 20/30, and 18/30.","v":"rational-number-comparison"},{"d":"MEDIUM","q":"Which is closer to zero: −3/10 or 1/4?","o":["−3/10","1/4","They are equally far","Neither is rational"],"a":1,"e":"Their distances from zero are 3/10 and 1/4; 1/4 is smaller.","v":"rational-number-comparison"},{"d":"HARD","q":"Which statement is correct when comparing −5/8 and −7/12?","o":["−5/8 < −7/12","−5/8 > −7/12","They are equal","Both are positive"],"a":0,"e":"Using denominator 24 gives −15/24 and −14/24, so −5/8 is smaller.","v":"rational-number-comparison"},{"d":"HARD","q":"Which fraction lies strictly between −2/5 and −1/3?","o":["−1/2","−11/30","−1/4","−3/5"],"a":1,"e":"Using denominator 30, the bounds are −12/30 and −10/30; −11/30 lies between them.","v":"rational-number-comparison"},{"d":"HARD","q":"Arrange −3/4, 2/5, −1/2, and 1/3 in ascending order.","o":["−3/4, −1/2, 1/3, 2/5","−1/2, −3/4, 2/5, 1/3","1/3, 2/5, −1/2, −3/4","−3/4, −1/2, 2/5, 1/3"],"a":0,"e":"The negative numbers come first; −3/4 < −1/2, and 1/3 < 2/5.","v":"rational-number-comparison"},{"d":"HARD","q":"Which is the greatest among −7/8, −5/6, and −11/12?","o":["−7/8","−5/6","−11/12","They are equal"],"a":1,"e":"Their decimal values are about −0.875, −0.833, and −0.917; −5/6 is greatest.","v":"rational-number-comparison"},{"d":"HARD","q":"Find a rational number exactly halfway between 1/4 and 3/4.","o":["1/4","1/2","5/8","3/4"],"a":1,"e":"The midpoint is the average: (1/4 + 3/4) ÷ 2 = 1/2.","v":"rational-number-comparison"},{"d":"HARD","q":"Which comparison is true?","o":["−4/9 < −1/2","−4/9 > −1/2","−4/9 = −1/2","−4/9 < −2/3"],"a":1,"e":"With denominator 18, −4/9 = −8/18 and −1/2 = −9/18, so −8/18 is greater.","v":"rational-number-comparison"},{"d":"HARD","q":"A temperature is −3/4 °C in one place and −2/3 °C in another. Which place is warmer?","o":["The place at −3/4 °C","The place at −2/3 °C","Both are equally warm","Not enough information"],"a":1,"e":"−2/3 is greater than −3/4, so it represents the warmer temperature.","v":"rational-number-comparison"},{"d":"HARD","q":"Which rational number is between −1/2 and −1/4?","o":["−3/4","−3/8","−1/8","1/3"],"a":1,"e":"−3/8 = −0.375, which lies between −0.5 and −0.25.","v":"rational-number-comparison"},{"d":"HARD","q":"Arrange 5/6, 7/9, and 4/5 in ascending order.","o":["7/9, 4/5, 5/6","4/5, 7/9, 5/6","5/6, 4/5, 7/9","7/9, 5/6, 4/5"],"a":0,"e":"Their values are about 0.778, 0.8, and 0.833, respectively.","v":"rational-number-comparison"},{"d":"HARD","q":"Which number has the greatest distance from zero?","o":["−7/10","3/4","−2/3","5/8"],"a":1,"e":"The distances are 0.7, 0.75, about 0.667, and 0.625; 3/4 is greatest.","v":"rational-number-comparison"}];let index=0,selected=-1,locked=false,finished=false,xp=0,hearts=5,correct=0;const $=id=>document.getElementById(id);function updateProgress(){const p=index>=questions.length?100:index/questions.length*100;$('bar').style.width=p+'%';const pb=document.querySelector('[role="progressbar"]');if(pb)pb.setAttribute('aria-valuenow',String(Math.round(p)));}function render(){if(index>=questions.length){results();return;}const q=questions[index];selected=-1;locked=false;$('counter').textContent='QUESTION '+(index+1)+' OF '+questions.length;$('eyebrow').textContent=(q.d==='BASIC'?'🟢 BASIC':q.d==='MEDIUM'?'🟡 MEDIUM':'🔴 HARD')+' · RATIONAL NUMBER COMPARISON';$('hint').textContent='Choose one answer';$('feedback').className='feedback';$('feedback').textContent='';const content=$('content');content.replaceChildren();const question=document.createElement('div');question.className='question';question.textContent=q.q;content.appendChild(question);const choices=document.createElement('div');choices.className='choices';content.appendChild(choices);q.o.forEach((answer,i)=>{const b=document.createElement('button');b.type='button';b.className='choice';b.textContent=answer;b.addEventListener('click',()=>{if(locked)return;selected=i;choices.querySelectorAll('.choice').forEach((x,j)=>x.classList.toggle('selected',j===i));$('action').disabled=false;});choices.appendChild(b);});$('action').textContent='Check answer';$('action').disabled=true;updateProgress();}function act(){const q=questions[index];if(!locked){if(selected<0)return;locked=true;const good=selected===q.a;if(good){correct++;xp+=10;$('xp').textContent='⭐ '+xp+' XP';if(window.skillupCelebrate)window.skillupCelebrate();}else{hearts=Math.max(0,hearts-1);$('hearts').textContent='❤️ '+hearts;}$('content').querySelectorAll('.choice').forEach((b,j)=>{b.disabled=true;if(j===q.a)b.classList.add('correct');if(j===selected&&!good)b.classList.add('wrong');});$('feedback').textContent=(good?'✨ Correct! ':'💡 Explanation: ')+q.e;$('feedback').className='feedback show '+(good?'good':'bad');$('hint').textContent=good?'+10 XP':'Keep practising';$('action').textContent=index===questions.length-1?'See results →':'Continue →';return;}if(index=24?'Excellent work!':correct>=15?'Good progress!':'Keep practising!';end.appendChild(title);const score=document.createElement('div');score.className='score';score.textContent=correct+' / '+questions.length;end.appendChild(score);const p=document.createElement('p');p.textContent='You answered '+correct+' questions correctly.';end.appendChild(p);const summary=document.createElement('div');summary.className='summary';summary.innerHTML='⭐ '+xp+' XP earned ❤️ '+hearts+' hearts remaining';end.appendChild(summary);content.appendChild(end);$('action').textContent='Try again ↻';$('action').disabled=false;}function restart(){index=0;selected=-1;locked=false;finished=false;xp=0;hearts=5;correct=0;$('xp').textContent='⭐ 0 XP';$('hearts').textContent='❤️ 5';render();}$('action').addEventListener('click',()=>{if(finished)restart();else act();});try{render();}catch(error){$('content').textContent='Quiz could not start. Please refresh the page.';console.error('Rational number comparison quiz initialization failed',error);}})();pt>