2024-07-15 12:22:02 +00:00
|
|
|
<div class="page_layout">
|
|
|
|
<br>
|
|
|
|
<div class="section">
|
2024-07-18 10:49:23 +00:00
|
|
|
<div class="form_container-response">
|
2024-07-19 03:10:38 +00:00
|
|
|
<div class="form_container_top">
|
|
|
|
<div class="form_container_top_title"><?= htmlspecialchars($form->title, ENT_QUOTES, 'UTF-8') ?></div>
|
2024-07-23 03:03:15 +00:00
|
|
|
<div class="form_container_top_desc"><?= htmlspecialchars($form->description, ENT_QUOTES, 'UTF-8') ?>
|
|
|
|
</div>
|
|
|
|
</div>
|
2024-07-19 03:10:38 +00:00
|
|
|
|
|
|
|
<?php if ($this->session->flashdata('error')): ?>
|
|
|
|
<div class="error-message" style="color: red;">
|
|
|
|
<?= $this->session->flashdata('error') ?>
|
|
|
|
</div>
|
|
|
|
<?php endif; ?>
|
2024-07-15 12:22:02 +00:00
|
|
|
|
|
|
|
<div id="questions-container">
|
2024-07-23 03:03:15 +00:00
|
|
|
<?php if (!empty($questions)): ?>
|
|
|
|
<?php foreach ($questions as $index => $question): ?>
|
|
|
|
<div class="question-box"
|
|
|
|
data-question-type="<?= htmlspecialchars($question->question_type, ENT_QUOTES, 'UTF-8') ?>"
|
|
|
|
id="question-template"
|
|
|
|
data-question_id="<?= htmlspecialchars($question->question_id, ENT_QUOTES, 'UTF-8') ?>">
|
2024-07-15 12:22:02 +00:00
|
|
|
<div class="question-box_header">
|
2024-07-23 03:03:15 +00:00
|
|
|
<div class="response-questions" style="color:black;">
|
|
|
|
<?= htmlspecialchars($question->question_text, ENT_QUOTES, 'UTF-8') ?></div>
|
|
|
|
<?= $question->is_required ? '<span style="color:red;">*</span>' : '' ?>
|
2024-07-15 12:22:02 +00:00
|
|
|
</div>
|
|
|
|
<br>
|
2024-07-23 03:03:15 +00:00
|
|
|
<?php if ($question->question_type == 'paragraph'): ?>
|
2024-07-15 12:22:02 +00:00
|
|
|
<div class="question-box_short-answer">
|
2024-07-19 03:10:38 +00:00
|
|
|
<textarea class="response-text-area" placeholder="Your Answer"></textarea>
|
2024-07-15 12:22:02 +00:00
|
|
|
</div>
|
2024-07-23 03:03:15 +00:00
|
|
|
<?php else: ?>
|
2024-07-15 12:22:02 +00:00
|
|
|
<div id="options-container">
|
2024-07-23 03:03:15 +00:00
|
|
|
<?php if (!empty($question->options)): ?>
|
|
|
|
<?php if ($question->question_type == 'dropdown'): ?>
|
|
|
|
<select name="question-<?= $index ?>" id="dropdown-<?= $index ?>" class="form-control">
|
|
|
|
<?php foreach ($question->options as $optionIndex => $option): ?>
|
|
|
|
<option value="<?= htmlspecialchars($option->option_text, ENT_QUOTES, 'UTF-8') ?>">
|
|
|
|
<?= htmlspecialchars($option->option_text, ENT_QUOTES, 'UTF-8') ?>
|
|
|
|
</option>
|
|
|
|
<?php endforeach; ?>
|
|
|
|
</select>
|
|
|
|
<?php else: ?>
|
|
|
|
<?php foreach ($question->options as $optionIndex => $option): ?>
|
|
|
|
<div class="question-box_option-block" id="option-template"
|
|
|
|
data-option_id="<?= htmlspecialchars($option->option_id, ENT_QUOTES, 'UTF-8') ?>">
|
|
|
|
<?php if ($question->question_type == 'multiple-choice'): ?>
|
|
|
|
<input type="radio" id="option-<?= $optionIndex ?>" name="question-<?= $index ?>">
|
|
|
|
<label style="padding-top:12px;"
|
|
|
|
for="option-<?= $optionIndex ?>"><?= htmlspecialchars($option->option_text, ENT_QUOTES, 'UTF-8') ?></label>
|
|
|
|
<?php elseif ($question->question_type == 'checkbox'): ?>
|
|
|
|
<input type="checkbox" id="option-<?= $optionIndex ?>"
|
|
|
|
name="question-<?= $index ?>[]">
|
|
|
|
<label style="padding-top:12px;"
|
|
|
|
for="option-<?= $optionIndex ?>"><?= htmlspecialchars($option->option_text, ENT_QUOTES, 'UTF-8') ?></label>
|
|
|
|
<?php endif; ?>
|
|
|
|
</div>
|
|
|
|
<br>
|
|
|
|
<?php endforeach; ?>
|
|
|
|
<?php endif; ?>
|
2024-07-19 03:10:38 +00:00
|
|
|
<?php else: ?>
|
|
|
|
<p>No options found for this question.</p>
|
2024-07-15 12:22:02 +00:00
|
|
|
<?php endif; ?>
|
|
|
|
</div>
|
2024-07-23 03:03:15 +00:00
|
|
|
|
2024-07-15 12:22:02 +00:00
|
|
|
<?php endif; ?>
|
|
|
|
</div>
|
|
|
|
<br>
|
|
|
|
<?php endforeach; ?>
|
2024-07-23 03:03:15 +00:00
|
|
|
<?php else: ?>
|
2024-07-15 12:22:02 +00:00
|
|
|
<p>No questions found for this form.</p>
|
|
|
|
<?php endif; ?>
|
|
|
|
</div>
|
2024-07-19 03:10:38 +00:00
|
|
|
<a class="publish-button" href="<?= base_url() ?>forms/publish_form/<?= $form->form_id ?>">Publish</a>
|
2024-07-15 12:22:02 +00:00
|
|
|
</div>
|
|
|
|
</div>
|
2024-07-23 03:03:15 +00:00
|
|
|
</div>
|