How to calculate valence factor (n-factor) for a element?
Hint :  

n-factor of a molecule/compound is defined as the change in oxidation state per molecule.
You have correctly calculated the change of one carbon atom as 4.
But how many carbon atoms are there in the glucose molecule?  

Note:  


The average oxidation state of carbon in glucose is zero while in reality the different carbons have different OS. (Reference)  
n-factor of a reaction is not defined but it is defined for a single species participating in that reaction.   
n-factor of glucose is not equal to the n-factor of the product formed in that reaction, that is, $\ce{CO_2}$.