parent
d7eea36e96
commit
9da7c7611f
@ -1,118 +1,98 @@ |
||||
<?php |
||||
/* |
||||
============================================================================== |
||||
Dokeos - elearning and course management software |
||||
DOKEOS - elearning and course management software |
||||
|
||||
Copyright (c) 2004 Dokeos S.A. |
||||
Copyright (c) 2003 Ghent University (UGent) |
||||
Copyright (c) 2001 Universite catholique de Louvain (UCL) |
||||
Copyright (c) Olivier Brouckaert |
||||
For a full list of contributors, see documentation/credits.html |
||||
|
||||
For a full list of contributors, see "credits.txt". |
||||
The full license can be read in "license.txt". |
||||
This program is free software; you can redistribute it and/or |
||||
modify it under the terms of the GNU General Public License |
||||
as published by the Free Software Foundation; either version 2 |
||||
of the License, or (at your option) any later version. |
||||
See "documentation/licence.html" more details. |
||||
|
||||
This program is free software; you can redistribute it and/or |
||||
modify it under the terms of the GNU General Public License |
||||
as published by the Free Software Foundation; either version 2 |
||||
of the License, or (at your option) any later version. |
||||
Contact: |
||||
Dokeos |
||||
Rue des Palais 44 Paleizenstraat |
||||
B-1030 Brussels - Belgium |
||||
Tel. +32 (2) 211 34 56 |
||||
*/ |
||||
|
||||
See the GNU General Public License for more details. |
||||
|
||||
Contact: Dokeos, 181 rue Royale, B-1000 Brussels, Belgium, info@dokeos.com |
||||
============================================================================== |
||||
*/ |
||||
/** |
||||
============================================================================== |
||||
* This file generates the ActionScript variables code used by the HotSpot .swf |
||||
* |
||||
* @author Toon Keppens |
||||
* @package dokeos.exercise |
||||
============================================================================== |
||||
* @author Toon Keppens |
||||
* @version $Id: admin.php 10680 2007-01-11 21:26:23Z pcool $ |
||||
*/ |
||||
|
||||
include('exercise.class.php'); |
||||
include('question.class.php'); |
||||
include('answer.class.php'); |
||||
|
||||
include('../inc/global.inc.php'); |
||||
|
||||
// set vars |
||||
$questionId = $_GET['modifyAnswers']; |
||||
$objQuestion = Question::read($questionId); |
||||
|
||||
$TBL_ANSWERS = Database::get_course_table(TABLE_QUIZ_ANSWER); |
||||
|
||||
$dbNameGlu = $_course['dbNameGlu']; |
||||
$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']; |
||||
|
||||
// Query db for answers |
||||
$sql = "SELECT id, answer, hotspot_coordinates, hotspot_type, ponderation FROM `$TBL_ANSWERS` WHERE question_id = '$questionId' ORDER BY id"; |
||||
$result = api_sql_query($sql,__FILE__,__LINE__); |
||||
|
||||
// Init |
||||
$output = "hotspot_lang=$courseLang&hotspot_image=$pictureName&hotspot_image_width=$pictureWidth&hotspot_image_height=$pictureHeight&dbNameGlu=$dbNameGlu&courseCode=$coursePath"; |
||||
$i = 0; |
||||
$nmbrTries = 0; |
||||
|
||||
while ($hotspot = mysql_fetch_assoc($result)) |
||||
include('exercise.class.php'); |
||||
include('question.class.php'); |
||||
include('answer.class.php'); |
||||
|
||||
include('../inc/global.inc.php'); |
||||
|
||||
// set vars |
||||
$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']; |
||||
|
||||
// Query db for answers |
||||
$sql = "SELECT id, answer, hotspot_coordinates, hotspot_type, ponderation FROM `$TBL_ANSWERS` WHERE question_id = '$questionId' ORDER BY id"; |
||||
$result = api_sql_query($sql,__FILE__,__LINE__); |
||||
|
||||
// Init |
||||
$output = "hotspot_lang=$courseLang&hotspot_image=$pictureName&hotspot_image_width=$pictureWidth&hotspot_image_height=$pictureHeight&courseCode=$coursePath"; |
||||
$i = 0; |
||||
$nmbrTries = 0; |
||||
|
||||
while ($hotspot = mysql_fetch_assoc($result)) |
||||
{ |
||||
$output .= "&hotspot_".$hotspot['id']."=true"; |
||||
$output .= "&hotspot_".$hotspot['id']."_answer=".str_replace('&','{amp}',$hotspot['answer']); |
||||
// Square or rectancle |
||||
if ($hotspot['hotspot_type'] == 'square' ) |
||||
{ |
||||
$output .= "&hotspot_".$hotspot['id']."=true"; |
||||
$output .= "&hotspot_".$hotspot['id']."_answer=".str_replace('&','{amp}',$hotspot['answer']); |
||||
|
||||
// Square or rectancle |
||||
if ($hotspot['hotspot_type'] == 'square' ) |
||||
{ |
||||
$output .= "&hotspot_".$hotspot['id']."_type=square"; |
||||
} |
||||
|
||||
// Circle or ovale |
||||
if ($hotspot['hotspot_type'] == 'circle') |
||||
{ |
||||
$output .= "&hotspot_".$hotspot['id']."_type=circle"; |
||||
} |
||||
|
||||
// Polygon |
||||
if ($hotspot['hotspot_type'] == 'poly') |
||||
{ |
||||
$output .= "&hotspot_".$hotspot['id']."_type=poly"; |
||||
} |
||||
|
||||
// This is a good answer, count + 1 for nmbr of clicks |
||||
if ($hotspot['hotspot_type'] > 0) |
||||
{ |
||||
$nmbrTries++; |
||||
} |
||||
|
||||
$output .= "&hotspot_".$hotspot['id']."_coord=".$hotspot['hotspot_coordinates'].""; |
||||
|
||||
$i++; |
||||
|
||||
$output .= "&hotspot_".$hotspot['id']."_type=square"; |
||||
} |
||||
|
||||
// Generate empty |
||||
$i++; |
||||
for ($i; $i <= 12; $i++) |
||||
// Circle or ovale |
||||
if ($hotspot['hotspot_type'] == 'circle') |
||||
{ |
||||
$output .= "&hotspot_".$hotspot['id']."_type=circle"; |
||||
} |
||||
// Polygon |
||||
if ($hotspot['hotspot_type'] == 'poly') |
||||
{ |
||||
$output .= "&hotspot_".$i."=false"; |
||||
$output .= "&hotspot_".$hotspot['id']."_type=poly"; |
||||
} |
||||
|
||||
// Output |
||||
echo $output."&nmbrTries=".$nmbrTries."&done=done"; |
||||
// This is a good answer, count + 1 for nmbr of clicks |
||||
if ($hotspot['hotspot_type'] > 0) |
||||
{ |
||||
$nmbrTries++; |
||||
} |
||||
|
||||
/*echo '<pre>'; |
||||
$output .= "&hotspot_".$hotspot['id']."_coord=".$hotspot['hotspot_coordinates'].""; |
||||
$i++; |
||||
|
||||
var_dump($explode); |
||||
} |
||||
|
||||
echo '</pre>';*/ |
||||
// Generate empty |
||||
$i++; |
||||
for ($i; $i <= 12; $i++) |
||||
{ |
||||
$output .= "&hotspot_".$i."=false"; |
||||
} |
||||
|
||||
// Output |
||||
echo $output."&nmbrTries=".$nmbrTries."&done=done"; |
||||
?> |
||||
@ -1,113 +1,106 @@ |
||||
<?php |
||||
/* |
||||
============================================================================== |
||||
Dokeos - elearning and course management software |
||||
DOKEOS - elearning and course management software |
||||
|
||||
Copyright (c) 2004 Dokeos S.A. |
||||
Copyright (c) 2003 Ghent University (UGent) |
||||
Copyright (c) 2001 Universite catholique de Louvain (UCL) |
||||
Copyright (c) Olivier Brouckaert |
||||
For a full list of contributors, see documentation/credits.html |
||||
|
||||
For a full list of contributors, see "credits.txt". |
||||
The full license can be read in "license.txt". |
||||
This program is free software; you can redistribute it and/or |
||||
modify it under the terms of the GNU General Public License |
||||
as published by the Free Software Foundation; either version 2 |
||||
of the License, or (at your option) any later version. |
||||
See "documentation/licence.html" more details. |
||||
|
||||
This program is free software; you can redistribute it and/or |
||||
modify it under the terms of the GNU General Public License |
||||
as published by the Free Software Foundation; either version 2 |
||||
of the License, or (at your option) any later version. |
||||
Contact: |
||||
Dokeos |
||||
Rue des Palais 44 Paleizenstraat |
||||
B-1030 Brussels - Belgium |
||||
Tel. +32 (2) 211 34 56 |
||||
*/ |
||||
|
||||
See the GNU General Public License for more details. |
||||
|
||||
Contact: Dokeos, 181 rue Royale, B-1000 Brussels, Belgium, info@dokeos.com |
||||
============================================================================== |
||||
*/ |
||||
/** |
||||
============================================================================== |
||||
* This file generates the ActionScript variables code used by the HotSpot .swf |
||||
* |
||||
* @author Toon Keppens |
||||
* @package dokeos.exercise |
||||
============================================================================== |
||||
* @author Toon Keppens |
||||
* @version $Id: admin.php 10680 2007-01-11 21:26:23Z pcool $ |
||||
*/ |
||||
|
||||
include('exercise.class.php'); |
||||
include('question.class.php'); |
||||
include('answer.class.php'); |
||||
|
||||
include('../inc/global.inc.php'); |
||||
|
||||
// set vars |
||||
$questionId = $_GET['modifyAnswers']; |
||||
$objQuestion = Question::read($questionId); |
||||
|
||||
$TBL_ANSWERS = Database::get_course_table(TABLE_QUIZ_ANSWER); |
||||
|
||||
$dbNameGlu = $_course['dbNameGlu']; |
||||
$documentPath = api_get_path(SYS_COURSE_PATH).$_course['path'].'/document'; |
||||
include('exercise.class.php'); |
||||
include('question.class.php'); |
||||
include('answer.class.php'); |
||||
include('../inc/global.inc.php'); |
||||
// set vars |
||||
$questionId = $_GET['modifyAnswers']; |
||||
$objQuestion = Question::read($questionId); |
||||
|
||||
$picturePath = $documentPath.'/images'; |
||||
$pictureName = $objQuestion->selectPicture(); |
||||
$pictureSize = getimagesize($picturePath.'/'.$objQuestion->selectPicture()); |
||||
$pictureWidth = $pictureSize[0]; |
||||
$pictureHeight = $pictureSize[1]; |
||||
$TBL_ANSWERS = Database::get_course_table(TABLE_QUIZ_ANSWER); |
||||
$documentPath = api_get_path(SYS_COURSE_PATH).$_course['path'].'/document'; |
||||
|
||||
$courseLang = $_course['language']; |
||||
$courseCode = $_course['sysCode']; |
||||
$coursePath = $_course['path']; |
||||
$picturePath = $documentPath.'/images'; |
||||
$pictureName = $objQuestion->selectPicture(); |
||||
$pictureSize = getimagesize($picturePath.'/'.$objQuestion->selectPicture()); |
||||
$pictureWidth = $pictureSize[0]; |
||||
$pictureHeight = $pictureSize[1]; |
||||
|
||||
// Query db for answers |
||||
//$sql = "SELECT id, answer, hotspot_coordinates, hotspot_type, ponderation FROM `$TBL_ANSWERS` WHERE question_id = '$questionId' ORDER BY id"; |
||||
//$result = api_sql_query($sql,__FILE__,__LINE__); |
||||
$courseLang = $_course['language']; |
||||
$courseCode = $_course['sysCode']; |
||||
$coursePath = $_course['path']; |
||||
|
||||
// Init |
||||
$output = "hotspot_lang=$courseLang&hotspot_image=$pictureName&hotspot_image_width=$pictureWidth&hotspot_image_height=$pictureHeight&dbNameGlu=$dbNameGlu&courseCode=$coursePath"; |
||||
$i = 0; |
||||
$nmbrTries = 0; |
||||
// Query db for answers |
||||
//$sql = "SELECT id, answer, hotspot_coordinates, hotspot_type, ponderation FROM `$TBL_ANSWERS` WHERE question_id = '$questionId' ORDER BY id"; |
||||
//$result = api_sql_query($sql,__FILE__,__LINE__); |
||||
|
||||
// Init |
||||
$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]; |
||||
$answers=$_SESSION['tmp_answers']; |
||||
$nbrAnswers = count($answers['answer']); |
||||
|
||||
// Square or rectancle |
||||
if ($answers['hotspot_type'][$i] == 'square' ) |
||||
{ |
||||
$output .= "&hotspot_".$i."_type=square"; |
||||
} |
||||
for($i=1;$i <= $nbrAnswers;$i++) |
||||
{ |
||||
$output .= "&hotspot_".$i."=true"; |
||||
$output .= "&hotspot_".$i."_answer=".$answers['answer'][$i]; |
||||
|
||||
// Circle or ovale |
||||
if ($answers['hotspot_type'][$i] == 'circle') |
||||
{ |
||||
$output .= "&hotspot_".$i."_type=circle"; |
||||
} |
||||
|
||||
// Polygon |
||||
if ($answers['hotspot_type'][$i] == 'poly') |
||||
{ |
||||
$output .= "&hotspot_".$i."_type=poly"; |
||||
} |
||||
// Square or rectancle |
||||
if ($answers['hotspot_type'][$i] == 'square' ) |
||||
{ |
||||
$output .= "&hotspot_".$i."_type=square"; |
||||
} |
||||
|
||||
// This is a good answer, count + 1 for nmbr of clicks |
||||
if ($answers['weighting'][$i] > 0) |
||||
{ |
||||
$nmbrTries++; |
||||
} |
||||
// Circle or ovale |
||||
if ($answers['hotspot_type'][$i] == 'circle') |
||||
{ |
||||
$output .= "&hotspot_".$i."_type=circle"; |
||||
} |
||||
|
||||
$output .= "&hotspot_".$i."_coord=".$answers['hotspot_coordinates'][$i].""; |
||||
} |
||||
// Polygon |
||||
if ($answers['hotspot_type'][$i] == 'poly') |
||||
{ |
||||
$output .= "&hotspot_".$i."_type=poly"; |
||||
} |
||||
|
||||
// Generate empty |
||||
$i++; |
||||
for ($i; $i <= 12; $i++) |
||||
// This is a good answer, count + 1 for nmbr of clicks |
||||
if ($answers['weighting'][$i] > 0) |
||||
{ |
||||
$output .= "&hotspot_".$i."=false"; |
||||
$nmbrTries++; |
||||
} |
||||
|
||||
// Output |
||||
echo $output."&nmbrTries=".$nmbrTries."&done=done"; |
||||
$output .= "&hotspot_".$i."_coord=".$answers['hotspot_coordinates'][$i].""; |
||||
} |
||||
|
||||
// Generate empty |
||||
$i++; |
||||
for ($i; $i <= 12; $i++) |
||||
{ |
||||
$output .= "&hotspot_".$i."=false"; |
||||
} |
||||
|
||||
// Output |
||||
echo $output."&nmbrTries=".$nmbrTries."&done=done"; |
||||
?> |
||||
@ -1,129 +1,107 @@ |
||||
<?php |
||||
/* |
||||
============================================================================== |
||||
Dokeos - elearning and course management software |
||||
DOKEOS - elearning and course management software |
||||
|
||||
Copyright (c) 2004 Dokeos S.A. |
||||
Copyright (c) 2003 Ghent University (UGent) |
||||
Copyright (c) 2001 Universite catholique de Louvain (UCL) |
||||
Copyright (c) Olivier Brouckaert |
||||
For a full list of contributors, see documentation/credits.html |
||||
|
||||
For a full list of contributors, see "credits.txt". |
||||
The full license can be read in "license.txt". |
||||
This program is free software; you can redistribute it and/or |
||||
modify it under the terms of the GNU General Public License |
||||
as published by the Free Software Foundation; either version 2 |
||||
of the License, or (at your option) any later version. |
||||
See "documentation/licence.html" more details. |
||||
|
||||
This program is free software; you can redistribute it and/or |
||||
modify it under the terms of the GNU General Public License |
||||
as published by the Free Software Foundation; either version 2 |
||||
of the License, or (at your option) any later version. |
||||
Contact: |
||||
Dokeos |
||||
Rue des Palais 44 Paleizenstraat |
||||
B-1030 Brussels - Belgium |
||||
Tel. +32 (2) 211 34 56 |
||||
*/ |
||||
|
||||
See the GNU General Public License for more details. |
||||
|
||||
Contact: Dokeos, 181 rue Royale, B-1000 Brussels, Belgium, info@dokeos.com |
||||
============================================================================== |
||||
*/ |
||||
/** |
||||
============================================================================== |
||||
* This file generates the ActionScript variables code used by the HotSpot .swf |
||||
* |
||||
* @author Toon Keppens |
||||
* @package dokeos.exercise |
||||
============================================================================== |
||||
* @author Toon Keppens |
||||
* @version $Id: admin.php 10680 2007-01-11 21:26:23Z pcool $ |
||||
*/ |
||||
|
||||
|
||||
include('exercise.class.php'); |
||||
include('question.class.php'); |
||||
include('answer.class.php'); |
||||
|
||||
include('../inc/global.inc.php'); |
||||
//include('../inc/lib/database.inc.lib'); |
||||
|
||||
// set vars |
||||
$userId = $_user['user_id']; |
||||
$questionId = $_GET['modifyAnswers']; |
||||
|
||||
$objQuestion = Question :: read($questionId); |
||||
|
||||
$TBL_ANSWERS = Database::get_course_table(TABLE_QUIZ_ANSWER); |
||||
|
||||
$dbNameGlu = $_course['dbNameGlu']; |
||||
$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']; |
||||
|
||||
// Query db for answers |
||||
$sql = "SELECT id, answer, hotspot_coordinates, hotspot_type FROM `$TBL_ANSWERS` WHERE question_id = '$questionId' ORDER BY id"; |
||||
$result = api_sql_query($sql,__FILE__,__LINE__); |
||||
|
||||
// Init |
||||
$output = "hotspot_lang=$courseLang&hotspot_image=$pictureName&hotspot_image_width=$pictureWidth&hotspot_image_height=$pictureHeight&dbNameGlu=$dbNameGlu&courseCode=$coursePath"; |
||||
$i = 0; |
||||
|
||||
while ($hotspot = mysql_fetch_array($result)) { |
||||
|
||||
$output .= "&hotspot_".$hotspot['id']."=true"; |
||||
|
||||
// Square or rectancle |
||||
if ($hotspot['hotspot_type'] == 'square' ) |
||||
{ |
||||
$output .= "&hotspot_".$hotspot['id']."_type=square"; |
||||
} |
||||
|
||||
// Circle or ovale |
||||
if ($hotspot['hotspot_type'] == 'circle') |
||||
{ |
||||
$output .= "&hotspot_".$hotspot['id']."_type=circle"; |
||||
} |
||||
|
||||
// Polygon |
||||
if ($hotspot['hotspot_type'] == 'poly') |
||||
{ |
||||
$output .= "&hotspot_".$hotspot['id']."_type=poly"; |
||||
} |
||||
|
||||
$output .= "&hotspot_".$hotspot['id']."_coord=".$hotspot['hotspot_coordinates'].""; |
||||
|
||||
$i++; |
||||
include('exercise.class.php'); |
||||
include('question.class.php'); |
||||
include('answer.class.php'); |
||||
include('../inc/global.inc.php'); |
||||
|
||||
// set vars |
||||
$userId = $_user['user_id']; |
||||
$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']; |
||||
|
||||
// Query db for answers |
||||
$sql = "SELECT id, answer, hotspot_coordinates, hotspot_type FROM `$TBL_ANSWERS` WHERE question_id = '$questionId' ORDER BY id"; |
||||
$result = api_sql_query($sql,__FILE__,__LINE__); |
||||
|
||||
// Init |
||||
$output = "hotspot_lang=$courseLang&hotspot_image=$pictureName&hotspot_image_width=$pictureWidth&hotspot_image_height=$pictureHeight&courseCode=$coursePath"; |
||||
$i = 0; |
||||
|
||||
while ($hotspot = mysql_fetch_array($result)) |
||||
{ |
||||
$output .= "&hotspot_".$hotspot['id']."=true"; |
||||
// Square or rectancle |
||||
if ($hotspot['hotspot_type'] == 'square' ) |
||||
{ |
||||
$output .= "&hotspot_".$hotspot['id']."_type=square"; |
||||
} |
||||
|
||||
// Generate empty |
||||
$i++; |
||||
for ($i; $i <= 12; $i++) |
||||
// Circle or ovale |
||||
if ($hotspot['hotspot_type'] == 'circle') |
||||
{ |
||||
$output .= "&hotspot_".$i."=false"; |
||||
$output .= "&hotspot_".$hotspot['id']."_type=circle"; |
||||
} |
||||
|
||||
// set vars |
||||
$questionId = $_GET['modifyAnswers']; |
||||
|
||||
$courseCode = $_course['sysCode']; |
||||
|
||||
// Get clicks |
||||
foreach ($_SESSION['exerciseResultCoordinates'][$questionId] as $coordinate) |
||||
// Polygon |
||||
if ($hotspot['hotspot_type'] == 'poly') |
||||
{ |
||||
$output2 .= $coordinate."|"; |
||||
$output .= "&hotspot_".$hotspot['id']."_type=poly"; |
||||
} |
||||
|
||||
//var_dump($_SESSION['exerciseResultCoordinates']); |
||||
// Output |
||||
$output .= "&p_hotspot_answers=".substr($output2,0,-1)."&done=done"; |
||||
$output .= "&hotspot_".$hotspot['id']."_coord=".$hotspot['hotspot_coordinates'].""; |
||||
|
||||
$i++; |
||||
} |
||||
|
||||
$explode = explode('&', $output); |
||||
// Generate empty |
||||
$i++; |
||||
for ($i; $i <= 12; $i++) |
||||
{ |
||||
$output .= "&hotspot_".$i."=false"; |
||||
} |
||||
|
||||
/*echo '<pre>'; |
||||
// set vars |
||||
$questionId = $_GET['modifyAnswers']; |
||||
$courseCode = $_course['sysCode']; |
||||
|
||||
var_dump($explode); |
||||
// Get clicks |
||||
foreach ($_SESSION['exerciseResultCoordinates'][$questionId] as $coordinate) |
||||
{ |
||||
$output2 .= $coordinate."|"; |
||||
} |
||||
|
||||
echo '</pre>';*/ |
||||
$output .= "&p_hotspot_answers=".substr($output2,0,-1)."&done=done"; |
||||
|
||||
echo $output; |
||||
$explode = explode('&', $output); |
||||
|
||||
echo $output; |
||||
?> |
||||
@ -1,72 +1,67 @@ |
||||
<?php |
||||
/* |
||||
============================================================================== |
||||
Dokeos - elearning and course management software |
||||
|
||||
Copyright (c) 2004 Dokeos S.A. |
||||
Copyright (c) 2003 Ghent University (UGent) |
||||
Copyright (c) 2001 Universite catholique de Louvain (UCL) |
||||
Copyright (c) Olivier Brouckaert |
||||
|
||||
For a full list of contributors, see "credits.txt". |
||||
The full license can be read in "license.txt". |
||||
|
||||
This program is free software; you can redistribute it and/or |
||||
modify it under the terms of the GNU General Public License |
||||
as published by the Free Software Foundation; either version 2 |
||||
of the License, or (at your option) any later version. |
||||
|
||||
See the GNU General Public License for more details. |
||||
|
||||
Contact: Dokeos, 181 rue Royale, B-1000 Brussels, Belgium, info@dokeos.com |
||||
============================================================================== |
||||
DOKEOS - elearning and course management software |
||||
|
||||
For a full list of contributors, see documentation/credits.html |
||||
|
||||
This program is free software; you can redistribute it and/or |
||||
modify it under the terms of the GNU General Public License |
||||
as published by the Free Software Foundation; either version 2 |
||||
of the License, or (at your option) any later version. |
||||
See "documentation/licence.html" more details. |
||||
|
||||
Contact: |
||||
Dokeos |
||||
Rue des Palais 44 Paleizenstraat |
||||
B-1030 Brussels - Belgium |
||||
Tel. +32 (2) 211 34 56 |
||||
*/ |
||||
|
||||
|
||||
/** |
||||
============================================================================== |
||||
* This file generates the ActionScript code used by the HotSpot .swf |
||||
* |
||||
* @author Toon Keppens |
||||
* @package dokeos.exercise |
||||
============================================================================== |
||||
* @author Toon Keppens |
||||
* @version $Id: admin.php 10680 2007-01-11 21:26:23Z pcool $ |
||||
*/ |
||||
|
||||
include('exercise.class.php'); |
||||
include('question.class.php'); |
||||
include('answer.class.php'); |
||||
|
||||
include('../inc/global.inc.php'); |
||||
|
||||
$TBL_ANSWER = $_GET['dbNameGlu']."quiz_answer"; |
||||
$questionId = $_GET['questionId']; |
||||
$answerId = $_GET['answerId']; |
||||
|
||||
if ($_GET['type'] == "square" || $_GET['type'] == "circle") |
||||
{ |
||||
$hotspot_type = $_GET['type']; |
||||
$hotspot_coordinates = $_GET['x'].";".$_GET['y']."|".$_GET['width']."|".$_GET['height']; |
||||
} |
||||
if ($_GET['type'] == "poly") |
||||
include('exercise.class.php'); |
||||
include('question.class.php'); |
||||
include('answer.class.php'); |
||||
include('../inc/global.inc.php'); |
||||
|
||||
$TBL_ANSWER = Database::get_course_table(TABLE_QUIZ_ANSWER); |
||||
$questionId = $_GET['questionId']; |
||||
$answerId = $_GET['answerId']; |
||||
|
||||
if ($_GET['type'] == "square" || $_GET['type'] == "circle") |
||||
{ |
||||
$hotspot_type = $_GET['type']; |
||||
$hotspot_coordinates = $_GET['x'].";".$_GET['y']."|".$_GET['width']."|".$_GET['height']; |
||||
} |
||||
if ($_GET['type'] == "poly") |
||||
{ |
||||
$hotspot_type = $_GET['type']; |
||||
$tmp_coord = explode(",",$_GET['co']); |
||||
$i = 0; |
||||
$hotspot_coordinates = ""; |
||||
foreach ($tmp_coord as $coord) |
||||
{ |
||||
$hotspot_type = $_GET['type']; |
||||
$tmp_coord = explode(",",$_GET['co']); |
||||
$i = 0; |
||||
$hotspot_coordinates = ""; |
||||
foreach ($tmp_coord as $coord) |
||||
if ($i%2 == 0) |
||||
{ |
||||
$delimiter = ";"; |
||||
} |
||||
else |
||||
{ |
||||
if ($i%2 == 0) |
||||
{ |
||||
$delimiter = ";"; |
||||
} else |
||||
{ |
||||
$delimiter = "|"; |
||||
} |
||||
$hotspot_coordinates .= $coord.$delimiter; |
||||
$i++; |
||||
$delimiter = "|"; |
||||
} |
||||
$hotspot_coordinates = substr($hotspot_coordinates,0,-2); |
||||
$hotspot_coordinates .= $coord.$delimiter; |
||||
$i++; |
||||
} |
||||
$sql = "UPDATE `$TBL_ANSWER` SET `hotspot_coordinates` = '$hotspot_coordinates',`hotspot_type` = '$hotspot_type' WHERE `id` =$answerId AND `question_id` =$questionId LIMIT 1 ;"; |
||||
$result = api_sql_query($sql,__FILE__,__LINE__); |
||||
|
||||
echo "done=done"; |
||||
$hotspot_coordinates = substr($hotspot_coordinates,0,-2); |
||||
} |
||||
$sql = "UPDATE `$TBL_ANSWER` SET `hotspot_coordinates` = '$hotspot_coordinates',`hotspot_type` = '$hotspot_type' WHERE `id` =$answerId AND `question_id` =$questionId LIMIT 1 ;"; |
||||
$result = api_sql_query($sql,__FILE__,__LINE__); |
||||
echo "done=done"; |
||||
?> |
||||
@ -1,75 +1,60 @@ |
||||
<?php |
||||
/* |
||||
============================================================================== |
||||
Dokeos - elearning and course management software |
||||
|
||||
Copyright (c) 2004 Dokeos S.A. |
||||
Copyright (c) 2003 Ghent University (UGent) |
||||
Copyright (c) 2001 Universite catholique de Louvain (UCL) |
||||
Copyright (c) Olivier Brouckaert |
||||
|
||||
For a full list of contributors, see "credits.txt". |
||||
The full license can be read in "license.txt". |
||||
|
||||
This program is free software; you can redistribute it and/or |
||||
modify it under the terms of the GNU General Public License |
||||
as published by the Free Software Foundation; either version 2 |
||||
of the License, or (at your option) any later version. |
||||
|
||||
See the GNU General Public License for more details. |
||||
|
||||
Contact: Dokeos, 181 rue Royale, B-1000 Brussels, Belgium, info@dokeos.com |
||||
============================================================================== |
||||
DOKEOS - elearning and course management software |
||||
|
||||
For a full list of contributors, see documentation/credits.html |
||||
|
||||
This program is free software; you can redistribute it and/or |
||||
modify it under the terms of the GNU General Public License |
||||
as published by the Free Software Foundation; either version 2 |
||||
of the License, or (at your option) any later version. |
||||
See "documentation/licence.html" more details. |
||||
|
||||
Contact: |
||||
Dokeos |
||||
Rue des Palais 44 Paleizenstraat |
||||
B-1030 Brussels - Belgium |
||||
Tel. +32 (2) 211 34 56 |
||||
*/ |
||||
|
||||
|
||||
/** |
||||
============================================================================== |
||||
* This file saves every click in the hotspot tool into track_e_hotspots |
||||
* |
||||
* @author Toon Keppens |
||||
* @package dokeos.exercise |
||||
============================================================================== |
||||
* @author Toon Keppens |
||||
* @version $Id: admin.php 10680 2007-01-11 21:26:23Z pcool $ |
||||
*/ |
||||
|
||||
include('exercise.class.php'); |
||||
include('question.class.php'); |
||||
include('answer.class.php'); |
||||
|
||||
include('../inc/global.inc.php'); |
||||
include('../inc/lib/database.lib.php'); |
||||
|
||||
$courseCode = $_GET['coursecode']; |
||||
$questionId = $_GET['questionId']; |
||||
$coordinates = $_GET['coord']; |
||||
$objExcercise = $_SESSION['objExercise']; |
||||
$exerciseId = $objExcercise->selectId(); |
||||
|
||||
// Save clicking order |
||||
$answerOrderId = count($_SESSION['exerciseResult'][$questionId]['ids'])+1; |
||||
|
||||
if ($_GET['answerId'] == "0") // click is NOT on a hotspot |
||||
{ |
||||
$hit = 0; |
||||
$answerId = NULL; |
||||
|
||||
} |
||||
else // user clicked ON a hotspot |
||||
{ |
||||
$hit = 1; |
||||
$answerId = substr($_GET['answerId'],22,2); |
||||
|
||||
// Save into session |
||||
$_SESSION['exerciseResult'][$questionId][$answerId] = $hit; |
||||
|
||||
} |
||||
|
||||
$TBL_TRACK_E_HOTSPOT = Database::get_statistic_table(STATISTIC_TRACK_E_HOTSPOTS); |
||||
|
||||
// Save into db |
||||
$sql = "INSERT INTO $TBL_TRACK_E_HOTSPOT (`user_id` , `course_id` , `quiz_id` , `question_id` , `answer_id` , `correct` , `coordinate` ) VALUES ('".$_user['user_id']."', '$courseCode', '$exerciseId', '$questionId', '$answerId', '$hit', '$coordinates')"; |
||||
|
||||
$result = api_sql_query($sql,__FILE__,__LINE__); |
||||
|
||||
// Save insert id into session if users changes answer. |
||||
$insert_id = mysql_insert_id(); |
||||
$_SESSION['exerciseResult'][$questionId]['ids'][$answerOrderId] = $insert_id; |
||||
include('exercise.class.php'); |
||||
include('question.class.php'); |
||||
include('answer.class.php'); |
||||
include('../inc/global.inc.php'); |
||||
include('../inc/lib/database.lib.php'); |
||||
$courseCode = $_GET['coursecode']; |
||||
$questionId = $_GET['questionId']; |
||||
$coordinates = $_GET['coord']; |
||||
$objExcercise = $_SESSION['objExercise']; |
||||
$exerciseId = $objExcercise->selectId(); |
||||
// Save clicking order |
||||
$answerOrderId = count($_SESSION['exerciseResult'][$questionId]['ids'])+1; |
||||
if ($_GET['answerId'] == "0") // click is NOT on a hotspot |
||||
{ |
||||
$hit = 0; |
||||
$answerId = NULL; |
||||
} |
||||
else // user clicked ON a hotspot |
||||
{ |
||||
$hit = 1; |
||||
$answerId = substr($_GET['answerId'],22,2); |
||||
// Save into session |
||||
$_SESSION['exerciseResult'][$questionId][$answerId] = $hit; |
||||
} |
||||
|
||||
$TBL_TRACK_E_HOTSPOT = Database::get_statistic_table(STATISTIC_TRACK_E_HOTSPOTS); |
||||
// Save into db |
||||
$sql = "INSERT INTO $TBL_TRACK_E_HOTSPOT (`user_id` , `course_id` , `quiz_id` , `question_id` , `answer_id` , `correct` , `coordinate` ) VALUES ('".$_user['user_id']."', '$courseCode', '$exerciseId', '$questionId', '$answerId', '$hit', '$coordinates')"; |
||||
$result = api_sql_query($sql,__FILE__,__LINE__); |
||||
// Save insert id into session if users changes answer. |
||||
$insert_id = mysql_insert_id(); |
||||
$_SESSION['exerciseResult'][$questionId]['ids'][$answerOrderId] = $insert_id; |
||||
?> |
||||
@ -1,77 +1,72 @@ |
||||
<?php |
||||
/* |
||||
============================================================================== |
||||
Dokeos - elearning and course management software |
||||
|
||||
Copyright (c) 2004 Dokeos S.A. |
||||
Copyright (c) 2003 Ghent University (UGent) |
||||
Copyright (c) 2001 Universite catholique de Louvain (UCL) |
||||
Copyright (c) Olivier Brouckaert |
||||
|
||||
For a full list of contributors, see "credits.txt". |
||||
The full license can be read in "license.txt". |
||||
|
||||
This program is free software; you can redistribute it and/or |
||||
modify it under the terms of the GNU General Public License |
||||
as published by the Free Software Foundation; either version 2 |
||||
of the License, or (at your option) any later version. |
||||
|
||||
See the GNU General Public License for more details. |
||||
|
||||
Contact: Dokeos, 181 rue Royale, B-1000 Brussels, Belgium, info@dokeos.com |
||||
============================================================================== |
||||
DOKEOS - elearning and course management software |
||||
|
||||
For a full list of contributors, see documentation/credits.html |
||||
|
||||
This program is free software; you can redistribute it and/or |
||||
modify it under the terms of the GNU General Public License |
||||
as published by the Free Software Foundation; either version 2 |
||||
of the License, or (at your option) any later version. |
||||
See "documentation/licence.html" more details. |
||||
|
||||
Contact: |
||||
Dokeos |
||||
Rue des Palais 44 Paleizenstraat |
||||
B-1030 Brussels - Belgium |
||||
Tel. +32 (2) 211 34 56 |
||||
*/ |
||||
|
||||
|
||||
/** |
||||
============================================================================== |
||||
* This file saves every click in the hotspot tool into track_e_hotspots |
||||
* |
||||
* @author Toon Keppens |
||||
* @package dokeos.exercise |
||||
============================================================================== |
||||
* @author Toon Keppens |
||||
* @version $Id: admin.php 10680 2007-01-11 21:26:23Z pcool $ |
||||
*/ |
||||
|
||||
include('exercise.class.php'); |
||||
include('question.class.php'); |
||||
include('answer.class.php'); |
||||
|
||||
include('../inc/global.inc.php'); |
||||
include('../inc/lib/database.lib.php'); |
||||
|
||||
$courseCode = $_GET['coursecode']; |
||||
$questionId = $_GET['questionId']; |
||||
$coordinates = $_GET['coord']; |
||||
$objExcercise = $_SESSION['objExercise']; |
||||
$hotspotId = $_GET['hotspotId']; |
||||
$exerciseId = $objExcercise->selectId(); |
||||
if ($_GET['answerId'] == "0") // click is NOT on a hotspot |
||||
{ |
||||
$hit = 0; |
||||
$answerId = $hotspotId; |
||||
|
||||
// remove from session |
||||
unset($_SESSION['exerciseResult'][$questionId][$answerId]); |
||||
|
||||
// Save clicking order |
||||
//$answerOrderId = count($_SESSION['exerciseResult'][$questionId]['order'])+1; |
||||
//$_SESSION['exerciseResult'][$questionId]['order'][$answerOrderId] = $answerId; |
||||
} |
||||
else // user clicked ON a hotspot |
||||
{ |
||||
$hit = 1; |
||||
$answerId = $hotspotId; |
||||
|
||||
// Save into session |
||||
$_SESSION['exerciseResult'][$questionId][$answerId] = $hit; |
||||
|
||||
// Save clicking order |
||||
//$answerOrderId = count($_SESSION['exerciseResult'][$questionId]['order'])+1; |
||||
//$_SESSION['exerciseResult'][$questionId]['order'][$answerOrderId] = $answerId; |
||||
} |
||||
|
||||
$TBL_TRACK_E_HOTSPOT = Database::get_statistic_table(STATISTIC_TRACK_E_HOTSPOTS); |
||||
|
||||
// update db |
||||
$update_id = $_SESSION['exerciseResult'][$questionId]['ids'][$answerId]; |
||||
$sql = "UPDATE $TBL_TRACK_E_HOTSPOT SET `coordinate` = '".$coordinates."' WHERE `id` =$update_id LIMIT 1 ;;"; |
||||
$result = api_sql_query($sql,__FILE__,__LINE__); |
||||
|
||||
include('exercise.class.php'); |
||||
include('question.class.php'); |
||||
include('answer.class.php'); |
||||
include('../inc/global.inc.php'); |
||||
|
||||
|
||||
$courseCode = $_GET['coursecode']; |
||||
$questionId = $_GET['questionId']; |
||||
$coordinates = $_GET['coord']; |
||||
$objExcercise = $_SESSION['objExercise']; |
||||
$hotspotId = $_GET['hotspotId']; |
||||
$exerciseId = $objExcercise->selectId(); |
||||
if ($_GET['answerId'] == "0") // click is NOT on a hotspot |
||||
{ |
||||
$hit = 0; |
||||
$answerId = $hotspotId; |
||||
|
||||
// remove from session |
||||
unset($_SESSION['exerciseResult'][$questionId][$answerId]); |
||||
|
||||
// Save clicking order |
||||
//$answerOrderId = count($_SESSION['exerciseResult'][$questionId]['order'])+1; |
||||
//$_SESSION['exerciseResult'][$questionId]['order'][$answerOrderId] = $answerId; |
||||
} |
||||
else // user clicked ON a hotspot |
||||
{ |
||||
$hit = 1; |
||||
$answerId = $hotspotId; |
||||
|
||||
// Save into session |
||||
$_SESSION['exerciseResult'][$questionId][$answerId] = $hit; |
||||
|
||||
// Save clicking order |
||||
//$answerOrderId = count($_SESSION['exerciseResult'][$questionId]['order'])+1; |
||||
//$_SESSION['exerciseResult'][$questionId]['order'][$answerOrderId] = $answerId; |
||||
} |
||||
|
||||
$TBL_TRACK_E_HOTSPOT = Database::get_statistic_table(STATISTIC_TRACK_E_HOTSPOTS); |
||||
|
||||
// update db |
||||
$update_id = $_SESSION['exerciseResult'][$questionId]['ids'][$answerId]; |
||||
$sql = "UPDATE $TBL_TRACK_E_HOTSPOT SET `coordinate` = '".$coordinates."' WHERE `id` =$update_id LIMIT 1 ;;"; |
||||
$result = api_sql_query($sql,__FILE__,__LINE__); |
||||
?> |
||||
@ -1,50 +1,46 @@ |
||||
<?php |
||||
/* |
||||
============================================================================== |
||||
Dokeos - elearning and course management software |
||||
|
||||
Copyright (c) 2004 Dokeos S.A. |
||||
Copyright (c) 2003 Ghent University (UGent) |
||||
Copyright (c) 2001 Universite catholique de Louvain (UCL) |
||||
Copyright (c) Istvan Mandak |
||||
|
||||
For a full list of contributors, see "credits.txt". |
||||
The full license can be read in "license.txt". |
||||
|
||||
This program is free software; you can redistribute it and/or |
||||
modify it under the terms of the GNU General Public License |
||||
as published by the Free Software Foundation; either version 2 |
||||
of the License, or (at your option) any later version. |
||||
|
||||
See the GNU General Public License for more details. |
||||
|
||||
Contact: Dokeos, 181 rue Royale, B-1000 Brussels, Belgium, info@dokeos.com |
||||
============================================================================== |
||||
DOKEOS - elearning and course management software |
||||
|
||||
For a full list of contributors, see documentation/credits.html |
||||
|
||||
This program is free software; you can redistribute it and/or |
||||
modify it under the terms of the GNU General Public License |
||||
as published by the Free Software Foundation; either version 2 |
||||
of the License, or (at your option) any later version. |
||||
See "documentation/licence.html" more details. |
||||
|
||||
Contact: |
||||
Dokeos |
||||
Rue des Palais 44 Paleizenstraat |
||||
B-1030 Brussels - Belgium |
||||
Tel. +32 (2) 211 34 56 |
||||
*/ |
||||
|
||||
|
||||
/** |
||||
============================================================================== |
||||
* Code library for HotPotatoes integration. |
||||
* |
||||
* @author Istvan Mandak |
||||
* @package dokeos.exercise |
||||
============================================================================== |
||||
* @author Istvan Mandak |
||||
* @version $Id: testheaderpage.php 10789 2007-01-18 19:18:27Z pcool $ |
||||
*/ |
||||
// name of the language file that needs to be included |
||||
|
||||
// name of the language file that needs to be included |
||||
$language_file='exercice'; |
||||
include('../inc/global.inc.php'); |
||||
|
||||
require_once($_configuration['root_sys'].'main/exercice/hotpotatoes.lib.php'); |
||||
|
||||
|
||||
include('../inc/global.inc.php'); |
||||
|
||||
require_once($_configuration['root_sys'].'main/exercice/hotpotatoes.lib.php'); |
||||
$documentPath= api_get_path(SYS_COURSE_PATH).$_course['path']."/document"; |
||||
$title = GetQuizName($_GET['file'],$documentPath); |
||||
$title = GetQuizName($_GET['file'],$documentPath); |
||||
if ($title =='') |
||||
{ |
||||
$title = GetFileName($_GET['file']); |
||||
} |
||||
{ |
||||
$title = GetFileName($_GET['file']); |
||||
} |
||||
$nameTools = $title; |
||||
$noPHP_SELF=true; |
||||
$interbreadcrumb[]= array ("url"=>"./exercice.php", "name"=> get_lang('Exercices')); |
||||
Display::display_header($nameTools,"Exercise"); |
||||
echo "<a name='TOP'></a>"; |
||||
|
||||
|
||||
?> |
||||
Loading…
Reference in new issue