Initial Joomla test questions component
This commit is contained in:
@@ -0,0 +1,28 @@
|
||||
<?php
|
||||
|
||||
defined('_JEXEC') or die;
|
||||
|
||||
use Joomla\CMS\HTML\HTMLHelper;
|
||||
?>
|
||||
<div class="com-testquestions">
|
||||
<h1><?php echo \Joomla\CMS\Language\Text::_('COM_TESTQUESTIONS'); ?></h1>
|
||||
<?php foreach ($this->items as $number => $item) : ?>
|
||||
<article class="testquestion mb-4">
|
||||
<h2><?php echo ($number + 1) . '. '; ?><?php echo $item->question; ?></h2>
|
||||
<?php if ($item->image) : ?>
|
||||
<img src="<?php echo htmlspecialchars($item->image, ENT_QUOTES, 'UTF-8'); ?>" alt="" loading="lazy">
|
||||
<?php endif; ?>
|
||||
<?php if ($item->question_type === 'open') : ?>
|
||||
<label for="answer-<?php echo (int) $number; ?>"><?php echo \Joomla\CMS\Language\Text::_('COM_TESTQUESTIONS_ENTER_ANSWER'); ?></label>
|
||||
<input type="text" id="answer-<?php echo (int) $number; ?>" name="answers[<?php echo (int) $number; ?>]" class="form-control">
|
||||
<?php else : ?>
|
||||
<ol type="A">
|
||||
<li><?php echo $item->answer_a; ?></li>
|
||||
<li><?php echo $item->answer_b; ?></li>
|
||||
<li><?php echo $item->answer_c; ?></li>
|
||||
<li><?php echo $item->answer_d; ?></li>
|
||||
</ol>
|
||||
<?php endif; ?>
|
||||
</article>
|
||||
<?php endforeach; ?>
|
||||
</div>
|
||||
Reference in New Issue
Block a user