File size: 1,245 Bytes
eabe83e
be56221
eabe83e
 
 
 
 
 
 
 
 
be56221
eabe83e
 
 
 
 
 
 
 
 
be56221
 
eabe83e
 
be56221
eabe83e
be56221
eabe83e
 
be56221
eabe83e
 
be56221
eabe83e
 
be56221
eabe83e
 
 
be56221
eabe83e
 
 
 
 
 
 
 
 
be56221
 
eabe83e
be56221
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
def build_master_prompt(subject, stream, partA, partB, partC, syllabus, refqp, realtime):

    if stream == "CSE":
        template = """
You are an expert in CSE academic content creation aligned with MAANGO BIG15.
Generate:
- Part A: {partA} × 2 marks
- Part B: {partB} × 16 marks (Either/Or)
- Part C: {partC} × 16 marks (Case-based)
Tag each question:
(Bloom's Level: <x> | Unit: <n> | Company Tag: <company>)
"""
    else:
        template = """
You are an expert academic creator for Mechanical/Electrical/Electronics (Non-CSE).
Generate:
- Part A: {partA} × 2 marks
- Part B: {partB} × 13 marks (Either/Or)
- Part C: {partC} × 14 marks (Case-based)
Tag each question:
(Bloom's Level: <x> | Unit: <n> | GATE Reference: <year>)
"""

    return f"""
{template.format(partA=partA, partB=partB, partC=partC)}

Subject: {subject}

Syllabus:
{syllabus[:20000]}

Reference QP:
{refqp[:10000]}

Real-time context:
{realtime}

Generate two outputs:
1. Printable QP
2. VALID JSON with key "questions", containing list of items:
{{
"part": "A/B/C",
"question_no": int,
"sub_no": str or "",
"marks": int,
"unit": int,
"course_outcome": str,
"bloom_level": str,
"tags": str,
"question_text": str
}}

JSON MUST appear at the bottom of answer.
"""