#!/usr/bin/env python3
"""Part 2: Deneme 1 (Kolay) + Deneme 2 (Orta)"""
from docx import Document
from docx.shared import Pt, Cm, RGBColor
from docx.enum.text import WD_ALIGN_PARAGRAPH
from docx.oxml.ns import qn

PATH = "/root/Akademik/İngilizce/5. Sınıf/Unit1_My_Day.docx"
doc = Document(PATH)

FONT = "Niramit"
BLUE = RGBColor(0x1a, 0x55, 0x9e)
DARK = RGBColor(0x22, 0x22, 0x22)
GRAY = RGBColor(0x66, 0x66, 0x66)

def run(p, text, size=11, bold=False, color=DARK, italic=False):
    r = p.add_run(text)
    r.font.name = FONT
    r.font.size = Pt(size)
    r.bold = bold
    r.font.color.rgb = color
    r.italic = italic
    return r

def heading(text, sz=14):
    doc.add_page_break()
    p = doc.add_paragraph()
    p.alignment = WD_ALIGN_PARAGRAPH.CENTER
    run(p, text, sz, True, BLUE)

def sub(text):
    p = doc.add_paragraph()
    p.alignment = WD_ALIGN_PARAGRAPH.CENTER
    run(p, text, 10, False, GRAY, italic=True)

def add_q(num, stem, opts):
    doc.add_paragraph()
    p = doc.add_paragraph()
    p.paragraph_format.space_before = Pt(6)
    run(p, f"{num}. {stem}", 11, True)
    for o in opts:
        p2 = doc.add_paragraph()
        p2.paragraph_format.left_indent = Cm(1)
        p2.paragraph_format.space_before = Pt(1)
        p2.paragraph_format.space_after = Pt(1)
        run(p2, o, 10.5)

# ================================================================
# DENEME 1 - KOLAY
# ================================================================
heading("DENEME 1 — KOLAY")
sub("15 Soru  |  Süre: 20 Dakika  |  Kapsam: Unit 1 Temel")

add_q(1, "I _______ 10 years old.",
    ["A) am", "B) is", "C) are", "D) be"])

add_q(2, "She _______ a student.",
    ["A) am", "B) are", "C) is", "D) be"])

add_q(3, "We _______ friends.",
    ["A) am", "B) is", "C) are", "D) be"])

add_q(4, "A: What time is it?\n B: It is quarter _______ eight. (8:15)",
    ["A) to", "B) past", "C) after", "D) before"])

add_q(5, "I wake up _______ 7 o'clock.",
    ["A) in", "B) on", "C) at", "D) to"])

add_q(6, "A: Are you a student?\n B: Yes, _______ .",
    ["A) you are", "B) I am", "C) you're", "D) I'm"])

add_q(7, "My sister is very kind. I love _______ .",
    ["A) she", "B) her", "C) he", "D) him"])

add_q(8, "I _______ my face every morning.",
    ["A) brush", "B) comb", "C) wash", "D) watch"])

add_q(9, "A: Is your father at home?\n B: No, _______ . He is at work.",
    ["A) he is", "B) he isn't", "C) she isn't", "D) it isn't"])

add_q(10, "I _______ my teeth before breakfast.",
    ["A) take", "B) brush", "C) go", "D) have"])

add_q(11, "A: _______ your friends at the park?\n B: Yes, they are.",
    ["A) Is", "B) Am", "C) Are", "D) Be"])

add_q(12, "It is _______ past seven. (7:30)",
    ["A) half", "B) quarter", "C) o'clock", "D) full"])

add_q(13, "_______ are the parts of your body above your neck.",
    ["A) Legs and feet", "B) Arms and hands", "C) Head and shoulders", "D) Fingers and toes"])

add_q(14, "I do my homework _______ school.",
    ["A) at", "B) in", "C) before", "D) after"])

add_q(15, "A: Give this book to Ali.\n B: OK. I give it to _______ .",
    ["A) he", "B) him", "C) his", "D) she"])

# ================================================================
# DENEME 2 - ORTA
# ================================================================
heading("DENEME 2 — ORTA")
sub("15 Soru  |  Süre: 20 Dakika  |  Kapsam: Unit 1 Orta Düzey")

add_q(1, "A: Is your sister at home?\n B: No, she _______ . She is at school.",
    ["A) is", "B) isn't", "C) aren't", "D) am not"])

add_q(2, "My brother and I _______ in the garden.",
    ["A) am", "B) are", "C) is", "D) be"])

add_q(3, "Look at _______ ! He is climbing the tree.",
    ["A) he", "B) him", "C) his", "D) she"])

add_q(4, "A: _______ you ready for school?\n B: Yes, I am.",
    ["A) Is", "B) Am", "C) Are", "D) Be"])

add_q(5, "A: Are your pencils in your bag?\n B: Yes, _______ .",
    ["A) it is", "B) we are", "C) I am", "D) they are"])

add_q(6, "I have breakfast _______ the morning.",
    ["A) at", "B) on", "C) in", "D) to"])

add_q(7, "_______ name is Emily. _______ is a very kind girl.",
    ["A) Her / She", "B) She / Her", "C) Her / Her", "D) She / She"])

add_q(8, "A: What do you do before bed?\n B: I _______ a book.",
    ["A) watch", "B) read", "C) take", "D) go"])

add_q(9, "I always brush my teeth _______ I go to bed.",
    ["A) before", "B) after", "C) in", "D) at"])

add_q(10, "A: What time is it?\n B: It is _______ past five. (5:30)",
    ["A) quarter", "B) o'clock", "C) half", "D) full"])

add_q(11, "It is quarter _______ twelve. (11:45)",
    ["A) past", "B) after", "C) to", "D) before"])

add_q(12, "Amy and Tom are my friends. I play with _______ every day.",
    ["A) they", "B) them", "C) him", "D) her"])

add_q(13, "It is quarter _______ eight. (7:45)",
    ["A) past", "B) after", "C) to", "D) before"])

add_q(14, "I comb my _______ after I take a shower.",
    ["A) teeth", "B) face", "C) hair", "D) hands"])

add_q(15, "A: _______ do you have lunch?\n B: At 12:30.",
    ["A) Where", "B) How", "C) When", "D) What time"])

doc.save(PATH)
print("✅ Part 2 eklendi: Deneme 1 (Kolay) + Deneme 2 (Orta)")
