// Use this for initialization
    void Start()
    {
        helper =  this.gameObject.AddComponent<BackEndHelper>();
        finalScore = (100 - (IM_PianoManager.pianoMistakes * (10)));

        helper.AddModel(new Activity(0, "Immediate_Memory", System.DateTime.Now, finalScore, 0.0f), BackEndHelper.current_patient.id);
    }
    // Use this for initialization
    void Start()
    {
        helper = this.gameObject.AddComponent<BackEndHelper>();
        for (int i = 0; i < BackEndHelper.current_patient.medication_list.Count; i++)
        {
            patientMedicineList.Add(BackEndHelper.current_patient.medication_list[i].name);
            patientDosageList.Add(BackEndHelper.current_patient.medication_list[i].dosage);
        }

        numMedicationsLeft = BackEndHelper.current_patient.medication_list.Count;

        currentScoreMedicine = 100.0f;
        currentScoreDosage = 100.0f;

        if(BackEndHelper.current_patient.medication_list.Count == 0)
        {
            feedback.text = "You have no medications in the system!";
            StartCoroutine(NoMedsExit());

        }
        else
        {
            StartMedication();
        }
    }
Exemple #3
0
        private static void AddReviewConfirmButton_Click(object sender, RoutedEventArgs e)
        {
            DataModels    database      = DataModels.GetInstance();
            Button        addRoomButton = (Button)sender;
            List <object> objects       = (List <object>)addRoomButton.Tag;
            Booking       booking       = (Booking)objects[0];
            TextBox       reviewTextBox = (TextBox)objects[1];
            TextBox       ratingTexyBox = (TextBox)objects[2];

            if (!BackEndHelper.IsNumber(ratingTexyBox.Text))
            {
                MessageBox.Show("Rating must be a number !");
                return;
            }
            bool done = database.AddReview(new Review(reviewTextBox.Text, int.Parse(ratingTexyBox.Text), booking.number));

            if (done)
            {
                MessageBox.Show("Review submitted");
            }
            else
            {
                MessageBox.Show("Error!");
            }
        }
Exemple #4
0
        private static void UpdateWebsiteConfirmButton_Click(object sender, RoutedEventArgs e)
        {
            Button        button  = (Button)sender;
            List <object> data    = (List <object>)button.Tag;
            Website       website = (Website)data[0];
            TextBox       websiteRatingTextBox = (TextBox)data[1];

            string websiteRating = websiteRatingTextBox.Text;

            if (!BackEndHelper.IsNumber(websiteRating))
            {
                MessageBox.Show("Rating must be a number");
                return;
            }
            int newRating = int.Parse(websiteRating);

            website.rating = newRating;
            DataModels database = DataModels.GetInstance();


            bool done = database.UpdateWebsite(website);

            if (done)
            {
                MessageBox.Show("Website Updated successfully !");
            }
            else
            {
                MessageBox.Show("Couldn't update website");
            }
        }
Exemple #5
0
    // Use this for initialization
    void Start()
    {
        helper = this.gameObject.AddComponent<BackEndHelper>();

        finalScore = (100 - (GameManager.mistake * (10)));
        helper.AddModel(new Activity(0, "Auditory_Processing", System.DateTime.Now, finalScore, 0.0f), BackEndHelper.current_patient.id);
    }
