Teaching-33-02Food Plus Plus Version 2.0 (addition of numbers within 3, 4, 5, 10, 15, 20, random drawing)

Product display

Addition of points within 3: the maximum value of addition is 6

Addition of points within 4: the maximum value of addition is 8

Context requirements:

When children complete “21 questions for addition within 5 and 21 questions for subtraction within 5”, there are two characteristics:

1. 50% of the children can count by mouth, the other 50% of the children who can’t do it draw circles, but they are more accustomed to counting with their fingers.

2. Young children do not understand the meaning of plus and minus signs, and subtraction problems are also made into addition problems.

The above shows that the level of children in the middle class should be in the stage of “points in kind”, so I hope to turn the numbers of addition questions into graphics, so that children can directly count and write numbers. At the same time, in the learning tools of food exchange cards 1.0, each child can write the corresponding number according to the number of food pictures, which proves that the child’s accurate rate of points is very high.

Therefore, the purpose of this set of learning aids is to let children understand the meaning of “+” and “-“: increase and decrease, (there are physical pictures, temporarily exclude the interference of the number 0 option)

Material preparation:

1. PNG image

2. WORD template (horizontal version)

Code execution

Originally, I only wanted to use “fruit pictures”, but later I found that there were too few fruits, and there would be repetitions when randomized, so 23 kinds of food were used together

#coding:utf-8
'''
Purpose:
1. 2 apples plus 3 apples =
2. Author: Axia
Time: May 15, 2023)

'''

import os
sum=int(input('The maximum number of each card (within 3, within 4, within 5, within 10, within 15, within 20)\
'))
size=float(input('picture size (1.4, 0.9, 0.8, 0.8, 0.6, 0.6)\
'))
num=int(input('How many copies (28 people)\
'))
Number=int(input('randomly select several pictures (8)\
'))
classroom=input('Grade (input "medium" "big")\
')

print('----------Step 1: Extract the path of all playing cards------------')

path=[]
p=r"C:\Users\jg2yXRZ\OneDrive\Desktop\Fruit Plus Plus\Fruit Plus Plus png"
# Filter: only keep images ending in png
imgs=os.listdir(p)
for img in imgs:
    if img.endswith(".png"):
        path.append(p + '' + img)
# path to all images
print(path)
print(imgs)
# ['09 Apple.png', '10 Orange.png', '11 Cherry.png', '12 Grape.png', '13 Watermelon.png', '14 Avocado.png']

# print('----------Step 2: Create a new temporary folder ------------')
# # Create a new folder "install N copies of word and PDF"
os.mkdir(r'C:\Users\jg2yXRZ\OneDrive\Desktop\Fruit Plus Plus\Zero Hour Word')


print('----------Step 3: Randomly select 12 pictures ------------')

import docx
from docx import Document
from docx.shared import Pt
from docx.shared import RGBColor
from docx.enum.text import WD_PARAGRAPH_ALIGNMENT
from docx.oxml.ns import qn
import random

import os,time
import docx
from docx import Document
from docx.shared import Inches,Cm,Pt
from docx.shared import RGBColor
from docx.enum.text import WD_PARAGRAPH_ALIGNMENT
from docx.oxml.ns import qn

from docxtpl import DocxTemplate
import pandas as pd
from docx2pdf import convert
from docx.shared import RGBColor


