mirror of
				https://gitlab.com/MrFry/moodle-test-userscript
				synced 2025-04-01 20:22:48 +02:00 
			
		
		
		
	Changed test mode notification style
This commit is contained in:
		
							
								
								
									
										10
									
								
								main.js
									
									
									
									
									
								
							
							
						
						
									
										10
									
								
								main.js
									
									
									
									
									
								
							| @@ -37,7 +37,7 @@ const motdShowCount = 3; /* Ammount of times to show motd */ | ||||
| var motd = ""; | ||||
| var lastestVersion = ""; | ||||
|  | ||||
| const minMatchAmmount = 15; /* Minimum ammount to consider that two questions match during answering */ | ||||
| const minMatchAmmount = 60; /* Minimum ammount to consider that two questions match during answering */ | ||||
| const minResultMatchPercent = 99; /* Minimum ammount to consider that two questions match during saving */ | ||||
| const lengthDiffMultiplier = 10; /* Percent minus for length difference */ | ||||
|  | ||||
| @@ -637,12 +637,12 @@ class MiscPageModell { | ||||
| 	} | ||||
| } | ||||
|  | ||||
| //: }}} | ||||
|  | ||||
| var QPM = new QuestionsPageModell(); | ||||
| var RPM = new ResultsPageModell(); | ||||
| var MPM = new MiscPageModell(); | ||||
|  | ||||
| //: }}} | ||||
|  | ||||
| //: Main function {{{ | ||||
| function Main() { | ||||
| 	'use strict'; | ||||
| @@ -691,7 +691,7 @@ function Main() { | ||||
| 	console.timeEnd('main'); | ||||
|  | ||||
| 	if (forceTestPage || forceResultPage || forceDefaultPage) | ||||
| 		alert("TEST MODE"); | ||||
| 		document.getElementById("scriptMessage").style.background = "green"; | ||||
| } | ||||
| //: }}} | ||||
|  | ||||
| @@ -1042,6 +1042,7 @@ function NLoad(resource, cwith) { | ||||
| 			i++; | ||||
| 		} | ||||
|  | ||||
| 		// TODO: move this | ||||
| 		AlertOnNoQuestion(i); | ||||
|  | ||||
| 	} catch (e) { | ||||
| @@ -1627,6 +1628,7 @@ function ShowMessage(msgItem, timeout, funct) { | ||||
| 		mainDiv.style.top = (startFromTop) + 'px'; | ||||
| 		mainDiv.style.left = (window.innerWidth - width) / 2 + 'px'; | ||||
| 		mainDiv.style.opacity = "0.9"; // setting starting opacity | ||||
| 		mainDiv.setAttribute("id", "scriptMessage"); | ||||
| 		var matchPercent = msgItem[0][0].p; | ||||
| 		if (isSimpleMessage) { | ||||
| 			var simpleMessageParagrapg = document.createElement("p"); // new paragraph | ||||
|   | ||||
		Reference in New Issue
	
	Block a user