Exemple #6
0
        private static void AddWebsiteConfirmButton_Click(object sender, RoutedEventArgs e)
        {
            Button         button        = (Button)sender;
            List <TextBox> data          = (List <TextBox>)button.Tag;
            string         websiteName   = data[0].Text;
            string         websiteRating = data[1].Text;

            if (!BackEndHelper.IsNumber(websiteRating))
            {
                MessageBox.Show("Rating must be a number");
                return;
            }
            int        rating   = int.Parse(websiteRating);
            DataModels database = DataModels.GetInstance();
            Website    website  = new Website(websiteName, rating);
            bool       done     = database.AddWebsite(website);

            if (done)
            {
                MessageBox.Show("Website Added successfully !");
            }
            else
            {
                MessageBox.Show("Couldn't add website");
            }
        }
        public void SignupButtonUserData_Click(object sender, RoutedEventArgs args)
        {
            Front_End.SignupCanvas signupCanvas = Front_End.SignupCanvas.GetInstance(SignupCanvas);
            if (BackEndHelper.IsValidEmail(signupCanvas.GetEmail()) == false)
            {
                MessageBox.Show("Invalid Email");
                return;
            }
            if (signupCanvas.GetPassword().Length < 8)
            {
                MessageBox.Show("Passowrd length must be more than 8 characters");
                return;
            }
            if (signupCanvas.GetCreditCardSerial().Length > 20 || BackEndHelper.IsNumber(signupCanvas.GetCreditCardSerial()) == false)
            {
                MessageBox.Show("Invalid serial number");
                return;
            }
            if (signupCanvas.GetCreditCardCVV().Length > 4 || signupCanvas.GetCreditCardCVV().Length < 3 || BackEndHelper.IsNumber(signupCanvas.GetCreditCardCVV()) == false)
            {
                MessageBox.Show("Invalid cvv");
                return;
            }
            if (signupCanvas.GetExpirationDate() < DateTime.Today)
            {
                MessageBox.Show("Credit card expired");
                return;
            }
            User user = new User
                        (
                signupCanvas.GetUserName(),
                signupCanvas.GetEmail(),
                signupCanvas.GetName(),
                null,
                new CreditCard
                    (signupCanvas.GetCreditCardSerial(),
                    int.Parse(signupCanvas.GetCreditCardCVV()),
                    signupCanvas.GetExpirationDate()
                    )
                        );
            bool valid = DataModels.GetInstance().RegisterUser(user, signupCanvas.GetPassword());

            if (valid == false)
            {
                MessageBox.Show("User name taken");
                return;
            }
            Front_End.NavigationCanvas.GetInstance(NavigationCanvas).Hide();
            InitializeLoggedinNavigationCanvas(user);
            ActiveUser = user;

            CurrentCanvas.Hide();
            InitializeHomeCanvas();
        }
    // Use this for initialization
    void Start()
    {
        score = 100f * (GenerateFormula.correctEquations) / (GenerateFormula.equationsGenerated + (GenerateFormula.equationsMistakes + (GenerateFormula.equationsTimedOut * 2)));
        equationsGeneratedString = "Number of Equations: " + GenerateFormula.equationsGenerated.ToString ();
        correctEquationString = "Number of Correct Answers: " + GenerateFormula.correctEquations.ToString ();
        equationsMistakeString = "Number of Mistakes: " + GenerateFormula.equationsMistakes.ToString ();
        equationsTimedOutString = "Number of Timed Out Equations: " + GenerateFormula.equationsTimedOut.ToString ();
        result = GetComponent<Text>();

        helper = this.gameObject.AddComponent<BackEndHelper>();
        helper.AddModel(new Activity(0, "Calculation", System.DateTime.Now, score, 0.0f), BackEndHelper.current_patient.id);
    }
    // Use this for initialization
    void Start()
    {
        helper = this.gameObject.AddComponent<BackEndHelper>();

        totalQuestions = DifficultySelection.numberOfQuestions;
        for (int i = 0; i < totalQuestions; i++) {
            if (DifficultySelection.answerSelected [i, 1].CompareTo (DifficultySelection.questionList [i].correct_answer) == 0) {
                correct += 1f;
            }
        }

        score = (int) ((correct / totalQuestions) * 100);

        helper.AddModel(new Activity(0, "Reading_Comprehension", System.DateTime.Now, score * 1.0f, 0.0f), BackEndHelper.current_patient.id);
    }
    // Use this for initialization
    void Start()
    {
        helper = this.gameObject.AddComponent<BackEndHelper>();

        DontDestroyOnLoad(this.gameObject);

        scores[0] = InitScanningController.scanningFinalScore;
        scores[1] = InitOrientationController.initOrientScore;
        scores[2] = InitSTMController.finalSTMScore;
        scores[3] = IA_IM_GameManager.IMscore;
        scores[4] = IA_C_Manager.calcScore;
        scores[5] = InitCategContr.initCatScore;
        scores[6] = InitPSController.probSolvScore;
        scores[7] = InitSequencingContr.initSequencingScore;
        scores[8] = IMMGameManager.audScore;
        scores[9] = IA_RC_QuestionMC.IA_RC_score * 1.0f;
        scores[10] = InitAttentionController.attentFinalScore;

        for(int i = 0; i < scores.Length; i++)
        {
            if(scores[i] < 25.0f)
            {
                results[i].text = "Severe";
            }
            else if (scores[i] < 50.0f)
            {
                results[i].text = "Moderate";
            }
            else if (scores[i] < 75.0f)
            {
                results[i].text = "Mild";
            }
            else
            {
                results[i].text = "Within functional limits";
            }

            editLabels[i].text = results[i].text;

        }
    }
