game/api/learning.php

15 lines
447 B
PHP
Raw Normal View History

2022-12-19 20:22:19 +00:00
<?php
require_once $_SERVER['DOCUMENT_ROOT'] . '/_incl_data/__config.php';
$learning = new Learming();
//set getLearningStatus to 0 and save
if ($_POST['hasLearned'] && $learning->hasLearned()) {
echo 'OK';
}
if ($_POST['getStatus']) {
// boolean
switch ($learning->getLearningStatus()) {
case 0: echo 'should not learn'; break;
case 1: echo 'should learn'; break;
default: echo 'error: no data'; break;
}
}