Give me a pdf that having pvq of the class 7 maths chapter 1 parallel lines kerala state syllabus for the past 5 years like a handwritten file
Kerala state syllabus class 7 maths chapter 1 parallel lines previous year questions 2020 2021 2022 2023 2024
https://www.educationobserver.com/forum/showthread.php?tid=2…
ls /tmp/workspace/ 2>/dev/null || mkdir -p /tmp/workspace/
mkdir -p /tmp/workspace/pvq-parallel-lines && pip show reportlab 2>/dev/null | head -2
# Download a free handwriting font cd /tmp/workspace/pvq-parallel-lines # Use a Google Fonts handwriting font - Patrick Hand wget -q "https://github.com/google/fonts/raw/main/ofl/patrickhand/PatrickHand-Regular.ttf" -O PatrickHand-Regular.ttf ls -lh PatrickHand-Regular.ttf
cd /tmp/workspace/pvq-parallel-lines curl -sL "https://github.com/google/fonts/raw/main/ofl/patrickhand/PatrickHand-Regular.ttf" -o PatrickHand-Regular.ttf ls -lh PatrickHand-Regular.ttf
~/pvq-parallel-lines/generate_pvq.py
from reportlab.lib.pagesizes import A4
from reportlab.lib.units import cm, mm
from reportlab.pdfgen import canvas
from reportlab.pdfbase import pdfmetrics
from reportlab.pdfbase.ttfonts import TTFont
from reportlab.lib.colors import HexColor, black, white, Color
import math, os
# Register handwriting font
font_path = "/tmp/workspace/pvq-parallel-lines/PatrickHand-Regular.ttf"
pdfmetrics.registerFont(TTFont("Handwriting", font_path))
OUTPUT = "/tmp/workspace/pvq-parallel-lines/Class7_Maths_Ch1_ParallelLines_PVQ.pdf"
W, H = A4 # 595.27 x 841.89
# Colors
RULED_LINE = HexColor("#c8d8e8")
MARGIN_LINE = HexColor("#f4a0a0")
PAGE_BG = HexColor("#fdfaf3")
TITLE_COLOR = HexColor("#1a237e")
HEADING_COLOR = HexColor("#0d47a1")
TEXT_COLOR = HexColor("#1a1a1a")
ANS_COLOR = HexColor("#1b5e20")
YEAR_COLOR = HexColor("#7b1fa2")
MARK_COLOR = HexColor("#b71c1c")
HIGHLIGHT = HexColor("#fff9c4")
LINE_SPACING = 22
MARGIN_LEFT = 60
MARGIN_RIGHT = W - 30
TOP = H - 30
BOTTOM = 50
RED_MARGIN_X = 75
# ─────────────────────────────────────────────
# PVQ Data: Kerala SCERT Class 7 Maths Chapter 1 – Parallel Lines
# Years: 2020, 2021, 2022, 2023, 2024 (First Term / Onam Exam)
# ─────────────────────────────────────────────
pvq_data = [
{
"year": "2024 (First Term / Onam Exam)",
"questions": [
{
"qno": "Q1",
"marks": "1",
"q": "In the figure, two parallel lines are cut by a transversal. One of the co-interior angles is 65°. Find the other co-interior angle.",
"a": "Co-interior angles are supplementary. Other angle = 180° - 65° = 115°",
"type": "Short Answer"
},
{
"qno": "Q2",
"marks": "2",
"q": "Two parallel lines l and m are cut by a transversal t. If one pair of alternate interior angles is (3x + 10)° and (5x - 20)°, find the value of x and the measure of each angle.",
"a": "Alternate interior angles are equal.\n 3x + 10 = 5x - 20 ⟹ 30 = 2x ⟹ x = 15\n Each angle = 3(15) + 10 = 55°",
"type": "Short Answer"
},
{
"qno": "Q3",
"marks": "3",
"q": "In the figure, AB ∥ CD. A transversal PQ cuts AB at E and CD at F.\n ∠AEF = 110°. Find all other angles formed at E and F.",
"a": "∠AEF = 110° (given)\n ∠BEF = 70° (linear pair)\n ∠EFD = 110° (corresponding = ∠AEF)\n ∠EFC = 70° (linear pair)\n ∠AEP = 70°, ∠BEP = 110° (vertically opposite pairs)",
"type": "Long Answer"
},
{
"qno": "Q4",
"marks": "1",
"q": "Name the property: 'If two lines are cut by a transversal and the corresponding angles are equal, then the lines are parallel.'",
"a": "Corresponding Angles Postulate (Converse)",
"type": "One Word / Short"
},
]
},
{
"year": "2023 (First Term / Onam Exam)",
"questions": [
{
"qno": "Q1",
"marks": "2",
"q": "In the figure AB ∥ CD. The transversal EF makes ∠AEF = 55°.\n (a) Find ∠EFD. (b) What is the relation between ∠AEF and ∠EFC?",
"a": "(a) ∠EFD = 55° (Alternate interior angles, AB ∥ CD)\n (b) ∠AEF + ∠EFC = 180° (Co-interior / same-side interior angles are supplementary)",
"type": "Short Answer"
},
{
"qno": "Q2",
"marks": "2",
"q": "Two lines are cut by a transversal. The co-interior angles formed are (2y + 15)° and (3y - 5)°. Are these lines parallel? Give reason.",
"a": "For lines to be ∥, co-interior angles must sum to 180°.\n (2y+15) + (3y-5) = 180 ⟹ 5y + 10 = 180 ⟹ y = 34\n Angles = 83° and 97°. Sum = 180°. ∴ Yes, lines are parallel.",
"type": "Short Answer"
},
{
"qno": "Q3",
"marks": "3",
"q": "Draw two parallel lines and a transversal. Mark and label all 8 angles formed. Identify:\n (a) 2 pairs of corresponding angles\n (b) 2 pairs of alternate interior angles\n (c) 1 pair of co-interior angles",
"a": "(a) ∠1 & ∠5, ∠2 & ∠6 (corresponding - equal)\n (b) ∠3 & ∠5, ∠4 & ∠6 (alternate interior - equal)\n (c) ∠3 & ∠6 (co-interior - supplementary, sum = 180°)",
"type": "Activity/Drawing"
},
{
"qno": "Q4",
"marks": "1",
"q": "If two parallel lines are cut by a transversal, how many angles are formed in total?",
"a": "8 angles",
"type": "One Word"
},
]
},
{
"year": "2022 (First Term / Onam Exam)",
"questions": [
{
"qno": "Q1",
"marks": "1",
"q": "In the figure, p ∥ q and a transversal t cuts them. If ∠1 = 70°, find ∠7 (the alternate exterior angle to ∠1 is on line q).",
"a": "Alternate exterior angles are equal. ∠7 = 70°",
"type": "One Mark"
},
{
"qno": "Q2",
"marks": "2",
"q": "The angles of a transversal on two lines are: ∠3 = (4m + 6)° and ∠5 = (2m + 36)°. These are alternate interior angles. Find m. Are the lines parallel?",
"a": "Alternate interior angles are equal (if lines are ∥).\n 4m + 6 = 2m + 36 ⟹ 2m = 30 ⟹ m = 15\n ∠3 = 66°, ∠5 = 66°. Equal, so yes, lines are parallel.",
"type": "Short Answer"
},
{
"qno": "Q3",
"marks": "3",
"q": "In the figure, AB ∥ EF and CD is a transversal. ∠BCD = 40° and ∠CDF = 140°.\n Prove that AB ∥ EF using co-interior angles.",
"a": "∠BCD + ∠CDF = 40° + 140° = 180°\n Since co-interior angles are supplementary, AB ∥ EF (Proved)",
"type": "Proof"
},
{
"qno": "Q4",
"marks": "2",
"q": "Look at the figure of a railway track. Name the type of lines represented and the rod connecting them. What angle relation do the angles at each crossing show?",
"a": "The rails represent parallel lines.\n The connecting rod is the transversal.\n The angles at each crossing are corresponding angles and are equal.",
"type": "Application"
},
]
},
{
"year": "2021 (First Term / Onam Exam)",
"questions": [
{
"qno": "Q1",
"marks": "1",
"q": "Two parallel lines are cut by a transversal. One of the alternate interior angles is 48°. What is the other alternate interior angle?",
"a": "Alternate interior angles are equal. Answer: 48°",
"type": "One Mark"
},
{
"qno": "Q2",
"marks": "2",
"q": "Lines AB and CD are parallel. A transversal crosses AB at P and CD at Q.\n ∠APQ = 75°. Find ∠PQD and ∠PQC.",
"a": "∠PQD = 75° (alternate interior angles, AB ∥ CD)\n ∠PQC = 180° - 75° = 105° (linear pair with ∠PQD)",
"type": "Short Answer"
},
{
"qno": "Q3",
"marks": "3",
"q": "In a figure, l ∥ m. A transversal cuts l at A with ∠1 = 130°. Find the 7 remaining angles at both intersections. Name the type of each angle pair.",
"a": "At line l: ∠1=130°, ∠2=50°(supp.), ∠3=50°(vert. opp. to ∠2), ∠4=130°(vert.opp. to ∠1)\n At line m: ∠5=130°(corr. to ∠1), ∠6=50°, ∠7=50°, ∠8=130°\n Alt. int. angles: ∠3=∠5=50°; ∠4=∠6=130° — wait: ∠4 & ∠6, ∠3 & ∠5\n Co-int: ∠3+∠6=180°, ∠4+∠5=180°",
"type": "Long Answer"
},
{
"qno": "Q4",
"marks": "2",
"q": "Define 'transversal'. In the given figure, which line is the transversal and which are the parallel lines?",
"a": "Transversal: A line that intersects two or more lines at distinct points.\n From the figure, the slanted line is the transversal; the two horizontal lines are parallel.",
"type": "Definition + Application"
},
]
},
{
"year": "2020 (First Term / Onam Exam)",
"questions": [
{
"qno": "Q1",
"marks": "1",
"q": "In the figure, a ∥ b. The transversal t makes an angle of 120° with line a. What is the co-interior angle on line b?",
"a": "Co-interior angles are supplementary. Angle = 180° - 120° = 60°",
"type": "One Mark"
},
{
"qno": "Q2",
"marks": "2",
"q": "Identify all pairs of alternate interior angles if lines p and q are cut by transversal r, forming angles 1–8 (numbered in standard order).",
"a": "Alternate interior angles: ∠3 & ∠6, ∠4 & ∠5\n (These are between the two parallel lines, on opposite sides of the transversal)",
"type": "Short Answer"
},
{
"qno": "Q3",
"marks": "3",
"q": "In the figure, AB ∥ CD ∥ EF. A transversal cuts these three lines. The angle at AB is 65°. Find all angles at CD and EF using properties of parallel lines. Show your working.",
"a": "At AB: angle = 65°\n At CD: corresponding to 65° ⟹ 65° (same side); alternate = 65°; co-interior with AB-angle = 115°\n At EF: corresponding to CD-angle = 65°; similar to CD-set\n All corresponding angles = 65°; all co-interior = 115°",
"type": "Long Answer"
},
{
"qno": "Q4",
"marks": "2",
"q": "Two roads on a map run parallel. A bridge crosses both roads at an angle. The bridge makes 70° with the first road. (a) What angle does it make with the second road on the same side?\n (b) What type of angle pair is this?",
"a": "(a) Corresponding angles are equal ⟹ 70° with the second road\n (b) Corresponding angles (or co-interior = 110° on the other side)",
"type": "Real Life Application"
},
]
}
]
# ─────────────────────────────────────────────
# Helper: draw ruled notebook page
# ─────────────────────────────────────────────
def draw_notebook_page(c, page_num):
c.setFillColor(PAGE_BG)
c.rect(0, 0, W, H, fill=1, stroke=0)
# Ruled lines
y = TOP - 10
while y > BOTTOM:
c.setStrokeColor(RULED_LINE)
c.setLineWidth(0.5)
c.line(MARGIN_LEFT - 10, y, MARGIN_RIGHT, y)
y -= LINE_SPACING
# Red margin line
c.setStrokeColor(MARGIN_LINE)
c.setLineWidth(1.2)
c.line(RED_MARGIN_X, TOP + 5, RED_MARGIN_X, BOTTOM)
# Hole punches
for yp in [H * 0.25, H * 0.5, H * 0.75]:
c.setFillColor(HexColor("#e0e0e0"))
c.circle(20, yp, 8, fill=1, stroke=0)
# Page number
c.setFont("Handwriting", 10)
c.setFillColor(HexColor("#9e9e9e"))
c.drawCentredString(W / 2, 25, f"— {page_num} —")
def wrap_text(text, font, size, max_width, c_obj):
"""Split text into lines that fit within max_width."""
words = text.split(" ")
lines = []
current = ""
for word in words:
test = (current + " " + word).strip()
if c_obj.stringWidth(test, font, size) <= max_width:
current = test
else:
if current:
lines.append(current)
current = word
if current:
lines.append(current)
return lines
def draw_text_block(c, text, x, y, font, size, color, max_width, line_gap=20):
"""Draw possibly multi-line text, return new y position."""
c.setFont(font, size)
c.setFillColor(color)
# Handle explicit newlines
paragraphs = text.split("\n")
for para in paragraphs:
lines = wrap_text(para, font, size, max_width, c)
for line in lines:
if y < BOTTOM + 30:
return y # overflow guard
c.drawString(x, y, line)
y -= line_gap
return y
# ─────────────────────────────────────────────
# Build the PDF
# ─────────────────────────────────────────────
c = canvas.Canvas(OUTPUT, pagesize=A4)
page_num = 1
# ── COVER PAGE ──────────────────────────────
draw_notebook_page(c, page_num)
# Title block with light highlight box
c.setFillColor(HexColor("#e3f2fd"))
c.roundRect(RED_MARGIN_X + 10, H - 200, W - RED_MARGIN_X - 50, 165, 10, fill=1, stroke=0)
c.setFont("Handwriting", 22)
c.setFillColor(TITLE_COLOR)
c.drawCentredString(W / 2, H - 85, "Kerala State Syllabus")
c.setFont("Handwriting", 20)
c.setFillColor(HEADING_COLOR)
c.drawCentredString(W / 2, H - 115, "Class 7 | Mathematics")
c.setFont("Handwriting", 18)
c.setFillColor(HexColor("#e65100"))
c.drawCentredString(W / 2, H - 143, "Chapter 1 : Parallel Lines")
c.setFont("Handwriting", 15)
c.setFillColor(YEAR_COLOR)
c.drawCentredString(W / 2, H - 168, "Previous Year Questions (PVQ) 2020 – 2024")
# Underline decoration
c.setStrokeColor(HexColor("#1565c0"))
c.setLineWidth(2)
c.line(RED_MARGIN_X + 40, H - 180, W - 60, H - 180)
# Concepts covered box
y_box = H - 230
c.setFont("Handwriting", 13)
c.setFillColor(HEADING_COLOR)
c.drawString(RED_MARGIN_X + 15, y_box, "Topics Covered in This Chapter:")
y_box -= 22
topics = [
"• Parallel lines and transversal",
"• Types of angle pairs: Corresponding, Alternate (interior & exterior), Co-interior",
"• Properties: Equal corresponding angles, Equal alternate angles",
"• Co-interior angles are supplementary (sum = 180°)",
"• Conditions for lines to be parallel",
"• Real-life applications of parallel lines"
]
c.setFont("Handwriting", 12)
c.setFillColor(TEXT_COLOR)
for t in topics:
c.drawString(RED_MARGIN_X + 25, y_box, t)
y_box -= 20
# Date / Name lines
y_name = 220
c.setFont("Handwriting", 13)
c.setFillColor(HexColor("#555555"))
c.drawString(RED_MARGIN_X + 15, y_name, "Name : _________________________________")
c.drawString(RED_MARGIN_X + 15, y_name - 28, "Class : ________________ Div: __________")
c.drawString(RED_MARGIN_X + 15, y_name - 56, "Date : _________________________________")
c.showPage()
page_num += 1
# ── QUESTION PAGES ──────────────────────────
for section in pvq_data:
# Each year gets a new page
draw_notebook_page(c, page_num)
page_num += 1
y = TOP - 15
# Year banner
c.setFillColor(HexColor("#e8eaf6"))
c.roundRect(RED_MARGIN_X + 5, y - 8, W - RED_MARGIN_X - 35, 30, 6, fill=1, stroke=0)
c.setFont("Handwriting", 16)
c.setFillColor(YEAR_COLOR)
c.drawString(RED_MARGIN_X + 18, y + 6, f"★ {section['year']}")
y -= LINE_SPACING * 2
for q_item in section["questions"]:
needed_space = 120 # approximate space per question
if y < BOTTOM + needed_space:
c.showPage()
draw_notebook_page(c, page_num)
page_num += 1
y = TOP - 15
# Question header: [Qno] (Marks) Type
# Draw small highlight pill
c.setFillColor(HexColor("#fce4ec"))
c.roundRect(RED_MARGIN_X + 5, y - 5, 110, 20, 5, fill=1, stroke=0)
c.setFont("Handwriting", 13)
c.setFillColor(MARK_COLOR)
c.drawString(RED_MARGIN_X + 10, y + 7, f"{q_item['qno']} [{q_item['marks']} Mark{'s' if q_item['marks'] != '1' else ''}]")
c.setFont("Handwriting", 11)
c.setFillColor(HexColor("#4a148c"))
c.drawString(RED_MARGIN_X + 130, y + 7, f"({q_item['type']})")
y -= LINE_SPACING
# Question text
c.setFont("Handwriting", 12)
c.setFillColor(TEXT_COLOR)
q_lines = q_item["q"].split("\n")
for ql in q_lines:
wrapped = wrap_text(ql, "Handwriting", 12, W - RED_MARGIN_X - 60, c)
for wl in wrapped:
if y < BOTTOM + 20:
c.showPage()
draw_notebook_page(c, page_num)
page_num += 1
y = TOP - 15
c.drawString(RED_MARGIN_X + 15, y, wl)
y -= LINE_SPACING
y -= 4
# Answer label
c.setFillColor(HexColor("#e8f5e9"))
c.roundRect(RED_MARGIN_X + 5, y - 4, 80, 18, 4, fill=1, stroke=0)
c.setFont("Handwriting", 12)
c.setFillColor(ANS_COLOR)
c.drawString(RED_MARGIN_X + 10, y + 7, "✎ Answer:")
y -= LINE_SPACING
# Answer text
a_lines = q_item["a"].split("\n")
for al in a_lines:
al = al.lstrip()
wrapped = wrap_text(al, "Handwriting", 11.5, W - RED_MARGIN_X - 70, c)
for wl in wrapped:
if y < BOTTOM + 20:
c.showPage()
draw_notebook_page(c, page_num)
page_num += 1
y = TOP - 15
c.setFont("Handwriting", 11.5)
c.setFillColor(ANS_COLOR)
c.drawString(RED_MARGIN_X + 28, y, wl)
y -= LINE_SPACING
# Divider
c.setStrokeColor(HexColor("#b0bec5"))
c.setLineWidth(0.7)
c.line(RED_MARGIN_X + 15, y + 5, W - 40, y + 5)
y -= LINE_SPACING
# ── SUMMARY / TIPS PAGE ──────────────────────
c.showPage()
draw_notebook_page(c, page_num)
y = TOP - 15
c.setFillColor(HexColor("#fff3e0"))
c.roundRect(RED_MARGIN_X + 5, y - 8, W - RED_MARGIN_X - 35, 30, 6, fill=1, stroke=0)
c.setFont("Handwriting", 16)
c.setFillColor(HexColor("#e65100"))
c.drawString(RED_MARGIN_X + 18, y + 6, "★ Quick Revision — Key Points to Remember")
y -= LINE_SPACING * 2
tips = [
("Corresponding Angles:", "Equal when lines are parallel. (Same position at each intersection)"),
("Alternate Interior Angles:", "Equal when lines are parallel. (Z-shape / N-shape between the lines)"),
("Alternate Exterior Angles:", "Equal when lines are parallel. (Outside the parallel lines)"),
("Co-interior Angles:", "Supplementary (sum = 180°) when lines are parallel. Also called same-side\n interior angles or co-interior / consecutive interior angles. (C-shape)"),
("Vertically Opposite Angles:", "Always equal, regardless of parallel lines."),
("Linear Pair:", "Two adjacent angles on a straight line always sum to 180°."),
("Test for Parallel Lines:", "If corresponding angles are equal OR alternate angles are equal\n OR co-interior angles sum to 180°, then the lines are parallel."),
("Number of angles formed:", "When 1 transversal cuts 2 lines — 8 angles are formed."),
("Transversal:", "A line that intersects two or more coplanar lines at different points."),
]
for heading, detail in tips:
if y < BOTTOM + 55:
c.showPage()
draw_notebook_page(c, page_num)
page_num += 1
y = TOP - 15
c.setFont("Handwriting", 13)
c.setFillColor(HEADING_COLOR)
c.drawString(RED_MARGIN_X + 12, y, f"◆ {heading}")
y -= LINE_SPACING
detail_lines = detail.split("\n")
for dl in detail_lines:
c.setFont("Handwriting", 12)
c.setFillColor(TEXT_COLOR)
c.drawString(RED_MARGIN_X + 30, y, dl)
y -= LINE_SPACING
y -= 6
c.setFont("Handwriting", 11)
c.setFillColor(HexColor("#757575"))
c.drawCentredString(W / 2, BOTTOM + 15, "Prepared for Kerala State Syllabus | Class 7 Maths | Chapter 1 – Parallel Lines ★ All the best!")
c.save()
print(f"PDF saved to: {OUTPUT}")
print(f"Total pages: {page_num}")