Free PSHS NCE reviewer on Fractions for the Quantitative Ability test. Start with the 5-question quick check: it places you at the right level, then you learn, practice, and finish with a mastery check. Your progress is saved on this device.
{8/5} × {5/2} = {40/10} = 4. ({2 3/10} is the trap: multiplying the parts separately.)
{3 1/2} ÷ {7/8} = ?
4
{3 1/16}
{1/4}
2
8
{7/2} × {8/7} = {56/14} = 4.
Which fraction is closest to {1/2}?
{5/11}
{7/12}
{9/20}
{13/25}
{6/13}
Half of 25 is 12.5, so {13/25} is only {1/50} away from {1/2}. The others are {1/22}, {1/12}, {1/20}, and {1/26} away. {13/25} is closest.
Level 2: NCE standard
These are the fraction questions you’ll see most on the NCE: two or three steps, in real situations.
Read slowly: the whole, or the rest?
Nina had ₱120. She spent {1/3} on a book, then {1/2} of the rest on lunch. How much is left?
{1/3} of ₱120 = ₱40 (the book). The rest is ₱80.
{1/2} of the rest: {1/2} of ₱80 = ₱40 (lunch).
Left: ₱80 − ₱40 = ₱40.
The trap: taking {1/2} of ₱120 instead of {1/2} of the rest.
How many fit?
How many {3/8}-cup scoops are in {4 1/2} cups of rice? {4 1/2} ÷ {3/8} = {9/2} × {8/3} = 12 scoops.
“How many ___ fit in ___?” or “How many pieces?” means divide.
Work backwards.
{2/5} of a number is 12. What is the number?
Draw 5 equal boxes. 2 boxes = 12.
So 1 box = 6.
All 5 boxes = 5 × 6 = 30.
Fractions hiding in pictures.
The rectangle has 4 equal parts. One part is fully shaded ({1/4}). Another part is half shaded: half of {1/4} is {1/8}. Total: {1/4} + {1/8} = {2/8} + {1/8} = {3/8}.
Tip: cut the picture into the smallest equal pieces first, then count.
A tank is {1/2} full. After adding 10 liters, it is {3/4} full. How many liters does the full tank hold?
How much of the tank did the 10 liters fill? {3/4} − {1/2} = ?
{3/4} − {2/4} = {1/4}. So {1/4} of the tank is 10 liters, and the full tank is 4 × 10 = 40 liters.
Leo had 60 marbles. He gave {1/4} of them to Ana. Then he gave {1/3} of the remaining marbles to Ben. How many marbles were left?
Find what is left after Ana. Then take away {1/3} of that.
30
25
20
35
45
Ana: {1/4} of 60 = 15, so 45 remain. Ben: {1/3} of 45 = 15, so 45 − 15 = 30. (25 is the trap: {1/3} of 60 instead of {1/3} of the rest.)
How many {2/3}-cup servings can be made from 6 cups of rice?
How many {2/3} fit in 6?
9
4
12
6
18
6 ÷ {2/3} = 6 × {3/2} = 9 servings.
{3/7} of the students in a club are girls. There are 12 girls. How many students are in the club?
3 out of 7 boxes = 12. How many in all 7 boxes?
28
21
36
16
84
3 boxes = 12, so 1 box = 4. All 7 boxes: 7 × 4 = 28.
A recipe needs {3/4} cup of sugar for one batch. How much sugar is needed for {2 1/2} batches?
One quarter is shaded ({1/4} = {2/8}) and half of another quarter ({1/8}). {2/8} + {1/8} = {3/8}.
A bookshelf has 48 books. {1/3} of them are science books. {1/4} of the other books are storybooks. How many storybooks are there?
Find the books that are not science. Then take {1/4} of those.
8
12
4
16
24
Science: {1/3} of 48 = 16. Other books: 48 − 16 = 32. Storybooks: {1/4} of 32 = 8. (12 is the trap: {1/4} of 48.)
A 5-meter rope is cut into pieces that are each {5/8} meter long. How many pieces are there?
How many {5/8} fit in 5?
8
5
3
40
10
5 ÷ {5/8} = 5 × {8/5} = 8 pieces.
Mr. Cruz spent {3/5} of his money and had ₱240 left. How much money did he have at first?
If he spent {3/5}, what part is left? That part is ₱240.
₱600
₱400
₱144
₱384
₱360
Left: {2/5} of his money = ₱240. 1 box = ₱120. All 5 boxes = ₱600. (₱400 is the trap: treating ₱240 as the {3/5} he spent.)
A tank is {1/4} full. After 24 liters are added, it is {5/8} full. How many liters does the full tank hold?
24 liters filled {5/8} − {1/4} of the tank.
64
96
48
40
72
{5/8} − {1/4} = {5/8} − {2/8} = {3/8}. So {3/8} of the tank = 24 L, {1/8} = 8 L, and the full tank = 8 × 8 = 64 L.
The large square is made of 16 equal small squares. What fraction of the large square is shaded?
{3/8}
{5/16}
{7/16}
{3/4}
{1/2}
5 small squares are fully shaded, and 2 are half shaded (2 halves = 1 square). That is 6 out of 16: {6/16} = {3/8}. (Count the halves!)
Level 3: NCE challenge
The hardest kind of fraction question on the NCE: more steps, hidden traps, and patterns. Slow down and draw.
Two changes? Go backwards, one step at a time.
A tank is {2/5} full. 24 L are added. Then {1/4} of the water is used, and the tank is now {3/5} full. How much does the full tank hold?
Start from the end. After using {1/4}, {3/4} of the water is left, and that is {3/5} of the tank.
So before using any: {3/5} ÷ {3/4} = {4/5} of the tank.
The 24 L took it from {2/5} to {4/5}: that’s {2/5} of the tank. So {1/5} = 12 L.
Full tank: 5 × 12 = 60 L.
Long sums? Look for a pattern.
{1/2} + {1/6} + {1/12} + {1/20} + {1/30} = ? Don’t add all five at once. Add step by step and watch:
{1/2}
{1/2} + {1/6} = {2/3}
+ {1/12} = {3/4}
+ {1/20} = {4/5}
See it? {1/2}, {2/3}, {3/4}, {4/5}… so the next one is {5/6}.
NCE habit: if a question looks too long to calculate, there is usually a pattern.
A fraction OF a fraction.
{2/3} of the pupils joined the school fair. {3/4} of those joined the science contest. What fraction of all the pupils joined the contest? “Of” means multiply: {3/4} × {2/3} = {6/12} = {1/2}.
The trap: answering {3/4}. That’s only a fraction of the fair pupils, not of everyone.
Watch which amount the fraction belongs to.
A shirt was sold at {3/4} of its price, a discount of ₱90. A bag was then marked down by {1/3}, and that markdown was equal to the shirt’s original price. What was the bag’s original price?
Shirt: the discount is {1/4} of its price = ₱90. Original price = 4 × 90 = ₱360.
Bag: {1/3} of its price = ₱360. Original price = 3 × 360 = ₱1,080.
Before you calculate, underline what each fraction is a fraction of.
Which is closer to 1: {11/12} or {14/15}?
Don’t find decimals. Ask: how much is missing from each to make 1?
{11/12} is missing {1/12}. {14/15} is missing {1/15}. {1/15} is the smaller gap, so {14/15} is closer to 1.
A tank is {1/3} full. 30 liters are added. Then {1/2} of the water in the tank is used, and the tank is now {1/2} full. How many liters does the full tank hold?
Start from the end: half the water is {1/2} of the tank. So how full was it before?
45
90
60
36
30
Half the water = {1/2} of the tank, so before using any, the tank was full. The 30 L took it from {1/3} to full: {2/3} of the tank = 30 L. Full tank = 45 L.
The running totals go {1/2}, {2/3}, {3/4}, {4/5}, {5/6}… After six fractions: {6/7}.
In a school, {3/5} of the pupils are girls. {2/3} of the girls and {1/2} of the boys joined the field trip. What fraction of ALL the pupils joined?
Find the girls who joined and the boys who joined, as fractions of everyone. Then add.
{3/5}
{7/10}
{1/2}
{2/5}
{7/15}
Girls who joined: {2/3} × {3/5} = {2/5}. Boys are {2/5} of the pupils, and {1/2} × {2/5} = {1/5}. Total: {2/5} + {1/5} = {3/5}.
Which fraction is closest to {2/3}?
{5/8}
{7/10}
{11/16}
{3/5}
{9/14}
As decimals: {2/3} ≈ 0.667. {5/8} = 0.625, {7/10} = 0.7, {11/16} ≈ 0.688, {3/5} = 0.6, {9/14} ≈ 0.643. The smallest gap (about 0.02) belongs to {11/16}.
Ramon read {1/4} of a book on Monday and {1/3} of the remaining pages on Tuesday. He still has 90 pages left. How many pages does the book have?
After Monday, {3/4} is left. On Tuesday he reads {1/3} of THAT.
180
216
120
270
135
After Monday: {3/4} left. Tuesday leaves {2/3} of that: {2/3} × {3/4} = {1/2} of the book = 90 pages. The book has 180 pages. (216 is the trap: using {1/3} of the whole book.)
A jar is {2/5} full of candies. 36 candies are added, and then {1/3} of all the candies are eaten. The jar is now {2/3} full. How many candies fill the jar?
Start from the end: {2/3} of the candies are left, and that is {2/3} of the jar.
60
90
45
54
100
{2/3} of the candies = {2/3} of the jar, so before eating, the jar was full. 36 candies took it from {2/5} to full: {3/5} of the jar = 36. Full jar = 60.
Running totals: {1/2}, {3/4}, {7/8}, {15/16}, {31/32}, and then {63/64}. Each one is just one small piece short of 1.
Half of a garden is planted with vegetables. {1/3} of the rest is planted with flowers. The remaining 40 m² is grass. What is the area of the whole garden?
Find what fraction of the WHOLE garden is grass.
120 m²
240 m²
80 m²
60 m²
100 m²
The rest is {1/2}. Flowers: {1/3} of {1/2} = {1/6}. Grass: {1/2} − {1/6} = {1/3} of the garden = 40 m². Whole garden = 120 m².
A shirt was sold at {4/5} of its price, saving ₱70. Shoes were then discounted by {1/4}, and the discount was equal to the shirt’s ORIGINAL price. What was the original price of the shoes?
Find the shirt’s original price first.
₱1,400
₱1,050
₱280
₱1,750
₱350
Shirt: {1/5} of its price = ₱70, so it was ₱350. Shoes: {1/4} of their price = ₱350, so they were ₱1,400.
Which is greater: {1/2} + {1/3} + {1/7}, or 1?
The sum
1
They are equal
With denominator 42: {21/42} + {14/42} + {6/42} = {41/42}. That is less than 1, so 1 is greater.
Mastery check
How many pieces, each {3/8} meter long, can be cut from a wire {5 1/4} meters long?
How many {3/8} fit in {5 1/4}?
14
12
16
{1 31/32}
42
{5 1/4} = {21/4}. {21/4} ÷ {3/8} = {21/4} × {8/3} = 14 pieces. ({1 31/32} is the trap: multiplying without flipping.)
{3/8} of a number is 27. What is {5/6} of the number?
Find the whole number first.
60
45
72
54
81
3 parts out of 8 = 27, so 1 part = 9 and the number is 72. {5/6} of 72 = 60.
Leo spent {1/3} of his money, then {1/4} of the rest. He had ₱180 left. How much did he have at first?
After spending {1/3}, {2/3} is left. Then he keeps {3/4} of THAT.
₱360
₱432
₱240
₱540
₱720
He kept {3/4} × {2/3} = {1/2} of his money = ₱180, so he had ₱360. (₱432 is the trap: {1/4} of the whole.)
Which fraction is closest to 1?
{7/8}
{11/12}
{13/15}
{9/10}
{15/17}
Gaps from 1: {1/8}, {1/12}, {2/15}, {1/10}, {2/17}. The smallest gap is {1/12}, so {11/12}.
A drum is {5/6} full. After 15 liters are used, it is {7/12} full. How many liters does a full drum hold?
60
36
45
90
180
{5/6} − {7/12} = {10/12} − {7/12} = {3/12} = {1/4} of the drum = 15 L. Full drum = 60 L.
A ribbon {7 1/2} meters long is cut into pieces that are each {5/8} meter long. How many pieces are there?
{4/7} of a number is 32. What is {3/4} of the number?
Find the whole number first.
42
24
56
18
48
4 parts out of 7 = 32, so 1 part = 8 and the number is 56. {3/4} of 56 = 42.
In a class, {2/5} of the pupils walk to school. {1/2} of the rest ride a jeep. The other 12 pupils ride a bus. How many pupils are in the class?
What fraction of the WHOLE class rides the bus?
40
30
60
24
20
The rest is {3/5}. Jeep: {1/2} of {3/5} = {3/10}. Bus: {3/5} − {3/10} = {3/10} of the class = 12. Class = 40.
{1/2} + {1/6} + {1/12} + {1/20} = ?
{4/5}
{3/4}
{5/6}
{4/40}
1
Running totals: {1/2}, {2/3}, {3/4}, then {4/5}.
A tank is {1/2} full. 12 liters are used. Then {1/3} of the water that is left is used, and the tank is now {1/5} full. How many liters does the full tank hold?
Work backwards from {1/5}.
60
40
30
120
36
Before the {1/3} was used, the water was {1/5} ÷ {2/3} = {3/10} of the tank. The 12 L took it from {1/2} down to {3/10}: {1/2} − {3/10} = {1/5} of the tank = 12 L. Full tank = 60 L.
Written and checked by Teacher Abi
Abigail is a licensed teacher who has tutored since 2006. She writes every item, solves it again before posting, and fixes errors readers report.
Read the questions in the test booklet. Shade your answers on the separate answer sheet, the way you will on exam day. Click a shaded circle again to erase it.
' +
'
' + (D.rules || []).map(function (r) { return '
' + r + '
'; }).join('') + '
' +
'' +
'
' +
'
' +
'
Prefer paper? Print the booklet and answer sheet, take it with a timer, then to see your results.
' +
'
Your answers are saved on this device only.
' +
'' +
// exam
'' +
'
' + esc(D.short || D.title) + '
' +
'
' +
'
' +
'
Test booklet
' + bookletHTML() + '
End of test. Check your answer sheet, then submit.
' +
'' +
'
' +
// phone strip
'
' +
'' +
// result
'' +
// dialog
'
Submit your answer sheet?
' +
'
');
var X = root.querySelector('.abi-x');
function q(s) { return X.querySelector(s); }
function qa(s) { return X.querySelectorAll(s); }
function setPhase(p) { S.phase = p; X.setAttribute('data-phase', p); save(); }
/* shading */
function paint() {
Array.prototype.forEach.call(qa('.abi-x-rows .abi-x-bub, .abi-x-striprow .abi-x-bub'), function (b) {
var on = S.answers[+b.dataset.i] === +b.dataset.j;
b.classList.toggle('on', on); b.setAttribute('aria-pressed', on ? 'true' : 'false');
});
var a = S.answers.filter(function (x) { return x != null; }).length;
var txt = a + ' answered · ' + (N - a) + ' blank';
q('.abi-x-count').textContent = txt; q('.abi-x-count2').textContent = txt;
}
X.addEventListener('click', function (e) {
var b = e.target.closest('.abi-x-bub[data-j]');
if (b && S.phase !== 'done') {
var i = +b.dataset.i, j = +b.dataset.j;
S.answers[i] = S.answers[i] === j ? null : j; save(); paint();
return;
}
var jmp = e.target.closest('[data-jump]');
if (jmp) {
var el = document.getElementById('abi-x-' + n + '-q' + (+jmp.dataset.jump + 1));
if (el) { X.classList.remove('abi-x-sheetopen'); el.scrollIntoView({ behavior: 'smooth', block: 'start' }); }
}
});
/* phone strip: shows the row for the question at the top of the screen */
var cur = 0;
function strip(i) {
cur = i;
var row = sheetHTML(false).split('
Name ____________________________ Date ____________ Time started ________ Time ended ________
' +
'
Instructions
Set a timer for ' + (D.minutes || 60) + ' minutes.
Shade your answers on the separate answer sheet (last page) with a pencil. Shade one circle per item completely.
' + (D.rules || []).map(function (r) { return '
' + r + '
'; }).join('') + '
When you finish, open the test online and choose “enter your paper answers” to see your results.
' +
'
teacherabiworksheets.blogspot.com · Independent practice, not affiliated with the exam’s official administrator.
' +
'
' + bookletHTML(true) + '
' +
'
Answer sheet
Name ____________________________ Score ______ / ' + N + '
' + colHTML + '
';
document.body.appendChild(div);
document.body.classList.add('abi-printing');
var done = function () { document.body.classList.remove('abi-printing'); window.removeEventListener('afterprint', done); };
window.addEventListener('afterprint', done);
setTimeout(function () { window.print(); }, 60);
};
/* restore */
if (S.phase === 'exam' && S.mode === 'timed' && left() <= 0) { S.phase = 'exam'; finish(true); }
else if (S.phase === 'exam') { if (S.mode === 'paper') X.classList.add('abi-x-papermode'); startExam(S.mode || 'timed'); }
else if (S.phase === 'done') { X.setAttribute('data-phase', 'done'); render(); }
paint();
}
})();
/* ============================================================
TEACHER ABI LEVELED LESSON ENGINE
A post holds the lesson as readable HTML; this turns it into the
step-by-step session: Quick check → Level 1/2/3 → Mastery.
questions
Why this level
Heading
body
Problem
Hint
Answer
5 questions
5 more
...levels 2 and 3...
..
..
A question:
..
Said simply
choice
...
worked answer
{3/4} and {1 7/8} are written as stacked fractions.
Progress is saved on this device: abiLesson:, plus a summary in abiLessons.
============================================================ */
(function () {
'use strict';
var roots = document.querySelectorAll('.abi-lesson');
if (!roots.length) return;
var MSG = (window.TA_CONFIG && window.TA_CONFIG.messenger) || 'https://m.me/araltayo.ph';
var NAVY = '#18344d', PEN = '#b04a31', RUST = '#c95f45', PAPER = '#fffaf4', LINE = '#b9ab9c', MINT = '#cfe0d8', GREEN = '#315d52';
Array.prototype.forEach.call(roots, function (root) { try { init(root); } catch (e) { root.classList.remove('abi-l-on'); if (window.console) console.error(e); } });
function esc(s) { return String(s == null ? '' : s).replace(/[&<>"]/g, function (c) { return { '&': '&', '<': '<', '>': '>', '"': '"' }[c]; }); }
function frac(s) {
return String(s).replace(/\{(\d+) (\d+)\/(\d+)\}/g, '$1$2$3')
.replace(/\{(\d+)\/(\d+)\}/g, '$1$2');
}
function store(k, v) { try { if (v === undefined) return JSON.parse(localStorage.getItem(k) || 'null'); localStorage.setItem(k, JSON.stringify(v)); } catch (e) { return null; } }
/* ---------- figures ---------- */
function bar(n, k, w, h, color) {
w = w || 300; h = h || 54;
var s = '';
}
function stack(list) {
var rowH = 46, w = 300, s = '';
}
function dots(total, groups, take) {
var per = total / groups, s = '';
}
function boxes(n, k, label, total) {
var w = 380, bw = w / n, s = '';
}
function fig(code) {
if (!code) return '';
var p = code.split(':');
if (p[0] === 'bar') return bar(+p[1], +p[2], +p[3] || undefined, +p[4] || undefined, p[5] === 'red' ? RUST : undefined);
if (p[0] === 'stack') return stack(p[1].split(','));
if (p[0] === 'dots') return dots(+p[1], +p[2], +p[3]);
if (p[0] === 'boxes') return boxes(+p[1], +p[2], p[3], p[4]);
return '';
}
function figHTML(el) {
if (!el) return '';
var code = el.getAttribute('data-fig');
return '
' + (code ? fig(code) : el.innerHTML) + '
';
}
/* ---------- read the lesson from the page ---------- */
function readQ(el) {
var a = (el.getAttribute('data-a') || 'A').trim().toUpperCase();
var say = el.querySelector('.say'), why = el.querySelector('.why'), stem = el.querySelector('.stem');
return {
lv: +el.getAttribute('data-lv') || 0,
q: stem ? stem.innerHTML : '',
p: say ? say.innerHTML : '',
f: figHTML(el.querySelector('.fig')),
o: Array.prototype.map.call(el.querySelectorAll('ol > li'), function (li) { return li.innerHTML; }),
a: 'ABCDE'.indexOf(a),
w: why ? why.innerHTML : '',
keep: el.hasAttribute('data-keep-order')
};
}
function readSets(sec) {
return Array.prototype.map.call(sec.querySelectorAll('.set'), function (s) {
return Array.prototype.map.call(s.querySelectorAll('.q'), readQ);
});
}
function read(root) {
var L = { check: [], levels: {}, mastery: [] };
var c = root.querySelector('[data-part="check"]');
if (c) L.check = Array.prototype.map.call(c.querySelectorAll('.q'), readQ);
Array.prototype.forEach.call(root.querySelectorAll('[data-part="level"]'), function (sec) {
var n = +sec.getAttribute('data-level');
var why = sec.querySelector(':scope > .why');
var rt = sec.querySelector('.reteach');
L.levels[n] = {
n: n, name: sec.getAttribute('data-name') || ('Level ' + n),
why: why ? why.innerHTML : '',
cards: Array.prototype.map.call(sec.querySelectorAll('.card'), function (c) {
var h = c.querySelector('h3'), ans = c.querySelector('.ans'), f = c.querySelector('.fig');
var body = c.cloneNode(true);
Array.prototype.forEach.call(body.querySelectorAll('h3, .ans, .fig'), function (x) { x.parentNode.removeChild(x); });
return { k: c.getAttribute('data-k') || '', h: h ? h.innerHTML : '', b: body.innerHTML, f: figHTML(f), tr: c.classList.contains('try'), ans: ans ? ans.innerHTML : '' };
}),
reteach: rt ? (function () {
var h = rt.querySelector('h3'), f = rt.querySelector('.fig'), body = rt.cloneNode(true);
Array.prototype.forEach.call(body.querySelectorAll('h3, .fig'), function (x) { x.parentNode.removeChild(x); });
return { h: h ? h.innerHTML : '', f: figHTML(f), b: body.innerHTML };
})() : null,
sets: readSets(sec)
};
});
var m = root.querySelector('[data-part="mastery"]');
if (m) L.mastery = readSets(m);
return L;
}
/* shuffle choices so the answer isn't always in the same place */
function prep(list) {
return list.map(function (q) {
var idx = q.o.map(function (_, i) { return i; });
if (!q.keep) for (var i = idx.length - 1; i > 0; i--) { var j = Math.floor(Math.random() * (i + 1)); var t = idx[i]; idx[i] = idx[j]; idx[j] = t; }
var c = {}; for (var k in q) c[k] = q[k];
c.o = idx.map(function (i) { return q.o[i]; }); c.a = idx.indexOf(q.a);
return c;
});
}
function init(root) {
var L = read(root);
var ID = root.getAttribute('data-id') || 'lesson';
var TITLE = root.getAttribute('data-title') || 'This topic';
var KEY = 'abiLesson:' + ID;
var NEXT = root.getAttribute('data-next-url'), NEXT_T = root.getAttribute('data-next-title');
var HUB = root.getAttribute('data-hub-url');
var IMG_THINK = root.getAttribute('data-img-think') || '';
var IMG_TALK = root.getAttribute('data-img-talk') || '';
var ART = (window.TA_CONFIG && window.TA_CONFIG.art) || {};
function pic(src, cls) { return src ? '' : ''; }
var LV = Object.keys(L.levels).map(Number).sort();
var TOP = LV[LV.length - 1] || 3;
function fresh() { var s = { step: 'start', check: [], level: 0, stars: {}, done: { check: false, m: false }, tries: { m: 0 }, card: 0, i: 0, ans: [], set: 0, simple: false, reveal: false }; LV.forEach(function (n) { s.stars[n] = 0; s.done[n] = false; s.tries[n] = 0; }); return s; }
var S = fresh();
var sv = store(KEY);
if (sv && sv.stars) { S.check = sv.check || []; S.level = sv.level || 0; S.stars = sv.stars; S.done = sv.done; S.tries = sv.tries || S.tries; }
function save() {
store(KEY, { check: S.check, level: S.level, stars: S.stars, done: S.done, tries: S.tries });
var all = store('abiLessons') || {};
all[ID] = { title: TITLE, level: S.level, stars: S.stars, mastered: !!S.done.m, url: location.href.split(/[?#]/)[0], t: Date.now() };
store('abiLessons', all);
}
/* page frame. The original content stays in the page for search engines and no-JS readers. */
var src = document.createElement('div');
src.className = 'abi-l-src';
while (root.firstChild) src.appendChild(root.firstChild);
root.innerHTML =
'
';
stage(h, !done);
Array.prototype.forEach.call(STAGE.querySelectorAll('.abi-l-opt'), function (b) {
b.onclick = function () { if (S.ans[S.i] != null) return; S.ans[S.i] = +b.getAttribute('data-k'); render(); var n = $('[data-act="next"]'); if (n) n.focus({ preventScroll: true }); };
});
on('[data-act="say"]', function () { S.simple = true; render(); });
on('[data-act="next"]', function () { S.simple = false; if (S.i < list.length - 1) { S.i++; render(); } else onDone(); });
}
function placeFromCheck() {
var c = S.cur.map(function (q, j) { return S.ans[j] === q.a; });
S.check = c; S.done.check = true;
var lv = TOP + 1;
for (var x = 0; x < LV.length; x++) {
var n = LV[x], miss = S.cur.some(function (q, j) { return (q.lv || 1) === n && !c[j]; });
if (miss) { lv = n; break; }
}
LV.forEach(function (n) { if (n < lv) { S.done[n] = true; S.stars[n] = Math.max(S.stars[n], 3); } });
S.level = lv; save(); S.step = 'placed'; render();
}
function screenPlaced() {
var n = S.check.filter(Boolean).length, lv = S.level, top = lv > TOP;
var msg = top ? ['You got all ' + n + '. Impressive!', 'You already handle ' + esc(TITLE.toLowerCase()) + ' at NCE challenge level. Let’s go straight to the mastery check.'] :
lv === TOP ? ['Your ' + esc(TITLE.toLowerCase()) + ' skills are strong.', 'Start at Level ' + lv + ', ' + esc(L.levels[lv].name) + ': the hardest kind of NCE questions on this topic, with more steps, traps, and patterns.'] :
lv > LV[0] ? ['Your rules are solid.', 'Start at Level ' + lv + ', ' + esc(L.levels[lv].name) + ': two- and three-step problems like the ones on the NCE.'] :
['Let’s tune up the rules first.', 'We’ll begin with Level ' + lv + ', ' + esc(L.levels[lv].name) + ': a fast review of the basics. It won’t take long.'];
stage('
' + tag('Quick check done, ' + n + ' of ' + S.check.length + ' correct') + '
' + msg[0] + '
' + msg[1] + '
' +
'
' + pic(ART.pointing) + '
');
on('[data-act="go"]', function () { if (top) startMastery(); else startLevel(lv); render(); });
}
function startLevel(lv) { S.level = lv; S.step = 'cards'; S.card = 0; S.reveal = false; save(); }
function screenCards() {
var Lv = L.levels[S.level], c = Lv.cards[S.card];
var h = '
Level ' + Lv.n + ', ' + esc(Lv.name) + '
';
if (S.card === 0 && Lv.why) h += '
' + Lv.why + '
';
h += tag(c.k) + '
' + c.h + '
' + c.f + '
' + c.b + '
';
if (c.tr) h += '' +
(S.reveal ? '
Here’s how:
' + c.ans + '
' : '');
h += '
' +
'
';
stage(h);
on('[data-act="reveal"]', function () { S.reveal = !S.reveal; render(); });
on('[data-act="back"]', function () { if (S.card > 0) { S.card--; S.reveal = false; render(); } });
on('[data-act="next"]', function () { S.reveal = false; if (S.card < Lv.cards.length - 1) { S.card++; render(); } else { startPractice(0); render(); } });
}
function startPractice(set) { S.counted = false; S.set = set; S.step = 'practice'; S.i = 0; S.ans = []; S.simple = false; S.cur = prep(L.levels[S.level].sets[set]); }
function screenPractice() { questionScreen(S.cur, 'Level ' + S.level + ' practice', function () { S.step = 'pres'; render(); }); }
function screenPracticeResult() {
var Lv = L.levels[S.level], list = S.cur, len = list.length, n = list.filter(function (q, j) { return S.ans[j] === q.a; }).length;
var other = (S.set + 1) % Lv.sets.length;
if (!S.counted) { S.tries[S.level] = (S.tries[S.level] || 0) + 1; S.counted = true; }
var st = n >= len ? 3 : n >= len - 1 ? 2 : n >= len - 2 ? 1 : 0;
S.stars[S.level] = Math.max(S.stars[S.level], st);
var up = n >= len - 1; if (up) S.done[S.level] = true; save();
var h = '
Level ' + Lv.n + ', ' + esc(Lv.name) + '
' + starRow(n, len);
if (up) {
var last = S.level === TOP;
h += '
' + (n === len ? 'Perfect! ' : 'Great work! ') + (last ? 'You’re ready for the mastery check.' : 'Level up!') + '
' + n + ' of ' + len + ' correct. ' +
(last ? 'Last step: ' + L.mastery[0].length + ' mixed questions. Get them all to master ' + esc(TITLE.toLowerCase()) + '.' : 'Next: Level ' + (S.level + 1) + ', ' + esc(L.levels[S.level + 1].name) + '.') + '
' +
'';
stage(h);
on('[data-act="go"]', function () { S.counted = false; if (last) startMastery(); else startLevel(S.level + 1); render(); });
} else if (n === len - 2) {
h += '
So close!
' + n + ' of ' + len + ' correct. You need ' + (len - 1) + ' to move up. Try a fresh set. You’ve got this.
' +
'';
stage(h);
on('[data-act="go"]', function () { S.counted = false; startPractice(other); render(); });
on('[data-act="cards"]', function () { S.counted = false; startLevel(S.level); render(); });
} else {
var R = Lv.reteach, second = S.tries[S.level] >= 2;
h += '
' + (second ? 'This one is tricky. That’s okay.' : 'Let’s look at it another way.') + '
' + n + ' of ' + len + ' correct. ' +
(second ? 'Ask your teacher or parent to go through it with you, or send me a message.' : 'Here’s a different way to see it. Then try a fresh set.') + '
';
stage(h);
on('[data-act="go"]', function () { S.counted = false; startPractice(other); render(); });
}
}
function startMastery() { S.step = 'mastery'; S.level = TOP + 1; S.i = 0; S.ans = []; S.simple = false; S.counted = false; S.set = (S.tries.m || 0) % Math.max(1, L.mastery.length); S.cur = prep(L.mastery[S.set] || []); save(); }
function screenMastery() { questionScreen(S.cur, 'Mastery check', function () { S.step = 'mres'; render(); }); }
function screenMasteryResult() {
var list = S.cur, len = list.length, n = list.filter(function (q, j) { return S.ans[j] === q.a; }).length;
if (!S.counted) { S.tries.m = (S.tries.m || 0) + 1; S.counted = true; }
if (n === len) { S.done.m = true; S.done[TOP] = true; save(); S.counted = false; S.step = 'finished'; render(); return; }
save();
stage(tag('Mastery check, ' + n + ' of ' + len) + '
' + (n === len - 1 ? 'Almost there!' : 'Not yet, and that’s fine.') + '
' +
'
Mastery means ' + len + ' out of ' + len + '. ' + (n === len - 1 ? 'One more try with a fresh set.' : 'Go back to Level ' + TOP + ' for more practice, then try again.') + '
' +
'
' +
(n === len - 1 ? '' : '') + '
');
on('[data-act="go"]', function () { S.counted = false; if (n === len - 1) startMastery(); else startLevel(TOP); render(); });
on('[data-act="l3"]', function () { S.counted = false; startLevel(TOP); render(); });
}
function screenFinished() {
stage('
' + pic(ART.trophy || IMG_TALK) + '
' +
'
Mastered
You mastered ' + esc(TITLE.toLowerCase()) + '!
' +
'
Every question right at NCE challenge level. That’s a real Pisay skill.
');
on('[data-act="again"]', function () { startLevel(TOP); render(); });
}
function render() {
if (S.step === 'start') screenStart();
else if (S.step === 'check') questionScreen(S.cur, 'Quick check', placeFromCheck);
else if (S.step === 'placed') screenPlaced();
else if (S.step === 'cards') screenCards();
else if (S.step === 'practice') screenPractice();
else if (S.step === 'pres') screenPracticeResult();
else if (S.step === 'mastery') screenMastery();
else if (S.step === 'mres') screenMasteryResult();
else if (S.step === 'finished') screenFinished();
}
if (/[?&]abitest/.test(location.search)) root.__abiAnswer = function () { return S.cur && S.cur[S.i] ? S.cur[S.i].a : null; };
render();
}
})();
/* ============================================================
TEACHER ABI STUDENT HUB
One page per exam that tells a student what to do next, from their
real results on this device:
abiResults - finished diagnostics (written by the diagnostic engine)
abiLessons - leveled lesson progress (written by the lesson engine)
abiHub: - this hub's own settings (name, sessions, ticked reviewers)
...readable list of links for search engines and readers without scripts...
============================================================ */
(function () {
'use strict';
var roots = document.querySelectorAll('.abi-sh');
if (!roots.length) return;
var MSG = (window.TA_CONFIG && window.TA_CONFIG.messenger) || 'https://m.me/araltayo.ph';
var ART = (window.TA_CONFIG && window.TA_CONFIG.art) || {};
var SUBJECT_ART = { quantitative: 'calculator', verbal: 'reading' };
function esc(s) { return String(s == null ? '' : s).replace(/[&<>"]/g, function (c) { return { '&': '&', '<': '<', '>': '>', '"': '"' }[c]; }); }
function store(k, v) { try { if (v === undefined) return JSON.parse(localStorage.getItem(k) || 'null'); localStorage.setItem(k, JSON.stringify(v)); } catch (e) { return null; } }
Array.prototype.forEach.call(roots, function (root) {
try { init(root); } catch (e) { root.classList.remove('abi-sh-on'); if (window.console) console.error(e); }
});
function init(root) {
var D = JSON.parse(root.querySelector('script.abi-sh-data').textContent);
var KEY = 'abiHub:' + (D.id || 'hub');
var S = store(KEY) || {};
/* carry over the name a student typed into an older hub */
if (!S.name && D.legacyStore) { var old = store(D.legacyStore); if (old && old.name) S.name = String(old.name).slice(0, 24); }
S.sessions = S.sessions || 3;
S.done = S.done || {};
function save() { store(KEY, S); }
var src = document.createElement('div');
src.className = 'abi-sh-src';
while (root.firstChild) src.appendChild(root.firstChild);
var app = document.createElement('div');
app.className = 'abi-sh-app';
root.appendChild(app);
root.appendChild(src);
root.classList.add('abi-sh-on');
/* ---------- what the student has done ---------- */
function results() { return store('abiResults') || {}; }
function lessons() { return store('abiLessons') || {}; }
function testResult(t) { var r = results()[t.diag]; return r && typeof r.pct === 'number' ? r : null; }
function topicState(tp) {
if (tp.lesson) {
var l = lessons()[tp.lesson];
if (!l) return { kind: 'new' };
if (l.mastered) return { kind: 'mastered' };
var lv = l.level || 0, stars = 0;
if (l.stars) Object.keys(l.stars).forEach(function (k) { stars += l.stars[k] || 0; });
return { kind: 'going', level: lv, stars: stars };
}
return S.done[tp.url] ? { kind: 'ticked' } : { kind: 'new' };
}
function isDone(tp) { var k = topicState(tp).kind; return k === 'mastered' || k === 'ticked'; }
function areaScore(test, area) { var r = testResult(test); return r && r.areas && r.areas[area] ? r.areas[area].p : null; }
/* the to-do queue: untaken diagnostics, then topics in the weakest areas, then the rest in order */
function queue() {
var q = [];
D.tests.forEach(function (t) {
if (!testResult(t)) q.push({ type: 'test', t: t, title: 'Take Test ' + t.n + ': ' + t.name, why: 'A ' + (t.minutes || 60) + '-minute diagnostic. Your result shows which topics to study first.', url: t.url, cta: 'Take Test ' + t.n });
});
D.tests.forEach(function (t) {
var list = (D.topics || {})[t.key] || [];
var scored = list.map(function (tp, i) {
var a = areaScore(t, tp.area);
return { tp: tp, i: i, a: a };
}).filter(function (x) { return !isDone(x.tp); });
/* lessons already started come first, then the weakest areas, then the learning order */
scored.sort(function (x, y) {
var gx = topicState(x.tp).kind === 'going' ? 0 : 1, gy = topicState(y.tp).kind === 'going' ? 0 : 1;
var wx = x.a != null && x.a < 75 ? x.a : 999, wy = y.a != null && y.a < 75 ? y.a : 999;
return gx - gy || wx - wy || x.i - y.i;
});
scored.forEach(function (x) {
var st = topicState(x.tp), going = st.kind === 'going';
var why = going ? 'You stopped at Level ' + st.level + '. Pick up where you left off.' :
(x.a != null && x.a < 75 ? 'Your Test ' + t.n + ' result in ' + (testResult(t).areas[x.tp.area].name || x.tp.area) + ' was ' + x.a + '%. This topic is part of that area.' :
'Next in the learning order for ' + t.name + '.');
q.push({ type: 'topic', t: t, tp: x.tp, title: (going ? 'Continue ' : 'Learn ') + x.tp.title, why: why, url: x.tp.url, cta: going ? 'Continue the lesson' : (x.tp.lesson ? 'Start the lesson' : 'Open the reviewer') });
});
});
return q;
}
function daysLeft() {
if (!D.date) return null;
var exam = new Date(D.date + 'T00:00:00+08:00'), now = new Date();
return Math.max(0, Math.ceil((exam - now) / 86400000));
}
function fmtDate(d) {
var m = ['January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December'];
var p = d.split('-'); return m[+p[1] - 1] + ' ' + (+p[2]) + ', ' + p[0];
}
/* ---------- screens ---------- */
function render() {
var q = queue(), next = q[0], days = daysLeft();
var h = '';
/* top: greeting, countdown, next step */
h += '';
h += '
';
});
h += '';
/* topics per test; tests with no reviewers yet share one short note */
var soon = [];
D.tests.forEach(function (t) {
var list = (D.topics || {})[t.key] || [];
if (!list.length) { soon.push(t); return; }
var done = list.filter(isDone).length;
var art = ART[SUBJECT_ART[t.key]];
h += '' + (art ? '' : '') + '
' + esc(t.name) + ': ' + list.length + ' topics
' + done + ' of ' + list.length + ' done
' +
'
' +
'
Work through them in this order. Leveled lessons record your progress here by themselves; for the other reviewers, tick Done when you finish.
';
list.forEach(function (tp) {
var st = topicState(tp), a = areaScore(t, tp.area), r = testResult(t);
var weak = a != null && a < 60 && !isDone(tp);
var meta = (tp.lesson ? 'Leveled lesson' : 'Reviewer') + (weak ? 'Start here (' + a + '%)' : '');
var status = tp.lesson ?
(st.kind === 'mastered' ? '\u2713 Mastered' :
st.kind === 'going' ? 'Level ' + st.level + ', in progress' : 'Not started') :
'';
h += '
';
});
h += '';
});
if (soon.length) {
var names = soon.map(function (t) { return t.name; });
var joined = names.length > 1 ? names.slice(0, -1).join(', ') + ' and ' + names[names.length - 1] : names[0];
h += '
' + esc(joined) + '
Reviewers for ' + (soon.length > 1 ? 'these tests' : 'this test') + ' are being written. Until then, take ' +
(function (l) { return l.length > 1 ? l.slice(0, -1).join(', ') + ' and ' + l[l.length - 1] : l[0]; })(soon.map(function (t) { return 'Test ' + esc(t.n) + ''; })) + ' and use your result to see what to practice.
';
}
/* this week */
var week = q.slice(0, S.sessions);
h += '
Your progress is saved on this device only. If you switch phones or clear your browser, it starts fresh.
';
}
app.innerHTML = h;
wire();
}
function wire() {
var nb = app.querySelector('[data-act="name"]'), form = app.querySelector('.abi-sh-nameform');
nb.onclick = function () { form.hidden = !form.hidden; if (!form.hidden) form.querySelector('input').focus(); };
form.onsubmit = function (e) { e.preventDefault(); S.name = form.querySelector('input').value.trim().slice(0, 24); save(); render(); };
Array.prototype.forEach.call(app.querySelectorAll('[data-sessions]'), function (b) {
b.onclick = function () { S.sessions = +b.getAttribute('data-sessions'); save(); render(); app.querySelector('[data-sessions="' + S.sessions + '"]').focus(); };
});
Array.prototype.forEach.call(app.querySelectorAll('[data-done]'), function (c) {
c.onchange = function () { var u = c.getAttribute('data-done'); if (c.checked) S.done[u] = Date.now(); else delete S.done[u]; save(); render(); var x = app.querySelector('[data-done="' + u.replace(/"/g, '\\"') + '"]'); if (x) x.focus(); };
});
}
render();
/* come back from a lesson or test in another tab: refresh */
window.addEventListener('storage', function (e) { if (!e.key || /^abi(Results|Lessons|Hub)/.test(e.key)) render(); });
window.addEventListener('pageshow', function (e) { if (e.persisted) render(); });
}
})();
//]]>