Bug #1512
Hotpotatoes score not saved in learnpath
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
Related issues
History
Updated by Yannick Warnier over 10 years ago
- Priority changed from Normal to High
- Complexity changed from Normal to Challenging
- SCRUM pts - complexity changed from ? to 8
Updated by Ivan Tcholakov over 10 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.
Updated by Andre Boivin over 10 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é
Updated by Ivan Tcholakov over 10 years ago
Thank you, I saw the additional information http://www.chamilo.org/fr/node/600
Ivan.
Updated by Yannick Warnier over 10 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...
Updated by Ivan Tcholakov over 10 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."
Updated by Ivan Tcholakov over 10 years ago
Saving HotPotatoes scores works on 1.8.5. On 1.8.6 and so forth saving scores fails.
Updated by Yannick Warnier over 10 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
Updated by Yannick Warnier over 10 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...
Updated by Yannick Warnier over 10 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
Updated by Andre Boivin over 10 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!