for nn in range(0,int(num/2)):
    doc = Document(r'C:\Users\jg2yXRZ\OneDrive\Desktop\Fruit Plus Plus\Fruit Plus Plus (template).docx')
    # make list
    for z in range(2): # 5-line combined loop 2 times, two tables per page
        table = doc. tables[z]
        # The first line writes the header information
        title=[random number within '{}'.format(' d'%sum), '{}( )class'.format(classroom)]
        zb=['00','02']
        
        for x in range(len(zb)):
            
            run=table.cell(int(zb[x][0]),int(zb[x][1])).paragraphs[0].add_run(title[x])
            run.font.name = 'Microsoft Yahei'#Default Chinese colorful cloud font when inputting
            run.font.size = Pt(15) #Input font size defaults to 30
            run.font.color.rgb = RGBColor(200,200,200) #The number is small, the color depth is 0-255
            # paragraph.paragraph_format.line_spacing = Pt(180) #Number paragraph spacing
            run.font.bold=True

            r = run._element
            r.rPr.rFonts.set(qn('w:eastAsia'), 'Microsoft Yahei')#Change the Chinese font in the input sentence into Chinese Xingkai
            table.cell(0,x).paragraphs[0].alignment = WD_PARAGRAPH_ALIGNMENT.CENTER #Center

        # Randomly select 12 of 23 graphics
        
        figure=random.sample(path,Number) # Randomly select 8 pictures from 23 pictures (requires 2 times
        print(figure)
        
        # generate more than 12 lists
        figures=[]
        s1=[]

   
        # Random multiple 12 times to make a list
        
        for w in range(len(figure)):
            for i in range(2):
                y =random.randint(1,sum) # The value of the random multiple between 1-8 The number of a card
                s1.append(y) # this is a list of aggregated multiples
                # random multiplication
                for e in range(y):
                    figures.append(figure[w])
        print(s1)
        # [2, 1, 1, 2, 4, 2, 3, 1, 2, 4, 2,
        print(figures)
        '''
#['C:\Users\jg2yXRZ\OneDrive\Desktop\Fruit Gagaga\Food Map png\15 Candy.png', 'C:\Users\jg2yXRZ\OneDrive\ Desktop\Fruit Plus\Food Map png\15 Candy.png', 'C:\Users\jg2yXRZ\OneDrive\Desktop\Fruit Plus\Food
# Picture png\09apple.png', 'C:\Users\jg2yXRZ\OneDrive\Desktop\Fruit Plus Plus\Food Picture PNG\11 Cherry.png', 'C:\ Users\jg2yXRZ\OneDrive\Desktop\Fruit Gagaga\Food Map png\19 Cake.png', 'C:\Users\jg2yXRZ\OneDrive\
# Desktop\Fruit Plus Plus\Food Map png\19cake.png', 'C:\Users\jg2yXRZ\OneDrive\Desktop\Fruit Plus\Food Map png\22 Popsicle.png', 'C:\Users\jg2yXRZ\OneDrive\Desktop\Fruit Gagaga\Food Map png\22 Popsicle.png', 'C:\Users\jg2yXRZ\ OneDrive\Desktop\Fruit Plus Plus\Food Map png\22 Popsicle.png', 'C:\Users\jg2yXRZ\OneDrive\Desktop\Fruit Plus\Food Map png\ \22 Popsicle.png', 'C:\Users\jg2yXRZ\OneDrive\Desktop\Fruit Plus Plus\Food Map png\21 Bread
# .png', 'C:\Users\jg2yXRZ\OneDrive\Desktop\Fruit Plus Plus\Food Map png\21 Bread.png', 'C:\Users\jg2yXRZ\ OneDrive\Desktop\Fruit Plus Gaga\Food Map png\08 Sushi.png', 'C:\Users\jg2yXRZ\OneDrive\Desktop\Fruit Plus Plus
# \Food map png\08 sushi.png', 'C:\Users\jg2yXRZ\OneDrive\Desktop\Fruit Jia Jia Jia\Food map png\08 sushi.png', 'C :\Users\jg2yXRZ\OneDrive\Desktop\Fruit Gagaga\Food Map png\01 Burger.png', 'C:\Users\jg2yXRZ\OneDrive\Desktop\Fruit Jiajiajia\food map png\10 oranges.png', 'C:\Users\jg2yXRZ\OneDrive\desktop\Fruit Jiajiajia\food map png\10 oranges.png', 'C:\Users\jg2yXRZ\OneDrive\Desktop\Fruit Plus Plus\Food Map png\23 Fruit Plate.png', 'C:\Users\jg2yXRZ\OneDrive\Desktop \Fruit Jia Jia Jia\Food Map png\23 Fruit Plate.png', 'C:\Users\jg2yXRZ\OneDrive\Desktop\Fruit Jia Jia Jia\Food Map png\23 Fruit Disk.png', 'C:\Users\jg2yXRZ\OneDrive\Desktop\Fruit Plus\Fruit Plus
# png\23 Fruit Plate.png', 'C:\Users\jg2yXRZ\OneDrive\Desktop\Fruit Plus Plus\Food Map png\02 Hamburger Cola.png', 'C:\ \Users\jg2yXRZ\OneDrive\Desktop\Fruit Plus Plus\Food Map png\02 Burger Coke.png', 'C:\Users\jg2yXRZ\OneDrive\Desktop\Fruit Plus Jiajia\food map png\05 noodles.png', 'C:\Users\jg2yXRZ\OneDrive\Desktop\Fruit Jiajia\food map png\05 noodles.png', ' C:\Users\jg2yXRZ\OneDrive\Desktop\Fruit Gagaga\Food Map png\05 Noodles.png', 'C:\Users\jg2yXRZ\OneDrive\Desktop\ Fruit Jiajia\food map png\05 noodles.png', 'C:\Users\jg2yXRZ\OneDrive\Desktop\Fruit Jiajia\food map png\05 noodles.png' ]
'''
        
        # Cell position 3*4 cells
        bg1=[]
        for x in range(1,9): # 4 lines
            for y in range(0,3,2): # only need 1 column and 3 columns
                    ww='{}{}'.format(x,y)
                    bg1.append(ww)
        print(bg1)
        # ['00', '02', '10', '12', '20', '22', '30', '32', '40', '42', '50', '52', '60', '62', '70', '72']

        print(s1)
        # [2, 1, 1, 2, 4, 2, 3, 1, 2, 4, 2, 5]

        # Cell multiple copy (for example, 4 pictures need to be entered in the 00 grid, so 00 needs to be copied 4 times)
        bg=[]
        
        for s in range(len(bg1)):
            for v in range(int(s1[s])):
                bg.append(bg1[s])
        print(bg)
            # ['00', '00', '01', '02', '10', '10', '11', '11', '11', '11', '12', '12', '20', '20', '20', '21', '22', '22', '30', '30', '30', '30', '31', '31', '32 ', '32', '32', '32', '32']


        table = doc.tables[z] # 4567 (8) lines

        for t in range(len(bg)): # 02
            pp=int(bg[t][0:1])
            qq=int(bg[t][1:2])
            # print(p)
            k = figures[t]
            

            print(pp,qq,k)
