mirror of
https://gitlab.com/MrFry/moodle-test-userscript
synced 2025-04-01 20:22:48 +02:00
Added some logs
This commit is contained in:
parent
6e9cdf75df
commit
b8b4af45a5
1 changed files with 11 additions and 6 deletions
|
@ -1115,13 +1115,10 @@
|
||||||
prevLength = kkerdesElements.length
|
prevLength = kkerdesElements.length
|
||||||
clearAllMessages()
|
clearAllMessages()
|
||||||
if (determineCurrentSite() === 'TEST') {
|
if (determineCurrentSite() === 'TEST') {
|
||||||
log('Handling quiz')
|
|
||||||
handleKGKQuiz(url)
|
handleKGKQuiz(url)
|
||||||
} else if (determineCurrentSite() === 'RESULT') {
|
} else if (determineCurrentSite() === 'RESULT') {
|
||||||
log('Handling results')
|
|
||||||
HandleKGKResults(url)
|
HandleKGKResults(url)
|
||||||
} else {
|
} else {
|
||||||
log('Handling UI')
|
|
||||||
HandleUI()
|
HandleUI()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1372,6 +1369,7 @@
|
||||||
return false // TODO :insert real url
|
return false // TODO :insert real url
|
||||||
},
|
},
|
||||||
action: (url) => {
|
action: (url) => {
|
||||||
|
log('Handling canvas quiz')
|
||||||
handleCanvasQuiz(url)
|
handleCanvasQuiz(url)
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
@ -1380,6 +1378,7 @@
|
||||||
return false // TODO :insert real url
|
return false // TODO :insert real url
|
||||||
},
|
},
|
||||||
action: (url) => {
|
action: (url) => {
|
||||||
|
log('Handling canvas results')
|
||||||
HandleCanvasResults(url)
|
HandleCanvasResults(url)
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
@ -1388,6 +1387,7 @@
|
||||||
return false // TODO :insert real url
|
return false // TODO :insert real url
|
||||||
},
|
},
|
||||||
action: (url) => {
|
action: (url) => {
|
||||||
|
log('Handling canvas default action')
|
||||||
HandleUI(url)
|
HandleUI(url)
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
@ -1415,6 +1415,7 @@
|
||||||
return true // TODO :insert real url
|
return true // TODO :insert real url
|
||||||
},
|
},
|
||||||
action: (url) => {
|
action: (url) => {
|
||||||
|
log('Handling KGK default action')
|
||||||
handleKGKSite(url)
|
handleKGKSite(url)
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
@ -1429,6 +1430,7 @@
|
||||||
)
|
)
|
||||||
},
|
},
|
||||||
action: () => {
|
action: () => {
|
||||||
|
log('Handling moodle quiz')
|
||||||
handleMoodleQuiz()
|
handleMoodleQuiz()
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
@ -1440,6 +1442,7 @@
|
||||||
)
|
)
|
||||||
},
|
},
|
||||||
action: (url) => {
|
action: (url) => {
|
||||||
|
log('Handling moodle results')
|
||||||
HandleMoodleResults(url)
|
HandleMoodleResults(url)
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
@ -1453,6 +1456,7 @@
|
||||||
)
|
)
|
||||||
},
|
},
|
||||||
action: (url) => {
|
action: (url) => {
|
||||||
|
log('Handling moodle default action')
|
||||||
HandleUI(url)
|
HandleUI(url)
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
@ -1469,6 +1473,7 @@
|
||||||
matcher.matchString === 'default' ||
|
matcher.matchString === 'default' ||
|
||||||
matcher.matchString.includes(forcedMatchString)
|
matcher.matchString.includes(forcedMatchString)
|
||||||
) {
|
) {
|
||||||
|
log(`trying '${matcher.matchString}'`)
|
||||||
if (matcher.testPage && matcher.testPage.match(url)) {
|
if (matcher.testPage && matcher.testPage.match(url)) {
|
||||||
matcher.testPage.action(url)
|
matcher.testPage.action(url)
|
||||||
return true
|
return true
|
||||||
|
@ -1479,7 +1484,7 @@
|
||||||
matcher.default.action(url)
|
matcher.default.action(url)
|
||||||
return true
|
return true
|
||||||
} else {
|
} else {
|
||||||
console.warn(
|
warn(
|
||||||
'Matcher did not have matched handler implemented, or there was no match!',
|
'Matcher did not have matched handler implemented, or there was no match!',
|
||||||
matcher
|
matcher
|
||||||
)
|
)
|
||||||
|
@ -2728,8 +2733,8 @@
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
console.warn('Error in createHtml')
|
warn('Error in createHtml')
|
||||||
console.warn(e)
|
warn(e)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue