Brick,
<!DOCTYPE html>
<html>
<head>
<title>Untitled</title>
<meta charset="utf-8">
</head>
<body>
<ol>
<li></li>
<li></li>
<li></li>
<li></li>
</ol>
<script>
function fn(c) {
var a = c.slice(0);
return function() {
var b = Math.floor(Math.random() * a.length);
b = a.splice(b, 1)[0];
a.length || (a = c.slice(0));
return b
}
};
var arr = [1,1,1,2,2,2,3,3,3,4];
var rnd = fn(arr);
//тестирование
var li = document.querySelectorAll("li");
for (var i = 0; i < 10; i++) {
var q = rnd();
li[q - 1].innerHTML += q
document.write(i + '=>' + q + '<br>')
}
</script>
</body>
</html>