File size: 31,279 Bytes
1d355ad
46d9e31
a6f461f
734b439
1d355ad
22032f3
 
be8c18b
22032f3
be8c18b
 
e455db3
a2e54db
734b439
22032f3
3ef0a66
b91b32e
734b439
3ef0a66
 
a4d2ef7
be8c18b
734b439
be8c18b
a4d2ef7
734b439
be8c18b
a4d2ef7
734b439
be8c18b
734b439
a4d2ef7
be8c18b
 
41359cb
be8c18b
 
 
 
 
 
7eb31f9
41359cb
 
be8c18b
6ab5f49
7eb31f9
be8c18b
41359cb
7eb31f9
 
 
be8c18b
7eb31f9
be8c18b
41359cb
a4d2ef7
be8c18b
734b439
9d50192
be8c18b
d7805f0
be8c18b
d05d1f1
f0b66e0
 
 
7198cb0
ad90ef7
be8c18b
7198cb0
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
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
import os
import time
import google.generativeai as genai
import gradio as gr

genai.configure(api_key=os.environ["GEMINI_API_KEY"])

# Model configuration
generation_config = {
    "temperature": 1,  # Controls creativity (closer to 0 is more deterministic)
    "top_p": 0.95,      # Range for sampling tokens based on top probabilities
    "top_k": 40,         # Consider top k tokens
    "max_output_tokens": 8192,  # Limit the maximum number of generated tokens
    "response_mime_type": "text/plain",
}
model = genai.GenerativeModel(
    model_name="gemini-2.0-flash",
    generation_config=generation_config,
)


