Skip to content

Commit

Permalink
Student connections will now pull from the matched student in the 'st…
Browse files Browse the repository at this point in the history
…udents' data. Meaning emails will default to the first if there is one, but the ZOOM file has none.

Time will not show AM/PM to support 24-hour formatted timestamps.
  • Loading branch information
HunterAhlquist committed Dec 2, 2021
1 parent 0623afd commit ebe3756
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 4 deletions.
7 changes: 6 additions & 1 deletion js/AliasEditor.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,12 @@ studentEditSelector.addEventListener('change', function () { //change student to

//click events
studentSaveButton.addEventListener('click', function () {
let emails = tagify_Email.value;
let emails = [];
for (let e of tagify_Email.value) {
console.log(e.value);
emails.push(e.value);
}

if (studentSaveButton.value === "add") { //add new
if (studentIDField.value !== "" && studentNameField.value !== "") {
let newStudent = new Student(studentIDField.value, studentNameField.value, emails);
Expand Down
6 changes: 5 additions & 1 deletion js/ZOOMparse.js
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,6 @@ function processLine(curLine) {
let matchResult = FindMatchFromStudentAttendance(curLine);
if (matchResult.student !== null) {
if (matchResult.unmatchedEmail !== null && matchResult.unmatchedEmail.length > 0) {//new email found with name
console.log("Adding new email");
students[students.indexOf(matchResult.student)].addKnownEmail(curLine[1]);
}
if (matchResult.unmatchedName !== null) {//new name found with email (might be a ZOOM username)
Expand All @@ -74,6 +73,11 @@ function processLine(curLine) {
connectionMatch = new StudentConnection();
connectionMatch.name = curLine[0];
connectionMatch.email = curLine[1];
if (matchResult.student.emails.length > 0) {
console.log(matchResult.student.emails[0]);
connectionMatch.email = matchResult.student.emails[0];
}

connectionMatch.addTime(curLine[4]);
studentsConnections.push(connectionMatch);

Expand Down
3 changes: 1 addition & 2 deletions js/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ const initApp = () => {

droparea.addEventListener("drop", handleDrop);
document.querySelector('#zoomLink').addEventListener("click", pushData);
document.querySelector('#openZoomAcc').addEventListener("click", openZoomLink);
document.querySelector('#upload').addEventListener("input", handleUpload);
}

Expand Down Expand Up @@ -63,7 +62,7 @@ function openZoomLink() {
* @param students StudentConnections object array
*/
function generateAttendanceSheet(students) {
let timeStamp = 'For the meeting/class hosted on ' + recordDate.split(" ")[0] + " starting at " + recordDate.split(" ")[1] + recordDate.split(" ")[2]
let timeStamp = 'For the meeting/class hosted on ' + recordDate.split(" ")[0] + " starting at " + recordDate.split(" ")[1];
let html = "<head>" +
"<title>Student Attendance - " + timeStamp + "</title>" +
"<style> " +
Expand Down

0 comments on commit ebe3756

Please sign in to comment.