GithubHelp home page GithubHelp logo

Comments (7)

greatislander avatar greatislander commented on June 16, 2024 1

One way to do this: we can detect if a window is within an iframe using this JS snippet and add a class to the body that would let us supress certain items:

if ( window.top != window.self ) {
  // Window is within an iframe
} else {
  // Window is not within an iframe
}

from pressbooks-book.

connerbw avatar connerbw commented on June 16, 2024 1

The IMS' LTI library does this:

 $this->checkValue($_POST['launch_presentation_document_target'], ['embed', 'frame', 'iframe', 'window', 'popup', 'overlay'], ...)

From the spec: https://www.imsglobal.org/specs/ltiv1p2/implementation-guide

launch_presentation_document_target: This field communicates the kind of browser container into which the TC (LMS such as Moodle) has launched the tool. The TP (Pressbooks) can ignore this parameter and try to detect its environment through JavaScript, but this parameter gives the TP the information without requiring the use of JavaScript if the tool prefers. The possible values for this parameter are:

  • frame – opened in the same frame as the resource link;
  • iframe – opened within an iframe placed inside the same page/frame as the resource link;
  • window – opened in a new window (or tab);
  • popup – opened in a popup window;
  • overlay – opened over the top of the page where the link exists (for example, using a lightbox);
  • embed – the TP page is inserted directly into the TC page; this option is not expected to be a common use case but could be used, for example, when the launch request is performed on behalf of the user by the TC (server-to-server) and the response rendered within its page (e.g. within a portal-like interface).

We can set a value and pass it to Pressbooks based on this if needed.

from pressbooks-book.

beckej13820 avatar beckej13820 commented on June 16, 2024

Another thing Lumen's Bombadil theme does is limit what is in the header when appearing within an iframe. This is particularly important inside the Moodle LMS, because the iframe is so short on the page.

Screenshot 1- LTI link in Moodle to Pressbooks 5 site with theme book 2.0
screen shot 2018-03-04 at 2 42 19 pm

Screenshot 2- LTI link in Moodle to Lumen's Candela/Pressbook site with theme Bombadil
screen shot 2018-03-04 at 2 43 42 pm

Notice on Moodle 3.4 and later, there are Moodle tools that would allow the student to go back or move forward, so I might want to suppress Pressbooks' navigation, but if you work in the Blackboard ecosystem, there is not a convenient way to move from chapter to chapter, so you may want to keep the default back and forward buttons because it might actually be better/more convenient for the student to use Pressbooks navigation.
Screenshot 3- Blackboard integration with Lumen's Candela/Pressbooks site with theme Bombadil
screen shot 2018-03-04 at 2 51 45 pm

I don't mean to confuse the issue, but I just wanted to bring up two of the other major LMSs and how flexibility and the creation of just a few options would be the most helpful for good LTI integration.

from pressbooks-book.

beckej13820 avatar beckej13820 commented on June 16, 2024

Hey Dac,

I'm not sure if this is doing exactly what you think it is doing. Every LTI connection from an LMS, the system administrators set the default for this setting. So if we want to display content "inside our lms" so that it appears seamless to the students, we select iframe.

I don't know what kind of experience you have with LMSs, but if it would be helpful to see how this behaves from an LMS I have access to a Blackboard and Moodle so you could see what it looks like. Not every LMS has every option available, for example in the screenshot of Moodle below, I can only choose between embed, embed without blocks, existing window, and new tab.

Embed opens in an iframe, with or without blocks just refers to if the iframe has the full width of the page, or if there is a sidebar on the page. In a new window the students will navigate away from Moodle and not have access to the rest of the course tools, and new tab is the same thing but in new window. In Moodle the administrator sets up a default, but a teacher can override this based on their own preference.

screen shot 2018-04-25 at 6 10 38 pm

In Blackboard there are fewer options. Basically, as a teacher you can choose to open in a new window or not (iframe). There is no preset or default value that the administrator can set.

screen shot 2018-04-25 at 6 17 30 pm

from pressbooks-book.

connerbw avatar connerbw commented on June 16, 2024

An LMS (Consumer) that launches an LTI link will send back info to the Provider of how it is being used.

Among the info (who launched the link, their role, context info...) will be one of those 6 browser container types.

Blackboard supports 2 of the 6. Moodle supports 5 of the 6.

We'll have more on this in the upcoming weeks. I've been working on this :)

from pressbooks-book.

connerbw avatar connerbw commented on June 16, 2024

The spec (also) says:

"The TP (Tool Provider aka Pressbooks) can ignore this parameter and try to detect its environment through JavaScript,"

Maybe this will turn out to the best solution. I was just pointing out another option.

from pressbooks-book.

beckej13820 avatar beckej13820 commented on June 16, 2024

Great, sounds like you have this completely under control. If you need testers I'm sure you know there are lots of us that would help anyway we could.

from pressbooks-book.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.