1
1
Fork 0
This commit is contained in:
Dominik Säume 2024-05-23 17:45:11 +02:00
parent 10b921c7c2
commit a1966e3270
Signed by: SZUT-Dominik
GPG key ID: 67D15BB250B41E7C
2 changed files with 2 additions and 7 deletions

View file

@ -64,7 +64,6 @@ function getAllAnswersElement(response) {
* @returns {Answer} * @returns {Answer}
*/ */
function parseAnswerElement(index, element, allAnswersElement) { function parseAnswerElement(index, element, allAnswersElement) {
console.log("PARSING AWNSER", {});
// Check for Possible Tags // Check for Possible Tags
if (!(element.tagName === "P" || element.tagName === "STRONG")) { if (!(element.tagName === "P" || element.tagName === "STRONG")) {
return; return;
@ -89,11 +88,6 @@ function parseAnswerElement(index, element, allAnswersElement) {
// Get Awsners // Get Awsners
const answersElement = getAnswersElement(index, allAnswersElement); const answersElement = getAnswersElement(index, allAnswersElement);
if (answersElement === null || answersElement.tagName === "UL") return; if (answersElement === null || answersElement.tagName === "UL") return;
console.log({
question: questionText,
answers: getAnswers(answersElement),
});
return { return {
question: questionText, question: questionText,
@ -122,6 +116,7 @@ function getAnswersElement(index, allAnswersElement) {
if (answersElement.tagName === "P") { if (answersElement.tagName === "P") {
answersElement = allAnswersElement.children[index + 2]; answersElement = allAnswersElement.children[index + 2];
} }
console.log(answersElement);
return answersElement; return answersElement;
} }

View file

@ -10,7 +10,7 @@
// @grant GM_setValue // @grant GM_setValue
// @grant GM_getValue // @grant GM_getValue
// @grant GM_xmlhttpRequest // @grant GM_xmlhttpRequest
// @version 0.0.15 // @version 0.0.16
// @author Dominik Säume // @author Dominik Säume
// ==/UserScript== // ==/UserScript==