<?php use Mtc\Shop\Assessment\AnswerMagento ?>

<h2>Magento assement</h2>

<?php $answer_data = $order->eloquent()->getAssessmentMagentoAnswers() ?>


<?php foreach ($answer_data as $form_name => $assessment_order_items) { ?>
    <?php foreach ($assessment_order_items as $assessment_order_item => $assessment_qas) { ?>
        
    <h5><?= $assessment_order_item ?></h5>

    <table width="100%" class="manage-items" style="margin: 0 0 2em 0">
        <tr>
            <th>Question</th>
            <th>Answer</th>
        </tr>

        <tr>
            <td>Last updated</td>
            <td><?= $order->eloquent()->assessment_magento_answers->first()->magento_update_time ?></td>
        </tr>

        <?php foreach ($assessment_qas as $assessment_q => $assessment_a) { ?>

        <tr>
            <td><?= AnswerMagento::getQuestionText($assessment_q) ?></td>
            <td><?= is_array($assessment_a) ? implode(',', $assessment_a) : $assessment_a ?></td>
        </tr>

        <?php } ?>

    </table>

    <?php } ?>
<?php } ?>
