Test 2
Test 2
Script is a powerful and cost-effective solution. You can make a complete system where:
Example columns:
oStudent ID
oName
oDOB
oClass
oSubject 1 Marks
oSubject 2 Marks
o…
oTotal
oPercentage
oGrade
oResult Status (Pass/Fail)
2. Use Formulas (in additional columns):
o Total: =SUM(E2:H2)
o Percentage: =I2/400*100 (assuming 400 is the total marks)
o Grade: Use nested IF:
=IF(J2>=90,"A+",IF(J2>=80,"A",IF(J2>=70,"B",IF(J2>=60,"C","Fail"))))
2.
o
o Result: =IF(J2>=40,"Pass","Fail")
OPTION B:
function doGet(e) {
return HtmlService.createHtmlOutputFromFile('index');
}
<!DOCTYPE html>
<html>
<head>
<base target="_top">
</head>
<body>
<h2>Check Your Result</h2>
<form id="resultForm">
Student ID: <input type="text" name="studentId"><br><br>
DOB (dd/mm/yyyy): <input type="text" name="dob"><br><br>
<input type="submit" value="Get Result">
</form>
<div id="resultBox"></div>
<script>
document.getElementById('resultForm').addEventListener('submit',
function(e) {
e.preventDefault();
const studentId = e.target.studentId.value;
const dob = e.target.dob.value;
google.script.run.withSuccessHandler(function(result) {
if (result.error) {
document.getElementById('resultBox').innerText = result.error;
} else {
document.getElementById('resultBox').innerHTML = `
Name: ${result.name} <br>
Total: ${result.total} <br>
Percentage: ${result.percentage}% <br>
Grade: ${result.grade} <br>
Status: ${result.status}
`;
}
}).getStudentResult(studentId, dob);
});
</script>
</body>
</html>
Would you like me to generate the actual Google Sheet template and script files for
download, or walk you through deploying a live web version from scratch?