(******
 * This file defines objects and operation in the Tools menu
 *
 *)
module Tools;
   from Gradesheet import GradeSheet;
   export all;
  op OpenSetManualThresholdWindow
    inputs: GradeSheet;
    outputs: GradeSheet;
    precondition: (* Not required for this milestone, but coming soon *);
    postcondition: (* Not required for this milestone, but coming soon *);
    description: (*
      Opens the Set Grade Thresholds dialog.  This dialog allows the user to manually set the percentage mappings for each grade and a corresponding color to represent the grade.  For example a person could set an A to be defined as 90-100% of the points possible and the color blue.  This would result in all scores between 90-100% being shown as a blue letter A on the Gradesheet.
      
      For more detail see section 2.4.5 of the requirements document.    
    *);
  end OpenSetManualThresholdWindow;

   (******
    * This section defines objects and operations related to manually setting grading schemes
    *
    * See section 2.4.5 of the Milestone 4 requirements.
    *
    *)
    
   (* Objects for creating a grading scheme *)
    
   obj GradeThreshold is Title and schemechoice:SchemeChoice
   description: (*
       A grade threshold is the generic definition for the interface to manually set the mapping between the percentage of points earned and the grade that is received.  The title is a brief description of what the interface is for.  The scheme choice is a mutually exclusive list of grading schemes to choose from.  CustomSchemeFields are editable fields that allow the professor to configure the grading schemes to be custom for his or her class
   *);
   end GradeThreshold;

   obj SchemeChoice is scheme:Scheme* and CustomNumberField
   description: (*
       A SchemeChoice is a collection of different grading schemes for a user to choose from including predefined grading schemes as well as an Other category for customized grading schemes.  
    
       The predefined grading schemes available are Standard 5(A,B,C,D,F) and Detailed Standard 12(A,A-,B+,B,B-,C+,C,C-,D+,D,D-,F).  The other category allows you to choose the number of grade ranges a student can earn if the standard 5 or Detailed 12 are not adequate.
   *);
   end SchemeChoice;

   obj Scheme is NumberOfGrades and gradenbr:GradeNumber* and gradeltr:GradeLetter* and gradeColor*
   description: (*
       A Scheme is the generic description of the information required to specify the specific point range (Grade Number)to grade (GradeLetter) mapping for a class.  It also contains the number of grades in the scheme.
    
       There is also a corresponding color for each grade.  The color indicates what color the corresponding grade will appear on the gradesheet.
   *);
   end Scheme;

   obj GradeNumber is min:Min and max:Max
   description: (*
       This is the minimum and maximum percentage thresholds for a grade.
   *);
   end GradeNumber;

   obj gradeColor is integer;
   obj GradeLetter is string;
   obj NumberOfGrades is integer;
   obj Title is string;
   obj Min is integer;
   obj Max is integer;
   obj CustomNumberField is integer;
   obj color is integer
   description: (*
       The color can be color from the color wheel the teacher desires to use.  The values are represented in the color representation of the underlying operating system.  A color wheel is used because there is no limit on the number of grading thresholds a teacher can specify.
   *);
   end color;

   (* Objects for operations while creating a grading scheme *)
   op ApplyScheme;
   op OK;
   op cancel; 
end Tools;