object User is components: Name and Password; description: (*A user that student can extend*); end; object Name = string description: (*Name of user*); end; object Password = string description: (*user password*); end; object Student extends User components: Timer and Alert and Status and QuestionDisplay and IDE and Test*; description: (*A student extends user and adds the elements found in the setting screen*); end; object Alert = number description:(*number of minutes for the alert timer*); end; object IDE = string description: (*path to the ide*); end; object Timer is components: timeRemaining and isDisplayed; description: (*boolean is for is it displayed or not, number is length of time*); end; object AnsweredTest extends Test components: a: AnsweredQuestion*; description: (*An answered test contained zero or more answered questions*); end; object timeRemaining = number description: (*time remaining *); end; object isDisplayed = boolean description: (*is it desplayed?*); end; object isTTDisplayed = boolean description: (*is the test timer displayed?*); end; object isQTDisplayed = boolean description: (*is the question timer displayed*); end; object TestTimer extends Timer components: tr: timeRemaining and id: isTTDisplayed; description: (*TestTimer is the timer for the whole test*); end; object QuestionTimer extends Timer components: tr: timeRemaining and id: isQTDisplayed; description: (*QuestionTimer is the timer for individual questions*); end; object Status is components: sd: StandardColor; description: (*colors for question status's*); end; object StandardColor components: Black or Brown or Red or Orange or Yellow or Green or Blue or Purple; description: (*a StandardColor is one of a fixed set of possibilities.*); end StandardColor; object Black = integer description: (*a color choice for status*); end; object Brown = integer description: (*a color choice for status*); end; object Red = integer description: (*a color choice for status*); end; object Orange = integer description: (*a color choice for status*); end; object Yellow = integer description: (*a color choice for status*); end; object Green = integer description: (*a color choice for status*); end; object Blue = integer description: (*a color choice for status*); end; object Purple = integer description: (*a color choice for status*); end; object Complete extends Status description: (*Color of a completed question*); end; object Incomplete extends Status description: (*Color of a completed question*); end; object Revisit extends Status description: (*Color of a completed question*); end; object QuestionDisplay is components: Method; description: (*The way questions are being diplayed on the test*); end; object Method is components: OnePerPage; description: (*The way questions are displayed on the test, if true, one question is displayed per page if false then scrolling style is used*); end; object OnePerPage = boolean description: (*is this going to be one per page or scrolling*); end; operation AnswerQuestion inputs: tq:TestQuestion and a:Answer and qb:QuestionBlock and at: AnsweredTest; outputs: aq:AnsweredQuestion; precondition: (* There exists at least one TestQuestion and answer is not null *) (tq != nil) and (a != nil); postcondition: (*answered question created and testquestion removed*) (aq in at.a) and not(tq in qb.questions); description: (*A student takes a test question, and answers it*); end; operation AnswerTest inputs: at: AnsweredTest and aq: AnsweredQuestion and qb: QuestionBlock; outputs: at': AnsweredTest; precondition: (*There exists one or more Answered questions*) (aq != nil); postcondition: (*There are no test questions, all questions are of answered type*) (aq in at'.a) and not(qb != nil); description: (*A student takes a test, and answers questions on it*); end; operation ToggleQDisplay inputs: onePP: OnePerPage; outputs: onePP': OnePerPage; precondition: (*none*); postcondition: (*toggles between one per page and scrolling by changing boolean value*) onePP' = not onePP; description: (*switches the boolean value*); end; operation ToggleComplete inputs: stdC: StandardColor and stdC2: StandardColor and stdC3: StandardColor; outputs: stdC': StandardColor; precondition: (*Dont allow same colors for different status*) stdC != stdC2 and stdC != stdC3; postcondition: (*user chooses a new color*) stdC' = stdC; description: (*chooses a new color for complete status*); end; operation ToggleInComplete inputs: stdC: StandardColor and stdC2: StandardColor and stdC3: StandardColor; outputs: stdC2': StandardColor; precondition: (*Dont allow same colors for different status*) stdC2 != stdC and stdC2 != stdC3; postcondition: (*user chooses a new color*) stdC2' = stdC2; description: (*chooses a new color for incomplete status*); end; operation ToggleRevisit inputs: stdC: StandardColor and stdC2: StandardColor and stdC3: StandardColor; outputs: stdC3': StandardColor; precondition: (*Dont allow same colors for different status*) stdC3 != stdC and stdC3 != stdC2; postcondition: (*user chooses a new color*) stdC3' = stdC3; description: (*chooses a new color for revisit status*); end; operation ToggleTestTimer inputs: tt: TestTimer; outputs: tt': TestTimer; precondition: (*none*); postcondition: (*toggles visibility of timer*) tt'.id = not tt.id; description: (*changes the display boolean*); end; operation ToggleQuestionTimer inputs: qt: QuestionTimer; outputs: qt': QuestionTimer; precondition: (*none*); postcondition: (*toggles visibility of timer*) qt'.id = not qt.id; description: (*changes the display boolean*); end;