#

            # write picture
            run=doc.tables[z].cell(pp,qq).paragraphs[0].add_run() # insert the national flag in the second cell of the first table
            run.add_picture('{}'.format(k),width=Cm(size),height=Cm(size)) # 1.5 pictures up to 6
            table.cell(pp,qq).paragraphs[0].alignment = WD_PARAGRAPH_ALIGNMENT.LEFT #Center

           
   

                
    doc.save(r'C:\Users\jg2yXRZ\OneDrive\Desktop\Fruit Plus\Zero Hour Word\{}.docx'.format(' d'%nn))
    from docx2pdf import convert

    # Save the docx file as a PDF file
    inputFile = r"C:/Users/jg2yXRZ/OneDrive/Desktop/Fruit Plus/Zero Hour Word/{}.docx".format(' d'%nn) # File to convert: already exists
    outputFile = r"C:/Users/jg2yXRZ/OneDrive/Desktop/Fruit Plus/Zero Hour Word/{}.pdf".format(' d'%nn) # File to be generated: does not exist
    # Create the non-existing file first
    f1 = open(outputFile, 'w')
    f1. close()
    # Then convert to write content in PDF
    convert(inputFile, outputFile)
    
print('----------Step 4: Merge all PDFs into one PDF for printing------------')
    
# Merge multiple PDFs (CSDN blogger "Red Little Crab", https://blog.csdn.net/yangcunbiao/article/details/125248205)
import os
from PyPDF2 import PdfFileMerger
target_path = 'C:/Users/jg2yXRZ/OneDrive/Desktop/Fruit Plus Plus/Zero Hour Word'
pdf_lst = [f for f in os.listdir(target_path) if f.endswith('.pdf')]
pdf_lst = [os.path.join(target_path, filename) for filename in pdf_lst]
pdf_lst. sort()
file_merger = PdfFileMerger()
for pdf in pdf_lst:
    print(pdf)
    file_merger.append(pdf)
file_merger.write("C:/Users/jg2yXRZ/OneDrive/Desktop/Fruit Plus Plus/Food Addition Chart {} maximum total {} food addition chart{}person {} total) (print collection).pdf" .format('d'%sum,'d'%(sum*2),num,int(num/2)))
file_merger. close()
# doc. Close()

# print('----------Step 5: Delete the temporary folder ------------')
import shut-off
shutil.rmtree('C:/Users/jg2yXRZ/OneDrive/Desktop/Fruit Plus Plus/Zero Time Word') #Delete folders recursively, ie: delete non-empty folders


Terminal operation:

Generate result:

Within 3: the maximum value of addition is 6

Within 4: the maximum value of addition is 8

Within 5: the maximum value of addition is 10

Within 10: the maximum value of addition is 20

Within 15: the maximum value of addition is 30

Less than 20: the total maximum number is 40

Insights:

Print different numbers of cards in batches to increase the difficulty and let children perceive the usage of “plus sign”.

Teaching process:

Time: May 22, 2023 8:30-8:55

Number of people:16 people

Class: Middle 6 Class

Material preparation:

Within 3 (less than 6): 28 copies

Within 5 (less than 10): 20 copies

Within 15 (less than 30): 10 copies

Choose your own difficulty

Point calculation process:

Crop swap card

Analysis:

1. Children choose learning tools with difficulty coefficients of 1, 2, and 3 according to their own level (within 6, within 10, and within 30). Number 23 chose the 2 hardest papers. Children count points and write out the total, all of which are correct.

2. After the children cut the cards, the exchange behavior is less, and it is not good enough. They are more likely to play games such as jigsaw puzzles and collecting coins with the cut out pictures.

3. The patterns on the cards are small, and children cannot color them.

4. Children explore other ways to play with the note. (lots, tabs, circles, etc.)

Description:

The number of additions in this code is to draw random numbers (random.choice), which can only ensure that the total number C of A + B does not exceed a certain number, so there may be adjacent questions in the title that are consistent (5 bananas + 1 banana, 5 burgers + 1 burger),

Therefore, it is not suitable for subtraction (the number of A must be greater than B (regardless of 0).