[svn r19894] show correct or incorrect in hostspot result see FS#4031

skala
Carlos Vargas 17 years ago
parent 9855d73660
commit db7e387a67
  1. 11
      main/exercice/exercice_submit.php
  2. 17
      main/exercice/exercise_result.php
  3. 10
      main/exercice/exercise_show.php
  4. 34
      main/exercice/question_list_admin.inc.php

@ -1,4 +1,4 @@
<?php // $Id: exercice_submit.php 19837 2009-04-17 17:25:50Z cfasanando $
<?php // $Id: exercice_submit.php 19894 2009-04-20 16:38:00Z cvargas1 $
/*
==============================================================================
@ -42,7 +42,7 @@
* @package dokeos.exercise
* @author Olivier Brouckaert
* @author Julio Montoya multiple fill in blank option added
* @version $Id: exercice_submit.php 19837 2009-04-17 17:25:50Z cfasanando $
* @version $Id: exercice_submit.php 19894 2009-04-20 16:38:00Z cvargas1 $
*/
@ -487,6 +487,13 @@ if ($formSent) {
$questionScore+=$answerWeighting;
$totalScore+=$answerWeighting;
}
$tbl_track_e_hotspot = Database::get_statistic_table(TABLE_STATISTIC_TRACK_E_HOTSPOT);
// Save into db
$sql = "INSERT INTO $tbl_track_e_hotspot (`hotspot_user_id` , `hotspot_course_code` , `hotspot_exe_id` , `hotspot_question_id` , `hotspot_answer_id` , `hotspot_correct` , `hotspot_coordinate` )
VALUES ('".Database::escape_string($_user['user_id'])."', '".Database::escape_string($_course['id'])."', '".Database::escape_string($exeId)."', '".Database::escape_string($questionId)."', '".Database::escape_string($answerId)."', '".Database::escape_string($studentChoice)."', '".Database::escape_string($_SESSION['exerciseResultCoordinates'][$questionId][$answerId])."')";
$result = api_sql_query($sql,__FILE__,__LINE__);
break;
// for hotspot with fixed order
case HOT_SPOT_ORDER : $studentChoice=$choice['order'][$answerId];

