I want to make 40 marks paper from this pdf strictly include all type of questions from both 1 chapter and 1 poem
cd /home/daytona/workspace/attachments/ef88c779-c517-45ed-bdd0-112dc04aff4c && p…
cd /home/daytona/workspace/attachments/ef88c779-c517-45ed-bdd0-112dc04aff4c && p…
cd /home/daytona/workspace/attachments/ef88c779-c517-45ed-bdd0-112dc04aff4c && p…
mkdir -p /home/daytona/workspace/question-paper && ls /home/daytona/workspace/qu…
~/question-paper/create_paper.js
const {
Document, Packer, Paragraph, TextRun, Table, TableRow, TableCell,
AlignmentType, HeadingLevel, BorderStyle, WidthType, VerticalAlign,
UnderlineType
} = require('docx');
const fs = require('fs');
function heading(text, size, bold, center, underline) {
return new Paragraph({
alignment: center ? AlignmentType.CENTER : AlignmentType.LEFT,
children: [
new TextRun({
text,
bold: bold !== false,
size: size || 24,
underline: underline ? { type: UnderlineType.SINGLE } : undefined,
})
],
spacing: { before: 160, after: 80 }
});
}
function para(text, bold, size, indent) {
return new Paragraph({
indent: indent ? { left: 360 } : undefined,
children: [
new TextRun({ text, bold: bold || false, size: size || 22 })
],
spacing: { before: 60, after: 60 }
});
}
function subpara(text, bold) {
return new Paragraph({
indent: { left: 720 },
children: [new TextRun({ text, bold: bold || false, size: 22 })],
spacing: { before: 40, after: 40 }
});
}
function blank() {
return new Paragraph({ children: [new TextRun({ text: '' })], spacing: { before: 40, after: 40 } });
}
function sectionHead(text) {
return new Paragraph({
children: [
new TextRun({ text, bold: true, size: 24, underline: { type: UnderlineType.SINGLE } })
],
spacing: { before: 180, after: 80 }
});
}
function qLine(qNum, text, marks) {
return new Paragraph({
children: [
new TextRun({ text: `Q.${qNum}. `, bold: true, size: 22 }),
new TextRun({ text: text, size: 22 }),
new TextRun({ text: ` [${marks} Mark${marks > 1 ? 's' : ''}]`, bold: true, size: 22 })
],
spacing: { before: 100, after: 60 }
});
}
function optionLine(letter, text) {
return new Paragraph({
indent: { left: 720 },
children: [new TextRun({ text: `(${letter}) ${text}`, size: 22 })],
spacing: { before: 30, after: 30 }
});
}
const doc = new Document({
sections: [{
properties: {},
children: [
// ===== HEADER =====
heading('ENGLISH (First Language) – STANDARD 9', 26, true, true),
heading('UNIT TEST – CHAPTER 1 & POEM 1', 26, true, true),
blank(),
// Info table
new Table({
width: { size: 100, type: WidthType.PERCENTAGE },
borders: {
top: { style: BorderStyle.NONE },
bottom: { style: BorderStyle.NONE },
left: { style: BorderStyle.NONE },
right: { style: BorderStyle.NONE },
insideH: { style: BorderStyle.NONE },
insideV: { style: BorderStyle.NONE },
},
rows: [
new TableRow({
children: [
new TableCell({
width: { size: 50, type: WidthType.PERCENTAGE },
borders: { top: { style: BorderStyle.NONE }, bottom: { style: BorderStyle.NONE }, left: { style: BorderStyle.NONE }, right: { style: BorderStyle.NONE } },
children: [new Paragraph({ children: [new TextRun({ text: 'Name: _______________________________', size: 22 })] })]
}),
new TableCell({
width: { size: 50, type: WidthType.PERCENTAGE },
borders: { top: { style: BorderStyle.NONE }, bottom: { style: BorderStyle.NONE }, left: { style: BorderStyle.NONE }, right: { style: BorderStyle.NONE } },
children: [new Paragraph({ children: [new TextRun({ text: 'Date: ________________', size: 22 })] })]
})
]
}),
new TableRow({
children: [
new TableCell({
borders: { top: { style: BorderStyle.NONE }, bottom: { style: BorderStyle.NONE }, left: { style: BorderStyle.NONE }, right: { style: BorderStyle.NONE } },
children: [new Paragraph({ children: [new TextRun({ text: 'Roll No.: ____________', size: 22 })] })]
}),
new TableCell({
borders: { top: { style: BorderStyle.NONE }, bottom: { style: BorderStyle.NONE }, left: { style: BorderStyle.NONE }, right: { style: BorderStyle.NONE } },
children: [new Paragraph({ children: [new TextRun({ text: 'Total Marks: 40', size: 22, bold: true })] })]
})
]
})
]
}),
blank(),
new Paragraph({
alignment: AlignmentType.CENTER,
children: [new TextRun({ text: '— All questions are compulsory. —', bold: true, size: 22, italics: true })],
spacing: { before: 80, after: 160 }
}),
// ===================================================================
// SECTION A – READING COMPREHENSION (MCQ)
// ===================================================================
new Paragraph({
alignment: AlignmentType.CENTER,
children: [new TextRun({ text: 'SECTION A – READING COMPREHENSION (Multiple Choice Questions)', bold: true, size: 24, underline: { type: UnderlineType.SINGLE } })],
spacing: { before: 160, after: 100 }
}),
para('(Based on Chapter 1: "The Fun They Had" and Poem 1: "The Road Not Taken")', false, 21),
para('Choose the correct option for each question.', false, 22),
blank(),
// Passage (A)
sectionHead('(A) Read the following passage and answer the questions: [5 Marks]'),
para('"They turned the pages, which were yellow and crinkly, and it was awfully funny to read words that stood still instead of moving the way they were supposed to—on a screen, you know. And then when they turned back to the page before, it had the same words on it that it had had when they read it the first time."', false, 22),
blank(),
qLine(1, 'The pages of the book were described as _______.', 1),
optionLine('A', 'Smooth and white'),
optionLine('B', 'Yellow and crinkly'),
optionLine('C', 'Torn and faded'),
optionLine('D', 'Green and damp'),
blank(),
qLine(2, 'The children found it strange that the words _______.', 1),
optionLine('A', 'Disappeared after reading'),
optionLine('B', 'Changed colour'),
optionLine('C', 'Stood still instead of moving on a screen'),
optionLine('D', 'Were printed in a foreign language'),
blank(),
qLine(3, 'The passage is taken from which story?', 1),
optionLine('A', 'The Road Not Taken'),
optionLine('B', 'The Fun They Had'),
optionLine('C', 'Wind'),
optionLine('D', 'The Sound of Music'),
blank(),
// Passage (B) – Poem
sectionHead('(B) Read the following stanza and answer the questions: [2 Marks]'),
para('"I shall be telling this with a sigh / Somewhere ages and ages hence; / Two roads diverged in a wood, and I— / I took the one less travelled by, / And that has made all the difference."', false, 22),
blank(),
qLine(4, 'The Figure of Speech in "Somewhere ages and ages hence" is _______.', 1),
optionLine('A', 'Simile'),
optionLine('B', 'Repetition and Assonance'),
optionLine('C', 'Metaphor'),
optionLine('D', 'Personification'),
blank(),
qLine(5, 'The phrase "the one less travelled by" means _______.', 1),
optionLine('A', 'The road that was broken'),
optionLine('B', 'The road that was very famous'),
optionLine('C', 'The road that was rarely used by others'),
optionLine('D', 'The road covered in snow'),
blank(),
// ===================================================================
// SECTION B – REFERENCE TO CONTEXT
// ===================================================================
new Paragraph({
alignment: AlignmentType.CENTER,
children: [new TextRun({ text: 'SECTION B – REFERENCE TO CONTEXT', bold: true, size: 24, underline: { type: UnderlineType.SINGLE } })],
spacing: { before: 200, after: 100 }
}),
sectionHead('(A) From Chapter 1: "The Fun They Had" [3 Marks]'),
para('"I wouldn\'t throw it away." [3 Marks]', false, 22),
blank(),
qLine(6, 'Who says these words and to whom?', 1),
blank(),
new Paragraph({ indent: { left: 360 }, children: [new TextRun({ text: 'Ans: ______________________________________________________________________________', size: 22 })], spacing: { before: 40, after: 60 } }),
blank(),
qLine(7, 'What does "it" refer to in the above line?', 1),
blank(),
new Paragraph({ indent: { left: 360 }, children: [new TextRun({ text: 'Ans: ______________________________________________________________________________', size: 22 })], spacing: { before: 40, after: 60 } }),
blank(),
qLine(8, 'What is "it" being compared with by the speaker?', 1),
blank(),
new Paragraph({ indent: { left: 360 }, children: [new TextRun({ text: 'Ans: ______________________________________________________________________________', size: 22 })], spacing: { before: 40, after: 60 } }),
blank(),
sectionHead('(B) From Poem 1: "The Road Not Taken" [3 Marks]'),
para('"Then took the other, just as fair, / And having perhaps the better claim, / Because it was grassy and wanted wear." [3 Marks]', false, 22),
blank(),
qLine(9, 'Which road does the poet choose and why?', 1),
blank(),
new Paragraph({ indent: { left: 360 }, children: [new TextRun({ text: 'Ans: ______________________________________________________________________________', size: 22 })], spacing: { before: 40, after: 60 } }),
blank(),
qLine(10, 'What does "the better claim" mean?', 1),
blank(),
new Paragraph({ indent: { left: 360 }, children: [new TextRun({ text: 'Ans: ______________________________________________________________________________', size: 22 })], spacing: { before: 40, after: 60 } }),
blank(),
qLine(11, 'What is the rhyme scheme of this stanza?', 1),
blank(),
new Paragraph({ indent: { left: 360 }, children: [new TextRun({ text: 'Ans: ______________________________________________________________________________', size: 22 })], spacing: { before: 40, after: 60 } }),
blank(),
// ===================================================================
// SECTION C – SHORT ANSWER QUESTIONS
// ===================================================================
new Paragraph({
alignment: AlignmentType.CENTER,
children: [new TextRun({ text: 'SECTION C – SHORT ANSWER QUESTIONS (30 words each)', bold: true, size: 24, underline: { type: UnderlineType.SINGLE } })],
spacing: { before: 200, after: 100 }
}),
sectionHead('(A) Chapter 1: "The Fun They Had" [8 Marks]'),
para('Answer each question in a short paragraph (about 30 words).', false, 21),
blank(),
qLine(12, 'What kind of teacher did Margie and Tommy have?', 2),
blank(),
new Paragraph({ indent: { left: 360 }, children: [new TextRun({ text: 'Ans: ______________________________________________________________________________', size: 22 })], spacing: { before: 20, after: 20 } }),
new Paragraph({ indent: { left: 360 }, children: [new TextRun({ text: '________________________________________________________________________________', size: 22 })], spacing: { before: 20, after: 60 } }),
blank(),
qLine(13, 'Why did Margie\'s mother send for the County Inspector?', 2),
blank(),
new Paragraph({ indent: { left: 360 }, children: [new TextRun({ text: 'Ans: ______________________________________________________________________________', size: 22 })], spacing: { before: 20, after: 20 } }),
new Paragraph({ indent: { left: 360 }, children: [new TextRun({ text: '________________________________________________________________________________', size: 22 })], spacing: { before: 20, after: 60 } }),
blank(),
qLine(14, 'Did Margie have regular days and hours for school? If so, why?', 2),
blank(),
new Paragraph({ indent: { left: 360 }, children: [new TextRun({ text: 'Ans: ______________________________________________________________________________', size: 22 })], spacing: { before: 20, after: 20 } }),
new Paragraph({ indent: { left: 360 }, children: [new TextRun({ text: '________________________________________________________________________________', size: 22 })], spacing: { before: 20, after: 60 } }),
blank(),
qLine(15, 'Where was Margie\'s school? Did she have any classmates?', 2),
blank(),
new Paragraph({ indent: { left: 360 }, children: [new TextRun({ text: 'Ans: ______________________________________________________________________________', size: 22 })], spacing: { before: 20, after: 20 } }),
new Paragraph({ indent: { left: 360 }, children: [new TextRun({ text: '________________________________________________________________________________', size: 22 })], spacing: { before: 20, after: 60 } }),
blank(),
sectionHead('(B) Poem 1: "The Road Not Taken" [6 Marks]'),
para('Answer each question in a short paragraph (about 30 words).', false, 21),
blank(),
qLine(16, 'Where does the traveller find himself? What problem does he face?', 2),
blank(),
new Paragraph({ indent: { left: 360 }, children: [new TextRun({ text: 'Ans: ______________________________________________________________________________', size: 22 })], spacing: { before: 20, after: 20 } }),
new Paragraph({ indent: { left: 360 }, children: [new TextRun({ text: '________________________________________________________________________________', size: 22 })], spacing: { before: 20, after: 60 } }),
blank(),
qLine(17, 'Could the poet see the road to its end? Why / Why not?', 2),
blank(),
new Paragraph({ indent: { left: 360 }, children: [new TextRun({ text: 'Ans: ______________________________________________________________________________', size: 22 })], spacing: { before: 20, after: 20 } }),
new Paragraph({ indent: { left: 360 }, children: [new TextRun({ text: '________________________________________________________________________________', size: 22 })], spacing: { before: 20, after: 60 } }),
blank(),
qLine(18, 'What doubt did the poet have after choosing one of the two roads?', 2),
blank(),
new Paragraph({ indent: { left: 360 }, children: [new TextRun({ text: 'Ans: ______________________________________________________________________________', size: 22 })], spacing: { before: 20, after: 20 } }),
new Paragraph({ indent: { left: 360 }, children: [new TextRun({ text: '________________________________________________________________________________', size: 22 })], spacing: { before: 20, after: 60 } }),
blank(),
// ===================================================================
// SECTION D – GRAMMAR (Match / Fill in the Blanks / Figures of Speech)
// ===================================================================
new Paragraph({
alignment: AlignmentType.CENTER,
children: [new TextRun({ text: 'SECTION D – LANGUAGE AND GRAMMAR', bold: true, size: 24, underline: { type: UnderlineType.SINGLE } })],
spacing: { before: 200, after: 100 }
}),
sectionHead('(A) Fill in the Blanks [3 Marks]'),
para('Fill in each blank with the correct word from the brackets.', false, 21),
blank(),
new Paragraph({ indent: { left: 360 }, children: [new TextRun({ text: '1. Margie\'s school was right next to her ________________. (classroom / bedroom / kitchen)', size: 22 })], spacing: { before: 60, after: 60 } }),
new Paragraph({ indent: { left: 360 }, children: [new TextRun({ text: '2. The County Inspector ________________ the geography sector to an average ten-year level. (sped up / slowed / removed)', size: 22 })], spacing: { before: 60, after: 60 } }),
new Paragraph({ indent: { left: 360 }, children: [new TextRun({ text: '3. The poet in "The Road Not Taken" chose the road that was ________________ and wanted wear. (muddy / grassy / rocky)', size: 22 })], spacing: { before: 60, after: 60 } }),
blank(),
sectionHead('(B) Figures of Speech – Identify and Name [3 Marks]'),
para('Identify the Figure of Speech in each line and name it.', false, 21),
blank(),
new Paragraph({ indent: { left: 360 }, children: [new TextRun({ text: '1. "Two roads diverged in a yellow wood."', size: 22 })], spacing: { before: 60, after: 40 } }),
new Paragraph({ indent: { left: 720 }, children: [new TextRun({ text: 'Figure of Speech: ______________________ Explanation: ________________________', size: 22 })], spacing: { before: 20, after: 60 } }),
new Paragraph({ indent: { left: 360 }, children: [new TextRun({ text: '2. "Yet knowing how way leads on to way."', size: 22 })], spacing: { before: 60, after: 40 } }),
new Paragraph({ indent: { left: 720 }, children: [new TextRun({ text: 'Figure of Speech: ______________________ Explanation: ________________________', size: 22 })], spacing: { before: 20, after: 60 } }),
new Paragraph({ indent: { left: 360 }, children: [new TextRun({ text: '3. "Somewhere ages and ages hence."', size: 22 })], spacing: { before: 60, after: 40 } }),
new Paragraph({ indent: { left: 720 }, children: [new TextRun({ text: 'Figure of Speech: ______________________ Explanation: ________________________', size: 22 })], spacing: { before: 20, after: 60 } }),
blank(),
// ===================================================================
// SECTION E – LONG ANSWER QUESTIONS
// ===================================================================
new Paragraph({
alignment: AlignmentType.CENTER,
children: [new TextRun({ text: 'SECTION E – LONG ANSWER QUESTIONS (100–150 words)', bold: true, size: 24, underline: { type: UnderlineType.SINGLE } })],
spacing: { before: 200, after: 100 }
}),
sectionHead('Answer any TWO of the following. [10 Marks: 5 Marks each]'),
blank(),
qLine(19, '(A) What are the main features of the mechanical teachers and the schoolrooms that Margie and Tommy have in the story "The Fun They Had"?', 5),
para('OR', true),
qLine('19', '(B) Describe the character of Margie.', 5),
blank(),
new Paragraph({ indent: { left: 360 }, children: [new TextRun({ text: 'Ans: ______________________________________________________________________________', size: 22 })], spacing: { before: 20, after: 20 } }),
...Array(8).fill(null).map(() => new Paragraph({ indent: { left: 360 }, children: [new TextRun({ text: '________________________________________________________________________________', size: 22 })], spacing: { before: 20, after: 20 } })),
blank(),
qLine(20, '(A) Write a brief note on the theme of Robert Frost\'s poem "The Road Not Taken".', 5),
para('OR', true),
qLine('20', '(B) "I took the one less travelled by, / And that has made all the difference." – Explain the significance of these lines.', 5),
blank(),
new Paragraph({ indent: { left: 360 }, children: [new TextRun({ text: 'Ans: ______________________________________________________________________________', size: 22 })], spacing: { before: 20, after: 20 } }),
...Array(8).fill(null).map(() => new Paragraph({ indent: { left: 360 }, children: [new TextRun({ text: '________________________________________________________________________________', size: 22 })], spacing: { before: 20, after: 20 } })),
blank(),
// ===================================================================
// SECTION F – VOCABULARY / GLOSSARY
// ===================================================================
new Paragraph({
alignment: AlignmentType.CENTER,
children: [new TextRun({ text: 'SECTION F – VOCABULARY', bold: true, size: 24, underline: { type: UnderlineType.SINGLE } })],
spacing: { before: 200, after: 100 }
}),
sectionHead('(A) Match the words with their meanings: [4 Marks]'),
blank(),
// Match table
new Table({
width: { size: 90, type: WidthType.PERCENTAGE },
rows: [
new TableRow({
children: [
new TableCell({ width: { size: 10, type: WidthType.PERCENTAGE }, children: [new Paragraph({ children: [new TextRun({ text: ' ', bold: true, size: 22 })] })] }),
new TableCell({ width: { size: 35, type: WidthType.PERCENTAGE }, children: [new Paragraph({ children: [new TextRun({ text: 'Column A (Word)', bold: true, size: 22 })] })] }),
new TableCell({ width: { size: 10, type: WidthType.PERCENTAGE }, children: [new Paragraph({ children: [new TextRun({ text: ' ', bold: true, size: 22 })] })] }),
new TableCell({ width: { size: 45, type: WidthType.PERCENTAGE }, children: [new Paragraph({ children: [new TextRun({ text: 'Column B (Meaning)', bold: true, size: 22 })] })] }),
]
}),
...[
['1.', 'Crinkly', 'a.', 'Separated and took different directions'],
['2.', 'Diverged', 'b.', 'Walked/trampled on'],
['3.', 'Trodden', 'c.', 'Wrinkled, folded'],
['4.', 'Nonchalantly', 'd.', 'In an uninterested / casual manner'],
].map(([n, w, l, m]) => new TableRow({
children: [
new TableCell({ children: [new Paragraph({ children: [new TextRun({ text: n, size: 22 })] })] }),
new TableCell({ children: [new Paragraph({ children: [new TextRun({ text: w, size: 22 })] })] }),
new TableCell({ children: [new Paragraph({ children: [new TextRun({ text: l, size: 22 })] })] }),
new TableCell({ children: [new Paragraph({ children: [new TextRun({ text: m, size: 22 })] })] }),
]
}))
]
}),
blank(),
para('Answers: 1-___, 2-___, 3-___, 4-___', false, 22),
blank(),
sectionHead('(B) Give the meaning of the following phrases: [3 Marks]'),
blank(),
new Paragraph({ indent: { left: 360 }, children: [new TextRun({ text: '1. "be through with" – ___________________________________________________________________', size: 22 })], spacing: { before: 60, after: 60 } }),
new Paragraph({ indent: { left: 360 }, children: [new TextRun({ text: '2. "blank out" – _________________________________________________________________________', size: 22 })], spacing: { before: 60, after: 60 } }),
new Paragraph({ indent: { left: 360 }, children: [new TextRun({ text: '3. "wanted wear" – ______________________________________________________________________', size: 22 })], spacing: { before: 60, after: 60 } }),
blank(),
// Marks summary
new Paragraph({
alignment: AlignmentType.CENTER,
children: [new TextRun({ text: '* * * END OF PAPER * * *', bold: true, size: 22 })],
spacing: { before: 200, after: 80 }
}),
new Paragraph({
alignment: AlignmentType.CENTER,
children: [new TextRun({ text: 'Total: 40 Marks', bold: true, size: 24, underline: { type: UnderlineType.SINGLE } })],
spacing: { before: 60, after: 80 }
}),
// Marks breakdown box
sectionHead('Marks Distribution:'),
new Table({
width: { size: 80, type: WidthType.PERCENTAGE },
rows: [
new TableRow({ children: [
new TableCell({ children: [new Paragraph({ children: [new TextRun({ text: 'Section', bold: true, size: 22 })] })] }),
new TableCell({ children: [new Paragraph({ children: [new TextRun({ text: 'Type', bold: true, size: 22 })] })] }),
new TableCell({ children: [new Paragraph({ children: [new TextRun({ text: 'Marks', bold: true, size: 22 })] })] }),
]}),
...[
['A', 'Reading Comprehension (MCQ)', '5'],
['B', 'Reference to Context', '6'],
['C', 'Short Answer Questions', '14'],
['D', 'Language and Grammar', '6'],
['E', 'Long Answer Questions', '10'], // 2 × 5
// Wait - let me recount: A=5, B=6, C=14, D=6, E=10 = 41. Adjust C to 13
// Actually: A=5, B=6, C=8+6=14, D=3+3=6, E=10 = 41 - fix match table to 3 marks and phrase to 2 = ok 5 total for vocab
// Recount: A=5, B=6, C=14, D=6, E=10 = 41. Let's fix: remove one short answer Q or reduce
// Actually Q12-15 = 4 × 2 = 8 (Ch1), Q16-18 = 3 × 2 = 6 (poem) = 14 for Section C
// Section D: fill=3, FoS=3 = 6
// Section E: 2 × 5 = 10
// Section F: match=4, phrases=3 = 7 ← wait I wrote 4 + 3 = 7 but this is Vocab not D
// Total: 5+6+14+6+10+7 = 48. Need to trim.
// Fix plan: Section C: Q12-15 = 4q at 1 mark each = 4 + Q16-18 = 3q at 2 marks = 6 → 10 total
// Section F: match=3, phrases=2 = 5
// Total: 5+6+10+6+10+5 = 42. Still 2 over.
// Simplest fix: reduce long answers to 2 × 4 = 8 → 40 exactly
// I'll note the correct distribution below
['F', 'Vocabulary (Match + Phrases)', '7'],
['', 'TOTAL', '48'],
].map(([s, t, m]) => new TableRow({ children: [
new TableCell({ children: [new Paragraph({ children: [new TextRun({ text: s, size: 22 })] })] }),
new TableCell({ children: [new Paragraph({ children: [new TextRun({ text: t, size: 22 })] })] }),
new TableCell({ children: [new Paragraph({ children: [new TextRun({ text: m, size: 22 })] })] }),
]}))
]
}),
]
}]
});
Packer.toBuffer(doc).then(buffer => {
fs.writeFileSync('/home/daytona/workspace/question-paper/Question_Paper_40_Marks.docx', buffer);
console.log('Done! File written.');
});
~/question-paper/build_paper.js
const {
Document, Packer, Paragraph, TextRun, Table, TableRow, TableCell,
AlignmentType, BorderStyle, WidthType, UnderlineType, PageOrientation
} = require('docx');
const fs = require('fs');
// ---- helpers ----
const C = (text, opts = {}) => new TextRun({ text, size: opts.size || 22, bold: opts.bold || false, underline: opts.ul ? { type: UnderlineType.SINGLE } : undefined, italics: opts.it || false });
const P = (runs, opts = {}) => new Paragraph({ alignment: opts.align || AlignmentType.LEFT, indent: opts.indent ? { left: opts.indent } : undefined, spacing: { before: opts.before || 80, after: opts.after || 60 }, children: Array.isArray(runs) ? runs : [runs] });
const blank = () => P([C('')], { before: 40, after: 40 });
const hr = () => new Paragraph({ border: { bottom: { style: BorderStyle.SINGLE, size: 6 } }, children: [], spacing: { before: 120, after: 120 } });
// Section title
const secTitle = (text) => P([C(text, { bold: true, size: 24, ul: true })], { align: AlignmentType.CENTER, before: 200, after: 100 });
// Sub heading
const subH = (text) => P([C(text, { bold: true, size: 22 })], { before: 160, after: 80 });
// Question
const Q = (num, text, marks) => new Paragraph({
spacing: { before: 120, after: 60 },
children: [
C(`Q.${num}. `, { bold: true }),
C(text),
C(` [${marks} Mark${marks > 1 ? 's' : ''}]`, { bold: true })
]
});
// Option
const OPT = (letter, text) => P([C(`(${letter}) ${text}`)], { indent: 720, before: 30, after: 30 });
// Answer line
const ansLine = (n) => Array(n).fill(null).map(() =>
P([C('________________________________________________________________________________')], { indent: 360, before: 30, after: 30 })
);
// Simple bordered table cell
const TC = (text, bold) => new TableCell({ children: [P([C(text, { bold: bold || false })])] });
const doc = new Document({
sections: [{
properties: { page: { size: { orientation: PageOrientation.PORTRAIT } } },
children: [
// ===== TITLE =====
P([C('ENGLISH (First Language) – STANDARD 9', { bold: true, size: 28, ul: true })], { align: AlignmentType.CENTER, before: 0, after: 60 }),
P([C('Unit Test – Chapter 1 & Poem 1', { bold: true, size: 26 })], { align: AlignmentType.CENTER, before: 0, after: 60 }),
P([C('The Fun They Had | The Road Not Taken', { it: true, size: 22 })], { align: AlignmentType.CENTER, before: 0, after: 80 }),
// Info row
new Table({
width: { size: 100, type: WidthType.PERCENTAGE },
borders: { top: { style: BorderStyle.NONE }, bottom: { style: BorderStyle.NONE }, left: { style: BorderStyle.NONE }, right: { style: BorderStyle.NONE }, insideH: { style: BorderStyle.NONE }, insideV: { style: BorderStyle.NONE } },
rows: [
new TableRow({ children: [
new TableCell({ borders: { top: { style: BorderStyle.NONE }, bottom: { style: BorderStyle.NONE }, left: { style: BorderStyle.NONE }, right: { style: BorderStyle.NONE } }, children: [P([C('Name: ___________________________________')])] }),
new TableCell({ borders: { top: { style: BorderStyle.NONE }, bottom: { style: BorderStyle.NONE }, left: { style: BorderStyle.NONE }, right: { style: BorderStyle.NONE } }, children: [P([C('Date: ____________________')])] }),
new TableCell({ borders: { top: { style: BorderStyle.NONE }, bottom: { style: BorderStyle.NONE }, left: { style: BorderStyle.NONE }, right: { style: BorderStyle.NONE } }, children: [P([C('Total Marks: 40', { bold: true })])] }),
]})
]
}),
blank(),
P([C('All questions are compulsory. Attempt all sections.', { it: true })], { align: AlignmentType.CENTER, before: 60, after: 160 }),
// ====================================================
// SECTION A – MCQ (5 marks)
// ====================================================
secTitle('SECTION A – MULTIPLE CHOICE QUESTIONS'),
P([C('(Choose the correct option. Each question carries 1 mark.)', { it: true })]),
blank(),
subH('Part 1 – Chapter: "The Fun They Had" (Q. 1 to 3) [3 Marks]'),
Q(1, 'How old were Margie and Tommy respectively?', 1),
OPT('A', '10 and 12'),
OPT('B', '11 and 13'),
OPT('C', '9 and 11'),
OPT('D', '12 and 14'),
blank(),
Q(2, 'The County Inspector repaired the mechanical teacher by _______.', 1),
OPT('A', 'Removing the geography sector completely'),
OPT('B', 'Replacing the television screen'),
OPT('C', 'Slowing it up to an average ten-year level'),
OPT('D', 'Gearing it to a higher level'),
blank(),
Q(3, 'What was the subject that caused Margie to perform poorly?', 1),
OPT('A', 'History'),
OPT('B', 'Arithmetic'),
OPT('C', 'Geography'),
OPT('D', 'Science'),
blank(),
subH('Part 2 – Poem: "The Road Not Taken" (Q. 4 to 5) [2 Marks]'),
Q(4, 'The phrase "wanted wear" in the poem means the road _______.', 1),
OPT('A', 'needed repair'),
OPT('B', 'was quite untrodden / rarely used'),
OPT('C', 'was covered with snow'),
OPT('D', 'led to a village'),
blank(),
Q(5, 'The rhyme scheme of the first stanza of "The Road Not Taken" is _______.', 1),
OPT('A', 'aabba'),
OPT('B', 'abcab'),
OPT('C', 'abaab'),
OPT('D', 'aabab'),
blank(),
hr(),
// ====================================================
// SECTION B – REFERENCE TO CONTEXT (6 marks)
// ====================================================
secTitle('SECTION B – REFERENCE TO CONTEXT'),
blank(),
subH('(A) From Chapter 1: "The Fun They Had" [3 Marks]'),
P([C('"I wouldn\'t throw it away."', { it: true })]),
blank(),
Q(6, 'Who says these words, and to whom?', 1),
...ansLine(1),
blank(),
Q(7, 'What does "it" refer to in the above line?', 1),
...ansLine(1),
blank(),
Q(8, 'What is "it" being compared with by the speaker?', 1),
...ansLine(1),
blank(),
subH('(B) From Poem 1: "The Road Not Taken" [3 Marks]'),
P([C('"Then took the other, just as fair, / And having perhaps the better claim, / Because it was grassy and wanted wear."', { it: true })]),
blank(),
Q(9, 'Which road does the poet choose, and why?', 1),
...ansLine(1),
blank(),
Q(10, 'What does the phrase "the better claim" mean?', 1),
...ansLine(1),
blank(),
Q(11, 'Identify the Figure of Speech in "it was grassy and wanted wear".', 1),
...ansLine(1),
blank(),
hr(),
// ====================================================
// SECTION C – SHORT ANSWER (12 marks)
// ====================================================
secTitle('SECTION C – SHORT ANSWER QUESTIONS (about 30 words each)'),
blank(),
subH('(A) Chapter 1: "The Fun They Had" [6 Marks]'),
Q(12, 'Why did Margie\'s mother send for the County Inspector?', 2),
...ansLine(3),
blank(),
Q(13, 'How does Tommy describe the old kind of school to Margie?', 2),
...ansLine(3),
blank(),
Q(14, 'What was the part of the mechanical teacher that Margie hated most?', 2),
...ansLine(3),
blank(),
subH('(B) Poem 1: "The Road Not Taken" [6 Marks]'),
Q(15, 'Where does the traveller find himself and what problem does he face?', 2),
...ansLine(3),
blank(),
Q(16, 'What made the choice of a road difficult for the poet in the third stanza?', 2),
...ansLine(3),
blank(),
Q(17, 'What does the poet mean by "telling this with a sigh"?', 2),
...ansLine(3),
blank(),
hr(),
// ====================================================
// SECTION D – LANGUAGE STUDY (6 marks)
// ====================================================
secTitle('SECTION D – LANGUAGE STUDY'),
blank(),
subH('(A) Fill in the Blanks with the correct word from the brackets: [3 Marks]'),
blank(),
P([C('1. Margie\'s school was right next to her _______________. (bedroom / classroom / garden)')], { indent: 360 }),
blank(),
P([C('2. The County Inspector _______________ the geography sector to a ten-year level. (sped up / slowed / removed)')], { indent: 360 }),
blank(),
P([C('3. The poet took the road that was _______________ and less frequently used. (muddy / grassy / stony)')], { indent: 360 }),
blank(),
subH('(B) Identify the Figure of Speech in each line and write it: [3 Marks]'),
blank(),
P([C('1. "Two roads diverged in a yellow wood."')], { indent: 360 }),
P([C('Figure of Speech: ____________________ Explanation: _________________________________')], { indent: 720, before: 20, after: 60 }),
P([C('2. "Yet knowing how way leads on to way."')], { indent: 360 }),
P([C('Figure of Speech: ____________________ Explanation: _________________________________')], { indent: 720, before: 20, after: 60 }),
P([C('3. "Somewhere ages and ages hence."')], { indent: 360 }),
P([C('Figure of Speech: ____________________ Explanation: _________________________________')], { indent: 720, before: 20, after: 60 }),
blank(),
hr(),
// ====================================================
// SECTION E – VOCABULARY (5 marks)
// ====================================================
secTitle('SECTION E – VOCABULARY'),
blank(),
subH('(A) Match the words in Column A with their meanings in Column B: [4 Marks]'),
blank(),
new Table({
width: { size: 90, type: WidthType.PERCENTAGE },
rows: [
new TableRow({ children: [ TC('', true), TC('Column A', true), TC('', true), TC('Column B', true) ] }),
new TableRow({ children: [ TC('1.'), TC('Crinkly'), TC('(a)'), TC('Adjusted to a level / standard') ] }),
new TableRow({ children: [ TC('2.'), TC('Diverged'), TC('(b)'), TC('Wrinkled, with many folds') ] }),
new TableRow({ children: [ TC('3.'), TC('Geared'), TC('(c)'), TC('Separated and took different directions') ] }),
new TableRow({ children: [ TC('4.'), TC('Trodden'), TC('(d)'), TC('Walked upon / trampled on') ] }),
]
}),
blank(),
P([C('Answers: 1 – ___ 2 – ___ 3 – ___ 4 – ___')], { indent: 360 }),
blank(),
subH('(B) Give the meaning of the following phrases: [1 Mark]'),
blank(),
P([C('1. "have better claim" – ___________________________________________________________________')], { indent: 360 }),
blank(),
hr(),
// ====================================================
// SECTION F – LONG ANSWER (6 marks)
// ====================================================
secTitle('SECTION F – LONG ANSWER QUESTIONS (100–150 words each)'),
P([C('(Attempt any ONE from each part.) [3 Marks each × 2 = 6 Marks]', { it: true })], { align: AlignmentType.CENTER }),
blank(),
subH('Part 1 – Chapter: "The Fun They Had"'),
Q('18', '(A) What are the main features of the mechanical teachers and the schoolrooms described in "The Fun They Had"?', 3),
P([C('OR', { bold: true })], { align: AlignmentType.CENTER }),
Q('18', '(B) Do you agree with Margie that schools today are more fun than the school in the story? Give reasons.', 3),
blank(),
...ansLine(7),
blank(),
subH('Part 2 – Poem: "The Road Not Taken"'),
Q('19', '(A) Write a brief note on the theme and significance of the title "The Road Not Taken".', 3),
P([C('OR', { bold: true })], { align: AlignmentType.CENTER }),
Q('19', '(B) Describe the poet\'s dilemma and what his final choice tells us about his personality.', 3),
blank(),
...ansLine(7),
blank(),
hr(),
// ====================================================
// END + MARKS TABLE
// ====================================================
P([C('* * * END OF QUESTION PAPER * * *', { bold: true })], { align: AlignmentType.CENTER, before: 160 }),
blank(),
subH('Marks Distribution:'),
new Table({
width: { size: 80, type: WidthType.PERCENTAGE },
rows: [
new TableRow({ children: [ TC('Section', true), TC('Type', true), TC('Marks', true) ] }),
new TableRow({ children: [ TC('A'), TC('Multiple Choice Questions'), TC('5') ] }),
new TableRow({ children: [ TC('B'), TC('Reference to Context'), TC('6') ] }),
new TableRow({ children: [ TC('C'), TC('Short Answer Questions'), TC('12') ] }),
new TableRow({ children: [ TC('D'), TC('Language Study (Fill Blanks + FoS)'), TC('6') ] }),
new TableRow({ children: [ TC('E'), TC('Vocabulary (Match + Phrases)'), TC('5') ] }),
new TableRow({ children: [ TC('F'), TC('Long Answer Questions'), TC('6') ] }),
new TableRow({ children: [ TC('', true), TC('TOTAL', true), TC('40', true) ] }),
]
}),
blank(),
]
}]
});
Packer.toBuffer(doc).then(buf => {
fs.writeFileSync('/home/daytona/workspace/question-paper/Question_Paper_40_Marks.docx', buf);
console.log('SUCCESS: File written.');
}).catch(e => { console.error('ERROR:', e); });
cd /home/daytona/workspace/question-paper && node build_paper.js 2>&1
ls -lh /home/daytona/workspace/question-paper/Question_Paper_40_Marks.docx
python3 /home/daytona/skills/docx/scripts/office/validate.py /home/daytona/works…
python3 -c " from docx import Document doc = Document('/home/daytona/workspace/q…
# Quick sanity check - unzip and read document.xml to verify content is correct …
Question Paper 40 Marks
Word Document · DOCX
| Section | Type | Marks |
|---|---|---|
| A | Multiple Choice Questions (5 MCQs) | 5 |
| B | Reference to Context (2 extracts: 3+3) | 6 |
| C | Short Answer Questions (~30 words, 6 Qs) | 12 |
| D | Language Study - Fill in the Blanks + Figures of Speech | 6 |
| E | Vocabulary - Match the Column + Phrase meanings | 5 |
| F | Long Answer Questions (2 OR choices) | 6 |
| TOTAL | 40 |
Is this paper strictly based on this pdf only
Rebuild the paper using ONLY questions & content from the PDF
cd /home/daytona/workspace/attachments/ef88c779-c517-45ed-bdd0-112dc04aff4c && p…
python3 -c " import pytesseract from pdf2image import convert_from_path pages =…
python3 -c " import pytesseract from pdf2image import convert_from_path pdf = '…
python3 -c " import pytesseract from pdf2image import convert_from_path pdf = '…
~/question-paper/build_paper_v2.js
const {
Document, Packer, Paragraph, TextRun, Table, TableRow, TableCell,
AlignmentType, BorderStyle, WidthType, UnderlineType
} = require('docx');
const fs = require('fs');
// ---- helpers ----
const C = (text, opts = {}) => new TextRun({
text, size: opts.size || 22,
bold: opts.bold || false,
underline: opts.ul ? { type: UnderlineType.SINGLE } : undefined,
italics: opts.it || false
});
const P = (runs, opts = {}) => new Paragraph({
alignment: opts.align || AlignmentType.LEFT,
indent: opts.indent ? { left: opts.indent } : undefined,
spacing: { before: opts.before || 80, after: opts.after || 60 },
children: Array.isArray(runs) ? runs : [runs]
});
const blank = () => P([C('')], { before: 40, after: 40 });
const hr = () => new Paragraph({
border: { bottom: { style: BorderStyle.SINGLE, size: 6, color: '000000' } },
children: [], spacing: { before: 140, after: 120 }
});
const secTitle = (text) => P(
[C(text, { bold: true, size: 24, ul: true })],
{ align: AlignmentType.CENTER, before: 200, after: 100 }
);
const subH = (text) => P(
[C(text, { bold: true, size: 22 })],
{ before: 160, after: 80 }
);
const Q = (num, text, marks) => new Paragraph({
spacing: { before: 120, after: 60 },
children: [
C(`Q.${num}. `, { bold: true }),
C(text),
C(` [${marks} Mark${marks > 1 ? 's' : ''}]`, { bold: true })
]
});
const OPT = (letter, text) => P([C(`(${letter}) ${text}`)], { indent: 720, before: 30, after: 30 });
// Answer lines (n = number of blank lines)
const ansLines = (n) => Array(n).fill(null).map(() =>
P([C('________________________________________________________________________________')],
{ indent: 360, before: 30, after: 30 })
);
// Simple table cell
const TC = (text, bold) => new TableCell({
children: [P([C(text, { bold: bold || false })])]
});
// ================================================================
// BUILD DOCUMENT
// ================================================================
const doc = new Document({
sections: [{
children: [
// ===== TITLE BLOCK =====
P([C('ENGLISH (First Language) – STANDARD 9', { bold: true, size: 28, ul: true })],
{ align: AlignmentType.CENTER, before: 0, after: 60 }),
P([C('UNIT TEST – CHAPTER 1 & POEM 1', { bold: true, size: 26 })],
{ align: AlignmentType.CENTER, before: 0, after: 60 }),
P([C('"The Fun They Had" | "The Road Not Taken"', { it: true, size: 22 })],
{ align: AlignmentType.CENTER, before: 0, after: 80 }),
new Table({
width: { size: 100, type: WidthType.PERCENTAGE },
borders: { top:{style:BorderStyle.NONE}, bottom:{style:BorderStyle.NONE}, left:{style:BorderStyle.NONE}, right:{style:BorderStyle.NONE}, insideH:{style:BorderStyle.NONE}, insideV:{style:BorderStyle.NONE} },
rows: [
new TableRow({ children: [
new TableCell({ borders:{top:{style:BorderStyle.NONE},bottom:{style:BorderStyle.NONE},left:{style:BorderStyle.NONE},right:{style:BorderStyle.NONE}}, children:[P([C('Name: _____________________________________')])] }),
new TableCell({ borders:{top:{style:BorderStyle.NONE},bottom:{style:BorderStyle.NONE},left:{style:BorderStyle.NONE},right:{style:BorderStyle.NONE}}, children:[P([C('Date: ____________________')])] }),
new TableCell({ borders:{top:{style:BorderStyle.NONE},bottom:{style:BorderStyle.NONE},left:{style:BorderStyle.NONE},right:{style:BorderStyle.NONE}}, children:[P([C('Total Marks: 40', {bold:true})])] }),
]})
]
}),
blank(),
P([C('All questions are compulsory.', { bold: true, it: true })],
{ align: AlignmentType.CENTER, before: 60, after: 180 }),
// ================================================================
// SECTION A – MCQ [6 Marks]
// Source: PDF pages 17 & 22 – printed MCQs with all 4 options
// ================================================================
secTitle('SECTION A – MULTIPLE CHOICE QUESTIONS'),
P([C('(Each question carries 1 mark.) [6 Marks Total]', { it: true })],
{ align: AlignmentType.CENTER }),
blank(),
subH('Part 1: "The Fun They Had" – Q. 1 to 4'),
// --- PDF Page 22, Passage A (MCQs printed in PDF) ---
subH('(A) Read the following passage and answer the questions:'),
P([C('"They turned the pages, which were yellow and crinkly, and it was awfully funny to read words that stood still instead of moving the way they were supposed to—on a screen, you know. And then when they turned back to the page before, it had the same words on it that it had had when they read it the first time."')],
{ indent: 360 }),
blank(),
Q(1, 'The pages of the book were _______.', 1),
OPT('A', 'funny'),
OPT('B', 'crinkly'),
OPT('C', 'old'),
OPT('D', 'torn'),
blank(),
Q(2, 'The pages of the book _______ on a screen.', 1),
OPT('A', 'stood still'),
OPT('B', 'moved away'),
OPT('C', 'looked very old'),
OPT('D', 'were illegible'),
blank(),
Q(3, 'What was strange about the book they had read?', 1),
OPT('A', 'Its pages were yellow and crinkly.'),
OPT('B', 'It stood still on a screen.'),
OPT('C', 'The pages of the book had the same words on them when they were opened again.'),
OPT('D', 'All of these three.'),
blank(),
// --- PDF Page 17 MCQs ---
Q(4, 'The inspector repaired the mechanical teacher by _______.', 1),
OPT('A', 'Slowing it up to an average ten-year level.'),
OPT('B', 'Making the running of it quite slow.'),
OPT('C', 'Gearing it to a higher level.'),
OPT('D', 'Removing the geography sector from it.'),
blank(),
subH('Part 2: "The Road Not Taken" – Q. 5 to 6'),
subH('(B) Read the following stanza and answer the questions:'),
P([C('"Two roads diverged in a yellow wood, / And sorry I could not travel both / And be one traveller, long I stood / And looked down one as far as I could / To where it bent in the undergrowth."')],
{ indent: 360, it: true }),
blank(),
// PDF Page 21 – Figures of Speech MCQs (Ans. given: 1.D 2.C 3.D 4.A)
Q(5, '"Two roads diverged in a yellow wood." – The Figure of Speech used is _______.', 1),
OPT('A', 'Metaphor'),
OPT('B', 'Consonance'),
OPT('C', 'Assonance'),
OPT('D', 'Both Metaphor and Assonance'),
blank(),
Q(6, '"Somewhere ages and ages hence." – The Figure of Speech used is _______.', 1),
OPT('A', 'Assonance'),
OPT('B', 'Repetition'),
OPT('C', 'Simile'),
OPT('D', 'Both Assonance and Repetition'),
blank(),
hr(),
// ================================================================
// SECTION B – REFERENCE TO CONTEXT [6 Marks]
// Source: PDF pages 16 (Q.2) and 18 (stanza Qs)
// ================================================================
secTitle('SECTION B – REFERENCE TO CONTEXT'),
blank(),
subH('(A) From Chapter 1: "The Fun They Had" [3 Marks]'),
// PDF Page 16, Q.2(1)
P([C('"I wouldn\'t throw it away."')], { indent: 360, it: true }),
blank(),
Q(7, 'Who says these words?', 1),
...ansLines(1),
blank(),
Q(8, 'What does \'it\' refer to?', 1),
...ansLines(1),
blank(),
Q(9, 'What is \'it\' being compared with by the speaker?', 1),
...ansLines(1),
blank(),
subH('(B) From Poem 1: "The Road Not Taken" [3 Marks]'),
// PDF Page 18, Stanza 2 CBQ
P([C('"Then took the other, just as fair, / And having perhaps the better claim, / Because it was grassy and wanted wear; / Though as for that the passing there / Had worn them really about the same."')],
{ indent: 360, it: true }),
blank(),
Q(10, 'How was the second road different from the first?', 1),
...ansLines(1),
blank(),
Q(11, 'Explain "the better claim" in this stanza.', 1),
...ansLines(1),
blank(),
Q(12, 'What is the rhyme-scheme in this stanza?', 1),
...ansLines(1),
blank(),
hr(),
// ================================================================
// SECTION C – COMPREHENSION PASSAGE [6 Marks]
// Source: PDF page 17 – Passage (B) printed in PDF with its 3 Qs
// ================================================================
secTitle('SECTION C – PASSAGE-BASED QUESTIONS'),
blank(),
subH('(A) Read the following passage from "The Fun They Had" and answer the questions: [3 Marks]'),
P([C('"Margie did so with a sigh. She was thinking about the old schools they had when her grandfather\'s grandfather was a little boy. All the kids from the whole neighbourhood came, laughing and shouting in the schoolyard, sitting together in the schoolroom, going home together at the end of the day. They learned the same things, so they could help one another with the homework and talk about it."')],
{ indent: 360 }),
blank(),
Q(13, 'Did Margie study in the old school? Why?', 1),
...ansLines(2),
blank(),
Q(14, 'How did the kids enjoy going to old schools?', 1),
...ansLines(2),
blank(),
Q(15, 'What was the special advantage of old schools?', 1),
...ansLines(2),
blank(),
subH('(B) Read the following stanza from "The Road Not Taken" and answer the questions: [3 Marks]'),
// PDF Page 18, Stanza 4
P([C('"I shall be telling this with a sigh / Somewhere ages and ages hence; / Two roads diverged in a wood, and I— / I took the one less travelled by, / And that has made all the difference."')],
{ indent: 360, it: true }),
blank(),
Q(16, 'What does the poet mean by the words "telling this with a sigh"?', 1),
...ansLines(2),
blank(),
Q(17, 'What made "all the difference" to the poet?', 1),
...ansLines(2),
blank(),
Q(18, 'Identify and explain the Figure of Speech in: "Somewhere ages and ages hence."', 1),
...ansLines(2),
blank(),
hr(),
// ================================================================
// SECTION D – SHORT ANSWER QUESTIONS [12 Marks]
// Source: PDF pages 14 (Qs 1-8), page 19 Q.1, page 21 Q.3
// ================================================================
secTitle('SECTION D – SHORT ANSWER QUESTIONS (about 30 words each)'),
blank(),
subH('(A) Chapter 1: "The Fun They Had" [6 Marks]'),
P([C('(Answer in a short paragraph of about 30 words.)', { it: true })]),
blank(),
// PDF Page 14 Q.(1)
Q(19, 'What kind of teachers did Margie and Tommy have?', 2),
...ansLines(3),
blank(),
// PDF Page 14 Q.(5)
Q(20, 'What had once happened to Tommy\'s teacher?', 2),
...ansLines(3),
blank(),
// PDF Page 14 Q.(6)
Q(21, 'Did Margie have regular days and hours for school? If so, why?', 2),
...ansLines(3),
blank(),
subH('(B) Poem 1: "The Road Not Taken" [6 Marks]'),
P([C('(Answer in a short paragraph of about 30 words.)', { it: true })]),
blank(),
// PDF Page 19 Q.1(1)
Q(22, 'Where does the traveller find himself? What problem does he face?', 2),
...ansLines(3),
blank(),
// PDF Page 21 Q.3(3)
Q(23, 'What was the poet\'s dilemma in the poem "The Road Not Taken"?', 2),
...ansLines(3),
blank(),
// PDF Page 21 Q.3(4)
Q(24, 'Why did the poet keep the first road for another day?', 2),
...ansLines(3),
blank(),
hr(),
// ================================================================
// SECTION E – LONG ANSWER QUESTIONS [8 Marks]
// Source: PDF pages 14-15 Q.4 and pages 20-21 Q.3
// ================================================================
secTitle('SECTION E – LONG ANSWER QUESTIONS (100–150 words)'),
P([C('(Attempt any ONE from Part A and any ONE from Part B.) [4 Marks each]', { it: true })],
{ align: AlignmentType.CENTER }),
blank(),
subH('Part A: "The Fun They Had" [4 Marks]'),
// PDF Page 14 Q.4(1)
Q(25, '(A) What are the main features of the mechanical teachers and the schoolrooms that Margie and Tommy have in the story "The Fun They Had"?', 4),
P([C('OR', { bold: true })], { align: AlignmentType.CENTER, before: 40, after: 40 }),
// PDF Page 15 Q.4(3)
Q('25', '(B) Do you agree with Margie that schools today are more fun than the school in the story? Give reasons for your answer.', 4),
blank(),
...ansLines(9),
blank(),
subH('Part B: "The Road Not Taken" [4 Marks]'),
// PDF Page 21 Q.3(1)
Q(26, '(A) Discuss the significance of the title "The Road Not Taken".', 4),
P([C('OR', { bold: true })], { align: AlignmentType.CENTER, before: 40, after: 40 }),
// PDF Page 21 Q.3(2)
Q('26', '(B) Describe the two roads that the poet finds. Which road does he choose and why?', 4),
blank(),
...ansLines(9),
blank(),
hr(),
// ================================================================
// SECTION F – VOCABULARY / GLOSSARY [2 Marks]
// Source: PDF pages 16 & 19 – printed glossary and phrases/idioms
// ================================================================
secTitle('SECTION F – VOCABULARY'),
blank(),
subH('Give the meaning of the following words/phrases as used in the text: [2 Marks]'),
P([C('(The words below are taken from the Glossary and Phrases sections of your textbook.)', { it: true })]),
blank(),
P([C('1. nonchalantly – __________________________________________________________________')], { indent: 360, before: 60, after: 60 }),
P([C('2. diverged – _____________________________________________________________________')], { indent: 360, before: 60, after: 60 }),
P([C('3. trodden – ______________________________________________________________________')], { indent: 360, before: 60, after: 60 }),
P([C('4. geared – _______________________________________________________________________')], { indent: 360, before: 60, after: 60 }),
blank(),
// ================================================================
// END + MARKS TABLE
// ================================================================
hr(),
P([C('* * * END OF QUESTION PAPER * * *', { bold: true })],
{ align: AlignmentType.CENTER, before: 160, after: 80 }),
blank(),
subH('Marks Distribution (Total = 40):'),
new Table({
width: { size: 80, type: WidthType.PERCENTAGE },
rows: [
new TableRow({ children: [ TC('Section',true), TC('Type',true), TC('Marks',true) ] }),
new TableRow({ children: [ TC('A'), TC('Multiple Choice Questions (from PDF pages 17, 21, 22)'), TC('6') ] }),
new TableRow({ children: [ TC('B'), TC('Reference to Context (from PDF pages 16, 18)'), TC('6') ] }),
new TableRow({ children: [ TC('C'), TC('Passage-Based Questions (from PDF pages 17, 18)'), TC('6') ] }),
new TableRow({ children: [ TC('D'), TC('Short Answer Questions (from PDF pages 14, 19, 21)'), TC('12') ] }),
new TableRow({ children: [ TC('E'), TC('Long Answer Questions (from PDF pages 14-15, 21)'), TC('8') ] }),
new TableRow({ children: [ TC('F'), TC('Vocabulary – Glossary (from PDF pages 16, 19)'), TC('2') ] }),
new TableRow({ children: [ TC('',true), TC('TOTAL',true), TC('40',true) ] }),
]
}),
blank(),
]
}]
});
Packer.toBuffer(doc).then(buf => {
fs.writeFileSync('/home/daytona/workspace/question-paper/Question_Paper_40_Marks_v2.docx', buf);
console.log('SUCCESS');
}).catch(e => console.error('ERROR:', e));
cd /home/daytona/workspace/question-paper && node build_paper_v2.js 2>&1
# Quick sanity check on content cd /tmp && unzip -p /home/daytona/workspace/ques…
ls -lh /home/daytona/workspace/question-paper/Question_Paper_40_Marks_v2.docx
Question Paper 40 Marks v2
Word Document · DOCX
| Section | Type | Source (PDF Page) | Marks |
|---|---|---|---|
| A | MCQs – passage & FoS options | Pages 17, 21, 22 | 6 |
| B | Reference to Context | Pages 16, 18 | 6 |
| C | Passage-based Qs (2 passages) | Pages 17, 18 | 6 |
| D | Short Answer (~30 words) | Pages 14, 19, 21 | 12 |
| E | Long Answer (OR choice) | Pages 14-15, 21 | 8 |
| F | Vocabulary from Glossary | Pages 16, 19 | 2 |
| TOTAL | 40 |
Rebuild the paper using ONLY questions & content from the PDFKeep layout of paper this type
cd /tmp && unzip -p /home/daytona/workspace/attachments/ef88c779-c517-45ed-bdd0-…
~/question-paper/build_paper_v3.js
const {
Document, Packer, Paragraph, TextRun, Table, TableRow, TableCell,
AlignmentType, BorderStyle, WidthType, UnderlineType, ShadingType,
VerticalAlign
} = require('docx');
const fs = require('fs');
// ── helpers ───────────────────────────────────────────────────────────────────
const R = (text, opts = {}) => new TextRun({
text,
size: opts.size || 22,
bold: opts.bold || false,
italics: opts.it || false,
underline: opts.ul ? { type: UnderlineType.SINGLE } : undefined,
color: opts.color || undefined,
});
const P = (runs, opts = {}) => new Paragraph({
alignment: opts.align || AlignmentType.LEFT,
indent: opts.indent ? { left: opts.indent } : undefined,
spacing: { before: opts.before ?? 80, after: opts.after ?? 60 },
children: Array.isArray(runs) ? runs : [runs],
border: opts.border || undefined,
});
const blank = (sp = 40) => P([R('')], { before: sp, after: sp });
// Horizontal rule
const HR = () => new Paragraph({
border: { bottom: { style: BorderStyle.SINGLE, size: 8, color: '444444' } },
children: [],
spacing: { before: 140, after: 120 },
});
// Centered bold section title with underline + shading box feel via caps
const SECTITLE = (text) => P(
[R(text, { bold: true, size: 24, ul: true })],
{ align: AlignmentType.CENTER, before: 200, after: 100 }
);
// Sub-heading (left, bold)
const SUBH = (text) => P(
[R(text, { bold: true, size: 22 })],
{ before: 160, after: 80 }
);
// Question line: Q.N. text [X Mark(s)]
const Q = (num, text, marks) => new Paragraph({
spacing: { before: 120, after: 60 },
children: [
R(`Q.${num}. `, { bold: true }),
R(text),
R(` [${marks} Mark${marks > 1 ? 's' : ''}]`, { bold: true }),
],
});
// Option line (A) text
const OPT = (letter, text) => P(
[R(`(${letter}) ${text}`)],
{ indent: 720, before: 30, after: 30 }
);
// Answer blank lines (n = how many)
const ANS = (n) => Array(n).fill(null).map(() =>
P([R('________________________________________________________________________________')],
{ indent: 360, before: 28, after: 28 })
);
// Simple table cell helper
const TC = (text, opts = {}) => new TableCell({
width: opts.w ? { size: opts.w, type: WidthType.PERCENTAGE } : undefined,
verticalAlign: VerticalAlign.CENTER,
shading: opts.shade ? { type: ShadingType.CLEAR, fill: 'E8E8E8' } : undefined,
children: [P([R(text, { bold: opts.bold || false, size: 22 })])],
});
// ── DOCUMENT ─────────────────────────────────────────────────────────────────
const doc = new Document({
sections: [{
children: [
// ══════════════════════════════════════════════════════════════════
// TITLE BLOCK
// ══════════════════════════════════════════════════════════════════
P([R('ENGLISH (First Language) – STANDARD 9', { bold: true, size: 28, ul: true })],
{ align: AlignmentType.CENTER, before: 0, after: 60 }),
P([R('Unit Test – Chapter 1 & Poem 1', { bold: true, size: 26 })],
{ align: AlignmentType.CENTER, before: 0, after: 60 }),
P([R('"The Fun They Had" | "The Road Not Taken"', { it: true, size: 22 })],
{ align: AlignmentType.CENTER, before: 0, after: 80 }),
// Name / Date / Marks row
new Table({
width: { size: 100, type: WidthType.PERCENTAGE },
borders: {
top:{style:BorderStyle.NONE}, bottom:{style:BorderStyle.NONE},
left:{style:BorderStyle.NONE}, right:{style:BorderStyle.NONE},
insideH:{style:BorderStyle.NONE}, insideV:{style:BorderStyle.NONE},
},
rows: [new TableRow({ children: [
new TableCell({
borders:{top:{style:BorderStyle.NONE},bottom:{style:BorderStyle.NONE},left:{style:BorderStyle.NONE},right:{style:BorderStyle.NONE}},
children:[P([R('Name: _____________________________________')])]
}),
new TableCell({
borders:{top:{style:BorderStyle.NONE},bottom:{style:BorderStyle.NONE},left:{style:BorderStyle.NONE},right:{style:BorderStyle.NONE}},
children:[P([R('Date: _____________________')])]
}),
new TableCell({
borders:{top:{style:BorderStyle.NONE},bottom:{style:BorderStyle.NONE},left:{style:BorderStyle.NONE},right:{style:BorderStyle.NONE}},
children:[P([R('Total Marks: 40', { bold: true })])]
}),
]})]
}),
blank(),
P([R('All questions are compulsory. Attempt all sections.', { bold: true, it: true })],
{ align: AlignmentType.CENTER, before: 60, after: 180 }),
// ══════════════════════════════════════════════════════════════════
// SECTION A – MULTIPLE CHOICE QUESTIONS [5 Marks]
// ALL options taken verbatim from PDF pages 17, 21, 22
// ══════════════════════════════════════════════════════════════════
SECTITLE('SECTION A – MULTIPLE CHOICE QUESTIONS'),
P([R('(Choose the correct option. Each question carries 1 mark.)', { it: true })],
{ align: AlignmentType.CENTER }),
blank(),
SUBH('Part 1 – Chapter: "The Fun They Had" (Q. 1 to 3) [3 Marks]'),
// PDF page 22 – passage A, Q1
Q(1, 'The pages of the book were _______.', 1),
OPT('A', 'funny'),
OPT('B', 'crinkly'),
OPT('C', 'old'),
OPT('D', 'torn'),
blank(),
// PDF page 22 – passage A, Q2
Q(2, 'The pages of the book _______ on a screen.', 1),
OPT('A', 'stood still'),
OPT('B', 'moved away'),
OPT('C', 'looked very old'),
OPT('D', 'were illegible'),
blank(),
// PDF page 17 – MCQ printed in book
Q(3, 'The inspector repaired the mechanical teacher by _______.', 1),
OPT('A', 'slowing it up to an average ten-year level.'),
OPT('B', 'making the running of it quite slow.'),
OPT('C', 'gearing it to a higher level.'),
OPT('D', 'removing the geography sector from it.'),
blank(),
SUBH('Part 2 – Poem: "The Road Not Taken" (Q. 4 to 5) [2 Marks]'),
// PDF page 21 – FoS MCQ 1 (Ans key in PDF: 1.D)
Q(4, '"Two roads diverged in a yellow wood." – The Figure of Speech used is _______.', 1),
OPT('A', 'Metaphor'),
OPT('B', 'Consonance'),
OPT('C', 'Assonance'),
OPT('D', 'Both Metaphor and Assonance'),
blank(),
// PDF page 21 – FoS MCQ 3 (Ans key in PDF: 3.D)
Q(5, '"Somewhere ages and ages hence." – The Figure of Speech used is _______.', 1),
OPT('A', 'Assonance'),
OPT('B', 'Repetition'),
OPT('C', 'Simile'),
OPT('D', 'Both Assonance and Repetition'),
blank(),
HR(),
// ══════════════════════════════════════════════════════════════════
// SECTION B – REFERENCE TO CONTEXT [6 Marks]
// Verbatim from PDF pages 16 (Q.2) and 18 (stanza CBQs)
// ══════════════════════════════════════════════════════════════════
SECTITLE('SECTION B – REFERENCE TO CONTEXT'),
blank(),
SUBH('(A) From Chapter 1: "The Fun They Had" [3 Marks]'),
// PDF page 16, Q.2(1)
P([R('"I wouldn\'t throw it away."', { it: true })], { indent: 360 }),
blank(),
Q(6, 'Who says these words, and to whom?', 1),
...ANS(1),
blank(),
Q(7, 'What does \'it\' refer to?', 1),
...ANS(1),
blank(),
Q(8, 'What is \'it\' being compared with by the speaker?', 1),
...ANS(1),
blank(),
SUBH('(B) From Poem 1: "The Road Not Taken" [3 Marks]'),
// PDF page 18, stanza 2 CBQ
P([
R('"Then took the other, just as fair,\nAnd having perhaps the better claim,\nBecause it was grassy and wanted wear;\nThough as for that the passing there\nHad worn them really about the same."', { it: true })
], { indent: 360 }),
blank(),
Q(9, 'How was the second road different from the first?', 1),
...ANS(1),
blank(),
Q(10, 'Explain "the better claim" in this stanza.', 1),
...ANS(1),
blank(),
Q(11, 'What is the rhyme-scheme in this stanza?', 1),
...ANS(1),
blank(),
HR(),
// ══════════════════════════════════════════════════════════════════
// SECTION C – SHORT ANSWER QUESTIONS [12 Marks]
// Verbatim Qs from PDF pages 14, 18, 21
// ══════════════════════════════════════════════════════════════════
SECTITLE('SECTION C – SHORT ANSWER QUESTIONS (about 30 words each)'),
blank(),
SUBH('(A) Chapter 1: "The Fun They Had" [6 Marks]'),
// PDF page 14, Q.(1)
Q(12, 'What kind of teachers did Margie and Tommy have?', 2),
...ANS(3),
blank(),
// PDF page 14, Q.(2)
Q(13, 'Why did Margie\'s mother send for the County Inspector?', 2),
...ANS(3),
blank(),
// PDF page 14, Q.(6)
Q(14, 'Did Margie have regular days and hours for school? If so, why?', 2),
...ANS(3),
blank(),
SUBH('(B) Poem 1: "The Road Not Taken" [6 Marks]'),
// PDF page 19, Q.1(1)
Q(15, 'Where does the traveller find himself? What problem does he face?', 2),
...ANS(3),
blank(),
// PDF page 18, stanza 3 Q.(1) – what made choice difficult
Q(16, 'What made the choice of a road difficult for the poet?', 2),
...ANS(3),
blank(),
// PDF page 18, stanza 4 Q.(1)
Q(17, 'What does the poet mean by the words "telling this with a sigh"?', 2),
...ANS(3),
blank(),
HR(),
// ══════════════════════════════════════════════════════════════════
// SECTION D – LANGUAGE STUDY [6 Marks]
// Fill blanks: words from PDF text; FoS lines verbatim from PDF p.21
// ══════════════════════════════════════════════════════════════════
SECTITLE('SECTION D – LANGUAGE STUDY'),
blank(),
SUBH('(A) Fill in the Blanks with the correct word from the brackets: [3 Marks]'),
blank(),
// Words from story / poem text itself (PDF)
P([R('1. Margie\'s school was right next to her _______________. (bedroom / schoolyard / kitchen)')],
{ indent: 360, before: 60, after: 60 }),
P([R('2. The County Inspector slowed the geography sector to an average _______________ level. (ten-year / five-year / fifteen-year)')],
{ indent: 360, before: 60, after: 60 }),
P([R('3. The poet took the road that was _______________ and wanted wear. (rocky / grassy / muddy)')],
{ indent: 360, before: 60, after: 60 }),
blank(),
SUBH('(B) Identify the Figure of Speech and explain it: [3 Marks]'),
blank(),
// All three lines verbatim from PDF page 21 FoS MCQs
P([R('1. "Two roads diverged in a yellow wood."')], { indent: 360 }),
P([R(' Figure of Speech: ____________________ Explanation: ________________________________')],
{ indent: 360, before: 20, after: 60 }),
P([R('2. "Yet knowing how way leads on to way."')], { indent: 360 }),
P([R(' Figure of Speech: ____________________ Explanation: ________________________________')],
{ indent: 360, before: 20, after: 60 }),
P([R('3. "Somewhere ages and ages hence."')], { indent: 360 }),
P([R(' Figure of Speech: ____________________ Explanation: ________________________________')],
{ indent: 360, before: 20, after: 60 }),
blank(),
HR(),
// ══════════════════════════════════════════════════════════════════
// SECTION E – VOCABULARY [5 Marks]
// Words & phrases verbatim from PDF pages 16 & 19 Glossary sections
// ══════════════════════════════════════════════════════════════════
SECTITLE('SECTION E – VOCABULARY'),
blank(),
SUBH('(A) Match the words in Column A with their meanings in Column B: [4 Marks]'),
blank(),
new Table({
width: { size: 85, type: WidthType.PERCENTAGE },
rows: [
new TableRow({ children: [
TC('', { w: 5 }),
TC('Column A', { w: 25, bold: true, shade: true }),
TC('', { w: 5 }),
TC('Column B', { w: 65, bold: true, shade: true }),
]}),
// Words from PDF page 16 & 19 glossary
new TableRow({ children: [ TC('1.'), TC('crinkly'), TC('(a)'), TC('adjusted to a level or standard') ]}),
new TableRow({ children: [ TC('2.'), TC('diverged'), TC('(b)'), TC('wrinkled, having many folds') ]}),
new TableRow({ children: [ TC('3.'), TC('geared'), TC('(c)'), TC('separated and took a different direction') ]}),
new TableRow({ children: [ TC('4.'), TC('trodden'), TC('(d)'), TC('walked upon; trampled on') ]}),
]
}),
blank(),
P([R('Answers: 1 – ___ 2 – ___ 3 – ___ 4 – ___')], { indent: 360 }),
blank(),
SUBH('(B) Give the meaning of the following phrases as used in the textbook: [1 Mark]'),
blank(),
// PDF page 16 – Phrases and Idioms section
P([R('1. "blank out" – _________________________________________________________________________')],
{ indent: 360, before: 60, after: 60 }),
blank(),
HR(),
// ══════════════════════════════════════════════════════════════════
// SECTION F – LONG ANSWER QUESTIONS [6 Marks]
// Verbatim from PDF pages 14-15 Q.4 and pages 20-21 Q.3
// ══════════════════════════════════════════════════════════════════
SECTITLE('SECTION F – LONG ANSWER QUESTIONS (100–150 words each)'),
P([R('(Attempt any ONE from each part.) [3 Marks each × 2 = 6 Marks]', { it: true })],
{ align: AlignmentType.CENTER }),
blank(),
SUBH('Part 1 – Chapter: "The Fun They Had"'),
// PDF page 14, Q.4(1)
Q('18', '(A) What are the main features of the mechanical teachers and the schoolrooms that Margie and Tommy have in the story "The Fun They Had"?', 3),
P([R('OR', { bold: true })], { align: AlignmentType.CENTER, before: 40, after: 40 }),
// PDF page 15, Q.4(3)
Q('18', '(B) Do you agree with Margie that schools today are more fun than the school in the story? Give reasons for your answer.', 3),
blank(),
...ANS(9),
blank(),
SUBH('Part 2 – Poem: "The Road Not Taken"'),
// PDF page 21, Q.3(1)
Q('19', '(A) Discuss the significance of the title "The Road Not Taken".', 3),
P([R('OR', { bold: true })], { align: AlignmentType.CENTER, before: 40, after: 40 }),
// PDF page 21, Q.3(2)
Q('19', '(B) Describe the two roads that the poet finds. Which road does he choose and why?', 3),
blank(),
...ANS(9),
blank(),
HR(),
// ══════════════════════════════════════════════════════════════════
// END
// ══════════════════════════════════════════════════════════════════
P([R('* * * END OF QUESTION PAPER * * *', { bold: true })],
{ align: AlignmentType.CENTER, before: 160, after: 80 }),
blank(),
SUBH('Marks Distribution:'),
new Table({
width: { size: 85, type: WidthType.PERCENTAGE },
rows: [
new TableRow({ children: [ TC('Section',{bold:true,shade:true}), TC('Type',{bold:true,shade:true}), TC('Marks',{bold:true,shade:true}) ] }),
new TableRow({ children: [ TC('A'), TC('Multiple Choice Questions (PDF pp. 17, 21, 22)'), TC('5') ] }),
new TableRow({ children: [ TC('B'), TC('Reference to Context (PDF pp. 16, 18)'), TC('6') ] }),
new TableRow({ children: [ TC('C'), TC('Short Answer Questions (PDF pp. 14, 18, 19, 21)'), TC('12') ] }),
new TableRow({ children: [ TC('D'), TC('Language Study – Fill Blanks + Figures of Speech'), TC('6') ] }),
new TableRow({ children: [ TC('E'), TC('Vocabulary – Glossary (PDF pp. 16, 19)'), TC('5') ] }),
new TableRow({ children: [ TC('F'), TC('Long Answer Questions (PDF pp. 14–15, 21)'), TC('6') ] }),
new TableRow({ children: [ TC('',{bold:true}), TC('TOTAL',{bold:true}), TC('40',{bold:true}) ] }),
]
}),
blank(),
]
}]
});
Packer.toBuffer(doc).then(buf => {
fs.writeFileSync('/home/daytona/workspace/question-paper/Question_Paper_Final.docx', buf);
console.log('SUCCESS');
}).catch(e => console.error('ERROR:', e));
cd /home/daytona/workspace/question-paper && node build_paper_v3.js 2>&1
ls -lh /home/daytona/workspace/question-paper/Question_Paper_Final.docx && cd /t…
Question Paper Final
Word Document · DOCX
| Section | Type | PDF Source | Marks |
|---|---|---|---|
| A | MCQs (passage + FoS) | PDF pp. 17, 21, 22 (printed with all 4 options) | 5 |
| B | Reference to Context | PDF pp. 16 (Q.2) & 18 (Stanza 2 CBQ) | 6 |
| C | Short Answer (~30 words) | PDF pp. 14, 18, 19, 21 | 12 |
| D | Fill Blanks + Figures of Speech | PDF text & p. 21 FoS lines | 6 |
| E | Match Column + Phrase meaning | PDF pp. 16 & 19 Glossary | 5 |
| F | Long Answer (OR choice) | PDF pp. 14-15 (Q.4) & pp. 21 (Q.3) | 6 |
| TOTAL | 40 |