object TestTakingWorkspace is
	components: name, proctor, class, Problem, AnsweredTest, Testtype;
	operations: Goto;
	description:
		(* A TestWorkspace is an object containing all of the 
		 * test-taking content for a student*);
end;

object name= string
	description:(*name of student*);
end;

object proctor=string
	description:(*name of proctor*);
end;

object class=string
	description:(*name of class*);
end;

object AnsweredQuestion extends TestQuestion
	components: a:Answer;
	operations: Comment, OpenIDE, Answered;
	description: 
		(* This is the Questions that makes up the Test
		 * it contains Student comments and the answers 
		 * the student selects*);
end;

operation OpenIDE
	inputs: ide:IDE, la:LongAnswer, a:Actual;
	outputs: ;
	precondition: 
		(*IDE selected and there is a longanswer*)
		(ide != nil) and
		(a!=nil) and
		(la != nil);
	postcondition:
		(*External Source IDE Loaded*);
	description:
		(* This operation opens up a pre-selected IDE
		 * for coding questions*);
end;

operation Goto
	inputs: t:Test, p:Problem;
	outputs: p':Problem;
	precondition: 
		(*theres a problem to goto*);
	postcondition: 
		(*goto problem*)
		p!=nil and
		p=p';
	description:
		(*This jumps to the given question*);
end;

operation Comment
	inputs: a:Actual;
	outputs: c:comms;
	precondition: 
		(*The test must be an actual not practice test*)
		a!=nil;
	postcondition: 
		(*comments not null*)
		c!=nil; 
	description:
		(* This allows the student to comment on a question*);
end;

object comms=string
	description:(*Comment or page reason*);
end;

object Problem extends TestQuestion
	components: qname, Summary, Actualquestion;
	description:
		(* This is the test problem that will extend from
		 * testquestion(same one used everywhere) and have 
		 * components that make up the visual portion of the
		 * test*);
end;

object qname= string
	description:(*name of question*);
end;

object Summary is
	components: Status, time, qnumber;
	description:
		(* This the saved description of the questions used
	 	* in the visual test*);
end;

object time= number
	description:(*time of question*);
end;

object qnumber= number
	description:(*question number*);
end;

object Actualquestion is
	components: qt:QuestionTimer, opp:OnePerPage;
	description:
		(*This is another description of the test questions
		 * used for visual purposes*);
end;

object Testtype is
	components: a:Actual, p:Practice;
	description:
		(*This is the type of test given, practice, proctored
		 * or takehome*);
end;

object Actual is
	components: Proctored, Takehome;
	operations: Submit;
	description:
		(* Type of actual test, inclass or takehome*);
end;

operation Submit
	inputs: a:Actual, at:AnsweredTest, tr:timeRemaining;
	outputs: at':AnsweredTest;
	precondition: 
		(*there is an answered test and timer*)
		(a!=nil) and
		(at!=nil) and 
		(tr>=0);
	postcondition:
		(*Test is all answered*)
		at=at';
	description: 
		(* Saves test and uploads to proctor*);
end;

object Takehome= boolean
	description:(*boolean if test is takehome or not*);
end;

object Proctored is
	components: ;
	operations: pageproctor;
	description: 
		(*This is an inclass test and has a page proctor oper*);
end;

operation pageproctor
	inputs: pt:Proctored;
	outputs: pw:pagew;
	precondition: 
		(*has to be a proctored test*)
		pt!=nil;
	postcondition:
		(*brings up the window*)
		pw!=nil;
	description:
		(*opens a pagewindow*);
end;

object pagew is
	components: (*none*);
	operations: page;
	description:
		(*this submits the page*);
end;

operation page
	inputs: pw:pagew, c:comms;
	outputs: ;
	precondition:
		(*comment not null*)
		pw!=nil and
		c!=nil;
	postcondition:
		(*none*);
	description:
		(*pages*);
end;

object Practice is
	components: (*none*);
	operations: Settimer;
	description:
		(*This is the basic practice test object*);
end;

object amount = number
	description:(*amount to set timer to*);
end;

operation Settimer
	inputs: a:amount;
	outputs: tt:TestTimer;
	precondition: 
		(*amount exists*)
		a!=nil;
	postcondition:
		(* sets the timer*)
		(tt!=nil) and
		(tt.tr = a);
	description:
		(* Allows user to time themselves*);
end;