Ejemplo n.º 1
0
 private void EvalOutput(GradeBand evalGrade)
 {
     Debug.LogWarning("PROGRESS EVALUATOR: Remember to also check your progress against the Status-xPercent.png files and " +
                      "Status-100Percent-Windows or Status-100Percent-Mac.app executables.");
     using BinaryWriter writer = new BinaryWriter(File.Open("ProgEv", FileMode.Create));
     writer.Write(evalGrade.ToString());
     writer.Write(studentNumber);
     writer.Write(DateTime.Now.ToString("MM/dd/yyyy"));
     //writer.Write(DateTime.Now.Year.ToString());
 }
Ejemplo n.º 2
0
    // Start is called before the first frame update
    void Start()
    {
        evalMethods = new Action[] { () => Pass50Band(), () => Pass60Band(), () => Credit70Band(), () => Distinction80Band(), () => HighDist90Band(), () => HighDist100Band() };
        loadedBand  = EvalReader();
        //Debug.LogWarning("LOADED BAND == " + loadedBand);

        int i = 0;

        try
        {
            while (i < (int)bandReached)
            {
                if (i == 0)
                {
                    CheckStudentNum();
                }
                GradeBand currentBand = (GradeBand)i + 1;
                evalMethods[i]();
                if (currentBand <= GradeBand.Pass60)
                {
                    EvalPassMessage(currentBand.ToString());
                    if (currentBand > loadedBand)
                    {
                        EvalOutput(currentBand);
                    }
                }
                else
                {
                    EvalInProgressMessage(currentBand.ToString());
                }
                i++;
            }
        }
        catch (EvalFailedException e)
        {
            EvalFailMessage(((GradeBand)i + 1).ToString(), e.Message);
        }
        catch (Exception e)
        {
            EvalFailMessage(((GradeBand)i + 1).ToString(), "An unknown error occured during the progress evaluation. It is likely " +
                            "that you have made a mistake that the ProgressEvaluator system has not been setup to handle. Go back over the " +
                            "steps for this grade band and see if you can spot anything wrong or ask your tutor. The full error is below for reference: ");
            Debug.LogError(e.GetType() + ": " + e.Message);
            Debug.LogError(e.GetType() + ": Full Stack Trace: " + e.StackTrace);
        }
    }