Student ID formatter

This commit is contained in:
Skylar Grant 2024-09-04 16:35:51 -04:00
parent e374ef1677
commit 5869456b6a
2 changed files with 83 additions and 35 deletions

50
mccs-it/IDFormatter.html Normal file
View File

@ -0,0 +1,50 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>ID Formatter</title>
<script src="https://cdn.tailwindcss.com"></script>
<style>
body {
font-family: 'Inter', sans-serif;
}
</style>
</head>
<body class="bg-gray-100 flex items-center justify-center min-h-screen">
<div class="max-w-2xl w-full bg-white p-6 rounded-lg shadow-lg">
<h1 class="text-3xl font-bold text-center mb-6">ID Formatter</h1>
<div class="mb-4">
<label for="inputText" class="block text-lg font-medium text-gray-700 mb-2">Input Text</label>
<textarea id="inputText" rows="6" class="w-full p-4 border border-gray-300 rounded-lg focus:outline-none focus:ring-2 focus:ring-blue-500" placeholder="Enter your text here..."></textarea>
</div>
<div class="mb-6">
<label for="outputText" class="block text-lg font-medium text-gray-700 mb-2">Output Text</label>
<textarea id="outputText" rows="6" readonly class="w-full p-4 border border-gray-300 rounded-lg bg-gray-50"></textarea>
</div>
<div class="text-center">
<button onclick="formatText()" class="bg-blue-500 text-white py-2 px-6 rounded-lg shadow hover:bg-blue-600 focus:outline-none focus:ring-2 focus:ring-blue-500">Format IDs</button>
</div>
</div>
<script>
function formatText() {
const inputText = document.getElementById('inputText').value;
const outputText = document.getElementById('outputText');
// Regular expression to find 7-digit numbers
const regex = /\b\d{7}\b/g;
const matches = inputText.match(regex);
// Format matches with quotes and commas
if (matches) {
const formattedMatches = matches.map(num => `"${num}",`).join('\n');
outputText.value = formattedMatches;
} else {
outputText.value = 'No 7-digit numbers found.';
}
}
</script>
</body>
</html>

View File

@ -8,41 +8,39 @@ import getpass
# Put
studentIds = [
"5121951",
"5010522",
"5137363",
"5145175",
"5144503",
"5146582",
"5142212",
"5146605",
"5109465",
"5146602",
"5146608",
"5146598",
"5127204",
"5142694",
"5123415",
"5146588",
"5146589",
"5146600",
"5146581",
"5146506",
"5146609",
"5146607",
"5146601",
"5131148",
"5107200",
"5133891",
"5005257",
"5146590",
"5135862",
"5146599",
"5146586",
"5146552",
"5146308",
"5136688",
"5126696",
"5010151",
"5146775",
"5119928",
"5103282",
"5136913",
"5146786",
"5146756",
"5146746",
"5117953",
"5146715",
"5120182",
"5146758",
"5143217",
"5134303",
"5125039",
"5146520",
"5128953",
"5146785",
"5138867",
"5146759",
"5129320",
"5115236",
"5146757",
"5146783",
"5136183",
"5146784",
"5146782",
"5120562",
"5132114",
"5122637",
"5146787",
"5108584",
"5137846"
]
class StudentInfo: