Exemplo n.º 1
0
    void SetupPageSwitch(ResultObject resultObject, DanishStrings ds, bool buttonBool)
    {
        if( resultObject.Analystisk > resultObject.Holistisk){
            analytikHeadline.text = ds.TitleAnalyst + " (" + resultObject.Analystisk + "%)";
            holistiskHeadline.text = ds.TitleHolistic2Part1 + resultObject.Holistisk + ds.TitleHolistic2Part2;
        }else if(resultObject.Holistisk > resultObject.Analystisk){
            holistiskHeadline.text = ds.TitleHolistic1 + " (" + resultObject.Holistisk + "%)";
            analytikHeadline.text = ds.TitleAnalyst2Part1 + resultObject.Analystisk + ds.TitleAnalyst2Part2;
        }else if(resultObject.Analystisk.ToString().Equals(resultObject.Holistisk.ToString())){
            holistiskHeadline.text = ds.TitleHolistic2Part1 + resultObject.Holistisk + ds.TitleHolistic2Part2;
            analytikHeadline.text = ds.TitleAnalyst2Part1 + resultObject.Analystisk + ds.TitleAnalyst2Part2;
        }

        double [] sortArray = {resultObject.Auditiv, resultObject.Taktil, resultObject.Kinaestisk, resultObject.Visuel};
        double max = sortArray.Max();
        if(resultObject.Auditiv == max){
            auditivHeadline.text = ds.TitleAuditory1 + " (" + resultObject.Auditiv + "%)";
            taktilHeadline.text = ds.TitleTactile2Part1 + resultObject.Taktil + ds.TitleTactile2Part2;
            kineastetiskHeadline.text = ds.TitleKinesthetic2Part1 + resultObject.Kinaestisk + ds.TitleKinesthetic2Part2;
            visuelHeadline.text = ds.TitleVisual2Part1 + resultObject.Visuel + ds.TitleVisual2Part2;
        }
        else if(resultObject.Taktil ==max){
            taktilHeadline.text = ds.TitleTactile1 + " (" + resultObject.Taktil + "%)";
            auditivHeadline.text = ds.TitleAuditory2Part1 + resultObject.Auditiv + ds.TitleAuditory2Part2;
            kineastetiskHeadline.text = ds.TitleKinesthetic2Part1 + resultObject.Kinaestisk + ds.TitleKinesthetic2Part2;
            visuelHeadline.text = ds.TitleVisual2Part1 + resultObject.Visuel + ds.TitleVisual2Part2;
        }
        else if(resultObject.Kinaestisk== max){
            kineastetiskHeadline.text = ds.TitleKinesthetic1 + " (" + resultObject.Kinaestisk + "%)";
            auditivHeadline.text = ds.TitleAuditory2Part1 + resultObject.Auditiv + ds.TitleAuditory2Part2;
            taktilHeadline.text = ds.TitleTactile2Part1 + resultObject.Taktil + ds.TitleTactile2Part2;
            visuelHeadline.text = ds.TitleVisual2Part1 + resultObject.Visuel + ds.TitleVisual2Part2;
        }
        else if(resultObject.Visuel == max){
            visuelHeadline.text = ds.TitleVisual1 + " (" + resultObject.Visuel + "%)";
            auditivHeadline.text = ds.TitleAuditory2Part1 + resultObject.Auditiv + ds.TitleAuditory2Part2;
            taktilHeadline.text = ds.TitleTactile2Part1 + resultObject.Taktil + ds.TitleTactile2Part2;
            kineastetiskHeadline.text = ds.TitleKinesthetic2Part1 + resultObject.Kinaestisk + ds.TitleKinesthetic2Part2;
        }
        else if(resultObject.Auditiv == max &&resultObject.Taktil== max && resultObject.Kinaestisk ==max && resultObject.Visuel == max){
            print(max);
            auditivHeadline.text = ds.TitleAuditory2Part1 + resultObject.Auditiv + ds.TitleAuditory2Part2;
            taktilHeadline.text = ds.TitleTactile2Part1 + resultObject.Taktil + ds.TitleTactile2Part2;
            kineastetiskHeadline.text = ds.TitleKinesthetic2Part1 + resultObject.Kinaestisk + ds.TitleKinesthetic2Part2;
            visuelHeadline.text = ds.TitleVisual2Part1 + resultObject.Visuel + ds.TitleVisual2Part2;
        }

        SubTitleThinkingStyle.text = ds.SubTitleThinkingStyle;
        analytikText.text = ds.DescpriptionAnalyst;
        string[] descriptionAnalyst2 = ds.DescpriptionAnalystPart2;

        envirCount = 0;
        for(int q=0; q< 4; q++){
            envirCount++;
            addHighlights(ds.DescpriptionAnalystPart2[q], analytiskHighlightPanel);
            addHighlights(ds.DescpriptionHolisticPart2[q], holistiskHighlightPanel);
            addHighlights(ds.DescpriptionVisualPart2[q], visuelHighlightPanel);
            addHighlights(ds.descpriptionKinestheticPart2[q], kinæstetiskHighlightPanel);
            addHighlights(ds.DescpriptionAuditoryPart2[q], auditivHighlightPanel);
            addHighlights(ds.descpriptionTactilePart2[q], taktilHighlightPanel);
        }

        holistiskText.text = ds.DescpriptionHolistic;
        SubTitlePreferences.text = ds.SubTitlePreferences;
        visuelText.text = ds.DescpriptionVisual;
        auditivText.text = ds.DescpriptionAuditory;
        taktilText.text = ds.DescpriptionTactile;
        kineastetiskText.text = ds.DescpriptionKinesthetic;
        SubTitleEnvironment.text = ds.SubTitleEnvironment;

        envirCount = 0;
        switch(resultObject.Lys){
        case 1:
            envirCount++;
            addHighlights(ds.EnvirLightOn, læringsstilsmiljøHighlightContainer);
            break;
        case 2:
            envirCount++;
            addHighlights(ds.EnvirLightOff, læringsstilsmiljøHighlightContainer);
            break;
        };

        switch(resultObject.Lyd){
        case 1:
            envirCount++;
            addHighlights(ds.EnvirSoundOff, læringsstilsmiljøHighlightContainer);
            break;
        case 2:
            envirCount++;
            addHighlights(ds.EnvirSoundOn, læringsstilsmiljøHighlightContainer);
            break;
        };

        switch(resultObject.Temperatur){
        case 1:
            envirCount++;
            addHighlights(ds.EnvirTempHot, læringsstilsmiljøHighlightContainer);
            break;
        case 2:
            envirCount++;
            addHighlights(ds.EnvirTempCold,læringsstilsmiljøHighlightContainer);
            break;
        };

        switch(resultObject.Design){
        case 1:
            envirCount++;
            addHighlights(ds.EnvirConfertTable, læringsstilsmiljøHighlightContainer);
            break;
        case 2:
            envirCount++;
            addHighlights(ds.EnvirConfertSofa, læringsstilsmiljøHighlightContainer);
            break;
        };

        switch(resultObject.Bevaeglse){
        case 1:
            envirCount++;
            addHighlights(ds.EnvirMovment, læringsstilsmiljøHighlightContainer);
            break;
        };

        switch (envirCount) {
        case 0:
            addHighlights("Du har ikke valgt noget i læringsmiljø", læringsstilsmiljøHighlightContainer);
            break;
        };

        if (buttonBool) {
            buttonText.text = ds.BtnTxtTagOm;
        } else if (!buttonBool) {
            buttonText.text = "Fortsæt Test";
        }
    }
