game/modules_data/steps/step.php

39 lines
806 B
PHP
Raw Permalink Normal View History

<?php
/**
* @var string $short_name
* @var $answer
* @var \DarksLight2\Training\StepFactory $step
*/
$user = User::start();
use DarksLight2\Training\TrainingManager;
$manager = TrainingManager::getInstance();
$step = $manager->getRegistered()[$short_name];
2023-01-18 17:24:00 +00:00
$time = time();
2023-01-18 12:00:56 +00:00
$token = password_hash($manager->getDatabaseData()['api_token'] . $time . $user->info['id'], PASSWORD_DEFAULT);
?>
<script>
const training_data = () => {
return {
content: `<?=$step->getMessage()?>`,
title: `<?=$step->getTitle()?>`,
time: <?=$time?>,
token: '<?=$token?>',
short_name: '<?=$short_name?>',
answer: '<?=$answer?>'
}
}
</script>
<script src="/js/training/modal.js"></script>
<script>
modal.show()
</script>