[svn r13224] Added ID to textarea of free answer

Added small placetaker for Hotspot (not yet integrated)
skala
Yannick Warnier 17 years ago
parent 9a23beed0b
commit 14bc2a63ec
  1. 37
      main/newscorm/js/api_wrapper.js

@ -136,13 +136,13 @@ function doLMSFinish()
}
else
{
var result = API.LMSFinish("");
if(result.toString() != "true")
{
var err = ErrorHandler();
var result = API.LMSFinish('');
//if(result.toString() != "true")
//{
// var err = ErrorHandler();
//}
}
}
return result.toString();
//return result.toString();
}
/**
* Calls the LMSGetValue method
@ -415,8 +415,9 @@ function checkAnswers(interrupted)
{
var tmpScore = 0;
var status = 'not attempted';
for(var i=0; i<questions_types.length;i++)
for(var i=0; i<questions.length;i++)
{
if(questions[i]){
var idQuestion = questions[i];
var type = questions_types[idQuestion];
var interactionScore = 0;
@ -429,7 +430,7 @@ function checkAnswers(interrupted)
{
var idAnswer = questions_answers[idQuestion][j];
var answer = document.getElementById('question_'+(idQuestion)+'_multiple_'+(idAnswer));
if(answer.checked.value == 'checked')
if(answer.checked.value == true)
{
myScore += questions_answers_correct[idQuestion][idAnswer];
}
@ -444,7 +445,7 @@ function checkAnswers(interrupted)
{
var idAnswer = questions_answers[idQuestion][j];
var answer = document.getElementById('question_'+(idQuestion)+'_unique_'+(idAnswer));
if(answer.selected.value == 'selected')
if(answer.checked.value == true)
{
myScore += questions_answers_correct[idQuestion][idAnswer];
}
@ -459,7 +460,7 @@ function checkAnswers(interrupted)
{
var idAnswer = questions_answers[idQuestion][j];
var answer = document.getElementById('question_'+(idQuestion)+'_tf_'+(idAnswer));
if(answer.selected == 'selected')
if(answer.checked.value == true)
{
myScore += questions_answers_correct[idQuestion][idAnswer];
}
@ -489,7 +490,7 @@ function checkAnswers(interrupted)
}
else if(type == 'free')
{
interactionAnswers += document.getElementById('question_'+idQuestion+'_free').value;
interactionAnswers += document.getElementById('question_'+(idQuestion)+'_free').innerHTML;
}
else if(type == 'hotspot')
{
@ -499,16 +500,12 @@ function checkAnswers(interrupted)
{
//
}
var interactionCorrectResponses = '';
for(var i=0; i<questions_answers_correct.length;i++)
{
interactionCorrectResponses += questions_answers_correct[i];
doLMSSetValue('cmi.interactions.'+idQuestion+'.id','Q'+idQuestion);
doLMSSetValue('cmi.interactions.'+idQuestion+'.result',interactionScore);
doLMSSetValue('cmi.interactions.'+idQuestion+'.type',type);
doLMSSetValue('cmi.interactions.'+idQuestion+'.student_response',interactionAnswers);
doLMSSetValue('cmi.interactions.'+idQuestion+'.correct_responses',questions_answers_correct[idQuestion]);
}
doLMSSetValue('cmi.core.interactions.'+idQuestion+'.id','Q'+idQuestion);
doLMSSetValue('cmi.core.interactions.'+idQuestion+'.result',interactionScore);
doLMSSetValue('cmi.core.interactions.'+idQuestion+'.type',type);
doLMSSetValue('cmi.core.interactions.'+idQuestion+'.student_response',interactionAnswers);
doLMSSetValue('cmi.core.interactions.'+idQuestion+'.correct_responses',interactionCorrectResponses);
}
doLMSSetValue('cmi.core.score.raw',tmpScore);
//get status

Loading…
Cancel
Save