mirror of
				https://gitlab.com/MrFry/moodle-test-userscript
				synced 2025-04-01 20:22:48 +02:00 
			
		
		
		
	Regexp fix, error stack sending refactor
This commit is contained in:
		
							
								
								
									
										8
									
								
								main.js
									
									
									
									
									
								
							
							
						
						
									
										8
									
								
								main.js
									
									
									
									
									
								
							@@ -65,7 +65,7 @@ const commonUselessAnswerParts = [
 | 
				
			|||||||
  'The correct answer is:',
 | 
					  'The correct answer is:',
 | 
				
			||||||
  '\''
 | 
					  '\''
 | 
				
			||||||
]
 | 
					]
 | 
				
			||||||
const commonUselessStringParts = [',', '.', ':', '!']
 | 
					const commonUselessStringParts = [',', '\\.', ':', '!']
 | 
				
			||||||
// ------------------------------------------------------------------------------
 | 
					// ------------------------------------------------------------------------------
 | 
				
			||||||
 | 
					
 | 
				
			||||||
// : Class descriptions {{{
 | 
					// : Class descriptions {{{
 | 
				
			||||||
@@ -1250,7 +1250,7 @@ function ShowAnswers (answers, question) {
 | 
				
			|||||||
    }, undefined, function () {
 | 
					    }, undefined, function () {
 | 
				
			||||||
      OpenErrorPage({
 | 
					      OpenErrorPage({
 | 
				
			||||||
        message: 'No result found',
 | 
					        message: 'No result found',
 | 
				
			||||||
        stack: question // TODO: test this
 | 
					        stack: JSON.stringify(question)
 | 
				
			||||||
      })
 | 
					      })
 | 
				
			||||||
    })
 | 
					    })
 | 
				
			||||||
  }
 | 
					  }
 | 
				
			||||||
@@ -2187,10 +2187,10 @@ function OpenErrorPage (e) {
 | 
				
			|||||||
      path += '?'
 | 
					      path += '?'
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
    if (e.message) {
 | 
					    if (e.message) {
 | 
				
			||||||
      path += 'msg:' + SUtils.SimplifyQuery(e.message) + '&'
 | 
					      path += 'msg:' + SUtils.SimplifyQuery(e.message)
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
    if (e.stack) {
 | 
					    if (e.stack) {
 | 
				
			||||||
      path += 'stack:' + SUtils.SimplifyStack(e.stack)
 | 
					      path += '___stack:' + SUtils.SimplifyStack(e.stack)
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
    path = SUtils.RemoveSpecialChars(path)
 | 
					    path = SUtils.RemoveSpecialChars(path)
 | 
				
			||||||
  } catch (e) {
 | 
					  } catch (e) {
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user