Beispiel #1
0
    public List <WrittenWordSerialized> LoadByStudent(StudentSerialized ss)
    {
        List <WrittenWordSerialized> result = new List <WrittenWordSerialized> ();

        /*List<WrittenWordSerialized> wwsList = LoadAll ();//LoadFile ();
         * foreach (WrittenWordSerialized wws in wwsList) {
         *      if (ss != null &&
         *          wws != null &&
         *          wws.getStudentSerialized () != null &&
         *          wws.getStudentSerialized ().Id == ss.Id) {
         *
         *              result.Add (wws);
         *      }
         * }
         *
         * //Order by date ascendent
         * for (int i = 0; i < result.Count - 1; i++) {
         *      for (int j = result.Count - 1; j > i; j--) {
         *              if (result[i].getWrittenAt () < result[j].getWrittenAt ()) {
         *                      WrittenWordSerialized aux = result [i];
         *                      result [i] = result [j];
         *                      result [j] = aux;
         *              }
         *      }
         * }
         *
         * result.Reverse ();
         *
         * //Print test
         * /*foreach (WrittenWordSerialized wws in result) {
         *      Debug.Log (wws.getWrittenAt ());
         * }*/

        return(result);
    }
 public DiagnosisLevelSnapshotSerialized(string diagnosisLevel, SchoolSerialized schoolSerialized, long startTime, StudentSerialized studentSerialized)
 {
     this.DiagnosisLevel    = diagnosisLevel;
     this.SchoolSerialized  = schoolSerialized;
     this.StartTime         = startTime;
     this.StudentSerialized = studentSerialized;
 }
    public DiagnosisLevelSnapshotSerialized(DiagnosisLevelSnapshot dls)
    {
        this.DiagnosisLevel = dls.DiagnosisLevel;
        this.StartTime      = dls.StartTime;

        if (dls.School != null)
        {
            SchoolSerialized ss = new SchoolSerializedDAO().LoadByObjectId(dls.School.ObjectId);
            if (ss != null)
            {
                this.SchoolSerialized = ss;
            }
            else
            {
                //Debug.Log ("Serialized: There is no relationship saved");
            }
        }

        if (dls.Student != null)
        {
            StudentSerialized ss = new StudentSerializedDAO().LoadByObjectId(dls.Student.ObjectId);
            if (ss != null)
            {
                this.StudentSerialized = ss;
            }
            else
            {
                //Debug.Log ("Serialized: There is no relationship saved");
            }
        }
    }
Beispiel #4
0
    public List <ChallengeSummarySerialized> LoadByStudentAndEtapa(StudentSerialized ss, string etapa)
    {
        List <ChallengeSummarySerialized> result = new List <ChallengeSummarySerialized> ();

        /*List<ChallengeSummarySerialized> cosList = LoadAll ();// LoadFile ();
         * if (cosList != null && cosList.Count > 0) {
         *      foreach(ChallengeSummarySerialized css in cosList){
         *              if(ss != null &&
         *                 css != null &&
         *                 css.getStudentSerialized (dataPersistencePath) != null &&
         *                 css.getStudentSerialized (dataPersistencePath).Id == ss.Id &&
         *                 css.getEtapa () != null &&
         *                 css.getEtapa ().Equals (etapa)){
         *                      result.Add (css);
         *                      //Debug.Log ("Serialized Loaded [id =  " + t.Id + "] " + t + " from " + path);
         *              }
         *              else
         *              {
         *                      //Debug.Log ("Serialized is Deleted!");
         *              }
         *      }
         * }else{
         *      //Debug.Log ("There are no Serializeds saved!");
         * }*/

        return(result);
    }
Beispiel #5
0
 public NoteSerialized(string noteText, SchoolSerialized schoolSerialized, StudentSerialized studentSerialized, TeacherSerialized teacherSerialized, long writtenAt)
 {
     this.NoteText          = noteText;
     this.SchoolSerialized  = schoolSerialized;
     this.StudentSerialized = studentSerialized;
     this.TeacherSerialized = teacherSerialized;
     this.WrittenAt         = writtenAt;
 }
