Skip to content

Commit

Permalink
fix notRs duplicates
Browse files Browse the repository at this point in the history
  • Loading branch information
ThejasKiranPS committed Jun 22, 2021
1 parent 89c5fb4 commit 00828be
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 6 deletions.
2 changes: 1 addition & 1 deletion results/results.html
Original file line number Diff line number Diff line change
Expand Up @@ -34,4 +34,4 @@ <h1 class="heading">Attendance Marker</h1>
</div>
<script src="./results.js"></script>
</body>
</html>
</html>
8 changes: 3 additions & 5 deletions results/results.js
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,6 @@ checkAttendance().then(() => {
// console.log(absent);
// console.log(notRecognised);
// console.log(present);
// console.log('---------');
displayResults(dbName, students, absent, present, notRecognised);
}
});
Expand Down Expand Up @@ -122,7 +121,7 @@ function fetchDate(length = "min") {
function markAttendance(students, absent, dbName) {
let attendance = getAttendance(students, absent);
chrome.storage.sync.get(dbName, (record) => {
console.log(record);
//console.log(record);
if (Object.keys(record).length == 0) {
//console.log("adding");
newRecord(dbName, students);
Expand All @@ -134,9 +133,7 @@ function markAttendance(students, absent, dbName) {
}

function displayResults(dbName, students, absent, present, notRecognised) {
//console.log('--------');
//console.log(absent,present,notRecognised);
//console.log('--------');
function setActions() {
//console.log('fncalled');
let abtns = document.querySelectorAll(".absent-container");
Expand All @@ -148,6 +145,7 @@ function displayResults(dbName, students, absent, present, notRecognised) {
e.children[1].classList.toggle("slide-show");
};
e.children[1].onclick = () => {
console.log('delete btn callled');
const index = Array.from(abtns).indexOf(e);
present.push(absent[index]);
absent.splice(index, 1);
Expand All @@ -172,7 +170,7 @@ function displayResults(dbName, students, absent, present, notRecognised) {
notRecognised.forEach((student) => {
notRs += `<div class="box item-box">${student}</div>`;
});
document.querySelector(".notR").innerHTML += notRs;
document.querySelector(".notR").innerHTML = notRs;
setAbs();
//number of students
document.querySelector(".abs-box").innerHTML =
Expand Down

0 comments on commit 00828be

Please sign in to comment.