Untitled

mail@pastecode.io avatar
unknown
plain_text
a year ago
2.9 kB
0
Indexable
Never
<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Exam Page</title>
<!-- Bootstrap CSS -->
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.5.2/css/bootstrap.min.css">
<!-- jQuery library -->
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.5.1/jquery.min.js"></script>
<!-- Bootstrap JS -->
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/4.5.2/js/bootstrap.min.js"></script>
</head>
<body>
    <div class="container mt-5">
        <h1>Exam Page</h1>
        <form action="submit-exam" method="post">
            <c:forEach items="${questions}" var="question">
                <div class="card my-3">
                    <div class="card-header">
                        <h5>Question ${question.id}</h5>
                    </div>
                    <div class="card-body">
                        <p>${question.text}</p>
                        <div class="form-check">
                            <input class="form-check-input" type="radio" name="answer${question.id}" id="answer${question.id}a" value="a">
                            <label class="form-check-label" for="answer${question.id}a">
                                ${question.optionA}
                            </label>
                        </div>
                        <div class="form-check">
                            <input class="form-check-input" type="radio" name="answer${question.id}" id="answer${question.id}b" value="b">
                            <label class="form-check-label" for="answer${question.id}b">
                                ${question.optionB}
                            </label>
                        </div>
                        <div class="form-check">
                            <input class="form-check-input" type="radio" name="answer${question.id}" id="answer${question.id}c" value="c">
                            <label class="form-check-label" for="answer${question.id}c">
                                ${question.optionC}
                            </label>
                        </div>
                        <div class="form-check">
                            <input class="form-check-input" type="radio" name="answer${question.id}" id="answer${question.id}d" value="d">
                            <label class="form-check-label" for="answer${question.id}d">
                                ${question.optionD}
                            </label>
                        </div>
                    </div>
                </div>
            </c:forEach>
            <button type="submit" class="btn btn-primary">Submit Exam</button>
        </form>
    </div>
</body>
</html>