Skip to content

Commit

Permalink
Merge pull request #21 from Mubashir-Md/main
Browse files Browse the repository at this point in the history
Recruitment drive updates
  • Loading branch information
Mubashir-Md authored Jan 26, 2024
2 parents 6107527 + 2463805 commit c7a871b
Show file tree
Hide file tree
Showing 11 changed files with 697 additions and 0 deletions.
Binary file added .DS_Store
Binary file not shown.
Binary file added public/.DS_Store
Binary file not shown.
407 changes: 407 additions & 0 deletions public/answers.html

Large diffs are not rendered by default.

189 changes: 189 additions & 0 deletions public/css/answers.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Binary file added public/img/bg1.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/img/bg2.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/img/correctGIF.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/img/tick.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/img/tsigLogo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/img/wrong.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
101 changes: 101 additions & 0 deletions public/js/answers.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,101 @@
window.onload = () => {
let idToShow = window.location.hash.replace("#", "");

let divs = document.querySelectorAll(".ans");

for (let i = 0; i < divs.length; i++) {
if (divs[i].id != idToShow) {
// console.log(divs[i].id);
divs[i].style.display = "none";
}
}

// console.log(idToShow);
};

let answers = {
1: "16",
2: "14",
3: "15",
4: "2",
5: "1",
6: "11",
7: "Y",
8: "8",
9: "52",
10: "87",
11: "4",
12: "3",
13: "7",
14: "10",
15: "65",
16: "3",
17: "2",
18: "a",
19: "0",
20: "3",
};

function checkAnswer(qno) {
let val = document.getElementById(`answerInput${qno}`).value;
let greenTick = document.createElement("img");
greenTick.src = "/public/img/tick.gif";
let redTick = document.createElement("img");
redTick.src = "/public/img/wrong.gif";

if (val == answers[qno]) {
let tickContainer = document.getElementById(`tickContainer${qno}`);

while (tickContainer.firstChild) {
tickContainer.removeChild(tickContainer.firstChild);
}

let msg = document.getElementById(`msg${qno}`);

msg.innerHTML = "Great job! πŸŽ‰ You've aced the challenge! πŸš€ Ready to level up? Join us to enhance your coding skills and make an impact. Click Apply Now to start the journey! πŸ’»πŸš€";

let applyBtn = document.createElement("a");
applyBtn.innerHTML = "Apply Now ->";
applyBtn.href = "https://forms.gle/9UYQddtDJrMrgfc86";

tickContainer.appendChild(greenTick);

let thingsDiv = document.getElementsByClassName("things")[qno - 1];
if (thingsDiv.firstElementChild && thingsDiv.lastElementChild) {
thingsDiv.removeChild(thingsDiv.firstElementChild);
thingsDiv.removeChild(thingsDiv.lastElementChild);
}


msg.after(applyBtn);


}
else {
let tickContainer = document.getElementById(`tickContainer${qno}`);

while (tickContainer.firstChild) {
tickContainer.removeChild(tickContainer.firstChild);
}

let msg = document.getElementById(`msg${qno}`);

msg.innerHTML = "No worries! πŸ€” Coding challenges can be tricky. It's cool if you didn't nail it this time. 🌈 Join us to boost your coding skills. Click Apply Now and let's learn together! πŸš€πŸ’‘πŸ‘©β€πŸ’»πŸ‘¨β€πŸ’»";

let applyBtn = document.createElement("a");
applyBtn.innerHTML = "Apply Now ->";
applyBtn.href = "https://forms.gle/9UYQddtDJrMrgfc86";

tickContainer.appendChild(redTick);

let thingsDiv = document.getElementsByClassName("things")[qno - 1];
if (thingsDiv.firstElementChild && thingsDiv.lastElementChild) {
thingsDiv.removeChild(thingsDiv.firstElementChild);
thingsDiv.removeChild(thingsDiv.lastElementChild);
}


msg.after(applyBtn);

}
}

0 comments on commit c7a871b

Please sign in to comment.