Exemplo n.º 2
0
    // SetupPage lavet et ListItem object, og tilføjere den til containern.
    public void SetupPage(ResultObject resultObject)
    {
        resultobjecValue = resultObject;
            GameObject container = GameObject.Find ("Container");
            DanishStrings ds = new DanishStrings ();
        print (resultObject.ToString());

        valueUserID = resultObject.UserID;
        valueUserType = resultObject.UserType;
        headlineText.text = resultObject.StudentName;

        if ((resultObject.TestTaken == false) && (!PlayerPrefs.HasKey ("TestToSave_" + resultObject.UserID))) {
            buttonText.text = ds.BtnTxtTagTest;
            underContainer.SetActive (false);
            ResetHeight ();
        } else if (resultObject.TestTaken == true && (!PlayerPrefs.HasKey ("TestToSave_" + resultObject.UserID))) {
            SetupPageSwitch (resultObject, ds, true);
        } else if (resultObject.TestTaken == false && (PlayerPrefs.HasKey ("TestToSave_" + resultObject.UserID))) {
            buttonText.text = "Fortsæt Test";
            underContainer.SetActive (false);
            ResetHeight ();

        } else if (resultObject.TestTaken == true && (PlayerPrefs.HasKey ("TestToSave_" + resultObject.UserID) != null)) {
            SetupPageSwitch(resultObject, ds,false);
        }

            setHAImage ();
            setVATKImage ();

        this.transform.SetParent (container.transform);
        this.transform.localScale = new Vector3 (1, 1, 1);
        ResetHeight ();
    }