Beispiel #6
0
    public void Add()
    {
        dt = DateTime.Now;

        int value = int.Parse(Qtde.text);

        if (popup.value == "School")
        {
            for (int i = 0; i < value; i++)
            {
                school = new SchoolSerialized("1234", "Escola Marota", "1234", "1234");
                schooldao.SaveOrUpdate(school);
            }
            print(school + GetTimeWated());
        }
        else if (popup.value == "Teacher")
        {
            for (int i = 0; i < value; i++)
            {
                ts = new TeacherSerialized("a", "*****@*****.**", true,
                                           "Sordi", "Rodrigo", "1234", "", "a", school);
                tsdao.SaveOrUpdate(ts);
            }
            print(ts + GetTimeWated());
        }
        else if (popup.value == "StudentGroup_Teacher")
        {
            for (int i = 0; i < value; i++)
            {
                sg_ts = new StudentGroup_TeacherSerialized(school, ts, sgs);
                sg_tsdao.SaveOrUpdate(sg_ts);
            }
            print(sg_ts + GetTimeWated());
        }
        else if (popup.value == "StudentGroup")
        {
            for (int i = 0; i < value; i++)
            {
                sgs = new StudentGroupSerialized("Group", "Manha", school, "Serie 1");
                sgsdao.SaveOrUpdate(sgs);
            }
            print(sgs + GetTimeWated());
        }
        else if (popup.value == "Student")
        {
            for (int i = 0; i < value; i++)
            {
                ss = new StudentSerialized(999999, 1l, 1000l, "", "", "", "Rodrigo", school, sgs, "Sordi");
                ssdao.SaveOrUpdate(ss);
            }
            print(ss + GetTimeWated());
        }
    }
Beispiel #7
0
    public List <WrittenWordSerialized> GetByStudentLast10(StudentSerialized ss)
    {
        List <WrittenWordSerialized> result = new List <WrittenWordSerialized> ();

        /*try {
         *      List<WrittenWordSerialized> orderedByWrittenAt = new List<WrittenWordSerialized> ();
         *
         *      List<WrittenWordSerialized> wwsList = LoadAll ();// LoadFile ();
         *      foreach (WrittenWordSerialized wws in wwsList) {
         *              if (ss != null &&
         *                  wws != null &&
         *                  wws.getStudentSerialized (dataPersistencePath) != null &&
         *                  wws.getStudentSerialized (dataPersistencePath).Id == ss.Id) {
         *
         *                      orderedByWrittenAt.Add (wws);
         *              }
         *      }
         *
         *      //Order by date ascendent
         *      for (int i = 0; i < orderedByWrittenAt.Count - 1; i++) {
         *              for (int j = orderedByWrittenAt.Count - 1; j > i; j--) {
         *                      if (orderedByWrittenAt[i].getWrittenAt () > orderedByWrittenAt[j].getWrittenAt ()) {
         *                              WrittenWordSerialized aux = orderedByWrittenAt [i];
         *                              orderedByWrittenAt [i] = orderedByWrittenAt [j];
         *                              orderedByWrittenAt [j] = aux;
         *                      }
         *              }
         *      }
         *
         *      //Get last ten
         *      if (orderedByWrittenAt.Count > 10) {
         *              int counting10 = 0;
         *              for (int i = orderedByWrittenAt.Count -1; i > 0; i--) {
         *                      counting10 ++;
         *                      result.Add (orderedByWrittenAt[i]);
         *                      if (counting10 == 10)
         *                              break;
         *              }
         *      } else {
         *              result = orderedByWrittenAt;
         *      }
         *
         *      //Print test
         *      /*foreach (WrittenWordSerialized wws in result) {
         *              Debug.Log (wws.getWrittenAt ());
         *      }
         * }catch (System.Exception e) {
         *      Debug.Log (e);
         * }*/
        return(result);
    }
    public List <DiagnosisLevelSnapshotSerialized> LoadByStudent(StudentSerialized ss)
    {
        List <DiagnosisLevelSnapshotSerialized> result = new List <DiagnosisLevelSnapshotSerialized> ();                //Debug.Log ("sgs.getSeries () = " + sgs.getSeries ());

        /*List<DiagnosisLevelSnapshotSerialized> dlssList = LoadAll ();// LoadFile ();
         * foreach (DiagnosisLevelSnapshotSerialized dlss in dlssList) {
         *      if (ss != null &&
         *          dlss != null &&
         *          dlss.getStudentSerialized () != null &&
         *          dlss.getStudentSerialized ().Id == ss.Id) {
         *              result.Add (dlss);
         *      }
         * }*/

        return(result);
    }
