Project

General

Profile

Bug #3343

Time spent on hotpotatoes test

Added by Andre Boivin over 8 years ago. Updated almost 7 years ago.

Status:
Needs testing
Priority:
Normal
Assignee:
-
Category:
Exercises
Target version:
-
Start date:
28/04/2011
Due date:
% Done:

80%

Estimated time:
Spent time:
Complexity:
Normal
SCRUM pts - complexity:
?

Description

Time spent on a HotPotatoes test is erroneous. See attached image


Files

time.gif (6.56 KB) time.gif Andre Boivin, 28/04/2011 19:04
test1.htm (29.9 KB) test1.htm Andre Boivin, 24/12/2012 15:02
3343.png (62.1 KB) 3343.png Yannick Warnier, 28/12/2012 05:57

Associated revisions

Revision 0209d060 (diff)
Added by Julio Montoya over 7 years ago

Should fix big date issues when adding a hotpotatoe in a LP see #3343

Revision 38bf82d7 (diff)
Added by Julio Montoya about 7 years ago

Fixing LP js error when using hotpotatoes see #3343

Revision 355abb18 (diff)
Added by Julio Montoya about 7 years ago

Fixing empty frame in IE7 see #3343

Revision 30f816c2 (diff)
Added by Yannick Warnier about 7 years ago

Minor - Fixed wrong HTML attribute - refs #3343

Revision 1ac878fd (diff)
Added by Yannick Warnier about 7 years ago

Slight improvement in top window selector for API and comments - refs #3343

History

#1

Updated by Julio Montoya over 8 years ago

  • Status changed from New to Needs more info

Need more details, how we can reproduce it? which is the context (exercise and LP settings) ?

#2

Updated by Yannick Warnier over 8 years ago

It is possible that we are in fact recovering the time spent on this page through the hotpotatoes communication rather than the lp communication.

#3

Updated by Yannick Warnier over 8 years ago

  • Assignee set to Andre Boivin

Hi André, we need a little bit of feedback here (otherwise we'll move it to 1.8.8.1) as we'd like to release this week (probably tomorrow).

#4

Updated by Andre Boivin over 8 years ago

exercice dans un parcours
LP= plusieurs tentatives

#5

Updated by Yannick Warnier over 8 years ago

  • Status changed from Needs more info to Assigned
  • Assignee changed from Andre Boivin to Julio Montoya

With any hotpotatoes test? (does the example in the other task work for that?)

#6

Updated by Andre Boivin over 8 years ago

Yes, any hotpotatoes

#7

Updated by Julio Montoya over 8 years ago

  • Target version changed from 1.8.8 stable to 1.8.8.4

moving to 1.8.8.1

#8

Updated by Julio Montoya over 8 years ago

  • Status changed from Assigned to New
  • Assignee deleted (Julio Montoya)
  • Target version changed from 1.8.8.4 to 1.9 Stable

moving to 1.9

#9

Updated by Yannick Warnier over 7 years ago

  • Target version changed from 1.9 Stable to 1.9.2
#10

Updated by Yannick Warnier over 7 years ago

  • Target version changed from 1.9.2 to 1.9.4
#11

Updated by Julio Montoya over 7 years ago

  • Status changed from New to Assigned
  • Assignee set to Julio Montoya

Yesterday I did a test and everything went fine. Today I did another test and now I have 18 hours of time spent. So I could reproduced the error.

#12

Updated by Julio Montoya over 7 years ago

  • Status changed from Assigned to New
  • Assignee deleted (Julio Montoya)

When loading the LP I have this in scorm_api.php

olms.total_time = '19:35:00';

even if I got out the page (LP list) or if I refresh the page

#13

Updated by Julio Montoya over 7 years ago

  • Status changed from New to Needs testing
  • % Done changed from 0 to 40

The problem is here: learnpath.class.php line ~308

$this->items[$row['id']]->set_lp_view($this->lp_view_id, $course_id);

This function sets this variables from the DB with the past dates:

$this->current_start_time
$this->current_stop_time 

This could be fixed if I added something like that:

// Setting the view in the item object.
            if (is_object($this->items[$row['id']])) {
                $this->items[$row['id']]->set_lp_view($this->lp_view_id, $course_id);
                if ($this->items[$row['id']]->get_type() == TOOL_HOTPOTATOES) {
                    $this->items[$row['id']]->current_start_time = 0;
                    $this->items[$row['id']]->current_stop_time    = 0;                    
                }
            }

I'm not confident of this change but it seems to work

Requires testing otherwise this fix should be removed.

http://code.google.com/p/chamilo/source/detail?r=f67e5aca0e408df77be444404e236d8bc767a481&name=1.9.x&repo=classic

#14

Updated by Andre Boivin about 7 years ago

Le temps n'est pas toujours compté et quand il est compté, il semble aller plus vite. Je ne sais pas si c'est lié mais les prés-requis ne fonctionne plus avec les hotpotatoes.

#15

Updated by Yannick Warnier about 7 years ago

  • Status changed from Needs testing to Assigned
  • Assignee set to Andre Boivin

Quel est le statut de ce problème maintenant? André, on a du te demander ça mille fois dans d'autres rapports, mais est-ce que tu aurais un petit HotPotatoes sous la main avec comptage du temps (si c'est lui qui le fait), pour qu'on vérifie?

