4 require_once
'Services/Form/classes/class.ilFileInputGUI.php';
5 require_once
'Modules/TestQuestionPool/classes/class.assAnswerImagemap.php';
27 if (!parent::checkInput()) {
31 $tmp_file_name = $_FILES[$this->
getPostVar()][
'tmp_name'];
32 if (strlen($tmp_file_name) == 0) {
36 if (!is_readable($tmp_file_name)) {
37 $this->
setAlert($lng->txt(
'ass_imap_map_file_not_readable'));
41 $contents = file_get_contents($tmp_file_name);
44 !preg_match_all(
'/<area(.+)>/siU',
$contents, $matches) ||
45 !is_array($matches) ||
46 !isset($matches[1]) ||
47 count($matches[1]) == 0
49 $this->
setAlert($lng->txt(
'ass_imap_no_map_found'));
53 for (
$i = 0;
$i< count($matches[1]);
$i++) {
54 preg_match(
"/alt\s*=\s*\"(.+)\"\s*/siU", $matches[1][
$i], $alt);
55 preg_match(
"/coords\s*=\s*\"(.+)\"\s*/siU", $matches[1][
$i],
$coords);
56 preg_match(
"/shape\s*=\s*\"(.+)\"\s*/siU", $matches[1][
$i], $shape);
Class for true/false or yes/no answers.
Create styles array
The data for the language used.