Beispiel #9
0
    public void LoadLast()
    {
        dt = DateTime.Now;

        if (popup.value == "School")
        {
            school = schooldao.LoadLast();
            print(school + GetTimeWated());
        }
        else if (popup.value == "Teacher")
        {
            ts = tsdao.LoadLast();
            print(ts + GetTimeWated());
        }
        else if (popup.value == "StudentGroup_Teacher")
        {
            sg_ts = sg_tsdao.LoadLast();
            print(sg_ts + GetTimeWated());
        }
        else if (popup.value == "StudentGroup")
        {
            sgs = sgsdao.LoadLast();
            print(sgs + GetTimeWated());
        }
        else if (popup.value == "Student")
        {
            ss = ssdao.LoadLast();
            print(ss + GetTimeWated());
        }



        /*dt = DateTime.Now;
         * int value = int.Parse (Index.text);
         * ss = dao.LoadById (value);
         * print (ss + GetTimeWated ());
         *
         *
         * /*TeacherSerialized ts = new TeacherSerialized ("a", "*****@*****.**", true, "Sordi", "Rodrigo", "1234", "", "a", ss);
         * tdao.SaveOrUpdate (ts);
         *
         * foreach (TeacherSerialized aux in tdao.LoadAll ())
         *      Debug.Log (aux);*/
    }
    public List <ChallengeOutputSerialized> LoadByStudent(StudentSerialized ss)
    {
        List <ChallengeOutputSerialized> result = new List <ChallengeOutputSerialized> ();

        /*List<ChallengeOutputSerialized> cosList = LoadAll ();// LoadFile ();
         * if (cosList != null && cosList.Count > 0) {
         *      foreach(ChallengeOutputSerialized cos in cosList){
         *              if(cos != null && cos.getStudentSerialized () != null && cos.getStudentSerialized ().Id == ss.Id){
         *                      result.Add (cos);
         *                      //Debug.Log ("Serialized Loaded [id =  " + t.Id + "] " + t + " from " + path);
         *              }
         *              else
         *              {
         *                      //Debug.Log ("Serialized is Deleted!");
         *              }
         *      }
         * }else{
         *      //Debug.Log ("There are no Serializeds saved!");
         * }*/

        return(result);
    }
Beispiel #11
0
 public void SaveChallengeFromMotoCat(SchoolSerialized schoolSerialized,
                                      StudentSerialized studentSerialized,
                                      int asserts,
                                      string challenge,
                                      string etapa,
                                      long totalTime)
 {
     /*new Thread (() => {
      *      ChallengeSummarySerialized css = null;
      *
      *      foreach (ChallengeSummarySerialized tmp in LoadByStudentAndEtapa (studentSerialized, etapa)) {
      *              if (tmp.getEtapaChallenge ().Equals (challenge)) {
      *                      css = tmp;
      *              }
      *      }
      *
      *      if (css == null)
      *              css = new ChallengeSummarySerialized ();
      *
      *      int timesPlayed = css.getTimesPlayed () + 1;
      *      css.setTimesPlayed (timesPlayed);
      *
      *      css.setAsserts (css.getAsserts () + asserts);
      *      css.setEtapa (etapa);
      *      css.setEtapaChallenge (challenge);
      *      css.setMinigame ("MOTOCAT");
      *      css.setTotalTime (css.getTotalTime () + totalTime);
      *      css.setSchoolSerialized (schoolSerialized);
      *      css.setStudentSerialized (studentSerialized);
      *
      *      float assertsPercentage = (float)(100 * css.getAsserts () / css.getTimesPlayed ());
      *      css.setAssertsPercentage (assertsPercentage);
      *
      *      SaveOrUpdate (css);
      *      Debug.Log (css);
      * }).Start ();*/
 }