def generate_dnc_plan(learning_objective):
    """
    Generates a Dick & Carey instructional design plan based on the given learning objective.

    Args:
      learning_objective: The desired learning outcome.

    Returns:
      The generated Dick & Carey instructional design plan.
    """

    # Prompt creation - includes example input and output 
    # (translated prompt in English)
    prompt = [
        "INSTRUCTIONAL DESIGN USING THE DICK AND CAREY SYSTEMS APPROACH, Analyze the given learning objective using a divide and conquer method and design an instruction using the Dick & Carey systems approach.",
        "input: learning objective", 
        "output: Instructional Design Using the Dick and Carey Systems Approach 1. Analysis of Instructional Goals\n\nGoal: Set as a measurable goal\n\nDetailed Objectives:\n(1) Verbal Information:\n\n(2) Intellectual Skills:\n\n(3) Motor Skills:\n\n(4) Attitude:\n\n(5) Cognitive Strategies:\n\n2. Analysis of Sub-elements of Knowledge, Understanding, and Skill Objectives\nDivide learning objectives into A, B, C areas\nSet sub-goals as A-1, A-2, A-3, etc.\n*Sub-element analysis should be written specifically, step-by-step, and hierarchically using divide and conquer.\n\n3. Diagnosis of Entry-Level Skills and Misconceptions\n\nIt is very important to diagnose the basic skills that students should have and the expected misconceptions before starting learning in this unit. By doing this, you can accurately grasp the level of students and design classes that are right for them.\n\n3.1 Entry-Level Skills:\n\nStudents should have the following minimum level of knowledge and skills to successfully achieve the learning objectives.\n\n3.2 Misconception Diagnosis and Remediation Strategies:\n\nHere are the typical misconceptions that students may encounter while learning, specific diagnostic methods for them, and remediation strategies to correct them.\n\n3.3 Sample Diagnostic Activities:\n\n3.4 Utilizing Diagnostic Results:\n\n\n4. Performance Objectives and Performance Tasks (GRASPS)\n\n5. Instructional Design: Teaching methods, specific plans for each stage of the class (n times)\n\n6. Available Resources\n\n7. Evaluation Methods and Tools, Evaluation Rubric (Excellent, Average, Needs Improvement)",
        "input: Students can perform three-digit by two-digit division calculations by understanding the principle of division.",
        "output: Instructional Design Using the Dick and Carey Systems Approach Instructional Design Using the Dick and Carey Systems Approach: Three-digit ÷ Two-digit Division\n\n1. Analysis of Instructional Goals\n\nGoal: Students can understand the principle of division and, based on this, solve three-digit ÷ two-digit division with an accuracy of 80% or more, solving at least 8 out of 10 problems. In addition, they can appropriately apply division in various problem situations, interpret and explain the results.\n\nDetailed Objectives:\n(1) Verbal Information:\nStudents can accurately understand division terms (dividend, divisor, quotient, remainder), use them appropriately in context, and express their thoughts.\nStudents can explain the division process step-by-step in words and writing.\nStudents can interpret division results in the context of real-life situations and clearly communicate their thoughts.\n\n(2) Intellectual Skills:\nStudents can explain the concept and principle of division in relation to multiplication and subtraction.\nStudents can analyze three-digit ÷ two-digit division problem situations and solve problems by selecting appropriate solution strategies.\nStudents can estimate the number of digits in the quotient using estimation (rounding up, rounding down, rounding off), and judge the validity of the calculation results.\nStudents can accurately understand the meaning of quotient and remainder, and use them to express division results in various ways.\n\n(3) Motor Skills:\nStudents can accurately and neatly write down the division calculation process in a notebook, aligning the digits.\nStudents can accurately calculate and utilize multiplication and subtraction in the process of solving division problems.\n\n(4) Attitude:\nStudents participate actively with interest and confidence in the process of solving division problems.\nStudents strive for accurate calculation and have the attitude to solve problems persistently.\nStudents actively participate in group activities, respect and listen to the opinions of others.\nStudents develop mathematical thinking skills in the process of logically expressing their thoughts and communicating with others.\n\n(5) Cognitive Strategies:\nStudents identify information necessary for solving division problems (dividend, divisor, quotient, remainder) from the problem situation, and perform division calculations using multiplication and subtraction.\nStudents predict the number of digits in the quotient using estimation, and check the accuracy of the calculation results through verification.\nStudents reflect on the problem-solving process, correct errors on their own, and try to find more efficient methods.\n\n2. Analysis of Sub-elements of Knowledge, Understanding, and Skill Objectives\n\nA. Understanding the Concept and Principle of Division\nA-1. Understand division situations by connecting them to real-life situations where things need to be divided equally. (Example: The situation of dividing 12 candies equally among 4 people)\nA-2. Students can explain that division is an operation that shows how many times the same number is subtracted through the relationship with repeated subtraction. (Example: 12 - 4 - 4 - 4 = 0, 12 ÷ 4 = 3)\nA-3. Students understand that division is the inverse operation of multiplication and can explain it by connecting multiplication and division equations. (Example: 3 x 4 = 12 ↔ 12 ÷ 4 = 3)\nA-4. Students can distinguish division terms (dividend, divisor, quotient, remainder) and explain the meaning of each term in actual division situations. (Example: In 13 ÷ 4 = 3 ... 1, 13 is the dividend, 4 is the divisor, 3 is the quotient, and 1 is the remainder)\nA-5. Students can represent and explain the relationship between dividend, divisor, quotient, and remainder using equations and diagrams (grouping diagrams, number models, etc.).\n\nB. Performing Three-digit ÷ Two-digit Division\nB-1. Students understand the calculation principle of three-digit ÷ two-digit division by comparing and contrasting commonalities and differences with two-digit ÷ one-digit division.\nB-2. Students can estimate the number of digits in the quotient through estimation (rounding up, rounding down, rounding off) and explain the reason based on the relationship between the divisor and the quotient. (Example: In 78 ÷ 20, estimate 20 as 20, and since 20 x 3 = 60 and 20 x 4 = 80, predict that the quotient is a number between 3 and 4)\nB-3. Use the product of the divisor and the quotient to find the number to be divided, and explain the calculation process using the relationship between multiplication and division.\nB-4. Students can use subtraction to find the remainder and understand and explain that the remainder must always be less than the divisor.\nB-5. Use the quotient and remainder to express the result of division as a complete sentence appropriate to the real-life situation. (Example: If 34 candies are divided among 5 people, each person gets 6 and there are 4 left over.)\n\nC. Solving Real-life Problems Using Division\nC-1. Students can identify situations where division is needed in various real-life problem situations (purchasing items, planning trips, allocating time, etc.) and structure the problem.\nC-2. Students can identify the information and conditions given in the problem situation and distinguish between necessary and unnecessary information.\nC-3. Students can choose an appropriate strategy for problem-solving (estimation, equation writing, table drawing, etc.) and use division to solve the problem.\nC-4. Students can logically explain the problem-solving process, review the validity of the answer, and interpret the results appropriately to the problem situation.\n\n3. Diagnosis of Entry-Level Skills and Misconceptions\n\nIt is very important to diagnose the basic skills that students should have and the expected misconceptions before starting learning in this unit. By doing this, you can accurately grasp the level of students and design classes that are right for them.\n\n3.1 Entry-Level Skills:\n\nStudents should have the following minimum level of mathematical knowledge and skills to successfully achieve the learning objectives for three-digit ÷ two-digit division:\n\n(1) Complete understanding and application of multiplication tables:\nStudents should be able to memorize multiplication tables and use them to solve multiplication problems proficiently.\nStudents should be able to look at the multiplication table and quickly find multiples of a particular number.\nStudents should be able to understand division as the inverse operation of multiplication and use multiplication tables for division calculations.\n\n(2) Two-digit multiplication:\nStudents should understand the principle of two-digit multiplication and be able to calculate accurately by aligning digits.\nStudents should be able to proficiently perform two-digit multiplication with carrying over.\nStudents should be able to accurately use two-digit multiplication to check and verify the quotient in the division process.\n\n(3) Two-digit ÷ one-digit division:\nStudents should understand the basic concept and principle of division and be able to accurately perform calculations that divide two digits by one digit.\nStudents should accurately understand the concepts of quotient and remainder and be able to represent the results of division using quotient and remainder.\nStudents should understand that the remainder is always smaller than the divisor and be able to apply this to the calculation process.\n\n(4) Subtraction with borrowing:\nStudents should understand the principle of subtraction with borrowing and be able to calculate accurately.\nSince subtraction must be performed continuously in the division process, fast and accurate subtraction skills are required.\n\n(5) Basic problem-solving skills:\nStudents should be able to understand the problem situation and grasp the given information.\nStudents should have experience using simple problem-solving strategies (drawing pictures, making tables, etc.).\n\n3.2 Misconception Diagnosis and Remediation Strategies:\n\nThe following are typical misconceptions that students may encounter while learning three-digit ÷ two-digit division, specific diagnostic methods for them, and remediation strategies to correct the misconceptions.\n\n(1) Trying to always make the remainder 0: This is a misconception that arises because students do not fully understand the concept of division and are accustomed to division without a remainder.\nDiagnosis: Present a variety of division problems and ask them to find the quotient and remainder, paying close attention to students' responses, especially to problems where a remainder occurs. If they try to arbitrarily adjust the quotient to make the remainder 0, or if they can't write down an answer with a remainder at all, you can suspect this misconception.\nRemediation:\nUse concrete objects such as Go stones or chips to directly create division situations and allow them to naturally experience cases where a remainder occurs. For example, create a situation where 13 Go stones are divided equally among 4 people and lead them to think about the meaning of the remaining Go stones.\nClearly explain that division is possible even when the remainder is not 0, and practice representing both the quotient and the remainder. Familiarize them with the way of writing both the quotient and the remainder, such as \"13 ÷ 4 = 3 ... 1\", and help them understand that this represents the situation where there is 1 left after dividing by 3.\nExplain using examples of division situations in real life where a remainder occurs. For example, present situations like dividing 13 candies among 4 people and having 1 left over, or forming 21 students into groups of 5 with 1 student left over, to help them understand the concept of remainder more easily.\n\n(2) Incorrectly determining the number of digits in the quotient: This is a misconception that arises from a lack of understanding of the concept of place value or an inability to use estimation.\nDiagnosis: Present division problems where the quotient is a two-digit or three-digit number and ask them to predict the number of digits in the quotient. If students consistently miswrite the number of digits in the quotient, or if they start calculating without estimation, you can suspect this misconception.\nRemediation:\nUse number models and place value charts to visually compare the magnitudes of three-digit and two-digit numbers and present how to predict the number of digits in the quotient. For example, when calculating 234 ÷ 12, use number models representing 234 and group them by 12 to visually check where the quotient starts.\nPractice step-by-step how to infer the number of digits in the quotient through bundled multiplication using the divisor. For example, in 234 ÷ 12 = ?, use 12 x 10 = 120 and 12 x 20 = 240 to infer that the quotient starts in the tens place and is less than 20.\nEmphasize the importance of estimation and practice predicting the number of digits in the quotient using various estimation methods (rounding up, rounding down, rounding off).\n\n(3) Making errors in subtraction during the division process: This is an error that occurs due to not being accustomed to subtraction with borrowing.\nDiagnosis: Carefully observe the process of performing subtraction during the division process. When a subtraction error occurs, ask where the student is having difficulty and explain the subtraction process again.\nRemediation:\nProvide enough subtraction with borrowing practice problems to improve calculation skills. In particular, focus on practicing subtraction types that frequently appear in the division process.\nUse materials that visually present the subtraction process (number lines, number cards, etc.) to help students clearly understand the subtraction process.\nWhen performing subtraction during the division process, guide students to develop the habit of writing each digit accurately aligned.\n\n(4) When the remainder is greater than or equal to the divisor: This is an error that occurs because students do not properly understand the concept and principle of division, or because they are not proficient in the calculation process.\nDiagnosis: Present a division result where the remainder is greater than or equal to the divisor and ask if it is correct. Ask them to explain why it's wrong and how to fix it to understand the student's level of understanding.\nRemediation:\nUse concrete objects such as Go stones or chips to have students directly perform division and help them intuitively understand that the remainder must be smaller than the divisor.\nPractice comparing the product of the divisor and the quotient as you increase the quotient one by one, and finding the point where the remainder becomes smaller than the divisor.\nWrite down the division process step-by-step and guide students to develop the habit of comparing the size of the remainder and the divisor at each step.\n\nGeneral Remediation Strategies:\nFor all misconceptions, it is important to clearly identify the cause of the error and use explanations and materials appropriate to the student's level.\nIt is more effective to use specific examples, visual aids, and manipulative activities to encourage students to directly participate and understand than abstract explanations.\nIt is important to help students master the concepts accurately and build confidence through sufficient practice and feedback.\n\n3.3 Sample Diagnostic Activities:\n\nPre-assessment: Before starting the unit, conduct a simple assessment that includes the pre-requisite skills and misconception-related questions presented above.\n\nObservation and questioning: During class, identify areas where students are having misconceptions or difficulties through their activity patterns, problem-solving processes, and questions.\n\nError log: Have students write down the problems they got wrong in an error log, analyze and reflect on why they were wrong and how to solve them.\n\n3.4 Utilizing Diagnostic Results:\n\nDifferentiated instruction: Based on the diagnostic results, identify the levels of students and provide differentiated learning materials and activities to meet individual learning needs.\n\nRemedial learning: For students who show misconceptions, re-explain the concepts using concrete object manipulation, peer tutoring, or individual instruction to correct their misconceptions.\n\nAdjusting the learning process: Adjust the pace of the class according to the students' level of understanding, and provide additional explanations or activities if necessary.\n\n4. Performance Objectives and Performance Tasks (GRASPS)\n\nGoal: Become a field trip planner for our class, plan bus rentals, entrance fees, snack purchases, etc. to maximize the enjoyment of as many friends as possible within the given budget, and write and present a budget plan report.\n\nRole: Field trip planner (Roles can be divided into budget manager, transportation manager, snack manager, etc.)\n\nAudience: Classmates and teacher\n\nSituation: A situation where you have to go on a fun field trip with classmates on a limited budget\n\nProduct/Performance: Writing and presenting a budget plan report (including a schedule, price comparison by option, calculation process, expected remaining amount, and result explanation)\n\nStandards:\n\nDid you accurately solve the problem situation using division?\n\nDid you use estimation to predict the quotient and verify the calculation results?\n\nDid you logically explain the calculation process and clearly present the results?\n\nIs the budget plan report creative and effective in conveying information?\n\nDid you actively participate in group activities and show cooperation with others?\n\n5. Instructional Design: Teaching methods, specific plans for each stage of the class (5 sessions)\n\n<Session 1: Getting Familiar with Division>\n\nIntroduction (10 minutes)\n\nQuiz: Review multiplication, subtraction, and division concepts (Using Kahoot)\n\nMotivation: Present examples of how division is used in everyday life with picture cards (e.g., dividing snacks equally, dividing allowance, distributing school supplies)\n\nDevelopment (25 minutes)\n\nActivity 1: Group activity - Presenting real-life division situation cards, acting them out (Presenting 3-4 situations per group, assigning roles and acting)\n\nActivity 2: Whole class discussion - Each group presents, recognizing the need and importance of division\n\nActivity 3: Vocabulary review - Division vocabulary card game (Pair work, using bingo game)\n\nWrap-up (5 minutes)\n\nSession 1 summary: Review division vocabulary, quiz solutions (Using Padlet)\n\nPreview of next session: Briefly introduce what they will learn in the next session (Presenting learning objectives)\n\n<Session 2: Let's Explore the Principles of Division!>\n\nIntroduction (10 minutes)\n\nReview of previous learning: Division vocabulary quiz (Using Quizizz)\n\nMotivation: Solving division problems using multiplication and subtraction (Presenting problems on the board, sharing students' solution processes)\n\nDevelopment (25 minutes)\n\nActivity 1: Hands-on experience - Visually experiencing the principle of division using Go stones (e.g., dividing 12 Go stones into groups of 4 and counting the number of groups)\n\nActivity 2: Concept explanation - Explaining the relationship between multiplication and division (Using connecting cards for multiplication and division equations), introducing and explaining the concept of remainder (Using picture materials)\n\nActivity 3: Pair work - Division practice using number cards, checking the solution process by explaining to each other (Presenting problems with varying levels of difficulty)\n\nWrap-up (5 minutes)\n\nSession 2 summary: Relationship between multiplication and division, concept of remainder, solving problems using what they learned today (Using Nearpod)\n\nPreview of next session: Announce that they will learn how to calculate three-digit ÷ two-digit division in the next session (Presenting learning objectives)\n\n<Session 3: Three-digit ÷ Two-digit Division, It's Not Difficult!>\n\nIntroduction (10 minutes)\n\nReview of previous learning: Division concept and vocabulary review quiz (Using Mentimeter, providing real-time feedback)\n\nMotivation: Comparing with two-digit ÷ one-digit division, presenting three-digit ÷ two-digit division problems, exploring solution methods (Pair work)\n\nDevelopment (20 minutes)\n\nActivity 1: Concept explanation - Explaining the calculation principle of three-digit ÷ two-digit division (Using number models, place value charts), emphasizing the importance of estimation (Demonstrating example problem solving)\n\nActivity 2: 'Think-aloud' strategy - Teacher first thinks aloud the steps of solving a division problem, students listen attentively and ask questions (Encouraging active participation)\n\nActivity 3: Individual practice - Solving division problems from textbooks or worksheets (Providing problems of varying difficulty levels, considering individual learning levels)\n\nWrap-up (5 minutes)\n\nSession 3 summary: Taking notes on important concepts and solution processes, solving problems using what they learned today (Submitting assignments on Google Classroom)\n\nPreview of next session: Announce that in the next session, they will be solving real-life problems using division (Presenting learning objectives)\n\n<Session 4: Show Your Division Skills!>\n\nIntroduction (10 minutes)\n\nReview of previous learning: Solving three-digit ÷ two-digit division problems (3 problems, individual solving followed by checking with a partner)\n\nMotivation: Presenting a situation where budget calculation is needed when planning a field trip (Using PPT materials, including photos of actual field trip locations), presenting a problem situation (e.g., renting a bus, entrance fees, buying snacks with a limited budget)\n\nDevelopment (25 minutes)\n\nActivity 1: Group formation and role assignment (4-5 students per group, assigning roles such as budget manager, transportation manager, snack manager, emphasizing collaboration and communication)\n\nActivity 2: Group activity - Using the provided materials (field trip location information, bus rental companies, snack price lists, etc.) to create a budget plan (using division)\n\nActivity 3: Creating a budget plan report (including a schedule, price comparison by option, calculation process, expected remaining amount, and result explanation) (Using PPT, Canva, etc.)\n\nWrap-up (5 minutes)\n\nSession 4 summary: Each group briefly presents their budget plan, learning by comparing with other groups' plans (Conducting group evaluation and self-evaluation)\n\nPreview of next session: Announce that the next session will be the final budget plan presentation and evaluation session (Requesting preparation for presentation)\n\n<Session 5: Our Class Field Trip Plan Presentation Day>\n\nIntroduction (5 minutes)\n\nPresentation guidelines and evaluation criteria explanation (Presenting clear and specific evaluation criteria)\n\nDevelopment (30 minutes)\n\nGroup presentations (within 5 minutes): Presenting budget plans (Using PPT, Canva, etc.), listening and asking questions about other groups' presentations (Encouraging active participation)\n\nFeedback: Teacher provides positive feedback on each group presentation, suggests areas for improvement (Providing specific and constructive feedback)\n\nWrap-up (5 minutes)\n\nLesson summary: Reviewing what they learned, sharing examples of using division, sharing thoughts\n\nFinal Evaluation: Individual evaluation sheet (division calculation problems, real-life problem solving, learning content summary) (Checking individual learning achievement)\n\n6. Available Resources\n\nManipulatives: Grid paper, Go stones, number cards, number models, place value charts, whiteboard, markers\n\nVisual aids: PPT, picture cards, actual field trip location photos, bus rental company information, snack price lists\n\nIT devices and programs: Computers, projector, internet, Kahoot, Quizizz, Mentimeter, Nearpod, Google Classroom, Padlet, PPT, Canva\n\n7. Evaluation Methods and Tools, Evaluation Rubric (Excellent, Average, Needs Improvement)\n\nEvaluation Methods:\n\nObservation: Participation and attitude during class, group activity participation, problem-solving process observation (Using checklists)\n\nAssignments: Solving division problems, writing budget plan reports (Using rubrics)\n\nPresentations: Group project presentations (Using rubrics)\n\nSelf-evaluation: Students evaluate their own participation in class, group activities, problem-solving processes, and understanding of learning content (Using self-evaluation sheets)\n\nPeer evaluation: Evaluate the participation and cooperation level of other group members in group activities (Using peer evaluation sheets)\n\nEvaluation Tools:\n\nChecklists: Evaluating participation and attitude in class (Are you concentrating in class? / Do you actively answer questions? / Do you actively participate in group activities? / Do you respect the opinions of others?)\n\nRubrics: Evaluating division problem solving, budget plan reports, group presentations (See rubrics below)\n\nSelf-evaluation sheets: Recording what you think are your strengths, weaknesses, and areas for improvement\n\nPeer evaluation sheets: Recording the strengths and areas for improvement of friends you worked with in group activities\n\nEvaluation Rubrics (Example):\n\n<Division Problem Solving>\n\nCriteria\tExcellent (3 points)\tAverage (2 points)\tNeeds Improvement (1 point)\nUnderstanding of division principles\tAccurately understands the concept and principles of division, and can explain the relationship with multiplication and subtraction.\tMostly understands the concept and principles of division, but shows some shortcomings.\tLacks understanding of the concept and principles of division, and shows errors.\nCalculation skills\tAccurately calculates three-digit ÷ two-digit division, verifies results through verification, and appropriately uses estimation.\tMostly accurately calculates three-digit ÷ two-digit division, but makes occasional mistakes.\tHas difficulty calculating three-digit ÷ two-digit division, and makes frequent mistakes.\nProblem-solving skills\tAnalyzes real-life problem situations using division, selects appropriate solution strategies to solve problems, and can judge and explain the reasonableness of the answer.\tTries to solve problems using division, but there are some errors in the process or results.\tHas difficulty solving problems using division, and cannot find appropriate solution methods.\n\n<Budget Plan Report & Presentation>\n\nCriteria\tExcellent (3 points)\tAverage (2 points)\tNeeds Improvement (1 point)\nInformation gathering and analysis\tAccurately gathers and analyzes necessary information, and reflects it in the plan. Compares various information and makes reasonable choices.\tMostly gathers necessary information, but some information is missing or analysis is insufficient.\tInsufficient information gathering and analysis, failing to properly reflect it in the plan.\nProblem-solving and plan presentation\tDevelops a logical budget plan using division and presents realistic solutions. Presents anticipated problems and solutions.\tDevelops a budget plan using division, but the plan is somewhat unrealistic, or the presentation of problems and solutions is insufficient.\tHas difficulty in problem-solving and plan presentation using division, and fails to develop a realistic plan.\nCommunication and presentation\tClearly and logically explains one's own thoughts and plans, and uses various visual aids to help the audience understand. Adequately answers questions.\tExplains one's own thoughts and plans, but the logical flow is insufficient, or the use of visual aids is insufficient.\tFails to clearly explain one's own thoughts and plans, making it difficult for the audience to understand.\nCollaboration and participation\tActively participates in group activities, listens to the opinions of others, and completes the plan through consensus.\tParticipates in group activities, but is somewhat passive, or fails to fully reflect the opinions of others.\tDoes not properly participate in group activities and does not show cooperation with others.\n\nNote:\n\nThis instructional design is an example and can be modified and supplemented according to the actual class situation and student level.\n\nMore systematic instructional design can be achieved by referring to the steps in the Dick and Carey systems approach.\n\nIt is recommended to use a variety of activities and materials to stimulate students' interest and participation.\n\nEvaluation should not be simply about scoring, but a process that helps students grow and develop.\n\nSelf-evaluation and peer evaluation can help students develop self-reflection and collaborative learning attitudes.",
        f"input: {learning_objective}", 
    ]

    full_text = ""
    yield full_text  # initial empty text output

    try:
        # Generate response in streaming mode
        response = model.generate_content(prompt, stream=True)
        for chunk in response:
            full_text += chunk.text
            yield full_text
            time.sleep(0.05) 
    except Exception as e:
        yield f"An error occurred: {str(e)}" 


# Gradio interface setup
iface = gr.Interface(
    fn=generate_dnc_plan,
    inputs=gr.Textbox(lines=1, label="Learning Objective"),
    outputs=gr.Textbox(lines=10, label="Dick & Carey Instructional Design"),
    title="Dick & Carey Instructional Design Generator",
    description="Enter a learning objective to receive a Dick & Carey instructional design plan.", 
    examples=[
        ["Fluently multiply and divide within 100, using strategies such as the relationship between multiplication and division (e.g., knowing that 8 × 5 = 40, one knows 40 ÷ 5 = 8) or properties of operations. "],
    ]
)

# Run the interface
iface.launch()