module SharedDatabase;

	operation RemoveQuestionFromDB is
		inputs: q:Question, qdb:QuestionDataBase;
		outputs: qdb':QuestionDataBase;
		preconditions: (* None *);
		postconditions: (* If the question is in the database it is  removed. *);
		(forall (q:Question)
			(q in qdb') iff (q in qdb)
				or
			(q' in qdb'));
description: (* Remove the specific question from the database if it is found in the database. *);
	end RemoveQuestionFromDB;
	
	operation EditQuestionInDB is
		inputs: q:Question, qdb:QuestionDataBase;
		outputs: q':Question, qdb':QuestionDataBase;
		preconditions: (* None *);
		postconditions: (* The question will contain the changes made by the user *);
		description: (* The user will change a specific question *);
	end EditQuestionInDB;

	operation ImportHTML is
		inputs: q:Question
		outputs: q':Question
		preconditions: (* None *);
		postconditions: (* The question contains the HTML added by the user *);
		description: (* HTML is added to a question *);
	end ImportHTML;

	operation ImportHTMLWithImage is
		inputs: q:Question, i:Image;
		outputs: q':Question;
		preconditions: (* The image to be imported with the HTML is in the designated images folder *);
		postconditions: (* The HTML and the image in the image tag is added to the question *);
		description: (* HTML with a(n) image tag(s) is added to the question along with the image in the tag *);
	end ImportHTMLWithImage;

	operation ImportIDE is
		inputs: q:Question, ide:IDE;
		outputs: q':Question
		preconditions: (* None *);
		postconditions: (* The question contains the use of the IDE added by the user *);
		description: (* The ability to use an IDE is added to a question *);
	end ImportIDE;