I know that when the carburetor heat knob is fully opened, the primary air filter is closed. But what happens to the primary filter when carburettor heat is partially open? Is the primary filter closed fully or partially?
The normal airbox path is through the air filter. Carb heat, as an alternate path, usually draws air from within the cowling and is unfiltered. The knob in the cockpit operates a baffle plate that opens one air inlet or the other within the carburetor air box.
You can stop it at an intermediate position, say half way, and the engine will be pulling half filtered cold air and half unfiltered heated air. At altitude, drawing unfiltered air is not too bad for the engine because there is little dust (silica particles) that can do (long term) damage. At low altitude however, you want to avoid extended operation on unfiltered air.
But in any case there is a bigger problem.
Using partial carb heat can be dangerous because you don't know the actual temperature of the blended air reaching the carb body. There needs to be enough heat to keep air at the throttle plate and venturi well above freezing, allowing for the huge temperature drop you get (a bit) from venturi effect itself and (mostly) from evaporative cooling of the fuel.
If the airplane came with a carburetor air temperature gauge, you could limit the amount of heat to make sure the air temperature at the sensor in the carburetor throat stays several degrees above freezing and avoid too much unfiltered air. But without a temperature gauge, there's no way to know how much heat is enough, so you just apply all or nothing, even if fully on is more heat than is technically necessary at any given time.
So, due to the fact that carb heat path introduces unfilter air (undesirable) that is heated (also undesirable because it reduces performance and makes the air/fuel mixture richer), and may or may not be keeping the air going through the carb warm enough to prevent icing, use of partial heat is a bad idea all around, and can be quite dangerous unless you have a Carburetor Air Temperature gauge. So stick with fully on, and fully off. The worst time for carb icing is during descents with the throttle closed or nearly closed, so be liberal with carb heat during descents.
Fuel injected engines don't have carburetor icing issues and don't have to use an air heater, but they do need to provide a secondary air path for the engine just for safety, mostly for the case where the air filter ices over in icing conditions or heavy snow. These engines have an Alternate Air control, which operates a baffle plate in the inlet airbox similar to carb heat, but the air is unheated and is only for when the main inlet is blocked for some reason. Alternate air is, like carb heat, unfiltered air drawn from within the cowling, just not heated.
Well in general, the carburetor heat knob is just opening and closing a door that controls whether the air comes in through a duct that leads to the air filter, or comes from another source that is unfiltered, but warmed by the exhaust manifold. If the carburetor heat knob is in an intermediate position, the door is part way open and you'll get air from both sources. Some of the intake air will be passing through the air filter, and some won't be.