Exam generation rework, batch user tables, fastapi endpoint switch

This commit is contained in:
Carlos-Mesquita
2024-11-04 23:29:14 +00:00
parent a2bc997e8f
commit 15c9c4d4bd
148 changed files with 11348 additions and 3901 deletions

20
src/utils/popout.ts Normal file
View File

@@ -0,0 +1,20 @@
import { NextRouter } from "next/router";
const openDetachedTab = (uri: string, router: NextRouter, name = 'ExamPreview', width = 1000, height = 600) => {
const left = (window.screen.width - width) / 2;
const top = (window.screen.height - height) / 2;
const features = `width=${width},height=${height},left=${left},top=${top},resizable=yes,scrollbars=yes,status=yes`;
const url = router.basePath + `/${uri}`;
const newWindow = window.open(url, name, features);
if (newWindow) {
newWindow.focus();
} else {
alert('Pop-up blocker may have prevented opening the new window. Please check your browser settings.');
}
return newWindow;
}
export default openDetachedTab;