Beispiel #1
0
        private double checkEssay3(SoalModel listSoal)
        {
            double point = 0;

            if (RemoveWhitespace(listSoal.pil1.Trim().ToLower().Replace(",", "").Replace(".", ""))
                == RemoveWhitespace(rtbEssay1.Text.Trim().ToLower().Replace(",", "").Replace(".", "")))
            {
                point++;
            }
            if (RemoveWhitespace(listSoal.pil2.Trim().ToLower().Replace(",", "").Replace(".", ""))
                == RemoveWhitespace(rtbEssay2.Text.Trim().ToLower().Replace(",", "").Replace(".", "")))
            {
                point++;
            }
            if (RemoveWhitespace(listSoal.pil3.Trim().ToLower().Replace(",", "").Replace(".", ""))
                == RemoveWhitespace(rtbEssay3.Text.Trim().ToLower().Replace(",", "").Replace(".", "")))
            {
                point++;
            }
            if (point == 3)
            {
                isTrue = true;
            }
            else
            {
                isTrue = false;
            }
            Debug.WriteLine("score : " + point);
            return(point / 3);
        }
Beispiel #2
0
 private void loadPilGan(SoalModel responData)
 {
     pnlPilGan.Visible = true;
     pnlEssay.Visible  = false;
     rtbIsiSoal.Text   = responData.isiSoal;
     rbA.Text          = responData.pil1;
     rbB.Text          = responData.pil2;
     rbC.Text          = responData.pil3;
     rbD.Text          = responData.pil4;
     rbE.Text          = responData.pil5;
 }
Beispiel #3
0
        private void checkPilGanAdaptif(SoalModel soalModel)
        {
            string jawab = getJawabPilgan();

            if (jawab.Trim().ToLower().Equals(soalModel.kunci.Trim().ToLower()))
            {
                double score = soalModel.cluster * testOpen.scoreItem;
                scores[noTest] = score;
                isTrue         = true;
            }
            else
            {
                isTrue         = false;
                scores[noTest] = 0;
            }
        }
Beispiel #4
0
        private double checkEssay1(SoalModel listSoal)
        {
            double point = 0;

            if (RemoveWhitespace(listSoal.pil1.Trim().ToLower().Replace(",", "").Replace(".", ""))
                == RemoveWhitespace(rtbEssay1.Text.Trim().ToLower().Replace(",", "").Replace(".", "")))
            {
                point++;
                isTrue = true;
            }
            else
            {
                isTrue = false;
            }
            return(point);
        }
Beispiel #5
0
 private void checkEssayAdaptif(SoalModel soalModel)
 {
     if (soalModel.jumlahEsay == 1)
     {
         double midScore = soalModel.cluster * testOpen.scoreItem * checkEssay1(soalModel);
         scores[noTest] = midScore;
     }
     else if (soalModel.jumlahEsay == 2)
     {
         double midScore = (soalModel.cluster * testOpen.scoreItem) * checkEssay2(soalModel);
         scores[noTest] = midScore;
     }
     else if (soalModel.jumlahEsay == 3)
     {
         double midScore = (soalModel.cluster * testOpen.scoreItem) * checkEssay3(soalModel);
         scores[noTest] = midScore;
     }
 }
Beispiel #6
0
 private void loadSoal(SoalModel responData)
 {
     if (responData.jenisSoal.ToLower().Equals("pilihan ganda"))
     {
         listIdSoal.Add(responData.idSoal);
         if (this.InvokeRequired)
         {
             this.Invoke((Action) delegate { loadPilGan(responData); });
         }
     }
     else if (responData.jenisSoal.ToLower().Equals("melengkapi"))
     {
         if (this.InvokeRequired)
         {
             this.Invoke((Action) delegate { loadEssay(responData); });
         }
     }
 }
Beispiel #7
0
 private void loadEssay(SoalModel responData)
 {
     pnlPilGan.Visible = false;
     pnlEssay.Visible  = true;
     rtbIsiSoal.Text   = responData.isiSoal;
     Debug.WriteLine("jumlah esay : " + responData.jumlahEsay);
     if (responData.jumlahEsay == 1)
     {
         Debug.WriteLine("jalan di if 1");
         rtbEssay1.Visible = true;
         label1.Visible    = true;
         rtbEssay2.Visible = false;
         label5.Visible    = false;
         rtbEssay3.Visible = false;
         label7.Visible    = false;
     }
     else if (responData.jumlahEsay == 2)
     {
         Debug.WriteLine("jalan di if 2");
         rtbEssay1.Visible = true;
         label1.Visible    = true;
         rtbEssay2.Visible = true;
         label5.Visible    = true;
         rtbEssay3.Visible = false;
         label7.Visible    = false;
     }
     else if (responData.jumlahEsay == 3)
     {
         Debug.WriteLine("jalan di if 3");
         rtbEssay1.Visible = true;
         label1.Visible    = true;
         rtbEssay2.Visible = true;
         label5.Visible    = true;
         rtbEssay3.Visible = true;
         label7.Visible    = true;
     }
     else
     {
         Debug.WriteLine("jalan di else nya");
     }
 }
Beispiel #8
0
        private void getNextSoal()
        {
            var reqNextSoal = new RestRequest("/php/desktopSiswa/nextSoal.php", Method.POST);

            reqNextSoal.AddJsonBody(new
            {
                status               = isTrue,
                idBankSoal           = testOpen.idBankSoal,
                jenis                = listJenisSoal[noTest],
                dayaBeda             = listSoal[noTest - 1].dayaBeda,
                tingkatKesulitanSoal = listSoal[noTest - 1].tingkatKesulitanSoal,
                idSoals              = listIdSoal
            });
            client.ExecuteAsync(reqNextSoal, response =>
            {
                Debug.WriteLine("result : " + response.Content);
                SoalModel soal = JsonConvert.DeserializeObject <NextSoalResponse>(response.Content).soal;
                listSoal.Add(soal);
                listIdSoal.Add(soal.idSoal);
                loadSoal(listSoal[noTest]);
            });
        }