Si ça ne fonctionne toujours pas, il est fort probable qu'on repousse jusque dans 1.9.6...

#16

Updated by Andre Boivin about 7 years ago

En voici un, les réponses: 1 et 2

#17

Updated by Yannick Warnier about 7 years ago

  • File 3343.png 3343.png added
  • Assignee changed from Andre Boivin to Julio Montoya

Effectivement, ça ne fonctionne pas.
De plus, je note que, dans un parcours, cliquer sur le bouton pour confirmer la fin du test envoie (au moins en tant qu'admin) vers la page générale du cours avec un message "Ce test HotPotatoes est terminé." (et avec l'en-tête de Chamilo, qui n'est pas voulue dans ce cas-ci).

Julio, est-ce que tu pourrais annuler ton patch précédent alors? (tu disais qu'il faudrait le retirer s'il ne fonctionnait pas)

Est-ce que tu penses pouvoir corriger ceci avant le 1/1/2012? :-)
Sinon, merci de le mettre en objectif 1.9.6. On va essayer de pas trop traîner pour sortir un patch.

#18

Updated by Julio Montoya about 7 years ago

l'erreur n'est pas à cause de mon changemenet, il y a un erreur js:

TypeError: window.parent.API is undefined
[Break On This Error]     

...<script>window.parent.API.void_save_asset('100', '100', 0, 'completed');</script
#19

Updated by Julio Montoya about 7 years ago

  • Status changed from Assigned to Needs testing
  • Assignee deleted (Julio Montoya)
  • % Done changed from 40 to 80

je viens de régler le problème testé avec FF 18 , Chrome v24 et IE7

#20

Updated by Yannick Warnier about 7 years ago

Your change to the exercices/showinframe.php is a little strange (http://support.chamilo.org/projects/chamilo-18/repository/revisions/0e6f1b2d1627/diff/main/exercice/showinframes.php) :

103: echo '<iframe overflow:hidden id="hotpotatoe" width="100%" frameborder="0" src="'.$url.'"></iframe>';

As far as I know (and I far as I've seen, on http://www.quackit.com/html_5/tags/html_iframe_tag.cfm for example), there is now "overflow:hidden" syntax anywhere except inside a possible style attribute, so I'm updating that.

Note that the time registration doesn't work for me (FF 17.0.1), which is why I'm looking into it.

As for the other change (in exercice/savescores.php - support.chamilo.org/projects/chamilo-18/repository/revisions/77f52b263ec3/diff/main/exercice/savescores.php):

API_obj = window.parent.frames.window.top.API;

seems a little bit excessive in terms of looking for the top window... it shoul normally be a little easier. Something like
$(window.top).find("API");
, maybe?

#21

Updated by Yannick Warnier about 7 years ago

The process seems to be as follows:
  • main/exercices/savescores.php calls the main window's API object.void_save_asset()
  • the API object, defined in main/newscorm/scorm_api.php, executs void_save_asset(), which basically checks the value received as parameters and calls xajax_save_item() (from the same object) with a series of parameters from the current SCORM context (are these even defined?) an the score, max, min and status received through void_save_asset() (in SCORM, an asset doesn't register time, so up to this point it seems logical not to have time
  • xajax_save_item() forms a call to lp_ajax_save_item.php (and calls it, synchronously)
  • in lp_ajax_save_item.php, the save_item() function is called. If $time is not define, it is assumed to be = 0 and replaced a little bit further by $time = $mylpi->get_total_time() (this one is defined in the learnpathItem.class.php file)
  • the get_total_time() function then tries to build a total amount of time based on the difference between $lpi->current_start_time and the $lpi->curent_stop_time. Each of them is replaced by time() if undefined, so we should make sure that one of them is initially defined, otherwise we obviously end up with a time of 0.

The problem seems to be that those elements (hotpotatoes) don't get any current_start_time, while the others do.

From the very first call to get_total_time(), an asset gets a current_start_time set, while an hotpotatoes gets a current_start_time of 0, for some reason.

The current_start_time seems to be set to the current time only in the learnPathItem::open() function, which in turn seems to be called only from the learnpath::start_current_item() method.

#22

Updated by Yannick Warnier about 7 years ago

  • Target version changed from 1.9.4 to 1.9.6

Sorry but I can't get to figure out this one. Already spent a series of hours but I'm getting nowhere and this is blocking 1.9.4, so I'm moving to 1.9.6.

#23

Updated by Yannick Warnier almost 7 years ago

  • Category set to Exercises
  • Target version deleted (1.9.6)

If anybody is really impacted by this, then we would need a hand organizing, resuming and maybe bugfixing here (or a someone's customer taking the costs in charge as apparently nobody wants to deal with the complexity). Moving it to no definite deadline for now.

Also available in: Atom PDF