Exemple #11
0
        private static void ConfirmReserveButton_Click(object sender, RoutedEventArgs e)
        {
            DataModels          database             = DataModels.GetInstance();
            Button              button               = (Button)sender;
            List <Object>       data                 = (List <Object>)button.Tag;
            Calendar            datePicker           = (Calendar)data[0];
            TextBox             numberofGuestTextBox = (TextBox)data[1];
            RoomsListShowCanvas roomListShowCanvas   = (RoomsListShowCanvas)data[2];
            int index = (int)data[3];

            DateTime startDate = datePicker.SelectedDates[0];
            DateTime endDate   = datePicker.SelectedDates[datePicker.SelectedDates.Count - 1];

            if (!BackEndHelper.IsNumber(numberofGuestTextBox.Text))
            {
                MessageBox.Show("Number of guests must be a number");
                return;
            }
            int  numberOfGuests = int.Parse(numberofGuestTextBox.Text);
            Room room           = roomListShowCanvas.GetSelectedRoom(index);

            if (numberOfGuests > room.type.maxGuests)
            {
                MessageBox.Show("Number of Guests bigger than room capacity");
                return;
            }

            Booking booking = new Booking(database.GetBookingId(), startDate, endDate, numberOfGuests,
                                          GetMainWindow().ActiveUser, roomListShowCanvas.GetSelectedMealPlan(index),
                                          room, new Review(database.GetBookingId()), roomListShowCanvas.GetSelectedWebsite(index));

            if (database.AddBooking(booking))
            {
                MessageBox.Show("You Booked the room !");
            }
            else
            {
                MessageBox.Show("Error");
            }
        }
    // Use this for initialization
    void Start()
    {
        helper = this.gameObject.AddComponent<BackEndHelper>();

        calcAverage = false;
        dayScore = 100.0f;
        GameObject calendar = GameObject.Find ("CalendarPanel");
        GameObject.Find ("Month").GetComponent<Text> ().text = today.ToString ("MMMMM");
        int dayofweek = (int)today.DayOfWeek;
        GameObject.Find ("Feedback").GetComponent<Text> ().text = "";
        dayOfWeekName = today.ToString ("dddd");

        DateTime thisMonth = new DateTime (today.Year, today.Month, 1);

        for (int i = 0; i < (int)thisMonth.DayOfWeek; i++) {
            Transform placeholder = Instantiate(placeholderPrefab);
            placeholder.SetParent(calendar.transform);
            placeholder.localScale = new Vector3 (1.0f, 1.0f, 1.0f);
        }

        for (int i = 1; i <= DateTime.DaysInMonth(thisMonth.Year, thisMonth.Month); i++) {
            Transform day = Instantiate(dayPrefab);
            day.transform.GetChild(0).GetComponent<Text>().text = i.ToString();
            if(dayofweek == (int)(new DateTime(today.Year, today.Month, i).DayOfWeek)) {
                day.tag = "CurrentDayofWeek";
            }
            if(today.Equals((new DateTime(today.Year, today.Month, i)))) {
                day.tag = "Today";
            }
            day.SetParent(calendar.transform);
            day.localScale = new Vector3 (1.0f, 1.0f, 1.0f);

            if(i == today.Day) {
                correctWeek = day.transform.GetSiblingIndex()/7;
            }
        }
    }
    // Use this for initialization
    void Start()
    {
        helper = this.gameObject.AddComponent<BackEndHelper>();

        GameObject titleText = GameObject.FindGameObjectWithTag ("Title");
        gameOver = false;
        numRounds++;
        if(WheelchairSelectionButtons.getOut)
            titleText.GetComponent<Text>().text = "Wheelchair Sequencing - Getting out of a Wheelchair";
        else
            titleText.GetComponent<Text>().text = "Wheelchair Sequencing - Sitting in a Wheelchair";

        for (int i = 0; i < 4; i++) {
            Transform step = Instantiate(stepPrefab);
            if(WheelchairSelectionButtons.getOut)
                step.transform.GetChild(1).GetComponent<Text>().text = stepsGetOut[i];
            else
                step.transform.GetChild(1).GetComponent<Text>().text = stepsSitIn[i];
            stepsToSort[i] = step;

        }

        for (int i = 0; i < 16; i++) {
            stepsToSort = swap (Random.Range (0, 4), Random.Range(0, 4), stepsToSort);
        }

        GameObject stepPanel = GameObject.FindGameObjectWithTag("StepsPanel");
        for (int i = 0; i < 4; i++) {
            stepsToSort[i].transform.SetParent(stepPanel.transform);
            stepsToSort[i].transform.localScale = new Vector3 (1.0f, 1.0f, 1.0f);
        }

        stepValue = 100.0f / 4.0f;
    }
    // Use this for initialization
    void Start()
    {
        {
            load_mananger = gameObject.GetComponent<InitializeScreen>();
            helper = gameObject.AddComponent<BackEndHelper>();
            states = new Dictionary<State, GameObject>();
            states.Add(State.TherapistRegistraion, TherapistRegisterMenu);
            states.Add(State.Login, Login_Menu);
            states.Add(State.TherapistProfile, TherapistProfileMenu);
            states.Add(State.PatientProfile, PatientProfileMenu);
            states.Add(State.PatientRegistration, PatientRegistrationMenu);
            states.Add(State.PostData, PostDataMenu);
            states.Add(State.ChangeTherapistInfo, UpdateTherapistMenu);
            states.Add(State.ChangePatientInfo, UpdatePatientMenu);

            current_state = State.Login;

            error_sound = GameObject.Find("Menus").GetComponents<AudioSource>()[1];
            started = false;
        }
    }
 // Use this for initialization
 void Start()
 {
     helper = this.gameObject.AddComponent<BackEndHelper>();
     scoreOutput.GetComponent<Text>().text = "You earned " + SortingGameController.finalAverageScore + "% points!";
 }
    // Use this for initialization
    void Start()
    {
        feedback.text = "";
        numOfAttempts = 1;

        puzzleComplete = false;

        be = this.gameObject.AddComponent<BackEndHelper> ();

        initialLocations = new Vector3[puzzle.transform.childCount];
        initialRotations = new Quaternion[puzzle.transform.childCount];

        initialTemplateLocation = new Vector3[puzzle.transform.childCount];
        initialTemplateRotation = new Quaternion[puzzle.transform.childCount];

        puzzleBoxColliderCenter = puzzle.transform.GetChild (0).GetComponent<BoxCollider> ().center;
        puzzleBoxColliderSize = puzzle.transform.GetChild (0).GetComponent<BoxCollider> ().size;

        templateBoxColliderCenter = template.transform.GetChild (0).GetComponent<BoxCollider> ().center;
        templateBoxColliderSize = template.transform.GetChild (0).GetComponent<BoxCollider> ().size;

        pictures = Resources.LoadAll ("", typeof(Texture));
        Texture texture = pictures[UnityEngine.Random.Range(0, pictures.Length)] as Texture;
        for (int i = 0; i < puzzle.transform.childCount; i++) {
            initialLocations[i] = puzzle.transform.GetChild(i).transform.position;
            initialRotations[i] = puzzle.transform.GetChild(i).transform.rotation;
            puzzle.transform.GetChild(i).GetComponent<Renderer>().material.mainTexture = texture;

            initialTemplateLocation[i] =  template.transform.GetChild(i).transform.position;
            initialTemplateRotation[i] =  template.transform.GetChild(i).transform.rotation;
        }
    }
