[solved] [BUG] SCORM Player not rendered correctly

Profile picture for user AltesisPro
AltesisPro
Hi, I was not able to trace this back into code. The "iframe" gets displaced after the quiz-question-naviagation-wrapper, resulting in an umpleasant render. As I said, I was not able to go back to the module implementing the bug. I can try and fix it if I am sent to the right module/function. Any help? Marco
Profile picture for user James Aparicio
James Aparicio

Hi AlterisPro,

Hi AlterisPro,

Do you mind posting an image?

The module is located inside profiles/opigno_lms/modules/opigno/opigno/modules/scorm

Best regards

Profile picture for user AltesisPro
AltesisPro

Reproduce SCORM BUG

http://www.altesis-pro.com/web/logo/OpignoSCORMBug.tiff The problem seem to be with the "iframe" being a form "item" and therefore being rendered with the wrong "#weight" property. I have attempted to regress to the quiz.module calling scorm-player--ui buto got lost in the form build process. My gut feeling is either give the navigation-wrapper a "#weight" of 10 and see what happens, or give the "iframe" a "#weight"of -1, whichever is easier. This supposes that the form array has the "#ordered" property set to false, or the render() will not take "#weight" into account.
Profile picture for user James Aparicio
James Aparicio

Hi AltesisPro

Hi AltesisPro

I see, thank you for your interest in Opigno. This issue is currently not very high on our priority.

Please let us know if you find a clean solution for this interface issue in the meanwhile

Best regards

Profile picture for user AltesisPro
AltesisPro

Sure,

Sure, could you help me reconstruct the call stack used to build the quiz form pelase? It would really help to know: 1) What hooks does your SCORM module impelment to intercept the quiz form build and inject the "iframe"? 2) Have you noticed the bug in other sites? 3) How come you did not assign a #weight property to your "item" (to knwo if it would conflict with something yo've done) Thanks
Profile picture for user James Aparicio
James Aparicio

Hi AltesisPro,

Hi AltesisPro,

Yes, we are aware of this issue.

What we do is create a specific field_formatter.

You can find the hook_field_formatter_view inside profiles/opigno_lms/modules/opigno/opigno/scorm/ui/opigno_scorm_ui.module

The template for the theme is located in profiles/opigno_lms/modules/opigno/opigno/scorm/ui/theme/opigno-scorm-ui--player.tpl.php

Best regards

Profile picture for user AltesisPro
AltesisPro

[solved]

Hi, it's a little hacky but it solved my problem. In ... /palton/template.php modify the function function platon_form_quiz_question_answering_form_alter on line 448-452 to become this: function platon_form_quiz_question_answering_form_alter(&$form, $form_state) { $form['navigation']['#prefix'] = ''; $form['navigation']['#weight'] = 10; $form['navigation']['#suffix'] = ''; It's related to the fact that you render the SCORM as .js in the #attached property of the form, which is IMHO a bit hacky. Since you are providnig content, it should go in the appropirate form field. HTH, Marco