mirror of
https://gitlab.com/animath/si/plateforme-corres2math.git
synced 2024-12-27 11:02:20 +00:00
41 lines
662 B
PHP
41 lines
662 B
PHP
<?php
|
|
|
|
|
|
class Reason
|
|
{
|
|
const SOLUTION = 0;
|
|
const ANSWER1 = 1;
|
|
const ANSWER2 = 2;
|
|
|
|
public static function getTranslatedName($class) {
|
|
switch ($class) {
|
|
case self::ANSWER1:
|
|
case self::ANSWER2:
|
|
return "Réponse";
|
|
default:
|
|
return "Solution";
|
|
}
|
|
}
|
|
|
|
public static function getName($class) {
|
|
switch ($class) {
|
|
case self::ANSWER1:
|
|
return "ANSWER1";
|
|
case self::ANSWER2:
|
|
return "ANSWER2";
|
|
default:
|
|
return "SOLUTION";
|
|
}
|
|
}
|
|
|
|
public static function fromName($name) {
|
|
switch ($name) {
|
|
case "ANSWER1":
|
|
return self::ANSWER1;
|
|
case "ANSWER2":
|
|
return self::ANSWER2;
|
|
default:
|
|
return self::SOLUTION;
|
|
}
|
|
}
|
|
} |