123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111 |
- <?php
- include('exercise.class.php');
- include('question.class.php');
- include('answer.class.php');
- include('../inc/global.inc.php');
- $questionId = $_GET['modifyAnswers'];
- $objQuestion = Question::read($questionId);
- $TBL_ANSWERS = Database::get_course_table(TABLE_QUIZ_ANSWER);
- $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 ($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['hotspot_type'][$i] == 'delineation')
- {
- $output .= "&hotspot_".$i."_type=delineation";
- }
-
- 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";
- ?>
|