@@ -824,15 +824,14 @@ public static function getAnswerInfo($userAnswer = '', $isStudentAnswer = false)
824824 $ listDetails = explode (': ' , $ listArobaseSplit [0 ]);
825825
826826 // < number of item after the ::[score]:[size]:[separator_id]@ , here there are 3
827+ $ listWeightings = explode (', ' , $ listDetails [0 ]);
827828 if (count ($ listDetails ) < 3 ) {
828- $ listWeightings = explode (', ' , $ listDetails [0 ]);
829829 $ listSizeOfInput = [];
830830 for ($ i = 0 ; $ i < count ($ listWeightings ); $ i ++) {
831831 $ listSizeOfInput [] = 200 ;
832832 }
833833 $ blankSeparatorNumber = 0 ; // 0 is [...]
834834 } else {
835- $ listWeightings = explode (', ' , $ listDetails [0 ]);
836835 $ listSizeOfInput = explode (', ' , $ listDetails [1 ]);
837836 $ blankSeparatorNumber = $ listDetails [2 ];
838837 }
@@ -1269,7 +1268,8 @@ public static function getHtmlAnswer(
12691268 $ resultsDisabled = false ,
12701269 $ showTotalScoreAndUserChoices = false ,
12711270 $ exercise
1272- ) {
1271+ ): string
1272+ {
12731273 $ hideExpectedAnswer = false ;
12741274 $ hideUserSelection = false ;
12751275 if (!$ exercise ->showExpectedChoiceColumn ()) {
@@ -1414,7 +1414,7 @@ public static function getHtmlWrongAnswer(
14141414 *
14151415 * @return bool
14161416 */
1417- public static function isCorrect ($ answerText )
1417+ public static function isCorrect ($ answerText ): bool
14181418 {
14191419 $ answerInfo = self ::getAnswerInfo ($ answerText , true );
14201420 $ correctAnswerList = $ answerInfo ['words ' ];
@@ -1436,7 +1436,7 @@ public static function isCorrect($answerText)
14361436 *
14371437 * @return string
14381438 */
1439- public static function clearStudentAnswer ($ answer )
1439+ public static function clearStudentAnswer ($ answer ): string
14401440 {
14411441 $ answer = htmlentities (api_utf8_encode ($ answer ), ENT_QUOTES );
14421442 $ answer = str_replace ('' ' , '' ' , $ answer ); // fix apostrophe
0 commit comments