Project

General

Profile

Bug #1512

Hotpotatoes score not saved in learnpath

Added by Andre Boivin over 9 years ago. Updated over 9 years ago.

Status:
Bug resolved
Priority:
High
Category:
-
Target version:
Start date:
16/06/2010
Due date:
% Done:

90%

Estimated time:
Spent time:
Complexity:
Challenging
SCRUM pts - complexity:
8

Description

Les hotpotatoes fonctionnent correctement dans les parcours avec les modif suivantes mais j'ai peur d'avoir causé d'autres problèmes.

Voici mes modifications:

newscorm/

lp_ajax_save_item.php ligne 146, remove olms.
lp_ajax_switch_item.php = remove all olms.
scorm.api.php = remove all olms.

learnpathitemclass.php = add break;

J'ai joint mes fichiers modifiés ainsi qu'un hotpotatoes


Files

mod.zip (49.7 KB) mod.zip fichiers modifiés Andre Boivin, 16/06/2010 14:51

Related issues

Related to Chamilo LMS - Bug #1761: Tests tool: Some Problems in supporting HotPotatoes testsFeature implemented25/07/2010

Actions

History

#1

Updated by Andre Boivin over 9 years ago

  • Target version set to 1.8.7.1
#2

Updated by Yannick Warnier over 9 years ago

  • Priority changed from Normal to High
  • Complexity changed from Normal to Challenging
  • SCRUM pts - complexity changed from ? to 8
#3

Updated by Ivan Tcholakov over 9 years ago

I have a question. I wonder, why the object variable olms is to eliminated? Is this change mandatory for solving the problem?

As I understand, olms is used like a namespace, where all the related variables are hidden. If we remove the variable olms, then all that was inside will move to the global namespace. There variables with very simple names will appear: score, min, max, ... Collisions with other javascripts might happen.

#4

Updated by Andre Boivin over 9 years ago

This is the only solution I found.
The problem with HotPotatoes is probably related to these variables.
Currently, I have no experience other problems with these changes.
André

#5

Updated by Ivan Tcholakov over 9 years ago

Thank you, I saw the additional information http://www.chamilo.org/fr/node/600
Ivan.

#7

Updated by Yannick Warnier over 9 years ago

apparently the result is sent back from exercice_result.php, line 1083, to scorm_api.php's API.void_save_asset(), which then calls xajax_save_item() and apparently the call gets routed to lp_ajax_save_itemp.php correctly...

#8

Updated by Ivan Tcholakov over 9 years ago

scorm_api.php 1034-1047

/**
 * Save a Dokeos learnpath item's time and mark as completed upon leaving it.
 * Same function as lms_save_asset() but saves it with empty params
 * to use values set from another side in the database. Only used by Dokeos quizzes.
 * Also save the score locally because it hasn't been done through SetValue().
 * Saving the status will be dealt with by the XAJAX function.
 */
function dokeos_void_save_asset(myscore,mymax)
{
    logit_lms('lms_save_asset',2);
    olms.score = myscore;
    if((mymax == null) || (mymax == '')){mymax = 100;} //assume a default of 100, otherwise the score will not get saved (see lpi->set_score())
    xajax_save_item(olms.lms_lp_id, olms.lms_user_id, olms.lms_view_id, olms.lms_item_id, myscore, mymax);
}

Here the status is not passed for recording. See the comment "Saving the status will be dealt with by the XAJAX function."

#9

Updated by Ivan Tcholakov over 9 years ago

Saving HotPotatoes scores works on 1.8.5. On 1.8.6 and so forth saving scores fails.

#10

Updated by Yannick Warnier over 9 years ago

Thx. This is the last bug for 1.8.7.1 and I'm retaking work on it now. As far as I see it, there might be problems due to the parameters actually passed to lp_ajax_save_item():

In save_item(3,4,1,16,100,100,undefined,"undefined",undefined,"undefined","undefined","","undefined"), referer: /main/newscorm/lp_controller.php?cidReq=VVV&action=view&lp_id=3
#11

Updated by Yannick Warnier over 9 years ago

  • Status changed from New to Needs more info
  • Assignee set to Yannick Warnier
  • % Done changed from 0 to 90

Found it. Fixed (added a special case for hotpotatoes) in http://code.google.com/p/chamilo/source/detail?r=ee0de4837717ae6a4cdaa2922391987a993defd6&repo=classic

I also arbitrarily "decided" that a score above 80% would be marked as "completed" while a score below that would be marked as "failed" (only for hotpotatoes). Open to other opinions here.

Now let's hope this doesn't break anything else in scorm, otherwise we're good for 1.8.7.2 soon ;-)

André, if you get any chance to apply the patch and report, would be helpful.
I'm moving forward with the 1.8.7.1 packaging now...

#12

Updated by Yannick Warnier over 9 years ago

  • Status changed from Needs more info to Bug resolved

Closing for release. Do not hesitate to send additional comments and update target version to 1.8.8 alpha

#13

Updated by Andre Boivin over 9 years ago

With the changes, everything works fine on my side, again you have solved a problem that required a prerequisite after a HotPotatoes if it was never marked as complete.
Finally an integrated solution for HotPotatoes.
Thank you and congratulations to the team!

Also available in: Atom PDF