Exemple #17
0
 void Start()
 {
     helper = gameObject.AddComponent<BackEndHelper>();
 }
    // Use this for initialization
    void Start()
    {
        helper = this.gameObject.AddComponent<BackEndHelper>();

        feedback.text = "";
        if (SoundActivityGameController.numAnswerChoices == 0) {
            SoundActivityGameController.numAnswerChoices = 4;
        }

        scoreForThisRound = 100.0f;
        timesPlayedSoundGame++;

        quitButton.gameObject.SetActive (false);
        playAgainButton.gameObject.SetActive (false);

        numRoundsLeft = 4;

        directions.text = "Tap the play sound button, then choose the sound you hear.";

        InitializeSounds ();
        ChooseSound ();
        CreateAnswers ();
    }
    // Use this for initialization
    void Start()
    {
        {
            load_mananger = gameObject.GetComponent<InitializeScreen>();
            helper = gameObject.AddComponent<BackEndHelper>();
            states = new Dictionary<State, GameObject>();
            states.Add(State.TherapistRegistraion, TherapistRegisterMenu);
            states.Add(State.Login, Login_Menu);
            states.Add(State.TherapistProfile, TherapistProfileMenu);
            states.Add(State.PatientProfile, PatientProfileMenu);
            states.Add(State.PatientRegistration, PatientRegistrationMenu);
            states.Add(State.PostData, PostDataMenu);
            current_state = State.Login;
            foreach(KeyValuePair<State, GameObject> pair in states)
            {
                if (pair.Key != current_state)
                    pair.Value.SetActive(false);
            }

            error_sound = GameObject.Find("Menus").GetComponents<AudioSource>()[1];
        }
    }