| @@ 433-449 (lines=17) @@ | ||
| 430 | * @param string Children language path |
|
| 431 | * @return string Parent language path or null |
|
| 432 | */ |
|
| 433 | public static function get_parent_language_path($language_path) |
|
| 434 | { |
|
| 435 | $tbl_admin_languages = Database :: get_main_table(TABLE_MAIN_LANGUAGE); |
|
| 436 | $sql = "SELECT dokeos_folder |
|
| 437 | FROM " . $tbl_admin_languages . " |
|
| 438 | WHERE id = ( |
|
| 439 | SELECT parent_id FROM " . $tbl_admin_languages . " |
|
| 440 | WHERE dokeos_folder = '" . Database::escape_string($language_path) . "' |
|
| 441 | ) |
|
| 442 | "; |
|
| 443 | $result = Database::query($sql); |
|
| 444 | if (Database::num_rows($result) == 0) { |
|
| 445 | return null; |
|
| 446 | } |
|
| 447 | $row = Database::fetch_array($result); |
|
| 448 | return $row['dokeos_folder']; |
|
| 449 | } |
|
| 450 | ||
| 451 | /** |
|
| 452 | * Get language matching isocode |
|
| @@ 1623-1635 (lines=13) @@ | ||
| 1620 | * |
|
| 1621 | * @return string the comment |
|
| 1622 | */ |
|
| 1623 | public static function get_comments($exe_id, $question_id) |
|
| 1624 | { |
|
| 1625 | $table_track_attempt = Database::get_main_table(TABLE_STATISTIC_TRACK_E_ATTEMPT); |
|
| 1626 | $sql = "SELECT teacher_comment FROM ".$table_track_attempt." |
|
| 1627 | WHERE |
|
| 1628 | exe_id='".Database::escape_string($exe_id)."' AND |
|
| 1629 | question_id = '".Database::escape_string($question_id)."' |
|
| 1630 | ORDER by question_id"; |
|
| 1631 | $sqlres = Database::query($sql); |
|
| 1632 | $comm = Database::result($sqlres, 0, "teacher_comment"); |
|
| 1633 | ||
| 1634 | return $comm; |
|
| 1635 | } |
|
| 1636 | ||
| 1637 | /** |
|
| 1638 | * @param int $exe_id |
|