Beispiel #12
0
    public Student(StudentSerialized ss)
    {
        if (ss != null)
        {
            this.ObjectId = ss.ObjectId;

            this.BirthDate      = ss.BirthDate;
            this.BuildingsCount = ss.BuildingsCount;
            this.Coins          = ss.Coins;
            this.DiagnosisLevel = ss.DiagnosisLevel;
            this.Gender         = ss.Gender;
            this.Guardian       = ss.Guardian;
            this.Name           = ss.Name;
            this.LastName       = ss.LastName;

            School s = new School();
            if (ss.SchoolSerialized != null)
            {
                s.ObjectId = ss.SchoolSerialized.ObjectId;
            }
            this.School = s;

            StudentGroup sg = new StudentGroup();
            if (ss.StudentGroupSerialized != null)
            {
                sg.ObjectId = ss.StudentGroupSerialized.ObjectId;
            }
            this.StudentGroup = sg;

            if (ss.Picture != null)
            {
                byte[] data = ss.Picture;
                this.Picture = new ParseFile("photo.jpg", data);
            }
        }
    }
    public List <ChallengeOutputSerialized> LoadStudentsByGroupButThis(StudentSerialized ss)
    {
        List <ChallengeOutputSerialized> result = new List <ChallengeOutputSerialized> ();

        /*List<ChallengeOutputSerialized> cosList = LoadAll (); //LoadFile ();
         * if (cosList != null && cosList.Count > 0) {
         *      foreach(ChallengeOutputSerialized cos in cosList){
         *              if (cos != null &&
         *                          cos.getStudentSerialized () != null &&
         *                          cos.getStudentSerialized ().getStudentGroupSerialized () != null &&
         *                          ss != null &&
         *                          ss.getStudentGroupSerialized () != null &&
         *                          cos.getStudentSerialized ().getStudentGroupSerialized ().Id == ss.getStudentGroupSerialized ().Id &&
         *                          cos.getStudentSerialized ().Id != ss.Id) {
         *
         *                      result.Add (cos);
         *              }
         *      }
         * }else{
         *      //Debug.Log ("There are no Serializeds saved!");
         * }*/

        return(result);
    }
 public WeekSummarySerialized(int asserts, float assertsPercentage, string etapa, string etapaChallenge, string minigame, SchoolSerialized schoolSerialized, StudentSerialized studentSerialized, int timesPlayed, long totalTime, long week)
 {
     this.Asserts           = asserts;
     this.AssertsPercentage = assertsPercentage;
     this.Etapa             = etapa;
     this.EtapaChallenge    = etapaChallenge;
     this.Minigame          = minigame;
     this.SchoolSerialized  = schoolSerialized;
     this.StudentSerialized = studentSerialized;
     this.TimesPlayed       = timesPlayed;
     this.TotalTime         = totalTime;
     this.Week = week;
 }
 public WrittenWordSerialized(string diagnosisLevel, string expected, string gesture, string input, SchoolSerialized schoolSerialized, StudentSerialized studentSerialized, long writtenAt)
 {
     this.DiagnosisLevel    = diagnosisLevel;
     this.Expected          = expected;
     this.Gesture           = gesture;
     this.Input             = input;
     this.SchoolSerialized  = schoolSerialized;
     this.StudentSerialized = studentSerialized;
     this.WrittenAt         = writtenAt;
 }
 public ChallengeOutputSerialized(int asserts, long assertsPercentage, string challengeExcercise, long duration, string etapa, string etapaChallenge, string minigame, SchoolSerialized schoolSerialized, StudentSerialized studentSerialized, bool summarized, DateTime timestamp, bool weekSummarized)
 {
     this.Asserts            = asserts;
     this.AssertsPercentage  = assertsPercentage;
     this.ChallengeExcercise = challengeExcercise;
     this.Duration           = duration;
     this.Etapa             = etapa;
     this.EtapaChallenge    = etapaChallenge;
     this.Minigame          = minigame;
     this.SchoolSerialized  = schoolSerialized;
     this.StudentSerialized = studentSerialized;
     this.Summarized        = summarized;
     this.Timestamp         = timestamp;
     this.WeekSummarized    = weekSummarized;
 }