module.js file

module.js file

by Kiran Sonawane -
Number of replies: 11

Hi,

 Use moodle 2.4

  In  module.js file contains the resizing of window code will be set.but where this file will call.

Average of ratings: -
In reply to Kiran Sonawane

Re: module.js file

by Matteo Scaramuccia -
Picture of Core developers Picture of Peer reviewers Picture of Plugin developers

Hi Kiran,
module.js is part of the Moodle Javascript Framework: you can read about it e.g. in http://docs.moodle.org/dev/How_to_create_a_YUI_3_module.

In the SCORM module everything start from here: https://github.com/moodle/moodle/blob/master/mod/scorm/player.php#L284. Whenever you load/refresh mod/scorm/player.php from your browser, M.mod_scorm.init() will be called and things will be registered (e.g. to be fired on events) and/or executed.

HTH,
Matteo

Average of ratings: Useful (1)
In reply to Matteo Scaramuccia

Re: module.js file

by Kiran Sonawane -

ok,thanks Matteo,

    Plz help me in SCORM pakage, When SCORM pkg runs then that scorm pkg window automatically resize means scome pkg width & height automatically fit with available size of window..this work said my boss.this scorm pkg runs that time my scorm pkg running window scollbar is there.not cut scorme pkg contains.I m very try but not success.not understand the code of that.

            

In reply to Kiran Sonawane

Re: module.js file

by Matteo Scaramuccia -
Picture of Core developers Picture of Peer reviewers Picture of Plugin developers

Hi Kiran,
if you can share your package (even a sample of the real one, just what needed to present the issue) I could, spare time permitted, try by myself (using FF or Chrome) to better understand what you're trying to do/solve.
It seems to me that your package tries to resize itself by its own, regardless what Moodle does when presenting the <iframe/> window for the content.

Matteo

Average of ratings: Useful (1)
In reply to Matteo Scaramuccia

Re: module.js file

by Kiran Sonawane -

Hii,

I use moodle 2.4.1 & scorm pkg 1.2,see the following img..that contains scorm pkg run..when we add the scorm pkg for any size it can display on fixed size.for giving new window.& i open that scorm pkg on new window.

Attachment untitled.JPG
In reply to Kiran Sonawane

Re: module.js file

by Matteo Scaramuccia -
Picture of Core developers Picture of Peer reviewers Picture of Plugin developers

Hi Kiran,
if your packages always contain one single item managing its own TOC, instead of trying to modify the Moodle SCORM Player/TOC code to fit the margins/sizes according to your requirements/constraints, you could configure the Activity to hide both TOC and navigation bar: Course structure displayHidden and Hide navigation buttons → Yes, see the docs at http://docs.moodle.org/24/en/SCORM_settings#Display_settings.

HTH,
Matteo

Average of ratings: Useful (1)
In reply to Matteo Scaramuccia

Re: module.js file

by Kiran Sonawane -

Thanks Matteo,

I see that settings but every time i have changed to every pkg suppose my one pakg width very large & other pakage small.so i avoid this always i add that socrm pkg its size will be automatically small or large to fit in available  window.its also portal on tablet or any screen size of monitor.

   I hide that navigaion bar..

Only ramain the resizeing window..but i cant find that solution.

In reply to Kiran Sonawane

Re: module.js file

by Matteo Scaramuccia -
Picture of Core developers Picture of Peer reviewers Picture of Plugin developers

Hi Kiran,
sorry but I do not have enough direct experience on this subject matter to drive you towards a solution able to fit with packages of different size other than working someway on module.js. Maybe (not sure if useful), you can play by your own even w/ the layout (CSS) using e.g. Firebug to discover the affected selectors.

Matteo

Average of ratings: Useful (1)
In reply to Matteo Scaramuccia

Re: module.js file

by Kiran Sonawane -

Hi,

  ya I changes in module.js file for scorm pkg.one more help needed In that scorm_object we can add how i can get that object size?means width & height? 

In reply to Kiran Sonawane

Re: module.js file

by Matteo Scaramuccia -
Picture of Core developers Picture of Peer reviewers Picture of Plugin developers

Hi Kiran,
you could try to change module.js as sampled below:

diff --git a/mod/scorm/module.js b/mod/scorm/module.js
index 03902fa..95b5bdd 100644
--- a/mod/scorm/module.js
+++ b/mod/scorm/module.js
@@ -195,7 +195,7 @@ M.mod_scorm.init = function(Y, hide_nav, hide_toc, toc_title, window_name, launc

             if (alsowidth) {
                 scorm_layout_widget.setStyle('width', '');
-                var newwidth = scorm_get_htmlelement_size('content', 'width');
+                var newwidth = scorm_get_htmlelement_size('scorm_content', 'width');
             }
             // make sure that the max width of the TOC doesn't go to far

@@ -534,7 +534,7 @@ M.mod_scorm.init = function(Y, hide_nav, hide_toc, toc_title, window_name, launc
         scorm_activate_item(scorm_first_url);

         // resizing
-        scorm_resize_layout(false);
+        scorm_resize_layout(true);

         // fix layout if window resized
         window.onresize = function() {

You need to add the logic to adjust the width using newwidth: mine is just a note quickly written to be as helpful as possible... you need to do it by your own - lacking of spare time and original content on my side.

HTH,
Matteo

 

Average of ratings: Useful (1)
In reply to Matteo Scaramuccia

Re: module.js file

by Kiran Sonawane -

Thanks Matteo,

      Its very useful for me.But in code what actually done.design one layout that content put the scorm_object & this layout will be resized called the function Scorm_frame resized I have no problem in that.But we can fit the orignal scorm pkg that shoud be reized in the layout where we can fit it.

In reply to Matteo Scaramuccia

Re: module.js file

by Kiran Sonawane -

Hiii,One more ques..

Y.YUI2.util.Dom.get('scorm_object')for using that we can get thescorm_object.

how we can add that scorm_object in Y.YUI2.util.Dom ?