|
|
|
@ -162,7 +162,7 @@ if ($submitAnswers || $buttonBack) { |
|
|
|
$select_question = $_POST['select_question']; |
|
|
|
$select_question = $_POST['select_question']; |
|
|
|
$try = isset($_POST['try']) ? $_POST['try'] : []; |
|
|
|
$try = isset($_POST['try']) ? $_POST['try'] : []; |
|
|
|
$url = $_POST['url']; |
|
|
|
$url = $_POST['url']; |
|
|
|
$destination = array(); |
|
|
|
$destination = []; |
|
|
|
|
|
|
|
|
|
|
|
$threadhold1 = $_POST['threadhold1']; |
|
|
|
$threadhold1 = $_POST['threadhold1']; |
|
|
|
$threadhold2 = $_POST['threadhold2']; |
|
|
|
$threadhold2 = $_POST['threadhold2']; |
|
|
|
@ -374,13 +374,13 @@ if ($modifyAnswers) { |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
$reponse = array(); |
|
|
|
$reponse = []; |
|
|
|
$comment = array(); |
|
|
|
$comment = []; |
|
|
|
$weighting = array(); |
|
|
|
$weighting = []; |
|
|
|
$hotspot_coordinates = array(); |
|
|
|
$hotspot_coordinates = []; |
|
|
|
$hotspot_type = array(); |
|
|
|
$hotspot_type = []; |
|
|
|
$destination_items = array(); |
|
|
|
$destination_items = []; |
|
|
|
$destination = array(); |
|
|
|
$destination = []; |
|
|
|
|
|
|
|
|
|
|
|
for ($i = 1; $i <= $nbrAnswers; $i++) { |
|
|
|
for ($i = 1; $i <= $nbrAnswers; $i++) { |
|
|
|
$reponse[$i] = $objAnswer->selectAnswer($i); |
|
|
|
$reponse[$i] = $objAnswer->selectAnswer($i); |
|
|
|
@ -433,7 +433,7 @@ if ($modifyAnswers) { |
|
|
|
$url_noerror = $destination_items[4]; |
|
|
|
$url_noerror = $destination_items[4]; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
$_SESSION['tmp_answers'] = array(); |
|
|
|
$_SESSION['tmp_answers'] = []; |
|
|
|
$_SESSION['tmp_answers']['answer'] = $reponse; |
|
|
|
$_SESSION['tmp_answers']['answer'] = $reponse; |
|
|
|
|
|
|
|
|
|
|
|
if ($objExercise->selectFeedbackType() != EXERCISE_FEEDBACK_TYPE_EXAM) { |
|
|
|
if ($objExercise->selectFeedbackType() != EXERCISE_FEEDBACK_TYPE_EXAM) { |
|
|
|
@ -533,7 +533,7 @@ if ($modifyAnswers) { |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
if ($answerType == HOT_SPOT_DELINEATION) { |
|
|
|
if ($answerType == HOT_SPOT_DELINEATION) { |
|
|
|
$hotspot_colors = array( |
|
|
|
$hotspot_colors = [ |
|
|
|
"", |
|
|
|
"", |
|
|
|
"#4271B5", |
|
|
|
"#4271B5", |
|
|
|
"#FE8E16", |
|
|
|
"#FE8E16", |
|
|
|
@ -547,9 +547,9 @@ if ($modifyAnswers) { |
|
|
|
"#F4EB24", |
|
|
|
"#F4EB24", |
|
|
|
"#ED2024", |
|
|
|
"#ED2024", |
|
|
|
"#3B3B3B" |
|
|
|
"#3B3B3B" |
|
|
|
); |
|
|
|
]; |
|
|
|
} else { |
|
|
|
} else { |
|
|
|
$hotspot_colors = array( |
|
|
|
$hotspot_colors = [ |
|
|
|
"", // $i starts from 1 on next loop (ugly fix) |
|
|
|
"", // $i starts from 1 on next loop (ugly fix) |
|
|
|
"#4271B5", |
|
|
|
"#4271B5", |
|
|
|
"#FE8E16", |
|
|
|
"#FE8E16", |
|
|
|
@ -564,7 +564,7 @@ if ($modifyAnswers) { |
|
|
|
"#ED2024", |
|
|
|
"#ED2024", |
|
|
|
"#3B3B3B", |
|
|
|
"#3B3B3B", |
|
|
|
"#F7BDE2" |
|
|
|
"#F7BDE2" |
|
|
|
); |
|
|
|
]; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
Display::tag( |
|
|
|
Display::tag( |
|
|
|
@ -576,28 +576,30 @@ if ($modifyAnswers) { |
|
|
|
echo Display::return_message($msgErr, 'normal'); //main API |
|
|
|
echo Display::return_message($msgErr, 'normal'); //main API |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
$hotspot_admin_url = api_get_path(WEB_CODE_PATH).'exercise/admin.php?'.api_get_cidreq().'&hotspotadmin=' |
|
|
|
$hotspot_admin_url = api_get_path(WEB_CODE_PATH).'exercise/admin.php?'.api_get_cidreq().'&hotspotadmin='.$modifyAnswers.'&exerciseId='.$exerciseId; ?> |
|
|
|
.$modifyAnswers.'&exerciseId='.$exerciseId.'&'.api_get_cidreq(); |
|
|
|
|
|
|
|
?> |
|
|
|
|
|
|
|
<form method="post" action="<?php echo $hotspot_admin_url; ?>" class="form-horizontal" id="frm_exercise"
|
|
|
|
<form method="post" action="<?php echo $hotspot_admin_url; ?>" class="form-horizontal" id="frm_exercise"
|
|
|
|
name="frm_exercise"> |
|
|
|
name="frm_exercise"> |
|
|
|
<div class="form-group"> |
|
|
|
<div class="form-group"> |
|
|
|
<div class="col-sm-12"> |
|
|
|
<div class="col-sm-12"> |
|
|
|
<?php if ($answerType == HOT_SPOT_DELINEATION) { ?> |
|
|
|
<?php if ($answerType == HOT_SPOT_DELINEATION) { |
|
|
|
|
|
|
|
?> |
|
|
|
<button type="submit" class="btn btn-danger" name="lessAnswers" value="lessAnswers"> |
|
|
|
<button type="submit" class="btn btn-danger" name="lessAnswers" value="lessAnswers"> |
|
|
|
<em class="fa fa-trash"></em> <?php echo get_lang('LessOAR'); ?> |
|
|
|
<em class="fa fa-trash"></em> <?php echo get_lang('LessOAR'); ?> |
|
|
|
</button> |
|
|
|
</button> |
|
|
|
<button type="submit" class="btn btn-primary" name="moreOARAnswers" value="moreOARAnswers"> |
|
|
|
<button type="submit" class="btn btn-primary" name="moreOARAnswers" value="moreOARAnswers"> |
|
|
|
<em class="fa fa-plus"></em> <?php echo get_lang('MoreOAR'); ?> |
|
|
|
<em class="fa fa-plus"></em> <?php echo get_lang('MoreOAR'); ?> |
|
|
|
</button> |
|
|
|
</button> |
|
|
|
<?php } else { ?> |
|
|
|
<?php |
|
|
|
|
|
|
|
} else { |
|
|
|
|
|
|
|
?> |
|
|
|
<button type="submit" class="btn btn-danger" name="lessAnswers" value="lessAnswers"> |
|
|
|
<button type="submit" class="btn btn-danger" name="lessAnswers" value="lessAnswers"> |
|
|
|
<em class="fa fa-trash"></em> <?php echo get_lang('LessHotspots'); ?> |
|
|
|
<em class="fa fa-trash"></em> <?php echo get_lang('LessHotspots'); ?> |
|
|
|
</button> |
|
|
|
</button> |
|
|
|
<button type="submit" class="btn btn-primary" name="moreAnswers" value="moreAnswers"> |
|
|
|
<button type="submit" class="btn btn-primary" name="moreAnswers" value="moreAnswers"> |
|
|
|
<em class="fa fa-plus"></em> <?php echo get_lang('MoreHotspots'); ?> |
|
|
|
<em class="fa fa-plus"></em> <?php echo get_lang('MoreHotspots'); ?> |
|
|
|
</button> |
|
|
|
</button> |
|
|
|
<?php } ?> |
|
|
|
<?php |
|
|
|
|
|
|
|
} ?> |
|
|
|
<button type="submit" class="btn btn-primary" name="submitAnswers" value="submitAnswers"> |
|
|
|
<button type="submit" class="btn btn-primary" name="submitAnswers" value="submitAnswers"> |
|
|
|
<em class="fa fa-save"></em> <?php echo get_lang('AddQuestionToExercise'); ?> |
|
|
|
<em class="fa fa-save"></em> <?php echo get_lang('AddQuestionToExercise'); ?> |
|
|
|
</button> |
|
|
|
</button> |
|
|
|
@ -619,82 +621,80 @@ if ($modifyAnswers) { |
|
|
|
} |
|
|
|
} |
|
|
|
} else { |
|
|
|
} else { |
|
|
|
echo '<th colspan="2">'.get_lang('Comment').'</th>'; |
|
|
|
echo '<th colspan="2">'.get_lang('Comment').'</th>'; |
|
|
|
} |
|
|
|
} ?> |
|
|
|
?> |
|
|
|
|
|
|
|
<th><?php echo get_lang('QuestionWeighting'); ?> *</th>
|
|
|
|
<th><?php echo get_lang('QuestionWeighting'); ?> *</th>
|
|
|
|
</tr> |
|
|
|
</tr> |
|
|
|
</thead> |
|
|
|
</thead> |
|
|
|
<tbody> |
|
|
|
<tbody> |
|
|
|
<?php |
|
|
|
<?php |
|
|
|
$list = new LearnpathList(api_get_user_id()); |
|
|
|
$list = new LearnpathList(api_get_user_id()); |
|
|
|
// Loading list of LPs |
|
|
|
// Loading list of LPs |
|
|
|
$flat_list = $list->get_flat_list(); |
|
|
|
$flat_list = $list->get_flat_list(); |
|
|
|
|
|
|
|
|
|
|
|
for ($i = 1; $i <= $nbrAnswers; $i++) { |
|
|
|
for ($i = 1; $i <= $nbrAnswers; $i++) { |
|
|
|
// is an delineation |
|
|
|
// is an delineation |
|
|
|
if ($answerType == HOT_SPOT_DELINEATION) { |
|
|
|
if ($answerType == HOT_SPOT_DELINEATION) { |
|
|
|
$option_lp = ''; |
|
|
|
$option_lp = ''; |
|
|
|
|
|
|
|
|
|
|
|
// setting the LP |
|
|
|
// setting the LP |
|
|
|
$isSelected = false; |
|
|
|
$isSelected = false; |
|
|
|
foreach ($flat_list as $id => $details) { |
|
|
|
foreach ($flat_list as $id => $details) { |
|
|
|
$selected = ''; |
|
|
|
$selected = ''; |
|
|
|
if (isset($lp[$i]) && $id == $lp[$i]) { |
|
|
|
if (isset($lp[$i]) && $id == $lp[$i]) { |
|
|
|
$isSelected = true; |
|
|
|
$isSelected = true; |
|
|
|
$selected = 'selected="selected"'; |
|
|
|
$selected = 'selected="selected"'; |
|
|
|
} |
|
|
|
} |
|
|
|
$option_lp .= '<option value="'.$id.'" '.$selected.'>'.$details['lp_name'].'</option>'; |
|
|
|
$option_lp .= '<option value="'.$id.'" '.$selected.'>'.$details['lp_name'].'</option>'; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
if ($isSelected) { |
|
|
|
if ($isSelected) { |
|
|
|
$option_lp = '<option value="0">'.get_lang('SelectTargetLP').'</option>'.$option_lp; |
|
|
|
$option_lp = '<option value="0">'.get_lang('SelectTargetLP').'</option>'.$option_lp; |
|
|
|
} else { |
|
|
|
} else { |
|
|
|
$option_lp = '<option value="0" selected="selected" >'.get_lang('SelectTargetLP') |
|
|
|
$option_lp = '<option value="0" selected="selected" >'.get_lang('SelectTargetLP') |
|
|
|
.'</option>'.$option_lp; |
|
|
|
.'</option>'.$option_lp; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
// Feedback SELECT |
|
|
|
// Feedback SELECT |
|
|
|
$question_list = $objExercise->selectQuestionList(); |
|
|
|
$question_list = $objExercise->selectQuestionList(); |
|
|
|
$option_feed = ''; |
|
|
|
$option_feed = ''; |
|
|
|
$option_feed .= '<option value="0">'.get_lang('SelectTargetQuestion').'</option>'; |
|
|
|
$option_feed .= '<option value="0">'.get_lang('SelectTargetQuestion').'</option>'; |
|
|
|
|
|
|
|
|
|
|
|
foreach ($question_list as $key => $questionid) { |
|
|
|
foreach ($question_list as $key => $questionid) { |
|
|
|
$selected = ''; |
|
|
|
$selected = ''; |
|
|
|
$question = Question::read($questionid); |
|
|
|
$question = Question::read($questionid); |
|
|
|
$val = 'Q'.$key.' :'.substrwords($question->selectTitle(), ICON_SIZE_SMALL); |
|
|
|
$val = 'Q'.$key.' :'.substrwords($question->selectTitle(), ICON_SIZE_SMALL); |
|
|
|
|
|
|
|
|
|
|
|
if (isset($select_question[$i]) && $questionid == $select_question[$i]) { |
|
|
|
if (isset($select_question[$i]) && $questionid == $select_question[$i]) { |
|
|
|
$selected = 'selected="selected"'; |
|
|
|
$selected = 'selected="selected"'; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
$option_feed .= '<option value="'.$questionid.'" '.$selected.' >'.$val.'</option>'; |
|
|
|
$option_feed .= '<option value="'.$questionid.'" '.$selected.' >'.$val.'</option>'; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
if (isset($select_question[$i]) && $select_question[$i] == -1) { |
|
|
|
if (isset($select_question[$i]) && $select_question[$i] == -1) { |
|
|
|
$option_feed .= '<option value="-1" selected="selected" >'.get_lang('ExitTest').'</option>'; |
|
|
|
$option_feed .= '<option value="-1" selected="selected" >'.get_lang('ExitTest').'</option>'; |
|
|
|
} else { |
|
|
|
} else { |
|
|
|
$option_feed .= '<option value="-1">'.get_lang('ExitTest').'</option>'; |
|
|
|
$option_feed .= '<option value="-1">'.get_lang('ExitTest').'</option>'; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
//-------- IF it is a delineation |
|
|
|
//-------- IF it is a delineation |
|
|
|
if ($_SESSION['tmp_answers']['hotspot_type'][$i] == 'delineation') { |
|
|
|
if ($_SESSION['tmp_answers']['hotspot_type'][$i] == 'delineation') { |
|
|
|
$option1 = $option2 = $option3 = ''; |
|
|
|
$option1 = $option2 = $option3 = ''; |
|
|
|
for ($k = 1; $k <= 100; $k++) { |
|
|
|
for ($k = 1; $k <= 100; $k++) { |
|
|
|
$selected1 = $selected2 = $selected3 = ''; |
|
|
|
$selected1 = $selected2 = $selected3 = ''; |
|
|
|
if ($k == $threadhold1[$i]) { |
|
|
|
if ($k == $threadhold1[$i]) { |
|
|
|
$selected1 = 'selected="selected"'; |
|
|
|
$selected1 = 'selected="selected"'; |
|
|
|
} |
|
|
|
} |
|
|
|
if ($k == $threadhold2[$i]) { |
|
|
|
if ($k == $threadhold2[$i]) { |
|
|
|
$selected2 = 'selected="selected"'; |
|
|
|
$selected2 = 'selected="selected"'; |
|
|
|
} |
|
|
|
} |
|
|
|
if ($k == $threadhold3[$i]) { |
|
|
|
if ($k == $threadhold3[$i]) { |
|
|
|
$selected3 = 'selected="selected"'; |
|
|
|
$selected3 = 'selected="selected"'; |
|
|
|
} |
|
|
|
} |
|
|
|
$option1 .= '<option '.$selected1.' >'.$k.' % </option>'; |
|
|
|
$option1 .= '<option '.$selected1.' >'.$k.' % </option>'; |
|
|
|
$option2 .= '<option '.$selected2.' >'.$k.' % </option>'; |
|
|
|
$option2 .= '<option '.$selected2.' >'.$k.' % </option>'; |
|
|
|
$option3 .= '<option '.$selected3.'>'.$k.' %</option>'; |
|
|
|
$option3 .= '<option '.$selected3.'>'.$k.' %</option>'; |
|
|
|
} |
|
|
|
} ?> |
|
|
|
?> |
|
|
|
|
|
|
|
<tr> |
|
|
|
<tr> |
|
|
|
<td> |
|
|
|
<td> |
|
|
|
<span class="fa fa-square fa-2x" aria-hidden="true" |
|
|
|
<span class="fa fa-square fa-2x" aria-hidden="true" |
|
|
|
@ -732,18 +732,18 @@ if ($modifyAnswers) { |
|
|
|
</p> |
|
|
|
</p> |
|
|
|
<input type="hidden" name="hotspot_type[<?php echo $i; ?>]" value="delineation"/>
|
|
|
|
<input type="hidden" name="hotspot_type[<?php echo $i; ?>]" value="delineation"/>
|
|
|
|
<input type="hidden" name="hotspot_coordinates[<?php echo $i; ?>]" value="<?php |
|
|
|
<input type="hidden" name="hotspot_coordinates[<?php echo $i; ?>]" value="<?php |
|
|
|
echo(empty($hotspot_coordinates[$i]) ? '0;0|0|0' : $hotspot_coordinates[$i]); |
|
|
|
echo(empty($hotspot_coordinates[$i]) ? '0;0|0|0' : $hotspot_coordinates[$i]); ?>"/> |
|
|
|
?>"/> |
|
|
|
|
|
|
|
</td> |
|
|
|
</td> |
|
|
|
<?php if ($objExercise->selectFeedbackType() == EXERCISE_FEEDBACK_TYPE_DIRECT) { ?> |
|
|
|
<?php if ($objExercise->selectFeedbackType() == EXERCISE_FEEDBACK_TYPE_DIRECT) { |
|
|
|
|
|
|
|
?> |
|
|
|
<td> |
|
|
|
<td> |
|
|
|
<div class="checkbox"> |
|
|
|
<div class="checkbox"> |
|
|
|
<p> |
|
|
|
<p> |
|
|
|
<label> |
|
|
|
<label> |
|
|
|
<input type="checkbox" class="checkbox" |
|
|
|
<input type="checkbox" class="checkbox" |
|
|
|
name="<?php echo 'try['.$i; ?>]" <?php if ($try[$i] == 1) { |
|
|
|
name="<?php echo 'try['.$i; ?>]" <?php if ($try[$i] == 1) { |
|
|
|
echo 'checked'; |
|
|
|
echo 'checked'; |
|
|
|
} ?> /> |
|
|
|
} ?> /> |
|
|
|
<?php echo get_lang('TryAgain'); ?> |
|
|
|
<?php echo get_lang('TryAgain'); ?> |
|
|
|
</label> |
|
|
|
</label> |
|
|
|
</p> |
|
|
|
</p> |
|
|
|
@ -766,12 +766,14 @@ if ($modifyAnswers) { |
|
|
|
</select> |
|
|
|
</select> |
|
|
|
</p> |
|
|
|
</p> |
|
|
|
</td> |
|
|
|
</td> |
|
|
|
<?php } else { ?> |
|
|
|
<?php |
|
|
|
|
|
|
|
} else { |
|
|
|
|
|
|
|
?> |
|
|
|
<td> </td> |
|
|
|
<td> </td> |
|
|
|
<?php |
|
|
|
<?php |
|
|
|
} |
|
|
|
} |
|
|
|
} elseif (false) { |
|
|
|
} elseif (false) { |
|
|
|
?> |
|
|
|
?> |
|
|
|
<tr> |
|
|
|
<tr> |
|
|
|
<th colspan="2"><?php echo get_lang('IfNoError'); ?></th>
|
|
|
|
<th colspan="2"><?php echo get_lang('IfNoError'); ?></th>
|
|
|
|
<th colspan="3"><?php echo get_lang('Feedback'); ?></th>
|
|
|
|
<th colspan="3"><?php echo get_lang('Feedback'); ?></th>
|
|
|
|
@ -791,7 +793,8 @@ if ($modifyAnswers) { |
|
|
|
name="comment[<?php echo $i; ?>]"
|
|
|
|
name="comment[<?php echo $i; ?>]"
|
|
|
|
style="width: 100%"><?php echo Security::remove_XSS($comment[$i]); ?></textarea>
|
|
|
|
style="width: 100%"><?php echo Security::remove_XSS($comment[$i]); ?></textarea>
|
|
|
|
</td> |
|
|
|
</td> |
|
|
|
<?php if ($objExercise->selectFeedbackType() == EXERCISE_FEEDBACK_TYPE_DIRECT) { ?> |
|
|
|
<?php if ($objExercise->selectFeedbackType() == EXERCISE_FEEDBACK_TYPE_DIRECT) { |
|
|
|
|
|
|
|
?> |
|
|
|
<td> |
|
|
|
<td> |
|
|
|
<table> |
|
|
|
<table> |
|
|
|
<tr> |
|
|
|
<tr> |
|
|
|
@ -802,8 +805,8 @@ if ($modifyAnswers) { |
|
|
|
<input type="checkbox" class="checkbox" |
|
|
|
<input type="checkbox" class="checkbox" |
|
|
|
name="<?php echo 'try[' |
|
|
|
name="<?php echo 'try[' |
|
|
|
.$i; ?>]" <?php if ($try[$i] == 1) { |
|
|
|
.$i; ?>]" <?php if ($try[$i] == 1) { |
|
|
|
echo 'checked'; |
|
|
|
echo 'checked'; |
|
|
|
} ?> /> |
|
|
|
} ?> /> |
|
|
|
<?php echo get_lang('TryAgain'); ?> |
|
|
|
<?php echo get_lang('TryAgain'); ?> |
|
|
|
</label> |
|
|
|
</label> |
|
|
|
</p> |
|
|
|
</p> |
|
|
|
@ -830,29 +833,37 @@ if ($modifyAnswers) { |
|
|
|
</tr> |
|
|
|
</tr> |
|
|
|
</table> |
|
|
|
</table> |
|
|
|
</td> |
|
|
|
</td> |
|
|
|
<?php } else { ?> |
|
|
|
<?php |
|
|
|
|
|
|
|
} else { |
|
|
|
|
|
|
|
?> |
|
|
|
<td> </td> |
|
|
|
<td> </td> |
|
|
|
<?php } ?> |
|
|
|
<?php |
|
|
|
|
|
|
|
} ?> |
|
|
|
</tr> |
|
|
|
</tr> |
|
|
|
<?php |
|
|
|
<?php |
|
|
|
} elseif ($_SESSION['tmp_answers']['hotspot_type'][$i] == 'oar') { |
|
|
|
} elseif ($_SESSION['tmp_answers']['hotspot_type'][$i] == 'oar') { |
|
|
|
// if it's an OAR |
|
|
|
// if it's an OAR |
|
|
|
if ($i == 2) { |
|
|
|
if ($i == 2) { |
|
|
|
?> |
|
|
|
?> |
|
|
|
<tr> |
|
|
|
<tr> |
|
|
|
<th width="5"> <?php /* echo get_lang('Hotspot'); */ ?></th>
|
|
|
|
<th width="5"> <?php /* echo get_lang('Hotspot'); */ ?></th>
|
|
|
|
<th><?php echo get_lang('OAR'); ?>*</th>
|
|
|
|
<th><?php echo get_lang('OAR'); ?>*</th>
|
|
|
|
<?php if ($objExercise->selectFeedbackType() == EXERCISE_FEEDBACK_TYPE_DIRECT) { ?> |
|
|
|
<?php if ($objExercise->selectFeedbackType() == EXERCISE_FEEDBACK_TYPE_DIRECT) { |
|
|
|
|
|
|
|
?> |
|
|
|
<th colspan="2"><?php echo get_lang('Comment'); ?></th>
|
|
|
|
<th colspan="2"><?php echo get_lang('Comment'); ?></th>
|
|
|
|
<th><?php if ($answerType == HOT_SPOT_DELINEATION) { |
|
|
|
<th><?php if ($answerType == HOT_SPOT_DELINEATION) { |
|
|
|
echo get_lang('Scenario'); |
|
|
|
echo get_lang('Scenario'); |
|
|
|
} ?></th> |
|
|
|
} ?></th> |
|
|
|
<?php } else { ?> |
|
|
|
<?php |
|
|
|
|
|
|
|
} else { |
|
|
|
|
|
|
|
?> |
|
|
|
<th colspan="3"><?php echo get_lang('Comment'); ?></th>
|
|
|
|
<th colspan="3"><?php echo get_lang('Comment'); ?></th>
|
|
|
|
<?php } ?> |
|
|
|
<?php |
|
|
|
|
|
|
|
} ?> |
|
|
|
<th> </th> |
|
|
|
<th> </th> |
|
|
|
</tr> |
|
|
|
</tr> |
|
|
|
<?php } ?> |
|
|
|
<?php |
|
|
|
|
|
|
|
} ?> |
|
|
|
<tr> |
|
|
|
<tr> |
|
|
|
<td> |
|
|
|
<td> |
|
|
|
<span class="fa fa-square fa-2x" aria-hidden="true" |
|
|
|
<span class="fa fa-square fa-2x" aria-hidden="true" |
|
|
|
@ -871,10 +882,10 @@ if ($modifyAnswers) { |
|
|
|
? Security::remove_XSS($comment[$i]) : ''; ?></textarea> |
|
|
|
? Security::remove_XSS($comment[$i]) : ''; ?></textarea> |
|
|
|
<input type="hidden" name="hotspot_type[<?php echo $i; ?>]" value="oar"/>
|
|
|
|
<input type="hidden" name="hotspot_type[<?php echo $i; ?>]" value="oar"/>
|
|
|
|
<input type="hidden" name="hotspot_coordinates[<?php echo $i; ?>]" value="<?php |
|
|
|
<input type="hidden" name="hotspot_coordinates[<?php echo $i; ?>]" value="<?php |
|
|
|
echo(empty($hotspot_coordinates[$i]) ? '0;0|0|0' : $hotspot_coordinates[$i]); |
|
|
|
echo(empty($hotspot_coordinates[$i]) ? '0;0|0|0' : $hotspot_coordinates[$i]); ?>"/> |
|
|
|
?>"/> |
|
|
|
|
|
|
|
</td> |
|
|
|
</td> |
|
|
|
<?php if ($objExercise->selectFeedbackType() == EXERCISE_FEEDBACK_TYPE_DIRECT) { ?> |
|
|
|
<?php if ($objExercise->selectFeedbackType() == EXERCISE_FEEDBACK_TYPE_DIRECT) { |
|
|
|
|
|
|
|
?> |
|
|
|
<td> |
|
|
|
<td> |
|
|
|
<div class="checkbox"> |
|
|
|
<div class="checkbox"> |
|
|
|
<p> |
|
|
|
<p> |
|
|
|
@ -883,8 +894,8 @@ if ($modifyAnswers) { |
|
|
|
name="<?php echo 'try['.$i; ?>]" <?php if (isset($try[$i]) |
|
|
|
name="<?php echo 'try['.$i; ?>]" <?php if (isset($try[$i]) |
|
|
|
&& $try[$i] == 1 |
|
|
|
&& $try[$i] == 1 |
|
|
|
) { |
|
|
|
) { |
|
|
|
echo 'checked'; |
|
|
|
echo 'checked'; |
|
|
|
} ?> /> |
|
|
|
} ?> /> |
|
|
|
<?php echo get_lang('TryAgain'); ?> |
|
|
|
<?php echo get_lang('TryAgain'); ?> |
|
|
|
</label> |
|
|
|
</label> |
|
|
|
</p> |
|
|
|
</p> |
|
|
|
@ -907,16 +918,17 @@ if ($modifyAnswers) { |
|
|
|
</select> |
|
|
|
</select> |
|
|
|
</p> |
|
|
|
</p> |
|
|
|
</td> |
|
|
|
</td> |
|
|
|
<?php } else { ?> |
|
|
|
<?php |
|
|
|
|
|
|
|
} else { |
|
|
|
|
|
|
|
?> |
|
|
|
<td> </td> |
|
|
|
<td> </td> |
|
|
|
<?php |
|
|
|
<?php |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
//end if is delineation |
|
|
|
//end if is delineation |
|
|
|
} else { |
|
|
|
} else { |
|
|
|
$commentValue = isset($comment[$i]) ? $comment[$i] : null; |
|
|
|
$commentValue = isset($comment[$i]) ? $comment[$i] : null; |
|
|
|
$responseValue = isset($reponse[$i]) ? $reponse[$i] : null; |
|
|
|
$responseValue = isset($reponse[$i]) ? $reponse[$i] : null; ?> |
|
|
|
?> |
|
|
|
|
|
|
|
<tr> |
|
|
|
<tr> |
|
|
|
<td> |
|
|
|
<td> |
|
|
|
<span class="fa fa-square fa-2x" style="color: <?php echo $hotspot_colors[$i]; ?>"
|
|
|
|
<span class="fa fa-square fa-2x" style="color: <?php echo $hotspot_colors[$i]; ?>"
|
|
|
|
@ -928,38 +940,40 @@ if ($modifyAnswers) { |
|
|
|
</td> |
|
|
|
</td> |
|
|
|
<?php |
|
|
|
<?php |
|
|
|
$form = new FormValidator('form_'.$i); |
|
|
|
$form = new FormValidator('form_'.$i); |
|
|
|
$config = array( |
|
|
|
$config = [ |
|
|
|
'ToolbarSet' => 'TestProposedAnswer', |
|
|
|
'ToolbarSet' => 'TestProposedAnswer', |
|
|
|
'cols-size' => [0, 12, 0] |
|
|
|
'cols-size' => [0, 12, 0] |
|
|
|
); |
|
|
|
]; |
|
|
|
$form->addHtmlEditor('comment['.$i.']', null, false, false, $config); |
|
|
|
$form->addHtmlEditor('comment['.$i.']', null, false, false, $config); |
|
|
|
$renderer = $form->defaultRenderer(); |
|
|
|
$renderer = $form->defaultRenderer(); |
|
|
|
$form_template = '{content}'; |
|
|
|
$form_template = '{content}'; |
|
|
|
$renderer->setFormTemplate($form_template); |
|
|
|
$renderer->setFormTemplate($form_template); |
|
|
|
$element_template = ' |
|
|
|
$element_template = ' |
|
|
|
{label} |
|
|
|
{label} |
|
|
|
{element}'; |
|
|
|
{element}'; |
|
|
|
$renderer->setElementTemplate($element_template); |
|
|
|
$renderer->setElementTemplate($element_template); |
|
|
|
|
|
|
|
|
|
|
|
$form->setDefaults(array('comment['.$i.']' => $commentValue)); |
|
|
|
$form->setDefaults(['comment['.$i.']' => $commentValue]); |
|
|
|
$return = $form->returnForm(); |
|
|
|
$return = $form->returnForm(); ?> |
|
|
|
?> |
|
|
|
|
|
|
|
<td colspan="2" align="left"><?php echo $return; ?></td>
|
|
|
|
<td colspan="2" align="left"><?php echo $return; ?></td>
|
|
|
|
<?php } ?> |
|
|
|
<?php |
|
|
|
|
|
|
|
} ?> |
|
|
|
<td> |
|
|
|
<td> |
|
|
|
<?php |
|
|
|
<?php |
|
|
|
if ($answerType == HOT_SPOT_DELINEATION) { |
|
|
|
if ($answerType == HOT_SPOT_DELINEATION) { |
|
|
|
if ($_SESSION['tmp_answers']['hotspot_type'][$i] == 'oar') { |
|
|
|
if ($_SESSION['tmp_answers']['hotspot_type'][$i] == 'oar') { |
|
|
|
?> |
|
|
|
?> |
|
|
|
<input type="hidden" name="weighting[<?php echo $i; ?>]" class="form-cotrol" value="0"/>
|
|
|
|
<input type="hidden" name="weighting[<?php echo $i; ?>]" class="form-cotrol" value="0"/>
|
|
|
|
<?php } else { ?> |
|
|
|
<?php |
|
|
|
|
|
|
|
} else { |
|
|
|
|
|
|
|
?> |
|
|
|
<input class="form-control" type="text" name="weighting[<?php echo $i; ?>]"
|
|
|
|
<input class="form-control" type="text" name="weighting[<?php echo $i; ?>]"
|
|
|
|
value="<?php echo(isset($weighting[$i]) ? $weighting[$i] : 10); ?>"/>
|
|
|
|
value="<?php echo(isset($weighting[$i]) ? $weighting[$i] : 10); ?>"/>
|
|
|
|
<?php |
|
|
|
<?php |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
if ($answerType == HOT_SPOT) { |
|
|
|
if ($answerType == HOT_SPOT) { |
|
|
|
?> |
|
|
|
?> |
|
|
|
<input class="form-control" type="text" name="weighting[<?php echo $i; ?>]"
|
|
|
|
<input class="form-control" type="text" name="weighting[<?php echo $i; ?>]"
|
|
|
|
value="<?php echo(isset($weighting[$i]) ? $weighting[$i] : 10); ?>"/>
|
|
|
|
value="<?php echo(isset($weighting[$i]) ? $weighting[$i] : 10); ?>"/>
|
|
|
|
<input type="hidden" name="hotspot_coordinates[<?php echo $i; ?>]"
|
|
|
|
<input type="hidden" name="hotspot_coordinates[<?php echo $i; ?>]"
|
|
|
|
@ -968,62 +982,67 @@ if ($modifyAnswers) { |
|
|
|
: $hotspot_coordinates[$i]); ?>"/> |
|
|
|
: $hotspot_coordinates[$i]); ?>"/> |
|
|
|
<input type="hidden" name="hotspot_type[<?php echo $i; ?>]"
|
|
|
|
<input type="hidden" name="hotspot_type[<?php echo $i; ?>]"
|
|
|
|
value="<?php echo(empty($hotspot_type[$i]) ? 'square' : $hotspot_type[$i]); ?>"/>
|
|
|
|
value="<?php echo(empty($hotspot_type[$i]) ? 'square' : $hotspot_type[$i]); ?>"/>
|
|
|
|
<?php } ?> |
|
|
|
<?php |
|
|
|
|
|
|
|
} ?> |
|
|
|
</td> |
|
|
|
</td> |
|
|
|
</tr> |
|
|
|
</tr> |
|
|
|
<?php |
|
|
|
<?php |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
$list = new LearnpathList(api_get_user_id()); |
|
|
|
$list = new LearnpathList(api_get_user_id()); |
|
|
|
$flat_list = $list->get_flat_list(); |
|
|
|
$flat_list = $list->get_flat_list(); |
|
|
|
$option_lp = ''; |
|
|
|
$option_lp = ''; |
|
|
|
$isSelected = false; |
|
|
|
$isSelected = false; |
|
|
|
foreach ($flat_list as $id => $details) { |
|
|
|
foreach ($flat_list as $id => $details) { |
|
|
|
$selected = ''; |
|
|
|
$selected = ''; |
|
|
|
if (isset($lp_noerror) && $id == $lp_noerror) { |
|
|
|
if (isset($lp_noerror) && $id == $lp_noerror) { |
|
|
|
$selected = 'selected="selected"'; |
|
|
|
$selected = 'selected="selected"'; |
|
|
|
$isSelected = true; |
|
|
|
$isSelected = true; |
|
|
|
} |
|
|
|
} |
|
|
|
$option_lp .= '<option value="'.$id.'" '.$selected.'>'.$details['lp_name'].'</option>'; |
|
|
|
$option_lp .= '<option value="'.$id.'" '.$selected.'>'.$details['lp_name'].'</option>'; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
if ($isSelected) { |
|
|
|
if ($isSelected) { |
|
|
|
$option_lp = '<option value="0">'.get_lang('SelectTargetLP').'</option>'.$option_lp; |
|
|
|
$option_lp = '<option value="0">'.get_lang('SelectTargetLP').'</option>'.$option_lp; |
|
|
|
} else { |
|
|
|
} else { |
|
|
|
$option_lp = '<option value="0" selected="selected" >'.get_lang('SelectTargetLP').'</option>' |
|
|
|
$option_lp = '<option value="0" selected="selected" >'.get_lang('SelectTargetLP').'</option>' |
|
|
|
.$option_lp; |
|
|
|
.$option_lp; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
// Feedback SELECT |
|
|
|
// Feedback SELECT |
|
|
|
$question_list = $objExercise->selectQuestionList(); |
|
|
|
$question_list = $objExercise->selectQuestionList(); |
|
|
|
$option_feed = ''; |
|
|
|
$option_feed = ''; |
|
|
|
$option_feed .= '<option value="0">'.get_lang('SelectTargetQuestion').'</option>'; |
|
|
|
$option_feed .= '<option value="0">'.get_lang('SelectTargetQuestion').'</option>'; |
|
|
|
$selectQuestionNoError = isset($selectQuestionNoError) ? $selectQuestionNoError : null; |
|
|
|
$selectQuestionNoError = isset($selectQuestionNoError) ? $selectQuestionNoError : null; |
|
|
|
foreach ($question_list as $key => $questionid) { |
|
|
|
foreach ($question_list as $key => $questionid) { |
|
|
|
$selected = ''; |
|
|
|
$selected = ''; |
|
|
|
$question = Question::read($questionid); |
|
|
|
$question = Question::read($questionid); |
|
|
|
$val = 'Q'.$key.' :'.substrwords($question->selectTitle(), ICON_SIZE_SMALL); |
|
|
|
$val = 'Q'.$key.' :'.substrwords($question->selectTitle(), ICON_SIZE_SMALL); |
|
|
|
if ($questionid == $selectQuestionNoError) { |
|
|
|
if ($questionid == $selectQuestionNoError) { |
|
|
|
$selected = 'selected="selected"'; |
|
|
|
$selected = 'selected="selected"'; |
|
|
|
} |
|
|
|
} |
|
|
|
$option_feed .= '<option value="'.$questionid.'" '.$selected.' >'.$val.'</option>'; |
|
|
|
$option_feed .= '<option value="'.$questionid.'" '.$selected.' >'.$val.'</option>'; |
|
|
|
} |
|
|
|
} |
|
|
|
if ($selectQuestionNoError == -1) { |
|
|
|
if ($selectQuestionNoError == -1) { |
|
|
|
$option_feed .= '<option value="-1" selected="selected" >'.get_lang('ExitTest').'</option>'; |
|
|
|
$option_feed .= '<option value="-1" selected="selected" >'.get_lang('ExitTest').'</option>'; |
|
|
|
} else { |
|
|
|
} else { |
|
|
|
$option_feed .= '<option value="-1">'.get_lang('ExitTest').'</option>'; |
|
|
|
$option_feed .= '<option value="-1">'.get_lang('ExitTest').'</option>'; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
if ($answerType == HOT_SPOT_DELINEATION) { |
|
|
|
if ($answerType == HOT_SPOT_DELINEATION) { |
|
|
|
?> |
|
|
|
?> |
|
|
|
<tr> |
|
|
|
<tr> |
|
|
|
<th colspan="2"><?php echo get_lang('IfNoError'); ?></th>
|
|
|
|
<th colspan="2"><?php echo get_lang('IfNoError'); ?></th>
|
|
|
|
<?php if ($objExercise->selectFeedbackType() == EXERCISE_FEEDBACK_TYPE_DIRECT) { ?> |
|
|
|
<?php if ($objExercise->selectFeedbackType() == EXERCISE_FEEDBACK_TYPE_DIRECT) { |
|
|
|
|
|
|
|
?> |
|
|
|
<th colspan="2"><?php echo get_lang('Feedback'); ?></th>
|
|
|
|
<th colspan="2"><?php echo get_lang('Feedback'); ?></th>
|
|
|
|
<th><?php echo get_lang('Scenario'); ?></th>
|
|
|
|
<th><?php echo get_lang('Scenario'); ?></th>
|
|
|
|
<?php } else { ?> |
|
|
|
<?php |
|
|
|
|
|
|
|
} else { |
|
|
|
|
|
|
|
?> |
|
|
|
<th colspan="3"><?php echo get_lang('Feedback'); ?></th>
|
|
|
|
<th colspan="3"><?php echo get_lang('Feedback'); ?></th>
|
|
|
|
<?php } ?> |
|
|
|
<?php |
|
|
|
|
|
|
|
} ?> |
|
|
|
<th> </th> |
|
|
|
<th> </th> |
|
|
|
</tr> |
|
|
|
</tr> |
|
|
|
<tr> |
|
|
|
<tr> |
|
|
|
@ -1034,15 +1053,16 @@ if ($modifyAnswers) { |
|
|
|
<textarea class="form-control" wrap="virtual" rows="3" cols="25" |
|
|
|
<textarea class="form-control" wrap="virtual" rows="3" cols="25" |
|
|
|
name="comment_noerror"><?php echo Security::remove_XSS($comment_noerror); ?></textarea>
|
|
|
|
name="comment_noerror"><?php echo Security::remove_XSS($comment_noerror); ?></textarea>
|
|
|
|
</td> |
|
|
|
</td> |
|
|
|
<?php if ($objExercise->selectFeedbackType() == EXERCISE_FEEDBACK_TYPE_DIRECT) { ?> |
|
|
|
<?php if ($objExercise->selectFeedbackType() == EXERCISE_FEEDBACK_TYPE_DIRECT) { |
|
|
|
|
|
|
|
?> |
|
|
|
<td> |
|
|
|
<td> |
|
|
|
<div class="checkbox"> |
|
|
|
<div class="checkbox"> |
|
|
|
<p> |
|
|
|
<p> |
|
|
|
<label> |
|
|
|
<label> |
|
|
|
<input type="checkbox" class="checkbox" |
|
|
|
<input type="checkbox" class="checkbox" |
|
|
|
name="try_noerror" <?php if ($try_noerror == 1) { |
|
|
|
name="try_noerror" <?php if ($try_noerror == 1) { |
|
|
|
echo 'checked'; |
|
|
|
echo 'checked'; |
|
|
|
} ?> /> |
|
|
|
} ?> /> |
|
|
|
<?php echo get_lang('TryAgain'); ?> |
|
|
|
<?php echo get_lang('TryAgain'); ?> |
|
|
|
</label> |
|
|
|
</label> |
|
|
|
</p> |
|
|
|
</p> |
|
|
|
@ -1065,11 +1085,15 @@ if ($modifyAnswers) { |
|
|
|
</p> |
|
|
|
</p> |
|
|
|
</td> |
|
|
|
</td> |
|
|
|
<td> </td> |
|
|
|
<td> </td> |
|
|
|
<?php } else { ?> |
|
|
|
<?php |
|
|
|
|
|
|
|
} else { |
|
|
|
|
|
|
|
?> |
|
|
|
<td colspan="2"> </td> |
|
|
|
<td colspan="2"> </td> |
|
|
|
<?php } ?> |
|
|
|
<?php |
|
|
|
|
|
|
|
} ?> |
|
|
|
</tr> |
|
|
|
</tr> |
|
|
|
<?php } ?> |
|
|
|
<?php |
|
|
|
|
|
|
|
} ?> |
|
|
|
</tbody> |
|
|
|
</tbody> |
|
|
|
</table> |
|
|
|
</table> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
@ -1077,9 +1101,8 @@ if ($modifyAnswers) { |
|
|
|
<div class="col-xs-12"> |
|
|
|
<div class="col-xs-12"> |
|
|
|
<?php |
|
|
|
<?php |
|
|
|
$swf_loaded = $answerType == HOT_SPOT_DELINEATION ? 'hotspot_delineation_admin' : 'hotspot_admin'; |
|
|
|
$swf_loaded = $answerType == HOT_SPOT_DELINEATION ? 'hotspot_delineation_admin' : 'hotspot_admin'; |
|
|
|
$height = 450; |
|
|
|
$height = 450; |
|
|
|
$relPath = api_get_path(WEB_CODE_PATH); |
|
|
|
$relPath = api_get_path(WEB_CODE_PATH); ?> |
|
|
|
?> |
|
|
|
|
|
|
|
<div id="hotspot-container" class="center-block"> |
|
|
|
<div id="hotspot-container" class="center-block"> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
@ -1087,21 +1110,25 @@ if ($modifyAnswers) { |
|
|
|
</form> |
|
|
|
</form> |
|
|
|
<script> |
|
|
|
<script> |
|
|
|
$(document).on('ready', function () { |
|
|
|
$(document).on('ready', function () { |
|
|
|
<?php if ($answerType == HOT_SPOT_DELINEATION) { ?> |
|
|
|
<?php if ($answerType == HOT_SPOT_DELINEATION) { |
|
|
|
|
|
|
|
?> |
|
|
|
new DelineationQuestion({ |
|
|
|
new DelineationQuestion({ |
|
|
|
questionId: <?php echo $modifyAnswers ?>,
|
|
|
|
questionId: <?php echo $modifyAnswers ?>,
|
|
|
|
selector: '#hotspot-container', |
|
|
|
selector: '#hotspot-container', |
|
|
|
for: 'admin', |
|
|
|
for: 'admin', |
|
|
|
relPath: '<?php echo $relPath ?>'
|
|
|
|
relPath: '<?php echo $relPath ?>'
|
|
|
|
}); |
|
|
|
}); |
|
|
|
<?php } else { ?> |
|
|
|
<?php |
|
|
|
|
|
|
|
} else { |
|
|
|
|
|
|
|
?> |
|
|
|
new HotspotQuestion({ |
|
|
|
new HotspotQuestion({ |
|
|
|
questionId: <?php echo $modifyAnswers ?>,
|
|
|
|
questionId: <?php echo $modifyAnswers ?>,
|
|
|
|
selector: '#hotspot-container', |
|
|
|
selector: '#hotspot-container', |
|
|
|
for: 'admin', |
|
|
|
for: 'admin', |
|
|
|
relPath: '<?php echo $relPath ?>'
|
|
|
|
relPath: '<?php echo $relPath ?>'
|
|
|
|
}); |
|
|
|
}); |
|
|
|
<?php } ?> |
|
|
|
<?php |
|
|
|
|
|
|
|
} ?> |
|
|
|
}); |
|
|
|
}); |
|
|
|
</script> |
|
|
|
</script> |
|
|
|
<?php |
|
|
|
<?php |
|
|
|
|