diff --git a/main/exercice/export/scorm/scorm_classes.php b/main/exercice/export/scorm/scorm_classes.php index d11a2c27a8..f9f5857055 100755 --- a/main/exercice/export/scorm/scorm_classes.php +++ b/main/exercice/export/scorm/scorm_classes.php @@ -202,7 +202,7 @@ class ScormAnswerMultipleChoice extends Answer $id++; } $js .= 'questions_answers['.$this->questionId.'] = new Array('.substr($jstmp,0,-1).');'."\n"; - $js .= 'questions_answers_correct['.$this->questionId.'] = new Array('.$jstmpc.');'."\n"; + $js .= 'questions_answers_correct['.$this->questionId.'] = '.$jstmpc.';'."\n"; $js .= 'questions_types['.$this->questionId.'] = \'mcua\';'."\n"; } $html .= '' . "\n"; @@ -297,13 +297,15 @@ class ScormAnswerFillInBlanks extends Answer // because [] is parsed here we follow this procedure: // 1. find everything between the [ and ] tags $i=1; + $jstmp = ''; $jstmpc = ''; $startlocations=strpos($answer,'['); $endlocations=strpos($answer,']'); while($startlocations !== false && $endlocations !== false) { $texstring=substr($answer,$startlocations,($endlocations-$startlocations)+1); - $answer = substr_replace($answer,'',$startlocations,($endlocations-$startlocations)+1); + $answer = substr_replace($answer,'',$startlocations,($endlocations-$startlocations)+1); + $jstmp .= $i.','; $jstmpc .= "'".htmlentities(substr($texstring,1,-1),ENT_QUOTES)."',"; $i++; $startlocations=strpos($answer,'['); @@ -316,7 +318,7 @@ class ScormAnswerFillInBlanks extends Answer . '' . "\n" . '' . "\n"; $html .= '' . "\n"; - $js .= 'questions_answers['.$this->questionId.'] = new Array();'."\n"; + $js .= 'questions_answers['.$this->questionId.'] = new Array('.substr($jstmp,0,-1).');'."\n"; $js .= 'questions_answers_correct['.$this->questionId.'] = new Array('.substr($jstmpc,0,-1).');'."\n"; $js .= 'questions_types['.$this->questionId.'] = \'fib\';'."\n"; return array($js,$html); @@ -356,7 +358,7 @@ class ScormAnswerMatching extends Answer $jstmpc = ''; for($answerId=1;$answerId <= $nbrAnswers;$answerId++) { - $identifier = 'question_'.$qId.'_matching_'.$answerId; + $identifier = 'question_'.$qId.'_matching_'; $answer=$this->selectAnswer($answerId); $answerCorrect=$this->isCorrect($answerId); $weight=$this->selectWeighting($answerId); @@ -374,7 +376,7 @@ class ScormAnswerMatching extends Answer { $s.=''."\n"; $s.=''."\n".''.$cpt2.'. '.$answer."\n\n"; - $s.='  '; $s.=' '; // fills the list-box foreach($Select as $key=>$val) @@ -389,7 +391,7 @@ class ScormAnswerMatching extends Answer $s.="\n\n"; $jstmp .= $cpt2.','; - $jstmpc .= '['.$cpt2.',\''.$Select[$cpt2]['Lettre'].'\'],'; + $jstmpc .= '['.$cpt2.',\''.$cpt2.'\'],'; $cpt2++; // if the left side of the "matching" has been completely shown @@ -581,10 +583,17 @@ class ScormAnswerHotspot extends Answer "; //because this header closes so many times the