plateforme-corres2math/server_files/classes/Reason.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;
}
}
}