2019-09-16 22:04:45 +00:00
|
|
|
<?php
|
|
|
|
|
|
|
|
|
|
|
|
class Reason
|
|
|
|
{
|
|
|
|
const SOLUTION = 0;
|
2019-09-23 22:12:33 +00:00
|
|
|
const ANSWER1 = 1;
|
|
|
|
const ANSWER2 = 2;
|
2019-09-16 22:04:45 +00:00
|
|
|
|
|
|
|
public static function getTranslatedName($class) {
|
|
|
|
switch ($class) {
|
2019-09-23 22:12:33 +00:00
|
|
|
case self::ANSWER1:
|
|
|
|
case self::ANSWER2:
|
2019-09-16 22:04:45 +00:00
|
|
|
return "Réponse";
|
|
|
|
default:
|
|
|
|
return "Solution";
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
public static function getName($class) {
|
|
|
|
switch ($class) {
|
2019-09-23 22:12:33 +00:00
|
|
|
case self::ANSWER1:
|
|
|
|
return "ANSWER1";
|
|
|
|
case self::ANSWER2:
|
|
|
|
return "ANSWER2";
|
2019-09-16 22:04:45 +00:00
|
|
|
default:
|
|
|
|
return "SOLUTION";
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
public static function fromName($name) {
|
|
|
|
switch ($name) {
|
2019-09-23 22:12:33 +00:00
|
|
|
case "ANSWER1":
|
|
|
|
return self::ANSWER1;
|
|
|
|
case "ANSWER2":
|
|
|
|
return self::ANSWER2;
|
2019-09-16 22:04:45 +00:00
|
|
|
default:
|
|
|
|
return self::SOLUTION;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|