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