@ -29,7 +29,7 @@
* @author Olivier Brouckaert, main author
* @author Roan Embrechts, some refactoring
* @author Julio Montoya Armas switchable fill in blank option added
* @version $Id: exercise_result.php 19788 2009-04-15 15:08:52Z juliomontoya $
* @version $Id: exercise_result.php 19894 2009-04-20 16:38:00Z cvargas1 $
*
* @todo split more code up in functions, move functions to library?
*/
@ -911,15 +911,7 @@ $exerciseTitle=api_parse_tex($exerciseTitle);
display_free_answer($choice);
}
elseif($answerType == HOT_SPOT)
{
$tbl_track_e_hotspot = Database::get_statistic_table(TABLE_STATISTIC_TRACK_E_HOTSPOT);
// Save into db
$sql = "INSERT INTO $tbl_track_e_hotspot (`hotspot_user_id` , `hotspot_course_code` , `hotspot_exe_id` , `hotspot_question_id` , `hotspot_answer_id` , `hotspot_correct` , `hotspot_coordinate` )
VALUES ('".Database::escape_string($_user['user_id'])."', '".Database::escape_string($_course['id'])."', '".Database::escape_string($exeId)."', '".Database::escape_string($questionId)."', '".Database::escape_string($answerId)."', '".Database::escape_string($studentChoice)."', '".Database::escape_string($_SESSION['exerciseResultCoordinates'][$questionId][$answerId])."')";
$result = api_sql_query($sql,__FILE__,__LINE__);
{
display_hotspot_answer($answerId, $answer, $studentChoice, $answerComment);
}
elseif($answerType == HOT_SPOT_ORDER)
@ -1054,10 +1046,13 @@ $exerciseTitle=api_parse_tex($exerciseTitle);
<br />
<?php
if ($origin != 'learnpath') {
echo "Holaaaaaaaaaaaaaaaaaaaaaaa";
?>
<button type="submit" class="save"><?php echo get_lang('Finish');?></button>
<?php
} else {
} else {
?>
<button type="button" class="save" onclick="top.location.href='../newscorm/lp_controller.php?cidReq=<?php echo api_get_course_id()?>&amp;action=view&amp;lp_id=<?php echo $learnpath_id ?>&amp;lp_item_id=<?php echo $learnpath_item_id ?>&amp;exeId=<?php echo $exeId ?>';" value="<?php echo get_lang('Finish'); ?>"><?php echo get_lang('Finish');?></button>
<?php }?>

@ -4,7 +4,7 @@
*
* @package dokeos.exercise
* @author Julio Montoya Armas Added switchable fill in blank option added
* @version $Id: exercise_show.php 19813 2009-04-17 00:19:28Z cvargas1 $
* @version $Id: exercise_show.php 19894 2009-04-20 16:38:00Z cvargas1 $
*
* @todo remove the debug code and use the general debug library
* @todo use the Database:: functions
@ -307,6 +307,9 @@ function display_hotspot_answer($answerId, $answer, $studentChoice, $answerComme
<td valign="top" align="left">
<?php $studentChoice = ($studentChoice)?get_lang('Correct'):get_lang('Fault'); echo $studentChoice; ?>
</td>
<td valign="top">
<?php echo stripslashes($answerComment); ?>
</td>
</tr>
<?php
}
@ -844,14 +847,13 @@ function display_hotspot_answer($answerId, $answer, $studentChoice, $answerComme
$answer=$objAnswerTmp->selectAnswer($answerId);
$answerComment=$objAnswerTmp->selectComment($answerId);
$answerCorrect=$objAnswerTmp->isCorrect($answerId);
$answerWeighting=$objAnswerTmp->selectWeighting($answerId);
$answerWeighting=$objAnswerTmp->selectWeighting($answerId);
$TBL_TRACK_HOTSPOT = Database::get_statistic_table(TABLE_STATISTIC_TRACK_E_HOTSPOT);
$query = "select hotspot_correct from ".$TBL_TRACK_HOTSPOT." where hotspot_exe_id = '".Database::escape_string($id)."' and hotspot_question_id= '".Database::escape_string($questionId)."' AND hotspot_answer_id='".Database::escape_string($answerId)."'";
$resq=api_sql_query($query);
$choice = Database::result($resq,0,"hotspot_correct");
display_hotspot_answer($answerId,$answer,$choice,$answerComment);
display_hotspot_answer($answerId,$answer,$choice,$answerComment);
$i++;
}
$queryfree = "select marks from ".$TBL_TRACK_ATTEMPT." where exe_id = '".Database::escape_string($id)."' and question_id= '".Database::escape_string($questionId)."'";

@ -1,4 +1,4 @@
<?php // $Id: question_list_admin.inc.php 19404 2009-03-28 01:24:38Z cvargas1 $
<?php // $Id: question_list_admin.inc.php 19894 2009-04-20 16:38:00Z cvargas1 $
/*
==============================================================================
@ -28,7 +28,7 @@
* Code library for HotPotatoes integration.
* @package dokeos.exercise
* @author
* @version $Id: question_list_admin.inc.php 19404 2009-03-28 01:24:38Z cvargas1 $
* @version $Id: question_list_admin.inc.php 19894 2009-04-20 16:38:00Z cvargas1 $
*/
@ -113,25 +113,21 @@ if($nbrQuestions) {
<td align="center"><?php echo $objQuestionTmp->selectLevel(); ?></td>
<!--<td align="center"><a href="<?php echo api_get_self(); ?>?action=exportqti2&questionId=<?php echo $id; ?>"><img src="../img/export.png" border="0" align="absmiddle" alt="IMS/QTI" /></a></td>-->
<td> <a href="<?php echo api_get_self(); ?>?myid=1&ed
itQuestion=<?php echo $id; ?>"><img src="../img/edit.gif" border="0" align="absmiddle" alt="<?php echo get_lang('Modify'); ?>" /></a> <a href="<?php echo api_get_self(); ?>?deleteQuestion=<?php echo $id; ?>" onclick="javascript:if(!confirm('<?php echo addslashes(htmlentities(get_lang('ConfirmYourChoice'))); ?>')) return false;"><img src="../img/delete.gif" border="0" align="absmiddle" alt="<?php echo get_lang('Delete'); ?>" /></a>
<?php
if($i != 1) {
?>
<a href="<?php echo api_get_self(); ?>?moveUp=<?php echo $id; ?>"><img src="../img/up.gif" border="0" align="absmiddle" alt="<?php echo get_lang('MoveUp'); ?>"></a>
<?php
if($i == $nbrQuestions)
echo '<img src="../img/down_na.gif" align="absmiddle">';
itQuestion=<?php echo $id; ?>"><img src="../img/edit.gif" border="0" alt="<?php echo get_lang('Modify'); ?>" /></a> <a href="<?php echo api_get_self(); ?>?deleteQuestion=<?php echo $id; ?>" onclick="javascript:if(!confirm('<?php echo addslashes(htmlentities(get_lang('ConfirmYourChoice'))); ?>')) return false;"><img src="../img/delete.gif" border="0" align="absmiddle" alt="<?php echo get_lang('Delete'); ?>" /></a>
<?php
if($i != 1) { ?>
<a href="<?php echo api_get_self(); ?>?moveUp=<?php echo $id; ?>"><img src="../img/up.gif" border="0" alt="<?php echo get_lang('MoveUp'); ?>"></a>
<?php if($i == $nbrQuestions) {
echo '<img src="../img/down_na.gif">';
}
}
if($i != $nbrQuestions) {
if($i == 1)
echo '<img src="../img/up_na.gif" align="absmiddle">';
?>
<a href="<?php echo api_get_self(); ?>?moveDown=<?php echo $id; ?>"><img src="../img/down.gif" border="0" align="absmiddle" alt="<?php echo get_lang('MoveDown'); ?>"></a>
<?php
}
?>
if($i == 1){
echo '<img src="../img/up_na.gif">';
}
?>
<a href="<?php echo api_get_self(); ?>?moveDown=<?php echo $id; ?>"><img src="../img/down.gif" border="0" alt="<?php echo get_lang('MoveDown'); ?>"></a>
<?php } ?>
</td>
<?php
$i++;

Loading…
Cancel
Save