5.2. TestGroup (TestGroup.sl)

 

(*
 * This is a specL for the AbstractTest class in our UML diagram 
 *)

module TestGroup;

  object QuestionDatabase
	  components: questions*;
    description: (* The complete Database of questions available for use *);
  end;

	object TestDatabase
	  components: test*;
    description: (* All available tests, either graded or answered or saved tests *);
  end;

	object questions = questions;

  object timeLimit = integer;
  object grade = integer;

  object test
    components: questions*;
    operations: editTest, practiceTest;
    description: (* A test that is a list of questions and is contained by AbstractTest *);
  end test;

  object AbstractTest
    components: test*, timeLimit, grade;
    operations: (* NONE *);
    description: (* An abstract lists of tests of all the differant kinds of tests *);
  end AbstractTest;

  object AnsweredTest
    components: questions*;
    operations: autoGrade, submit;
    description: (* The students have inputed their data, what the proctor collects*);
  end AnsweredTest;

  object GradedTest
    components: questions*;
    operations: getScore;
    description: (* The graded test by the teacher *);
  end GradedTest;


  operation editTest
    inputs: at:AnsweredTest, td:TestDatabase;
    outputs: td':TestDatabase;
    precondition: at in td;
    postcondition: at in td';
    description: (* edit an answered test *);	
  end editTest;

  operation practiceTest
    inputs: at:AnsweredTest, td:TestDatabase;
    outputs: td':TestDatabase;
    precondition: at in td;
    postcondition: at in td';
    description: (* practice for an upcoming test *);
  end practiceTest;

  operation autoGrade
    inputs: at:AnsweredTest, td:TestDatabase;
    outputs: td':TestDatabase;
    precondition: at in td;
		postcondition: at in td';
    description: (* automatically grades the test for a mock score 
                     still awaits for the teacher to finalize the grade*);
  end autoGrade;

  operation submit
    inputs: gt:GradedTest, td:TestDatabase;
    outputs: td':TestDatabase;
    precondition: gt in td;
    postcondition: gt in td';
    description: (* used for the teacher to submit the graded test for the student to see *);
  end submit;

  operation getGradedTestScore
    inputs: GradedTest;
    outputs: grade;
    description: (* reports the grade of a graded test *);
  end getGradedTestScore;

end TestGroup;






Prev: Questions.sl | Next: Users.sl | Up: spec | Top: index