12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788 |
- <?php
- include('../inc/global.inc.php');
- $questionId = intval($_GET['modifyAnswers']);
- $objQuestion = Question::read($questionId);
- $documentPath = api_get_path(SYS_COURSE_PATH).$_course['path'].'/document';
- $picturePath = $documentPath.'/images';
- $pictureName = $objQuestion->selectPicture();
- $pictureSize = getimagesize($picturePath.'/'.$objQuestion->selectPicture());
- $pictureWidth = $pictureSize[0];
- $pictureHeight = $pictureSize[1];
- $courseLang = $_course['language'];
- $courseCode = $_course['sysCode'];
- $coursePath = $_course['path'];
- $output = "hotspot_lang=$courseLang&hotspot_image=$pictureName&hotspot_image_width=$pictureWidth&hotspot_image_height=$pictureHeight&courseCode=$coursePath";
- $i = 0;
- $nmbrTries = 0;
- $answers = $_SESSION['tmp_answers'];
- $nbrAnswers = count($answers['answer']);
- for($i=1;$i <= $nbrAnswers;$i++) {
- $output .= "&hotspot_".$i."=true";
- $output .= "&hotspot_".$i."_answer=".$answers['answer'][$i];
- if ($answer_type==HOT_SPOT_DELINEATION) {
- if ($i==1)
- $output .= "&hotspot_".$i."_type=delineation";
- else
- $output .= "&hotspot_".$i."_type=oar";
- } else {
-
- if ($answers['hotspot_type'][$i] == 'square' )
- {
- $output .= "&hotspot_".$i."_type=square";
- }
-
- if ($answers['hotspot_type'][$i] == 'circle')
- {
- $output .= "&hotspot_".$i."_type=circle";
- }
-
- if ($answers['hotspot_type'][$i] == 'poly')
- {
- $output .= "&hotspot_".$i."_type=poly";
- }
-
- }
-
- if ($answers['weighting'][$i] > 0)
- {
- $nmbrTries++;
- }
- $output .= "&hotspot_".$i."_coord=".$answers['hotspot_coordinates'][$i]."";
- }
- $i++;
- for ($i; $i <= 12; $i++) {
- $output .= "&hotspot_".$i."=false";
- }
- echo $output."&nmbrTries=".$nmbrTries."&done=done";
|