5.4. question.fmsl

(****
 * This is the model for the question database (question manager).
 *)

module QuestionManagement;

	import Filtering.Filter;
	import Questions.Question;
	 import TestGeneration.TestQuestion;

--	export Database;

	object QuestionList
		components: QuestionList;
		description: (*
			A list of questions.
		*);
	end QuestionsList;

	operation SortBy
		inputs: Category;
		outputs: SortedQuestionList;
		description: (*
			When the user selects a catagory at the head of 
			a column, the list becomes sorted by that category.
		*);
	end SortBy;
	
	operation addQuestion
		inputs: Database, Question;
		outputs: Database;
		description: (*
			Takes a question and adds it to the QuestionList
			(question database).
		*);

	(*** note:
		Add filter is done in two ways.  The filters pallet allows users to
		drag-and-drop filters on to this database.  In the database users also
		add filters by clicking the add button and typing a filter in manually.
		*)

	end addQuestion;	

	operation addFilter
		inputs: Filter;
		outputs: FilteredQuestionList;
		description: (*
			This takes a filter object passed from the filter panel and
			applies it to the QuestionList (question database).
		*);
	end addFilter;

	operation addFilter
		inputs: FilterName, FilterKey;
		outputs: FilteredQuestionList, Filter;
		description: (*
			This operation takes place when the user applies a tag to the 
			database by manually typing in a filter.  The function takes a
			pair of strings (like tags) and returns a filtered quesiton list
			and the filter that was just created.
		*);
	
	(*** note:
		Other operations to this screen are done by pallets which have their own
		models.
		*) 
	end addFilter;

(*	object Category
	end Category;

	object SortedQuestionList
	end SortedQuestionList;

	object Database
		components:	questions:TestQuestion*;
	end Database;

	object FilteredQuestionList
	end FilteredQuestionList;

	object FilterName
	end FilterName;

	object FilterKey
	end FilterKey;*)

end QuestionManagement;




(*****
 * This is a Question data structure
 *)
module Questions;

	import Courses.Course;

	export Question, Answer;

	object Answer
	end Answer;

	object Characteristics
		components: type:integer, difficulty:integer, time:integer, 
			    course:Course, professor: Professor;
		description: (*
			type - question type.
			difficulty - numerical descriptor of difficulty
			time - data structure (ubound, lbound, etc.) to
				store time characteristics
			course - course(s) this question applies to - list ds
			professor - professor who generated this question
		*);
	end Characteristics;

	object Tags
		components: TagList;
		description: (*
			a linked structure of tags which are 2 field data structures.
		*);
	end Tags;

	object Prompt 
		components: Text, PromptType;
		description: (*
			This is the portion that depends on question type.
			This is the actual question data, like the question text,
			answer choices, etc.
		*);
	end Data;

object PromptType
	description: (*Parent for various prompt types*);

end Object;

object MC_Prompt extends PromptType
	components: choices*, correctAnswer;
	description: (*Multiple chocie*);
end MC_Prompt;

	object correctAnswerMC
		components: choice:Integer;
		description: (* points to correct answer choice *);
	end correctAnswerMC;

object SA_Prompt extends PromptType
	components: correctAnswer;
	description: (*Short answer*);
end SA_Prompt;

	object correctAnswersa
		components: expected:String;
		description: (* keywords for expected answer *);
	end correctAnswerSA;


object MA_Prompt extends PromptType
	components: lchoices*, rchocies*, correctAnswer;
	description: (*Matching *);
end MA_Prompt;

	object correctAnswerMA
		components: associationsMap: integer and integer;
		description: (*association for left and right choices*)i;
	end correctAnswerMA;

object CO_Prompt extends PromptType
	components: exCode, correctAnswer;
	description: (*Code*);
end CO_Prompt;

	object correctAnswerCO
		components: script:String;
		description: (*file for test script*);
	end correctAnswerCO;


end Questions;

 


Prev: filtering.fmsl | Next: testgeneration.fmsl | Up: specification | Top: index