tooling.report a quick way to determine the best build tool for your next web project, or if tooling migration is worth it, or how to adopt a tool's best practice into your existing configuration and code base.
const gabolehaksessekalibuat = () => {
let akses = document.formuploadmateri.idaksessiswa.value
let betulbetul = (akses == "sekali") ? false : true;
if (betulbetul) {
alert("Anda tidak bisa memilih jenis tagihan, karena jenis pembelajaran(KBM) yang Anda edit hanya untuk latihan/tidak menerima tagihan nilai dari siswa");
document.formuploadmateri.jenistagihan.value = ""
}
}
const janganadatagihanbuat = () => {
let akses = document.formuploadmateri.idaksessiswa.value
let betulbetul = (akses == "sekali") ? false : true;
if (betulbetul) {
document.formuploadmateri.jenistagihan.value = ""
const awalbuatwaktu = () => {
let val = document.formuploadmateri.idtgl.value;
let d = new Date(val)
let dd = d.getDate();
let mm = d.getMonth() + 1;
let yy = d.getFullYear();
const objekKD = (asal) => {
if (asal.indexOf("KUNCI-KD") > -1) {
//REPLACE DULU = misal: _KUNCI-PG_1A, 2B, 3C
var tekskunci = asal.replace("KUNCI-KD", "").replace(/\s+/g, "").split("<||>");//.split(":");
let ar = []
let ob = {};
for (i = 0; i < tekskunci.length; i++) {
//get the image selected
var item = "";
item = document.querySelector('#tmbluploadgambarmatei').files[0];
//create a FileReader
var reader = new FileReader();
//image turned to base64-encoded Data URI.
reader.readAsDataURL(item);
reader.name = item.name;//get the image's name
reader.size = item.size; //get the image's size
reader.onload = function (event) {
let mmtpe = event.target.result.match(/^.*(?=;)/)[0];
var img = new Image();//create a image
img.src = event.target.result;//result is base64-encoded Data URI
img.name = event.target.name;//set name (optional)
img.size = event.target.size;//set size (optional)
img.onload = function (el) {
var elem = document.createElement('canvas');//create a canvas
//scale the image to 600 (width) and keep aspect ratio
var scaleFactor = resize_width / el.target.width;
elem.width = resize_width;
elem.height = el.target.height * scaleFactor;
//draw in canvas
var ctx = elem.getContext('2d');
ctx.drawImage(el.target, 0, 0, elem.width, elem.height);
//get the base64-encoded Data URI from the resize image
// var srcEncoded = ctx.canvas.toDataURL(el.target, 'image/jpeg', 0);
var srcEncoded = ctx.canvas.toDataURL(el.target, mmtpe, 0);
resultuploadpotomateri.innerHTML = "";
var inputbase64 = document.createElement("input");
inputbase64.setAttribute("name", "gmbrdata");
inputbase64.setAttribute("id", "gmbrdata");
inputbase64.value = srcEncoded.replace(/^.*,/, '');
inputbase64.setAttribute("style", "display:none");
var inputfilename = document.createElement("input");
inputfilename.setAttribute("name", "gmbrfilename");
inputfilename.setAttribute("id", "gmbrfilename");
inputfilename.setAttribute("style", "display:none");
inputfilename.value = new Date().getTime();;// + namebantukirim.value.toUpperCase().replace(/\s+/, "_");
var inputmimetype = document.createElement("input");
inputmimetype.setAttribute("name", "gmbrmimeType")
inputmimetype.setAttribute("id", "gmbrmimeType")
inputmimetype.setAttribute("style", "display:none")
inputmimetype.value = srcEncoded.match(/^.*(?=;)/)[0];;//"data:image/jpeg";
resultuploadpotomateri.appendChild(inputbase64);
resultuploadpotomateri.appendChild(inputfilename);
resultuploadpotomateri.appendChild(inputmimetype);
let teks1 = document.createTextNode("Data siap upload. Klik tombol ini ")
resultuploadpotomateri.appendChild(teks1);
let tmbl = document.createElement("button",);
tmbl.setAttribute("class", "w3-black w3-button w3-hover-blue w3-tiny w3-round-xxlarge");
tmbl.setAttribute("onclick", "uplgmbrmateri()");
tmbl.innerHTML = "Upload ke Server"
resultuploadpotomateri.append(tmbl)
}
}
daftarGambar()
}
const uplgmbrmateri = async () => {
// let ti = document.createElement("i")
// ti.setAttribute("class","fa fa-spin fa-spinner w3-large")
// resultuploadpotomateri.appendChild(ti);
// inputbase64.setAttribute("id", "gmbrdata");
// inputfilename.setAttribute("id", "gmbrfilename");
// inputmimetype.setAttribute("name", "gmbrmimeType");
// let valdata = document.getElementById("gmbrdata").value ;
// console.log(valdata)
let ketval = document.formuploadmateri.idmapel.value
let val = (ketval == "") ? "e-lamaso" : ketval;
.... tidak ditampilkan di siswa dan teks jawaban akan dienkripsi().
Cara mengeceknya ada di keterangan atas:
Contoh penulisan: _KUNCI-PG_1A, 2B, 3C, ...dst...., 40D (diakhir kunci ga boleh ada koma
lagi)
Paramater: 1A ⇒ No. 1 kunci jawabannya A.
Masing-masing kunci jawaban dipisahkan dengan koma.
Contoh penulisan: _KUNCI-PG_1A, 2B, 3C, ...dst...., 40D (diakhir kunci ga boleh ada koma
lagi)
SEBARAN KD
.... tidak ditampilkan di siswa dan teks jawaban akan dienkripsi().
Cara mengeceknya ada di keterangan atas:
Contoh penulisan: _KUNCI-KD_ PKN_3.1 : 1, 2, 3 <||> MTK_3.1 : 4, 5, 6
Default kode Mata pelajaran
Nama Mapel
Kode HURUF KAPITAL SEMUA
Pendidikan Kewarganegaraan
PKN
Pendidikan Agama Islam dan Budi Pekerti
PAI
Pendidikan Agama Kristen dan Budi Pekerti
PKRIS
Pendidikan Agama Katolik dan Budi Pekerti
PKATO
Pendidikan Agama Hindu dan Budi Pekerti
PHIND
Pendidikan Agama Budha dan Budi Pekerti
PBUDH
Pendidikan Agama Khonghucu dan Budi Pekerti
PKONG
Bahasa Indonesia
BINDO
Matematika
MTK
IPA (Ilmu Pengetahuan Alam)
IPA
IPS (Ilmu Pengetahuan Sosial)
IPS
SBDP (Seni Budaya dan Prakarya)
SBDP
PJOK (Pendidikan Jasmani dan Kesehatan)
PJOK
Bahasa Sunda (Mulok wajib)
BSUND
TIK (Mulok Pilihan)
TIKOM
Paramater: "PKN_3.1: 1, 2, 3, 4, 5" ⇒ Mapel PKN dangan KD 3.1 untuk
nomor soal: 1, 2, 3, 4, dan 5;
Masing-masing parameter dipisahkan kode <||>
Contoh penulisan: _KUNCI-KD_ PKN_3.1 : 1, 2, 3 <||> MTK_3.1 : 4, 5, 6
Kode | adalah tombol garis tegak lurus yang ada di atas tombol ENTER
Video Youtube
default:
copy paste link url, contoh: https://www.youtube.com/watch?v=GR2jxW4tlkY
Buat Tabel
NO
NAMA
KELAS
1
ADZKA
3A
2
NUHAA
4A
default: kode <|HEADER|> untuk batas garis header
kode <|> untuk batas garis sel
Kode | adalah tombol garis tegak lurus yang ada di atas tombol ENTER
Pilihan Ganda (Normal), OPSI sampai D
1
ASEAN didirikan berdasarkan Deklarasi Bangkok yang ditandatangani pada tanggal….
Masukkan No soal sebelum dicopy:
No. Soal:
Pilihan Ganda (Normal), OPSI sampai C
1
ASEAN didirikan berdasarkan Deklarasi Bangkok yang ditandatangani pada tanggal….
Masukkan No soal sebelum dicopy:
No. Soal:
Pilihan Ganda (Opsi Berupa Tabel)
1
Yang termasuk contoh simbiosis dan contohnya yang tepat adalah ...
Simbiosis
contoh
Mutualisme
Hubungan bunga dengan lebah
Parasitisme
Hubungan bakteri E-Coli pada usus manusia
Komensialisme
Benalu pada batang pohon mangga
Xerofitisme
Hubungan burung jalak dengan kerbau
Masukkan No soal sebelum dicopy:
No. Soal:
ESSAY
1
Patung yang digunakan sebagai sarana untuk beribadah dan memiliki makna yang
religius adalah patung ….
atau
Pilih Salah satu cara Kalian menjawab soal ini
Masukkan No soal sebelum dicopy:
No. Soal:
Matematika: PECAHAN BIASA
Contoh:
a = Pembilang
b = penyebut
Matematika: PECAHAN BIASA CAMPURAN
Contoh:
a = Satuan
b = Pembilang
c = penyebut
Matematika: AKAR KUADRAT
Contoh:
a = angka dalam akar
Matematika: AKAR PANGKAT TIGA
Contoh:
angka = angka dalam akar
Matematika: PANGKAT (Semua angka)
Contoh:
a = angka
b = eksponen
a dan b berupa angka
Matematika: PANGKAT HURUF (boleh huruf)
Contoh:
a = angka
b = eksponen
a dan b boleh huruf
Misalnya digunakan untuk menulis rumus matematika, contoh:
Rumus luas lingkaran adalah:
ℼ x r 2
Matematika: EQUATION EDITOR LAINNYA
Contoh:
dibutuhkan kode equation editor di link ini: equation editor
online;
Contoh di atas adalah dengan menggunakan kode: \sqrt{325\frac{2}{3}}
kode di atas dihilangkan spasinya;
Simbol: Operator pembagian
Contoh:
÷
default:
Digunakan untuk operator matematika
Simbol: Tanda Derajat
Contoh:
°
default:
Digunakan untuk eksponen yang menyatakan suhu:
Suhu di Kota Depok adalah 35 ° Celcius
Simbol: tanda sudut lancip
Contoh:
∠
default:
Digunakan untuk menulis simbol sudut lancip
Simbol: tanda sudut siku-siku
Contoh:
⊾
default:
Digunakan untuk menulis simbol sudut siku-siku
Simbol: Plus Minus (Kurang lebih)
Contoh:
±
default:
Digunakan untuk menulis simbol kurang lebih
Simbol: Checklist
Contoh:
✓
default:
Digunakan untuk menulis simbol ceklis
Simbol: Phi
Contoh:
ℼ
default:
Digunakan untuk menulis simbol phi : 22/7
Simbol: Tanda panah ke kiri
Contoh:
←
default:
Digunakan untuk menulis tanda panah
Simbol: Tanda panah ke kanan
Contoh:
→
default:
Digunakan untuk menulis tanda panah
Simbol: Tanda panah dobel ke kanan
Contoh:
⟹
default:
Digunakan untuk menulis tanda panah
Simbol: Tanda panah dobel ke kiri
Contoh:
⟸
default:
Digunakan untuk menulis tanda panah
`
petunjukcarabuatmateri.style.display = "block"
txtareapetunjuk.style.display = "block";
}
const publikasikanmateribaru = () => {
let tglkosong = document.formuploadmateri.idtgl.value
let boltgl = (tglkosong == "") ? alert('Waktu Mulai tidak boleh kosong') : true;
let mapel = document.formuploadmateri.idmapel.value;
let bolmapel = (mapel == "") ? alert('Identitas pembelajaran tidak boleh kosong') : true;
let kuncikosong = document.formuploadmateri.kuncikd.value;
let bolkd = (kuncikosong == "") ? alert("Anda belum membuat sebaran KD") : true;
if (bolmapel && boltgl && bolkd) {
let dom = document.getElementById("formuploadmateri");
let data = new FormData(dom);
pranalamateri.style.display = "block";
dom.reset();
idpracetak.innerHTML = ` On Proess kirim`
let url = linkmateri + "&action=materibaru"
fetch(url, { method: 'post', body: data })
.then(m => m.json())
.then(f => {
idpracetak.innerHTML = f.result;
loadketkunci.innerHTML = "";
loadketKD.innerHTML = "";
//console.log(f)
pembelajaran();
updatematerikan();
localStorage.removeItem("draftmateri")
})
.catch(er => idpracetak.innerHTML = "Maaf, terjadi kesalahan: Error Code" + er)
}
}
const daftarnilaikronologi = (id) => {
//alert(id)
//let teks = "kbmtoday"+ tglStringZero();
idtabaktif.innerHTML = id;
koreksidarimana.innerHTML = id + "_kronologi";
// let datamaterilocal = JSON.parse(localStorage.getItem(teks))[id];
let datamaterilocal = kronologijson[id];
let materi = datamaterilocal.idmapel.toUpperCase();
let mtri = datamaterilocal.idmapel;
let tagih = datamaterilocal.jenistagihan;
let ctok = datamaterilocal.crtToken;
//alert (teks)
//let kodeunik = tagih + "_" + tglStringZero();
modaldaftarnilaikronologi.style.display = "block";
document.querySelector("#modalidmapelkronologi").innerHTML = " " + tagih + " " + materi;
document.getElementsByClassName("tablinkkronologi")[0].click();
//$.getJSON(constlinknilai+"&action=dataanalisisharian", function(json))
// let kelas = e.parameter.idkelas;
// let idmapel = e.parameter.idmapel;
// let kodeunik = e.parameter.kodeunik;
let paramtambahan = "&idkelas=" + encodeURIComponent(idNamaKelas);
// paramtambahan += "&idmapel=" + encodeURIComponent(mtri);
// paramtambahan += "&kodeunik=" + encodeURIComponent(kodeunik)
// tablinkKDtabel.innerHTML = ``
// fetch(constlinknilai + "?action=dataanalisisharian" + paramtambahan)
fetch(constlinknilai + "?action=nilairseponkronologi" + paramtambahan)
.then(m => m.json())
.then(f => {
//console.log(f)
let res = f.records;
nilairesponkronologi = res.filter(k => k.idmapel == mtri && k.jenistagihan == tagih & k.crtToken == ctok)
// nilairesponkronologi = f.records;
//console.log(nilairesponkronologi)
forModalTabelkronologi(id)
}
)
}
function bukaModalTabkronologi(evt, cityName) {
var i, x, tablinks;
x = document.getElementsByClassName("citykronologi");
for (i = 0; i < x.length; i++) {
x[i].style.display = "none";
}
tablinks = document.getElementsByClassName("tablinkkronologi");
for (i = 0; i < x.length; i++) {
tablinks[i].classList.remove("w3-light-grey");
}
document.getElementById(cityName).style.display = "block";
evt.currentTarget.classList.add("w3-light-grey");
}
const forModalTabelkronologi = (id) => {
//tes dulu bekerja di id tablinkKDtabel
let datamaterilocal = kronologijson[id];
// console.log(datamaterilocal)
// // console.log(JSON.parse(datamaterilocal.kuncikd));
let identitasmapel = datamaterilocal.idmapel;
let idd = parseInt(id);
let datakd = JSON.parse(datamaterilocal.kuncikd);
let punyaessay = (datamaterilocal.jumlahessay == 0) ? false : true;
// console.log(punyaessay)
// console.log("datakd:")
// console.log(datakd)
let banyakkd = Object.keys(datakd);
// console.log("banyakkd:")
// console.log(banyakkd.length);
// console.log("idKD");
// console.log(banyakkd)
// filter untuk dijadikan unik pada key
let mapelunik = [];
let koleksikd = []
let kdpermapel = {};
for (i = 0; i < banyakkd.length; i++) {
let mp = banyakkd[i].split("_")[0]
if (mapelunik.indexOf(mp) == -1) {
mapelunik.push(mp);
}
}
let koleksinamasiswa = jsondatasiswa.map(k => k.pd_nama)
// console.log(kdpermapel);
// console.log(mapelunik)
//bikin tabel
let tabel = document.createElement("table")
tabel.setAttribute("class", "versi-table w3-tiny");
tabel.setAttribute("id", "tabel_rekap_KDkronologi");
//bikin head;
//let row = tabel.insertRow(0)
let rthead = tabel.createTHead();
let rth = rthead.insertRow(0)
let rtd = document.createElement("th")
rtd.setAttribute("rowspan", 3)
rtd.innerHTML = "No"
rth.appendChild(rtd);
rtd = document.createElement("th")
rtd.setAttribute("rowspan", 3)
rtd.setAttribute("style", "position:sticky;position:-webkit-sticky;left:0px;box-shadow: inset 0 0 1px #000000");
rtd.innerHTML = "Nama Siswa"
rth.appendChild(rtd);
// if (punyaessay) {
// rtd = document.createElement("th")
// rtd.setAttribute("rowspan", 3)
// rtd.innerHTML = "Koreksi"
// rth.appendChild(rtd);
// }
rtd = document.createElement("th")
rtd.setAttribute("rowspan", 3)
rtd.innerHTML = "Aksi"
rth.appendChild(rtd);
rtd = document.createElement("th")
rtd.setAttribute("colspan", banyakkd.length)
rtd.innerHTML = "Mata Pelajaran"
rth.appendChild(rtd);
rth = rthead.insertRow(-1);
rth.setAttribute("colspan", banyakkd.length);
rth2 = rthead.insertRow(-1)
for (k = 0; k < mapelunik.length; k++) {
rtd = document.createElement("th")
// rtd.innerHTML = mapelunik[k]
// rth.appendChild(rtd);
let coun = 0;
for (j = 0; j < banyakkd.length; j++) {
let st = banyakkd[j]
if (st.indexOf(mapelunik[k]) > -1) {
coun++;
//let tekconsol = "Mapel " + mapelunik[k] +"KD " + banyakkd[j];
//console.log(tekconsol)
let rtd1 = document.createElement("th")
rtd1.innerHTML = banyakkd[j].split("_")[1] + " " + banyakkd[j]
rth2.appendChild(rtd1);
}
}
rtd.innerHTML = mapelunik[k]
rtd.setAttribute("colspan", coun)
rth.appendChild(rtd);
}
let tbo = tabel.createTBody();
for (z = 0; z < koleksinamasiswa.length; z++) {
let rowisi = tbo.insertRow(-1);
let sel = rowisi.insertCell(-1)
sel.innerHTML = (z + 1);
sel = rowisi.insertCell(-1)
sel.setAttribute("style", "position:sticky;position:-webkit-sticky;left:0px;box-shadow: inset 0 0 1px #000000");
sel.innerHTML = koleksinamasiswa[z];
// if (punyaessay) {
sel = rowisi.insertCell(-1)
sel.innerHTML = tombolaksikronologi(punyaessay, koleksinamasiswa[z], z, idd);
// sel.innerHTML = ``;
// }
for (a = 0; a < mapelunik.length; a++) {
// rtd.innerHTML = mapelunik[k]
// rth.appendChild(rtd);
let coun = 0;
for (j = 0; j < banyakkd.length; j++) {
let st = banyakkd[j]
if (st.indexOf(mapelunik[a]) > -1) {
coun++;
let tekconsol = "Mapel " + mapelunik[a] + "KD " + banyakkd[j];
//console.log(tekconsol)
let sell = rowisi.insertCell(-1)
sell.innerHTML = nilaiKDSiswakronologi(koleksinamasiswa[z], banyakkd[j]).replace(".", ",");// banyakkd[j] + "nama = " + koleksinamasiswa[z];
}
}
}
}
let idtabel = `tabel_rekap_KDkronologi`;
let judul1 = `DAFTAR NILAI PER-KD ${identitasmapel.toUpperCase()} KELAS ${idNamaKelas.toUpperCase()}`;
let judul2 = `Semester ${idSemester} Tahun Pelajaran ${idTeksTapel}`;
let tekstgl = `${StringTanggal(new Date())}`;
let namafile = `DAFTAR NILAI PER-KD ${identitasmapel.toUpperCase()} Kelas ${idNamaKelas} id file ${new Date().getTime()}`;
let xx = `${idtabel},${judul1}, ${judul2}, ${tekstgl}`;
let xxx = `${idtabel}, ${namafile},${judul1}`
tablinkKDkronologitabel.innerHTML = ` | `;
//tablinkKDtabel.appendChild(tombolprint)
tablinkKDkronologitabel.appendChild(tabel);
let teksket = document.createTextNode("Tombol LJK merah menandakan LJK belum dikoreksi dan belum ada nilai")
tablinkKDkronologitabel.appendChild(teksket)
let brr = document.createElement("br")
tablinkKDkronologitabel.appendChild(brr)
teksket = document.createTextNode("Tombol LJK biru menandakan LJK sudah dikoreksi dan sudah ada nilai")
tablinkKDkronologitabel.appendChild(teksket)
}
document.querySelector(".tabpgkronologi").addEventListener("click", function () {
let a = parseInt(idtabaktif.innerHTML);
formModalTabelAnalisisPGkronologi(a)
})
document.querySelector(".tabskorkronologi").addEventListener("click", function () {
let a = parseInt(idtabaktif.innerHTML);
formModalTabelAnalisisSkorkronologi(a)
})
const formModalTabelAnalisisPGkronologi = (id) => {
let datamaterilocal = kronologijson[id];
let jumlahpg = (datamaterilocal.jumlahpg == 0) ? 1 : parseInt(datamaterilocal.jumlahpg);
let identitasmapel = datamaterilocal.idmapel;
//console.log(jumlahpg);
let koleksinamasiswa = jsondatasiswa.map(k => k.pd_nama);
let tabel = document.createElement("table");
tabel.setAttribute("class", "versi-table w3-tiny");
tabel.setAttribute("id", "table_rekap_pgkronologi");
let thead = tabel.createTHead();
let row = thead.insertRow(0);
let th = document.createElement("th");
th.setAttribute("rowspan", 2)
th.innerHTML = "No";
row.appendChild(th);
th = document.createElement("th");
th.setAttribute("rowspan", 2)
th.setAttribute("style", "position:sticky;position:-webkit-sticky;left:0px;box-shadow: inset 0 0 1px #000000");
th.innerHTML = "NAMA SISWA";
row.appendChild(th);
th = document.createElement("th");
th.setAttribute("colspan", jumlahpg)
th.innerHTML = "NOMOR SOAL";
row.appendChild(th);
row = thead.insertRow(-1)
if (datamaterilocal.jumlahpg !== 0) {
for (b = 0; b < jumlahpg; b++) {
th = document.createElement("th");
th.innerHTML = (b + 1);
row.appendChild(th);
}
} else {
th = document.createElement("th");
th.innerHTML = "Tidak Ada PG";
row.appendChild(th);
}
let bdy = tabel.createTBody();
for (c = 0; c < koleksinamasiswa.length; c++) {
let tr = bdy.insertRow(-1)
let sel = tr.insertCell(-1)
sel.innerHTML = (c + 1);
sel = tr.insertCell(-1);
sel.setAttribute("style", "position:sticky;position:-webkit-sticky;left:0px;box-shadow: inset 0 0 1px #000000");
sel.innerHTML = koleksinamasiswa[c];
if (datamaterilocal.jumlahpg !== 0) {
for (d = 0; d < jumlahpg; d++) {
sel = tr.insertCell(-1)
//sel.innerHTML = OpsiSiswakronologi(koleksinamasiswa[c],"PG_" + (d+1));
if (OpsiSiswakronologi(koleksinamasiswa[c], "PG_" + (d + 1))[0]) {
if (OpsiSiswakronologi(koleksinamasiswa[c], "PG_" + (d + 1))[2] == 1) {
sel.setAttribute("style", "background-color:aqua");
sel.innerHTML = OpsiSiswakronologi(koleksinamasiswa[c], "PG_" + (d + 1))[1]
} else {
sel.setAttribute("style", "background-color:red");
sel.innerHTML = OpsiSiswakronologi(koleksinamasiswa[c], "PG_" + (d + 1))[1]
}
} else {
sel.innerHTML = ""
}
}
} else {
sel = tr.insertCell(-1)
sel.innerHTML = "Tidak ada Soal PG"
}
}
let idtabel = `table_rekap_pgkronologi`;
let judul1 = `ANALISIS SOAL ${identitasmapel.toUpperCase()} KELAS ${idNamaKelas.toUpperCase()}`;
let judul2 = `Semester ${idSemester} Tahun Pelajaran ${idTeksTapel}`;
let tekstgl = `${StringTanggal(new Date())}`;
let namafile = `ANALISIS SOAL ${identitasmapel.toUpperCase()} Kelas ${idNamaKelas} id file ${new Date().getTime()}`;
let xx = `${idtabel},${judul1}, ${judul2}, ${tekstgl}`;
let xxx = `${idtabel}, ${namafile},${judul1}`
tablinkPGkronologitabel.innerHTML = ` | `;
//tablinkKDtabel.appendChild(tombolprint)
tablinkPGkronologitabel.appendChild(tabel);
}
const formModalTabelAnalisisSkorkronologi = (id) => {
let datamaterilocal = kronologijson[id];
let jumlahpg = parseInt(datamaterilocal.jumlahpg) + parseInt(datamaterilocal.jumlahessay);
let identitasmapel = datamaterilocal.idmapel;
//console.log(jumlahpg);
let koleksinamasiswa = jsondatasiswa.map(k => k.pd_nama);
let tabel = document.createElement("table");
tabel.setAttribute("class", "versi-table w3-tiny");
tabel.setAttribute("id", "table_rekap_skorkronologi");
let thead = tabel.createTHead();
let row = thead.insertRow(0);
let th = document.createElement("th");
th.setAttribute("rowspan", 2)
th.innerHTML = "No";
row.appendChild(th);
th = document.createElement("th");
th.setAttribute("rowspan", 2)
th.setAttribute("style", "position:sticky;position:-webkit-sticky;left:0px;box-shadow: inset 0 0 1px #000000");
th.innerHTML = "NAMA SISWA";
row.appendChild(th);
th = document.createElement("th");
th.setAttribute("colspan", jumlahpg)
th.innerHTML = "NOMOR SOAL";
row.appendChild(th);
row = thead.insertRow(-1)
for (b = 0; b < jumlahpg; b++) {
th = document.createElement("th");
th.innerHTML = (b + 1);
row.appendChild(th);
}
let bdy = tabel.createTBody();
for (c = 0; c < koleksinamasiswa.length; c++) {
let tr = bdy.insertRow(-1)
let sel = tr.insertCell(-1)
sel.innerHTML = (c + 1);
sel = tr.insertCell(-1);
sel.setAttribute("style", "position:sticky;position:-webkit-sticky;left:0px;box-shadow: inset 0 0 1px #000000");
sel.innerHTML = koleksinamasiswa[c];
for (d = 0; d < jumlahpg; d++) {
sel = tr.insertCell(-1)
// sel.innerHTML = "-";
if (OpsiSiswakronologi(koleksinamasiswa[c], "PG_" + (d + 1))[0]) {
if (OpsiSiswakronologi(koleksinamasiswa[c], "PG_" + (d + 1))[2] == 1) {
sel.setAttribute("style", "background-color:aqua");
sel.innerHTML = OpsiSiswakronologi(koleksinamasiswa[c], "PG_" + (d + 1))[2]
} else {
sel.setAttribute("style", "background-color:red");
sel.innerHTML = OpsiSiswakronologi(koleksinamasiswa[c], "PG_" + (d + 1))[2]
}
} else {
sel.innerHTML = ""
}
}
}
let idtabel = `table_rekap_skorkronologi`;
let judul1 = `ANALISIS SKOR SOAL ${identitasmapel.toUpperCase()} KELAS ${idNamaKelas.toUpperCase()}`;
let judul2 = `Semester ${idSemester} Tahun Pelajaran ${idTeksTapel}`;
let tekstgl = `${StringTanggal(new Date())}`;
let namafile = `ANALISIS SKOR SOAL ${identitasmapel.toUpperCase()} Kelas ${idNamaKelas} id file ${new Date().getTime()}`;
let xx = `${idtabel},${judul1}, ${judul2}, ${tekstgl}`;
let xxx = `${idtabel}, ${namafile},${judul1}`
tablinkSkorkronologitabel.innerHTML = ` | `;
//tablinkKDtabel.appendChild(tombolprint)
tablinkSkorkronologitabel.appendChild(tabel);
}
const tutuploadingljk = () => {
$('#infoloadingljk').nextAll('button').remove();
$('#infoloadingljk').nextAll('center').remove();
infoloadingljk.innerHTML = "";
loadingljk.style.display = 'none'
}
const nilaiKDSiswakronologi = (parNama, keyKD) => {
let FilterRec = nilairesponkronologi.filter(k => k.namasiswa == parNama);
let jmlh = FilterRec.length, nn;
if (jmlh > 0) {
//JSON.parse(nilairespon.filter(k => k.namasiswa == "ABIN NUGRAHA")[0].nilaikd)
let arry = FilterRec[jmlh - 1].nilaikd
let obj = JSON.parse(arry)[keyKD]
//nn = JSON.parse(FilterRec[jmlh - 1].nilaikd)[keyKD];
nn = obj
//console.log(nn)
} else {
nn = ""
}
return nn
}
const OpsiSiswakronologi = (parNama, keyKD) => {
//nilairespon.filter(k=>k.namasiswa == "ABIN NUGRAHA").map(k => [k.PG_1, k.SKOR_1])
let angka = keyKD.match(/(\d+)/)[0] // mengembalikan angkanya aja
let cek = nilairesponkronologi.filter(k => k.namasiswa == parNama).map(d => [d[keyKD], d["SKOR_" + angka]]);
//nilairespon.filter(k => k.namasiswa == "ABIN NUGRAHA").map(d => d["PG_4"])[0]
// let cek = nilairespon.filter(k => k.namasiswa == parNama).map(d => d[keyKD]);
let ada = cek.length;
// let angka = keyKD.match(/(\d+)/)[0] // mengembalikan angkanya aja
// let skoropsi =nilairespon.filter(k => k.namasiswa == parNama).map(d => d["SKOR_" + angka]);
let opsinya = [];
if (ada > 0) {
opsinya = [true, cek[ada - 1][0], cek[ada - 1][1]];
} else {
opsinya = [false]
}
return opsinya
}
const tombolaksikronologi = (currEssay, parNama, z, idhtmlmateri) => {
//let currEssay = ;//ada ga essay? false (jika ga ada)
//anggap aja ada essay dulu!
let kodehtml = "";
let cek = nilairesponkronologi.filter(k => k.namasiswa == parNama);
if (cek.length == 0) {
//jika siswa belum mengerjakan, tolong bantu isi!
kodehtml = ``
} else {
// console.log(cek)
// console.log(cek[cek.length - 1])
// console.log(cek[cek.length - 1]['nilaiEssay'])
let indek = cek.length - 1;
let indekk = indek + "<|>" + parNama
if (currEssay) {
// jika ada essay, cek lagi. Nilai essaynya udah masuk apa belum
// jika belum masuk, maka tampilkan tombol koreksi
if (cek[indek].nilaiEssay == "") {
kodehtml = `
";
}
}
}
resumenilaiskhir.innerHTML = resulthasilessay;
buathtmlbantu.textContent = window.btoa(unescape(encodeURIComponent(previewljkbantu.innerHTML)));
let iddarimana = (koreksidarimana.innerHTML).split("_")[1];
let idakseskoreksi = (koreksidarimana.innerHTML).split("_")[0];
let namaform = document.getElementById("ljkbantu")
let dataform = new FormData(namaform);
fetch(constlinknilai + "?action=gurukirimnilai", { method: 'post', body: dataform })
.then(u => u.json())
.then(q => {
document.getElementById("infoloadingljk").innerHTML = q.result;
if (iddarimana == "hariini") {
getdaftarnilai(idakseskoreksi)
} else (
daftarnilaikronologi(idakseskoreksi)
)
})
.catch(er => console.log(er))
document.getElementById("infoloadingljk").innerHTML = ` proses kirim ....`;
}
const hapusljk = (idbaris) => {
let cekcrtToken = kronologijson.filter(k => k.idbaris = idbaris)
alert("pengen hapus data baris ke-" + idbaris + " di SS jenjang kelas " + idJenjang + " dan ini crtTokennya " + cekcrtToken[0].crtToken)
let idok = cekcrtToken[0].crtToken;
let dataform = new FormData();
dataform.append("idbaris", idbaris);
dataform.append("idok", idok);
fetch(constlinknilai + "?action=hapusljk", {
method: 'post',
body: dataform
}).then(m => m.json())
.then(f => {
alert(f.result);
refreshdatakdkd();
})
.catch(er => alert(er))
}
const refreshdatakdkd = () => {
let iddarimana = (koreksidarimana.innerHTML).split("_")[1];
let idakseskoreksi = (koreksidarimana.innerHTML).split("_")[0];
if (iddarimana == "hariini") {
getdaftarnilai(idakseskoreksi)
} else (
daftarnilaikronologi(idakseskoreksi)
)
}
const buathtmlljk = (adapg) => {
let tekshtml = "";
if (adapg) {
tekshtml = `
Nilai Belajar
Sekolah
${idNamaSekolah}
Nama
Kelas
${idNamaKelas}
Mapel/Tema
Waktu Mulai oleh Guru
Waktu Selesai oleh Guru
PILIHAN GANDA:
Jawaban
Kunci:
Nilai
`;
} else {
tekshtml = `
Nilai Belajar
Sekolah
${idNamaSekolah}
Nama
Kelas
${idNamaKelas}
Mapel/Tema
Waktu Mulai oleh Guru
Waktu Selesai oleh Guru
`;
}
return tekshtml
}
function tombolketikjawaban2(idpar) {
let id = idpar.split("_")[0];
//alert("Tombol ketik Jawbaan No " + id)
var tempatnya = document.getElementById("tomboljawaban" + id)
tempatnya.innerHTML = "";
var teksarea = document.createElement("textarea");
teksarea.setAttribute("class", "filejawaban");
teksarea.setAttribute("id", "filejawaban" + id);
teksarea.setAttribute("cols", "30");
teksarea.setAttribute("rows", "10");
teksarea.setAttribute("placeholder", "Silakan ketik jawaban essay untuk No. Soal " + id);
tempatnya.appendChild(teksarea);
tempatnya.innerHTML += " Ganti dengan mengupload media:";
var tombollain = document.createElement("button")
tombollain.setAttribute("onclick", "tomboluploadjawaban2('" + idpar + "')");
tombollain.innerHTML = "Upload Jawaban No " + id
tempatnya.appendChild(tombollain);
tempatnya.innerHTML += " dengan memilih cara lain, jawaban yang sudah diketik akan hilang dan diganti dengan jawaban berupa gambar/media yang diunggah"
}
function tomboluploadjawaban2(idpar) {
//alert("Tombol Upload Jawbaan No " + id)
console.log(idpar)
let id = idpar.split("_")[0]
var tempatnya = document.getElementById("tomboljawaban" + id);
var katajadi = "";
tempatnya.innerHTML = "";
// var divbackground = document.createElement("div");
// divbackground.setAttribute("style","background-color:#ffcdc9;padding:10px");
// divbackground.innerHTML = "Upload Media(Poto, audio, video, pdf, word/txt, dll) jawaban essay No " + id + " dengan menguploadnya di sini:
Upload Media(Poto, audio, video, pdf, word/txt, dll) jawaban essay No";
katajadi += " " + id + " dengan menguploadnya di sini:
";
katajadi += "
";
katajadi += "
";
katajadi += "";
katajadi += "
";
katajadi += `"`
katajadi += "
";
//-----------------------------
katajadi += " Ganti dengan mengetik jawaban:";
katajadi += "";
katajadi += " dengan memilih cara lain, jawaban yang sudah diupload akan hilang dan diganti dengan jawaban berupa ketikan/tulisan"
//-----------------------------
tempatnya.innerHTML = katajadi;
}
function uploadpotoessay(idpar) {
console.log(idpar)
let id = idpar.split("_")[0];
let idsw = idpar.split("_")[1];
var item = document.getElementById("iduploadpotoessay" + id).files[0];
var tempat = document.getElementById("filejawaban" + id);
let total = (1048576 / item.size).toFixed(2);
tempat.innerHTML = ` Sedang proses, mohon tunggu ...`
let ekstensi = item.name.substring(item.name.lastIndexOf('.') + 1);
var filename;
// format nama file = kodetokensiswa_kelas_nomateri_nosoal
let tokensiswa = JSON.parse(localStorage.getItem("datasiswa_" + idNamaKelas))["datasiswa"][idsw].id;
filename = idNamaKelas + "_" + tokensiswa + "_MateriKoreksi_" + kodebarismateriyangdikerjakan + "_essayno_" + id;
let dataaa = ""
var ofReader = new FileReader();
ofReader.readAsDataURL(item);
ofReader.onload = async function (e) {
let base64 = e.target.result.replace(/^.*,/, '');
let mmtype = e.target.result.match(/^.*(?=;)/)[0];
dataaa = e.target.result
let datafom = new FormData()
datafom.append("base64", base64);
datafom.append("mmtype", mmtype);
datafom.append("kelas", idNamaKelas);
datafom.append("filename", filename);
datafom.append("ekstensi", ekstensi);
await fetch(constlinknilai + "?action=siswauploadmedia", {
method: 'post', body: datafom
}).then(m => m.json())
.then(k => {
tempat.innerHTML = k.result
})
.catch(er => {
tempat.innerHTML = "Ups, Maaf. Media gagal diunggah ke server.
Kode Error: " + er;
})
}
}
const simpancatatansementara = () => {
let isiteks = document.formuploadmateri.idmateri.value
if (isiteks == "") {
alert("Maaf, Draft Anda kosong .... :(");
return
}
let idmapel = document.formuploadmateri.idmapel.value;
let iddurasi = document.formuploadmateri.iddurasi.value;
let idaksessiswa = document.formuploadmateri.idaksessiswa.value;
let jenistagihan = document.formuploadmateri.jenistagihan.value;
let idtgl = document.formuploadmateri.idtgl.value;
let idtglend = document.formuploadmateri.idtglend.value;
let botakin = window.btoa(unescape(encodeURIComponent(isiteks)));
let obj = {};
obj.idmapel = idmapel;
obj.iddurasi = iddurasi;
obj.jenistagihan = jenistagihan;
obj.idaksessiswa = idaksessiswa;
obj.idtgl = idtgl;
obj.idtglend = idtglend;
obj.botakin = botakin;
window.localStorage.setItem("drafmateri", JSON.stringify(obj))
alert("Draf, berhasil disimpan")
}
const taruhcatatansementara = () => {
let idmapel = document.formuploadmateri.idmapel;
let iddurasi = document.formuploadmateri.iddurasi;
let idaksessiswa = document.formuploadmateri.idaksessiswa;
let jenistagihan = document.formuploadmateri.jenistagihan;
let idtgl = document.formuploadmateri.idtgl;
let idtglend = document.formuploadmateri.idtglend;
let isiteks = document.formuploadmateri.idmateri
if (localStorage.hasOwnProperty("drafmateri")) {
let teks = JSON.parse(localStorage.getItem("drafmateri"))
idmapel.value = teks.idmapel;
iddurasi.value = teks.iddurasi;
idaksessiswa.value = teks.idaksessiswa;
jenistagihan.value = teks.jenistagihan;
idtgl.value = teks.idtgl;
idtglend.value = teks.idtglend;
let botakin = teks.botakin;
isiteks.textContent = window.atob(botakin)
alert("Anda mempunyai Draft")
} else {
alert("Maaf, Anda tidak memiliki Draft.")
}
}
const editfilemateri = (id) => {
let file = kronologijson[id];//.idmateri;
let idbaris = file.idbaris;
let time = new Date(file.idtgl).getTime()
let now = new Date().getTime()
if (now > time) {
alert("Perhatian! Materi ini sedang/Sudah/Telah lewat dipublikasikan saat ini. Mungkin saja siswa Anda sudah mengirimkan pekejaannya dari materi ini. Jika mengedit alokasi waktu awal Anda akan kehilangan data REKAP PENILAIAN yang berlangsung, dan Materi akan diganti dengan materi yang Anda Edit (overwrite). Hindari mengubah Alokasi Waktu Awal jika Alokasi awal sudah berlangsung karena Rekap Penilaian Anda tidak sinkron.");
// return
}
// document.getElementsByClassName("tablinks")[2].click();
//openCity(event, 'upload_materi')
// lainnya tutup
tabcontent = document.getElementsByClassName("tabcontent");
for (i = 0; i < tabcontent.length; i++) {
tabcontent[i].style.display = "none";
}
tablinks = document.getElementsByClassName("tablinks");
for (i = 0; i < tablinks.length; i++) {
tablinks[i].className = tablinks[i].className.replace(" active", "");
}
document.getElementById("upload_materi").style.display = "block";
let idmapel = document.formuploadmateri.idmapel;
let iddurasi = document.formuploadmateri.iddurasi;
let idaksessiswa = document.formuploadmateri.idaksessiswa;
let jenistagihan = document.formuploadmateri.jenistagihan;
let idtgl = document.formuploadmateri.idtgl;
let idtglend = document.formuploadmateri.idtglend;
let isiteks = document.formuploadmateri.idmateri;
idmapel.value = file.idmapel;
iddurasi.value = file.iddurasi;
idaksessiswa.value = file.idaksessiswa;
jenistagihan.value = file.jenistagihan;
idtgl.value = file.idtgl;
idtglend.value = file.idtglend;
let botakin = file.idmateri;
let idm = encodeURIComponent(botakin)
tombolpublikasikan.setAttribute("onclick", `editfilematerikeserver('${idbaris}')`)
tombolpublikasikan.removeAttribute("class");//.wa w3-deep-purple w3-hover-aqua);
tombolpublikasikan.setAttribute("class", "wa w3-red w3-hover-aqua");
tombolpublikasikan.innerHTML = "EDIT KONTEN MATERI"
// $.getJSON(linkmateri + "&idmateri=" + idm + "&action=previewriwayat", function (json) { })
fetch(linkmateri + "&action=previewriwayat&idmateri=" + idm).then(m => m.json())
.then(k => {
isiteks.textContent = k
}).catch(er => {
isiteks.textContent = er
})
//alert("Anda membuka link upload materi")
}
const editfilematerikeserver = (id) => {
let tglkosong = document.formuploadmateri.idtgl.value
let boltgl = (tglkosong == "") ? alert('Waktu Mulai tidak boleh kosong') : true;
let mapel = document.formuploadmateri.idmapel.value;
let bolmapel = (mapel == "") ? alert('Identitas pembelajaran tidak boleh kosong') : true;
let kuncikosong = document.formuploadmateri.kuncikd.value;
let bolkd = (kuncikosong == "") ? alert("Anda belum membuat sebaran KD") : true;
if (bolmapel && boltgl && bolkd) {
let dom = document.getElementById("formuploadmateri");
let data = new FormData(dom);
data.append("idbaris", id)
pranalamateri.style.display = "block";
dom.reset();
dom.idmateri.value = "";
idpracetak.innerHTML = ` On Proess kirim`
let url = linkmateri + "&action=materiedit"
fetch(url, { method: 'post', body: data })
.then(m => m.json())
.then(f => {
idpracetak.innerHTML = f.result;
loadketkunci.innerHTML = "";
loadketKD.innerHTML = "";
//console.log(f)
pembelajaran();
updatematerikan();
})
.catch(er => idpracetak.innerHTML = "Maaf, terjadi kesalahan: Error Code" + er)
}
localStorage.removeItem("draftmateri")
tombolpublikasikan.setAttribute("onclick", "publikasikanmateribaru()")
tombolpublikasikan.removeAttribute("class");//.wa w3-deep-purple w3-hover-aqua);
tombolpublikasikan.setAttribute("class", "wa w3-deep-purple w3-hover-aqua");
tombolpublikasikan.innerHTML = "PUBLIKASIKAN";
}
const kopipaste = (id) => { var copyText = document.getElementById(id); copyText.select(); copyText.setSelectionRange(0, 99999) document.execCommand("copy"); // alert("Copied the text: " + copyText.value); // alert("Berhasil Ngopi ... ^_^"); resultuploadpotomateri.innerHTML = ""; }
const pratinjaubuatmateri = () => { prevhp.style.display = "block"; let idtextarea = document.formuploadmateri.idmateri;
var copyText = document.formuploadmateri.idmateri;//document.querySelector(id);//document.getElementById(id); copyText.select(); copyText.setSelectionRange(0, 999999) // document.execCommand("copy"); // // alert("Copied the text: " + copyText.value); // alert("Berhasil Ngopi ... ^_^"); // materiimport.innerHTML = brkline(unescape(decodeURIComponent(copyText.value))).teks let arrteks = copyText.value.split("\n");
let tteks = ""; let kuncipg = "Kunci PG:
"; let kuncienk = "
Arti enksripsi:
" let kuncikd = "Data Sebaran KD :
"; let oo; let countpg = 0; let countess = 0; for (let i = 0; i < arrteks.length; i++) { tteks += brkline(arrteks[i]).teks; // kuncipg += brkline(arrteks[i]).kunci; //window.atob(brkline(json).kunci).split(",").join("
"); if (arrteks[i].indexOf("KUNCI-PG") > -1) { kuncipg += brkline(arrteks[i]).kunci;//+"
";//.split(",").join("
"); kuncienk += window.atob(brkline(arrteks[i]).kunci)
} }
const gabolehaksessekalibuat = () => { let akses = document.formuploadmateri.idaksessiswa.value let betulbetul = (akses == "sekali") ? false : true; if (betulbetul) { alert("Anda tidak bisa memilih jenis tagihan, karena jenis pembelajaran(KBM) yang Anda edit hanya untuk latihan/tidak menerima tagihan nilai dari siswa"); document.formuploadmateri.jenistagihan.value = "" }
}
const janganadatagihanbuat = () => { let akses = document.formuploadmateri.idaksessiswa.value let betulbetul = (akses == "sekali") ? false : true; if (betulbetul) { document.formuploadmateri.jenistagihan.value = ""
} else { document.formuploadmateri.jenistagihan.value = "PH" } }
const awalbuatwaktu = () => { let val = document.formuploadmateri.idtgl.value; let d = new Date(val) let dd = d.getDate(); let mm = d.getMonth() + 1; let yy = d.getFullYear();
let newval = addZero(dd) + "" + addZero(mm) + "" + yy; //console.log(newval) document.formuploadmateri.crtToken.value = newval
}
const objekKD = (asal) => { if (asal.indexOf("KUNCI-KD") > -1) { //REPLACE DULU = misal: _KUNCI-PG_1A, 2B, 3C
var tekskunci = asal.replace("KUNCI-KD", "").replace(/\s+/g, "").split("<||>");//.split(":");
let ar = []
let ob = {};
for (i = 0; i < tekskunci.length; i++) {
} }
const daftarGambar = async () => { //alert ("bakal dibuat modal"); koleksigambar.style.display = 'block'; tempattextarea.innerHTML = ""; // document.getElementById("tabelkoleksigambarmateri").innerHTML =""; document.getElementById("tabelkoleksigambarmateri").innerHTML = ""; await fetch(linkmateri + "&action=koleksigambar") .then(m => m.json()) .then(j => { // console.log(j) // console.log(j.records) // let datasheet = j.records; let tabelmateri = document.createElement("table"); tabelmateri.setAttribute("class", "versi-table w3-card-4 w3-center"); tabelmateri.setAttribute("id", "tabeltabelkoleksiuploadgambar"); let row = tabelmateri.insertRow(0); let cell = row.insertCell(-1); cell.innerHTML = "No"; cell = row.insertCell(-1); cell.innerHTML = "Preview"; cell = row.insertCell(-1); cell.innerHTML = "Tombol Copy";
//console.log(linkmateri) }
// {/ <input type="file" id="tmbluploadgambarmatei" onchange="uploadgambarmateri()" class="w3-hide" accept="image/"> //
const uploadgambarmateri = () => { resultuploadpotomateri.innerHTML = "";
var resize_width = 150;//without px
//get the image selected var item = ""; item = document.querySelector('#tmbluploadgambarmatei').files[0];
//create a FileReader var reader = new FileReader();
//image turned to base64-encoded Data URI. reader.readAsDataURL(item); reader.name = item.name;//get the image's name reader.size = item.size; //get the image's size reader.onload = function (event) { let mmtpe = event.target.result.match(/^.*(?=;)/)[0]; var img = new Image();//create a image img.src = event.target.result;//result is base64-encoded Data URI img.name = event.target.name;//set name (optional) img.size = event.target.size;//set size (optional) img.onload = function (el) { var elem = document.createElement('canvas');//create a canvas
}
daftarGambar() }
const uplgmbrmateri = async () => { // let ti = document.createElement("i") // ti.setAttribute("class","fa fa-spin fa-spinner w3-large") // resultuploadpotomateri.appendChild(ti);
// inputbase64.setAttribute("id", "gmbrdata"); // inputfilename.setAttribute("id", "gmbrfilename"); // inputmimetype.setAttribute("name", "gmbrmimeType"); // let valdata = document.getElementById("gmbrdata").value ; // console.log(valdata) let ketval = document.formuploadmateri.idmapel.value let val = (ketval == "") ? "e-lamaso" : ketval;
// let frmdata = "gmbrdata=" + encodeURIComponent(gmbrdata.value); // frmdata =+ "&gmbrfilename="+ encodeURIComponent(gmbrfilename.value); // frmdata =+ "&gmbrmimeType"+ encodeURIComponent(gmbrmimeType.value); // frmdata =+ "&keterangan"+ encodeURIComponent(val); let frmdata = new FormData(); frmdata.append("gmbrdata", gmbrdata.value); frmdata.append("gmbrfilename", gmbrfilename.value); frmdata.append("gmbrmimeType", gmbrmimeType.value); frmdata.append("keterangan", val); // $.ajax({ // crossDomain: true, // url: linkmateri +"&action=uplgmbrmateri", // dataType: 'json', // method: 'POST', // contentType: 'application/x-www-form-urlencoded', // data: frmdata, // success: async function(p){ // resultuploadpotomateri.innerHTML = p; // }, // error: function(er) // {resultuploadpotomateri.innerHTML = er}
// }); resultuploadpotomateri.innerHTML =
<i class="fa fa-spin fa-spinner"></i>
// $.ajax() //let ur ="https://script.google.com/macros/s/AKfycbxnQL4WMBUYJx7IrY8CnKycG1OuzOjaL4IY3f8LM7cuYCcW-Kd_sVcRXA/exec?idss=1f4Rg_uax5Tk6X9Xawo972uDYnll0aHoYGM3NVLrW0rU" await fetch(linkmateri + "&action=uplgmbrmateri", { method: 'post', body: frmdata }) .then(m => m.json()) .then(k => { console.log(k);//.catch(er => console.log(er))
}
const petunjukuploadmateri = () => { document.querySelector(".isipetunjukbuatmateri").innerHTML = `
JUDUL
Contoh penulisan: _KUNCI-PG_1A, 2B, 3C, ...dst...., 40D (diakhir kunci ga boleh ada koma lagi)
Masing-masing kunci jawaban dipisahkan dengan koma.
Contoh penulisan: _KUNCI-PG_1A, 2B, 3C, ...dst...., 40D (diakhir kunci ga boleh ada koma lagi)
Contoh penulisan: _KUNCI-KD_ PKN_3.1 : 1, 2, 3 <||> MTK_3.1 : 4, 5, 6
Default kode Mata pelajaran
HURUF KAPITAL SEMUA
Masing-masing parameter dipisahkan kode <||>
Contoh penulisan: _KUNCI-KD_ PKN_3.1 : 1, 2, 3 <||> MTK_3.1 : 4, 5, 6
Kode | adalah tombol garis tegak lurus yang ada di atas tombol ENTER
copy paste link url, contoh:
https://www.youtube.com/watch?v=GR2jxW4tlkY
kode <|HEADER|> untuk batas garis header
kode <|> untuk batas garis sel
Kode | adalah tombol garis tegak lurus yang ada di atas tombol ENTER
No. Soal:
No. Soal:
No. Soal:
atau
Pilih Salah satu cara Kalian menjawab soal ini
No. Soal:
PECAHAN BIASA
b = penyebut
PECAHAN BIASA CAMPURAN
b = Pembilang
c = penyebut
AKAR KUADRAT
AKAR PANGKAT TIGA
PANGKAT (Semua angka)
b = eksponen
a dan b berupa angka
PANGKAT HURUF (boleh huruf)
b = eksponen
a dan b boleh huruf
Misalnya digunakan untuk menulis rumus matematika, contoh:
Rumus luas lingkaran adalah:
EQUATION EDITOR LAINNYA
equation editor online;
Contoh di atas adalah dengan menggunakan kode: \sqrt{325\frac{2}{3}}
kode di atas dihilangkan spasinya;
Operator pembagian
Tanda Derajat
Suhu di Kota Depok adalah 35 ° Celcius
tanda sudut lancip
tanda sudut siku-siku
Plus Minus (Kurang lebih)
Checklist
Phi
Tanda panah ke kiri
Tanda panah ke kanan
Tanda panah dobel ke kanan
Tanda panah dobel ke kiri
Error Code" + er) } } const daftarnilaikronologi = (id) => { //alert(id) //let teks = "kbmtoday"+ tglStringZero(); idtabaktif.innerHTML = id; koreksidarimana.innerHTML = id + "_kronologi"; // let datamaterilocal = JSON.parse(localStorage.getItem(teks))[id]; let datamaterilocal = kronologijson[id]; let materi = datamaterilocal.idmapel.toUpperCase(); let mtri = datamaterilocal.idmapel; let tagih = datamaterilocal.jenistagihan; let ctok = datamaterilocal.crtToken; //alert (teks) //let kodeunik = tagih + "_" + tglStringZero(); modaldaftarnilaikronologi.style.display = "block"; document.querySelector("#modalidmapelkronologi").innerHTML = "
" + tagih + " " + materi; document.getElementsByClassName("tablinkkronologi")[0].click(); //$.getJSON(constlinknilai+"&action=dataanalisisharian", function(json)) // let kelas = e.parameter.idkelas; // let idmapel = e.parameter.idmapel; // let kodeunik = e.parameter.kodeunik; let paramtambahan = "&idkelas=" + encodeURIComponent(idNamaKelas); // paramtambahan += "&idmapel=" + encodeURIComponent(mtri); // paramtambahan += "&kodeunik=" + encodeURIComponent(kodeunik) // tablinkKDtabel.innerHTML = `` // fetch(constlinknilai + "?action=dataanalisisharian" + paramtambahan) fetch(constlinknilai + "?action=nilairseponkronologi" + paramtambahan) .then(m => m.json()) .then(f => { //console.log(f) let res = f.records; nilairesponkronologi = res.filter(k => k.idmapel == mtri && k.jenistagihan == tagih & k.crtToken == ctok) // nilairesponkronologi = f.records; //console.log(nilairesponkronologi) forModalTabelkronologi(id) } ) } function bukaModalTabkronologi(evt, cityName) { var i, x, tablinks; x = document.getElementsByClassName("citykronologi"); for (i = 0; i < x.length; i++) { x[i].style.display = "none"; } tablinks = document.getElementsByClassName("tablinkkronologi"); for (i = 0; i < x.length; i++) { tablinks[i].classList.remove("w3-light-grey"); } document.getElementById(cityName).style.display = "block"; evt.currentTarget.classList.add("w3-light-grey"); } const forModalTabelkronologi = (id) => { //tes dulu bekerja di id tablinkKDtabel let datamaterilocal = kronologijson[id]; // console.log(datamaterilocal) // // console.log(JSON.parse(datamaterilocal.kuncikd)); let identitasmapel = datamaterilocal.idmapel; let idd = parseInt(id); let datakd = JSON.parse(datamaterilocal.kuncikd); let punyaessay = (datamaterilocal.jumlahessay == 0) ? false : true; // console.log(punyaessay) // console.log("datakd:") // console.log(datakd) let banyakkd = Object.keys(datakd); // console.log("banyakkd:") // console.log(banyakkd.length); // console.log("idKD"); // console.log(banyakkd) // filter untuk dijadikan unik pada key let mapelunik = []; let koleksikd = [] let kdpermapel = {}; for (i = 0; i < banyakkd.length; i++) { let mp = banyakkd[i].split("_")[0] if (mapelunik.indexOf(mp) == -1) { mapelunik.push(mp); } } let koleksinamasiswa = jsondatasiswa.map(k => k.pd_nama) // console.log(kdpermapel); // console.log(mapelunik) //bikin tabel let tabel = document.createElement("table") tabel.setAttribute("class", "versi-table w3-tiny"); tabel.setAttribute("id", "tabel_rekap_KDkronologi"); //bikin head; //let row = tabel.insertRow(0) let rthead = tabel.createTHead(); let rth = rthead.insertRow(0) let rtd = document.createElement("th") rtd.setAttribute("rowspan", 3) rtd.innerHTML = "No" rth.appendChild(rtd); rtd = document.createElement("th") rtd.setAttribute("rowspan", 3) rtd.setAttribute("style", "position:sticky;position:-webkit-sticky;left:0px;box-shadow: inset 0 0 1px #000000"); rtd.innerHTML = "Nama Siswa" rth.appendChild(rtd); // if (punyaessay) { // rtd = document.createElement("th") // rtd.setAttribute("rowspan", 3) // rtd.innerHTML = "Koreksi" // rth.appendChild(rtd); // } rtd = document.createElement("th") rtd.setAttribute("rowspan", 3) rtd.innerHTML = "Aksi" rth.appendChild(rtd); rtd = document.createElement("th") rtd.setAttribute("colspan", banyakkd.length) rtd.innerHTML = "Mata Pelajaran" rth.appendChild(rtd); rth = rthead.insertRow(-1); rth.setAttribute("colspan", banyakkd.length); rth2 = rthead.insertRow(-1) for (k = 0; k < mapelunik.length; k++) { rtd = document.createElement("th") // rtd.innerHTML = mapelunik[k] // rth.appendChild(rtd); let coun = 0; for (j = 0; j < banyakkd.length; j++) { let st = banyakkd[j] if (st.indexOf(mapelunik[k]) > -1) { coun++; //let tekconsol = "Mapel " + mapelunik[k] +"KD " + banyakkd[j]; //console.log(tekconsol) let rtd1 = document.createElement("th") rtd1.innerHTML = banyakkd[j].split("_")[1] + "
" + banyakkd[j] rth2.appendChild(rtd1); } } rtd.innerHTML = mapelunik[k] rtd.setAttribute("colspan", coun) rth.appendChild(rtd); } let tbo = tabel.createTBody(); for (z = 0; z < koleksinamasiswa.length; z++) { let rowisi = tbo.insertRow(-1); let sel = rowisi.insertCell(-1) sel.innerHTML = (z + 1); sel = rowisi.insertCell(-1) sel.setAttribute("style", "position:sticky;position:-webkit-sticky;left:0px;box-shadow: inset 0 0 1px #000000"); sel.innerHTML = koleksinamasiswa[z]; // if (punyaessay) { sel = rowisi.insertCell(-1) sel.innerHTML = tombolaksikronologi(punyaessay, koleksinamasiswa[z], z, idd); // sel.innerHTML = ``; // } for (a = 0; a < mapelunik.length; a++) { // rtd.innerHTML = mapelunik[k] // rth.appendChild(rtd); let coun = 0; for (j = 0; j < banyakkd.length; j++) { let st = banyakkd[j] if (st.indexOf(mapelunik[a]) > -1) { coun++; let tekconsol = "Mapel " + mapelunik[a] + "KD " + banyakkd[j]; //console.log(tekconsol) let sell = rowisi.insertCell(-1) sell.innerHTML = nilaiKDSiswakronologi(koleksinamasiswa[z], banyakkd[j]).replace(".", ",");// banyakkd[j] + "nama = " + koleksinamasiswa[z]; } } } } let idtabel = `tabel_rekap_KDkronologi`; let judul1 = `DAFTAR NILAI PER-KD ${identitasmapel.toUpperCase()} KELAS ${idNamaKelas.toUpperCase()}`; let judul2 = `Semester ${idSemester} Tahun Pelajaran ${idTeksTapel}`; let tekstgl = `${StringTanggal(new Date())}`; let namafile = `DAFTAR NILAI PER-KD ${identitasmapel.toUpperCase()} Kelas ${idNamaKelas} id file ${new Date().getTime()}`; let xx = `${idtabel},${judul1}, ${judul2}, ${tekstgl}`; let xxx = `${idtabel}, ${namafile},${judul1}` tablinkKDkronologitabel.innerHTML = ` |
`; //tablinkKDtabel.appendChild(tombolprint) tablinkKDkronologitabel.appendChild(tabel); let teksket = document.createTextNode("Tombol LJK merah menandakan LJK belum dikoreksi dan belum ada nilai") tablinkKDkronologitabel.appendChild(teksket) let brr = document.createElement("br") tablinkKDkronologitabel.appendChild(brr) teksket = document.createTextNode("Tombol LJK biru menandakan LJK sudah dikoreksi dan sudah ada nilai") tablinkKDkronologitabel.appendChild(teksket) } document.querySelector(".tabpgkronologi").addEventListener("click", function () { let a = parseInt(idtabaktif.innerHTML); formModalTabelAnalisisPGkronologi(a) }) document.querySelector(".tabskorkronologi").addEventListener("click", function () { let a = parseInt(idtabaktif.innerHTML); formModalTabelAnalisisSkorkronologi(a) }) const formModalTabelAnalisisPGkronologi = (id) => { let datamaterilocal = kronologijson[id]; let jumlahpg = (datamaterilocal.jumlahpg == 0) ? 1 : parseInt(datamaterilocal.jumlahpg); let identitasmapel = datamaterilocal.idmapel; //console.log(jumlahpg); let koleksinamasiswa = jsondatasiswa.map(k => k.pd_nama); let tabel = document.createElement("table"); tabel.setAttribute("class", "versi-table w3-tiny"); tabel.setAttribute("id", "table_rekap_pgkronologi"); let thead = tabel.createTHead(); let row = thead.insertRow(0); let th = document.createElement("th"); th.setAttribute("rowspan", 2) th.innerHTML = "No"; row.appendChild(th); th = document.createElement("th"); th.setAttribute("rowspan", 2) th.setAttribute("style", "position:sticky;position:-webkit-sticky;left:0px;box-shadow: inset 0 0 1px #000000"); th.innerHTML = "NAMA SISWA"; row.appendChild(th); th = document.createElement("th"); th.setAttribute("colspan", jumlahpg) th.innerHTML = "NOMOR SOAL"; row.appendChild(th); row = thead.insertRow(-1) if (datamaterilocal.jumlahpg !== 0) { for (b = 0; b < jumlahpg; b++) { th = document.createElement("th"); th.innerHTML = (b + 1); row.appendChild(th); } } else { th = document.createElement("th"); th.innerHTML = "Tidak Ada PG"; row.appendChild(th); } let bdy = tabel.createTBody(); for (c = 0; c < koleksinamasiswa.length; c++) { let tr = bdy.insertRow(-1) let sel = tr.insertCell(-1) sel.innerHTML = (c + 1); sel = tr.insertCell(-1); sel.setAttribute("style", "position:sticky;position:-webkit-sticky;left:0px;box-shadow: inset 0 0 1px #000000"); sel.innerHTML = koleksinamasiswa[c]; if (datamaterilocal.jumlahpg !== 0) { for (d = 0; d < jumlahpg; d++) { sel = tr.insertCell(-1) //sel.innerHTML = OpsiSiswakronologi(koleksinamasiswa[c],"PG_" + (d+1)); if (OpsiSiswakronologi(koleksinamasiswa[c], "PG_" + (d + 1))[0]) { if (OpsiSiswakronologi(koleksinamasiswa[c], "PG_" + (d + 1))[2] == 1) { sel.setAttribute("style", "background-color:aqua"); sel.innerHTML = OpsiSiswakronologi(koleksinamasiswa[c], "PG_" + (d + 1))[1] } else { sel.setAttribute("style", "background-color:red"); sel.innerHTML = OpsiSiswakronologi(koleksinamasiswa[c], "PG_" + (d + 1))[1] } } else { sel.innerHTML = "" } } } else { sel = tr.insertCell(-1) sel.innerHTML = "Tidak ada Soal PG" } } let idtabel = `table_rekap_pgkronologi`; let judul1 = `ANALISIS SOAL ${identitasmapel.toUpperCase()} KELAS ${idNamaKelas.toUpperCase()}`; let judul2 = `Semester ${idSemester} Tahun Pelajaran ${idTeksTapel}`; let tekstgl = `${StringTanggal(new Date())}`; let namafile = `ANALISIS SOAL ${identitasmapel.toUpperCase()} Kelas ${idNamaKelas} id file ${new Date().getTime()}`; let xx = `${idtabel},${judul1}, ${judul2}, ${tekstgl}`; let xxx = `${idtabel}, ${namafile},${judul1}` tablinkPGkronologitabel.innerHTML = ` |
`; //tablinkKDtabel.appendChild(tombolprint) tablinkPGkronologitabel.appendChild(tabel); } const formModalTabelAnalisisSkorkronologi = (id) => { let datamaterilocal = kronologijson[id]; let jumlahpg = parseInt(datamaterilocal.jumlahpg) + parseInt(datamaterilocal.jumlahessay); let identitasmapel = datamaterilocal.idmapel; //console.log(jumlahpg); let koleksinamasiswa = jsondatasiswa.map(k => k.pd_nama); let tabel = document.createElement("table"); tabel.setAttribute("class", "versi-table w3-tiny"); tabel.setAttribute("id", "table_rekap_skorkronologi"); let thead = tabel.createTHead(); let row = thead.insertRow(0); let th = document.createElement("th"); th.setAttribute("rowspan", 2) th.innerHTML = "No"; row.appendChild(th); th = document.createElement("th"); th.setAttribute("rowspan", 2) th.setAttribute("style", "position:sticky;position:-webkit-sticky;left:0px;box-shadow: inset 0 0 1px #000000"); th.innerHTML = "NAMA SISWA"; row.appendChild(th); th = document.createElement("th"); th.setAttribute("colspan", jumlahpg) th.innerHTML = "NOMOR SOAL"; row.appendChild(th); row = thead.insertRow(-1) for (b = 0; b < jumlahpg; b++) { th = document.createElement("th"); th.innerHTML = (b + 1); row.appendChild(th); } let bdy = tabel.createTBody(); for (c = 0; c < koleksinamasiswa.length; c++) { let tr = bdy.insertRow(-1) let sel = tr.insertCell(-1) sel.innerHTML = (c + 1); sel = tr.insertCell(-1); sel.setAttribute("style", "position:sticky;position:-webkit-sticky;left:0px;box-shadow: inset 0 0 1px #000000"); sel.innerHTML = koleksinamasiswa[c]; for (d = 0; d < jumlahpg; d++) { sel = tr.insertCell(-1) // sel.innerHTML = "-"; if (OpsiSiswakronologi(koleksinamasiswa[c], "PG_" + (d + 1))[0]) { if (OpsiSiswakronologi(koleksinamasiswa[c], "PG_" + (d + 1))[2] == 1) { sel.setAttribute("style", "background-color:aqua"); sel.innerHTML = OpsiSiswakronologi(koleksinamasiswa[c], "PG_" + (d + 1))[2] } else { sel.setAttribute("style", "background-color:red"); sel.innerHTML = OpsiSiswakronologi(koleksinamasiswa[c], "PG_" + (d + 1))[2] } } else { sel.innerHTML = "" } } } let idtabel = `table_rekap_skorkronologi`; let judul1 = `ANALISIS SKOR SOAL ${identitasmapel.toUpperCase()} KELAS ${idNamaKelas.toUpperCase()}`; let judul2 = `Semester ${idSemester} Tahun Pelajaran ${idTeksTapel}`; let tekstgl = `${StringTanggal(new Date())}`; let namafile = `ANALISIS SKOR SOAL ${identitasmapel.toUpperCase()} Kelas ${idNamaKelas} id file ${new Date().getTime()}`; let xx = `${idtabel},${judul1}, ${judul2}, ${tekstgl}`; let xxx = `${idtabel}, ${namafile},${judul1}` tablinkSkorkronologitabel.innerHTML = ` |
`; //tablinkKDtabel.appendChild(tombolprint) tablinkSkorkronologitabel.appendChild(tabel); } const tutuploadingljk = () => { $('#infoloadingljk').nextAll('button').remove(); $('#infoloadingljk').nextAll('center').remove(); infoloadingljk.innerHTML = ""; loadingljk.style.display = 'none' } const nilaiKDSiswakronologi = (parNama, keyKD) => { let FilterRec = nilairesponkronologi.filter(k => k.namasiswa == parNama); let jmlh = FilterRec.length, nn; if (jmlh > 0) { //JSON.parse(nilairespon.filter(k => k.namasiswa == "ABIN NUGRAHA")[0].nilaikd) let arry = FilterRec[jmlh - 1].nilaikd let obj = JSON.parse(arry)[keyKD] //nn = JSON.parse(FilterRec[jmlh - 1].nilaikd)[keyKD]; nn = obj //console.log(nn) } else { nn = "" } return nn } const OpsiSiswakronologi = (parNama, keyKD) => { //nilairespon.filter(k=>k.namasiswa == "ABIN NUGRAHA").map(k => [k.PG_1, k.SKOR_1]) let angka = keyKD.match(/(\d+)/)[0] // mengembalikan angkanya aja let cek = nilairesponkronologi.filter(k => k.namasiswa == parNama).map(d => [d[keyKD], d["SKOR_" + angka]]); //nilairespon.filter(k => k.namasiswa == "ABIN NUGRAHA").map(d => d["PG_4"])[0] // let cek = nilairespon.filter(k => k.namasiswa == parNama).map(d => d[keyKD]); let ada = cek.length; // let angka = keyKD.match(/(\d+)/)[0] // mengembalikan angkanya aja // let skoropsi =nilairespon.filter(k => k.namasiswa == parNama).map(d => d["SKOR_" + angka]); let opsinya = []; if (ada > 0) { opsinya = [true, cek[ada - 1][0], cek[ada - 1][1]]; } else { opsinya = [false] } return opsinya } const tombolaksikronologi = (currEssay, parNama, z, idhtmlmateri) => { //let currEssay = ;//ada ga essay? false (jika ga ada) //anggap aja ada essay dulu! let kodehtml = ""; let cek = nilairesponkronologi.filter(k => k.namasiswa == parNama); if (cek.length == 0) { //jika siswa belum mengerjakan, tolong bantu isi! kodehtml = `` } else { // console.log(cek) // console.log(cek[cek.length - 1]) // console.log(cek[cek.length - 1]['nilaiEssay']) let indek = cek.length - 1; let indekk = indek + "<|>" + parNama if (currEssay) { // jika ada essay, cek lagi. Nilai essaynya udah masuk apa belum // jika belum masuk, maka tampilkan tombol koreksi if (cek[indek].nilaiEssay == "") { kodehtml = `
` } else { kodehtml = `
` //
// } } else { kodehtml = `
` } } return kodehtml } const lihatljksaya = (html_jawaban) => { loadingljk.style.display = "block"; infoloadingljk.innerHTML = ` `; $('#infoloadingljk').nextAll('button').remove(); $('#infoloadingljk').nextAll('center').remove(); $.getJSON(constpreviewljk + "?idmateri=" + html_jawaban + "&action=previewriwayat", function (json) { //loadingljk.style.display = "none"; //$("#output").html(brkline(json)) // document.getElementById("judulpetunjuk").innerHTML = "Preview e-Lamaso"; // document.getElementById("isipetunjuk").innerHTML = brkline(json); infoloadingljk.innerHTML = brkline(json).teks + "
"; let tombol = document.createElement("button"); tombol.setAttribute("class", "w3-button w3-dark-grey w3-display-bottommiddle w3-margin-bottom"); tombol.setAttribute("onclick", `printPortrait('infoloadingljk,,,${StringTanggal(new Date())}')`); tombol.innerHTML = ` Cetak` infoloadingljk.after(tombol) }) } const gurumengoreksi2 = (bid) => { //let nilkdstr = cek.nilaikd; //let nilkdobj = JSON.parse(nilkdstr) let indek = bid.split("<|>")[0]; let parnama = bid.split("<|>")[1]; let cek = nilairesponkronologi.filter(k => k.namasiswa == parnama)[indek]; let idbaris = cek.idbaris; let html_jawaban = cek.html_jawaban; let ob = JSON.parse(kronologijson[parseInt(idtabaktif.innerHTML)].kuncikd); let nilaisebelumnya = JSON.parse(cek.nilaikd) console.log(nilaisebelumnya) // let loadingljk.style.display = "block"; infoloadingljk.innerHTML = ` `; $('#infoloadingljk').nextAll('button').remove(); $('#infoloadingljk').nextAll('center').remove(); $.getJSON(constpreviewljk + "?idmateri=" + html_jawaban + "&action=previewriwayat", function (json) { //loadingljk.style.display = "none"; //$("#output").html(brkline(json)) // document.getElementById("judulpetunjuk").innerHTML = "Preview e-Lamaso"; // document.getElementById("isipetunjuk").innerHTML = brkline(json); infoloadingljk.innerHTML = brkline(json).teks + "
"; var elEssay = document.getElementsByClassName("koleksilj") if (elEssay.length !== 0) { for (i = 0; i < elEssay.length; i++) { var idEl = elEssay[i].getAttribute("id"); var inidEl = idEl.replace("untuklj", ""); var tempattombol = document.getElementById("untuklj" + inidEl); var tombolsatu = document.createElement("input"); tombolsatu.setAttribute("type", "number"); tombolsatu.setAttribute("class", "koreksisoal"); // tombolsatu.setAttribute("min", 0); // tombolsatu.setAttribute("max", 100); tombolsatu.setAttribute("onchange", "updatenilaikoreksi()"); tempattombol.innerHTML = "Beri Nilai :"; tempattombol.appendChild(tombolsatu); } } var tengahdulu = document.createElement("center"); tengahdulu.setAttribute("style", "background-color:yellow"); var inputidbaris = document.createElement("input"); inputidbaris.setAttribute("id", "brs"); inputidbaris.setAttribute("value", idbaris); inputidbaris.setAttribute("disabled", "true"); inputidbaris.setAttribute("style", "display:block"); var inputnilaikoreksi = document.createElement("input"); inputnilaikoreksi.setAttribute("type", "number"); inputnilaikoreksi.setAttribute("id", "nilaiakhiressay"); inputnilaikoreksi.setAttribute("disabled", "true"); var tombolkirim = document.createElement("button"); tombolkirim.setAttribute("onclick", "siapkirimnilai()") tombolkirim.innerHTML = "Beri Nilai"; tengahdulu.appendChild(inputidbaris); // let inputt = document.createElement("input"); // inputt.setAttribute("id",) tengahdulu.innerHTML += "Preview Nilai Essay : " tengahdulu.appendChild(inputnilaikoreksi); tengahdulu.appendChild(tombolkirim); let tombol = document.createElement("button"); tombol.setAttribute("class", "w3-button w3-dark-grey w3-display-bottommiddle w3-margin-bottom"); tombol.setAttribute("onclick", `printPortrait('infoloadingljk,,,${StringTanggal(new Date())}')`); tombol.innerHTML = ` Cetak` infoloadingljk.after(tengahdulu) infoloadingljk.after(tombol) }) } const gurumengoreksi3 = (bid) => { let indek = bid.split("<|>")[0]; let parnama = bid.split("<|>")[1]; let cek = nilairesponkronologi.filter(k => k.namasiswa == parnama)[indek]; let idbaris = cek.idbaris; loadingljk.style.display = "block"; infoloadingljk.innerHTML = ` `; let divljk = document.createElement("div"); divljk.setAttribute("id", "divljkkoreksi"); $('#infoloadingljk').nextAll('button').remove(); $('#infoloadingljk').nextAll('center').remove(); let html_jawaban = cek.html_jawaban; $.getJSON(constpreviewljk + "?idmateri=" + html_jawaban + "&action=previewriwayat", function (json) { // infoloadingljk.innerHTML = brkline(json).teks + "
"; infoloadingljk.innerHTML = "";//brkline(json).teks + "
"; infoloadingljk.appendChild(divljk) divljkkoreksi.innerHTML = brkline(json).teks + "
"; var elEssay = document.getElementsByClassName("koleksilj") if (elEssay.length !== 0) { for (i = 0; i < elEssay.length; i++) { var idEl = elEssay[i].getAttribute("id"); var inidEl = idEl.replace("untuklj", ""); var tempattombol = document.getElementById("untuklj" + inidEl); var tombolsatu = document.createElement("input"); tombolsatu.setAttribute("type", "number"); tombolsatu.setAttribute("id", "koreksisoal_" + inidEl); tombolsatu.setAttribute("class", "koreksisoal"); tombolsatu.setAttribute("onchange", `updatenilaikoreksi('${inidEl}')`); tempattombol.innerHTML = `Nilai Koreksi :`; tempattombol.appendChild(tombolsatu); } } //----------------------------------------------------- var tengahdulu = document.createElement("center"); tengahdulu.setAttribute("style", "background-color:yellow"); var inputidbaris = document.createElement("input"); inputidbaris.setAttribute("id", "brs"); inputidbaris.setAttribute("value", idbaris); inputidbaris.setAttribute("disabled", "true"); inputidbaris.setAttribute("style", "display:block"); var inputnilaikoreksi = document.createElement("input"); inputnilaikoreksi.setAttribute("type", "number"); inputnilaikoreksi.setAttribute("id", "nilaiakhiressay"); inputnilaikoreksi.setAttribute("disabled", "true"); var tombolkirim = document.createElement("button"); tombolkirim.setAttribute("onclick", "siapkirimnilai()") tombolkirim.innerHTML = "Beri Nilai"; let inputnilaikd = document.createElement("input") inputnilaikd.setAttribute("id", "nilaikdkoreksi") tengahdulu.appendChild(inputidbaris); tengahdulu.appendChild(inputnilaikd); // let inputt = document.createElement("input"); // inputt.setAttribute("id",) tengahdulu.innerHTML += "Preview Nilai Essay : " tengahdulu.appendChild(inputnilaikoreksi); tengahdulu.appendChild(tombolkirim); let tombol = document.createElement("button"); tombol.setAttribute("class", "w3-button w3-dark-grey w3-display-bottommiddle w3-margin-bottom"); tombol.setAttribute("onclick", `printPortrait('divljkkoreksi,,,${StringTanggal(new Date())}')`); tombol.innerHTML = ` Cetak` //--------------------------------------------------------------- let ob = JSON.parse(kronologijson[parseInt(idtabaktif.innerHTML)].kuncikd); let obnosoal = ubahjsonkuncikd(ob); //console.log(obnosoal) //console.log(obnosoal.length); let dibikin = Object.keys(obnosoal) //console.log(dibikin.length) for (let i = 0; i < dibikin.length; i++) { // console.log(dibikin[i]) // console.log(]) //infoloadingljk.innerHTML += `` let lbl = document.createElement("label") let tek = document.createTextNode("No " + dibikin[i]) lbl.appendChild(tek) let docinput = document.createElement("input") docinput.setAttribute("id", "SKOR_" + dibikin[i]); docinput.setAttribute("class", obnosoal[dibikin[i]]); docinput.setAttribute("name", "SKOR_" + dibikin[i]); docinput.setAttribute("value", cek["SKOR_" + dibikin[i]]); infoloadingljk.appendChild(lbl) infoloadingljk.appendChild(docinput) } docinput = document.createElement("textarea"); //docinput.textContent = json docinput.setAttribute("id", "htmlljkkoreksi") infoloadingljk.appendChild(docinput) // docinput.textcontent // var teksarea = document.getElementById("tekshtmlnilai"); // var isiteks = document.getElementById("borderidhasilakhirnama"); // var teksbtoa = encodeURIComponent(isiteks.innerHTML); // teksarea.textContent = window.btoa(unescape(encodeURIComponent(isiteks.innerHTML))); infoloadingljk.after(tengahdulu) infoloadingljk.after(tombol) }) } function updatenilaikoreksi(id) { let inputedit = document.getElementById("koreksisoal_" + id); if (inputedit.value > 100) { alert("Nilai Maksimum 100, dan minimum 0") inputedit.value = 100; } document.getElementById("SKOR_" + id).value = (inputedit.value / 100).toFixed(2); document.getElementById("nilaiessaykoreksi_" + id).innerHTML = inputedit.value; var kelasinput = document.getElementsByClassName("koreksisoal"); var nilai = 0; for (i = 0; i < kelasinput.length; i++) { nilai += kelasinput[i].value * 1; } /// --------------------------------------------------- var jumlahsoalessaysebenarnya = kronologijson[parseInt(idtabaktif.innerHTML)].jumlahessay; var nilaiakhir = (nilai / jumlahsoalessaysebenarnya).toFixed(2); // document.getElementById("nilaiakhiressay").value = nilai; document.getElementById("nilaiakhiressay").value = nilaiakhir; /// --------------------------------------------------- document.getElementById("nilaiakhiressay").value = nilaiakhir; //document.getElementById("htmlljkkoreksi").textContent = divljkkoreksi.innerHTML; let kd = JSON.parse(kronologijson[parseInt(idtabaktif.innerHTML)].kuncikd) let keykd = Object.keys(kd); // MTK_3.1 , PKN_3.5 let objnilai = {}; for (let k = 0; k < keykd.length; k++) { let nomorsoal = kd[keykd[k]]; let jumlahnomor = nomorsoal.length; let count = 0; let inkd = document.getElementsByClassName(keykd[k]); for (let j = 0; j < inkd.length; j++) { count += inkd[j].value * 1; //console.log(inkd[j].value) } let nilaiakhir = (count / jumlahnomor * 100).toFixed(2) objnilai[keykd[k]] = nilaiakhir } document.getElementById("nilaikdkoreksi").value = JSON.stringify(objnilai) document.getElementById("prevprevnilaikoreksi").innerHTML = `
Skor Essay =
${nilaiakhir}
Skor KD =
${JSON.stringify(objnilai)}` } function updatenilaikoreksi2() { var kelasinput = document.getElementsByClassName("koreksisoal"); var nilai = 0; for (i = 0; i < kelasinput.length; i++) { if (kelasinput[i].value > 100) { alert("Nilai maksimal 100"); kelasinput[i].value = 100; } nilai += kelasinput[i].value * 1; } var jumlahsoalessaysebenarnya = kronologijson[parseInt(idtabaktif.innerHTML)].jumlahessay; var nilaiakhir = (nilai / jumlahsoalessaysebenarnya).toFixed(2); //document.getElementById("nilaiakhiressay").value = nilai; //document.getElementById("nilaiakhiressay").value = nilaiakhir; } const ubahjsonkuncikd = (ob) => { //let ob = JSON.parse(kronologijson[0].kuncikd); let key = Object.keys(ob); let val = Object.keys(ob).map(m => ob[m]); let obnew = {} for (i = 0; i < val.length; i++) { let kol = val[i] for (j = 0; j < kol.length; j++) { obnew[kol[j]] = key[i] } } return obnew } const gurumengoreksi = (bid) => { let indek = bid.split("<|>")[0]; let parnama = bid.split("<|>")[1]; let cek = nilairesponkronologi.filter(k => k.namasiswa == parnama)[indek]; let idbaris = cek.idbaris; let prefikkodeunik = cek.matericode + "_" + cek.kodeunik + "_"; let tagihankoreksi = cek.jenistagihan; let namasiswakoreksi = cek.namasiswa; loadingljk.style.display = "block"; infoloadingljk.innerHTML = ` `; let divljk = document.createElement("div"); divljk.setAttribute("id", "divljkkoreksi"); let formljk = document.createElement("form"); formljk.setAttribute("id", "formgurumengoreksi") //formljk.setAttribute("id", "formgurumengoreksi") $('#infoloadingljk').nextAll('button').remove(); $('#infoloadingljk').nextAll('center').remove(); let html_jawaban = cek.html_jawaban; $.getJSON(constpreviewljk + "?idmateri=" + html_jawaban + "&action=previewriwayat", function (json) { // infoloadingljk.innerHTML = brkline(json).teks + "
"; infoloadingljk.innerHTML = "";//brkline(json).teks + "
"; infoloadingljk.appendChild(divljk) divljkkoreksi.innerHTML = brkline(json).teks + "
"; var elEssay = document.getElementsByClassName("koleksilj") if (elEssay.length !== 0) { for (i = 0; i < elEssay.length; i++) { var idEl = elEssay[i].getAttribute("id"); var inidEl = idEl.replace("untuklj", ""); var tempattombol = document.getElementById("untuklj" + inidEl); var tombolsatu = document.createElement("input"); tombolsatu.setAttribute("type", "number"); tombolsatu.setAttribute("id", "koreksisoal_" + inidEl); tombolsatu.setAttribute("value", cek["SKOR_" + inidEl] * 100); tombolsatu.setAttribute("class", "koreksisoal"); tombolsatu.setAttribute("onchange", `updatenilaikoreksi('${inidEl}')`); tempattombol.innerHTML = `Nilai Koreksi :`; tempattombol.appendChild(tombolsatu); } } //----------------------------------------------------- infoloadingljk.appendChild(formljk); //dibikin fildseet let fieldsett = document.createElement("fieldset") fieldsett.setAttribute("style", "display:none"); fieldsett.setAttribute("id", "kirimanedit"); formgurumengoreksi.appendChild(fieldsett) let ob = JSON.parse(kronologijson[parseInt(idtabaktif.innerHTML)].kuncikd); let obnosoal = ubahjsonkuncikd(ob); //console.log(obnosoal) //console.log(obnosoal.length); let dibikin = Object.keys(obnosoal) //console.log(dibikin.length) for (let i = 0; i < dibikin.length; i++) { // console.log(dibikin[i]) // console.log(]) //infoloadingljk.innerHTML += `` let lbl = document.createElement("label") lbl.setAttribute("for", "SKOR_" + dibikin[i]); let tek = document.createTextNode("No " + dibikin[i]) lbl.appendChild(tek) let docinput = document.createElement("input") docinput.setAttribute("id", "SKOR_" + dibikin[i]); docinput.setAttribute("class", obnosoal[dibikin[i]]); docinput.setAttribute("name", "SKOR_" + dibikin[i]); docinput.setAttribute("value", cek["SKOR_" + dibikin[i]]); kirimanedit.appendChild(lbl) kirimanedit.appendChild(docinput) let gantibaris = document.createElement("br") kirimanedit.appendChild(gantibaris) } var tengahdulu = document.createElement("fieldset"); tengahdulu.setAttribute("style", "background-color:yellow;display:block"); tengahdulu.setAttribute("id", "formedittontonin"); tengahdulu.setAttribute("class", "w3-center"); var inputidbaris = document.createElement("input"); inputidbaris.setAttribute("id", "brs"); inputidbaris.setAttribute("name", "brs"); inputidbaris.setAttribute("class", "w3-input w3-center"); inputidbaris.setAttribute("value", idbaris); // inputidbaris.setAttribute("disabled", "true"); inputidbaris.setAttribute("style", "display:block"); var inputnilaikoreksi = document.createElement("input"); inputnilaikoreksi.setAttribute("type", "number"); inputnilaikoreksi.setAttribute("class", "w3-input w3-center"); inputnilaikoreksi.setAttribute("id", "nilaiakhiressay"); inputnilaikoreksi.setAttribute("name", "nilaiakhiressay"); var tombolkirim = document.createElement("button"); tombolkirim.setAttribute("onclick", "siapkirimnilai()"); tombolkirim.setAttribute("class", "wa"); tombolkirim.innerHTML = "Beri Nilai"; let inputnilaikd = document.createElement("input") inputnilaikd.setAttribute("id", "nilaikdkoreksi"); inputnilaikd.setAttribute("name", "nilaikd"); inputnilaikd.setAttribute("class", "w3-input w3-center"); // inputnilaikd.setAttribute("disabled", false); lbl = document.createElement("label"); lbl.setAttribute("for", "brs") tek = document.createTextNode("ID LJK") lbl.appendChild(tek) kirimanedit.appendChild(lbl) kirimanedit.appendChild(inputidbaris); lbl = document.createElement("label"); lbl.setAttribute("for", "nilaikdkoreksi") tek = document.createTextNode("Nilai Per KD"); lbl.appendChild(tek); kirimanedit.appendChild(lbl) kirimanedit.appendChild(inputnilaikd); // let inputt = document.createElement("input"); // inputt.setAttribute("id",) kirimanedit.innerHTML += "Preview Nilai Essay : " kirimanedit.appendChild(inputnilaikoreksi); tengahdulu.innerHTML += "Preview Nilai Essay : " let sp = document.createElement("span"); sp.setAttribute("id", "prevprevnilaikoreksi") tengahdulu.appendChild(sp) docinput = document.createElement("textarea"); //docinput.textContent = json docinput.setAttribute("id", "htmlljkkoreksi") docinput.setAttribute("name", "htmlljkkoreksi") // formgurumengoreksi.appendChild(docinput) // formgurumengoreksi.appendChild(tengahdulu) kirimanedit.appendChild(docinput) let inputprefik = document.createElement("input"); inputprefik.setAttribute("id", "prefikkodeunik"); inputprefik.setAttribute("name", "prefikkodeunik"); inputprefik.setAttribute("value", prefikkodeunik); kirimanedit.appendChild(inputprefik) inputprefik = document.createElement("input"); inputprefik.setAttribute("id", "jenistagihankoreksi"); inputprefik.setAttribute("name", "jenistagihankoreksi"); inputprefik.setAttribute("value", tagihankoreksi); kirimanedit.appendChild(inputprefik) inputprefik = document.createElement("input"); inputprefik.setAttribute("id", "jenjangkoreksi"); inputprefik.setAttribute("name", "jenjangkoreksi"); inputprefik.setAttribute("value", idJenjang); kirimanedit.appendChild(inputprefik) inputprefik = document.createElement("input"); inputprefik.setAttribute("id", "kelaskoreksi"); inputprefik.setAttribute("name", "kelaskoreksi"); inputprefik.setAttribute("value", idNamaKelas); kirimanedit.appendChild(inputprefik) inputprefik = document.createElement("input"); inputprefik.setAttribute("id", "namasiswakoreksi"); inputprefik.setAttribute("name", "namasiswakoreksi"); inputprefik.setAttribute("value", namasiswakoreksi); kirimanedit.appendChild(inputprefik) formgurumengoreksi.appendChild(tengahdulu) formgurumengoreksi.after(tombolkirim); let tombol = document.createElement("button"); tombol.setAttribute("class", "w3-button w3-dark-grey w3-display-bottommiddle w3-margin-bottom"); tombol.setAttribute("onclick", `printPortrait('divljkkoreksi,,,${StringTanggal(new Date())}')`); tombol.innerHTML = ` Cetak` //--------------------------------------------------------------- // docinput.textcontent // var teksarea = document.getElementById("tekshtmlnilai"); // var isiteks = document.getElementById("borderidhasilakhirnama"); // var teksbtoa = encodeURIComponent(isiteks.innerHTML); // teksarea.textContent = window.btoa(unescape(encodeURIComponent(isiteks.innerHTML))); infoloadingljk.after(tombol) }) } const siapkirimnilai = () => { let hapusinput = document.querySelectorAll(".koreksisoal") for (let i = 0; i < hapusinput.length; i++) { let id = hapusinput[i].getAttribute("id").replace("koreksisoal_", "");//i + 1; let inputedit = document.getElementById("koreksisoal_" + id); document.getElementById("nilaiessaykoreksi_" + id).innerHTML = inputedit.value; hapusinput[i].remove(); } //jaga-jaga jika ada LJK yang mau dikoreksi ulang let ttdkoreksi = document.querySelectorAll(".ttdkoreksi") for (let i = 0; i < ttdkoreksi.length; i++) { ttdkoreksi[i].remove(); } // console.log(hapusinput.length) let isidiv = document.getElementById("divljkkoreksi") let htmlisidiv = isidiv.innerHTML; let nilaikd = JSON.parse(document.querySelector("#nilaikdkoreksi").value); let mapelnya = Object.keys(nilaikd) let teks = ""; teks = `
KD ${mapelnya[i].split("_")[1]}
${namauser}
Pada tanggal =
${tanggalfulllengkap(new Date())}
${f.result}
`; if (iddarimana == "hariini") { getdaftarnilai(idakseskoreksi) } else ( daftarnilaikronologi(idakseskoreksi) ) //setTimeout(tutuploadingljk(), 5000) }) .catch(er => console.log(er)) document.querySelector("#infoloadingljk").innerHTML = `` } const bantusiswaisiljk = (param) => { let params = param.split("_"); let par = params[1];//indek materi kbm parameterbantuisiljk = par; let idsw = params[0];//indek id siswa //alert (par); let siswabantu = JSON.parse(localStorage.getItem("datasiswa_" + idNamaKelas))["datasiswa"][idsw]; loadingljk.style.display = "block"; //bikin judul h4 let datamateri = kronologijson; kodebarismateriyangdikerjakan = datamateri[par].idbaris; let adapg = (datamateri[par].jumlahpg == 0) ? false : true; let jumlahsoal = (datamateri[par].jumlahpg * 1) + (datamateri[par].jumlahessay * 1); //console.log(datamateri) var judul = document.createElement("h4") judul.setAttribute("class", "w3-center"); judul.innerHTML = "Identitas e-Lamaso"; let tes = document.getElementById("infoloadingljk"); // tes.innerHTML = ` On Process ...` tes.innerHTML = ""; //-- Bikin Tabel identitas: var tabelidentitas = document.createElement("table"); tabelidentitas.setAttribute("class", "versi-table"); tabelidentitas.setAttribute("style", "margin:auto"); var tr = tabelidentitas.insertRow(-1); var tr = tabelidentitas.insertRow(-1); var td = tr.insertCell(-1); td.innerHTML = "Sekolah" var td = tr.insertCell(-1); td.innerHTML = datamateri[par].idSekolah var tr = tabelidentitas.insertRow(-1); var td = tr.insertCell(-1); td.innerHTML = "Nama Siswa" var td = tr.insertCell(-1); td.innerHTML = siswabantu.pd_nama; var tr = tabelidentitas.insertRow(-1); var td = tr.insertCell(-1); td.innerHTML = "Kelas" var td = tr.insertCell(-1); td.innerHTML = idNamaKelas; var tr = tabelidentitas.insertRow(-1); var td = tr.insertCell(-1); td.innerHTML = "Mapel/Tema" var td = tr.insertCell(-1); td.innerHTML = datamateri[par].idmapel; var tr = tabelidentitas.insertRow(-1); var td = tr.insertCell(-1); td.innerHTML = "Frekuensi Akses" var td = tr.insertCell(-1); var keteranganakses; if (datamateri[par].idaksessiswa == "sekali") { keteranganakses = "TESTSekali saja sejak mengirim nilai" } else { keteranganakses = "LATIHAN
Berapa kali saja untuk latihan" } td.innerHTML = keteranganakses; var tr = tabelidentitas.insertRow(-1); var td = tr.insertCell(-1); td.innerHTML = "Tanggal Publikasi" var td = tr.insertCell(-1); td.innerHTML = tanggalfulllengkap(datamateri[par].idtgl); var tr = tabelidentitas.insertRow(-1); var cel1 = tr.insertCell(-1); cel1.setAttribute("id", "timer"); cel1.setAttribute("colspan", "2"); cel1.setAttribute("style", "text-align:center"); cel1.innerHTML = "Timer: "; var cdtimer = document.createElement("input") cdtimer.setAttribute("id", "cd_seconds"); cdtimer.setAttribute("disabled", "true"); cdtimer.setAttribute("value", datamateri[par].iddurasi); cdtimer.setAttribute("style", "width:50px") cel1.appendChild(cdtimer); cel1.innerHTML += " Menit." var tr = tabelidentitas.insertRow(-1); var cel1 = tr.insertCell(-1); cel1.setAttribute("id", "tempatdurasi"); cel1.setAttribute("colspan", "2"); cel1.setAttribute("style", "text-align:center"); var cdstatus = document.createElement("b"); cdstatus.setAttribute("id", "cd_status"); var tekscdstatus = document.createTextNode("Durasi Penyelesaian:"); cdstatus.appendChild(tekscdstatus); var cdjam = document.createElement("span"); cdjam.setAttribute("id", "cd_h"); var tekscdjam = document.createTextNode("00:"); cdjam.appendChild(tekscdjam); var cdmenit = document.createElement("span"); cdmenit.setAttribute("id", "cd_m"); var tekscdmenit = document.createTextNode("00:"); cdmenit.appendChild(tekscdmenit); var cddetik = document.createElement("span"); cddetik.setAttribute("id", "cd_s"); var tekscddetik = document.createTextNode("00"); cddetik.appendChild(tekscddetik); var cdpause = document.createElement("input") cdpause.setAttribute("type", "button"); cdpause.setAttribute("id", "cd_pause"); cdpause.setAttribute("value", "Jeda"); var cdpstop = document.createElement("input") cdpstop.setAttribute("type", "button"); cdpstop.setAttribute("id", "cd_stop"); cdpstop.setAttribute("value", "Selesai"); var gntibaris = document.createElement("br"); var controltimer = document.createElement("b") var tekscontroltimer = document.createTextNode("Control Timer:"); controltimer.appendChild(tekscontroltimer); var controlstart = document.createElement("input"); controlstart.setAttribute("type", "button"); controlstart.setAttribute("id", "cd_start"); controlstart.setAttribute("value", "Mulai Mengerjakan"); var controlreset = document.createElement("input"); controlreset.setAttribute("type", "button"); controlreset.setAttribute("id", "cd_reset"); controlreset.setAttribute("value", "Reset Timer"); var titikdua = document.createElement("b"); var tekstitikdua = document.createTextNode(":"); titikdua.appendChild(tekstitikdua); cel1.appendChild(controltimer); cel1.innerHTML += "
"; cel1.appendChild(controlstart); //cel1.appendChild(controlreset); //cel1.appendChild(cdpause); cel1.appendChild(cdpstop); cel1.appendChild(gntibaris); cel1.appendChild(cdstatus); cel1.innerHTML += ":
"; cel1.appendChild(cdjam); cel1.innerHTML += ":"; cel1.appendChild(cdmenit); cel1.appendChild(titikdua) cel1.appendChild(cddetik); tes.appendChild(tabelidentitas); let formljkbantu = document.createElement("form") formljkbantu.setAttribute("id", "ljkbantu") formljkbantu.setAttribute("class", "w3-hide") $.getJSON(constpreviewljk + "?idmateri=" + datamateri[par].idmateri + "&action=previewriwayat", function (json) { document.querySelector("#infoloadingljk").innerHTML += brkline(json).teks; //console.log(kuncijawabanku) var elEssay = document.getElementsByClassName("soalessay") if (elEssay.length !== 0) { for (i = 0; i < elEssay.length; i++) { var idEl = elEssay[i].getAttribute("id"); var inidEl = idEl.replace("essay", ""); var tempattombol = document.getElementById("tomboljawaban" + inidEl); var tombolsatu = document.createElement("button"); tombolsatu.setAttribute("onclick", "tombolketikjawaban2('" + inidEl + "_" + idsw + "')"); var tekstombolsatu = document.createTextNode("Ketik Jawaban No " + inidEl); tombolsatu.appendChild(tekstombolsatu); tempattombol.appendChild(tombolsatu); tempattombol.innerHTML += "
atau " var tomboldua = document.createElement("button"); tomboldua.setAttribute("onclick", "tomboluploadjawaban2('" + inidEl + "_" + idsw + "')"); var tekstomboldua = document.createTextNode("Upload Jawaban No " + inidEl); tomboldua.appendChild(tekstomboldua); tempattombol.appendChild(tomboldua); tempattombol.innerHTML += "
Pilih Salah satu cara Kalian menjawab soal ini" } } //}) //idkelas idmapel namasiswa crtToken jenistagihan kodeunik nilaikd html_jawaban emailguru document.querySelector("#infoloadingljk").appendChild(formljkbantu); let identitasljkbantu = document.createElement("input") identitasljkbantu.setAttribute("id", "idkelas") identitasljkbantu.setAttribute("name", "idkelas") identitasljkbantu.setAttribute("value", idNamaKelas); document.getElementById("ljkbantu").appendChild(identitasljkbantu); identitasljkbantu = document.createElement("input") identitasljkbantu.setAttribute("id", "idmapel") identitasljkbantu.setAttribute("name", "idmapel") identitasljkbantu.setAttribute("value", datamateri[par].idmapel); document.getElementById("ljkbantu").appendChild(identitasljkbantu); identitasljkbantu = document.createElement("input") identitasljkbantu.setAttribute("id", "crtToken") identitasljkbantu.setAttribute("name", "crtToken") identitasljkbantu.setAttribute("value", datamateri[par].crtToken); document.getElementById("ljkbantu").appendChild(identitasljkbantu); identitasljkbantu = document.createElement("input") identitasljkbantu.setAttribute("id", "jenistagihan") identitasljkbantu.setAttribute("name", "jenistagihan") identitasljkbantu.setAttribute("value", datamateri[par].jenistagihan); document.getElementById("ljkbantu").appendChild(identitasljkbantu); identitasljkbantu = document.createElement("input") identitasljkbantu.setAttribute("id", "kodeunik") identitasljkbantu.setAttribute("name", "kodeunik") identitasljkbantu.setAttribute("value", datamateri[par].jenistagihan + "_" + datamateri[par].crtToken); document.getElementById("ljkbantu").appendChild(identitasljkbantu); identitasljkbantu = document.createElement("textarea") identitasljkbantu.setAttribute("id", "buathtmlbantu") identitasljkbantu.setAttribute("name", "tekshtmlnilai") identitasljkbantu.setAttribute("value", "buathtmlbantu"); document.getElementById("ljkbantu").appendChild(identitasljkbantu); identitasljkbantu = document.createElement("input") identitasljkbantu.setAttribute("id", "nilaikd") identitasljkbantu.setAttribute("name", "nilaikd") identitasljkbantu.setAttribute("value", "Nilai KD Otomatis"); document.getElementById("ljkbantu").appendChild(identitasljkbantu); //idtoken idsekolah nilaiPG idbaris nilaiEssay matericode identitasljkbantu = document.createElement("input") identitasljkbantu.setAttribute("id", "idtoken") identitasljkbantu.setAttribute("name", "idtoken") identitasljkbantu.setAttribute("value", datamateri[par].idtoken); document.getElementById("ljkbantu").appendChild(identitasljkbantu); identitasljkbantu = document.createElement("input") identitasljkbantu.setAttribute("id", "idsekolah") identitasljkbantu.setAttribute("name", "idsekolah") identitasljkbantu.setAttribute("value", idNamaSekolah); document.getElementById("ljkbantu").appendChild(identitasljkbantu); identitasljkbantu = document.createElement("input") identitasljkbantu.setAttribute("id", "nilaiPG") identitasljkbantu.setAttribute("name", "nilaiPG") // identitasljkbantu.setAttribute("value", "Nilai PG "); document.getElementById("ljkbantu").appendChild(identitasljkbantu); identitasljkbantu = document.createElement("input") identitasljkbantu.setAttribute("id", "nilaiEssay") identitasljkbantu.setAttribute("name", "nilaiEssay") // identitasljkbantu.setAttribute("value", "nilaiEssay"); document.getElementById("ljkbantu").appendChild(identitasljkbantu); identitasljkbantu = document.createElement("input") identitasljkbantu.setAttribute("id", "matericode") identitasljkbantu.setAttribute("name", "matericode") identitasljkbantu.setAttribute("value", datamateri[par].idbaris); document.getElementById("ljkbantu").appendChild(identitasljkbantu); identitasljkbantu = document.createElement("input") identitasljkbantu.setAttribute("id", "namasiswa") identitasljkbantu.setAttribute("name", "namasiswa") identitasljkbantu.setAttribute("value", siswabantu.pd_nama); document.getElementById("ljkbantu").appendChild(identitasljkbantu); identitasljkbantu = document.createElement("div") identitasljkbantu.setAttribute("id", "inputpgdanskor") identitasljkbantu.innerHTML = "tempat PG dan Skor:
" document.getElementById("ljkbantu").appendChild(identitasljkbantu); //---nosoalpada skor, dan PG_1 let obnosoal = JSON.parse(datamateri[par].kuncikd) let ob = ubahjsonkuncikd(obnosoal) let dibikin = Object.keys(ob); for (let i = 0; i < dibikin.length; i++) { let lbl = document.createElement("label") lbl.setAttribute("for", "SKOR_" + dibikin[i]); let tek = document.createTextNode("No " + dibikin[i]) lbl.appendChild(tek) let docinput = document.createElement("input") docinput.setAttribute("id", "SKOR_" + dibikin[i]); docinput.setAttribute("class", "hitungskor"); docinput.setAttribute("name", "SKOR_" + dibikin[i]); docinput.setAttribute("value", ""); inputpgdanskor.appendChild(lbl); let br = document.createElement("br") inputpgdanskor.appendChild(br) inputpgdanskor.appendChild(docinput); br = document.createElement("br") inputpgdanskor.appendChild(br) } let nopg = datamateri[par].jumlahpg; for (let j = 0; j < nopg; j++) { lbl = document.createElement("label") lbl.setAttribute("for", "PG_" + (j + 1)); let tek = document.createTextNode("No PG " + (j + 1)) lbl.appendChild(tek) docinput = document.createElement("input") docinput.setAttribute("id", "PG_" + (j + 1)); docinput.setAttribute("class", "hitungpg"); docinput.setAttribute("name", "PG_" + (j + 1)); docinput.setAttribute("value", ""); inputpgdanskor.appendChild(lbl); let br = document.createElement("br") inputpgdanskor.appendChild(br) inputpgdanskor.appendChild(docinput); br = document.createElement("br") inputpgdanskor.appendChild(br) } identitasljkbantu = document.createElement("div") identitasljkbantu.setAttribute("id", "previewljkbantu") identitasljkbantu.setAttribute("class", "w3-card-4 w3-padding") identitasljkbantu.setAttribute("style", "display:none") identitasljkbantu.innerHTML = "previewljkbantu" document.getElementById("ljkbantu").after(identitasljkbantu); // identitasljkbantu = document.createElement("button") // identitasljkbantu.setAttribute("onclick", "cekljk()") // identitasljkbantu.setAttribute("class", "w3-button w3-card-4 w3-blue") // identitasljkbantu.innerHTML = "Preview LJK" // document.getElementById("ljkbantu").after(identitasljkbantu); previewljkbantu.innerHTML = buathtmlljk(adapg); selwaktumulai.innerHTML = tanggalfulllengkap(new Date()); hasilakhirnamasiswa.innerHTML = siswabantu.pd_nama; hasilakhirmapeltema.innerHTML = datamateri[par].idmapel.toUpperCase(); let kuncijawabanku = ""; if (adapg) { kuncijawabanku = brkline(json).kunci; document.querySelector("#infoloadingljk").innerHTML += `` } else { document.querySelector("#infoloadingljk").innerHTML += `` } }) } const cekljk = () => { var x = document.getElementById("previewljkbantu"); if (x.style.display === "none") { x.style.display = "block"; } else { x.style.display = "none"; } } function PGBenar(opsi, kuncijawaban) { // kebalik, hahahaha var benarsalah; let benar = opsi.filter(f => f == kuncijawaban); if (benar.length == 1) { benarsalah = "Benar" } else { benarsalah = "Salah" } // if (opsi.indexOf(kuncijawaban) > -1) { // benarsalah = "Benar" // } else { // benarsalah = "Salah" // } // return benarsalah return benarsalah } function pgskor(opsik, kuncijawaban) { // kebalik, hahahaha var benarsalah; let opsi = opsik.split(","); let benar = opsi.filter(f => f == kuncijawaban); // let benar = kuncijawaban.filter(f => f == opsi); if (benar.length == 1) { benarsalah = 1; } else { benarsalah = 0; } // if (opsi.indexOf(kuncijawaban) > -1) { // benarsalah = "Benar" // } else { // benarsalah = "Salah" // } // return benarsalah return benarsalah } const hasilakhirelamaso = (par) => { hasilakhirwaktu.innerHTML = tanggalfulllengkap(new Date()); let koleksiceklis = [] let datakuncikd = JSON.parse(kronologijson[parameterbantuisiljk].kuncikd);//JSON.parse(localStorage.getItem("kuncikd")) let keyarray = Object.keys(datakuncikd); let obj = {}; for (l = 0; l < keyarray.length; l++) { let valu = datakuncikd[keyarray[l]]; // [1, 2, 3, 4, dst] let valulengt = valu.length; // [banyaknya array di atas] let coun = 0; for (z = 0; z < valu.length; z++) { // nomor soal pada kunciKD for (m = 0; m < koleksiceklis.length; m++) { //jawaban siswa 1A, 2B var skor = (PGBenar(arrkunci, koleksiceklis[m]) == "Benar") ? 1 : 0; if (parseInt(valu[z]) == parseInt(koleksiceklis[m])) { coun += skor } } } let nilaikd = (coun / valulengt * 100).toFixed(2); obj[keyarray[l]] = nilaikd } nilaikd.value = JSON.stringify(obj) // tempatinputpilihanganda.innerHTML += "Nilai KD
" // var resulthasilessay = "JAWABAN ESSAY:
";; var resulthasilessay = (kronologijson[parameterbantuisiljk].jumlahessay == 0) ? "" : "JAWABAN ESSAY:
";; //resulthasilessay += ""; var elFilejawaban = document.getElementsByClassName("filejawaban"); if (elFilejawaban.length > 0) { //mengantisipasi jika tidak ada filejawaban kosong ga perlu dieksekusi for (var c = 0; c < elFilejawaban.length; c++) { var innernya = elFilejawaban[c].tagName; var noessay = elFilejawaban[c].getAttribute("id").replace("filejawaban", ""); //console.log(innernya) if (innernya == "TEXTAREA") { resulthasilessay += "
- Pertanyaan::
Nilai ";
resulthasilessay += "
"; } else { resulthasilessay += ""; resulthasilessay += document.getElementById("pertanyaanessay_" + noessay).innerHTML + "
Jawaban::
"; resulthasilessay += elFilejawaban[c].value.split("\n").join("
"); resulthasilessay += "
- Pertanyaan::
Nilai ";
resulthasilessay += "
"; } } } resumenilaiskhir.innerHTML = resulthasilessay; buathtmlbantu.textContent = window.btoa(unescape(encodeURIComponent(previewljkbantu.innerHTML))); let iddarimana = (koreksidarimana.innerHTML).split("_")[1]; let idakseskoreksi = (koreksidarimana.innerHTML).split("_")[0]; let namaform = document.getElementById("ljkbantu") let dataform = new FormData(namaform); fetch(constlinknilai + "?action=gurukirimnilai", { method: 'post', body: dataform }) .then(u => u.json()) .then(q => { document.getElementById("infoloadingljk").innerHTML = q.result; if (iddarimana == "hariini") { getdaftarnilai(idakseskoreksi) } else ( daftarnilaikronologi(idakseskoreksi) ) }) .catch(er => console.log(er)) document.getElementById("infoloadingljk").innerHTML = ` proses kirim ....`; } const hasilakhirelamasopg = (par) => { hasilakhirwaktu.innerHTML = tanggalfulllengkap(new Date()); let kuncijawaban = window.atob(par); let arrkunci = kuncijawaban.split(",") tabelpgbantu.innerHTML = "" let tr = tabelpgbantu.insertRow(0); let th = document.createElement("th"); th.innerHTML = "Jawaban"; tr.appendChild(th); th = document.createElement("th") th.innerHTML = "Kunci" tr.appendChild(th) th = document.createElement("th") th.innerHTML = "Nilai" tr.appendChild(th) let benarsalah = ""; let skorpg = 0; let opsipg = document.getElementsByClassName("calc"); let koleksiceklis = [] for (let i = 0; i < opsipg.length; i++) { if (opsipg[i].checked) { let idpg = opsipg[i].getAttribute("id"); let nosoalinput = idpg.match(/(\d+)/)[0] // mengembalikan angkanya aja benarsalah = PGBenar(arrkunci, idpg); document.getElementById("PG_" + nosoalinput).value = idpg.replace(nosoalinput, ""); document.getElementById("SKOR_" + nosoalinput).value = pgskor(kuncijawaban, idpg); tr = tabelpgbantu.insertRow(-1) let sel = tr.insertCell(-1); sel.innerHTML = idpg; sel = tr.insertCell(-1); sel.innerHTML = arrkunci[nosoalinput - 1]; sel = tr.insertCell(-1); sel.innerHTML = benarsalah; if (benarsalah == "Benar") { skorpg++ } koleksiceklis.push(idpg) } } let jumlahpg = kronologijson[parameterbantuisiljk].jumlahpg; nilaiPG.value = ((skorpg / jumlahpg) * 100).toFixed(2) tr = tabelpgbantu.insertRow(-1); sel = tr.insertCell(-1); sel.setAttribute("colspan", 2) sel.innerHTML = "SKOR PG"; sel = tr.insertCell(-1); sel.innerHTML = ((skorpg / jumlahpg) * 100).toFixed(2); let inputskor = document.querySelectorAll(".hitungskor"); // let datakuncikd = JSON.parse(kronologijson[parameterbantuisiljk].kuncikd) // let keyarray = Object.keys(datakuncikd); // let obj = {} // for (let m = 0; m < keyarray.length; m++) { // for (let k = 0; k < inputskor.length; k++) { // } // } let datakuncikd = JSON.parse(kronologijson[parameterbantuisiljk].kuncikd);//JSON.parse(localStorage.getItem("kuncikd")) let keyarray = Object.keys(datakuncikd); let obj = {}; for (l = 0; l < keyarray.length; l++) { let valu = datakuncikd[keyarray[l]]; // [1, 2, 3, 4, dst] let valulengt = valu.length; // [banyaknya array di atas] let coun = 0; for (z = 0; z < valu.length; z++) { // nomor soal pada kunciKD for (m = 0; m < koleksiceklis.length; m++) { //jawaban siswa 1A, 2B var skor = (PGBenar(arrkunci, koleksiceklis[m]) == "Benar") ? 1 : 0; if (parseInt(valu[z]) == parseInt(koleksiceklis[m])) { coun += skor } } } let nilaikd = (coun / valulengt * 100).toFixed(2); obj[keyarray[l]] = nilaikd } nilaikd.value = JSON.stringify(obj) // tempatinputpilihanganda.innerHTML += "Nilai KD"; resulthasilessay += document.getElementById("pertanyaanessay_" + noessay).innerHTML + "
Jawaban::
"; resulthasilessay += elFilejawaban[c].outerHTML; resulthasilessay += "
" // var resulthasilessay = "JAWABAN ESSAY:
";; var resulthasilessay = (kronologijson[parameterbantuisiljk].jumlahessay == 0) ? "" : "JAWABAN ESSAY:
";; //resulthasilessay += ""; var elFilejawaban = document.getElementsByClassName("filejawaban"); if (elFilejawaban.length > 0) { //mengantisipasi jika tidak ada filejawaban kosong ga perlu dieksekusi for (var c = 0; c < elFilejawaban.length; c++) { var innernya = elFilejawaban[c].tagName; var noessay = elFilejawaban[c].getAttribute("id").replace("filejawaban", ""); //console.log(innernya) if (innernya == "TEXTAREA") { resulthasilessay += "
- Pertanyaan::
Nilai ";
resulthasilessay += "
"; } else { resulthasilessay += ""; resulthasilessay += document.getElementById("pertanyaanessay_" + noessay).innerHTML + "
Jawaban::
"; resulthasilessay += elFilejawaban[c].value.split("\n").join("
"); resulthasilessay += "
- Pertanyaan::
Nilai ";
resulthasilessay += "
"; } } } resumenilaiskhir.innerHTML = resulthasilessay; buathtmlbantu.textContent = window.btoa(unescape(encodeURIComponent(previewljkbantu.innerHTML))); let iddarimana = (koreksidarimana.innerHTML).split("_")[1]; let idakseskoreksi = (koreksidarimana.innerHTML).split("_")[0]; let namaform = document.getElementById("ljkbantu") let dataform = new FormData(namaform); fetch(constlinknilai + "?action=gurukirimnilai", { method: 'post', body: dataform }) .then(u => u.json()) .then(q => { document.getElementById("infoloadingljk").innerHTML = q.result; if (iddarimana == "hariini") { getdaftarnilai(idakseskoreksi) } else ( daftarnilaikronologi(idakseskoreksi) ) }) .catch(er => console.log(er)) document.getElementById("infoloadingljk").innerHTML = ` proses kirim ....`; } const hapusljk = (idbaris) => { let cekcrtToken = kronologijson.filter(k => k.idbaris = idbaris) alert("pengen hapus data baris ke-" + idbaris + " di SS jenjang kelas " + idJenjang + " dan ini crtTokennya " + cekcrtToken[0].crtToken) let idok = cekcrtToken[0].crtToken; let dataform = new FormData(); dataform.append("idbaris", idbaris); dataform.append("idok", idok); fetch(constlinknilai + "?action=hapusljk", { method: 'post', body: dataform }).then(m => m.json()) .then(f => { alert(f.result); refreshdatakdkd(); }) .catch(er => alert(er)) } const refreshdatakdkd = () => { let iddarimana = (koreksidarimana.innerHTML).split("_")[1]; let idakseskoreksi = (koreksidarimana.innerHTML).split("_")[0]; if (iddarimana == "hariini") { getdaftarnilai(idakseskoreksi) } else ( daftarnilaikronologi(idakseskoreksi) ) } const buathtmlljk = (adapg) => { let tekshtml = ""; if (adapg) { tekshtml = `"; resulthasilessay += document.getElementById("pertanyaanessay_" + noessay).innerHTML + "
Jawaban::
"; resulthasilessay += elFilejawaban[c].outerHTML; resulthasilessay += "
Nilai Belajar
oleh Guru
oleh Guru
Nilai Belajar
oleh Guru
oleh Guru
Ganti dengan mengupload media:"; var tombollain = document.createElement("button") tombollain.setAttribute("onclick", "tomboluploadjawaban2('" + idpar + "')"); tombollain.innerHTML = "Upload Jawaban No " + id tempatnya.appendChild(tombollain); tempatnya.innerHTML += " dengan memilih cara lain, jawaban yang sudah diketik akan hilang dan diganti dengan jawaban berupa gambar/media yang diunggah" } function tomboluploadjawaban2(idpar) { //alert("Tombol Upload Jawbaan No " + id) console.log(idpar) let id = idpar.split("_")[0] var tempatnya = document.getElementById("tomboljawaban" + id); var katajadi = ""; tempatnya.innerHTML = ""; // var divbackground = document.createElement("div"); // divbackground.setAttribute("style","background-color:#ffcdc9;padding:10px"); // divbackground.innerHTML = "Upload Media(Poto, audio, video, pdf, word/txt, dll) jawaban essay No " + id + " dengan menguploadnya di sini:
"; // var labelupload = document.createElement("label"); // labelupload.setAttribute("style", "border:1px solid black;background-color:#eee;padding:5px;border-radius:5px"); // labelupload.setAttribute("for", katajadi += "
"; katajadi += "
"; katajadi += "
Ganti dengan mengetik jawaban:"; katajadi += ""; katajadi += " dengan memilih cara lain, jawaban yang sudah diupload akan hilang dan diganti dengan jawaban berupa ketikan/tulisan" //----------------------------- tempatnya.innerHTML = katajadi; } function uploadpotoessay(idpar) { console.log(idpar) let id = idpar.split("_")[0]; let idsw = idpar.split("_")[1]; var item = document.getElementById("iduploadpotoessay" + id).files[0]; var tempat = document.getElementById("filejawaban" + id); let total = (1048576 / item.size).toFixed(2); tempat.innerHTML = ` Sedang proses, mohon tunggu ...` let ekstensi = item.name.substring(item.name.lastIndexOf('.') + 1); var filename; // format nama file = kodetokensiswa_kelas_nomateri_nosoal let tokensiswa = JSON.parse(localStorage.getItem("datasiswa_" + idNamaKelas))["datasiswa"][idsw].id; filename = idNamaKelas + "_" + tokensiswa + "_MateriKoreksi_" + kodebarismateriyangdikerjakan + "_essayno_" + id; let dataaa = "" var ofReader = new FileReader(); ofReader.readAsDataURL(item); ofReader.onload = async function (e) { let base64 = e.target.result.replace(/^.*,/, ''); let mmtype = e.target.result.match(/^.*(?=;)/)[0]; dataaa = e.target.result let datafom = new FormData() datafom.append("base64", base64); datafom.append("mmtype", mmtype); datafom.append("kelas", idNamaKelas); datafom.append("filename", filename); datafom.append("ekstensi", ekstensi); await fetch(constlinknilai + "?action=siswauploadmedia", { method: 'post', body: datafom }).then(m => m.json()) .then(k => { tempat.innerHTML = k.result }) .catch(er => { tempat.innerHTML = "Ups, Maaf. Media gagal diunggah ke server.
Kode Error: " + er; }) } } const simpancatatansementara = () => { let isiteks = document.formuploadmateri.idmateri.value if (isiteks == "") { alert("Maaf, Draft Anda kosong .... :("); return } let idmapel = document.formuploadmateri.idmapel.value; let iddurasi = document.formuploadmateri.iddurasi.value; let idaksessiswa = document.formuploadmateri.idaksessiswa.value; let jenistagihan = document.formuploadmateri.jenistagihan.value; let idtgl = document.formuploadmateri.idtgl.value; let idtglend = document.formuploadmateri.idtglend.value; let botakin = window.btoa(unescape(encodeURIComponent(isiteks))); let obj = {}; obj.idmapel = idmapel; obj.iddurasi = iddurasi; obj.jenistagihan = jenistagihan; obj.idaksessiswa = idaksessiswa; obj.idtgl = idtgl; obj.idtglend = idtglend; obj.botakin = botakin; window.localStorage.setItem("drafmateri", JSON.stringify(obj)) alert("Draf, berhasil disimpan") } const taruhcatatansementara = () => { let idmapel = document.formuploadmateri.idmapel; let iddurasi = document.formuploadmateri.iddurasi; let idaksessiswa = document.formuploadmateri.idaksessiswa; let jenistagihan = document.formuploadmateri.jenistagihan; let idtgl = document.formuploadmateri.idtgl; let idtglend = document.formuploadmateri.idtglend; let isiteks = document.formuploadmateri.idmateri if (localStorage.hasOwnProperty("drafmateri")) { let teks = JSON.parse(localStorage.getItem("drafmateri")) idmapel.value = teks.idmapel; iddurasi.value = teks.iddurasi; idaksessiswa.value = teks.idaksessiswa; jenistagihan.value = teks.jenistagihan; idtgl.value = teks.idtgl; idtglend.value = teks.idtglend; let botakin = teks.botakin; isiteks.textContent = window.atob(botakin) alert("Anda mempunyai Draft") } else { alert("Maaf, Anda tidak memiliki Draft.") } } const editfilemateri = (id) => { let file = kronologijson[id];//.idmateri; let idbaris = file.idbaris; let time = new Date(file.idtgl).getTime() let now = new Date().getTime() if (now > time) { alert("Perhatian! Materi ini sedang/Sudah/Telah lewat dipublikasikan saat ini. Mungkin saja siswa Anda sudah mengirimkan pekejaannya dari materi ini. Jika mengedit alokasi waktu awal Anda akan kehilangan data REKAP PENILAIAN yang berlangsung, dan Materi akan diganti dengan materi yang Anda Edit (overwrite). Hindari mengubah Alokasi Waktu Awal jika Alokasi awal sudah berlangsung karena Rekap Penilaian Anda tidak sinkron."); // return } // document.getElementsByClassName("tablinks")[2].click(); //openCity(event, 'upload_materi') // lainnya tutup tabcontent = document.getElementsByClassName("tabcontent"); for (i = 0; i < tabcontent.length; i++) { tabcontent[i].style.display = "none"; } tablinks = document.getElementsByClassName("tablinks"); for (i = 0; i < tablinks.length; i++) { tablinks[i].className = tablinks[i].className.replace(" active", ""); } document.getElementById("upload_materi").style.display = "block"; let idmapel = document.formuploadmateri.idmapel; let iddurasi = document.formuploadmateri.iddurasi; let idaksessiswa = document.formuploadmateri.idaksessiswa; let jenistagihan = document.formuploadmateri.jenistagihan; let idtgl = document.formuploadmateri.idtgl; let idtglend = document.formuploadmateri.idtglend; let isiteks = document.formuploadmateri.idmateri; idmapel.value = file.idmapel; iddurasi.value = file.iddurasi; idaksessiswa.value = file.idaksessiswa; jenistagihan.value = file.jenistagihan; idtgl.value = file.idtgl; idtglend.value = file.idtglend; let botakin = file.idmateri; let idm = encodeURIComponent(botakin) tombolpublikasikan.setAttribute("onclick", `editfilematerikeserver('${idbaris}')`) tombolpublikasikan.removeAttribute("class");//.wa w3-deep-purple w3-hover-aqua); tombolpublikasikan.setAttribute("class", "wa w3-red w3-hover-aqua"); tombolpublikasikan.innerHTML = "EDIT KONTEN MATERI" // $.getJSON(linkmateri + "&idmateri=" + idm + "&action=previewriwayat", function (json) { }) fetch(linkmateri + "&action=previewriwayat&idmateri=" + idm).then(m => m.json()) .then(k => { isiteks.textContent = k }).catch(er => { isiteks.textContent = er }) //alert("Anda membuka link upload materi") } const editfilematerikeserver = (id) => { let tglkosong = document.formuploadmateri.idtgl.value let boltgl = (tglkosong == "") ? alert('Waktu Mulai tidak boleh kosong') : true; let mapel = document.formuploadmateri.idmapel.value; let bolmapel = (mapel == "") ? alert('Identitas pembelajaran tidak boleh kosong') : true; let kuncikosong = document.formuploadmateri.kuncikd.value; let bolkd = (kuncikosong == "") ? alert("Anda belum membuat sebaran KD") : true; if (bolmapel && boltgl && bolkd) { let dom = document.getElementById("formuploadmateri"); let data = new FormData(dom); data.append("idbaris", id) pranalamateri.style.display = "block"; dom.reset(); dom.idmateri.value = ""; idpracetak.innerHTML = ` On Proess kirim` let url = linkmateri + "&action=materiedit" fetch(url, { method: 'post', body: data }) .then(m => m.json()) .then(f => { idpracetak.innerHTML = f.result; loadketkunci.innerHTML = ""; loadketKD.innerHTML = ""; //console.log(f) pembelajaran(); updatematerikan(); }) .catch(er => idpracetak.innerHTML = "Maaf, terjadi kesalahan:
Error Code" + er) } localStorage.removeItem("draftmateri") tombolpublikasikan.setAttribute("onclick", "publikasikanmateribaru()") tombolpublikasikan.removeAttribute("class");//.wa w3-deep-purple w3-hover-aqua); tombolpublikasikan.setAttribute("class", "wa w3-deep-purple w3-hover-aqua"); tombolpublikasikan.innerHTML = "PUBLIKASIKAN"; }