(* * * Module AdvancedTest defines the objects and operations related to using the * AdvancedTest Wizard to generate a test. * *) module AdvancedTest; from QuestionBank import all; export all; object Step1Criteria is components: TestTitle and ClassName and TestType and NumQuestions and Duration; description: (* AdvancedTest Wizard allows the user to quickly create a test with limited criteria including a TestTitle, ClassName, NumQuestions, and Duration. *); end Step1Criteria; object TestTitle is string description: (* The name of the Test that is being created *); end TestTitle; object ClassName is string description: (* Name of the class the test is being created for. *); end ClassName; object TestType is integer description: (* Standard or Incremental type of test specification. Standard will create typical test, while Incremental produces a dynamically changing test. *); end TestType; object NumQuestions is integer description: (* Numeric total of amount of question *); end NumQuestions; object Duration is integer description: (* Integer that specifies the time limit for the test being created. *); end Duration; object Step2Criteria is components: keywords:Keywords and testdifficulty:TestDifficulty and author:Author and lastused:LastUsed and date:Date; description: (* AdvancedTestStep 2 specifies more details about the test, including keywords, overall difficulty, author, etc... *); end Step2Criteria; object Keywords is string description: (* Subject list separated by commas of the topics of questions to be drawn from. *); end Keywords; object TestDifficulty is integer description: (* Integer from 1-10 of difficulty. *); end TestDifficulty; object Author is string description: (* Author Name of the person who is creating the test. *); end Author; object LastUsed is boolean description: (* Either before or after the object specified in Date. Is used to draw questions from date range. *); end LastUsed; object Date is string description: (* *); end Date; object Step3Criteria is components: Question and TFdiff and MCdiff and ShortAnswerdiff and FillIndiff and matchingdiff and Codediff; description: (* AdvancedTestStep 3 assigns the questions to the test and has the options to assign different difficulties to each question type. *); end Step3Criteria; object TF is integer description: (* amount of TF questions. *); end TF; object MC is integer description: (* amount of MC questions. *); end MC; object ShortAnswer is integer description: (* amount of Short answer questions. *); end ShortAnswer; object FillIn is integer description: (* amount of FillIn the blank questions. *); end FillIn; object matching is integer description: (* amount of matching questions. *); end matching; object Code is integer description: (* amount of code questions. *); end code; object TFdiff is integer description: (* integer 1-10 of difficulty of question type. *); end TFdiff; object MCdiff is integer description: (* integer 1-10 of difficulty of question type. *); end MCdiff; object ShortAnswerdiff is integer description: (* integer 1-10 of difficulty of question type. *); end ShortAnswerdiff; object FillIndiff is integer description: (* integer 1-10 of difficulty of question type. *); end FillIndiff; object matchingdiff is integer description: (* integer 1-10 of difficulty of question type. *); end matchingdiff; object Codediff is integer description: (* integer 1-10 of difficulty of question type. *); end Codediff; operation DifficultyFill is inputs: TestDifficulty; outputs: TFdiff, MCdiff, ShortAnswerdiff, FillIndiff, matchingdiff, Codediff; precondition: ; postcondition: ; end DifficultyFill; object RawTest is components: question:Question* and testtitle:TestTitle and classname:ClassName and testtype:TestType and duration:Duration and author:Author; description: (* The RawTest is the result of the inputs of the 3 steps of the TestTool. The RawTest is a collection of question that meet the criteria of these 3 steps. *); end RawTest; operation GenerateTest is inputs: s1:Step1Criteria, s2:Step2Criteria, s3:Step3Criteria; outputs: t:RawTest; precondition: (* * keywords field is present *) s2.keywords != nil and (* * author field is present *) s2.author != nil and (* * difficulty is within the correct range *) (s2.testdifficulty<10 and s2.testdifficulty>1); postcondition: (* * for all questions in the test there must exist a * common keyword and difficulty from the Step2 Criteria * I commented out my rsl code because I was getting syntax * errors in my exists statement. *) (*forall(question in t)*) (* exists*) (*(QuestionKeywords)QuestionKeywords in s2.keywords and*) (*(questionDifficulty = s2.testdifficulty*) ; end GenerateTest; end AdvancedTest;