# Friedman test when subjects are not a random sample from a population/ when subjects are dependent

Imagine that you measure all $n$ people from a school class in $k$ $\geq2$ different treatment conditions. My goal is to find out whether the there is a systematic difference in Ranks (i.e. the $H_0$ from the Friedman Test) for the population that consists solely out of this class. For my question it is important that the sample is not an iid sample from a population.

My question is whether it still makes sense to apply the friedman rank-test. My argument against is that I already know every subject from the population that I am interested in, so there is no randomness from sampling.
On the other hand there is still some randomness if we consider the response of each subject to the $k$ treatments as a random variable.

So I would say that the test still makes sense in the sense of establishing internal validity. Do you agree?

My second question is what happens when the $n$ pupils are dependent. I have read in "Nonparametric Statistiacl Methods" by Hollander, Wolfe & Chicken (at lest I understand it that way), that in this case we could still test the Nullhypothesis, that all the possible $(k!)^n$ Rank-Outcomes are equally likely. Is this correct?