/** * event * * @throws RemoteException */ private void buttonJawabActionPerformed() throws RemoteException { if (cekPilih()) { jawabanBs = new JawabanBs(); jawabanBs.setMahasiswa(mhs); jawabanBs.setSoalBs(soalBsList.get(noSoal)); jawabanBs.setJawab(Jawab.valueOf("S")); if (soalBsList.get(noSoal).getKunci() == KunciBs.valueOf(kunciJawaban())) { bener++; jawabanBs.setJawab(Jawab.valueOf("B")); } bsPretestService.save(jawabanBs); if (noSoal < jumlahSoal - 1) { noSoal++; textNo.setText((noSoal + 1) + ""); textSoal.setText(soalBsList.get(noSoal).getSoal()); buttonGroup.clearSelection(); } else { nilai = ((double) bener / (double) jumlahSoal) * 100; nilaiBs = new NilaiBs(); nilaiBs.setMahasiswa(mhs); nilaiBs.setPertemuanPraktikum(pertemuanPraktikum); nilaiBs.setNilai(nilai); nilaiBs.setStatusNilai(StatusNilai.Y); bsPretestService.save(nilaiBs); listener.selesai(nilai, setting.getBataLulus()); } } else { JOptionPane.showMessageDialog(this, "jawaban tidak boleh kosong"); } }
public void setDuration() throws RemoteException { // menghitung selisih waktu start dengan waktu sekarang if (s == 0) { s = 60; m--; } else { s--; } if (m == 0) { m = 60; h--; } Time t = new Time(); TimeEntity te = t.timeFormat(s, m, h); labelWaktu.setText(te.getJam() + " : " + te.getMenit() + " : " + te.getDetik()); if (h == -1) { h--; nilai = ((double) bener / (double) jumlahSoal) * 100; nilaiBs = new NilaiBs(); nilaiBs.setMahasiswa(mhs); nilaiBs.setPertemuanPraktikum(pertemuanPraktikum); nilaiBs.setNilai(nilai); bsPretestService.save(nilaiBs); listener.selesai(nilai, setting.getBataLulus()); } }