| 12345678910111213141516171819202122232425262728293031323334353637383940 |
- <?php
- class PracticeTest extends Test {
- private $values = [];
- private $template_id = null;
- // Constants
- /**
- * @param bool $as_assoc_array
- * @return array
- */
- public function getValues(bool $as_assoc_array = false): array {
- return $this->values;
- }
- /**
- * @param string $key
- * @param string $value
- * @return bool
- */
- public function setValue(string $key, string $value): bool {
- $this->values[$key] = $value;
- return true;
- }
- /**
- * @return string
- */
- public function getDirectory(): string {
- $directory = ROOT_DIR . "/files/users/$this->tester_id/practice_tests/$this->template_id";
- if(!file_exists($directory)) mkdir($directory, 0777, true);
- return $directory;
- }
- public function setTemplateId(int $id) {
- $this->template_id = $id;
- }
- }
|