otsApp.controller('idleController', function($scope, $http)
	{
	$scope.idle_reason="connecting...";
	
    $http.get('/controller/problems')
    .success(function(data)
        {
    	$scope.message = "No test started. Yet. ";
    	
    	if( typeof data['last-completed-timestamp'] === "number" )
            $scope.message = "Last test completed at " + new Date(data['last-completed-timestamp']) + ". ";
    	
    	if( typeof data['number-of-problems'] === "number" )
            $scope.message += "There were " + data['number-of-problems'] + " execution problem(s). ";
    	
    	if( typeof data['termination-reason'] === "string" )
            $scope.message += "Test stopped because: " + data['termination-reason'];
        });
	});