Exercise: Fix related values to learning path for submit modal #4178

pull/4284/head
Angel Fernando Quiroz Campos 4 years ago
parent 22de8cbfd8
commit 929a78cde8
  1. 12
      main/exercise/exercise.class.php
  2. 14
      main/exercise/exercise_submit.php

@ -3379,9 +3379,11 @@ class Exercise
$questions_in_media = [], $questions_in_media = [],
$currentAnswer = '', $currentAnswer = '',
$myRemindList = [], $myRemindList = [],
$showPreviousButton = true $showPreviousButton = true,
int $lpId = 0,
int $lpItemId = 0,
int $lpItemViewId = 0
) { ) {
global $safe_lp_id, $safe_lp_item_id, $safe_lp_item_view_id;
$nbrQuestions = $this->countQuestionsInExercise(); $nbrQuestions = $this->countQuestionsInExercise();
$buttonList = []; $buttonList = [];
$html = $label = ''; $html = $label = '';
@ -3397,9 +3399,9 @@ class Exercise
$url = api_get_path(WEB_CODE_PATH).'exercise/exercise_submit_modal.php?'.api_get_cidreq(); $url = api_get_path(WEB_CODE_PATH).'exercise/exercise_submit_modal.php?'.api_get_cidreq();
$url .= '&'.http_build_query([ $url .= '&'.http_build_query([
'learnpath_id' => $safe_lp_id, 'learnpath_id' => $lpId,
'learnpath_item_id' => $safe_lp_item_id, 'learnpath_item_id' => $lpItemId,
'learnpath_item_view_id' => $safe_lp_item_view_id, 'learnpath_item_view_id' => $lpItemViewId,
'hotspot' => $hotspotGet, 'hotspot' => $hotspotGet,
'nbrQuestions' => $nbrQuestions, 'nbrQuestions' => $nbrQuestions,
'num' => $questionNum, 'num' => $questionNum,

@ -1778,7 +1778,10 @@ foreach ($questionList as $questionId) {
[], [],
[], [],
$myRemindList, $myRemindList,
$showPreviousButton $showPreviousButton,
$learnpath_id,
$learnpath_item_id,
$learnpath_item_view_id
); );
break; break;
case ALL_ON_ONE_PAGE: case ALL_ON_ONE_PAGE:
@ -1837,7 +1840,14 @@ foreach ($questionList as $questionId) {
if ($objExercise->type == ALL_ON_ONE_PAGE) { if ($objExercise->type == ALL_ON_ONE_PAGE) {
$exerciseActions = $objExercise->show_button( $exerciseActions = $objExercise->show_button(
$questionId, $questionId,
$current_question $current_question,
[],
'',
[],
true,
$learnpath_id,
$learnpath_item_id,
$learnpath_item_view_id
); );
echo Display::div($exerciseActions, ['class' => 'exercise_actions']); echo Display::div($exerciseActions, ['class' => 'exercise_actions']);
echo '<br>'; echo '<br>';

Loading…
Cancel
Save