(* * 2.4 Editing (editing.rsl) * Editing Module defines the Objects and Operations related to * Test Editing in the Test Tool System. *) module Editing; from QuestionDatabase import Question; export NewTest; object Question is components: Class and Keyword and Format and Duration and Difficulty and Last Used and Owner and Points; description: (* The question as it exists in a question bank and * also the base class for the different question objects. *); end Question; object Class is string description: (* * The specific course that a question is primarily used in. *); end Class; object Keywords is string* description: (* * A list of zero or more words and/or phrases that describe a question. *); end Keywords; object Difficulty is integer description: (* * Number from 1 to 10 (inclusive) that indicates the difficulty of a question. 1 is low * and 10 is high. *); end Difficulty; object Format is sting description: (* * One of the seven types of questions available in the Test Tool Suite. *); end Format; object Duration is components: quantity:Quantity and increments:Increments; description: (* * The time it takes (on average) to complete a question. ('Quantity' number of * 'Increments' increments. *); end Duration; object Quantity is integer description: (* * A quantative amount. *); end Quantity; object Increments is components: sec:Seconds or min:Minutes or hours:Hours; description: (* * Represents a measurement of time. *); end Increments; object Seconds is description: (* * Unit of time. *); end Seconds; object Minutes is description: (* * Unit of time (equivalent to 60 Seconds). *); end Minutes; object Hours is description: (* *Unit of time (equivalent to 60 Minutes or 3,600 Seconds). *); end Hours; object DateLastUsed is components: date:Date; description: (* * The date a question was last used in a test. *); end DateLastUsed; object Date is components: day:Day and month:Month and year:Year and hour:Hour and minute:Minute; description: (* * A specific day and time. *); end Date; object Day is integer description: (* * The n-th day of a month. (1 though 31) *); end Day ; object Month is integer description: (* * The n-th month of a year. (1 = January and 12 = December) *); end Month ; object Year is integer description: (* *A specific year 2004 or later. (No object could have been made or used before the Test *Tool was created). *); end Year ; object User is string description: (* * The username of a valid user. *); end User; object PointsPossible is integer description: (* * The number of points possible in a question. *); end PointsPossible; operation AddQuestion is inputs: Question; outputs: Test'; precondition: (* Question Database exists and Question exists. (Question Database != nil) and (Question != nil) and Addition Method must be set to either Manual or Automatic (Addition Method = Manual) || (Addition Method = Automatic) *); postcondition: (* The question is added to the current test and the Last Used Date on the Question in the Question Database is changed to the current date. *); end AddQuestion; operation RemoveSelected is inputs: Question; outputs: Test'; precondition: (* A Question must be selected in the Test Editor window. *) (Question != nil); postcondition: (* An updated Test with the selected question removed. *); end Remove; operation ReplaceSelected is inputs: q:Question; outputs: t':Test'; precondition: ; end Replace; operation EditSelected is inputs: q:Question; outputs: t':Test'; precondition: (* A Question must be selected in the Edit Questions Window *) (Question != nil); postcondition: (* q must have it's Owner changed to the current user if it is not already the case. *); end EditSelected; operation GeneratreSummary is inputs: q:Question*; outputs: sum:Summary; precondition: (* Must have one or more questions present in Edit Window *) (q != nil); postcondition: ; end GenerateSummary; operation PublishTest inputs: q:Question*; outputs: pub:PublishedTest; precondition: (* One or more Questions must be selected from the Question Database *) (q != nil); postcondition: (* A Published Test must be created with the current user as owner *); end PublishTest; end Editing;