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
|
||||
clearAllMessages()
|
||||
if (determineCurrentSite() === 'TEST') {
|
||||
log('Handling quiz')
|
||||
handleKGKQuiz(url)
|
||||
} else if (determineCurrentSite() === 'RESULT') {
|
||||
log('Handling results')
|
||||
HandleKGKResults(url)
|
||||
} else {
|
||||
log('Handling UI')
|
||||
HandleUI()
|
||||
}
|
||||
}
|
||||
|
@ -1372,6 +1369,7 @@
|
|||
return false // TODO :insert real url
|
||||
},
|
||||
action: (url) => {
|
||||
log('Handling canvas quiz')
|
||||
handleCanvasQuiz(url)
|
||||
},
|
||||
},
|
||||
|
@ -1380,6 +1378,7 @@
|
|||
return false // TODO :insert real url
|
||||
},
|
||||
action: (url) => {
|
||||
log('Handling canvas results')
|
||||
HandleCanvasResults(url)
|
||||
},
|
||||
},
|
||||
|
@ -1388,6 +1387,7 @@
|
|||
return false // TODO :insert real url
|
||||
},
|
||||
action: (url) => {
|
||||
log('Handling canvas default action')
|
||||
HandleUI(url)
|
||||
},
|
||||
},
|
||||
|
@ -1415,6 +1415,7 @@
|
|||
return true // TODO :insert real url
|
||||
},
|
||||
action: (url) => {
|
||||
log('Handling KGK default action')
|
||||
handleKGKSite(url)
|
||||
},
|
||||
},
|
||||
|
@ -1429,6 +1430,7 @@
|
|||
)
|
||||
},
|
||||
action: () => {
|
||||
log('Handling moodle quiz')
|
||||
handleMoodleQuiz()
|
||||
},
|
||||
},
|
||||
|
@ -1440,6 +1442,7 @@
|
|||
)
|
||||
},
|
||||
action: (url) => {
|
||||
log('Handling moodle results')
|
||||
HandleMoodleResults(url)
|
||||
},
|
||||
},
|
||||
|
@ -1453,6 +1456,7 @@
|
|||
)
|
||||
},
|
||||
action: (url) => {
|
||||
log('Handling moodle default action')
|
||||
HandleUI(url)
|
||||
},
|
||||
},
|
||||
|
@ -1469,6 +1473,7 @@
|
|||
matcher.matchString === 'default' ||
|
||||
matcher.matchString.includes(forcedMatchString)
|
||||
) {
|
||||
log(`trying '${matcher.matchString}'`)
|
||||
if (matcher.testPage && matcher.testPage.match(url)) {
|
||||
matcher.testPage.action(url)
|
||||
return true
|
||||
|
@ -1479,7 +1484,7 @@
|
|||
matcher.default.action(url)
|
||||
return true
|
||||
} else {
|
||||
console.warn(
|
||||
warn(
|
||||
'Matcher did not have matched handler implemented, or there was no match!',
|
||||
matcher
|
||||
)
|
||||
|
@ -2728,8 +2733,8 @@
|
|||
}
|
||||
})
|
||||
} catch (e) {
|
||||
console.warn('Error in createHtml')
|
||||
console.warn(e)
|
||||
warn('Error in createHtml')
|
||||
warn(e)
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue