You only set flour in this equation, but not the relationship between flour and rice in the problem. This must be deducted!
How many bags of flour and rice are there? You only solved one of them (whether you calculated correctly or not), and this must be deducted.
The following is the correct solution
Solution: Let 1/4 flour = 1/2 rice = X.
Flour equals 4x and rice equals 2x.
(Flour and rice, * * * has 30 bags), then 2x+4x = 30.
6x=30
x=5
Flour equals 4x5=20.
Rice is equal to 2x5 = 10.