/* ======================================================================
   Parts Copyright 2006 University of Leeds, Oxford University, University of the Highlands and Islands.

   Licensed under the Apache License, Version 2.0 (the "License");
   you may not use this file except in compliance with the License.
   You may obtain a copy of the License at

       http://www.apache.org/licenses/LICENSE-2.0

   Unless required by applicable law or agreed to in writing, software
   distributed under the License is distributed on an "AS IS" BASIS,
   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   See the License for the specific language governing permissions and
   limitations under the License.

====================================================================== */

package org.bodington.assessment;

import java.util.Vector;
import java.util.Enumeration;
import java.util.Hashtable;
import java.sql.Timestamp;

import org.bodington.database.PrimaryKey;
import org.bodington.server.*;

public interface PigeonHoleSession extends BuildingSession 
	{
	public PigeonHole getPigeonHole() throws BuildingServerException;
	
	public void setMaximumMark( int m ) throws BuildingServerException;
	
	public void setDates( Timestamp open, Timestamp deadline, Timestamp penalty )
		throws BuildingServerException;
	
	public Vector getPigeonHoleQuestionIds() throws BuildingServerException;
	
	public Hashtable getPigeonHoleQuestions() throws BuildingServerException;
	
	public Vector getPigeonHoleQuestionsInOrder() throws BuildingServerException;

	public Hashtable getStrings() throws BuildingServerException;

	public PigeonHoleQuestion createQuestion() throws BuildingServerException;
	
	public void removeQuestion( PrimaryKey id ) throws BuildingServerException;
	
	public void changeQuestion( PrimaryKey id, PigeonHoleQuestion model ) throws BuildingServerException;
	
	public void changeQuestionText( PrimaryKey qid, PrimaryKey tid, String new_text ) throws BuildingServerException;
	

	public boolean canUpload() throws BuildingServerException;
	public boolean canUpload( PrimaryKey user_id ) throws BuildingServerException;
	public boolean canSeeMark() throws BuildingServerException;
	public boolean canSeeMark( PrimaryKey user_id ) throws BuildingServerException;
	public String denyUploadMessage() throws BuildingServerException;
	public String denyUploadMessage( PrimaryKey user_id ) throws BuildingServerException;

	public PigeonHoleEntry transferFileForAssessment( String current_pathname, String file_name, String mime_type )
		throws BuildingServerException;

	public PigeonHoleEntry recordStatus( PrimaryKey entry_id, int status ) throws BuildingServerException;
	public PigeonHoleEntry recordMarks( PrimaryKey entry_id, PrimaryKey[] pigeonhole_question_ids, int[] marks, String feedback, String comments ) throws BuildingServerException;
	public PigeonHoleEntry recordAdjustedMark( PrimaryKey entry_id, int adjusted_mark, String feedback, String comments ) throws BuildingServerException;

	
	public PigeonHoleEntry getPigeonHoleEntry() throws BuildingServerException;
	public PigeonHoleEntry getPigeonHoleEntry( PrimaryKey uid ) throws BuildingServerException;
	public Hashtable getPigeonHoleEntries() throws BuildingServerException;
	public Vector getPigeonHoleUsers() throws BuildingServerException;


	public Hashtable getPigeonHoleResponses( PrimaryKey entryid ) throws BuildingServerException;
	
	// returns enumeration of results found and if analysis is non null it is filled in with
	// statistical analysis.
	public Enumeration analyse( String where_clause, PigeonHoleAnalysis analysis );
	
	}
	
