Here is the solution based on the RANOMIZE-IN-PLACE procedure in the CLRS. The procedure is defined as
n = A.length
for i=1 to n
swap A[i] with A[random(i,n)]
(CLRS does not like end for, so we do not use it either).
TeX code uses random.tex by Donald Arseneau (should be in your distribution). This code puts in 10 macros \csname num0\endcsname, \csname num1\endcsname, ... some random permutation of numbers 0..9 (I used macros instead of counters to save the latter). You can use this code to write something like \expandafter\input{file\csname num0\endcsname}, \expandafter\input{file\csname num1\endcsname} etc.
\documentclass{article}
\input{random}
\begin{document}
\newcount\number
\newcount\randomnum
% Put 0..9 into \num0..\num9
\number=0
\loop\ifnum\the\number<10\relax
\expandafter\edef\csname num\the\number\endcsname{\the\number}
\advance\number by 1
\repeat
% Randomize
\number=0
\loop\ifnum\the\number<10\relax
\setrannum{\randomnum}{\the\number}{9} % Random number between \number and 9
\edef\tmpnum{\csname num\the\number\endcsname}
\expandafter\edef\csname num\the\number\endcsname{\csname
num\the\randomnum\endcsname}
\expandafter\edef\csname num\the\randomnum\endcsname{\tmpnum}
\advance\number by 1
\repeat
% Print the results:
\number=0
\loop\ifnum\the\number<10\relax
Macro \textbackslash num\the\number\space contains \expandafter\csname
num\the\number\endcsname
\advance\number by 1\relax\par
\repeat
% To input in random order files file0.tex, file1.tex, file2.tex,...
% use instead
% \number=0
% \loop\ifnum\the\number<10\relax
% \expandafter\input{file\csname num\the\number\endcsname}
% \advance\number by 1\relax
% \repeat
\end{document}
See random.tex documentation about seeding the generator.
Output example:
Macro \num0 contains 7
Macro \num1 contains 1
Macro \num2 contains 9
Macro \num3 contains 3
Macro \num4 contains 6
Macro \num5 contains 8
Macro \num6 contains 2
Macro \num7 contains 5
Macro \num8 contains 4
Macro \num9 contains 0
examdesignwould mean to rewrite them. – digital-Ink Jan 11 '12 at 22:24