@@ -3872,8 +3872,8 @@ public function manage_answer(
38723872
38733873 if ($ answerType == MULTIPLE_ANSWER_TRUE_FALSE_DEGREE_CERTAINTY ) {
38743874 $ choiceTmp = $ choice ;
3875- $ choice = isset ( $ choiceTmp ['choice ' ]) ? $ choiceTmp [ ' choice ' ] : '' ;
3876- $ choiceDegreeCertainty = isset ( $ choiceTmp ['choiceDegreeCertainty ' ]) ? $ choiceTmp [ ' choiceDegreeCertainty ' ] : '' ;
3875+ $ choice = $ choiceTmp ['choice ' ] ?? '' ;
3876+ $ choiceDegreeCertainty = $ choiceTmp ['choiceDegreeCertainty ' ] ?? '' ;
38773877 }
38783878
38793879 if ($ answerType == FREE_ANSWER ||
@@ -3888,12 +3888,12 @@ public function manage_answer(
38883888 $ generatedFile = '' ;
38893889 if ($ answerType == ORAL_EXPRESSION ) {
38903890 $ exe_info = Event::get_exercise_results_by_attempt ($ exeId );
3891- $ exe_info = isset ( $ exe_info [$ exeId ]) ? $ exe_info [ $ exeId ] : null ;
3891+ $ exe_info = $ exe_info [$ exeId ] ?? null ;
38923892 $ objQuestionTmp ->initFile (
38933893 api_get_session_id (),
3894- isset ( $ exe_info ['exe_user_id ' ]) ? $ exe_info [ ' exe_user_id ' ] : api_get_user_id (),
3895- isset ( $ exe_info ['exe_exo_id ' ]) ? $ exe_info [ ' exe_exo_id ' ] : $ this ->iid ,
3896- isset ( $ exe_info ['exe_id ' ]) ? $ exe_info [ ' exe_id ' ] : $ exeId
3894+ $ exe_info ['exe_user_id ' ] ?? api_get_user_id (),
3895+ $ exe_info ['exe_exo_id ' ] ?? $ this ->iid ,
3896+ $ exe_info ['exe_id ' ] ?? $ exeId
38973897 );
38983898
38993899 // Probably this attempt came in an exercise all question by page
@@ -4068,7 +4068,7 @@ function ($answerId) use ($objAnswerTmp) {
40684068 $ userAnsweredQuestion = !empty ($ choice );
40694069 }
40704070
4071- $ studentChoice = isset ( $ choice [$ answerAutoId ]) ? $ choice [ $ answerAutoId ] : null ;
4071+ $ studentChoice = $ choice [$ answerAutoId ] ?? null ;
40724072 if (isset ($ studentChoice )) {
40734073 $ correctAnswerId [] = $ answerAutoId ;
40744074 if ($ studentChoice == $ answerCorrect ) {
@@ -4110,8 +4110,8 @@ function ($answerId) use ($objAnswerTmp) {
41104110 }
41114111 }
41124112
4113- $ studentChoice = isset ( $ choice [$ answerAutoId ]) ? $ choice [ $ answerAutoId ] : null ;
4114- $ studentChoiceDegree = isset ( $ choiceDegreeCertainty [$ answerAutoId ]) ? $ choiceDegreeCertainty [ $ answerAutoId ] : null ;
4113+ $ studentChoice = $ choice [$ answerAutoId ] ?? null ;
4114+ $ studentChoiceDegree = $ choiceDegreeCertainty [$ answerAutoId ] ?? null ;
41154115
41164116 // student score update
41174117 if (!empty ($ studentChoice )) {
@@ -4150,14 +4150,14 @@ function ($answerId) use ($objAnswerTmp) {
41504150 $ choice [$ row ['answer ' ]] = 1 ;
41514151 }
41524152
4153- $ studentChoice = isset ( $ choice [$ answerAutoId ]) ? $ choice [ $ answerAutoId ] : null ;
4153+ $ studentChoice = $ choice [$ answerAutoId ] ?? null ;
41544154 $ real_answers [$ answerId ] = (bool ) $ studentChoice ;
41554155
41564156 if ($ studentChoice ) {
41574157 $ questionScore += $ answerWeighting ;
41584158 }
41594159 } else {
4160- $ studentChoice = isset ( $ choice [$ answerAutoId ]) ? $ choice [ $ answerAutoId ] : null ;
4160+ $ studentChoice = $ choice [$ answerAutoId ] ?? null ;
41614161 $ real_answers [$ answerId ] = (bool ) $ studentChoice ;
41624162
41634163 if (isset ($ studentChoice )
@@ -4178,13 +4178,13 @@ function ($answerId) use ($objAnswerTmp) {
41784178 while ($ row = Database::fetch_array ($ resultans )) {
41794179 $ choice [$ row ['answer ' ]] = 1 ;
41804180 }
4181- $ studentChoice = isset ( $ choice [$ answerAutoId ]) ? $ choice [ $ answerAutoId ] : null ;
4181+ $ studentChoice = $ choice [$ answerAutoId ] ?? null ;
41824182 $ real_answers [$ answerId ] = (bool ) $ studentChoice ;
41834183 if ($ studentChoice ) {
41844184 $ questionScore += $ answerWeighting ;
41854185 }
41864186 } else {
4187- $ studentChoice = isset ( $ choice [$ answerAutoId ]) ? $ choice [ $ answerAutoId ] : null ;
4187+ $ studentChoice = $ choice [$ answerAutoId ] ?? null ;
41884188 if (isset ($ studentChoice )) {
41894189 $ questionScore += $ answerWeighting ;
41904190 }
@@ -4209,13 +4209,13 @@ function ($answerId) use ($objAnswerTmp) {
42094209 $ choice [$ my_answer_id ] = $ option ;
42104210 }
42114211 }
4212- $ studentChoice = isset ( $ choice [$ answerAutoId ]) ? $ choice [ $ answerAutoId ] : '' ;
4212+ $ studentChoice = $ choice [$ answerAutoId ] ?? '' ;
42134213 $ real_answers [$ answerId ] = false ;
42144214 if ($ answerCorrect == $ studentChoice ) {
42154215 $ real_answers [$ answerId ] = true ;
42164216 }
42174217 } else {
4218- $ studentChoice = isset ( $ choice [$ answerAutoId ]) ? $ choice [ $ answerAutoId ] : '' ;
4218+ $ studentChoice = $ choice [$ answerAutoId ] ?? '' ;
42194219 $ real_answers [$ answerId ] = false ;
42204220 if ($ answerCorrect == $ studentChoice ) {
42214221 $ real_answers [$ answerId ] = true ;
@@ -4232,7 +4232,7 @@ function ($answerId) use ($objAnswerTmp) {
42324232 $ choice [$ row ['answer ' ]] = 1 ;
42334233 }
42344234
4235- $ studentChoice = isset ( $ choice [$ answerAutoId ]) ? $ choice [ $ answerAutoId ] : null ;
4235+ $ studentChoice = $ choice [$ answerAutoId ] ?? null ;
42364236 if (1 == $ answerCorrect ) {
42374237 $ real_answers [$ answerId ] = false ;
42384238 if ($ studentChoice ) {
@@ -4245,7 +4245,7 @@ function ($answerId) use ($objAnswerTmp) {
42454245 }
42464246 }
42474247 } else {
4248- $ studentChoice = isset ( $ choice [$ answerAutoId ]) ? $ choice [ $ answerAutoId ] : null ;
4248+ $ studentChoice = $ choice [$ answerAutoId ] ?? null ;
42494249 if (1 == $ answerCorrect ) {
42504250 $ real_answers [$ answerId ] = false ;
42514251 if ($ studentChoice ) {
@@ -5745,7 +5745,7 @@ function ($answerId) use ($objAnswerTmp) {
57455745 break ;
57465746 case ORAL_EXPRESSION :
57475747 echo '<tr>
5748- <td valign="top" > ' .
5748+ <td> ' .
57495749 ExerciseShowFunctions::display_oral_expression_answer (
57505750 $ feedback_type ,
57515751 $ choice ,
0 commit comments