package hintSystem; /* ** PREAMBLE ** ** (c) Copyright University of Massachusetts ** ** $Workfile: TryAgainMsg.java$ ** $Subproject: integerhints$ ** $Log: // 4 03/15/99 Ivon Added another feature to each of the hints and analyzed // the values of each feature. // 3 02/08/99 Ivon Updated features // 2 01/06/99 marshall added version control headers // 1 12/30/98 marshall Initial Version // $ ** */ import hintSystem.HintFeatures; import hintSystem.MessageHint; import problem.Problem; import domain.Skill; import psolve.Num; import javax.swing.JFrame; import javax.swing.JLabel; import javax.swing.ImageIcon; public class GiveSolutionMsg extends MessageHint { // it can be used as a tactical hint which requires no args public GiveSolutionMsg (Problem p) { Skill sk = p.getSkill(); Num soln = p.solve(); setMessage("Incorrect. "+p.getDescription()+" is "+soln); } // it can be used as a tactical hint which requires no args public GiveSolutionMsg (Problem p, boolean summary) { Skill sk = p.getSkill(); Num soln = p.solve(); setMessage(p.getDescription()+" is "+soln); } public static HintFeatures getFeatures () { HintFeatures f= new HintFeatures("hintSystem.GiveSolutionMsg",3,3,0,0,1,0); f.setTactical(); return f; } public static boolean isRunnable (Problem p) { return p.getSkillOperands().length == p.getSkill().getArgTypes().length; } }