43 lines
945 B
PHP
43 lines
945 B
PHP
<?php
|
|
|
|
ini_set('display_errors', 1);
|
|
error_reporting(E_ALL);
|
|
|
|
/**
|
|
* @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];
|
|
$button_text = 'Продолжить';
|
|
$time = time();
|
|
|
|
$token = password_hash($manager->getDatabaseData()['api_token'] . $time . $user->info['id'], PASSWORD_DEFAULT);
|
|
?>
|
|
|
|
<script>
|
|
const training_data = () => {
|
|
return {
|
|
content: `<?=$step->getMessage()?>`,
|
|
title: `<?=$step->getTitle()?>`,
|
|
button_text: `<?=$button_text?>`,
|
|
time: <?=$time?>,
|
|
token: '<?=$token?>',
|
|
short_name: '<?=$short_name?>',
|
|
answer: '<?=$answer?>'
|
|
}
|
|
}
|
|
</script>
|
|
<script src="/js/training/modal.js"></script>
|
|
|
|
<script>
|
|
modal.show()
|
|
</script>
|