| @@ 918-927 (lines=10) @@ | ||
| 915 | * @param string $filePath The absolute filepath |
|
| 916 | * @return bool Whether it is an IMS/QTI question bank or not |
|
| 917 | */ |
|
| 918 | function isQtiQuestionBank($filePath) |
|
| 919 | { |
|
| 920 | $data = file_get_contents($filePath); |
|
| 921 | if (!empty($data)) { |
|
| 922 | $match = preg_match('/ims_qtiasiv(\d)p(\d)/', $data); |
|
| 923 | if ($match) { |
|
| 924 | return true; |
|
| 925 | } |
|
| 926 | } |
|
| 927 | ||
| 928 | return false; |
|
| 929 | } |
|
| 930 | ||
| @@ 936-945 (lines=10) @@ | ||
| 933 | * @param string $filePath The absolute filepath |
|
| 934 | * @return bool Whether it is an IMS/QTI manifest file or not |
|
| 935 | */ |
|
| 936 | function isQtiManifest($filePath) |
|
| 937 | { |
|
| 938 | $data = file_get_contents($filePath); |
|
| 939 | if (!empty($data)) { |
|
| 940 | $match = preg_match('/imsccv(\d)p(\d)/', $data); |
|
| 941 | if ($match) { |
|
| 942 | return true; |
|
| 943 | } |
|
| 944 | } |
|
| 945 | ||
| 946 | return false; |
|
| 947 | } |
|
| 948 | ||