73 lines
2.4 KiB
HTML
73 lines
2.4 KiB
HTML
<!DOCTYPE html>
|
|
<html lang="en">
|
|
<head>
|
|
<meta charset="UTF-8">
|
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
<title>Manage Questions</title>
|
|
<link rel="stylesheet" href="/static/style.css">
|
|
</head>
|
|
<body>
|
|
<div class="container">
|
|
<h1>Manage Questions</h1>
|
|
|
|
<button id="dark-mode-toggle">Toggle Dark Mode</button>
|
|
|
|
<h2>Add New Question</h2>
|
|
<form action="/manage/add" method="post">
|
|
<label for="question_text">Question Text:</label>
|
|
<input type="text" id="question_text" name="question_text" required><br><br>
|
|
|
|
<label for="question_type">Question Type:</label>
|
|
<select id="question_type" name="question_type" required>
|
|
<option value="text">Text</option>
|
|
<option value="multiple_choice">Multiple Choice</option>
|
|
<option value="single_choice">Single Choice</option>
|
|
<option value="dropdown">Dropdown</option>
|
|
<option value="tags">Tag Input</option>
|
|
</select><br><br>
|
|
|
|
<div id="options-section" style="display:none;">
|
|
<label for="options">Options (comma-separated):</label>
|
|
<textarea id="options" name="options" rows="4" cols="50"></textarea><br><br>
|
|
</div>
|
|
|
|
<input type="submit" value="Add Question">
|
|
</form>
|
|
|
|
|
|
<h2>Existing Questions</h2>
|
|
<table>
|
|
<tr>
|
|
<th>Question Text</th>
|
|
<th>Question Type</th>
|
|
<th>Options</th>
|
|
<th>Actions</th>
|
|
</tr>
|
|
{{range .}}
|
|
<tr>
|
|
<td>{{.QuestionText}}</td>
|
|
<td>{{.QuestionType}}</td>
|
|
<td>
|
|
{{if .Options}}
|
|
<ul>
|
|
{{range .Options}}
|
|
<li>{{.}}</li>
|
|
{{end}}
|
|
</ul>
|
|
{{else}}None{{end}}
|
|
</td>
|
|
<td><a href="/manage/remove?id={{.ID}}">Remove</a></td>
|
|
</tr>
|
|
{{else}}
|
|
<tr>
|
|
<td colspan="4">No questions found.</td>
|
|
</tr>
|
|
{{end}}
|
|
</table>
|
|
</div>
|
|
|
|
<script src="/static/theme.js"></script>
|
|
<script src="/static/util.js"></script>
|
|
</body>
|
|
</html>
|