2023-01-15 21:47:19 +00:00
|
|
|
<?php
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @var string $short_name
|
2023-01-18 11:43:45 +00:00
|
|
|
* @var $answer
|
|
|
|
* @var \DarksLight2\Training\StepFactory $step
|
2023-01-15 21:47:19 +00:00
|
|
|
*/
|
|
|
|
|
2023-01-18 11:43:45 +00:00
|
|
|
|
2023-01-15 21:47:19 +00:00
|
|
|
$user = User::start();
|
|
|
|
|
|
|
|
use DarksLight2\Training\TrainingManager;
|
|
|
|
|
|
|
|
$manager = TrainingManager::getInstance();
|
2023-01-18 11:43:45 +00:00
|
|
|
$step = $manager->getRegistered()[$short_name];
|
2023-01-18 17:24:00 +00:00
|
|
|
|
2023-01-15 21:47:19 +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);
|
2023-01-18 11:43:45 +00:00
|
|
|
?>
|
|
|
|
|
|
|
|
<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>
|