/* ======================================================================
   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.Hashtable;
import java.io.IOException;
import java.io.OutputStream;
import java.sql.Timestamp;

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

public interface McqPaperSession extends BuildingSession 
	{
	public McqPaper getMcqPaper() throws BuildingServerException;
	
	public void setOnceOnly( boolean b ) throws BuildingServerException;
	
	public void setMarkWitheld( boolean b ) throws BuildingServerException;

	public void setDeadline( Timestamp t ) throws BuildingServerException;
	
	public Vector getMcqQuestionIds() throws BuildingServerException;
	
	public Hashtable getMcqQuestions() throws BuildingServerException;
	
	public Vector getMcqQuestionsInOrder() throws BuildingServerException;
	
	public Hashtable getStrings() throws BuildingServerException;

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

	public McqResult record( PrimaryKey[] mcq_question_ids, int[][] responses ) throws BuildingServerException;
	
	public McqResult getMcqResult( PrimaryKey rid ) throws BuildingServerException;

	public Hashtable getMcqResponses( PrimaryKey rid ) throws BuildingServerException;

	public Vector getResultsOfUser() throws BuildingServerException;

	public Hashtable getMcqUsers() throws BuildingServerException;
	
	// returns enumeration of results found and if analysis is non null it is filled in with
	// statistical analysis.
	public Vector analyse( String where_clause, boolean first_attempt, Vector users, Vector alt_marks, McqAnalysis analysis ) throws BuildingServerException;
	
	public void exportXML( OutputStream stream ) throws BuildingServerException, IOException;
	public void importXMLQuestions( String file_name ) throws BuildingServerException;
	}
	
