How to give ans in viva english
| Situation | Phrase |
|---|---|
| You know the answer | "This refers to..." / "In simple terms..." |
| You need a moment | "That's a good point. Let me think..." / "If I understand correctly..." |
| You're not sure | "I believe it is... but I'm not entirely certain." |
| You don't know | "I don't recall the exact detail, but I know that..." |
Create a study guide PDF with common viva question formats
mkdir -p /tmp/workspace/viva-guide && ls /tmp/workspace/
~/viva-guide/create_pdf.py
from reportlab.lib.pagesizes import A4
from reportlab.lib import colors
from reportlab.lib.styles import getSampleStyleSheet, ParagraphStyle
from reportlab.lib.units import cm
from reportlab.platypus import (
SimpleDocTemplate, Paragraph, Spacer, Table, TableStyle,
HRFlowable, KeepTogether
)
from reportlab.lib.enums import TA_CENTER, TA_LEFT, TA_JUSTIFY
from reportlab.platypus import PageBreak
OUTPUT = "/tmp/workspace/viva-guide/Viva_Study_Guide.pdf"
# ── Colour palette ──────────────────────────────────────────────────────────
NAVY = colors.HexColor("#1A237E")
TEAL = colors.HexColor("#00897B")
AMBER = colors.HexColor("#F57F17")
LIGHT_BG = colors.HexColor("#E8EAF6")
TEAL_BG = colors.HexColor("#E0F2F1")
WHITE = colors.white
DARK = colors.HexColor("#212121")
GREY = colors.HexColor("#757575")
LIGHT_GREY = colors.HexColor("#F5F5F5")
# ── Styles ───────────────────────────────────────────────────────────────────
styles = getSampleStyleSheet()
def S(name, **kw):
return ParagraphStyle(name, **kw)
title_style = S("Title2",
fontName="Helvetica-Bold", fontSize=28, textColor=WHITE,
alignment=TA_CENTER, spaceAfter=6)
subtitle_style = S("Subtitle2",
fontName="Helvetica", fontSize=13, textColor=colors.HexColor("#C5CAE9"),
alignment=TA_CENTER, spaceAfter=4)
section_title = S("SectionTitle",
fontName="Helvetica-Bold", fontSize=15, textColor=NAVY,
spaceBefore=14, spaceAfter=6, borderPadding=(0,0,4,0))
subsection_title = S("SubTitle",
fontName="Helvetica-Bold", fontSize=12, textColor=TEAL,
spaceBefore=8, spaceAfter=4)
body = S("Body2",
fontName="Helvetica", fontSize=10, textColor=DARK,
leading=16, spaceAfter=4, alignment=TA_JUSTIFY)
bullet_style = S("Bullet2",
fontName="Helvetica", fontSize=10, textColor=DARK,
leading=15, leftIndent=14, spaceAfter=3,
bulletIndent=4, bulletFontName="Helvetica-Bold")
tip_style = S("Tip",
fontName="Helvetica-Oblique", fontSize=9.5, textColor=colors.HexColor("#4A148C"),
leading=14, spaceAfter=3, leftIndent=10)
bold_body = S("BoldBody",
fontName="Helvetica-Bold", fontSize=10, textColor=DARK,
leading=15, spaceAfter=2)
phrase_q = S("PhraseQ",
fontName="Helvetica-Bold", fontSize=9.5, textColor=NAVY,
leading=14, leftIndent=8)
phrase_a = S("PhraseA",
fontName="Helvetica-Oblique", fontSize=9.5, textColor=TEAL,
leading=14, leftIndent=8, spaceAfter=5)
small_grey = S("SmallGrey",
fontName="Helvetica", fontSize=8.5, textColor=GREY,
alignment=TA_CENTER)
# ── Helper builders ──────────────────────────────────────────────────────────
def colored_box(text, bg=LIGHT_BG, fg=NAVY, font="Helvetica-Bold", size=10):
data = [[Paragraph(text, ParagraphStyle("CB", fontName=font,
fontSize=size, textColor=fg, leading=14, alignment=TA_CENTER))]]
t = Table(data, colWidths=[16*cm])
t.setStyle(TableStyle([
("BACKGROUND", (0,0), (-1,-1), bg),
("TOPPADDING", (0,0), (-1,-1), 8),
("BOTTOMPADDING", (0,0), (-1,-1), 8),
("LEFTPADDING", (0,0), (-1,-1), 12),
("RIGHTPADDING", (0,0), (-1,-1), 12),
("ROUNDEDCORNERS", [6]),
]))
return t
def two_col_table(rows, col1=6.5*cm, col2=9.5*cm, header=None):
data = []
if header:
data.append([
Paragraph(header[0], ParagraphStyle("H", fontName="Helvetica-Bold",
fontSize=10, textColor=WHITE, leading=13)),
Paragraph(header[1], ParagraphStyle("H", fontName="Helvetica-Bold",
fontSize=10, textColor=WHITE, leading=13)),
])
for r in rows:
data.append([
Paragraph(r[0], ParagraphStyle("C1", fontName="Helvetica-Bold",
fontSize=9.5, textColor=NAVY, leading=13)),
Paragraph(r[1], ParagraphStyle("C2", fontName="Helvetica-Oblique",
fontSize=9.5, textColor=TEAL, leading=13)),
])
t = Table(data, colWidths=[col1, col2])
style = [
("GRID", (0,0), (-1,-1), 0.5, colors.HexColor("#CFD8DC")),
("TOPPADDING", (0,0), (-1,-1), 6),
("BOTTOMPADDING",(0,0),(-1,-1), 6),
("LEFTPADDING", (0,0), (-1,-1), 8),
("RIGHTPADDING",(0,0), (-1,-1), 8),
("ROWBACKGROUNDS",(0,0),(-1,-1),[LIGHT_GREY, WHITE]),
]
if header:
style += [
("BACKGROUND", (0,0), (-1,0), NAVY),
("ROWBACKGROUNDS",(0,1),(-1,-1), [LIGHT_GREY, WHITE]),
]
t.setStyle(TableStyle(style))
return t
def qa_box(question, answer, tip=None):
items = [
Paragraph(f"Q: {question}", phrase_q),
Paragraph(f"A: {answer}", phrase_a),
]
if tip:
items.append(Paragraph(f"Tip: {tip}", tip_style))
data = [[items]]
t = Table(data, colWidths=[16*cm])
t.setStyle(TableStyle([
("BACKGROUND", (0,0), (-1,-1), TEAL_BG),
("TOPPADDING", (0,0), (-1,-1), 8),
("BOTTOMPADDING", (0,0), (-1,-1), 8),
("LEFTPADDING", (0,0), (-1,-1), 12),
("RIGHTPADDING", (0,0), (-1,-1), 12),
("BOX", (0,0), (-1,-1), 1.5, TEAL),
]))
return t
def section_header(text, icon=""):
data = [[Paragraph(f"{icon} {text}" if icon else text,
ParagraphStyle("SH", fontName="Helvetica-Bold", fontSize=14,
textColor=WHITE, leading=18))]]
t = Table(data, colWidths=[16*cm])
t.setStyle(TableStyle([
("BACKGROUND", (0,0), (-1,-1), NAVY),
("TOPPADDING", (0,0), (-1,-1), 9),
("BOTTOMPADDING", (0,0), (-1,-1), 9),
("LEFTPADDING", (0,0), (-1,-1), 14),
("ROUNDEDCORNERS", [5]),
]))
return t
# ── Cover page ───────────────────────────────────────────────────────────────
def cover_page():
elements = []
# Top hero banner
data = [[
Paragraph("VIVA ENGLISH", title_style),
Paragraph("STUDY GUIDE", title_style),
]]
# single-cell cover banner
banner_data = [[Paragraph("VIVA ENGLISH STUDY GUIDE", title_style)]]
banner = Table(banner_data, colWidths=[16*cm])
banner.setStyle(TableStyle([
("BACKGROUND", (0,0), (-1,-1), NAVY),
("TOPPADDING", (0,0), (-1,-1), 28),
("BOTTOMPADDING", (0,0), (-1,-1), 12),
("ROUNDEDCORNERS", [8]),
]))
elements.append(Spacer(1, 1.5*cm))
elements.append(banner)
sub_data = [[Paragraph("How to Answer Confidently in Any Oral Exam", subtitle_style)]]
sub = Table(sub_data, colWidths=[16*cm])
sub.setStyle(TableStyle([
("BACKGROUND", (0,0), (-1,-1), colors.HexColor("#283593")),
("TOPPADDING", (0,0), (-1,-1), 10),
("BOTTOMPADDING", (0,0), (-1,-1), 10),
("ROUNDEDCORNERS", [8]),
]))
elements.append(sub)
elements.append(Spacer(1, 1.2*cm))
# Contents overview boxes
topics = [
("1", "Question Types", "Understand the 7 core formats"),
("2", "Answer Frameworks", "Structure every answer clearly"),
("3", "Key Phrases", "Ready-to-use English phrases"),
("4", "Sample Q&A", "Practice with real examples"),
("5", "Body Language Tips", "Perform confidently"),
("6", "Quick Reference", "1-page cheat sheet"),
]
toc_rows = [[
Paragraph(f"{n}. {t}", ParagraphStyle("TOC", fontName="Helvetica-Bold",
fontSize=10, textColor=NAVY, leading=14)),
Paragraph(d, ParagraphStyle("TOCD", fontName="Helvetica", fontSize=9.5,
textColor=GREY, leading=14)),
] for n, t, d in topics]
toc = Table(toc_rows, colWidths=[6*cm, 10*cm])
toc.setStyle(TableStyle([
("ROWBACKGROUNDS", (0,0), (-1,-1), [LIGHT_GREY, WHITE]),
("TOPPADDING", (0,0), (-1,-1), 6),
("BOTTOMPADDING", (0,0), (-1,-1), 6),
("LEFTPADDING", (0,0), (-1,-1), 10),
("BOX", (0,0), (-1,-1), 1, colors.HexColor("#90A4AE")),
("LINEBELOW", (0,0), (-1,-2), 0.4, colors.HexColor("#CFD8DC")),
]))
elements.append(toc)
elements.append(Spacer(1, 1*cm))
footer_data = [[Paragraph(
"Prepared for students who want to speak clearly, confidently, and correctly in oral examinations.",
small_grey)]]
footer_t = Table(footer_data, colWidths=[16*cm])
footer_t.setStyle(TableStyle([
("TOPPADDING", (0,0), (-1,-1), 6),
("BOTTOMPADDING", (0,0), (-1,-1), 6),
]))
elements.append(footer_t)
elements.append(PageBreak())
return elements
# ── Section 1 - Question Types ────────────────────────────────────────────────
def section1():
el = []
el.append(section_header("SECTION 1 - The 7 Common Viva Question Types"))
el.append(Spacer(1, 0.3*cm))
el.append(Paragraph(
"Examiners use predictable question patterns. Learn to recognise each type instantly so you can choose the right response strategy.",
body))
el.append(Spacer(1, 0.25*cm))
q_types = [
("Type", "Pattern", "Example", "Your Strategy"),
("1. Definition", '"What is...?"',
'"What is osmosis?"',
"State the term, define it, give one example."),
("2. Explain / Describe", '"Explain / Describe...?"',
'"Explain how the heart pumps blood."',
"Use a simple structure: What - How - Why."),
("3. Difference", '"What is the difference between X and Y?"',
'"Difference between arteries and veins?"',
"State X, then Y, then contrast directly."),
("4. Reason / Cause", '"Why does...?" / "What causes...?"',
'"Why do metals conduct electricity?"',
"Give the cause first, then mechanism."),
("5. Process / Steps", '"How does...?" / "What happens when...?"',
'"How does digestion work?"',
"Use numbered steps: First... Then... Finally..."),
("6. Opinion / Evaluate", '"What do you think about...?"',
'"Is this method effective?"',
"State your view + reason + acknowledge other side."),
("7. Application", '"How would you apply...?" / "Give an example..."',
'"Give an example of Newton\'s 3rd law."',
"Real-world example + link back to concept."),
]
data = []
for row in q_types:
if row[0] == "Type":
data.append([Paragraph(c, ParagraphStyle("H",fontName="Helvetica-Bold",
fontSize=9,textColor=WHITE,leading=12)) for c in row])
else:
data.append([
Paragraph(row[0], ParagraphStyle("T",fontName="Helvetica-Bold",
fontSize=9,textColor=NAVY,leading=12)),
Paragraph(row[1], ParagraphStyle("P",fontName="Helvetica-Oblique",
fontSize=8.5,textColor=DARK,leading=12)),
Paragraph(row[2], ParagraphStyle("E",fontName="Helvetica",
fontSize=8.5,textColor=GREY,leading=12)),
Paragraph(row[3], ParagraphStyle("S",fontName="Helvetica",
fontSize=8.5,textColor=DARK,leading=12)),
])
t = Table(data, colWidths=[3.2*cm, 3.8*cm, 4*cm, 5*cm])
t.setStyle(TableStyle([
("BACKGROUND", (0,0), (-1,0), NAVY),
("ROWBACKGROUNDS",(0,1),(-1,-1),[WHITE, LIGHT_GREY]),
("GRID", (0,0),(-1,-1), 0.4, colors.HexColor("#CFD8DC")),
("TOPPADDING", (0,0),(-1,-1), 5),
("BOTTOMPADDING", (0,0),(-1,-1), 5),
("LEFTPADDING", (0,0),(-1,-1), 6),
("VALIGN", (0,0),(-1,-1), "TOP"),
]))
el.append(t)
el.append(Spacer(1, 0.5*cm))
return el
# ── Section 2 - Answer Frameworks ────────────────────────────────────────────
def section2():
el = []
el.append(section_header("SECTION 2 - Answer Frameworks"))
el.append(Spacer(1, 0.3*cm))
# Framework A
el.append(Paragraph("Framework A - DARE (for most answers)", subsection_title))
dare = [
("D - Define", "State what the concept/term is."),
("A - Add Detail","Expand with mechanism, cause, or features."),
("R - Real Example","Give a concrete example."),
("E - End Clearly","Summarise in 1 sentence to close."),
]
el.append(two_col_table(dare, col1=5*cm, col2=11*cm))
el.append(Spacer(1, 0.3*cm))
el.append(colored_box(
"DARE Example - \"What is photosynthesis?\"",
bg=LIGHT_BG, fg=NAVY))
el.append(Spacer(1,0.15*cm))
el.append(Paragraph(
"<b>D:</b> Photosynthesis is the process by which green plants make food using sunlight. "
"<b>A:</b> Chlorophyll in the leaves absorbs light energy to convert CO2 and water into glucose and oxygen. "
"<b>R:</b> A mango tree uses this process to produce sugar stored in its fruit. "
"<b>E:</b> So photosynthesis is the foundation of energy flow in most ecosystems.",
body))
el.append(Spacer(1, 0.4*cm))
# Framework B
el.append(Paragraph("Framework B - PEEL (for opinion/evaluate questions)", subsection_title))
peel = [
("P - Point", "State your main argument or position."),
("E - Evidence", "Provide facts, data, or examples."),
("E - Explain", "Link evidence back to your point."),
("L - Link", "Connect to the broader topic or examiner's question."),
]
el.append(two_col_table(peel, col1=5*cm, col2=11*cm))
el.append(Spacer(1, 0.4*cm))
# Framework C
el.append(Paragraph("Framework C - Compare & Contrast (for difference questions)", subsection_title))
compare = [
("Step 1", "Describe X briefly."),
("Step 2", "Describe Y briefly."),
("Step 3", 'Use contrast language: "whereas", "on the other hand", "unlike X, Y..."'),
("Step 4", "State one key similarity if relevant."),
]
el.append(two_col_table(compare, col1=5*cm, col2=11*cm))
el.append(Spacer(1, 0.5*cm))
return el
# ── Section 3 - Key Phrases ───────────────────────────────────────────────────
def section3():
el = []
el.append(section_header("SECTION 3 - Essential English Phrases for Viva"))
el.append(Spacer(1, 0.3*cm))
categories = [
("Starting an Answer", [
"\"This refers to...\"",
"\"In simple terms, this means...\"",
"\"The concept of X can be defined as...\"",
"\"To answer this, I need to explain...\"",
]),
("Buying Time (Politely)", [
"\"That's an interesting question. Let me think for a moment.\"",
"\"If I understand the question correctly...\"",
"\"Could you give me a moment to organise my thoughts?\"",
"\"Let me approach this step by step.\"",
]),
("Explaining a Process", [
"\"First... Then... After that... Finally...\"",
"\"The process begins when...\"",
"\"As a result of X, Y occurs because...\"",
"\"This leads to... which in turn causes...\"",
]),
("Giving Examples", [
"\"For example...\" / \"For instance...\"",
"\"A good illustration of this is...\"",
"\"To put this in context...\"",
"\"In real life, we can see this when...\"",
]),
("Comparing / Contrasting", [
"\"X is similar to Y in that... however, they differ in...\"",
"\"Unlike X, Y tends to...\"",
"\"The key difference is that...\"",
"\"Both X and Y share... but X also...\"",
]),
("Admitting Uncertainty", [
"\"I'm not entirely certain, but I believe...\"",
"\"I don't recall the exact figure, but the concept is...\"",
"\"I may be wrong, but my understanding is...\"",
"\"I haven't studied that in depth, but I know that...\"",
]),
("Asking for Clarification", [
"\"Could you please clarify what you mean by...?\"",
"\"Are you asking about X or Y?\"",
"\"Do you mean in the context of...?\"",
"\"I want to make sure I understood - you're asking about...?\"",
]),
("Closing / Summarising", [
"\"In summary...\" / \"To conclude...\"",
"\"So, to answer your question directly...\"",
"\"That covers the main points. I hope that answers your question.\"",
"\"I would like to add that...\"",
]),
]
for cat, phrases in categories:
el.append(Paragraph(cat, subsection_title))
rows = [[Paragraph(p, ParagraphStyle("PH", fontName="Helvetica-Oblique",
fontSize=9.5, textColor=colors.HexColor("#1B5E20"), leading=14))]
for p in phrases]
t = Table(rows, colWidths=[16*cm])
t.setStyle(TableStyle([
("ROWBACKGROUNDS", (0,0),(-1,-1), [TEAL_BG, WHITE]),
("TOPPADDING", (0,0),(-1,-1), 5),
("BOTTOMPADDING", (0,0),(-1,-1), 5),
("LEFTPADDING", (0,0),(-1,-1), 14),
("BOX", (0,0),(-1,-1), 0.5, colors.HexColor("#B2DFDB")),
("LINEBELOW", (0,0),(-1,-2), 0.3, colors.HexColor("#B2DFDB")),
]))
el.append(t)
el.append(Spacer(1, 0.25*cm))
return el
# ── Section 4 - Sample Q&A ────────────────────────────────────────────────────
def section4():
el = []
el.append(section_header("SECTION 4 - Sample Questions & Model Answers"))
el.append(Spacer(1, 0.3*cm))
el.append(Paragraph(
"Study these model answers. Notice: direct opening, structured explanation, concrete example, brief close.",
body))
el.append(Spacer(1, 0.25*cm))
qa_pairs = [
(
"What is osmosis?",
"Osmosis is the movement of water molecules from a region of lower solute "
"concentration to a region of higher solute concentration through a semi-permeable "
"membrane. For example, when a red blood cell is placed in pure water, water enters "
"the cell by osmosis, causing it to swell.",
"Use 'lower to higher' not 'high to low' - water follows concentration gradient of solute."
),
(
"What is the difference between an acid and a base?",
"An acid is a substance that donates hydrogen ions (H+) in solution, whereas a base "
"accepts hydrogen ions. Acids have a pH below 7 - lemon juice is a common example. "
"Bases have a pH above 7 - baking soda is a typical example. The key contrast is in "
"their effect on indicators: acids turn litmus red, bases turn it blue.",
"Use 'whereas' to make the contrast crisp and clear."
),
(
"Why do objects fall to the ground?",
"Objects fall because of gravity - a force of attraction between any two masses. The "
"Earth has a much greater mass than everyday objects, so it pulls them toward its centre. "
"This gives all objects near Earth's surface an acceleration of approximately 9.8 m/s². "
"So when you drop a ball, gravity accelerates it downward until it hits the ground.",
"Mention the value 9.8 m/s² to show precise knowledge."
),
(
"Explain the water cycle.",
"The water cycle describes the continuous movement of water through the environment. "
"It begins with evaporation - the sun heats surface water, turning it into vapour which "
"rises into the atmosphere. This vapour cools and condenses into clouds. When clouds "
"become heavy enough, precipitation occurs as rain or snow. Water then flows back to "
"oceans and lakes via rivers, and the cycle repeats.",
"Use the sequence words: begins with, then, after that, finally."
),
(
"Do you think renewable energy can replace fossil fuels?",
"In my view, yes - renewable energy has the potential to replace fossil fuels over time. "
"Evidence shows solar and wind costs have dropped over 80% in the last decade. However, "
"challenges like energy storage and grid stability remain. So while a complete transition "
"is possible, it requires significant investment and policy support.",
"Always acknowledge the other side - it shows critical thinking."
),
]
for q, a, tip in qa_pairs:
el.append(KeepTogether([qa_box(q, a, tip), Spacer(1, 0.3*cm)]))
return el
# ── Section 5 - Body Language ─────────────────────────────────────────────────
def section5():
el = []
el.append(section_header("SECTION 5 - Body Language & Delivery Tips"))
el.append(Spacer(1, 0.3*cm))
tips = [
("Eye Contact", "Look at the examiner while speaking - not at the floor or ceiling. Brief "
"glances away while thinking are fine."),
("Speaking Speed", "Speak slower than you think you need to. Fast speech signals nerves. "
"Pause between points - silence is not weakness."),
("Posture", "Sit straight with both feet on the floor. Avoid slumping or leaning too "
"far forward. A relaxed upright posture signals confidence."),
("Hands", "Use gentle hand gestures to emphasise points. Avoid fidgeting, tapping, "
"or touching your face - these signal anxiety."),
("Tone of Voice", "Vary your pitch slightly - a monotone voice loses the examiner's attention. "
"Emphasise key words: 'The MAIN reason is...'"),
("Handling Silence","If you need to think, say 'Let me think about that for a moment' and then "
"pause - this is better than long 'ummm' or 'ahhh' fillers."),
("Filler Words", "Replace 'um', 'uh', 'like', 'you know' with a brief pause or connector "
"phrase like 'Additionally...' or 'What I mean is...'"),
("When Nervous", "Take a slow breath before you start. Remind yourself: the examiner wants "
"you to succeed. Nervousness is normal and examiners expect it."),
]
rows = [[
Paragraph(t[0], ParagraphStyle("BT", fontName="Helvetica-Bold", fontSize=10,
textColor=NAVY, leading=14)),
Paragraph(t[1], ParagraphStyle("BD", fontName="Helvetica", fontSize=9.5,
textColor=DARK, leading=14)),
] for t in tips]
t = Table(rows, colWidths=[4*cm, 12*cm])
t.setStyle(TableStyle([
("ROWBACKGROUNDS", (0,0),(-1,-1), [LIGHT_GREY, WHITE]),
("TOPPADDING", (0,0),(-1,-1), 7),
("BOTTOMPADDING", (0,0),(-1,-1), 7),
("LEFTPADDING", (0,0),(-1,-1), 8),
("GRID", (0,0),(-1,-1), 0.4, colors.HexColor("#CFD8DC")),
("VALIGN", (0,0),(-1,-1), "TOP"),
]))
el.append(t)
el.append(Spacer(1, 0.5*cm))
return el
# ── Section 6 - Quick Reference ───────────────────────────────────────────────
def section6():
el = []
el.append(section_header("SECTION 6 - Quick Reference Cheat Sheet"))
el.append(Spacer(1, 0.3*cm))
el.append(Paragraph(
"Print this page and keep it on your desk while practising.",
body))
el.append(Spacer(1, 0.2*cm))
cheat = [
["QUESTION TYPE", "YOUR FIRST WORDS"],
["Definition (What is...?)", '"This refers to... / is defined as..."'],
["Explain / Describe", '"This works by... / can be explained as..."'],
["Difference", '"X is... whereas Y is... The key difference is..."'],
["Reason / Cause", '"This is because... / The main cause is..."'],
["Process / Steps", '"First... Then... After that... Finally..."'],
["Opinion", '"In my view... because... however..."'],
["Application / Example", '"A real-world example is... which shows that..."'],
["", ""],
["BUYING TIME", "SHOWING UNCERTAINTY"],
['"Let me think about that..."', '"I\'m not entirely certain, but..."'],
['"If I understand correctly..."','"My understanding is... though I may be wrong."'],
["", ""],
["CLOSING WELL", "ASKING CLARIFICATION"],
['"In summary..."', '"Could you clarify what you mean by...?"'],
['"That covers the main points."','"Are you asking about X or Y?"'],
]
rows = []
header_rows = {0, 9, 13}
for i, row in enumerate(cheat):
if i in header_rows:
rows.append([
Paragraph(row[0], ParagraphStyle("CH", fontName="Helvetica-Bold",
fontSize=9, textColor=WHITE, leading=12)),
Paragraph(row[1], ParagraphStyle("CH", fontName="Helvetica-Bold",
fontSize=9, textColor=WHITE, leading=12)),
])
elif row[0] == "":
rows.append([Paragraph("", body), Paragraph("", body)])
else:
rows.append([
Paragraph(row[0], ParagraphStyle("CR", fontName="Helvetica-Bold",
fontSize=9, textColor=NAVY, leading=12)),
Paragraph(row[1], ParagraphStyle("CA", fontName="Helvetica-Oblique",
fontSize=9, textColor=colors.HexColor("#1B5E20"), leading=12)),
])
t = Table(rows, colWidths=[8*cm, 8*cm])
style = [
("GRID", (0,0),(-1,-1), 0.4, colors.HexColor("#CFD8DC")),
("TOPPADDING", (0,0),(-1,-1), 5),
("BOTTOMPADDING",(0,0),(-1,-1), 5),
("LEFTPADDING", (0,0),(-1,-1), 8),
("ROWBACKGROUNDS",(0,0),(-1,-1),[WHITE, LIGHT_GREY]),
]
for r in header_rows:
style.append(("BACKGROUND", (0,r), (-1,r), TEAL))
style.append(("SPAN", (0,r), (-1,r)))
t.setStyle(TableStyle(style))
el.append(t)
el.append(Spacer(1, 0.5*cm))
# Motivational close
close_data = [[Paragraph(
"Remember: Confidence comes from preparation. Practise answering out loud every day - "
"even 10 minutes makes a huge difference. You've got this!",
ParagraphStyle("Close", fontName="Helvetica-Bold", fontSize=10.5,
textColor=WHITE, leading=16, alignment=TA_CENTER))]]
close_t = Table(close_data, colWidths=[16*cm])
close_t.setStyle(TableStyle([
("BACKGROUND", (0,0),(-1,-1), AMBER),
("TOPPADDING", (0,0),(-1,-1), 14),
("BOTTOMPADDING", (0,0),(-1,-1), 14),
("LEFTPADDING", (0,0),(-1,-1), 16),
("RIGHTPADDING", (0,0),(-1,-1), 16),
("ROUNDEDCORNERS", [8]),
]))
el.append(close_t)
return el
# ── Page template (header/footer) ─────────────────────────────────────────────
def on_page(canvas, doc):
canvas.saveState()
w, h = A4
# Header line
canvas.setStrokeColor(NAVY)
canvas.setLineWidth(1.5)
canvas.line(2*cm, h - 1.4*cm, w - 2*cm, h - 1.4*cm)
canvas.setFont("Helvetica-Bold", 8)
canvas.setFillColor(NAVY)
canvas.drawString(2*cm, h - 1.2*cm, "VIVA ENGLISH STUDY GUIDE")
canvas.setFont("Helvetica", 8)
canvas.setFillColor(GREY)
canvas.drawRightString(w - 2*cm, h - 1.2*cm, "Speak Clearly. Answer Confidently.")
# Footer line
canvas.setStrokeColor(colors.HexColor("#CFD8DC"))
canvas.setLineWidth(0.5)
canvas.line(2*cm, 1.4*cm, w - 2*cm, 1.4*cm)
canvas.setFont("Helvetica", 8)
canvas.setFillColor(GREY)
canvas.drawCentredString(w/2, 1.0*cm, f"Page {doc.page}")
canvas.restoreState()
def on_first_page(canvas, doc):
# No header/footer on cover
pass
# ── Build ─────────────────────────────────────────────────────────────────────
doc = SimpleDocTemplate(
OUTPUT,
pagesize=A4,
leftMargin=2*cm, rightMargin=2*cm,
topMargin=2*cm, bottomMargin=2*cm,
title="Viva English Study Guide",
author="Orris",
subject="Oral Exam Preparation",
)
story = []
story += cover_page()
story += section1()
story.append(PageBreak())
story += section2()
story.append(PageBreak())
story += section3()
story.append(PageBreak())
story += section4()
story.append(PageBreak())
story += section5()
story += section6()
doc.build(story, onFirstPage=on_first_page, onLaterPages=on_page)
print(f"PDF created: {OUTPUT}")
cd /tmp/workspace/viva-guide && python create_pdf.py
Viva Study Guide
PDF Document · PDF
| # | Section | What you'll find |
|---|---|---|
| 1 | The 7 Question Types | Definition, Explain, Difference, Reason, Process, Opinion, Application - with patterns and strategies |
| 2 | Answer Frameworks | DARE, PEEL, and Compare & Contrast structures with worked examples |
| 3 | Key English Phrases | 8 categories of ready-to-use phrases (opening, buying time, explaining, closing, etc.) |
| 4 | Sample Q&A | 5 model answers with examiner tips (science, opinion, process questions) |
| 5 | Body Language & Delivery | Eye contact, speaking speed, handling filler words, managing nerves |
| 6 | Quick Reference Cheat Sheet | One-page printable table of first words for every question type |
Tomorrow is my physiology viva and I'm so nervous would you plz help me in preparation Topic is General physiology Blood hematology Biophysics Endocrine system with Introduction, Anterior pituitary gland, thyroid gland, parathyroid gland
You are helping a medical student prepare for their physiology viva tomorrow. Read the following physiology textbook files (Guyton and Hall) and extract the key facts, definitions, mechanisms, and numbers needed for a viva. Read these files: 1. /textbooks/9780443111013/9780443111013_block1.md — lines 360-500 (cell membrane), lines 1547-1920 (transport mechanisms) 2. /textbooks/9780443111013/9780443111013_block8.md — Search for hematology/blood topics (RBCs, hemoglobin, WBCs, platelets, clotting) 3. /textbooks/9780443111013/9780443111013_block9.md — Search for endocrine content (pituitary, thyroid, parathyroid) Use read_file with appropriate offset/limit. Also search using query_library_db: - SELECT level, heading, block_number, '/textbooks/' || block_file_path AS file_path, line_number FROM v_toc WHERE book_isbn = '9780443111013' ORDER BY block_number, line_number LIMIT 100 to get the full TOC - Then read the blocks that cover: Blood/Hematology, Endocrine (pituitary, thyroid, parathyroid) For each topic, extract: - Key definitions - Important numbers/values - Mechanisms explained simply - Common viva questions with answers Return a detailed, structured JSON with these 4 main sections: 1. general_physiology (cell membrane, transport, biophysics - membrane potential, osmosis, diffusion) 2. blood_hematology (RBC, WBC, platelets, hemoglobin, blood groups, coagulation) 3. endocrine_pituitary (hormones, functions, disorders) 4. endocrine_thyroid_parathyroid (T3/T4 synthesis, functions, calcium regulation, PTH) Each section should have: key_facts (list), important_values (list of name:value pairs), viva_qa (list of question:answer pairs, at least 5 per section). Be thorough - this student's exam is tomorrow!
ls /tmp/workspace/viva-guide/