Ejemplo n.º 1
0
 public function init()
 {
     $gel = Gelombang::getActive();
     $gelTitle = $gel ? ' - Gelombang ' . $gel->label . ' ' . $gel->periode->tahun : '';
     $this->setTitle('Rekapitulasi Nilai' . $gelTitle);
     $this->data['gel'] = $gel;
 }
Ejemplo n.º 2
0
 public function getIndex()
 {
     if (\Request::ajax()) {
         $data = ['group' => GroupNilai::all(), 'gelombang' => Gelombang::getActive()];
         return $this->render('backend.pages.dashboard', $data);
     }
     return view('frontend.home');
 }
Ejemplo n.º 3
0
 public function getReload()
 {
     $gel = Gelombang::getActive();
     $this->setTitle('Pengolahan Nilai', 'Pre-Test & Post-Test');
     $data = ['gelombang' => $gel, 'groupNilai' => GroupNilai::all(), 'peserta' => Participation::whereHas('kelas', function ($query) use($gel) {
         $query->where('gelombang_id', $gel->id);
     })->get()];
     return $this->render('backend.pages.olahdata.prepost.prepost', $data);
 }
Ejemplo n.º 4
0
 public function getDetailChart($type)
 {
     $data = ['chartType' => ''];
     $g = Gelombang::getActive();
     if ($type == 'fasilitas') {
         $data['kuesioner'] = $g->getFasilitas();
     } else {
         $data['kuesioner'] = $g->getSmileyFace();
     }
     $data['chartType'] = $type == 'fasilitas' ? "Detail Penilaian Fasilitas" : "Detail Smiley Face";
     return view('backend.pages.detail-chart', $data)->render();
 }
Ejemplo n.º 5
0
 public function getI($id, $i)
 {
     $gel = Gelombang::getActive();
     $k = $gel->indikatorG()->where('indikator_id', $id)->first();
     if (!$k) {
         $k = $gel->indikator()->attach($id, ['status' => $i]);
     } else {
         $k->status = $i;
         $k->save();
     }
     return $this->redirectAjax('olahdata/materi');
 }
Ejemplo n.º 6
0
 public function getPerHari($hari)
 {
     $gelombang = Gelombang::getActive();
     $gelTitle = $gelombang ? ' - ' . $gelombang->label : '';
     $this->setTitle('Pengolahan Nilai', 'Nilai Harian' . $gelTitle);
     $data = ['gelombang' => $gelombang, 'hari' => $hari, 'groupNilai' => GroupNilai::all(), 'peserta' => Participation::whereHas('kelas', function ($query) use($gelombang) {
         $query->where('gelombang_id', $gelombang->id);
     })->get()];
     if ($hari != -1) {
         return $this->render('backend.pages.olahdata.harian.perhari', $data);
     }
     return $this->render('backend.pages.olahdata.harian.total', $data);
 }
Ejemplo n.º 7
0
 public static function newKuesioner($data)
 {
     $k = new static();
     $k->title = $data['title'];
     $k->user_id = auth()->user()->id;
     $k->gelombang_id = Gelombang::getActive()->id;
     $k->save();
     $i = 1;
     foreach ($data['pertanyaan'] as $q) {
         $p = new KuesionerItem();
         $p->label = $q;
         $p->type = 'input';
         $p->priority = $i;
         $k->items()->save($p);
         $i++;
     }
 }
Ejemplo n.º 8
0
 public function postTable()
 {
     $filters = [];
     if ($gel = Gelombang::getActive()) {
         $filters['gelombang_id'] = $gel->id;
     }
     $this->setupTable('Kuesioner', $this->structs, $filters);
     return parent::postTable();
 }