Are IFRAMES still a necessity in a tracking SCORM SCO
Asked Answered
H

3

4

When building a SCORM solution from html and javascript where tracking with the LMS is required, is it still necessary to contain all pages in an IFRAME or are other approaches being adopted? What difficulties does working within an IFRAME present when trying to create responsive pages?

Halogen answered 3/7, 2015 at 8:19 Comment(4)
Is this question asking if the LMS launching the SCORM content must use frames or if the content itself must use frames? You have two answers, one for each interpretation of that question.Halvorsen
Its asking if the content itself must be wrapped in an iframe within the SCO package. For example in the scorm golf examples a main page contains an IFrame, and all other pages must be loaded into it.Halogen
Ok, in that case got for @Rycochet's answerHalvorsen
From a SCO perspective you can load pages in via AJAX. So template systems like handlebars, knockout, angular and more could be used to load in your layouts, pages etc. player on my site uses that approach. cybercussion.com. Your right though that IFRAME approach is dated.Rage
P
3

There's no need to use IFRAMES or OBJECTS to contain your SCORM content. The API is simply Javascript, and as long as it's all included in the page everything will work (the SCORM conformance reqs basically require you to look in your own frame, then any parent frames, then any parent window)...

Saying that - whatever platform you are using needs to allow you to have the content in there directly, and most simply put it into some sort of frame / window by default.

Pengelly answered 3/7, 2015 at 9:55 Comment(4)
Could you direct me to any examples online which do not use IFRAMES in a SCORM solution? The examples I am going on are the scorm golf scorm.com/scorm-explained/technical-scorm/golf-examples which use IFRAMES heavily. A related question I posted yesterday had an answer which suggested IFRAMES were necessary where multiple pages were used https://mcmap.net/q/1933492/-is-implementing-lms-scorm-tracking-without-an-authoring-package-feasible-for-a-beginner "if you use multiple pages, you will need to use iframes to prevent accidentally killing the API connection"Halogen
Sadly I don't think there are any examples. The problem with the API is that there can only ever be one init/exit pair - so if the content is in an iframe then only one iframe can be allowed to exist at a time (relatively easily worked around, but doubt anyone has). When it's part of the page content then it's only ever going to be one thing accessing the API, so that problem isn't as big. The server communication is the only thing that's not addressed via the old API (ie, the big change in Tin Can) - so that needs to be supplied in there.Pengelly
So in a solution comprised of multiple html pages with no iframe in any page.. can I utilize a javascript library/wrapper for SCORM 1.2 that will expose a single SCORM API "instance" which can be referenced in each page?Halogen
You can do - but you still need to have the actual scorm API itself available - I'm a big fan of wrappers, and any half-decent one will handle being within the same frame as the API itself - so just make sure the relevant javascript files for the platform are included.Pengelly
L
10

As the other posters mention, technically frames were never required, but they are by far the easiest and most reliable way to ensure the SCORM API remains available as you navigate between multiple pages.

If you don't use an iframe (maintaining the API connection in the parent frame), and the user navigates to the second page of your course, it will break the API connection and the course will no longer be able to communicate with the LMS.

The parent frame handles the communication with the LMS while the child frame contains the course content. The child frame (usually an iframe) can be maximized to fit the entire viewport, rendering the parent frame invisible and enabling the child frame to feel/behave as a single HTML page.

RE: Responsive layout, iframes are not a barrier to creating responsive layouts. We do it all the time. Set the iframe to take up 100% width/height of the parent frame (overflow: hidden on parent frame, overflow: auto on child frame so the scrollbars show up as desired). At this point, any responsive code you use within the iframe's HTML should work the same as it would if it were NOT in an iframe. For example, if you use a media query to stack elements when the viewport is small (eg a tablet or phone), the media query should fire just fine. SCORM has no impact on CSS, and the iframe's impact on your CSS/design is negligible if managed well.

iframes are a big part of modern web sites, and are part of the HTML5 spec; support for iframes is very robust across browsers and devices. Don't let it scare you.

Lanford answered 4/7, 2015 at 5:36 Comment(0)
P
3

There's no need to use IFRAMES or OBJECTS to contain your SCORM content. The API is simply Javascript, and as long as it's all included in the page everything will work (the SCORM conformance reqs basically require you to look in your own frame, then any parent frames, then any parent window)...

Saying that - whatever platform you are using needs to allow you to have the content in there directly, and most simply put it into some sort of frame / window by default.

Pengelly answered 3/7, 2015 at 9:55 Comment(4)
Could you direct me to any examples online which do not use IFRAMES in a SCORM solution? The examples I am going on are the scorm golf scorm.com/scorm-explained/technical-scorm/golf-examples which use IFRAMES heavily. A related question I posted yesterday had an answer which suggested IFRAMES were necessary where multiple pages were used https://mcmap.net/q/1933492/-is-implementing-lms-scorm-tracking-without-an-authoring-package-feasible-for-a-beginner "if you use multiple pages, you will need to use iframes to prevent accidentally killing the API connection"Halogen
Sadly I don't think there are any examples. The problem with the API is that there can only ever be one init/exit pair - so if the content is in an iframe then only one iframe can be allowed to exist at a time (relatively easily worked around, but doubt anyone has). When it's part of the page content then it's only ever going to be one thing accessing the API, so that problem isn't as big. The server communication is the only thing that's not addressed via the old API (ie, the big change in Tin Can) - so that needs to be supplied in there.Pengelly
So in a solution comprised of multiple html pages with no iframe in any page.. can I utilize a javascript library/wrapper for SCORM 1.2 that will expose a single SCORM API "instance" which can be referenced in each page?Halogen
You can do - but you still need to have the actual scorm API itself available - I'm a big fan of wrappers, and any half-decent one will handle being within the same frame as the API itself - so just make sure the relevant javascript files for the platform are included.Pengelly
H
1

This answer assumes the question means: 'Do iframes have to be used in the complete solution including the LMS and content?'

Remember that SCORM is now quite an old specification so wasn't designed with the modern world in mind. SCORM uses a JavaScript API and needs to have a parent-child relationship between the LMS window and the content. That means you have a choice of:

  • Pop-ups, which are blocked by default in many browsers.
  • Framesets, which are 'obsolete' and now longer supported in HTML5.
  • Iframes, which as you mentioned can cause problems for responsivity. See this stack overflow question for some suggestions.

The successor of SCORM, Tin Can API uses HTTP requests instead of a JavaScript API. With Tin Can, you can launch content in a new window, in the same window, on another device or however you like. Pop-ups and frames are not required.

If the question is 'Do I have to use iframes in my content?', the answer is no.

Halvorsen answered 3/7, 2015 at 9:40 Comment(3)
Can I target a SCORM 1.2 LMS using the tincan api and therefore avail of the http request mechanism?Halogen
No. The LMS must support Tin Can. There are ways to wrap Tin Can content in a SCORM package, but then you are hitting the same problem.Halvorsen
The question is specific to SCORM, bringing Tin Can into it is confusing the matter. Yes, Tin Can was designed to get around this stuff, but it doesn't answer the question.Lanford

© 2022 - 2024 — McMap. All rights reserved.