(* RSL file for modeling the View Student Feedback window of the * admin application. *) module ViewFeedback; from StudentFile import Server; from StudentApp import FeedbackEntry, EntryDepartment, EntryCourseNumber, EntryInput; object ViewDepartment is components: fd:EntryDepartment* and UserSelected:EntryDepartment; description: (* The Department combo box contains a variable list of department names that correspond to departments with submitted student feedback. *); end ViewDepartment; object ViewCourseNumber is components: fcn:EntryCourseNumber* and UserSelected:EntryCourseNumber; description: (* The Course Number combo box contains a variable list of course numbers that correspond to courses with submitted student feedback. This combo box is enabled only after a department from the department combo box is chosen. *); end ViewCourseNumber; object ViewFeedbackList is components: ei:EntryInput* and UserSelected:EntryInput; description: (* This list box contains feedback entries for the selected department and course number. Entries in this list are respresented by the first seven characters of the entry and each element is sorted in alphabetical order with respect to each other. The Feedback list is enabled only after a department and course number is selected from the combo boxes. *); end ViewFeedbacklist; object CommentField is components: string; description: (* The Comment Field is a display of the contents of the selected feedback entry in the Feedback entry list. *); end CommentField; operation UpdateCourseNum inputs: vd:ViewDepartment, srvr:Server; outputs: vcn':ViewCourseNumber; precondition: (* Input for the department combo box can't be empty *) (vd.UserSelected != nil); postcondition: (* A course number exists in the combo box if it is filed under the user selected department on the server *) forall(cn:EntryCourseNumber) (cn in vcn'.fcn) iff exists(fe in srvr.sfe) ((vd.UserSelected = fe.ed) and (fe.ecn = cn)); description: (* This operation updates the elements in the course number combo box as the selected item in the department combo box changes *); end UpdateCourseNum; operation UpdateFeedbackList inputs: vcn:ViewCourseNumber, vd:ViewDepartment, srvr:Server; outputs: vfl':ViewFeedbackList; precondition: (* Input for the course number combo box can't be empty *) (vcn.UserSelected != nil); postcondition: (* A feedback entry exists in the list if it is filled under the user selected department and course number on the server *) forall(e_input:EntryInput) (e_input in vfl'.ei) iff exists(fe in srvr.sfe) ((vcn.UserSelected = fe.ecn) and (vd.UserSelected = fe.ed) and (fe.ei = e_input)); description: (* This operation updates the list of submitted feedback entries as the selected department and course number changes by the user *); end UpdateFeedbackList; end ViewFeedback;