/* ======================================================================
   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.math.BigDecimal;
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 TextQSession extends BuildingSession 
	{
	public TextQPaper getTextQPaper() throws BuildingServerException;
	
	public void setMaximumMark( int m ) throws BuildingServerException;
	
	public void setGeneralAssessment( int available, BigDecimal weight, String notes ) throws BuildingServerException;
	
	public void setDates( Timestamp open, Timestamp deadline, Timestamp penalty ) throws BuildingServerException;
	
	public Vector getTextQuestionIds() throws BuildingServerException;
	
	public Hashtable getTextQuestions() throws BuildingServerException;
	
	public Vector getTextQuestionsInOrder() throws BuildingServerException;
	
	public Hashtable getStrings() throws BuildingServerException;

	public TextQuestion createQuestion() throws BuildingServerException;
	
	public void removeQuestion( PrimaryKey id ) throws BuildingServerException;
	
	public void changeQuestion( PrimaryKey id, TextQuestion model ) throws BuildingServerException;
	
	public void changeQuestionText( PrimaryKey qid, PrimaryKey tid, String new_text ) throws BuildingServerException;
	
	public boolean canSubmit() throws BuildingServerException;
	public boolean canSubmit( PrimaryKey user_id ) throws BuildingServerException;
	public boolean canSeeMark() throws BuildingServerException;
	public boolean canSeeMark( PrimaryKey user_id ) throws BuildingServerException;
	public String denySubmitMessage() throws BuildingServerException;
	public String denySubmitMessage( PrimaryKey user_id ) throws BuildingServerException;

	public TextQResult record( PrimaryKey[] questionnaire_question_ids, String[] responses ) throws BuildingServerException;
	public TextQResult recordStatus( PrimaryKey entry_id, int status ) throws BuildingServerException;
	public TextQResult recordMarks( PrimaryKey entry_id, PrimaryKey[] text_question_ids, int[] marks, String[] feedback, String general_feedback, String comments ) throws BuildingServerException;
	public TextQResult recordAdjustedMark( PrimaryKey entry_id, int adjusted_mark, String general_feedback, String comments ) throws BuildingServerException;
	
	public TextQResult getTextQResult() throws BuildingServerException;
	public TextQResult getTextQResult( PrimaryKey rid ) throws BuildingServerException;
	public Hashtable getTextQResults() throws BuildingServerException;
	public Vector getTextQUsers() throws BuildingServerException;


	public Hashtable getTextQResponses( 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, TextQAnalysis analysis ) throws BuildingServerException;
	
	}
	
