How To / General

[Closed] Moodle Wrapper with a SCORM package.

  • Bruce Rick
  • Topic Author
  • Offline
  • Junior Member
  • Junior Member
More
11 years 2 months ago - 11 years 1 month ago #1 by Bruce Rick
I was working with the Moodle wrapper and SCORM packages. We set our SCORM packages to be opened up into a new window. Everything works perfectly as expected, but when the SCORM package is done and closed, the site comes back to the Moodle site, outside of the wrapper. Is there a setting that needs to be made here to keep it in the wrapper? Otherwise, the wrapper is working perfectly, even the auto height settings.

Thanks,
Bruce
Last edit: 11 years 1 month ago by Antonio DurĂ¡n.
The topic has been locked.
More
11 years 2 months ago #2 by Chris
Replied by Chris on topic Moodle Wrapper with a SCORM package.
Hi Bruce.

I am a little confused by the issue ... You open in a new window and run the package - OK no issue. But you close the package, do you mean you close the package or close the window? If you open in a new window, you would normally close off the new window when done and be left with the original window, which is a Joomla window. It sounds like you are closing the package and then having two windows open still. One Joomla and one Moodle. Is this correct?

Also, you wish to consider what URL is being used when opening the package in a new window? Is the URL link pointing directly to Moodle or is it a new Joomla window wrapped around the package? If the former, this would be logical that it returns to Moodle.
The topic has been locked.
  • Bruce Rick
  • Topic Author
  • Offline
  • Junior Member
  • Junior Member
More
11 years 2 months ago #3 by Bruce Rick
Replied by Bruce Rick on topic Moodle Wrapper with a SCORM package.
Chris,

What I meant is that you close the window. When the window closes, Moodle comes out of the wrapper at that point. The course is being tracked, and I've noticed this with Moodle, that when you have a SCORM package open in another window, when you close it, the original page gets redirected to a completed page for the SCORM, or something like that. At that point, it comes out of the wrapper. Since the course link is pointing to a SCORM course inside of Moodle, it's a direct link. It does not open up a new window inside of the wrapper, which is what we want anyway. I hope that helps explain it a bit.

Thanks,
Bruce
The topic has been locked.
More
11 years 2 months ago #4 by Chris
Replied by Chris on topic Moodle Wrapper with a SCORM package.
Thanks I understand your issue now and confirm the same behaviour.

Moodle has changed the way they close Popup windows with 2.7 I think as can be seen here
tracker.moodle.org/browse/MDL-43247

so that SCORM results are sent back to Moodle properly for tracking. Thus they are now forcing a parent window refresh.

We will need to look at this.
The topic has been locked.
  • Bruce Rick
  • Topic Author
  • Offline
  • Junior Member
  • Junior Member
More
11 years 2 months ago #5 by Bruce Rick
Replied by Bruce Rick on topic Moodle Wrapper with a SCORM package.
Okay, thank you for confirming the issue. I thought I was going crazy for a bit (may still be possible).

Thanks,
Bruce
The topic has been locked.
More
11 years 2 months ago #6 by Antonio DurĂ¡n
Replied by Antonio DurĂ¡n on topic Moodle Wrapper with a SCORM package.
I looked into it and, as expected, you cannot "fix" this without modifying Moodle core code (SCORM mod).

Files involved:
/mod/scorm/view.js

It gets course url from scorm object:
var course_url = scormplayerdata.courseurl;

Then it redirects there on pop up close:
if (winobj.closed) {
// Redirect the parent window to the course homepage.
parent.window.location = course_url;
}


Course URL is filled in:
/mod/scorm/view.php

$courseurl = course_get_url($course, $sectionid)->out(false);


What I did was:
- create new file: auth/joomdle/helper.php with these contents:

<?php

function joomdle_wrapper_course_get_url ($course)
{
$joomla_url = get_config ('auth/joomdle', 'joomla_url');
return $joomla_url . "/index.php?option=com_joomdle&view=wrapper&moodle_page_type=course&id=".$course->id;
}

?>


Then, modified /mod/scorm/view.php to call this function:
// $courseurl = course_get_url($course, $sectionid)->out(false);
require_once ($CFG->dirroot. '/auth/joomdle/helper.php');
$courseurl = joomdle_wrapper_course_get_url($course);


With these changes, I managed to get main window to redirect to course view inside Joomdle wrapper.
The topic has been locked.
  • Bruce Rick
  • Topic Author
  • Offline
  • Junior Member
  • Junior Member
More
11 years 2 months ago #7 by Bruce Rick
Replied by Bruce Rick on topic Moodle Wrapper with a SCORM package.
Thanks Antonio. I hate modifying the Moodle code, but if that is what it will take right now, I'm fine with that. I will document this information so that if we update Moodle we can jump back and re-add this in again.
The topic has been locked.
More
11 years 2 months ago #8 by Antonio DurĂ¡n
Replied by Antonio DurĂ¡n on topic Moodle Wrapper with a SCORM package.
Yes, I hate it too.. always try to find ways to do things without touching core code, but there are times that you can't help it if you want some things working as you need.
The topic has been locked.