Last active
January 15, 2026 07:28
-
-
Save MaxySpark/2d902b18bb3a9b0c9aaf3e623ab3a10b to your computer and use it in GitHub Desktop.
UGC Net Score Calculate
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| function extractFormOptionsData() { | |
| let questions = document.querySelectorAll('[id*="grAnswerKey"][id$="_lbl_QuestionNo"]'); | |
| let answers = document.querySelectorAll('[id*="grAnswerKey"][id$="_lbl_RAnswer"]'); | |
| let data = {}; | |
| questions.forEach((row, i) => { | |
| data[row.innerHTML]= parseInt(answers[i].innerHTML) | |
| }); | |
| return data; | |
| } | |
| extractFormOptionsData(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| function extractAllQuestionData() { | |
| let tables = document.querySelectorAll('.menu-tbl'); | |
| let data = {}; | |
| tables.forEach(table => { | |
| let rows = table.getElementsByTagName('tr'); | |
| let questionID = null; | |
| let chosenOption = null; | |
| for (let row of rows) { | |
| let keyCell = row.cells[0]?.textContent.trim(); | |
| let valueCell = row.cells[1]?.textContent.trim(); | |
| if (keyCell === 'Question ID :') { | |
| questionID = valueCell; | |
| } else if (keyCell === 'Chosen Option :') { | |
| chosenOption = valueCell; | |
| } | |
| } | |
| if (questionID && chosenOption) { | |
| data[questionID] = parseInt(chosenOption, 10); | |
| } | |
| }); | |
| return data; | |
| } | |
| extractAllQuestionData(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment