Fixing hot spot UI see CT#493

skala
Julio Montoya 15 years ago
parent 990b02b9ba
commit 38d9a9e288
  1. 38
      main/exercice/exercice_submit.php
  2. 58
      main/exercice/exercise.lib.php
  3. 5
      main/exercice/exercise_show.php

@ -1097,6 +1097,9 @@ if ($limit_time_exists) {
}
}
if ($origin != 'learnpath') {
echo '<div id="highlight-plugin" class="glossary-content">';
}
if (!empty ($error)) {
Display :: display_error_message($error, false);
} else {
@ -1143,7 +1146,7 @@ if (!empty ($error)) {
{
$s2 = "&exerciseId=" . $exerciseId;
}
$s .= " <form method='post' action='" . api_get_self() . "?".api_get_cidreq()."&autocomplete=off&gradebook=$gradebook" . $s2 . "' id='my_frm_exercise' name='frm_exercise' $onsubmit>
<input type='hidden' name='formSent' value='1' />
<input type='hidden' name='exerciseType' value='" . $exerciseType . "' />
@ -1157,7 +1160,7 @@ if (!empty ($error)) {
<tr>
<td>
<table width='100%' cellpadding='3' cellspacing='0' border='0'>";
echo '<div id="highlight-plugin" class="glossary-content">';
echo $s;
$i = 1;
foreach ($questionList as $questionId) {
@ -1194,8 +1197,7 @@ if (!empty ($error)) {
}
}
// end foreach()
echo "<!-- <button type='submit' name='buttonCancel' class='cancel'>" . get_lang('Cancel') . "</button>
&nbsp;&nbsp; //--><br />";
//echo "<!-- <button type='submit' name='buttonCancel' class='cancel'>" . get_lang('Cancel') . "</button>&nbsp;&nbsp; //--><br />";
echo '<div style="margin-top:-10px;">';
$submit_btn = "<button class='next' type='submit' name='submit' name='submit_save' id='submit_save'>";
// $submit_btn.=get_lang('ValidateAnswer');
@ -1210,35 +1212,31 @@ if (!empty ($error)) {
$('.rounded_inner').corners();
});</script>";
//echo '<br /><span class="rounded" style="width: 300px; margin-top: 10px; padding: 3px; background-color:#ccc;"><span style="width: 300px" class="rounded_inner" ><a href="exercise_submit_modal.php?hotspot='.$hotspot_get.'&nbrQuestions='.$nbrQuestions.'&questionnum='.$questionNum.'&exerciseType='.$exerciseType.'&exerciseId='.$exerciseId.'&placeValuesBeforeTB_=savedValues&TB_iframe=true&height=480&width=640&modal=true" title="" class="thickbox" id="validationButton">'.get_lang('ValidateAnswer').'</a></span></span><br /><br /><br />';
} else {
if (api_is_allowed_to_session_edit() ) {
if ($exerciseType == ALL_ON_ONE_PAGE || $nbrQuestions == $questionNum) {
$submit_btn .= get_lang('ValidateAnswer');
$name_btn = get_lang('ValidateAnswer');
$name_btn = get_lang('ValidateAnswer');
} else {
$submit_btn .= get_lang('NextQuestion');
$name_btn = get_lang('NextQuestion');
$name_btn = get_lang('NextQuestion');
}
$submit_btn .= "</button>";
if ($exercise_row['expired_time'] != 0) {
echo $submit_btn ="<input class='submit_next' type='submit' id='submit_save' value='".$name_btn."' name='submit_save'/>";
} else {
echo $submit_btn;
}
if ($exercise_row['expired_time'] != 0) {
echo $submit_btn ="<input class='submit_next' type='submit' id='submit_save' value='".$name_btn."' name='submit_save'/>";
} else {
echo $submit_btn;
}
}
}
echo "</table>
echo '</div>'; //margin top -10
echo '</table>
</td>
</tr>
</table></form>";
</table></form>';
$b = 2;
}
echo '</div>';
if ($_configuration['live_exercise_tracking'] == true && $exerciseFeedbackType != EXERCISE_FEEDBACK_TYPE_DIRECT) {
@ -1267,7 +1265,7 @@ if ($_configuration['live_exercise_tracking'] == true && $exerciseFeedbackType !
if ($origin != 'learnpath') {
//so we are not in learnpath tool
echo '</div>'; //End glossary div
echo '</div>'; //End glossary div
Display :: display_footer();
} else {
echo '</body></html>';

@ -48,11 +48,9 @@ function showQuestion($questionId, $onlyAnswers=false, $origin=false,$current_it
//echo '<script src="'.api_get_path(WEB_LIBRARY_PATH).'javascript/jquery.js" type="text/javascript"></script>';
//echo '<script src="'.api_get_path(WEB_LIBRARY_PATH).'javascript/jquery.corners.min.js" type="text/javascript"></script>';
}
// reads question informations
if(!$objQuestionTmp = Question::read($questionId))
{
if(!$objQuestionTmp = Question::read($questionId)) {
// question not found
return false;
}
@ -60,8 +58,8 @@ function showQuestion($questionId, $onlyAnswers=false, $origin=false,$current_it
$answerType=$objQuestionTmp->selectType();
$pictureName=$objQuestionTmp->selectPicture();
if ($answerType != HOT_SPOT) // Question is not of type hotspot
{
if ($answerType != HOT_SPOT) {
// Question is not of type hotspot
if(!$onlyAnswers) {
$questionName=$objQuestionTmp->selectTitle();
$questionDescription=$objQuestionTmp->selectDescription();
@ -346,9 +344,9 @@ function showQuestion($questionId, $onlyAnswers=false, $origin=false,$current_it
{
return($s);
}
}
elseif ($answerType == HOT_SPOT) // Question is of type HOT_SPOT
{
} elseif ($answerType == HOT_SPOT) {
// Question is of type HOT_SPOT
$questionName=$objQuestionTmp->selectTitle();
$questionDescription=$objQuestionTmp->selectDescription();
@ -358,8 +356,7 @@ function showQuestion($questionId, $onlyAnswers=false, $origin=false,$current_it
// get answers of hotpost
$answers_hotspot = array();
for($answerId=1;$answerId <= $nbrAnswers;$answerId++)
{
for($answerId=1;$answerId <= $nbrAnswers;$answerId++) {
$answers = $objAnswerTmp->selectAnswerByAutoId($objAnswerTmp->selectAutoId($answerId));
$answers_hotspot[$answers['id']] = $objAnswerTmp->selectAnswer($answerId);
}
@ -369,34 +366,22 @@ function showQuestion($questionId, $onlyAnswers=false, $origin=false,$current_it
if (!empty($answers_hotspot)) {
ksort($answers_hotspot);
foreach ($answers_hotspot as $key => $value) {
$answer_list .= '<dt>'.$key.'.- '.$value.'</dt><br>';
$answer_list .= '<dt>'.$key.'.- '.$value.'</dt><br />';
}
}
$answer_list .= '</dl></div>';
if(!$onlyAnswers)
{
$s="<div id=\"question_title\" class=\"sectiontitle\">
".get_lang('Question').' ';
$s.="<input type='hidden' name='hidden_hotspot_id' value='$questionId'>";
$s.=$current_item;
if(!$onlyAnswers) {
echo '<div id="question_title" class="sectiontitle">'.get_lang('Question').' '.$current_item.' : '.$questionName.'</div>';
//@todo I need to the get the feedback type
//if($answerType == 2)
// $s.=' / '.$total_item;
echo $s;
echo ': ';
$s =$questionName.'</div>';
$s.="<table class='exercise_questions'>
<tr>
<td valign='top' colspan='2'>
";
$questionDescription=api_parse_tex($questionDescription);
$s.=$questionDescription;
$s.="
</td>
</tr>";
// $s.=' / '.$total_item;
echo '<input type="hidden" name="hidden_hotspot_id" value="'.$questionId.'">';
echo '<table class="exercise_questions">
<tr>
<td valign="top" colspan="2">';
echo $questionDescription=api_parse_tex($questionDescription);
echo '</td></tr>';
}
$canClick = isset($_GET['editQuestion']) ? '0' : (isset($_GET['modifyAnswers']) ? '0' : '1');
@ -535,11 +520,12 @@ function showQuestion($questionId, $onlyAnswers=false, $origin=false,$current_it
document.write(alternateContent); // insert non-flash content
}
// -->
</script></td>
<td valign='top' align='left'>$answer_list</td></tr></table>
</script>
</td>
<td valign='top' align='left'>$answer_list</td></tr>
</table>
</td></tr>";
echo $s;
}
echo "</table>";

@ -140,12 +140,13 @@ if($origin=='user_course') {
$from_myspace = false;
if (isset ($_GET['from']) && $_GET['from'] == 'myspace') {
$fromlink = '&from=myspace';
$this_section = "session_my_space";
$this_section = SECTION_TRACKING;
} else {
$this_section = SECTION_COURSES;
}
} else if($origin=='student_progress') {
} elseif($origin=='student_progress') {
$this_section = SECTION_TRACKING;
$interbreadcrumb[] = array ("url" => "../auth/my_progress.php?id_session".Security::remove_XSS($_GET['id_session'])."&course=".$_cid, "name" => get_lang('MyProgress'));
unset($_cid);
} else {

Loading…
Cancel
Save