Fixing SCORM export when using the Exact question

skala
Julio Montoya 15 years ago
parent 05e2b3a682
commit 6a2019dd97
  1. 6
      main/exercice/export/scorm/scorm_classes.php
  2. 20
      main/newscorm/js/api_wrapper.js

@ -218,15 +218,15 @@ class ScormAnswerMultipleChoice extends Answer
// some javascript must be added for that kind of questions
$html .= '<tr>' . "\n"
. '<td>' . "\n"
. '<textarea name="question_'.$qId.'_free" id="question_'.$qId.'_free" rows="20" cols="100"></textarea>' . "\n"
. '<textarea name="question_'.$qId.'_free" id="question_'.$qId.'_exact" rows="20" cols="100"></textarea>' . "\n"
. '</td>' . "\n"
. '</tr>' . "\n";
$html .= '</table></td></tr>' . "\n";
// currently the free answers cannot be displayed, so ignore the textarea
// currently the exact answers cannot be displayed, so ignore the textarea
$html = '<tr><td colspan="2">'.get_lang('ThisItemIsNotExportable').'</td></tr>';
$js .= 'questions_answers['.$this->questionJSId.'] = new Array();'."\n";
$js .= 'questions_answers_correct['.$this->questionJSId.'] = new Array();'."\n";
$js .= 'questions_types['.$this->questionJSId.'] = \'free\';'."\n";
$js .= 'questions_types['.$this->questionJSId.'] = \'exact\';'."\n";
$jstmpw = 'questions_answers_ponderation['.$this->questionJSId.'] = new Array();'."\n";
$jstmpw .= 'questions_answers_ponderation['.$this->questionJSId.'][0] = 0;'."\n";
$jstmpw .= 'questions_answers_ponderation['.$this->questionJSId.'][1] = 0;'.";\n";

@ -429,8 +429,7 @@ function checkAnswers(interrupted)
var tmpScore = 0;
var status = 'not attempted';
var scoreMax = 0;
for(var i=0; i<questions.length;i++)
{
for(var i=0; i<questions.length;i++) {
if(questions[i] != undefined && questions[i] != null){
var idQuestion = questions[i];
var type = questions_types[idQuestion];
@ -439,8 +438,7 @@ function checkAnswers(interrupted)
var interactionCorrectResponses = '';
var interactionType = '';
if (type == 'mcma')
{
if (type == 'mcma') {
var interactionType = 'choice';
var myScore = 0;
for(var j=0; j<questions_answers[idQuestion].length;j++)
@ -608,18 +606,16 @@ function checkAnswers(interrupted)
// interactionCorrectResponses += questions_answers_correct[idQuestion][k].toString()+',';
//}
scoreMax += questions_score_max[idQuestion];
}
else if(type == 'free')
{ //ignore for now as a score cannot be given
} else if(type == 'free') {
//ignore for now as a score cannot be given
var interactionType = 'likert';
interactionScore = 0;
//interactionAnswers = document.getElementById('question_'+(idQuestion)+'_free').value;
//correct responses work by pattern, see SCORM Runtime Env Doc
//interactionCorrectResponses += questions_answers_correct[idQuestion].toString();
}
else if(type == 'hotspot')
{
} else if(type == 'hotspot') {
var interactionType = 'sequencing';
interactionScore = 0;
//if(question_score && question_score[idQuestion]){
// interactionScore = question_score[idQuestion];
//} //else, 0
@ -630,9 +626,11 @@ function checkAnswers(interrupted)
// interactionCorrectResponses += questions_answers_correct[idQuestion][k].toString()+',';
//}
} else if(type == 'exact') {
var interactionType = 'exact';
interactionScore = 0;
// not yet implemented see scorm_classes.php ScormAnswerMultipleChoice::export() function
/*
var interactionType = 'exact';
var myScore = 0;
var real_answers = new Array();

Loading…
Cancel
Save